Skip to content

Commit

Permalink
Remove soil columns on a seperate soil column as handled in ESCOMP#1249
Browse files Browse the repository at this point in the history
  • Loading branch information
ekluzek committed Feb 23, 2022
1 parent b0f2856 commit c7ade8d
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 100 deletions.
1 change: 0 additions & 1 deletion bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ attributes from the config_cache.xml file (with keys converted to upper-case).
<use_bedrock phys="clm5_0" vichydro ="1" >.false.</use_bedrock>
<use_bedrock phys="clm5_0" >.true.</use_bedrock>
<use_bedrock phys="clm4_5" >.false.</use_bedrock>
<use_individual_pft_soil_column>.false.</use_individual_pft_soil_column>

<!-- Rooting profile namelist defaults -->
<rooting_profile_method_water phys="clm5_1" >1</rooting_profile_method_water>
Expand Down
5 changes: 0 additions & 5 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,6 @@ User-defined number of soil layers required to be set in the namelist when the u
<default>Default: iundef</default>
</entry>

<entry id="use_individual_pft_soil_column" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If TRUE, each pft exists on a separate soil column.
</entry>

<entry id="use_bedrock" type="logical" category="clm_physics"
group="clm_inparm" valid_values="" >
If TRUE, use variable soil depth.
Expand Down
6 changes: 0 additions & 6 deletions src/main/clm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -293,12 +293,6 @@ module clm_varctl

logical, public :: use_biomass_heat_storage = .false. ! true => include biomass heat storage in canopy energy budget

!----------------------------------------------------------
! each pft has individual soil column switch
!----------------------------------------------------------

logical, public :: use_individual_pft_soil_column = .false. ! true => each pft exists on its own soil column

!----------------------------------------------------------
! bedrock / soil depth switch
!----------------------------------------------------------
Expand Down
4 changes: 0 additions & 4 deletions src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ subroutine control_init(dtime)
namelist /clm_inparm/ use_biomass_heat_storage


namelist /clm_inparm/ use_individual_pft_soil_column

namelist /clm_inparm/ use_hydrstress

namelist /clm_inparm/ use_dynroot
Expand Down Expand Up @@ -749,8 +747,6 @@ subroutine control_spmd()
call mpi_bcast (use_biomass_heat_storage, 1, MPI_LOGICAL, 0, mpicom, ier)


call mpi_bcast (use_individual_pft_soil_column, 1, MPI_LOGICAL, 0, mpicom, ier)

call mpi_bcast (use_hydrstress, 1, MPI_LOGICAL, 0, mpicom, ier)

call mpi_bcast (use_dynroot, 1, MPI_LOGICAL, 0, mpicom, ier)
Expand Down
76 changes: 4 additions & 72 deletions src/main/initGridCellsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ subroutine initGridcells(glc_behavior)
use subgridWeightsMod , only : compute_higher_order_weights
use landunit_varcon , only : istsoil, istwet, istdlak, istice_mec
use landunit_varcon , only : isturb_tbd, isturb_hd, isturb_md, istcrop
use clm_varctl , only : use_fates,use_individual_pft_soil_column
use clm_varctl , only : use_fates
use shr_const_mod , only : SHR_CONST_PI
!
! !ARGUMENTS:
Expand Down Expand Up @@ -133,13 +133,8 @@ subroutine initGridcells(glc_behavior)

! Determine naturally vegetated landunit
do gdc = bounds_clump%begg,bounds_clump%endg
if(use_individual_pft_soil_column) then
call set_landunit_veg_noncompete( &
ltype=istsoil, gi=gdc, li=li, ci=ci, pi=pi)
else
call set_landunit_veg_compete( &
ltype=istsoil, gi=gdc, li=li, ci=ci, pi=pi)
end if
call set_landunit_veg_compete( &
ltype=istsoil, gi=gdc, li=li, ci=ci, pi=pi)
end do

! Determine crop landunit
Expand Down Expand Up @@ -249,7 +244,7 @@ subroutine set_landunit_veg_compete (ltype, gi, li, ci, pi)
! Set decomposition properties

call subgrid_get_info_natveg(gi, &
npatches=npatches, ncols=ncols, nlunits=nlunits, sesc=.FALSE.)
npatches=npatches, ncols=ncols, nlunits=nlunits)
wtlunit2gcell = wt_lunit(gi, ltype)

nlunits_added = 0
Expand Down Expand Up @@ -279,69 +274,6 @@ subroutine set_landunit_veg_compete (ltype, gi, li, ci, pi)
end subroutine set_landunit_veg_compete


subroutine set_landunit_veg_noncompete (ltype, gi, li, ci, pi)


