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

Improve the plant hydro codes to accomodate dynamic forest #440

Merged
Merged
Show file tree
Hide file tree
Changes from 58 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
4183e31
initial set of add'l data structures and code for plant growth & turn…
Jul 20, 2018
e8cefc0
rounded out FuseCohortHydraulics and CopyCohortHydraulics with the mi…
Jul 24, 2018
3e9f814
added some hydraulics variables to dump_cohort(). Beware, there is no…
Jul 24, 2018
ded6ccc
shuffled order of a few cohort-level hydraulics variables, for visual…
Jul 24, 2018
c8f8243
added numpft to InitHydraulicsDerived to enable initializing derived …
Aug 3, 2018
931ca5f
uncommented call to updateSizeDepRhizHydStates
Aug 3, 2018
97a0dc6
added soil water content by layer and rhizosphere shell, h2osoi_shsl.…
Aug 3, 2018
3cd6830
added calculation of derived pinot pft-specific hydraulics parameter,…
Aug 3, 2018
c5f2edf
added call to new subroutine RecruitWaterStorage(), which calculates …
Aug 7, 2018
6be3995
added subroutine RecruitWaterStorage which caluclates site-level amou…
Aug 7, 2018
257c1e4
added H2OVEG_RECRUIT as a history output variable
Aug 7, 2018
9134ac4
added site-level variable h2oveg_recruit
Aug 7, 2018
a8481ea
adds a call to AccumulateMortalityWaterStorage from within terminate_…
Oct 19, 2018
eb5d4cb
update the recruit water uptake,veg water storage and a typo correction
xuchongang Nov 6, 2018
8a0a1cf
Merge branch 'xuchongang/fix_hydraulic_bug_ready_to_merge' of github.…
xuchongang Nov 6, 2018
9abc96b
Merge branch 'master' of github.com:NGEET/fates into xuchongang/fates…
xuchongang Nov 6, 2018
0a96285
update the HYDRO warning
xuchongang Nov 6, 2018
2933859
Upudate the dump_cohort statement for hydro
xuchongang Nov 6, 2018
45c31fe
using associated(ccohort_hydr%th_aroot) instead of hlm_use_planthydro
xuchongang Nov 6, 2018
790db87
update the fill rhizosphere drainage filling for mass balance
xuchongang Nov 7, 2018
8162bc1
update the rhizosphere drainage refilling for improvement of mass bal…
xuchongang Nov 7, 2018
b9a88e4
avoid the reference to site%hydr for Fates History when hydro is not …
xuchongang Nov 9, 2018
a7c674e
Merge branch 'xuchongang/fates_hydro_improve_fillrhiz' of github.com:…
xuchongang Nov 9, 2018
dc04ffe
update the dump_cohort for hydro
xuchongang Nov 9, 2018
13ada94
simply the rhizosphere kmax code by avoiding duplicate calculations
xuchongang Nov 9, 2018
26e3db8
turn on the default sapwood area calculation for hydro
xuchongang Nov 9, 2018
aa86820
Starting to scratch out variable dependencies for hydro restarts
rgknox Nov 12, 2018
977c6c7
Spacing out and listing hydro variables that will be added to restarts.
rgknox Nov 12, 2018
b84261a
First pass at incorporating hydraulics variables into restarts
rgknox Nov 13, 2018
37291fc
syntax and bug fixes for hydro restarts, code compiles, un-tested
rgknox Nov 13, 2018
ffd5e4f
SPlitting up hydraulic props routine
rgknox Nov 14, 2018
56de482
update the c_area and treelai for fusecohort in hydraulics
xuchongang Nov 14, 2018
0a2e40d
use the profile-based leaf area for hydraulics for code consistency
xuchongang Nov 14, 2018
57beba2
Merge branch 'xuchongang/fates_hydro_improve_fillrhiz' of github.com:…
xuchongang Nov 14, 2018
e6679a8
Re-arranging calls to initialize hydro cohorts
rgknox Nov 15, 2018
44d639d
Debugging new hydro restarts
rgknox Nov 15, 2018
6abcbe6
update the leaf lai for hydro after fuse cohorts
xuchongang Nov 15, 2018
9f262a6
track the error for hydro dynamics
xuchongang Nov 15, 2018
b529e5c
avoid the calls to update plant water when no recruitment happens in …
xuchongang Nov 15, 2018
258acb6
add a debug flag to turn on and off warning for mass error checking
xuchongang Nov 15, 2018
cfbdb86
cleaned the codes on updating veg water storage and error terms
xuchongang Nov 15, 2018
015533c
fates hydro restart refactors - syntax updates
rgknox Nov 16, 2018
a90d5e0
conflict resolution related to sapwood area calculation
rgknox Nov 16, 2018
6481b73
Added some zero-ing initializations to hydraulics during restarts
rgknox Nov 16, 2018
50e8141
Corrected hydro-restart initialization procedure
rgknox Nov 19, 2018
757d93b
Removed length, node and volumes from shell restarts as they are auto…
rgknox Nov 19, 2018
9d70ddd
Added debug protection to an abundant water balance error write state…
rgknox Nov 20, 2018
2254e76
Merge pull request #3 from rgknox/rgknox-cxu-dynamic-hydro-restart-me…
xuchongang Nov 21, 2018
a250245
Add the recruitment water constrain based on water availability in t…
xuchongang Nov 20, 2018
8b6371f
update the recruit water constrain for hydro
xuchongang Nov 21, 2018
8e03126
update the recruit water constrain within plant hydro
xuchongang Nov 21, 2018
22b84c5
update the hydro codes to avoid positive water potentials
xuchongang Nov 21, 2018
4a20a17
update the recruitment constraint for parteh
xuchongang Nov 25, 2018
be3ae7a
add a new default parameter file for hydro
xuchongang Nov 25, 2018
d2c8d8b
add the hydraulic failure mortality based on fractional loss of condu…
xuchongang Nov 25, 2018
8fcbadd
update the parameter files for hydraulic failure mortality
xuchongang Nov 25, 2018
78b28ab
correct a typo of hf_flc_threshold
xuchongang Nov 25, 2018
30f776d
moved a comment on hf mortality for easier readibility of codes
xuchongang Nov 25, 2018
f0bce93
Reset default settings for phenology in EDTypes
rgknox Dec 31, 2018
657473e
Fixes for history and restarts, making sure that hydro diagostics are…
rgknox Jan 2, 2019
8971025
Merge pull request #6 from rgknox/xuchongang/fates_hydro_improve_read…
xuchongang Jan 10, 2019
4f0310d
Trival conflict resolutions with master
rgknox Jan 14, 2019
911b539
Merge pull request #7 from rgknox/xuchongang/fates_hydro_improve_read…
xuchongang Jan 14, 2019
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
5 changes: 4 additions & 1 deletion biogeochem/EDCanopyStructureMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module EDCanopyStructureMod
use FatesInterfaceMod , only : hlm_days_per_year
use FatesInterfaceMod , only : hlm_use_planthydro
use FatesInterfaceMod , only : numpft
use FatesPlantHydraulicsMod, only : UpdateH2OVeg,InitHydrCohort
use FatesPlantHydraulicsMod, only : UpdateH2OVeg,InitHydrCohort, RecruitWaterStorage

