Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple updates to drought deciduous phenology #801

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
229b5dc
Added LAI by size class and PFT to the list of output variables.
mpaiao Aug 13, 2021
d44620c
A few bug fixes and updates in carbon allocation (see issue #784).
mpaiao Oct 30, 2021
9ee0831
First set of changes in the drought deciduous phenology to improve it…
mpaiao Oct 30, 2021
3ebf2b9
Merge branch 'master' into carbon-alloc
mpaiao Oct 30, 2021
1df54a4
Merge branch 'master' into drgt-decid
mpaiao Oct 30, 2021
cf6b05b
Updated reproduction, the routine had not been updated with the new d…
mpaiao Nov 1, 2021
aabf4fe
Merge branch 'drgt-decid' of https://github.com/mpaiao/fates into drg…
mpaiao Nov 1, 2021
4eba25f
Added option (hlm_parteh_mode = 0) to use the simpler carbon allocati…
mpaiao Nov 3, 2021
45f5584
Merge branch 'carbon-alloc' into drgt-decid
mpaiao Nov 3, 2021
40bb0cc
Merge branch 'carbon-alloc' of https://github.com/mpaiao/fates into c…
mpaiao Nov 3, 2021
089bf23
Resolved conflict that I had forgotten to resolve.
mpaiao Nov 3, 2021
befe169
Merge branch 'carbon-alloc' into drgt-decid
mpaiao Nov 3, 2021
944455a
Fixed ctrl-c ctrl-v mistake when resolving conflicts (sigh).
mpaiao Nov 3, 2021
b98a3db
Merge branch 'carbon-alloc' into drgt-decid
mpaiao Nov 3, 2021
0ad213d
Deleted if statement that was replaced with select case (sigh again).
mpaiao Nov 3, 2021
ff3fa95
Merge branch 'carbon-alloc' into drgt-decid
mpaiao Nov 3, 2021
d653c83
Fixing another typo in PRTParamsFATESMod.F90 (forgot to replace end i…
mpaiao Nov 3, 2021
9e0896f
Merge branch 'carbon-alloc' into drgt-decid
mpaiao Nov 3, 2021
80377eb
Revised soil water stress tracking for drought deciduous.
mpaiao Nov 11, 2021
f3643aa
Added option for semi-drought deciduous, similar to the ED2 drought d…
mpaiao Feb 15, 2022
a97fb77
Merge branch 'mainline' into drgt-decid
mpaiao Apr 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 66 additions & 18 deletions biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ module EDCohortDynamicsMod
use FatesAllometryMod , only : tree_lai, tree_sai
use FatesAllometryMod , only : set_root_fraction
use PRTGenericMod, only : prt_carbon_allom_hyp
use PRTGenericMod, only : prt_csimpler_allom_hyp
use PRTGenericMod, only : prt_cnp_flex_allom_hyp
use PRTGenericMod, only : prt_vartypes
use PRTGenericMod, only : all_carbon_elements
Expand All @@ -85,14 +86,21 @@ module EDCohortDynamicsMod
use PRTGenericMod, only : SetState

use PRTAllometricCarbonMod, only : callom_prt_vartypes
use PRTAllometricCarbonMod, only : csimpler_allom_prt_vartypes
use PRTAllometricCarbonMod, only : ac_bc_inout_id_netdc
use PRTAllometricCarbonMod, only : ac_bc_in_id_pft
use PRTAllometricCarbonMod, only : ac_bc_in_id_ctrim
use PRTAllometricCarbonMod, only : ac_bc_inout_id_dbh
use PRTAllometricCarbonMod, only : ac_bc_in_id_lstat
use PRTAllometricCarbonMod, only : ac_bc_in_id_efleaf
use PRTAllometricCarbonMod, only : ac_bc_in_id_effnrt
use PRTAllometricCarbonMod, only : ac_bc_in_id_efstem
use PRTAllometricCNPMod, only : cnp_allom_prt_vartypes
use PRTAllometricCNPMod, only : acnp_bc_in_id_pft, acnp_bc_in_id_ctrim
use PRTAllometricCNPMod, only : acnp_bc_in_id_lstat, acnp_bc_inout_id_dbh
use PRTAllometricCNPMod, only : acnp_bc_in_id_efleaf
use PRTAllometricCNPMod, only : acnp_bc_in_id_effnrt
use PRTAllometricCNPMod, only : acnp_bc_in_id_efstem
use PRTAllometricCNPMod, only : acnp_bc_inout_id_rmaint_def, acnp_bc_in_id_netdc
use PRTAllometricCNPMod, only : acnp_bc_in_id_netdnh4, acnp_bc_in_id_netdno3, acnp_bc_in_id_netdp
use PRTAllometricCNPMod, only : acnp_bc_out_id_cefflux, acnp_bc_out_id_nefflux
Expand Down Expand Up @@ -147,8 +155,9 @@ module EDCohortDynamicsMod


subroutine create_cohort(currentSite, patchptr, pft, nn, hite, coage, dbh, &
prt, laimemory, sapwmemory, structmemory, &
status, recruitstatus,ctrim, carea, clayer, spread, bc_in)
prt, leafmemory, fnrtmemory, sapwmemory, structmemory, &
elongf_leaf, elongf_fnrt, elongf_stem, status, &
recruitstatus, ctrim, carea, clayer, spread, bc_in)
!
! !DESCRIPTION:
! create new cohort
Expand All @@ -171,17 +180,25 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, coage, dbh, &
integer, intent(in) :: clayer ! canopy status of cohort
! (1 = canopy, 2 = understorey, etc.)
integer, intent(in) :: status ! growth status of plant
! (2 = leaves on , 1 = leaves off)
! (1 = abscissing, 2 = flushing)
integer, intent(in) :: recruitstatus ! recruit status of plant
! (1 = recruitment , 0 = other)
real(r8), intent(in) :: nn ! number of individuals in cohort
! per 'area' (10000m2 default)
real(r8), intent(in) :: hite ! height: meters
real(r8), intent(in) :: coage ! cohort age in years
real(r8), intent(in) :: dbh ! dbh: cm
real(r8), intent(in) :: elongf_leaf ! leaf elongation factor (fraction)
real(r8), intent(in) :: elongf_fnrt ! fine-root "elongation factor" (fraction)
real(r8), intent(in) :: elongf_stem ! stem "elongation factor" (fraction)
! For all elongation factors:
! 0 means fully abscissed
! 1 means fully flushed
class(prt_vartypes),target :: prt ! The allocated PARTEH
! object
real(r8), intent(in) :: laimemory ! target leaf biomass- set from
real(r8), intent(in) :: leafmemory ! target leaf biomass- set from
! previous year: kGC per indiv
real(r8), intent(in) :: fnrtmemory ! target fine root biomass- set from
! previous year: kGC per indiv
real(r8), intent(in) :: sapwmemory ! target sapwood biomass- set from
! previous year: kGC per indiv
Expand Down Expand Up @@ -230,14 +247,18 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, coage, dbh, &

new_cohort%pft = pft
new_cohort%status_coh = status
new_cohort%efleaf_coh = elongf_leaf
new_cohort%effnrt_coh = elongf_fnrt
new_cohort%efstem_coh = elongf_stem
new_cohort%n = nn
new_cohort%hite = hite
new_cohort%dbh = dbh
new_cohort%coage = coage
new_cohort%canopy_trim = ctrim
new_cohort%canopy_layer = clayer
new_cohort%canopy_layer_yesterday = real(clayer, r8)
new_cohort%laimemory = laimemory
new_cohort%leafmemory = leafmemory
new_cohort%fnrtmemory = fnrtmemory
new_cohort%sapwmemory = sapwmemory
new_cohort%structmemory = structmemory

Expand Down Expand Up @@ -400,7 +421,7 @@ subroutine InitPRTBoundaryConditions(new_cohort)


select case(hlm_parteh_mode)
case (prt_carbon_allom_hyp)
case (prt_csimpler_allom_hyp,prt_carbon_allom_hyp)

! Register boundary conditions for the Carbon Only Allometric Hypothesis

Expand All @@ -409,12 +430,18 @@ subroutine InitPRTBoundaryConditions(new_cohort)
call new_cohort%prt%RegisterBCIn(ac_bc_in_id_pft,bc_ival = new_cohort%pft)
call new_cohort%prt%RegisterBCIn(ac_bc_in_id_ctrim,bc_rval = new_cohort%canopy_trim)
call new_cohort%prt%RegisterBCIn(ac_bc_in_id_lstat,bc_ival = new_cohort%status_coh)
call new_cohort%prt%RegisterBCIn(ac_bc_in_id_efleaf,bc_rval = new_cohort%efleaf_coh)
call new_cohort%prt%RegisterBCIn(ac_bc_in_id_effnrt,bc_rval = new_cohort%effnrt_coh)
call new_cohort%prt%RegisterBCIn(ac_bc_in_id_efstem,bc_rval = new_cohort%efstem_coh)

case (prt_cnp_flex_allom_hyp)

call new_cohort%prt%RegisterBCIn(acnp_bc_in_id_pft,bc_ival = new_cohort%pft)
call new_cohort%prt%RegisterBCIn(acnp_bc_in_id_ctrim,bc_rval = new_cohort%canopy_trim)
call new_cohort%prt%RegisterBCIn(acnp_bc_in_id_lstat,bc_ival = new_cohort%status_coh)
call new_cohort%prt%RegisterBCIn(acnp_bc_in_id_efleaf,bc_rval = new_cohort%efleaf_coh)
call new_cohort%prt%RegisterBCIn(acnp_bc_in_id_effnrt,bc_rval = new_cohort%effnrt_coh)
call new_cohort%prt%RegisterBCIn(acnp_bc_in_id_efstem,bc_rval = new_cohort%efstem_coh)
call new_cohort%prt%RegisterBCIn(acnp_bc_in_id_netdc, bc_rval = new_cohort%npp_acc)
call new_cohort%prt%RegisterBCIn(acnp_bc_in_id_netdnh4, bc_rval = new_cohort%daily_nh4_uptake)
call new_cohort%prt%RegisterBCIn(acnp_bc_in_id_netdno3, bc_rval = new_cohort%daily_no3_uptake)
Expand Down Expand Up @@ -463,10 +490,16 @@ subroutine InitPRTObject(prt)

! Potential Extended types
class(callom_prt_vartypes), pointer :: c_allom_prt
class(csimpler_allom_prt_vartypes), pointer :: csimpler_allom_prt
class(cnp_allom_prt_vartypes), pointer :: cnp_allom_prt


select case(hlm_parteh_mode)
case (prt_csimpler_allom_hyp)

allocate(csimpler_allom_prt)
prt => csimpler_allom_prt

case (prt_carbon_allom_hyp)

allocate(c_allom_prt)
Expand Down Expand Up @@ -530,7 +563,10 @@ subroutine nan_cohort(cc_p)
currentCohort%canopy_layer = fates_unset_int ! canopy status of cohort (1 = canopy, 2 = understorey, etc.)
currentCohort%canopy_layer_yesterday = nan ! recent canopy status of cohort (1 = canopy, 2 = understorey, etc.)
currentCohort%NV = fates_unset_int ! Number of leaf layers: -
currentCohort%status_coh = fates_unset_int ! growth status of plant (2 = leaves on , 1 = leaves off)
currentCohort%status_coh = fates_unset_int ! growth status of plant (2 = flushing , 1 = fully abscissed, 3 = abscissing)
currentCohort%efleaf_coh = nan ! leaf elongation factor (fraction from 0 (fully abscissed) to 1 (fully flushed)
currentCohort%effnrt_coh = nan ! fine-root "elongation factor" (fraction from 0 (fully abscissed) to 1 (fully flushed)
currentCohort%efstem_coh = nan ! stem "elongation factor" (fraction from 0 (fully abscissed) to 1 (fully flushed)
currentCohort%size_class = fates_unset_int ! size class index
currentCohort%size_class_lasttimestep = fates_unset_int ! size class index
currentCohort%size_by_pft_class = fates_unset_int ! size by pft classification index
Expand All @@ -540,8 +576,9 @@ subroutine nan_cohort(cc_p)
currentCohort%n = nan ! number of individuals in cohort per 'area' (10000m2 default)
currentCohort%dbh = nan ! 'diameter at breast height' in cm
currentCohort%coage = nan ! age of the cohort in years
currentCohort%hite = nan ! height: meters
currentCohort%laimemory = nan ! target leaf biomass- set from previous year: kGC per indiv
currentCohort%hite = nan ! height: meters
currentCohort%leafmemory = nan ! target leaf biomass- set from previous year: kGC per indiv
currentCohort%fnrtmemory = nan ! target fine-root biomass- set from previous year: kGC per indiv
currentCohort%sapwmemory = nan ! target sapwood biomass- set from previous year: kGC per indiv
currentCohort%structmemory = nan ! target structural biomass- set from previous year: kGC per indiv
currentCohort%lai = nan ! leaf area index of cohort m2/m2
Expand Down Expand Up @@ -647,6 +684,9 @@ subroutine zero_cohort(cc_p)

currentCohort%NV = 0
currentCohort%status_coh = 0
currentCohort%efleaf_coh = 0._r8
currentCohort%effnrt_coh = 0._r8
currentCohort%efstem_coh = 0._r8
currentCohort%rdark = 0._r8
currentCohort%resp_m = 0._r8
currentCohort%resp_m_def = 0._r8
Expand Down Expand Up @@ -765,7 +805,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_
if (currentcohort%n < min_n_safemath .and. level == 1) then
terminate = itrue
if ( debug ) then
write(fates_log(),*) 'terminating cohorts 0',currentCohort%n/currentPatch%area,currentCohort%dbh,call_index
write(fates_log(),*) 'terminating cohorts 0',currentCohort%n/currentPatch%area,currentCohort%dbh,currentCohort%pft,call_index
endif
endif

Expand All @@ -778,15 +818,15 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_
(currentCohort%dbh < 0.00001_r8 .and. store_c < 0._r8) ) then
terminate = itrue
if ( debug ) then
write(fates_log(),*) 'terminating cohorts 1',currentCohort%n/currentPatch%area,currentCohort%dbh,call_index
write(fates_log(),*) 'terminating cohorts 1',currentCohort%n/currentPatch%area,currentCohort%dbh,currentCohort%pft,call_index
endif
endif

! Outside the maximum canopy layer
if (currentCohort%canopy_layer > nclmax ) then
terminate = itrue
if ( debug ) then
write(fates_log(),*) 'terminating cohorts 2', currentCohort%canopy_layer,call_index
write(fates_log(),*) 'terminating cohorts 2', currentCohort%canopy_layer,currentCohort%pft,call_index
endif
endif

Expand All @@ -796,7 +836,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_
terminate = itrue
if ( debug ) then
write(fates_log(),*) 'terminating cohorts 3', &
sapw_c,leaf_c,fnrt_c,store_c,call_index
sapw_c,leaf_c,fnrt_c,store_c,currentCohort%pft,call_index
endif
endif

Expand All @@ -805,7 +845,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_
terminate = itrue
if ( debug ) then
write(fates_log(),*) 'terminating cohorts 4', &
struct_c,sapw_c,leaf_c,fnrt_c,store_c,call_index
struct_c,sapw_c,leaf_c,fnrt_c,store_c,currentCohort%pft,call_index
endif

endif
Expand Down Expand Up @@ -1196,7 +1236,8 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
write(fates_log(),*) 'Cohort I, Cohort II'
write(fates_log(),*) 'n:',currentCohort%n,nextc%n
write(fates_log(),*) 'isnew:',currentCohort%isnew,nextc%isnew
write(fates_log(),*) 'laimemory:',currentCohort%laimemory,nextc%laimemory
write(fates_log(),*) 'leafmemory:',currentCohort%leafmemory,nextc%leafmemory
write(fates_log(),*) 'fnrtmemory:',currentCohort%fnrtmemory,nextc%fnrtmemory
write(fates_log(),*) 'hite:',currentCohort%hite,nextc%hite
write(fates_log(),*) 'coage:',currentCohort%coage,nextc%coage
write(fates_log(),*) 'dbh:',currentCohort%dbh,nextc%dbh
Expand Down Expand Up @@ -1234,8 +1275,11 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
! -----------------------------------------------------------------
call UpdateCohortBioPhysRates(currentCohort)

currentCohort%laimemory = (currentCohort%n*currentCohort%laimemory &
+ nextc%n*nextc%laimemory)/newn
currentCohort%leafmemory = (currentCohort%n*currentCohort%leafmemory &
+ nextc%n*nextc%leafmemory)/newn

currentCohort%fnrtmemory = (currentCohort%n*currentCohort%fnrtmemory &
+ nextc%n*nextc%fnrtmemory)/newn

currentCohort%sapwmemory = (currentCohort%n*currentCohort%sapwmemory &
+ nextc%n*nextc%sapwmemory)/newn
Expand Down Expand Up @@ -1828,7 +1872,8 @@ subroutine copy_cohort( currentCohort,copyc )
n%dbh = o%dbh
n%coage = o%coage
n%hite = o%hite
n%laimemory = o%laimemory
n%leafmemory = o%leafmemory
n%fnrtmemory = o%fnrtmemory
n%sapwmemory = o%sapwmemory
n%structmemory = o%structmemory
n%lai = o%lai
Expand All @@ -1839,6 +1884,9 @@ subroutine copy_cohort( currentCohort,copyc )
n%canopy_layer_yesterday = o%canopy_layer_yesterday
n%nv = o%nv
n%status_coh = o%status_coh
n%efleaf_coh = o%efleaf_coh
n%effnrt_coh = o%effnrt_coh
n%efstem_coh = o%efstem_coh
n%canopy_trim = o%canopy_trim
n%excl_weight = o%excl_weight
n%prom_weight = o%prom_weight
Expand Down
3 changes: 2 additions & 1 deletion biogeochem/EDPatchDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ module EDPatchDynamicsMod
use PRTGenericMod, only : struct_organ
use PRTLossFluxesMod, only : PRTBurnLosses
use FatesInterfaceTypesMod, only : hlm_parteh_mode
use PRTGenericMod, only : prt_carbon_allom_hyp
use PRTGenericMod, only : prt_csimpler_allom_hyp
use PRTGenericMod, only : prt_carbon_allom_hyp
use PRTGenericMod, only : prt_cnp_flex_allom_hyp
use SFParamsMod, only : SF_VAL_CWD_FRAC
use EDParamsMod, only : logging_event_code
Expand Down
Loading