! !DESCRIPTION:
! Initialize vegetated landunit without competition
!
! !USES
use clm_instur, only : wt_lunit, wt_nat_patch
use subgridMod, only : subgrid_get_info_natveg, natveg_patch_exists
use clm_varpar, only : natpft_lb, natpft_ub
!
! !ARGUMENTS:
integer , intent(in) :: ltype ! landunit type
integer , intent(in) :: gi ! gridcell index
integer , intent(inout) :: li ! landunit index
integer , intent(inout) :: ci ! column index
integer , intent(inout) :: pi ! patch index
!
! !LOCAL VARIABLES:
integer :: m ! index
integer :: npatches ! number of patches in landunit
integer :: ncols
integer :: nlunits
integer :: npatches_added ! number of patches actually added
integer :: ncols_added ! number of columns actually added
integer :: nlunits_added ! number of landunits actually added
real(r8) :: wtlunit2gcell ! landunit weight in gridcell
!------------------------------------------------------------------------

! Set decomposition properties

call subgrid_get_info_natveg(gi, &
npatches=npatches, ncols=ncols, nlunits=nlunits, sesc=.TRUE.)
wtlunit2gcell = wt_lunit(gi, ltype)

nlunits_added = 0
ncols_added = 0
npatches_added = 0

if (nlunits > 0) then
call add_landunit(li=li, gi=gi, ltype=ltype, wtgcell=wtlunit2gcell)
nlunits_added = nlunits_added + 1


do m = natpft_lb,natpft_ub
if (natveg_patch_exists(gi, m)) then
! Assume one column for each vegetation patch
call add_column(ci=ci, li=li, ctype=1, wtlunit=wt_nat_patch(gi,m))
ncols_added = ncols_added + 1

call add_patch(pi=pi, ci=ci, ptype=m, wtcol=1.0_r8)
npatches_added = npatches_added + 1
end if
end do
end if

SHR_ASSERT_FL(nlunits_added == nlunits, sourcefile, __LINE__)
SHR_ASSERT_FL(ncols_added == ncols, sourcefile, __LINE__)
SHR_ASSERT_FL(npatches_added == npatches, sourcefile, __LINE__)

end subroutine set_landunit_veg_noncompete


!------------------------------------------------------------------------
subroutine set_landunit_wet_lake (ltype, gi, li, ci, pi)
!
Expand Down
17 changes: 5 additions & 12 deletions src/main/subgridMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module subgridMod
use shr_kind_mod , only : r8 => shr_kind_r8
use spmdMod , only : masterproc
use abortutils , only : endrun
use clm_varctl , only : iulog,use_individual_pft_soil_column
use clm_varctl , only : iulog
use clm_instur , only : wt_lunit, wt_nat_patch, urban_valid, wt_cft
use landunit_varcon, only : istcrop, istdlak, istwet, isturb_tbd, isturb_hd, isturb_md
use glcBehaviorMod , only : glc_behavior_type
Expand Down Expand Up @@ -81,7 +81,7 @@ subroutine subgrid_get_gcellinfo (gi, glc_behavior, &
nlunits = 0
ncohorts = 0

call subgrid_get_info_natveg(gi, npatches_temp, ncols_temp, nlunits_temp, use_individual_pft_soil_column)
call subgrid_get_info_natveg(gi, npatches_temp, ncols_temp, nlunits_temp)
call accumulate_counters()

call subgrid_get_info_urban_tbd(gi, npatches_temp, ncols_temp, nlunits_temp)
Expand Down Expand Up @@ -123,7 +123,7 @@ end subroutine accumulate_counters
end subroutine subgrid_get_gcellinfo

!-----------------------------------------------------------------------
subroutine subgrid_get_info_natveg(gi, npatches, ncols, nlunits, sesc)
subroutine subgrid_get_info_natveg(gi, npatches, ncols, nlunits)
!
! !DESCRIPTION:
! Obtain properties for natural vegetated landunit in this grid cell
Expand All @@ -133,7 +133,6 @@ subroutine subgrid_get_info_natveg(gi, npatches, ncols, nlunits, sesc)
!
! !ARGUMENTS:
integer, intent(in) :: gi ! grid cell index
logical, intent(in) :: sesc ! switch for separated soil columns of natural vegetation

integer, intent(out) :: npatches ! number of nat veg patches in this grid cell
integer, intent(out) :: ncols ! number of nat veg columns in this grid cell
Expand All @@ -154,14 +153,8 @@ subroutine subgrid_get_info_natveg(gi, npatches, ncols, nlunits, sesc)
end do

if (npatches > 0) then
if(sesc) then
! Assume one soil column for each patch
ncols = npatches
else
! Assume that the vegetated landunit has one column
ncols = 1
end if

! Assume that the vegetated landunit has one column
ncols = 1
nlunits = 1
else
! As noted in natveg_patch_exists, we expect a naturally vegetated landunit in
Expand Down

0 comments on commit c7ade8d

Please sign in to comment.