Skip to content

Commit

Permalink
Merge branch 'thorntonpe/lnd/IM3_testing_2'(PR #6607)
Browse files Browse the repository at this point in the history
Change handling for how snow burial of shrubs is calculated, with parameterization for bending of stems.
Change the treatment of surface weather downscaling on topounits, so that the downscaling happens when using the coupler bypass code branch.
Introduce four new parameters controlling the burial of shrubs by snow into vegetation physiology file.
If new parameters are not included on the physiology file the code replaces with default values, which then produce BFB results with code before this PR.
The four new parameters are: taper, stocking, bendresist, and vegshape.
Development Lead: Rich Fiorella rfiorella@lanl.gov
Development Team: Katrina Bennett kbennett@lnl.gov, Cade Trotter ctrotter@lanl.gov, Claire Bachand cbachand@lanl.gov

[BFB]
  • Loading branch information
peterdschwartz committed Oct 8, 2024
2 parents 5130bd1 + 3cb0e38 commit 4b85dbe
Show file tree
Hide file tree
Showing 21 changed files with 1,065 additions and 446 deletions.
5 changes: 3 additions & 2 deletions cime_config/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
"ERS.f19_g16.I20TRGSWCNPECACNTBC.elm-eca_f19_g16_I20TRGSWCNPECACNTBC",
"ERS.f19_g16.I20TRGSWCNPRDCTCBC.elm-ctc_f19_g16_I20TRGSWCNPRDCTCBC",
"ERS.r05_r05.ICNPRDCTCBC.elm-cbudget",
"ERS.ELM_USRDAT.I1850CNPRDCTCBC.elm-snowveg_arctic",
"ERS.ELM_USRDAT.I1850CNPRDCTCBC.elm-usrpft_default_I1850CNPRDCTCBC",
"ERS.ELM_USRDAT.I1850CNPRDCTCBC.elm-usrpft_codetest_I1850CNPRDCTCBC",
)
},

Expand Down Expand Up @@ -94,8 +97,6 @@
"SMS.r05_r05.IELM.elm-topounit",
"ERS.ELM_USRDAT.I1850ELM.elm-usrdat",
"ERS.r05_r05.IELM.elm-lnd_rof_2way",
"ERS.ELM_USRDAT.I1850CNPRDCTCBC.elm-usrpft_default_I1850CNPRDCTCBC",
"ERS.ELM_USRDAT.I1850CNPRDCTCBC.elm-usrpft_codetest_I1850CNPRDCTCBC",
"ERS.r05_r05.IELM.elm-V2_ELM_MOSART_features",
"ERS.ELM_USRDAT.IELM.elm-surface_water_dynamics"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
./xmlchange LND_DOMAIN_FILE=domain_42_FLUXNETSITES_simyr1850_c170912.nc
./xmlchange ATM_DOMAIN_FILE=domain_42_FLUXNETSITES_simyr1850_c170912.nc
./xmlchange LND_DOMAIN_PATH="\$DIN_LOC_ROOT/share/domains/domain.clm"
./xmlchange ATM_DOMAIN_PATH="\$DIN_LOC_ROOT/share/domains/domain.clm"
./xmlchange DATM_MODE=CLM1PT
./xmlchange DATM_CLMNCEP_YR_START=2000
./xmlchange DATM_CLMNCEP_YR_END=2000
./xmlchange ELM_USRDAT_NAME=42_FLUXNETSITES
./xmlchange NTASKS=1
./xmlchange NTHRDS=1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fsurdat = '$DIN_LOC_ROOT/lnd/clm2/surfdata_map/surfdata_42_FLUXNETSITES_simyr1850_c170912.nc'
! this test has a parameter file with four new parameters defined for NGEE Arctic IM3
! meant to improve snow-vegetation interactions.
! bendresist -> varies between 0 and 1, represents how much vegetation bends under snow loading
! vegshape -> suggested value 1 (parabolic), but 2 also used previously (Liston and Heimstra, 2011)
! taper -> deadstem height/radius ratio, moved from hardcoded in VegStructUpdateMod to pftvarcon
! stocking -> individual density on landscape (plants/m2), moved from hardcoded in VegStructUpdateMod to pftvarcon
paramfile = '$DIN_LOC_ROOT/lnd/clm2/paramdata/clm_params_ngeea-im3_c240822.nc'
276 changes: 138 additions & 138 deletions components/elm/src/biogeochem/AllocationMod.F90

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions components/elm/src/biogeochem/CNAllocationBetrMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ module CNAllocationBeTRMod
use PhotosynthesisType , only : photosyns_type
use CropType , only : crop_type
use VegetationPropertiesType, only : veg_vp
use LandunitType , only : lun_pp
use LandunitType , only : lun_pp
use ColumnType , only : col_pp
use ColumnDataType , only : col_cf, col_ns, col_nf, col_ps, col_pf
use ColumnDataType , only : col_cf, col_ns, col_nf, col_ps, col_pf
use VegetationType , only : veg_pp
use VegetationDataType , only : veg_cs, veg_ns, veg_nf, veg_ps, veg_pf
use VegetationDataType , only : veg_cf, c13_veg_cf, c14_veg_cf
use VegetationDataType , only : veg_cf, c13_veg_cf, c14_veg_cf