use PRTGenericMod, only : leaf_organ
use PRTGenericMod, only : all_carbon_elements
Expand Down Expand Up @@ -503,6 +503,7 @@ subroutine DemoteFromLayer(currentSite,currentPatch,i_lyr)
! demoted to the understory

allocate(copyc)

call InitPRTCohort(copyc)
if( hlm_use_planthydro.eq.itrue ) then
call InitHydrCohort(currentSite,copyc)
Expand Down Expand Up @@ -850,6 +851,7 @@ subroutine PromoteIntoLayer(currentSite,currentPatch,i_lyr)
elseif ( cc_gain > nearzero .and. cc_gain < currentCohort%c_area) then

allocate(copyc)

call InitPRTCohort(copyc)
if( hlm_use_planthydro.eq.itrue ) then
call InitHydrCohort(CurrentSite,copyc)
Expand Down Expand Up @@ -1759,6 +1761,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)

! If hydraulics is turned on, update the amount of water bound in vegetation
if (hlm_use_planthydro.eq.itrue) then
call RecruitWaterStorage(nsites,sites,bc_out)
call UpdateH2OVeg(nsites,sites,bc_out)
end if

Expand Down
65 changes: 57 additions & 8 deletions biogeochem/EDCohortDynamicsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module EDCohortDynamicsMod
use FatesGlobals , only : fates_log
use FatesInterfaceMod , only : hlm_freq_day
use FatesInterfaceMod , only : bc_in_type
use FatesInterfaceMod , only : hlm_use_planthydro
use FatesConstantsMod , only : r8 => fates_r8
use FatesConstantsMod , only : fates_unset_int
use FatesConstantsMod , only : itrue,ifalse
Expand All @@ -30,6 +31,9 @@ module EDCohortDynamicsMod
use FatesPlantHydraulicsMod, only : InitHydrCohort
use FatesPlantHydraulicsMod, only : DeallocateHydrCohort
use FatesPlantHydraulicsMod, only : AccumulateMortalityWaterStorage
use FatesPlantHydraulicsMod, only : UpdateTreeHydrNodes
use FatesPlantHydraulicsMod, only : UpdateTreeHydrLenVolCond
use FatesPlantHydraulicsMod, only : SavePreviousCompartmentVolumes
use FatesSizeAgeTypeIndicesMod, only : sizetype_class_index
use FatesAllometryMod , only : bleaf
use FatesAllometryMod , only : bfineroot
Expand Down Expand Up @@ -97,6 +101,13 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, dbh, bleaf, bfine
!
! !DESCRIPTION:
! create new cohort
! There are 4 places this is called
! 1) Initializing new cohorts at the beginning of a cold-start simulation
! 2) Initializing new recruits during dynamics
! 3) Initializing new cohorts at the beginning of a inventory read
! 4) Initializing new cohorts during restart
!
! It is assumed that in the first 3, this is called with a reasonable amount of starter information.
!
! !USES:
!
Expand Down Expand Up @@ -124,7 +135,8 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, dbh, bleaf, bfine
! !LOCAL VARIABLES:
type(ed_cohort_type), pointer :: new_cohort ! Pointer to New Cohort structure.
type(ed_cohort_type), pointer :: storesmallcohort
type(ed_cohort_type), pointer :: storebigcohort
type(ed_cohort_type), pointer :: storebigcohort
integer :: nlevsoi_hyd ! number of hydraulically active soil layers
integer :: tnull,snull ! are the tallest and shortest cohorts allocate
!----------------------------------------------------------------------

