Skip to content

Commit

Permalink
Merge branch 'yangx/lnd/bugfix_soilorder' into next (PR #1792)
Browse files Browse the repository at this point in the history
Fixes the reading of soilorder

Fixes #1793

[non-BFB]
  • Loading branch information
jqyin committed Oct 3, 2017
2 parents d6223a4 + 3c64b3c commit 3ff1350
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions components/clm/src/data_types/CNStateType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ module CNStateType
use ColumnType , only : col_pp
use VegetationType , only : veg_pp
use clm_varctl , only: forest_fert_exp
use clm_varctl , only : nu_com
use clm_varctl , only: use_ed,use_crop

!
! !PUBLIC TYPES:
implicit none
Expand Down Expand Up @@ -758,18 +761,24 @@ subroutine initCold(this, bounds)
! Read in soilorder data
! --------------------------------------------------------------------

allocate(soilorder_rdin(bounds%begg:bounds%endg))
!call ncd_io(ncid=ncid, varname='SOIL_ORDER', flag='read',data=soilorder_rdin, dim1name=grlnd, readvar=readvar)
!if (.not. readvar) then
! call endrun(msg=' ERROR: SOIL_ORDER NOT on surfdata file'//errMsg(__FILE__, __LINE__))
!end if
do c = bounds%begc, bounds%endc
g = col_pp%gridcell(c)
! this%isoilorder(c) = soilorder_rdin(g)
this%isoilorder(c) = 12
end do
deallocate(soilorder_rdin)
if ( (nu_com .eq. 'RD' .or. nu_com .eq. 'ECA') .and. (use_cn .and. .not. use_ed .and. .not. use_crop) ) then
allocate(soilorder_rdin(bounds%begg:bounds%endg))
call ncd_io(ncid=ncid, varname='SOIL_ORDER', flag='read',data=soilorder_rdin, dim1name=grlnd, readvar=readvar)
if (.not. readvar) then
call endrun(msg=' ERROR: SOIL_ORDER NOT on surfdata file'//errMsg(__FILE__, __LINE__))
end if
do c = bounds%begc, bounds%endc
g = col_pp%gridcell(c)
this%isoilorder(c) = soilorder_rdin(g)
end do
deallocate(soilorder_rdin)

else
do c = bounds%begc, bounds%endc
g = col_pp%gridcell(c)
this%isoilorder(c) = 12
end do
end if

! --------------------------------------------------------------------
! forest fertilization experiments info, Q. Z. 2017
Expand Down

0 comments on commit 3ff1350

Please sign in to comment.