diff --git a/components/clm/src/ED/biogeochem/EDCanopyStructureMod.F90 b/components/clm/src/ED/biogeochem/EDCanopyStructureMod.F90 index 41247f0729..f156ed869f 100755 --- a/components/clm/src/ED/biogeochem/EDCanopyStructureMod.F90 +++ b/components/clm/src/ED/biogeochem/EDCanopyStructureMod.F90 @@ -342,7 +342,7 @@ subroutine canopy_structure( currentSite ) enddo !is there still excess area in any layer? call fuse_cohorts(currentPatch) - call terminate_cohorts(currentPatch) + call terminate_cohorts(currentSite, currentPatch) ! ----------- Check cohort area ------------------------------! do i = 1,z @@ -562,7 +562,7 @@ subroutine canopy_structure( currentSite ) enddo !is there still not enough canopy area in any layer? call fuse_cohorts(currentPatch) - call terminate_cohorts(currentPatch) + call terminate_cohorts(currentSite, currentPatch) if(promswitch == 1)then !write(fates_log(),*) 'going into cohort check' diff --git a/components/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 b/components/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 index 1ff9971d82..f1bbdde262 100755 --- a/components/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 +++ b/components/clm/src/ED/biogeochem/EDCohortDynamicsMod.F90 @@ -485,7 +485,7 @@ subroutine zero_cohort(cc_p) end subroutine zero_cohort !-------------------------------------------------------------------------------------! - subroutine terminate_cohorts( patchptr ) + subroutine terminate_cohorts( siteptr, patchptr ) ! ! !DESCRIPTION: ! terminates cohorts when they get too small @@ -495,6 +495,7 @@ subroutine terminate_cohorts( patchptr ) use SFParamsMod, only : SF_val_CWD_frac ! ! !ARGUMENTS + type (ed_site_type), intent(inout), target :: siteptr type (ed_patch_type), intent(inout), target :: patchptr ! ! !LOCAL VARIABLES: @@ -571,10 +572,10 @@ subroutine terminate_cohorts( patchptr ) else levcan = 2 endif - currentPatch%siteptr%terminated_nindivs(currentCohort%size_class,currentCohort%pft,levcan) = & - currentPatch%siteptr%terminated_nindivs(currentCohort%size_class,currentCohort%pft,levcan) + currentCohort%n + siteptr%terminated_nindivs(currentCohort%size_class,currentCohort%pft,levcan) = & + siteptr%terminated_nindivs(currentCohort%size_class,currentCohort%pft,levcan) + currentCohort%n ! - currentPatch%siteptr%termination_carbonflux(levcan) = currentPatch%siteptr%termination_carbonflux(levcan) + & + siteptr%termination_carbonflux(levcan) = siteptr%termination_carbonflux(levcan) + & currentCohort%n * currentCohort%b if (.not. associated(currentCohort%taller)) then currentPatch%tallest => currentCohort%shorter @@ -772,7 +773,8 @@ subroutine fuse_cohorts(patchptr) currentCohort%npp_store = (currentCohort%n*currentCohort%npp_store + nextc%n*nextc%npp_store)/newn ! recent canopy history - currentCohort%canopy_layer_yesterday = (currentCohort%n*currentCohort%canopy_layer_yesterday + nextc%n*nextc%canopy_layer_yesterday)/newn + currentCohort%canopy_layer_yesterday = (currentCohort%n*currentCohort%canopy_layer_yesterday + & + nextc%n*nextc%canopy_layer_yesterday)/newn do i=1, nlevcan if (currentCohort%year_net_uptake(i) == 999._r8 .or. nextc%year_net_uptake(i) == 999._r8) then diff --git a/components/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90 b/components/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90 index 237c831af5..fd5423eeec 100755 --- a/components/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90 +++ b/components/clm/src/ED/biogeochem/EDPatchDynamicsMod.F90 @@ -396,7 +396,7 @@ subroutine spawn_patches( currentSite ) !sort out the cohorts, since some of them may be so small as to need removing. call fuse_cohorts(currentPatch) - call terminate_cohorts(currentPatch) + call terminate_cohorts(currentSite, currentPatch) call sort_cohorts(currentPatch) currentPatch => currentPatch%younger @@ -413,7 +413,7 @@ subroutine spawn_patches( currentSite ) currentSite%youngest_patch => new_patch call fuse_cohorts(new_patch) - call terminate_cohorts(new_patch) + call terminate_cohorts(currentSite, new_patch) call sort_cohorts(new_patch) endif !end new_patch area diff --git a/components/clm/src/ED/biogeochem/EDPhysiologyMod.F90 b/components/clm/src/ED/biogeochem/EDPhysiologyMod.F90 index 0cdd239021..f2ffc055e9 100755 --- a/components/clm/src/ED/biogeochem/EDPhysiologyMod.F90 +++ b/components/clm/src/ED/biogeochem/EDPhysiologyMod.F90 @@ -1081,7 +1081,7 @@ subroutine recruitment( t, currentSite, currentPatch ) temp_cohort%laimemory, cohortstatus, temp_cohort%canopy_trim, currentPatch%NCL_p) ! keep track of how many individuals were recruited for passing to history - currentPatch%siteptr%recruitment_rate(ft) = currentPatch%siteptr%recruitment_rate(ft) + temp_cohort%n + currentSite%recruitment_rate(ft) = currentSite%recruitment_rate(ft) + temp_cohort%n endif enddo !pft loop diff --git a/components/clm/src/ED/main/EDMainMod.F90 b/components/clm/src/ED/main/EDMainMod.F90 index d06ff59218..780787e2df 100755 --- a/components/clm/src/ED/main/EDMainMod.F90 +++ b/components/clm/src/ED/main/EDMainMod.F90 @@ -118,7 +118,7 @@ subroutine ed_ecosystem_dynamics(currentSite, bc_in) call fuse_cohorts(currentPatch) ! kills cohorts that are too small - call terminate_cohorts(currentPatch) + call terminate_cohorts(currentSite, currentPatch) currentPatch => currentPatch%younger @@ -341,7 +341,7 @@ subroutine ed_update_site( currentSite, bc_in ) currentPatch => currentSite%oldest_patch do while(associated(currentPatch)) - call terminate_cohorts(currentPatch) + call terminate_cohorts(currentSite, currentPatch) ! FIX(SPM,040314) why is this needed for BFB restarts? Look into this at some point cohort_number = count_cohorts(currentPatch) diff --git a/components/clm/src/ED/main/FatesHistoryInterfaceMod.F90 b/components/clm/src/ED/main/FatesHistoryInterfaceMod.F90 index eb95615af3..d7aa01ec11 100644 --- a/components/clm/src/ED/main/FatesHistoryInterfaceMod.F90 +++ b/components/clm/src/ED/main/FatesHistoryInterfaceMod.F90 @@ -1227,7 +1227,8 @@ subroutine update_history_dyn(this,nc,nsites,sites) ccohort%npp_bseed * ccohort%n hio_npp_store_understory_si_scls(io_si,scls) = hio_npp_store_understory_si_scls(io_si,scls) + & ccohort%npp_store * ccohort%n - hio_yesterdaycanopylevel_understory_si_scls(io_si,scls) = hio_yesterdaycanopylevel_understory_si_scls(io_si,scls) + & + hio_yesterdaycanopylevel_understory_si_scls(io_si,scls) = & + hio_yesterdaycanopylevel_understory_si_scls(io_si,scls) + & ccohort%canopy_layer_yesterday * ccohort%n endif !