@@ -340,12 +340,13 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_
340340 terminate = itrue
341341 termination_type = i_term_mort_type_numdens
342342 if ( debug ) then
343- write (fates_log(),* ) ' terminating cohorts 0' ,currentCohort% n/ currentPatch% area,currentCohort% dbh,currentCohort% pft,call_index
343+ write (fates_log(),* ) ' terminating cohorts 0' ,currentCohort% n/ currentPatch% area, &
344+ currentCohort% dbh,currentCohort% pft,call_index
344345 endif
345346 endif
346347
347348 ! The rest of these are only allowed if we are not dealing with a recruit (level 2)
348- if (.not. currentCohort% isnew .and. level == 2 ) then
349+ if_level_2: if (.not. currentCohort% isnew .and. level == 2 ) then
349350
350351 ! Not enough n or dbh
351352 if (currentCohort% n/ currentPatch% area <= min_npm2 .or. & !
@@ -354,18 +355,13 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_
354355 terminate = itrue
355356 termination_type = i_term_mort_type_numdens
356357 if ( debug ) then
357- write (fates_log(),* ) ' terminating cohorts 1' ,currentCohort% n/ currentPatch% area,currentCohort% dbh,currentCohort% pft,call_index
358+ write (fates_log(),* ) ' terminating cohorts 1' , &
359+ currentCohort% n/ currentPatch% area,currentCohort% dbh, &
360+ currentCohort% pft,call_index
358361 endif
359362 endif
360363
361- ! Outside the maximum canopy layer
362- if (currentCohort% canopy_layer > nclmax ) then
363- terminate = itrue
364- termination_type = i_term_mort_type_canlev
365- if ( debug ) then
366- write (fates_log(),* ) ' terminating cohorts 2' , currentCohort% canopy_layer,currentCohort% pft,call_index
367- endif
368- endif
364+
369365
370366 ! live biomass pools are terminally depleted
371367 if ( ( sapw_c+ leaf_c+ fnrt_c ) < 1e-10_r8 .or. &
@@ -387,8 +383,18 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_
387383 struct_c,sapw_c,leaf_c,fnrt_c,store_c,currentCohort% pft,call_index
388384 endif
389385
390- endif
391- endif ! if (.not.currentCohort%isnew .and. level == 2) then
386+ endif
387+
388+ end if if_level_2
389+
390+ ! Outside the maximum canopy layer
391+ if (currentCohort% canopy_layer > nclmax .and. level == 3 ) then
392+ terminate = itrue
393+ termination_type = i_term_mort_type_canlev
394+ if ( debug ) then
395+ write (fates_log(),* ) ' terminating cohorts 2' , currentCohort% canopy_layer,currentCohort% pft,call_index
396+ endif
397+ endif
392398
393399 if (terminate == itrue) then
394400 call terminate_cohort(currentSite, currentPatch, currentCohort, bc_in, termination_type)
@@ -941,7 +947,7 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
941947 currentCohort% size_class,currentCohort% size_by_pft_class)
942948
943949 if (hlm_use_planthydro.eq. itrue) then
944- call FuseCohortHydraulics(currentSite,currentCohort,nextc,bc_in, newn)
950+ call FuseCohortHydraulics(currentSite,currentCohort,nextc,newn)
945951 endif
946952
947953 ! recent canopy history
@@ -1020,6 +1026,12 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
10201026
10211027 currentCohort% fire_mort = (currentCohort% n* currentCohort% fire_mort + &
10221028 nextc% n* nextc% fire_mort)/ newn
1029+
1030+ currentCohort% nonrx_fire_mort = (currentCohort% n* currentCohort% nonrx_fire_mort + &
1031+ nextc% n* nextc% nonrx_fire_mort)/ newn
1032+
1033+ currentCohort% rx_fire_mort = (currentCohort% n* currentCohort% rx_fire_mort + &
1034+ nextc% n* nextc% rx_fire_mort)/ newn
10231035
10241036 ! mortality diagnostics
10251037 currentCohort% cmort = (currentCohort% n* currentCohort% cmort + nextc% n* nextc% cmort)/ newn
@@ -1118,7 +1130,7 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
11181130 ! update hydraulics quantities that are functions of height & biomasses
11191131 ! deallocate the hydro structure of nextc
11201132 if (hlm_use_planthydro.eq. itrue) then
1121- call UpdateSizeDepPlantHydProps(currentSite,currentCohort, bc_in )
1133+ call UpdateSizeDepPlantHydProps(currentSite,currentCohort)
11221134 endif
11231135
11241136 call nextc% FreeMemory()
0 commit comments