@@ -10,9 +10,9 @@ module EDCohortDynamicsMod
1010 use FatesInterfaceMod , only : bc_in_type
1111 use FatesConstantsMod , only : r8 = > fates_r8
1212 use FatesConstantsMod , only : fates_unset_int
13+ use FatesConstantsMod , only : itrue
1314 use FatesInterfaceMod , only : hlm_days_per_year
1415 use EDPftvarcon , only : EDPftvarcon_inst
15- use EDEcophysContype , only : EDecophyscon
1616 use EDGrowthFunctionsMod , only : c_area, tree_lai
1717 use EDTypesMod , only : ed_site_type, ed_patch_type, ed_cohort_type
1818 use EDTypesMod , only : nclmax
@@ -21,7 +21,7 @@ module EDCohortDynamicsMod
2121 use EDTypesMod , only : sclass_ed,nlevsclass_ed,AREA
2222 use EDTypesMod , only : min_npm2, min_nppatch
2323 use EDTypesMod , only : min_n_safemath
24- use EDTypesMod , only : use_fates_plant_hydro
24+ use FatesInterfaceMod , only : hlm_use_planthydro
2525 use FatesPlantHydraulicsMod, only : FuseCohortHydraulics
2626 use FatesPlantHydraulicsMod, only : CopyCohortHydraulics
2727 use FatesPlantHydraulicsMod, only : updateSizeDepTreeHydProps
@@ -172,7 +172,7 @@ subroutine create_cohort(patchptr, pft, nn, hite, dbh, &
172172 ! growth, disturbance and mortality.
173173 new_cohort% isnew = .true.
174174
175- if ( use_fates_plant_hydro ) then
175+ if ( hlm_use_planthydro .eq. itrue ) then
176176 call InitHydrCohort(new_cohort)
177177 call updateSizeDepTreeHydProps(new_cohort, bc_in)
178178 call initTreeHydStates(new_cohort, bc_in)
@@ -216,7 +216,7 @@ subroutine allocate_live_biomass(cc_p,mode)
216216
217217 currentCohort = > cc_p
218218 ft = currentcohort% pft
219- leaf_frac = 1.0_r8 / (1.0_r8 + EDecophyscon % sapwood_ratio (ft) * currentcohort% hite + EDPftvarcon_inst% froot_leaf (ft))
219+ leaf_frac = 1.0_r8 / (1.0_r8 + EDpftvarcon_inst % allom_latosa_int (ft) * currentcohort% hite + EDPftvarcon_inst% allom_l2fr (ft))
220220
221221 ! currentcohort%bl = currentcohort%balive*leaf_frac
222222 ! for deciduous trees, there are no leaves
@@ -228,8 +228,8 @@ subroutine allocate_live_biomass(cc_p,mode)
228228
229229 ! iagnore the root and stem biomass from the functional balance hypothesis. This is used when the leaves are
230230 ! fully on.
231- ! currentcohort%br = EDPftvarcon_inst%froot_leaf (ft) * (currentcohort%balive + currentcohort%laimemory) * leaf_frac
232- ! currentcohort%bsw = EDecophyscon%sapwood_ratio (ft) * currentcohort%hite *(currentcohort%balive + &
231+ ! currentcohort%br = EDPftvarcon_inst%allom_l2fr (ft) * (currentcohort%balive + currentcohort%laimemory) * leaf_frac
232+ ! currentcohort%bsw = EDpftvarcon_inst%allom_latosa_int (ft) * currentcohort%hite *(currentcohort%balive + &
233233 ! currentcohort%laimemory)*leaf_frac
234234
235235 leaves_off_switch = 0
@@ -245,9 +245,9 @@ subroutine allocate_live_biomass(cc_p,mode)
245245
246246 new_bl = currentcohort% balive* leaf_frac
247247
248- new_br = EDpftvarcon_inst% froot_leaf (ft) * (currentcohort% balive + currentcohort% laimemory) * leaf_frac
248+ new_br = EDpftvarcon_inst% allom_l2fr (ft) * (currentcohort% balive + currentcohort% laimemory) * leaf_frac
249249
250- new_bsw = EDecophyscon % sapwood_ratio (ft) * currentcohort% hite * (currentcohort% balive + &
250+ new_bsw = EDpftvarcon_inst % allom_latosa_int (ft) * currentcohort% hite * (currentcohort% balive + &
251251 currentcohort% laimemory)* leaf_frac
252252
253253 ! diagnose the root and stem biomass from the functional balance hypothesis. This is used when the leaves are
@@ -279,13 +279,13 @@ subroutine allocate_live_biomass(cc_p,mode)
279279 ! not have enough live biomass to support the hypothesized root mass
280280 ! thus, we use 'ratio_balive' to adjust br and bsw. Apologies that this is so complicated! RF
281281
282- ideal_balive = currentcohort% laimemory * EDPftvarcon_inst% froot_leaf (ft) + &
283- currentcohort% laimemory* EDecophyscon % sapwood_ratio (ft) * currentcohort% hite
282+ ideal_balive = currentcohort% laimemory * EDPftvarcon_inst% allom_l2fr (ft) + &
283+ currentcohort% laimemory* EDpftvarcon_inst % allom_latosa_int (ft) * currentcohort% hite
284284 ratio_balive = currentcohort% balive / ideal_balive
285285
286- new_br = EDpftvarcon_inst% froot_leaf (ft) * (ideal_balive + currentcohort% laimemory) * &
286+ new_br = EDpftvarcon_inst% allom_l2fr (ft) * (ideal_balive + currentcohort% laimemory) * &
287287 leaf_frac * ratio_balive
288- new_bsw = EDecophyscon % sapwood_ratio (ft) * currentcohort% hite * &
288+ new_bsw = EDpftvarcon_inst % allom_latosa_int (ft) * currentcohort% hite * &
289289 (ideal_balive + currentcohort% laimemory) * leaf_frac * ratio_balive
290290
291291 ! Diagnostics
@@ -505,7 +505,6 @@ subroutine terminate_cohorts( currentSite, patchptr, level )
505505 ! terminates cohorts when they get too small
506506 !
507507 ! !USES:
508- use EDParamsMod, only : ED_val_ag_biomass
509508 use SFParamsMod, only : SF_val_CWD_frac
510509 !
511510 ! !ARGUMENTS
@@ -618,10 +617,10 @@ subroutine terminate_cohorts( currentSite, patchptr, level )
618617
619618 currentPatch% CWD_AG(c) = currentPatch% CWD_AG(c) + currentCohort% n* (currentCohort% bdead+ currentCohort% bsw) / &
620619 currentPatch% area &
621- * SF_val_CWD_frac(c) * ED_val_ag_biomass
620+ * SF_val_CWD_frac(c) * EDPftvarcon_inst % allom_agb_frac(currentCohort % pft)
622621 currentPatch% CWD_BG(c) = currentPatch% CWD_BG(c) + currentCohort% n* (currentCohort% bdead+ currentCohort% bsw) / &
623622 currentPatch% area &
624- * SF_val_CWD_frac(c) * (1.0_r8 - ED_val_ag_biomass )
623+ * SF_val_CWD_frac(c) * (1.0_r8 - EDPftvarcon_inst % allom_agb_frac(currentCohort % pft) )
625624 enddo
626625
627626 currentPatch% leaf_litter(currentCohort% pft) = currentPatch% leaf_litter(currentCohort% pft) + currentCohort% n* &
@@ -633,10 +632,10 @@ subroutine terminate_cohorts( currentSite, patchptr, level )
633632 do c= 1 ,ncwd
634633 currentSite% CWD_AG_diagnostic_input_carbonflux(c) = currentSite% CWD_AG_diagnostic_input_carbonflux(c) &
635634 + currentCohort% n* (currentCohort% bdead+ currentCohort% bsw) * &
636- SF_val_CWD_frac(c) * ED_val_ag_biomass * hlm_days_per_year / AREA
635+ SF_val_CWD_frac(c) * EDPftvarcon_inst % allom_agb_frac(currentCohort % pft) * hlm_days_per_year / AREA
637636 currentSite% CWD_BG_diagnostic_input_carbonflux(c) = currentSite% CWD_BG_diagnostic_input_carbonflux(c) &
638637 + currentCohort% n* (currentCohort% bdead+ currentCohort% bsw) * &
639- SF_val_CWD_frac(c) * (1.0_r8 - ED_val_ag_biomass ) * hlm_days_per_year / AREA
638+ SF_val_CWD_frac(c) * (1.0_r8 - EDPftvarcon_inst % allom_agb_frac(currentCohort % pft) ) * hlm_days_per_year / AREA
640639 enddo
641640
642641 currentSite% leaf_litter_diagnostic_input_carbonflux(currentCohort% pft) = &
@@ -646,7 +645,7 @@ subroutine terminate_cohorts( currentSite, patchptr, level )
646645 currentSite% root_litter_diagnostic_input_carbonflux(currentCohort% pft) + &
647646 currentCohort% n * (currentCohort% br+ currentCohort% bstore) * hlm_days_per_year / AREA
648647
649- if (use_fates_plant_hydro ) call DeallocateHydrCohort(currentCohort)
648+ if (hlm_use_planthydro .eq. itrue ) call DeallocateHydrCohort(currentCohort)
650649
651650 deallocate (currentCohort)
652651 endif
@@ -676,8 +675,8 @@ subroutine fuse_cohorts(patchptr, bc_in)
676675 type (ed_cohort_type) , pointer :: currentCohort, nextc, nextnextc
677676 integer :: i
678677 integer :: fusion_took_place
679- integer :: maxcohorts ! maximum total no of cohorts. Needs to be >numpft_edx2
680- integer :: iterate ! do we need to keep fusing to get below maxcohorts?
678+ integer :: maxcohorts ! maximum total no of cohorts.
679+ integer :: iterate ! do we need to keep fusing to get below maxcohorts?
681680 integer :: nocohorts
682681 real (r8 ) :: newn
683682 real (r8 ) :: diff
@@ -799,7 +798,7 @@ subroutine fuse_cohorts(patchptr, bc_in)
799798 call sizetype_class_index(currentCohort% dbh,currentCohort% pft, &
800799 currentCohort% size_class,currentCohort% size_by_pft_class)
801800
802- if (use_fates_plant_hydro ) call FuseCohortHydraulics(currentCohort,nextc,bc_in,newn)
801+ if (hlm_use_planthydro .eq. itrue ) call FuseCohortHydraulics(currentCohort,nextc,bc_in,newn)
803802
804803 ! recent canopy history
805804 currentCohort% canopy_layer_yesterday = (currentCohort% n* currentCohort% canopy_layer_yesterday + &
@@ -888,7 +887,7 @@ subroutine fuse_cohorts(patchptr, bc_in)
888887 endif
889888
890889 if (associated (nextc)) then
891- if (use_fates_plant_hydro ) call DeallocateHydrCohort(nextc)
890+ if (hlm_use_planthydro .eq. itrue ) call DeallocateHydrCohort(nextc)
892891 deallocate (nextc)
893892 endif
894893
@@ -1246,7 +1245,7 @@ subroutine copy_cohort( currentCohort,copyc )
12461245
12471246 ! Plant Hydraulics
12481247
1249- if ( use_fates_plant_hydro ) call CopyCohortHydraulics(n,o)
1248+ if ( hlm_use_planthydro .eq. itrue ) call CopyCohortHydraulics(n,o)
12501249
12511250 ! indices for binning
12521251 n% size_class = o% size_class
0 commit comments