diff --git a/biogeochem/EDCanopyStructureMod.F90 b/biogeochem/EDCanopyStructureMod.F90 index 23d851ea92..a6323efe9e 100644 --- a/biogeochem/EDCanopyStructureMod.F90 +++ b/biogeochem/EDCanopyStructureMod.F90 @@ -11,6 +11,7 @@ module EDCanopyStructureMod use FatesConstantsMod , only : nearzero, area_error_1 use FatesConstantsMod , only : rsnbl_math_prec use FatesConstantsMod , only : nocomp_bareground + use FatesConstantsMod, only : i_term_mort_type_canlev use FatesGlobals , only : fates_log use EDPftvarcon , only : EDPftvarcon_inst use PRTParametersMod , only : prt_params @@ -741,7 +742,7 @@ subroutine DemoteFromLayer(currentSite,currentPatch,i_lyr,bc_in) if(currentCohort%canopy_layer>nclmax )then ! put the litter from the terminated cohorts ! straight into the fragmenting pools - call terminate_cohort(currentSite,currentPatch,currentCohort,bc_in) + call terminate_cohort(currentSite,currentPatch,currentCohort,bc_in,i_term_mort_type_canlev) deallocate(currentCohort, stat=istat, errmsg=smsg) if (istat/=0) then write(fates_log(),*) 'dealloc012: fail on deallocate(currentCohort):'//trim(smsg) diff --git a/biogeochem/EDCohortDynamicsMod.F90 b/biogeochem/EDCohortDynamicsMod.F90 index 12385a8f9d..ef87851ec1 100644 --- a/biogeochem/EDCohortDynamicsMod.F90 +++ b/biogeochem/EDCohortDynamicsMod.F90 @@ -120,6 +120,10 @@ Module EDCohortDynamicsMod use PRTAllometricCNPMod, only : acnp_bc_out_id_pefflux, acnp_bc_out_id_limiter use PRTAllometricCNPMod, only : acnp_bc_in_id_cdamage use DamageMainMod, only : undamaged_class + use FatesConstantsMod, only : n_term_mort_types + use FatesConstantsMod, only : i_term_mort_type_cstarv + use FatesConstantsMod, only : i_term_mort_type_canlev + use FatesConstantsMod, only : i_term_mort_type_numdens use shr_infnan_mod, only : nan => shr_infnan_nan, assignment(=) use shr_log_mod, only : errMsg => shr_log_errMsg @@ -382,12 +386,14 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_ integer :: terminate ! do we terminate (itrue) or not (ifalse) integer :: istat ! return status code character(len=255) :: smsg + integer :: termination_type !---------------------------------------------------------------------- currentCohort => currentPatch%shortest do while (associated(currentCohort)) terminate = ifalse + termination_type = 0 tallerCohort => currentCohort%taller leaf_c = currentCohort%prt%GetState(leaf_organ, carbon12_element) @@ -400,6 +406,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_ ! Check if number density is so low is breaks math (level 1) if (currentcohort%n < min_n_safemath .and. level == 1) then terminate = itrue + termination_type = i_term_mort_type_numdens if ( debug ) then write(fates_log(),*) 'terminating cohorts 0',currentCohort%n/currentPatch%area,currentCohort%dbh,currentCohort%pft,call_index endif @@ -413,6 +420,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_ currentCohort%n <= min_nppatch .or. & (currentCohort%dbh < 0.00001_r8 .and. store_c < 0._r8) ) then terminate = itrue + termination_type = i_term_mort_type_numdens if ( debug ) then write(fates_log(),*) 'terminating cohorts 1',currentCohort%n/currentPatch%area,currentCohort%dbh,currentCohort%pft,call_index endif @@ -421,6 +429,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_ ! Outside the maximum canopy layer if (currentCohort%canopy_layer > nclmax ) then terminate = itrue + termination_type = i_term_mort_type_canlev if ( debug ) then write(fates_log(),*) 'terminating cohorts 2', currentCohort%canopy_layer,currentCohort%pft,call_index endif @@ -430,6 +439,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_ if ( ( sapw_c+leaf_c+fnrt_c ) < 1e-10_r8 .or. & store_c < 1e-10_r8) then terminate = itrue + termination_type = i_term_mort_type_cstarv if ( debug ) then write(fates_log(),*) 'terminating cohorts 3', & sapw_c,leaf_c,fnrt_c,store_c,currentCohort%pft,call_index @@ -439,6 +449,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_ ! Total cohort biomass is negative if ( ( struct_c+sapw_c+leaf_c+fnrt_c+store_c ) < 0._r8) then terminate = itrue + termination_type = i_term_mort_type_cstarv if ( debug ) then write(fates_log(),*) 'terminating cohorts 4', & struct_c,sapw_c,leaf_c,fnrt_c,store_c,currentCohort%pft,call_index @@ -448,7 +459,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_ endif ! if (.not.currentCohort%isnew .and. level == 2) then if (terminate == itrue) then - call terminate_cohort(currentSite, currentPatch, currentCohort, bc_in) + call terminate_cohort(currentSite, currentPatch, currentCohort, bc_in, termination_type) deallocate(currentCohort, stat=istat, errmsg=smsg) if (istat/=0) then write(fates_log(),*) 'dealloc001: fail on terminate_cohorts:deallocate(currentCohort):'//trim(smsg) @@ -461,7 +472,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level , call_index, bc_ end subroutine terminate_cohorts !-------------------------------------------------------------------------------------! - subroutine terminate_cohort(currentSite, currentPatch, currentCohort, bc_in) + subroutine terminate_cohort(currentSite, currentPatch, currentCohort, bc_in, termination_type) ! ! !DESCRIPTION: ! Terminates an individual cohort and updates the site-level @@ -474,6 +485,7 @@ subroutine terminate_cohort(currentSite, currentPatch, currentCohort, bc_in) type (fates_patch_type) , intent(inout), target :: currentPatch type (fates_cohort_type), intent(inout), target :: currentCohort type(bc_in_type), intent(in) :: bc_in + integer, intent(in) :: termination_type ! !LOCAL VARIABLES: type (fates_cohort_type) , pointer :: shorterCohort @@ -491,6 +503,12 @@ subroutine terminate_cohort(currentSite, currentPatch, currentCohort, bc_in) !---------------------------------------------------------------------- + ! check termination_type; it should not be 0 + if (termination_type == 0) then + write(fates_log(),*) 'termination_type=0' + call endrun(msg=errMsg(sourcefile, __LINE__)) + endif + leaf_c = currentCohort%prt%GetState(leaf_organ, carbon12_element) store_c = currentCohort%prt%GetState(store_organ, carbon12_element) sapw_c = currentCohort%prt%GetState(sapw_organ, carbon12_element) @@ -506,16 +524,16 @@ subroutine terminate_cohort(currentSite, currentPatch, currentCohort, bc_in) ! Update the site-level carbon flux and individuals count for the appropriate canopy layer if(levcan==ican_upper) then - currentSite%term_nindivs_canopy(currentCohort%size_class,currentCohort%pft) = & - currentSite%term_nindivs_canopy(currentCohort%size_class,currentCohort%pft) + currentCohort%n + currentSite%term_nindivs_canopy(termination_type,currentCohort%size_class,currentCohort%pft) = & + currentSite%term_nindivs_canopy(termination_type,currentCohort%size_class,currentCohort%pft) + currentCohort%n - currentSite%term_carbonflux_canopy(currentCohort%pft) = currentSite%term_carbonflux_canopy(currentCohort%pft) + & + currentSite%term_carbonflux_canopy(termination_type,currentCohort%pft) = currentSite%term_carbonflux_canopy(termination_type,currentCohort%pft) + & currentCohort%n * (struct_c+sapw_c+leaf_c+fnrt_c+store_c+repro_c) else - currentSite%term_nindivs_ustory(currentCohort%size_class,currentCohort%pft) = & - currentSite%term_nindivs_ustory(currentCohort%size_class,currentCohort%pft) + currentCohort%n + currentSite%term_nindivs_ustory(termination_type,currentCohort%size_class,currentCohort%pft) = & + currentSite%term_nindivs_ustory(termination_type,currentCohort%size_class,currentCohort%pft) + currentCohort%n - currentSite%term_carbonflux_ustory(currentCohort%pft) = currentSite%term_carbonflux_ustory(currentCohort%pft) + & + currentSite%term_carbonflux_ustory(termination_type,currentCohort%pft) = currentSite%term_carbonflux_ustory(termination_type,currentCohort%pft) + & currentCohort%n * (struct_c+sapw_c+leaf_c+fnrt_c+store_c+repro_c) end if @@ -553,7 +571,7 @@ subroutine terminate_cohort(currentSite, currentPatch, currentCohort, bc_in) call currentCohort%FreeMemory() - end subroutine terminate_cohort + end subroutine terminate_cohort ! ===================================================================================== diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index fd44f07bbe..4ab881c4f6 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -90,6 +90,7 @@ module EDInitMod use PRTGenericMod, only : SetState use FatesSizeAgeTypeIndicesMod,only : get_age_class_index use DamageMainMod, only : undamaged_class + use FatesConstantsMod, only : n_term_mort_types use FatesInterfaceTypesMod , only : hlm_num_luh2_transitions ! CIME GLOBALS @@ -132,8 +133,8 @@ subroutine init_site_vars( site_in, bc_in, bc_out ) integer :: el ! - allocate(site_in%term_nindivs_canopy(1:nlevsclass,1:numpft)) - allocate(site_in%term_nindivs_ustory(1:nlevsclass,1:numpft)) + allocate(site_in%term_nindivs_canopy(1:n_term_mort_types,1:nlevsclass,1:numpft)) + allocate(site_in%term_nindivs_ustory(1:n_term_mort_types,1:nlevsclass,1:numpft)) allocate(site_in%demotion_rate(1:nlevsclass)) allocate(site_in%promotion_rate(1:nlevsclass)) allocate(site_in%imort_rate(1:nlevsclass,1:numpft)) @@ -169,8 +170,8 @@ subroutine init_site_vars( site_in, bc_in, bc_out ) allocate(site_in%fmort_cflux_ustory_damage(1,1)) end if - allocate(site_in%term_carbonflux_canopy(1:numpft)) - allocate(site_in%term_carbonflux_ustory(1:numpft)) + allocate(site_in%term_carbonflux_canopy(1:n_term_mort_types,1:numpft)) + allocate(site_in%term_carbonflux_ustory(1:n_term_mort_types,1:numpft)) allocate(site_in%imort_carbonflux(1:numpft)) allocate(site_in%fmort_carbonflux_canopy(1:numpft)) allocate(site_in%fmort_carbonflux_ustory(1:numpft)) @@ -287,15 +288,15 @@ subroutine zero_site( site_in ) site_in%ema_npp = -9999.9_r8 ! termination and recruitment info - site_in%term_nindivs_canopy(:,:) = 0._r8 - site_in%term_nindivs_ustory(:,:) = 0._r8 + site_in%term_nindivs_canopy(:,:,:) = 0._r8 + site_in%term_nindivs_ustory(:,:,:) = 0._r8 site_in%term_crownarea_canopy = 0._r8 site_in%term_crownarea_ustory = 0._r8 site_in%imort_crownarea = 0._r8 site_in%fmort_crownarea_canopy = 0._r8 site_in%fmort_crownarea_ustory = 0._r8 - site_in%term_carbonflux_canopy(:) = 0._r8 - site_in%term_carbonflux_ustory(:) = 0._r8 + site_in%term_carbonflux_canopy(:,:) = 0._r8 + site_in%term_carbonflux_ustory(:,:) = 0._r8 site_in%recruitment_rate(:) = 0._r8 site_in%imort_rate(:,:) = 0._r8 site_in%imort_carbonflux(:) = 0._r8 diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 34e5f319d7..d310f0b84b 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -380,18 +380,18 @@ module EDTypesMod real(r8) :: fmort_crownarea_canopy ! crownarea of canopy indivs killed due to fire per year. [m2/sec] real(r8) :: fmort_crownarea_ustory ! crownarea of understory indivs killed due to fire per year [m2/sec] - real(r8), allocatable :: term_nindivs_canopy(:,:) ! number of canopy individuals that were in cohorts which - ! were terminated this timestep, on size x pft - real(r8), allocatable :: term_nindivs_ustory(:,:) ! number of understory individuals that were in cohorts which - ! were terminated this timestep, on size x pft - - real(r8), allocatable :: term_carbonflux_canopy(:) ! carbon flux from live to dead pools associated - ! with termination mortality, per canopy level. [kgC/ha/day] - real(r8), allocatable :: term_carbonflux_ustory(:) ! carbon flux from live to dead pools associated - ! with termination mortality, per canopy level. [kgC/ha/day] - real(r8), allocatable :: imort_carbonflux(:) ! biomass of individuals killed due to impact mortality per year. [kgC/m2/sec] - real(r8), allocatable :: fmort_carbonflux_canopy(:) ! biomass of canopy indivs killed due to fire per year. [gC/m2/sec] - real(r8), allocatable :: fmort_carbonflux_ustory(:) ! biomass of understory indivs killed due to fire per year [gC/m2/sec] + real(r8), allocatable :: term_nindivs_canopy(:,:,:) ! number of canopy individuals that were in cohorts which + ! were terminated this timestep, by termination type, size x pft + real(r8), allocatable :: term_nindivs_ustory(:,:,:) ! number of understory individuals that were in cohorts which + ! were terminated this timestep, by termination type, size x pft + + real(r8), allocatable :: term_carbonflux_canopy(:,:) ! carbon flux from live to dead pools associated + ! with termination mortality, by termination type and pft. [kgC/ha/day] + real(r8), allocatable :: term_carbonflux_ustory(:,:) ! carbon flux from live to dead pools associated + ! with termination mortality, by termination type and pft. [kgC/ha/day] + real(r8), allocatable :: imort_carbonflux(:) ! biomass of individuals killed due to impact mortality per year, by pft. [kgC/m2/sec] + real(r8), allocatable :: fmort_carbonflux_canopy(:) ! biomass of canopy indivs killed due to fire per year, by pft. [gC/m2/sec] + real(r8), allocatable :: fmort_carbonflux_ustory(:) ! biomass of understory indivs killed due to fire per year, by pft [gC/m2/sec] real(r8), allocatable :: term_abg_flux(:,:) ! aboveground biomass lost due to termination mortality x size x pft real(r8), allocatable :: imort_abg_flux(:,:) ! aboveground biomass lost due to impact mortality x size x pft [kgC/m2/sec] diff --git a/main/FatesConstantsMod.F90 b/main/FatesConstantsMod.F90 index df3a719204..1df110c076 100644 --- a/main/FatesConstantsMod.F90 +++ b/main/FatesConstantsMod.F90 @@ -336,5 +336,10 @@ module FatesConstantsMod real(fates_r8), parameter, public :: lmr_r_2 = -0.0402_fates_r8 ! (umol CO2/m**2/s/degree C) - + ! some integers related to termination mortality + integer, parameter, public :: n_term_mort_types = 3 + integer, parameter, public :: i_term_mort_type_cstarv = 1 + integer, parameter, public :: i_term_mort_type_canlev = 2 + integer, parameter, public :: i_term_mort_type_numdens = 3 + end module FatesConstantsMod diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index 81bfef2792..71013177ec 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -576,6 +576,7 @@ module FatesHistoryInterfaceMod integer :: ih_mortality_carbonflux_si_pft integer :: ih_hydraulicmortality_carbonflux_si_pft integer :: ih_cstarvmortality_carbonflux_si_pft + integer :: ih_cstarvmortality_continuous_carbonflux_si_pft integer :: ih_firemortality_carbonflux_si_pft integer :: ih_crownarea_si_pft integer :: ih_canopycrownarea_si_pft @@ -2235,6 +2236,11 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in) use EDParamsMod , only : nlevleaf use EDParamsMod , only : ED_val_history_height_bin_edges use FatesInterfaceTypesMod , only : nlevdamage + + use FatesConstantsMod, only : n_term_mort_types + use FatesConstantsMod, only : i_term_mort_type_cstarv + use FatesConstantsMod, only : i_term_mort_type_canlev + use FatesConstantsMod, only : i_term_mort_type_numdens ! Arguments class(fates_history_interface_type) :: this @@ -2272,8 +2278,9 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in) integer :: el ! Loop index for elements integer :: model_day_int ! Integer model day since simulation start integer :: ageclass_since_anthrodist ! what is the equivalent age class for - ! time-since-anthropogenic-disturbance of secondary forest + ! time-since-anthropogenic-disturbance of secondary forest + real(r8) :: store_max ! The target nutrient mass for storage element of interest [kg] real(r8) :: n_perm2 ! individuals per m2 for the whole column real(r8) :: dbh ! diameter ("at breast height") @@ -2348,6 +2355,7 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in) hio_mortality_si_pft => this%hvars(ih_mortality_si_pft)%r82d, & hio_mortality_carbonflux_si_pft => this%hvars(ih_mortality_carbonflux_si_pft)%r82d, & hio_cstarvmortality_carbonflux_si_pft => this%hvars(ih_cstarvmortality_carbonflux_si_pft)%r82d, & + hio_cstarvmortality_continuous_carbonflux_si_pft => this%hvars(ih_cstarvmortality_continuous_carbonflux_si_pft)%r82d, & hio_hydraulicmortality_carbonflux_si_pft => this%hvars(ih_hydraulicmortality_carbonflux_si_pft)%r82d, & hio_firemortality_carbonflux_si_pft => this%hvars(ih_firemortality_carbonflux_si_pft)%r82d, & hio_crownarea_si_pft => this%hvars(ih_crownarea_si_pft)%r82d, & @@ -3397,6 +3405,9 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in) hio_cstarvmortality_carbonflux_si_pft(io_si,ccohort%pft) = hio_cstarvmortality_carbonflux_si_pft(io_si,ccohort%pft) + & ccohort%cmort * total_m * ccohort%n * days_per_sec * years_per_day * ha_per_m2 + hio_cstarvmortality_continuous_carbonflux_si_pft(io_si,ccohort%pft) = hio_cstarvmortality_continuous_carbonflux_si_pft(io_si,ccohort%pft) + & + ccohort%cmort * total_m * ccohort%n * days_per_sec * years_per_day * ha_per_m2 + ! Aboveground mortality hio_abg_mortality_cflux_si_scpf(io_si,scpf) = hio_abg_mortality_cflux_si_scpf(io_si,scpf) + & (ccohort%bmort + ccohort%hmort + ccohort%cmort + & @@ -3882,34 +3893,69 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in) ! pass the cohort termination mortality as a flux to the history, and then reset the termination mortality buffer ! note there are various ways of reporting the total mortality, so pass to these as well + do i_pft = 1, numpft + hio_cstarvmortality_carbonflux_si_pft(io_si,i_pft) = hio_cstarvmortality_carbonflux_si_pft(io_si,i_pft) + & + (sites(s)%term_carbonflux_ustory(i_term_mort_type_cstarv,i_pft) + & + sites(s)%term_carbonflux_canopy(i_term_mort_type_cstarv,i_pft)) * days_per_sec * ha_per_m2 + end do + do i_pft = 1, numpft do i_scls = 1,nlevsclass i_scpf = (i_pft-1)*nlevsclass + i_scls ! ! termination mortality. sum of canopy and understory indices - hio_m6_si_scpf(io_si,i_scpf) = (sites(s)%term_nindivs_canopy(i_scls,i_pft) + & - sites(s)%term_nindivs_ustory(i_scls,i_pft)) * & + ! move carbon starvation-related termination mortality to the carbon starvation mortality type and only consider + ! the other two types of termination mortality here. + + hio_m6_si_scpf(io_si,i_scpf) = (sum(sites(s)%term_nindivs_canopy(i_term_mort_type_canlev:n_term_mort_types,i_scls,i_pft)) + & + sum(sites(s)%term_nindivs_ustory(i_term_mort_type_canlev:n_term_mort_types,i_scls,i_pft))) * & days_per_year / m2_per_ha hio_m6_si_scls(io_si,i_scls) = hio_m6_si_scls(io_si,i_scls) + & - (sites(s)%term_nindivs_canopy(i_scls,i_pft) + & - sites(s)%term_nindivs_ustory(i_scls,i_pft)) * & + (sum(sites(s)%term_nindivs_canopy(i_term_mort_type_canlev:n_term_mort_types,i_scls,i_pft)) + & + sum(sites(s)%term_nindivs_ustory(i_term_mort_type_canlev:n_term_mort_types,i_scls,i_pft))) * & days_per_year / m2_per_ha ! - ! add termination mortality to canopy and understory mortality + ! add the carbon starvation-related termination mortality to the carbon starvation diagnostics + hio_m3_si_scpf(io_si,i_scpf) = hio_m3_si_scpf(io_si,i_scpf) + & + (sites(s)%term_nindivs_canopy(i_term_mort_type_cstarv,i_scls,i_pft) + & + sites(s)%term_nindivs_ustory(i_term_mort_type_cstarv,i_scls,i_pft)) * & + days_per_year / m2_per_ha + ! + hio_m3_si_scls(io_si,i_scls) = hio_m3_si_scls(io_si,i_scls) + & + (sites(s)%term_nindivs_canopy(i_term_mort_type_cstarv,i_scls,i_pft) + & + sites(s)%term_nindivs_ustory(i_term_mort_type_cstarv,i_scls,i_pft)) * & + days_per_year / m2_per_ha + + + ! add c-starve termination mortality to canopy and understory M3 mortality (N/m^2/yr) + hio_m3_mortality_canopy_si_scpf(io_si,i_scpf) = hio_m3_mortality_canopy_si_scpf(io_si,i_scpf) + & + sites(s)%term_nindivs_canopy(i_term_mort_type_cstarv,i_scls,i_pft) * days_per_year / m2_per_ha + + hio_m3_mortality_understory_si_scpf(io_si,i_scpf) = hio_m3_mortality_understory_si_scpf(io_si,i_scpf) + & + sites(s)%term_nindivs_ustory(i_term_mort_type_cstarv,i_scls,i_pft) * days_per_year / m2_per_ha + + hio_m3_mortality_canopy_si_scls(io_si,i_scls) = hio_m3_mortality_canopy_si_scls(io_si,i_scls) + & + sites(s)%term_nindivs_canopy(i_term_mort_type_cstarv,i_scls,i_pft) * days_per_year / m2_per_ha + + hio_m3_mortality_understory_si_scls(io_si,i_scls) = hio_m3_mortality_understory_si_scls(io_si,i_scls) + & + sites(s)%term_nindivs_ustory(i_term_mort_type_cstarv,i_scls,i_pft) * days_per_year / m2_per_ha + + ! + ! add termination mortality to canopy and understory mortality (N/m^2/yr) hio_mortality_canopy_si_scls(io_si,i_scls) = hio_mortality_canopy_si_scls(io_si,i_scls) + & - sites(s)%term_nindivs_canopy(i_scls,i_pft) * days_per_year / m2_per_ha + sum(sites(s)%term_nindivs_canopy(:,i_scls,i_pft)) * days_per_year / m2_per_ha hio_mortality_understory_si_scls(io_si,i_scls) = hio_mortality_understory_si_scls(io_si,i_scls) + & - sites(s)%term_nindivs_ustory(i_scls,i_pft) * days_per_year / m2_per_ha + sum(sites(s)%term_nindivs_ustory(:,i_scls,i_pft)) * days_per_year / m2_per_ha hio_mortality_canopy_si_scpf(io_si,i_scpf) = hio_mortality_canopy_si_scpf(io_si,i_scpf) + & - sites(s)%term_nindivs_canopy(i_scls,i_pft) * days_per_year / m2_per_ha + sum(sites(s)%term_nindivs_canopy(:,i_scls,i_pft)) * days_per_year / m2_per_ha hio_mortality_understory_si_scpf(io_si,i_scpf) = hio_mortality_understory_si_scpf(io_si,i_scpf) + & - sites(s)%term_nindivs_ustory(i_scls,i_pft) * days_per_year / m2_per_ha + sum(sites(s)%term_nindivs_ustory(:,i_scls,i_pft)) * days_per_year / m2_per_ha - ! + ! ! imort on its own hio_m4_si_scpf(io_si,i_scpf) = sites(s)%imort_rate(i_scls, i_pft) / m2_per_ha hio_m4_si_scls(io_si,i_scls) = hio_m4_si_scls(io_si,i_scls) + sites(s)%imort_rate(i_scls, i_pft) / m2_per_ha @@ -3988,8 +4034,8 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in) (sites(s)%fmort_carbonflux_canopy(i_pft) + & sites(s)%fmort_carbonflux_ustory(i_pft) ) / g_per_kg + & sites(s)%imort_carbonflux(i_pft) + & - sites(s)%term_carbonflux_ustory(i_pft) * days_per_sec * ha_per_m2 + & - sites(s)%term_carbonflux_canopy(i_pft) * days_per_sec * ha_per_m2 + sum(sites(s)%term_carbonflux_ustory(:,i_pft)) * days_per_sec * ha_per_m2 + & + sum(sites(s)%term_carbonflux_canopy(:,i_pft)) * days_per_sec * ha_per_m2 hio_firemortality_carbonflux_si_pft(io_si,i_pft) = sites(s)%fmort_carbonflux_canopy(i_pft) / g_per_kg end do @@ -4040,8 +4086,8 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in) end do end if - sites(s)%term_nindivs_canopy(:,:) = 0._r8 - sites(s)%term_nindivs_ustory(:,:) = 0._r8 + sites(s)%term_nindivs_canopy(:,:,:) = 0._r8 + sites(s)%term_nindivs_ustory(:,:,:) = 0._r8 sites(s)%imort_carbonflux(:) = 0._r8 sites(s)%imort_rate(:,:) = 0._r8 sites(s)%fmort_rate_canopy(:,:) = 0._r8 @@ -4454,10 +4500,10 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in) ! mortality-associated carbon fluxes hio_canopy_mortality_carbonflux_si(io_si) = hio_canopy_mortality_carbonflux_si(io_si) + & - sum(sites(s)%term_carbonflux_canopy(:)) * days_per_sec * ha_per_m2 + sum(sites(s)%term_carbonflux_canopy(:,:)) * days_per_sec * ha_per_m2 hio_understory_mortality_carbonflux_si(io_si) = hio_understory_mortality_carbonflux_si(io_si) + & - sum(sites(s)%term_carbonflux_ustory(:)) * days_per_sec * ha_per_m2 + sum(sites(s)%term_carbonflux_ustory(:,:)) * days_per_sec * ha_per_m2 ! add site level mortality counting to crownarea diagnostic hio_canopy_mortality_crownarea_si(io_si) = hio_canopy_mortality_crownarea_si(io_si) + & @@ -4470,8 +4516,8 @@ subroutine update_history_dyn(this,nc,nsites,sites,bc_in) sites(s)%imort_crownarea ! and zero the site-level termination carbon flux variable - sites(s)%term_carbonflux_canopy(:) = 0._r8 - sites(s)%term_carbonflux_ustory(:) = 0._r8 + sites(s)%term_carbonflux_canopy(:,:) = 0._r8 + sites(s)%term_carbonflux_ustory(:,:) = 0._r8 ! ! add the site-level disturbance-associated cwd and litter input fluxes to thir respective flux fields @@ -6886,11 +6932,17 @@ subroutine define_history_vars(this, initialize_variables) index=ih_hydraulicmortality_carbonflux_si_pft) call this%set_history_var(vname='FATES_MORTALITY_CSTARV_CFLUX_PF', units='kg m-2 s-1', & - long='PFT-level flux of biomass carbon from live to dead pool from carbon starvation mortality', & + long='PFT-level flux of biomass carbon from live to dead pool from carbon starvation mortality (both continuous and termination)', & use_default='active', avgflag='A', vtype=site_pft_r8, hlms='CLM:ALM', & upfreq=1, ivar=ivar, initialize=initialize_variables, & index=ih_cstarvmortality_carbonflux_si_pft) + call this%set_history_var(vname='FATES_MORT_CSTARV_CONT_CFLUX_PF', units='kg m-2 s-1', & + long='PFT-level flux of biomass carbon from live to dead pool from carbon starvation mortality (Continuous-only, without termination)', & + use_default='active', avgflag='A', vtype=site_pft_r8, hlms='CLM:ALM', & + upfreq=1, ivar=ivar, initialize=initialize_variables, & + index=ih_cstarvmortality_continuous_carbonflux_si_pft) + call this%set_history_var(vname='FATES_ABOVEGROUND_MORT_SZPF', units='kg m-2 s-1', & long='Aboveground flux of carbon from AGB to necromass due to mortality', & use_default='inactive', avgflag='A', vtype=site_size_pft_r8, hlms='CLM:ALM', & @@ -7165,7 +7217,7 @@ subroutine define_history_vars(this, initialize_variables) call this%set_history_var(vname='FATES_MORTALITY_CSTARV_SZPF', & units = 'm-2 yr-1', & - long='carbon starvation mortality by pft/size in number of plants per m2 per year', & + long='carbon starvation mortality by pft/size in number of plants per m2 per year (both continous and termination)', & use_default='inactive', avgflag='A', vtype=site_size_pft_r8, & hlms='CLM:ALM', upfreq=1, ivar=ivar, & initialize=initialize_variables, index = ih_m3_si_scpf) @@ -7200,7 +7252,7 @@ subroutine define_history_vars(this, initialize_variables) call this%set_history_var(vname='FATES_MORTALITY_TERMINATION_SZPF', & units = 'm-2 yr-1', & - long='termination mortality by pft/size in number pf plants per m2 per year', & + long='termination mortality (excluding C-starvation) by pft/size in number pf plants per m2 per year', & use_default='inactive', avgflag='A', vtype=site_size_pft_r8, & hlms='CLM:ALM', upfreq=1, ivar=ivar, & initialize=initialize_variables, index = ih_m6_si_scpf) @@ -7248,14 +7300,14 @@ subroutine define_history_vars(this, initialize_variables) initialize=initialize_variables, index = ih_mortality_canopy_si_scpf) call this%set_history_var(vname='FATES_M3_MORTALITY_CANOPY_SZPF', & - units = 'N/ha/yr', & + units = 'm-2 yr-1', & long='C starvation mortality of canopy plants by pft/size', & use_default='inactive', avgflag='A', vtype=site_size_pft_r8, & hlms='CLM:ALM', upfreq=1, ivar=ivar, & initialize=initialize_variables, index = ih_m3_mortality_canopy_si_scpf ) call this%set_history_var(vname='FATES_M3_MORTALITY_USTORY_SZPF', & - units = 'N/ha/yr', & + units = 'm-2 yr-1', & long='C starvation mortality of understory plants by pft/size', & use_default='inactive', avgflag='A', vtype=site_size_pft_r8, & hlms='CLM:ALM', upfreq=1, ivar=ivar, & @@ -7540,14 +7592,14 @@ subroutine define_history_vars(this, initialize_variables) initialize=initialize_variables, index = ih_nplant_understory_si_scls) call this%set_history_var(vname='FATES_M3_MORTALITY_CANOPY_SZ', & - units = 'N/ha/yr', & + units = 'm-2 yr-1', & long='C starvation mortality of canopy plants by size', & use_default='inactive', avgflag='A', vtype=site_size_r8, & hlms='CLM:ALM', upfreq=1, ivar=ivar, & initialize=initialize_variables, index = ih_m3_mortality_canopy_si_scls ) call this%set_history_var(vname='FATES_M3_MORTALITY_USTORY_SZ', & - units = 'N/ha/yr', & + units = 'm-2 yr-1', & long='C starvation mortality of understory plants by size', & use_default='inactive', avgflag='A', vtype=site_size_r8, & hlms='CLM:ALM', upfreq=1, ivar=ivar, & @@ -7594,7 +7646,7 @@ subroutine define_history_vars(this, initialize_variables) call this%set_history_var(vname='FATES_MORTALITY_CSTARV_SZ', & units = 'm-2 yr-1', & - long='carbon starvation mortality by size in number of plants per m2 per year', & + long='carbon starvation mortality by size in number of plants per m2 per year (both continous and termination)', & use_default='active', avgflag='A', vtype=site_size_r8, & hlms='CLM:ALM', upfreq=1, ivar=ivar, & initialize=initialize_variables, index = ih_m3_si_scls) @@ -7636,7 +7688,7 @@ subroutine define_history_vars(this, initialize_variables) call this%set_history_var(vname='FATES_MORTALITY_TERMINATION_SZ', & units = 'm-2 yr-1', & - long='termination mortality by size in number of plants per m2 per year', & + long='termination mortality (excluding C-starvation) by size in number of plants per m2 per year', & use_default='active', avgflag='A', vtype=site_size_r8, & hlms='CLM:ALM', upfreq=1, ivar=ivar, & initialize=initialize_variables, index = ih_m6_si_scls) diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index a2e7089c76..90e282253b 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -50,9 +50,10 @@ module FatesRestartInterfaceMod use TwoStreamMLPEMod, only : normalized_upper_boundary use EDParamsMod, only : regeneration_model use EDParamsMod, only : radiation_model + use FatesConstantsMod, only : n_term_mort_types use FatesConstantsMod, only : n_landuse_cats use FatesConstantsMod, only : N_DIST_TYPES - + ! CIME GLOBALS use shr_log_mod , only : errMsg => shr_log_errMsg @@ -1991,6 +1992,8 @@ subroutine set_restart_vectors(this,nc,nsites,sites) integer :: io_idx_si_pft ! each site-pft index integer :: io_idx_si_vtmem ! indices for veg-temp memory at site integer :: io_idx_pa_ncl ! each canopy layer within each patch + integer :: io_idx_si_scpf_term ! loop counter for scls, pft, and termination type + integer :: io_idx_si_pft_term ! loop counter for pft, and termination type integer :: io_idx_si_luludi ! site-level lu x lu x ndist index ! Some counters (for checking mostly) @@ -2014,8 +2017,9 @@ subroutine set_restart_vectors(this,nc,nsites,sites) integer :: i_cdam ! loop counter for damage integer :: icdi ! loop counter for damage integer :: icdj ! loop counter for damage + integer :: i_term_type ! loop counter for termination type integer :: i_lu_donor, i_lu_receiver, i_dist ! loop counters for land use and disturbance - + type(fates_restart_variable_type) :: rvar type(fates_patch_type),pointer :: cpatch type(fates_cohort_type),pointer :: ccohort @@ -2175,6 +2179,8 @@ subroutine set_restart_vectors(this,nc,nsites,sites) io_idx_si_cdpf = io_idx_co_1st io_idx_si_scpf = io_idx_co_1st io_idx_si_pft = io_idx_co_1st + io_idx_si_scpf_term = io_idx_co_1st + io_idx_si_pft_term = io_idx_co_1st io_idx_si_luludi = io_idx_co_1st ! recruitment rate @@ -2197,19 +2203,25 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_imortrate_siscpf(io_idx_si_scpf) = sites(s)%imort_rate(i_scls, i_pft) rio_fmortrate_crown_siscpf(io_idx_si_scpf) = sites(s)%fmort_rate_crown(i_scls, i_pft) rio_fmortrate_cambi_siscpf(io_idx_si_scpf) = sites(s)%fmort_rate_cambial(i_scls, i_pft) - rio_termnindiv_cano_siscpf(io_idx_si_scpf) = sites(s)%term_nindivs_canopy(i_scls,i_pft) - rio_termnindiv_usto_siscpf(io_idx_si_scpf) = sites(s)%term_nindivs_ustory(i_scls,i_pft) rio_growflx_fusion_siscpf(io_idx_si_scpf) = sites(s)%growthflux_fusion(i_scls, i_pft) rio_abg_term_flux_siscpf(io_idx_si_scpf) = sites(s)%term_abg_flux(i_scls, i_pft) rio_abg_imort_flux_siscpf(io_idx_si_scpf) = sites(s)%imort_abg_flux(i_scls, i_pft) rio_abg_fmort_flux_siscpf(io_idx_si_scpf) = sites(s)%fmort_abg_flux(i_scls, i_pft) io_idx_si_scpf = io_idx_si_scpf + 1 + do i_term_type = 1, n_term_mort_types + rio_termnindiv_cano_siscpf(io_idx_si_scpf_term) = sites(s)%term_nindivs_canopy(i_term_type,i_scls,i_pft) + rio_termnindiv_usto_siscpf(io_idx_si_scpf_term) = sites(s)%term_nindivs_ustory(i_term_type,i_scls,i_pft) + io_idx_si_scpf_term = io_idx_si_scpf_term + 1 + end do end do end do do i_pft = 1, numpft - rio_termcflux_cano_sipft(io_idx_si_pft) = sites(s)%term_carbonflux_canopy(i_pft) - rio_termcflux_usto_sipft(io_idx_si_pft) = sites(s)%term_carbonflux_ustory(i_pft) + do i_term_type = 1, n_term_mort_types + rio_termcflux_cano_sipft(io_idx_si_pft_term) = sites(s)%term_carbonflux_canopy(i_term_type,i_pft) + rio_termcflux_usto_sipft(io_idx_si_pft_term) = sites(s)%term_carbonflux_ustory(i_term_type,i_pft) + io_idx_si_pft_term = io_idx_si_pft_term + 1 + end do rio_fmortcflux_cano_sipft(io_idx_si_pft) = sites(s)%fmort_carbonflux_canopy(i_pft) rio_fmortcflux_usto_sipft(io_idx_si_pft) = sites(s)%fmort_carbonflux_ustory(i_pft) rio_imortcflux_sipft(io_idx_si_pft) = sites(s)%imort_carbonflux(i_pft) @@ -2955,6 +2967,8 @@ subroutine get_restart_vectors(this, nc, nsites, sites) integer :: io_idx_si_cdpf ! damage x size x pft within site integer :: io_idx_pa_ncl ! each canopy layer within each patch + integer :: io_idx_si_scpf_term ! loop counter for scls, pft, and termination type + integer :: io_idx_si_pft_term ! loop counter for pft, and termination type integer :: io_idx_si_luludi ! site-level lu x lu x ndist index ! Some counters (for checking mostly) @@ -2975,7 +2989,8 @@ subroutine get_restart_vectors(this, nc, nsites, sites) integer :: i_cdam ! loop counter for damage class integer :: icdj ! loop counter for damage class integer :: icdi ! loop counter for damage class - integer :: i_lu_donor, i_lu_receiver, i_dist ! loop counters for land use and disturbance + integer :: i_term_type ! loop counter for termination type + integer :: i_lu_donor, i_lu_receiver, i_dist ! loop counters for land use and disturbance associate( rio_npatch_si => this%rvars(ir_npatch_si)%int1d, & rio_cd_status_si => this%rvars(ir_cd_status_si)%int1d, & @@ -3121,6 +3136,9 @@ subroutine get_restart_vectors(this, nc, nsites, sites) io_idx_si_cdpf = io_idx_co_1st io_idx_si_scpf = io_idx_co_1st io_idx_si_pft = io_idx_co_1st + io_idx_si_scpf_term = io_idx_co_1st + io_idx_si_pft_term = io_idx_co_1st + io_idx_si_luludi = io_idx_co_1st ! read seed_bank info(site-level, but PFT-resolved) @@ -3150,19 +3168,25 @@ subroutine get_restart_vectors(this, nc, nsites, sites) sites(s)%imort_rate(i_scls, i_pft) = rio_imortrate_siscpf(io_idx_si_scpf) sites(s)%fmort_rate_crown(i_scls, i_pft) = rio_fmortrate_crown_siscpf(io_idx_si_scpf) sites(s)%fmort_rate_cambial(i_scls, i_pft) = rio_fmortrate_cambi_siscpf(io_idx_si_scpf) - sites(s)%term_nindivs_canopy(i_scls,i_pft) = rio_termnindiv_cano_siscpf(io_idx_si_scpf) - sites(s)%term_nindivs_ustory(i_scls,i_pft) = rio_termnindiv_usto_siscpf(io_idx_si_scpf) sites(s)%growthflux_fusion(i_scls, i_pft) = rio_growflx_fusion_siscpf(io_idx_si_scpf) sites(s)%term_abg_flux(i_scls,i_pft) = rio_abg_term_flux_siscpf(io_idx_si_scpf) sites(s)%imort_abg_flux(i_scls,i_pft) = rio_abg_imort_flux_siscpf(io_idx_si_scpf) sites(s)%fmort_abg_flux(i_scls,i_pft) = rio_abg_fmort_flux_siscpf(io_idx_si_scpf) io_idx_si_scpf = io_idx_si_scpf + 1 + do i_term_type = 1, n_term_mort_types + sites(s)%term_nindivs_canopy(i_term_type,i_scls,i_pft) = rio_termnindiv_cano_siscpf(io_idx_si_scpf_term) + sites(s)%term_nindivs_ustory(i_term_type,i_scls,i_pft) = rio_termnindiv_usto_siscpf(io_idx_si_scpf_term) + io_idx_si_scpf_term = io_idx_si_scpf_term + 1 + end do end do end do do i_pft = 1, numpft - sites(s)%term_carbonflux_canopy(i_pft) = rio_termcflux_cano_sipft(io_idx_si_pft) - sites(s)%term_carbonflux_ustory(i_pft) = rio_termcflux_usto_sipft(io_idx_si_pft) + do i_term_type = 1, n_term_mort_types + sites(s)%term_carbonflux_canopy(i_term_type,i_pft) = rio_termcflux_cano_sipft(io_idx_si_pft_term) + sites(s)%term_carbonflux_ustory(i_term_type,i_pft) = rio_termcflux_usto_sipft(io_idx_si_pft_term) + io_idx_si_pft_term = io_idx_si_pft_term + 1 + end do sites(s)%fmort_carbonflux_canopy(i_pft) = rio_fmortcflux_cano_sipft(io_idx_si_pft) sites(s)%fmort_carbonflux_ustory(i_pft) = rio_fmortcflux_usto_sipft(io_idx_si_pft) sites(s)%imort_carbonflux(i_pft) = rio_imortcflux_sipft(io_idx_si_pft)