Expand Down Expand Up @@ -241,12 +253,31 @@ subroutine create_cohort(currentSite, patchptr, pft, nn, hite, dbh, bleaf, bfine
new_cohort%isnew = .true.

if( hlm_use_planthydro.eq.itrue ) then
call InitHydrCohort(CurrentSite,new_cohort)
call updateSizeDepTreeHydProps(CurrentSite,new_cohort, bc_in)
call initTreeHydStates(CurrentSite,new_cohort, bc_in)

nlevsoi_hyd = currentSite%si_hydr%nlevsoi_hyd

! This allocates array spaces
call InitHydrCohort(currentSite,new_cohort)

! This calculates node heights
call UpdateTreeHydrNodes(new_cohort%co_hydr,new_cohort%pft, &
new_cohort%hite,nlevsoi_hyd,bc_in)

! This calculates volumes, lengths and max conductances
call UpdateTreeHydrLenVolCond(new_cohort,nlevsoi_hyd,bc_in)

! Since this is a newly initialized plant, we set the previous compartment-size
! equal to the ones we just calculated.
call SavePreviousCompartmentVolumes(new_cohort%co_hydr)

! This comes up with starter suctions and then water contents
! based on the soil values
call initTreeHydStates(currentSite,new_cohort, bc_in)

if(recruitstatus==1)then
new_cohort%co_hydr%is_newly_recuited = .true.
new_cohort%co_hydr%is_newly_recruited = .true.
endif

endif

call insert_cohort(new_cohort, patchptr%tallest, patchptr%shortest, tnull, snull, &
Expand Down Expand Up @@ -614,7 +645,10 @@ subroutine terminate_cohorts( currentSite, currentPatch, level )
!
currentSite%termination_carbonflux(levcan) = currentSite%termination_carbonflux(levcan) + &
currentCohort%n * (struct_c+sapw_c+leaf_c+fnrt_c+store_c+repro_c)


if( hlm_use_planthydro == itrue ) then
call AccumulateMortalityWaterStorage(currentSite,currentCohort,currentCohort%n)
end if

!put the litter from the terminated cohorts straight into the fragmenting pools
if (currentCohort%n.gt.0.0_r8) then
Expand Down Expand Up @@ -729,6 +763,7 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
real(r8) :: newn
real(r8) :: diff
real(r8) :: dynamic_fusion_tolerance
real(r8) :: leaf_c ! leaf carbon [kg]

integer :: largersc, smallersc, sc_i ! indices for tracking the growth flux caused by fusion
real(r8) :: larger_n, smaller_n
Expand Down Expand Up @@ -845,8 +880,11 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)

call sizetype_class_index(currentCohort%dbh,currentCohort%pft, &
currentCohort%size_class,currentCohort%size_by_pft_class)


if(hlm_use_planthydro.eq.itrue) call FuseCohortHydraulics(currentSite,currentCohort,nextc,bc_in,newn)
if(hlm_use_planthydro.eq.itrue) then
call FuseCohortHydraulics(currentSite,currentCohort,nextc,bc_in,newn)
endif

! recent canopy history
currentCohort%canopy_layer_yesterday = (currentCohort%n*currentCohort%canopy_layer_yesterday + &
Expand Down Expand Up @@ -976,7 +1014,18 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
endif

! At this point, nothing should be pointing to current Cohort
if (hlm_use_planthydro.eq.itrue) call DeallocateHydrCohort(nextc)
! update hydraulics quantities that are functions of hite & biomasses
! deallocate the hydro structure of nextc
if (hlm_use_planthydro.eq.itrue) then
call carea_allom(currentCohort%dbh,currentCohort%n,currentSite%spread, &
currentCohort%pft,currentCohort%c_area)
leaf_c = currentCohort%prt%GetState(leaf_organ, all_carbon_elements)
currentCohort%treelai = tree_lai(leaf_c, &
currentCohort%pft, currentCohort%c_area, currentCohort%n, &
currentCohort%canopy_layer, currentPatch%canopy_layer_tlai )
call updateSizeDepTreeHydProps(currentSite,currentCohort, bc_in)
call DeallocateHydrCohort(nextc)
endif

! Deallocate the cohort's PRT structure
call nextc%prt%DeallocatePRTVartypes()
Expand Down
29 changes: 26 additions & 3 deletions biogeochem/EDMortalityFunctionsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module EDMortalityFunctionsMod
use FatesInterfaceMod , only : bc_in_type
use FatesInterfaceMod , only : hlm_use_ed_prescribed_phys
use FatesInterfaceMod , only : hlm_freq_day
use FatesInterfaceMod , only : hlm_use_planthydro
use EDLoggingMortalityMod , only : LoggingMortality_frac
use EDParamsMod , only : fates_mortality_disturbance_fraction
use FatesInterfaceMod , only : bc_in_type
Expand Down Expand Up @@ -62,8 +63,14 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )
real(r8) :: leaf_c_target ! target leaf biomass kgC
real(r8) :: store_c
real(r8) :: hf_sm_threshold ! hydraulic failure soil moisture threshold
real(r8) :: hf_flc_threshold ! hydraulic failure fractional loss of conductivity threshold
real(r8) :: temp_dep_fraction ! Temp. function (freezing mortality)
real(r8) :: temp_in_C ! Daily averaged temperature in Celcius
real(r8) :: min_fmc_ag ! minimum fraction of maximum conductivity for aboveground
real(r8) :: min_fmc_tr ! minimum fraction of maximum conductivity for transporting root
real(r8) :: min_fmc_ar ! minimum fraction of maximum conductivity for absorbing root
real(r8) :: min_fmc ! minimum fraction of maximum conductivity for whole plant
real(r8) :: flc ! fractional loss of conductivity
real(r8), parameter :: frost_mort_buffer = 5.0_r8 ! 5deg buffer for freezing mortality
logical, parameter :: test_zero_mortality = .false. ! Developer test which
! may help to debug carbon imbalances
Expand All @@ -77,12 +84,28 @@ subroutine mortality_rates( cohort_in,bc_in,cmort,hmort,bmort,frmort )

! Proxy for hydraulic failure induced mortality.
hf_sm_threshold = EDPftvarcon_inst%hf_sm_threshold(cohort_in%pft)

if(cohort_in%patchptr%btran_ft(cohort_in%pft) <= hf_sm_threshold)then
hf_flc_threshold = EDPftvarcon_inst%hf_flc_threshold(cohort_in%pft)
Copy link
Contributor

@rgknox rgknox Nov 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first I thought maybe we should consider having just one parameter here, generically defined as "hydraulic failure threshold". But it does appear that the units of hf_sm_threshold and hf_flc_threshold are completely different. One is soil moisture and the other is conductivity. I think I like them separated into two different values. Maybe we should add a note in the parameter file meta-data and the parameter definitions "in-code" as to where they are relevant though.

if(hlm_use_planthydro.eq.itrue)then
!note the flc is set as the fraction of max conductivity in hydro
min_fmc_ag = minval(cohort_in%co_hydr%flc_ag(:))
min_fmc_tr = minval(cohort_in%co_hydr%flc_troot(:))
min_fmc_ar = minval(cohort_in%co_hydr%flc_aroot(:))
min_fmc = min(min_fmc_ag, min_fmc_tr)
min_fmc = min(min_fmc, min_fmc_ar)
flc = 1.0_r8-min_fmc
if(flc >= hf_flc_threshold .and. hf_flc_threshold < 1.0_r8 )then
hmort = (flc-hf_flc_threshold)/(1.0_r8-hf_flc_threshold) * &
EDPftvarcon_inst%mort_scalar_hydrfailure(cohort_in%pft)
else
hmort = 0.0_r8
endif
else
if(cohort_in%patchptr%btran_ft(cohort_in%pft) <= hf_sm_threshold)then
hmort = EDPftvarcon_inst%mort_scalar_hydrfailure(cohort_in%pft)
else
hmort = 0.0_r8
endif
endif
endif

! Carbon Starvation induced mortality.
if ( cohort_in%dbh > 0._r8 ) then
Expand Down
82 changes: 66 additions & 16 deletions biogeochem/EDPhysiologyMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ module EDPhysiologyMod
use FatesInterfaceMod, only : hlm_day_of_year
use FatesInterfaceMod, only : numpft
use FatesInterfaceMod, only : hlm_use_planthydro
use FatesInterfaceMod, only : hlm_parteh_mode
use FatesConstantsMod, only : r8 => fates_r8
use FatesConstantsMod, only : nearzero
use EDPftvarcon , only : EDPftvarcon_inst
use FatesInterfaceMod, only : bc_in_type
use EDCohortDynamicsMod , only : zero_cohort
use EDCohortDynamicsMod , only : create_cohort, sort_cohorts
use EDCohortDynamicsMod , only : create_cohort, sort_cohorts,InitPRTCohort
use FatesAllometryMod , only : tree_lai
use FatesAllometryMod , only : tree_sai
use FatesAllometryMod , only : decay_coeff_kn
Expand All @@ -39,6 +40,12 @@ module EDPhysiologyMod
use EDParamsMod , only : fates_mortality_disturbance_fraction

use FatesPlantHydraulicsMod , only : AccumulateMortalityWaterStorage
use FatesPlantHydraulicsMod , only : updateSizeDepTreeHydProps
use FatesPlantHydraulicsMod , only : initTreeHydStates
use FatesPlantHydraulicsMod , only : InitHydrCohort
use FatesPlantHydraulicsMod , only : ConstrainRecruitNumber
use FatesPlantHydraulicsMod , only : DeallocateHydrCohort

use FatesConstantsMod , only : itrue,ifalse
use FatesConstantsMod , only : calloc_abs_error

Expand All @@ -54,7 +61,8 @@ module EDPhysiologyMod
use FatesAllometryMod , only : carea_allom
use FatesAllometryMod , only : CheckIntegratedAllometries
use FatesAllometryMod , only : StructureResetOfDH


use PRTGenericMod, only : prt_carbon_allom_hyp
use PRTGenericMod, only : leaf_organ
use PRTGenericMod, only : all_carbon_elements
use PRTGenericMod, only : carbon12_element
Expand Down Expand Up @@ -950,6 +958,10 @@ subroutine recruitment( currentSite, currentPatch, bc_in )

allocate(temp_cohort) ! create temporary cohort
call zero_cohort(temp_cohort)
if( hlm_use_planthydro.eq.itrue ) then
call InitHydrCohort(CurrentSite,temp_cohort)
endif
call InitPRTCohort(temp_cohort)

do ft = 1,numpft

Expand Down Expand Up @@ -993,28 +1005,64 @@ subroutine recruitment( currentSite, currentPatch, bc_in )
else
! prescribed recruitment rates. number per sq. meter per year
temp_cohort%n = currentPatch%area * EDPftvarcon_inst%prescribed_recruitment(ft) * hlm_freq_day
! modify the carbon balance accumulators to take into account the different way of defining recruitment
! add prescribed rates as an input C flux, and the recruitment that would have otherwise occured as an output flux
! (since the carbon associated with them effectively vanishes)
currentSite%flux_in = currentSite%flux_in + temp_cohort%n * &
(b_store + b_leaf + b_fineroot + b_sapwood + b_dead)
currentSite%flux_out = currentSite%flux_out + currentPatch%area * currentPatch%seed_germination(ft)*hlm_freq_day
endif

if (temp_cohort%n > 0.0_r8 )then
if ( debug ) write(fates_log(),*) 'EDPhysiologyMod.F90 call create_cohort '
call create_cohort(currentSite,currentPatch, temp_cohort%pft, temp_cohort%n, temp_cohort%hite, temp_cohort%dbh, &
if ( DEBUG ) write(fates_log(),*) 'EDPhysiologyMod.F90 call create_cohort '
!constrain the number of individual based on rhyzosphere water availability
if( hlm_use_planthydro.eq.itrue ) then
call carea_allom(temp_cohort%dbh,temp_cohort%n,currentSite%spread, &
ft,temp_cohort%c_area)
if(associated(currentPatch%shortest)) then
temp_cohort%canopy_layer = currentPatch%shortest%canopy_layer
else
temp_cohort%canopy_layer = 1
endif
temp_cohort%pft = ft
select case(hlm_parteh_mode)
case (prt_carbon_allom_hyp)

call SetState(temp_cohort%prt,leaf_organ, carbon12_element, b_leaf)
call SetState(temp_cohort%prt,fnrt_organ, carbon12_element, b_fineroot)
call SetState(temp_cohort%prt,sapw_organ, carbon12_element, b_sapwood)
call SetState(temp_cohort%prt,store_organ, carbon12_element, b_store)
call SetState(temp_cohort%prt,struct_organ, carbon12_element, b_dead)
call SetState(temp_cohort%prt,repro_organ , carbon12_element, 0.0_r8)

end select
temp_cohort%treelai = tree_lai(b_leaf, ft,&
temp_cohort%c_area,temp_cohort%n, &
temp_cohort%canopy_layer,currentPatch%canopy_layer_tlai)
call updateSizeDepTreeHydProps(CurrentSite,temp_cohort, bc_in)
call initTreeHydStates(CurrentSite,temp_cohort, bc_in)
call ConstrainRecruitNumber(currentSite,temp_cohort, bc_in)
endif
if(temp_cohort%n > 0.0_r8) then
call create_cohort(currentSite,currentPatch, temp_cohort%pft, temp_cohort%n, temp_cohort%hite, temp_cohort%dbh, &
b_leaf, b_fineroot, b_sapwood, b_dead, b_store, &
temp_cohort%laimemory, cohortstatus,recruitstatus, temp_cohort%canopy_trim, currentPatch%NCL_p, &
currentSite%spread, bc_in)


! keep track of how many individuals were recruited for passing to history
currentSite%recruitment_rate(ft) = currentSite%recruitment_rate(ft) + temp_cohort%n
! keep track of how many individuals were recruited for passing to history
currentSite%recruitment_rate(ft) = currentSite%recruitment_rate(ft) + temp_cohort%n
! modify the carbon balance accumulators to take into account the different way of defining recruitment
! add prescribed rates as an input C flux, and the recruitment that would have otherwise occured as an output flux
! (since the carbon associated with them effectively vanishes)
! check the water for hydraulics
if (hlm_use_ed_prescribed_phys .ne. ifalse .and. EDPftvarcon_inst%prescribed_recruitment(ft) .ge. 0. ) then
currentSite%flux_in = currentSite%flux_in + temp_cohort%n * &
(b_store + b_leaf + b_fineroot + b_sapwood + b_dead)
currentSite%flux_out = currentSite%flux_out + currentPatch%area * currentPatch%seed_germination(ft)*hlm_freq_day
endif

endif

endif
enddo !pft loop

!deallocate the temporatory cohort
if (hlm_use_planthydro.eq.itrue) call DeallocateHydrCohort(temp_cohort)
!Deallocate the cohort's PRT structure
call temp_cohort%prt%DeallocatePRTVartypes()
deallocate(temp_cohort%prt)
deallocate(temp_cohort) ! delete temporary cohort

end subroutine recruitment
Expand Down Expand Up @@ -1153,7 +1201,9 @@ subroutine CWD_Input( currentSite, currentPatch)
hlm_freq_day * currentPatch%area

if( hlm_use_planthydro == itrue ) then
call AccumulateMortalityWaterStorage(currentSite,currentCohort,dead_n)
!call AccumulateMortalityWaterStorage(currentSite,currentCohort,dead_n)
call AccumulateMortalityWaterStorage(currentSite,currentCohort,&
-1.0_r8 * currentCohort%dndt * hlm_freq_day)
end if


Expand Down
28 changes: 28 additions & 0 deletions biogeochem/FatesAllometryMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ module FatesAllometryMod
public :: decay_coeff_kn
public :: StructureResetOfDH ! Method to set DBH to sync with structure biomass
public :: CheckIntegratedAllometries
public :: CrownDepth
public :: set_root_fraction ! Generic wrapper to calculate normalized
! root profiles

Expand Down Expand Up @@ -1843,6 +1844,33 @@ subroutine h2d_martcano(h,p1,p2,p3,d,dddh)
return
end subroutine h2d_martcano

! =====================================================================================


subroutine CrownDepth(height,crown_depth)

! -----------------------------------------------------------------------------------
! This routine returns the depth of a plant's crown. Which is the length
! from the bottom of the crown to the top in the vertical dimension.
!
! This code may be used as a wrapper if different hypotheses are wished to be
! optioned.
! -----------------------------------------------------------------------------------

real(r8),intent(in) :: height ! The height of the plant [m]
real(r8),intent(out) :: crown_depth ! The depth of the crown [m]

! Alternative Hypothesis:
! crown depth from Poorter, Bongers & Bongers
! crown_depth = exp(-1.169_r8)*cCohort%hite**1.098_r8

crown_depth = min(height,0.1_r8)

return
end subroutine CrownDepth



! =============================================================================
! Specific diameter to crown area allometries
! =============================================================================
Expand Down
Loading