! bgc interface & pflotran module switches
use elm_varctl , only : nu_com
use SoilStatetype , only : soilstate_type
Expand Down Expand Up @@ -359,7 +359,7 @@ subroutine Allocation1_PlantNPDemand (bounds, num_soilc, filter_soilc, num_soilp
associate( &
ivt => veg_pp%itype , & ! Input: [integer (:) ] pft vegetation type

woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)
froot_leaf => veg_vp%froot_leaf , & ! Input: [real(r8) (:) ] allocation parameter: new fine root C per new leaf C (gC/gC)
croot_stem => veg_vp%croot_stem , & ! Input: [real(r8) (:) ] allocation parameter: new coarse root C per new stem C (gC/gC)
stem_leaf => veg_vp%stem_leaf , & ! Input: [real(r8) (:) ] allocation parameter: new stem c per new leaf C (gC/gC)
Expand Down Expand Up @@ -1167,7 +1167,7 @@ subroutine Allocation3_PlantCNPAlloc (bounds , &
associate( &
ivt => veg_pp%itype , & ! Input: [integer (:) ] pft vegetation type
!
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)
froot_leaf => veg_vp%froot_leaf , & ! Input: [real(r8) (:) ] allocation parameter: new fine root C per new leaf C (gC/gC)
croot_stem => veg_vp%croot_stem , & ! Input: [real(r8) (:) ] allocation parameter: new coarse root C per new stem C (gC/gC)
stem_leaf => veg_vp%stem_leaf , & ! Input: [real(r8) (:) ] allocation parameter: new stem c per new leaf C (gC/gC)
Expand Down
8 changes: 4 additions & 4 deletions components/elm/src/biogeochem/CNGapMortalityBeTRMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ module CNGapMortalityBeTRMod
use ColumnType , only : col_pp
use ColumnDataType , only : col_cf, col_nf, col_pf
use VegetationPropertiesType , only : veg_vp
use VegetationType , only : veg_pp
use VegetationDataType , only : veg_cs, veg_cf, veg_ns, veg_nf
use VegetationDataType , only : veg_ps, veg_pf
use VegetationType , only : veg_pp
use VegetationDataType , only : veg_cs, veg_cf, veg_ns, veg_nf
use VegetationDataType , only : veg_ps, veg_pf

use PhosphorusFluxType , only : phosphorusflux_type
use PhosphorusStateType , only : phosphorusstate_type
Expand Down Expand Up @@ -121,7 +121,7 @@ subroutine CNGapMortality (&
associate( &
ivt => veg_pp%itype , & ! Input: [integer (:) ] pft vegetation type

woody => veg_vp%woody & ! Input: [real(r8) (:) ] binary flag for woody lifeform
woody => veg_vp%woody & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)
)

! set the mortality rate based on annual rate
Expand Down
2 changes: 1 addition & 1 deletion components/elm/src/biogeochem/CNNStateUpdate1BeTRMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ subroutine NStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp, &
associate( &
ivt => veg_pp%itype , & ! Input: [integer (:) ] pft vegetation type

woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)

cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Input: [integer (:) ] which pool is C taken from for a given decomposition step
cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Input: [integer (:) ] which pool is C added to for a given decomposition step
Expand Down
8 changes: 4 additions & 4 deletions components/elm/src/biogeochem/CNPhenologyBeTRMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ subroutine CNSeasonDecidPhenology (num_soilp, filter_soilp , &
prev_dayl => grc_pp%prev_dayl , & ! Input: [real(r8) (:) ] daylength from previous time step (s)

season_decid => veg_vp%season_decid , & ! Input: [real(r8) (:) ] binary flag for seasonal-deciduous leaf habit (0 or 1)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)

t_soisno => col_es%t_soisno , & ! Input: [real(r8) (:,:) ] soil temperature (Kelvin) (-nlevsno+1:nlevgrnd)

Expand Down Expand Up @@ -875,7 +875,7 @@ subroutine CNStressDecidPhenology (num_soilp, filter_soilp , &
dayl => grc_pp%dayl , & ! Input: [real(r8) (:) ] daylength (s)

leaf_long => veg_vp%leaf_long , & ! Input: [real(r8) (:) ] leaf longevity (yrs)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)
stress_decid => veg_vp%stress_decid , & ! Input: [real(r8) (:) ] binary flag for stress-deciduous leaf habit (0 or 1)

soilpsi => soilstate_vars%soilpsi_col , & ! Input: [real(r8) (:,:) ] soil water potential in each soil layer (MPa)
Expand Down Expand Up @@ -2295,7 +2295,7 @@ subroutine CNOnsetGrowth (num_soilp, filter_soilp, &
associate( &
ivt => veg_pp%itype , & ! Input: [integer (:) ] pft vegetation type

woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)

onset_flag => cnstate_vars%onset_flag_patch , & ! Input: [real(r8) (:) ] onset flag
onset_counter => cnstate_vars%onset_counter_patch , & ! Input: [real(r8) (:) ] onset days counter
Expand Down Expand Up @@ -2880,7 +2880,7 @@ subroutine CNLivewoodTurnover (num_soilp, filter_soilp, &
associate( &
ivt => veg_pp%itype , & ! Input: [integer (:) ] pft vegetation type

woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)
livewdcn => veg_vp%livewdcn , & ! Input: [real(r8) (:) ] live wood (phloem and ray parenchyma) C:N (gC/gN)
deadwdcn => veg_vp%deadwdcn , & ! Input: [real(r8) (:) ] dead wood (xylem and heartwood) C:N (gC/gN)

Expand Down
2 changes: 1 addition & 1 deletion components/elm/src/biogeochem/CarbonStateUpdate1Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ subroutine CarbonStateUpdate1(bounds, &

associate( &
ivt => veg_pp%itype , & ! Input: [integer (:) ] pft vegetation type
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)
cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Input: [integer (:) ] which pool is C taken from for a given decomposition step
cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Input: [integer (:) ] which pool is C added to for a given decomposition step
harvdate => crop_vars%harvdate_patch & ! Input: [integer (:) ] harvest date
Expand Down
4 changes: 2 additions & 2 deletions components/elm/src/biogeochem/GrowthRespMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ subroutine GrowthResp(num_soilp, filter_soilp)
associate( &
ivt => veg_pp%itype , & ! Input: [integer (:)] pft vegetation type

woody => veg_vp%woody , & ! Input: [real(r8) (:)] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:)] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)

cpool_to_leafc => veg_cf%cpool_to_leafc , & ! Input: [real(r8) (:)]
cpool_to_leafc_storage => veg_cf%cpool_to_leafc_storage , & ! Input: [real(r8) (:)]
Expand Down Expand Up @@ -98,7 +98,7 @@ subroutine GrowthResp(num_soilp, filter_soilp)
)

! Loop through patches
! start pft loop
! start pft loop
do fp = 1,num_soilp

p = filter_soilp(fp)
Expand Down
6 changes: 3 additions & 3 deletions components/elm/src/biogeochem/MaintenanceRespMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ subroutine readMaintenanceRespParams ( ncid )
call ncd_io(varname=trim(tString),data=tempr, flag='read', ncid=ncid, readvar=readv)
if ( .not. readv ) call endrun(msg=trim(errCode)//trim(tString)//errMsg(__FILE__, __LINE__))
br_mr_Inst = tempr

end subroutine readMaintenanceRespParams

!-----------------------------------------------------------------------
Expand Down Expand Up @@ -107,7 +107,7 @@ subroutine MaintenanceResp(bounds, &

associate( &
ivt => veg_pp%itype , & ! Input: [integer (:) ] patch vegetation type
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)
br_xr => veg_vp%br_xr , & ! Input: [real(r8) (:) ] base rate for excess respiration
frac_veg_nosno => canopystate_vars%frac_veg_nosno_patch , & ! Input: [integer (:) ] fraction of vegetation not covered by snow (0 OR 1) [-]
laisun => canopystate_vars%laisun_patch , & ! Input: [real(r8) (:) ] sunlit projected leaf area index
Expand Down Expand Up @@ -160,7 +160,7 @@ subroutine MaintenanceResp(bounds, &
! calculate temperature corrections for each soil layer, for use in
! estimating fine root maintenance respiration with depth
tcsoi(c,j) = Q10**((t_soisno(c,j)-SHR_CONST_TKFRZ - 20.0_r8)/10.0_r8)

end do
end do

Expand Down
10 changes: 5 additions & 5 deletions components/elm/src/biogeochem/NitrogenStateUpdate1Mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ subroutine NitrogenStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp
associate( &
ivt => veg_pp%itype , & ! Input: [integer (:) ] pft vegetation type

woody => veg_vp%woody , & ! Input: [real(r8) (:) ] binary flag for woody lifeform (1=woody, 0=not woody)
woody => veg_vp%woody , & ! Input: [real(r8) (:) ] woody lifeform flag (0 = non-woody, 1 = tree, 2 = shrub)

cascade_donor_pool => decomp_cascade_con%cascade_donor_pool , & ! Input: [integer (:) ] which pool is C taken from for a given decomposition step
cascade_receiver_pool => decomp_cascade_con%cascade_receiver_pool , & ! Input: [integer (:) ] which pool is C added to for a given decomposition step
Expand All @@ -147,7 +147,7 @@ subroutine NitrogenStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp
do j = 1, nlevdecomp
do fc = 1,num_soilc
c = filter_soilc(fc)

! N deposition and fixation (put all into NH4 pool)
col_ns%smin_nh4_vr(c,j) = col_ns%smin_nh4_vr(c,j) + col_nf%ndep_to_sminn(c)*dt * ndep_prof(c,j)
col_ns%smin_nh4_vr(c,j) = col_ns%smin_nh4_vr(c,j) + col_nf%nfix_to_sminn(c)*dt * nfixation_prof(c,j)
Expand Down Expand Up @@ -219,7 +219,7 @@ subroutine NitrogenStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp
end do
end if
end do

do j = 1, nlevdecomp
! column loop
do fc = 1,num_soilc
Expand Down Expand Up @@ -254,8 +254,8 @@ subroutine NitrogenStateUpdate1(num_soilc, filter_soilc, num_soilp, filter_soilp

end do ! end of column loop
end do
endif !end if is_active_betr_bgc

endif !end if is_active_betr_bgc

! forest fertilization
call get_curr_date(kyr, kmo, kda, mcsec)
Expand Down
Loading

0 comments on commit 4b85dbe

Please sign in to comment.