@@ -29,6 +29,7 @@ module EDCohortDynamicsMod
2929 use FatesPlantHydraulicsMod, only : initTreeHydStates
3030 use FatesPlantHydraulicsMod, only : InitHydrCohort
3131 use FatesPlantHydraulicsMod, only : DeallocateHydrCohort
32+ use FatesPlantHydraulicsMod, only : AccumulateMortalityWaterStorage
3233 use FatesSizeAgeTypeIndicesMod, only : sizetype_class_index
3334 use FatesAllometryMod , only : bsap_allom
3435 use FatesAllometryMod , only : bleaf
@@ -64,19 +65,23 @@ module EDCohortDynamicsMod
6465contains
6566
6667 !- ------------------------------------------------------------------------------------!
67- subroutine create_cohort (patchptr , pft , nn , hite , dbh , bleaf , bfineroot , bsap , &
68- bdead , bstore , laimemory , status , ctrim , clayer , spread , bc_in )
68+
69+ subroutine create_cohort (currentSite , patchptr , pft , nn , hite , dbh , bleaf , bfineroot , bsap , &
70+ bdead , bstore , laimemory , status , recruitstatus ,ctrim , clayer , spread , bc_in )
71+
6972 !
7073 ! !DESCRIPTION:
7174 ! create new cohort
7275 !
7376 ! !USES:
7477 !
7578 ! !ARGUMENTS
79+ type (ed_site_type), intent (inout ), target :: currentSite
7680 type (ed_patch_type), intent (inout ), pointer :: patchptr
7781 integer , intent (in ) :: pft ! Cohort Plant Functional Type
7882 integer , intent (in ) :: clayer ! canopy status of cohort (1 = canopy, 2 = understorey, etc.)
7983 integer , intent (in ) :: status ! growth status of plant (2 = leaves on , 1 = leaves off)
84+ integer , intent (in ) :: recruitstatus ! recruit status of plant (1 = recruitment , 0 = other)
8085 real (r8 ), intent (in ) :: nn ! number of individuals in cohort per 'area' (10000m2 default)
8186 real (r8 ), intent (in ) :: hite ! height: meters
8287 real (r8 ), intent (in ) :: dbh ! dbh: cm
@@ -89,6 +94,7 @@ subroutine create_cohort(patchptr, pft, nn, hite, dbh, bleaf, bfineroot, bsap, &
8994 real (r8 ), intent (in ) :: ctrim ! What is the fraction of the maximum leaf biomass that we are targeting? :-
9095 real (r8 ), intent (in ) :: spread ! The community assembly effects how spread crowns are in horizontal space
9196 type (bc_in_type), intent (in ) :: bc_in ! External boundary conditions
97+
9298 !
9399 ! !LOCAL VARIABLES:
94100 type (ed_cohort_type), pointer :: new_cohort ! Pointer to New Cohort structure.
@@ -180,7 +186,10 @@ subroutine create_cohort(patchptr, pft, nn, hite, dbh, bleaf, bfineroot, bsap, &
180186 if ( hlm_use_planthydro.eq. itrue ) then
181187 call InitHydrCohort(new_cohort)
182188 call updateSizeDepTreeHydProps(new_cohort, bc_in)
183- call initTreeHydStates(new_cohort, bc_in)
189+ call initTreeHydStates(currentSite,new_cohort, bc_in)
190+ if (recruitstatus== 1 )then
191+ new_cohort% co_hydr% is_newly_recuited = .true.
192+ endif
184193 endif
185194
186195 call insert_cohort(new_cohort, patchptr% tallest, patchptr% shortest, tnull, snull, &
@@ -535,6 +544,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level )
535544 if (associated (shorterCohort)) shorterCohort% taller = > null ()
536545 else
537546 tallerCohort% shorter = > shorterCohort
547+
538548 endif
539549
540550 if (.not. associated (shorterCohort)) then
@@ -557,7 +567,7 @@ end subroutine terminate_cohorts
557567
558568 !- ------------------------------------------------------------------------------------!
559569
560- subroutine fuse_cohorts (currentPatch , bc_in )
570+ subroutine fuse_cohorts (currentSite , currentPatch , bc_in )
561571
562572 !
563573 ! !DESCRIPTION:
@@ -567,7 +577,8 @@ subroutine fuse_cohorts(currentPatch, bc_in)
567577 use EDParamsMod , only : ED_val_cohort_fusion_tol
568578 use shr_infnan_mod, only : nan = > shr_infnan_nan, assignment (= )
569579 !
570- ! !ARGUMENTS
580+ ! !ARGUMENTS
581+ type (ed_site_type), intent (inout ), target :: currentSite
571582 type (ed_patch_type), intent (inout ), target :: currentPatch
572583 type (bc_in_type), intent (in ) :: bc_in
573584 !
@@ -711,7 +722,7 @@ subroutine fuse_cohorts(currentPatch, bc_in)
711722 call sizetype_class_index(currentCohort% dbh,currentCohort% pft, &
712723 currentCohort% size_class,currentCohort% size_by_pft_class)
713724
714- if (hlm_use_planthydro.eq. itrue) call FuseCohortHydraulics(currentCohort,nextc,bc_in,newn)
725+ if (hlm_use_planthydro.eq. itrue) call FuseCohortHydraulics(currentSite, currentCohort,nextc,bc_in,newn)
715726
716727 ! recent canopy history
717728 currentCohort% canopy_layer_yesterday = (currentCohort% n* currentCohort% canopy_layer_yesterday + &
@@ -1209,7 +1220,9 @@ subroutine copy_cohort( currentCohort,copyc )
12091220
12101221 ! Plant Hydraulics
12111222
1212- if ( hlm_use_planthydro.eq. itrue ) call CopyCohortHydraulics(n,o)
1223+ if ( hlm_use_planthydro.eq. itrue ) then
1224+ call CopyCohortHydraulics(n,o)
1225+ endif
12131226
12141227 ! indices for binning
12151228 n% size_class = o% size_class
0 commit comments