From 3c8e46e5f135641f58b653093a28acd86c43bf3a Mon Sep 17 00:00:00 2001 From: ckoven Date: Mon, 20 Aug 2018 15:31:17 -0600 Subject: [PATCH 01/23] changed diagnostic calculation of fmort to correct for changing N. also added cambial and crown fire mort diagnostci variables --- biogeochem/EDPatchDynamicsMod.F90 | 14 +++++++++++++- main/EDInitMod.F90 | 6 ++++++ main/EDTypesMod.F90 | 3 +++ main/FatesHistoryInterfaceMod.F90 | 25 +++++++++++++++++++++++-- 4 files changed, 45 insertions(+), 3 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 358f342297..5c02d31a43 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -503,6 +503,17 @@ subroutine spawn_patches( currentSite, bc_in) ! loss of individuals from source patch due to area shrinking currentCohort%n = currentCohort%n * (1._r8 - patch_site_areadis/currentPatch%area) + ! before changing number densities, keep track of the total rate of trees that died due to fire, as well as from each fire mortality term + currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft) = & + currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft) + & + nc%n * currentCohort%fire_mort / hlm_freq_day + currentSite%fmort_rate_cambial(currentCohort%size_class, currentCohort%pft) = & + currentSite%fmort_rate_cambial(currentCohort%size_class, currentCohort%pft) + & + nc%n * currentCohort%crownfire_mort / hlm_freq_day + currentSite%fmort_rate_crown(currentCohort%size_class, currentCohort%pft) = & + currentSite%fmort_rate_crown(currentCohort%size_class, currentCohort%pft) + & + nc%n * currentCohort%cambial_mort / hlm_freq_day + ! loss of individual from fire in new patch. nc%n = nc%n * (1.0_r8 - currentCohort%fire_mort) @@ -516,7 +527,8 @@ subroutine spawn_patches( currentSite, bc_in) nc%lmort_direct = currentCohort%lmort_direct nc%lmort_collateral = currentCohort%lmort_collateral nc%lmort_infra = currentCohort%lmort_infra - + + ! Logging is the dominant disturbance elseif (currentPatch%disturbance_rates(dtype_ilog) > currentPatch%disturbance_rates(dtype_ifall) .and. & currentPatch%disturbance_rates(dtype_ilog) > currentPatch%disturbance_rates(dtype_ifire)) then ! Logging diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 64286c1fee..be09e7c1cd 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -72,6 +72,9 @@ subroutine init_site_vars( site_in ) allocate(site_in%demotion_rate(1:nlevsclass)) allocate(site_in%promotion_rate(1:nlevsclass)) allocate(site_in%imort_rate(1:nlevsclass,1:numpft)) + allocate(site_in%fmort_rate(1:nlevsclass,1:numpft)) + allocate(site_in%fmort_rate_cambial(1:nlevsclass,1:numpft)) + allocate(site_in%fmort_rate_crown(1:nlevsclass,1:numpft)) ! end subroutine init_site_vars @@ -125,6 +128,9 @@ subroutine zero_site( site_in ) site_in%recruitment_rate(:) = 0._r8 site_in%imort_rate(:,:) = 0._r8 site_in%imort_carbonflux = 0._r8 + site_in%fmort_rate(:,:) = 0._r8 + site_in%fmort_rate_cambial(:,:) = 0._r8 + site_in%fmort_rate_crown(:,:) = 0._r8 ! demotion/promotion info site_in%demotion_rate(:) = 0._r8 diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 7d4c2e2841..e9c5a96f99 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -596,6 +596,9 @@ module EDTypesMod real(r8) :: promotion_carbonflux ! biomass of promoted individuals from understory to canopy [kgC/ha/day] real(r8), allocatable :: imort_rate(:,:) ! rate of individuals killed due to impact mortality per year. on size x pft array real(r8) :: imort_carbonflux ! biomass of individuals killed due to impact mortality per year. [kgC/ha/day] + real(r8), allocatable :: fmort_rate(:,:) ! rate of individuals killed due to fire mortality per year. on size x pft array + real(r8), allocatable :: fmort_rate_cambial(:,:) ! rate of individuals killed due to fire mortality from cambial damage per year. on size x pft array + real(r8), allocatable :: fmort_rate_crown(:,:) ! rate of individuals killed due to fire mortality from crown damage per year. on size x pft array ! some diagnostic-only (i.e. not resolved by ODE solver) flux of carbon to CWD and litter pools from termination and canopy mortality real(r8) :: CWD_AG_diagnostic_input_carbonflux(1:ncwd) ! diagnostic flux to AG CWD [kg C / m2 / yr] diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index 7497d53673..267d81954a 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -1398,6 +1398,8 @@ subroutine update_history_dyn(this,nc,nsites,sites) hio_m6_si_scpf => this%hvars(ih_m6_si_scpf)%r82d, & hio_m7_si_scpf => this%hvars(ih_m7_si_scpf)%r82d, & hio_m8_si_scpf => this%hvars(ih_m8_si_scpf)%r82d, & + hio_crownfiremort_si_scpf => this%hvars(ih_crownfiremort_si_scpf)%r82d, & + hio_cambialfiremort_si_scpf => this%hvars(ih_cambialfiremort_si_scpf)%r82d, & hio_m1_si_scls => this%hvars(ih_m1_si_scls)%r82d, & hio_m2_si_scls => this%hvars(ih_m2_si_scls)%r82d, & @@ -1725,7 +1727,6 @@ subroutine update_history_dyn(this,nc,nsites,sites) hio_m1_si_scpf(io_si,scpf) = hio_m1_si_scpf(io_si,scpf) + ccohort%bmort*ccohort%n hio_m2_si_scpf(io_si,scpf) = hio_m2_si_scpf(io_si,scpf) + ccohort%hmort*ccohort%n hio_m3_si_scpf(io_si,scpf) = hio_m3_si_scpf(io_si,scpf) + ccohort%cmort*ccohort%n - hio_m5_si_scpf(io_si,scpf) = hio_m5_si_scpf(io_si,scpf) + ccohort%fmort*ccohort%n hio_m7_si_scpf(io_si,scpf) = hio_m7_si_scpf(io_si,scpf) + & (ccohort%lmort_direct+ccohort%lmort_collateral+ccohort%lmort_infra) * ccohort%n hio_m8_si_scpf(io_si,scpf) = hio_m8_si_scpf(io_si,scpf) + ccohort%frmort*ccohort%n @@ -1733,7 +1734,6 @@ subroutine update_history_dyn(this,nc,nsites,sites) hio_m1_si_scls(io_si,scls) = hio_m1_si_scls(io_si,scls) + ccohort%bmort*ccohort%n hio_m2_si_scls(io_si,scls) = hio_m2_si_scls(io_si,scls) + ccohort%hmort*ccohort%n hio_m3_si_scls(io_si,scls) = hio_m3_si_scls(io_si,scls) + ccohort%cmort*ccohort%n - hio_m5_si_scls(io_si,scls) = hio_m5_si_scls(io_si,scls) + ccohort%fmort*ccohort%n hio_m7_si_scls(io_si,scls) = hio_m7_si_scls(io_si,scls) + & (ccohort%lmort_direct+ccohort%lmort_collateral+ccohort%lmort_infra) * ccohort%n hio_m8_si_scls(io_si,scls) = hio_m8_si_scls(io_si,scls) + & @@ -2108,6 +2108,14 @@ subroutine update_history_dyn(this,nc,nsites,sites) iscag = i_scls ! since imort is by definition something that only happens in newly disturbed patches, treat as such hio_mortality_understory_si_scag(io_si,iscag) = hio_mortality_understory_si_scag(io_si,iscag) + & sites(s)%imort_rate(i_scls, i_pft) + ! + ! fire mortality from the site-level diagnostic rates + hio_m5_si_scpf(io_si,i_scpf) = sites(s)%fmort_rate(i_scls, i_pft) + hio_m5_si_scls(io_si,i_scls) = hio_m5_si_scls(io_si,i_scls) + sites(s)%fmort_rate(i_scls, i_pft) + ! + hio_crownfiremort_si_scpf(io_si,i_scpf) = sites(s)%fmort_rate_crown(i_scls, i_pft) + hio_cambialfiremort_si_scpf(io_si,i_scpf) = sites(s)%fmort_rate_cambial(i_scls, i_pft) + ! end do end do ! @@ -2118,6 +2126,9 @@ subroutine update_history_dyn(this,nc,nsites,sites) sites(s)%terminated_nindivs(:,:,:) = 0._r8 sites(s)%imort_carbonflux = 0._r8 sites(s)%imort_rate(:,:) = 0._r8 + sites(s)%fmort_rate(:,:) = 0._r8 + sites(s)%fmort_rate_cambial(:,:) = 0._r8 + sites(s)%fmort_rate_crown(:,:) = 0._r8 ! pass the recruitment rate as a flux to the history, and then reset the recruitment buffer do i_pft = 1, numpft @@ -3789,6 +3800,16 @@ subroutine define_history_vars(this, initialize_variables) avgflag='A', vtype=site_size_pft_r8, hlms='CLM:ALM', flushval=0.0_r8, & upfreq=1, ivar=ivar, initialize=initialize_variables, index = ih_m5_si_scpf ) + call this%set_history_var(vname='CROWNFIREMORT_SCPF', units = 'N/ha/yr', & + long='crown fire mortality by pft/size',use_default='inactive', & + avgflag='A', vtype=site_size_pft_r8, hlms='CLM:ALM', flushval=0.0_r8, & + upfreq=1, ivar=ivar, initialize=initialize_variables, index = ih_crownfiremort_si_scpf ) + + call this%set_history_var(vname='CAMBIALFIREMORT_SCPF', units = 'N/ha/yr', & + long='cambial fire mortality by pft/size',use_default='inactive', & + avgflag='A', vtype=site_size_pft_r8, hlms='CLM:ALM', flushval=0.0_r8, & + upfreq=1, ivar=ivar, initialize=initialize_variables, index = ih_cambialfiremort_si_scpf ) + call this%set_history_var(vname='M6_SCPF', units = 'N/ha/yr', & long='termination mortality by pft/size',use_default='inactive', & avgflag='A', vtype=site_size_pft_r8, hlms='CLM:ALM', flushval=0.0_r8, & From 7ec047201b9ad1ae620ccb42ae88f3feb9092e14 Mon Sep 17 00:00:00 2001 From: ckoven Date: Mon, 20 Aug 2018 17:12:50 -0600 Subject: [PATCH 02/23] stratified site-level fire mort by canopy, incldued carbon flux term, and got rid of old fmort variable entirely --- biogeochem/EDCohortDynamicsMod.F90 | 2 -- biogeochem/EDPatchDynamicsMod.F90 | 25 +++++++-------- main/EDInitMod.F90 | 5 +-- main/EDMainMod.F90 | 1 - main/EDTypesMod.F90 | 11 +++---- main/FatesHistoryInterfaceMod.F90 | 51 ++++++++++++++++++++++-------- main/FatesRestartInterfaceMod.F90 | 10 ------ 7 files changed, 58 insertions(+), 47 deletions(-) diff --git a/biogeochem/EDCohortDynamicsMod.F90 b/biogeochem/EDCohortDynamicsMod.F90 index 7f9832a8e6..9d82afd13e 100644 --- a/biogeochem/EDCohortDynamicsMod.F90 +++ b/biogeochem/EDCohortDynamicsMod.F90 @@ -784,7 +784,6 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in) currentCohort%cmort = (currentCohort%n*currentCohort%cmort + nextc%n*nextc%cmort)/newn currentCohort%hmort = (currentCohort%n*currentCohort%hmort + nextc%n*nextc%hmort)/newn currentCohort%bmort = (currentCohort%n*currentCohort%bmort + nextc%n*nextc%bmort)/newn - currentCohort%fmort = (currentCohort%n*currentCohort%fmort + nextc%n*nextc%fmort)/newn currentCohort%frmort = (currentCohort%n*currentCohort%frmort + nextc%n*nextc%frmort)/newn ! logging mortality, Yi Xu @@ -1191,7 +1190,6 @@ subroutine copy_cohort( currentCohort,copyc ) ! Mortality diagnostics n%cmort = o%cmort n%bmort = o%bmort - n%fmort = o%fmort n%hmort = o%hmort n%frmort = o%frmort diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 5c02d31a43..1118b7fd6d 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -128,7 +128,6 @@ subroutine disturbance_rates( site_in, bc_in) currentCohort%bmort = bmort currentCohort%hmort = hmort currentCohort%frmort = frmort - currentCohort%fmort = 0.0_r8 ! Fire mortality is initialized as zero, but may be changed call LoggingMortality_frac(currentCohort%pft, currentCohort%dbh, & lmort_direct,lmort_collateral,lmort_infra ) @@ -205,7 +204,6 @@ subroutine disturbance_rates( site_in, bc_in) currentCohort => currentPatch%shortest do while(associated(currentCohort)) if(currentCohort%canopy_layer == 1)then - currentCohort%fmort = 0.0_r8 currentCohort%cmort = currentCohort%cmort*(1.0_r8 - fates_mortality_disturbance_fraction) currentCohort%hmort = currentCohort%hmort*(1.0_r8 - fates_mortality_disturbance_fraction) currentCohort%bmort = currentCohort%bmort*(1.0_r8 - fates_mortality_disturbance_fraction) @@ -256,7 +254,6 @@ subroutine disturbance_rates( site_in, bc_in) currentCohort%lmort_direct = 0.0_r8 currentCohort%lmort_collateral = 0.0_r8 currentCohort%lmort_infra = 0.0_r8 - currentCohort%fmort = 0.0_r8 end if currentCohort => currentCohort%taller enddo !currentCohort @@ -312,6 +309,7 @@ subroutine spawn_patches( currentSite, bc_in) real(r8) :: leaf_litter_local(maxpft) ! initial value of leaf litter. KgC/m2 real(r8) :: cwd_ag_local(ncwd) ! initial value of above ground coarse woody debris. KgC/m2 real(r8) :: cwd_bg_local(ncwd) ! initial value of below ground coarse woody debris. KgC/m2 + integer :: levcan ! canopy level !--------------------------------------------------------------------- storesmallcohort => null() ! storage of the smallest cohort for insertion routine @@ -415,7 +413,6 @@ subroutine spawn_patches( currentSite, bc_in) nc%cmort = nan ! The mortality diagnostics are set to nan because the cohort should dissappear nc%hmort = nan nc%bmort = nan - nc%fmort = nan nc%frmort = nan nc%lmort_direct = nan nc%lmort_collateral = nan @@ -455,7 +452,6 @@ subroutine spawn_patches( currentSite, bc_in) ! number density in EDCLMLink, and the number density of this new patch is donated ! so with the number density must come the effective mortality rates. - nc%fmort = 0.0_r8 ! Should had also been zero in the donor nc%cmort = currentCohort%cmort nc%hmort = currentCohort%hmort nc%bmort = currentCohort%bmort @@ -480,7 +476,6 @@ subroutine spawn_patches( currentSite, bc_in) ! Those remaining in the existing currentCohort%n = currentCohort%n * (1._r8 - patch_site_areadis/currentPatch%area) - nc%fmort = 0.0_r8 nc%cmort = currentCohort%cmort nc%hmort = currentCohort%hmort nc%bmort = currentCohort%bmort @@ -503,9 +498,15 @@ subroutine spawn_patches( currentSite, bc_in) ! loss of individuals from source patch due to area shrinking currentCohort%n = currentCohort%n * (1._r8 - patch_site_areadis/currentPatch%area) + if (currentCohort%canopy_layer .eq. 1) then + levcan = 1 + else + levcan = 2 + endif + ! before changing number densities, keep track of the total rate of trees that died due to fire, as well as from each fire mortality term - currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft) = & - currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft) + & + currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft, levcan) = & + currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft, levcan) + & nc%n * currentCohort%fire_mort / hlm_freq_day currentSite%fmort_rate_cambial(currentCohort%size_class, currentCohort%pft) = & currentSite%fmort_rate_cambial(currentCohort%size_class, currentCohort%pft) + & @@ -513,12 +514,13 @@ subroutine spawn_patches( currentSite, bc_in) currentSite%fmort_rate_crown(currentCohort%size_class, currentCohort%pft) = & currentSite%fmort_rate_crown(currentCohort%size_class, currentCohort%pft) + & nc%n * currentCohort%cambial_mort / hlm_freq_day + currentSite%fmort_carbonflux(levcan) = currentSite%fmort_carbonflux(levcan) + & + (nc%n * currentCohort%fire_mort) * & + currentCohort%b_total() * g_per_kg * days_per_sec * ha_per_m2 ! loss of individual from fire in new patch. nc%n = nc%n * (1.0_r8 - currentCohort%fire_mort) - nc%fmort = currentCohort%fire_mort/hlm_freq_day - nc%cmort = currentCohort%cmort nc%hmort = currentCohort%hmort nc%bmort = currentCohort%bmort @@ -549,7 +551,6 @@ subroutine spawn_patches( currentSite, bc_in) nc%hmort = nan nc%bmort = nan nc%frmort = nan - nc%fmort = nan nc%lmort_direct = nan nc%lmort_collateral = nan nc%lmort_infra = nan @@ -591,7 +592,6 @@ subroutine spawn_patches( currentSite, bc_in) currentCohort%n = currentCohort%n * (1._r8 - patch_site_areadis/currentPatch%area) - nc%fmort = 0.0_r8 nc%cmort = currentCohort%cmort nc%hmort = currentCohort%hmort nc%bmort = currentCohort%bmort @@ -611,7 +611,6 @@ subroutine spawn_patches( currentSite, bc_in) currentCohort%n = currentCohort%n * (1._r8 - patch_site_areadis/currentPatch%area) ! No grass impact mortality imposed on the newly created patch - nc%fmort = 0.0_r8 nc%cmort = currentCohort%cmort nc%hmort = currentCohort%hmort nc%bmort = currentCohort%bmort diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index be09e7c1cd..7f6a94f44b 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -72,7 +72,7 @@ subroutine init_site_vars( site_in ) allocate(site_in%demotion_rate(1:nlevsclass)) allocate(site_in%promotion_rate(1:nlevsclass)) allocate(site_in%imort_rate(1:nlevsclass,1:numpft)) - allocate(site_in%fmort_rate(1:nlevsclass,1:numpft)) + allocate(site_in%fmort_rate(1:nlevsclass,1:numpft,1:2)) allocate(site_in%fmort_rate_cambial(1:nlevsclass,1:numpft)) allocate(site_in%fmort_rate_crown(1:nlevsclass,1:numpft)) ! @@ -128,7 +128,8 @@ subroutine zero_site( site_in ) site_in%recruitment_rate(:) = 0._r8 site_in%imort_rate(:,:) = 0._r8 site_in%imort_carbonflux = 0._r8 - site_in%fmort_rate(:,:) = 0._r8 + site_in%fmort_rate(:,:,:) = 0._r8 + site_in%fmort_carbonflux(:) = 0._r8 site_in%fmort_rate_cambial(:,:) = 0._r8 site_in%fmort_rate_crown(:,:) = 0._r8 diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index 817adf0850..923f902a16 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -588,7 +588,6 @@ subroutine bypass_dynamics(currentSite) currentCohort%bmort = 0.0_r8 currentCohort%hmort = 0.0_r8 currentCohort%cmort = 0.0_r8 - currentCohort%fmort = 0.0_r8 currentCohort%frmort = 0.0_r8 currentCohort%dndt = 0.0_r8 diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index e9c5a96f99..196a8f7d6c 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -241,7 +241,6 @@ module EDTypesMod real(r8) :: bmort ! background mortality rate n/year real(r8) :: cmort ! carbon starvation mortality rate n/year real(r8) :: hmort ! hydraulic failure mortality rate n/year - real(r8) :: fmort ! fire mortality n/year real(r8) :: frmort ! freezing mortality n/year ! Logging Mortality Rate @@ -266,9 +265,9 @@ module EDTypesMod ! FIRE real(r8) :: cfa ! proportion of crown affected by fire:- - real(r8) :: cambial_mort ! probability that trees dies due to cambial char:- - real(r8) :: crownfire_mort ! probability of tree post-fire mortality due to crown scorch:- - real(r8) :: fire_mort ! post-fire mortality from cambial and crown damage assuming two are independent:- + real(r8) :: cambial_mort ! probability that trees dies due to cambial char (conditional on the tree being subjected to the fire) + real(r8) :: crownfire_mort ! probability of tree post-fire mortality due to crown scorch (conditional on the tree being subjected to the fire) + real(r8) :: fire_mort ! post-fire mortality from cambial and crown damage assuming two are independent:- ! Integration real(r8) :: ode_opt_step ! What is the current optimum step size @@ -596,7 +595,8 @@ module EDTypesMod real(r8) :: promotion_carbonflux ! biomass of promoted individuals from understory to canopy [kgC/ha/day] real(r8), allocatable :: imort_rate(:,:) ! rate of individuals killed due to impact mortality per year. on size x pft array real(r8) :: imort_carbonflux ! biomass of individuals killed due to impact mortality per year. [kgC/ha/day] - real(r8), allocatable :: fmort_rate(:,:) ! rate of individuals killed due to fire mortality per year. on size x pft array + real(r8), allocatable :: fmort_rate(:,:,:) ! rate of individuals killed due to fire mortality per year. on size x pft array + real(r8) :: fmort_carbonflux(2) ! biomass of individuals killed due to fire mortality per year. [gC/m2/sec] real(r8), allocatable :: fmort_rate_cambial(:,:) ! rate of individuals killed due to fire mortality from cambial damage per year. on size x pft array real(r8), allocatable :: fmort_rate_crown(:,:) ! rate of individuals killed due to fire mortality from crown damage per year. on size x pft array @@ -809,7 +809,6 @@ subroutine dump_cohort(ccohort) write(fates_log(),*) 'co%c_area = ', ccohort%c_area write(fates_log(),*) 'co%cmort = ', ccohort%cmort write(fates_log(),*) 'co%bmort = ', ccohort%bmort - write(fates_log(),*) 'co%fmort = ', ccohort%fmort write(fates_log(),*) 'co%hmort = ', ccohort%hmort write(fates_log(),*) 'co%frmort = ', ccohort%frmort write(fates_log(),*) 'co%isnew = ', ccohort%isnew diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index 267d81954a..4c80f9ca5d 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -184,6 +184,8 @@ module FatesHistoryInterfaceMod integer, private :: ih_m6_si_scpf integer, private :: ih_m7_si_scpf integer, private :: ih_m8_si_scpf + integer, private :: ih_crownfiremort_si_scpf + integer, private :: ih_cambialfiremort_si_scpf integer, private :: ih_ar_si_scpf integer, private :: ih_ar_grow_si_scpf @@ -1788,7 +1790,7 @@ subroutine update_history_dyn(this,nc,nsites,sites) if (ccohort%canopy_layer .eq. 1) then hio_nplant_canopy_si_scag(io_si,iscag) = hio_nplant_canopy_si_scag(io_si,iscag) + ccohort%n hio_mortality_canopy_si_scag(io_si,iscag) = hio_mortality_canopy_si_scag(io_si,iscag) + & - (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort) * ccohort%n + (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort) * ccohort%n hio_ddbh_canopy_si_scag(io_si,iscag) = hio_ddbh_canopy_si_scag(io_si,iscag) + & ccohort%ddbhdt*ccohort%n hio_bstor_canopy_si_scpf(io_si,scpf) = hio_bstor_canopy_si_scpf(io_si,scpf) + & @@ -1799,10 +1801,10 @@ subroutine update_history_dyn(this,nc,nsites,sites) hio_canopy_biomass_pa(io_pa) = hio_canopy_biomass_pa(io_pa) + n_density * ccohort%b_total() * g_per_kg !hio_mortality_canopy_si_scpf(io_si,scpf) = hio_mortality_canopy_si_scpf(io_si,scpf)+ & - ! (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort) * ccohort%n + ! (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort) * ccohort%n hio_mortality_canopy_si_scpf(io_si,scpf) = hio_mortality_canopy_si_scpf(io_si,scpf)+ & - (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort) * ccohort%n + & + (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort) * ccohort%n + & (ccohort%lmort_direct + ccohort%lmort_collateral + ccohort%lmort_infra) * & ccohort%n * sec_per_day * days_per_year @@ -1826,12 +1828,12 @@ subroutine update_history_dyn(this,nc,nsites,sites) ! sum of all mortality hio_mortality_canopy_si_scls(io_si,scls) = hio_mortality_canopy_si_scls(io_si,scls) + & - (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort ) * ccohort%n + & + (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort ) * ccohort%n + & (ccohort%lmort_direct + ccohort%lmort_collateral + ccohort%lmort_infra) * & ccohort%n * sec_per_day * days_per_year hio_canopy_mortality_carbonflux_si(io_si) = hio_canopy_mortality_carbonflux_si(io_si) + & - (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort) * & + (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort) * & ccohort%b_total() * ccohort%n * g_per_kg * days_per_sec * years_per_day * ha_per_m2 + & (ccohort%lmort_direct + ccohort%lmort_collateral + ccohort%lmort_infra)* ccohort%b_total() * & ccohort%n * g_per_kg * ha_per_m2 @@ -1881,7 +1883,7 @@ subroutine update_history_dyn(this,nc,nsites,sites) else hio_nplant_understory_si_scag(io_si,iscag) = hio_nplant_understory_si_scag(io_si,iscag) + ccohort%n hio_mortality_understory_si_scag(io_si,iscag) = hio_mortality_understory_si_scag(io_si,iscag) + & - (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort) * ccohort%n + (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort) * ccohort%n hio_ddbh_understory_si_scag(io_si,iscag) = hio_ddbh_understory_si_scag(io_si,iscag) + & ccohort%ddbhdt*ccohort%n hio_bstor_understory_si_scpf(io_si,scpf) = hio_bstor_understory_si_scpf(io_si,scpf) + & @@ -1891,10 +1893,10 @@ subroutine update_history_dyn(this,nc,nsites,sites) hio_understory_biomass_pa(io_pa) = hio_understory_biomass_pa(io_pa) + & n_density * ccohort%b_total() * g_per_kg !hio_mortality_understory_si_scpf(io_si,scpf) = hio_mortality_understory_si_scpf(io_si,scpf)+ & - ! (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort) * ccohort%n + ! (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort) * ccohort%n hio_mortality_understory_si_scpf(io_si,scpf) = hio_mortality_understory_si_scpf(io_si,scpf)+ & - (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort ) * ccohort%n + & + (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort ) * ccohort%n + & (ccohort%lmort_direct + ccohort%lmort_collateral + ccohort%lmort_infra) * & ccohort%n * sec_per_day * days_per_year @@ -1919,12 +1921,12 @@ subroutine update_history_dyn(this,nc,nsites,sites) ! sum of all mortality hio_mortality_understory_si_scls(io_si,scls) = hio_mortality_understory_si_scls(io_si,scls) + & - (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort ) * ccohort%n + & + (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort ) * ccohort%n + & (ccohort%lmort_direct + ccohort%lmort_collateral + ccohort%lmort_infra) * & ccohort%n * sec_per_day * days_per_year hio_understory_mortality_carbonflux_si(io_si) = hio_understory_mortality_carbonflux_si(io_si) + & - (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%fmort + ccohort%frmort) * & + (ccohort%bmort + ccohort%hmort + ccohort%cmort + ccohort%frmort) * & ccohort%b_total() * ccohort%n * g_per_kg * days_per_sec * years_per_day * ha_per_m2 + & (ccohort%lmort_direct + ccohort%lmort_collateral + ccohort%lmort_infra) * ccohort%b_total() * & ccohort%n * g_per_kg * ha_per_m2 @@ -2110,12 +2112,34 @@ subroutine update_history_dyn(this,nc,nsites,sites) sites(s)%imort_rate(i_scls, i_pft) ! ! fire mortality from the site-level diagnostic rates - hio_m5_si_scpf(io_si,i_scpf) = sites(s)%fmort_rate(i_scls, i_pft) - hio_m5_si_scls(io_si,i_scls) = hio_m5_si_scls(io_si,i_scls) + sites(s)%fmort_rate(i_scls, i_pft) + hio_m5_si_scpf(io_si,i_scpf) = sum(sites(s)%fmort_rate(i_scls, i_pft,:)) + hio_m5_si_scls(io_si,i_scls) = hio_m5_si_scls(io_si,i_scls) + sum(sites(s)%fmort_rate(i_scls, i_pft,:)) ! hio_crownfiremort_si_scpf(io_si,i_scpf) = sites(s)%fmort_rate_crown(i_scls, i_pft) hio_cambialfiremort_si_scpf(io_si,i_scpf) = sites(s)%fmort_rate_cambial(i_scls, i_pft) ! + ! fire components of overall canopy and understory mortality + hio_mortality_canopy_si_scpf(io_si,i_scpf) = hio_mortality_canopy_si_scpf(io_si,i_scpf) + & + sites(s)%fmort_rate(i_scls, i_pft,1) + hio_mortality_canopy_si_scls(io_si,i_scls) = hio_mortality_canopy_si_scls(io_si,i_scls) + & + sites(s)%fmort_rate(i_scls, i_pft,1) + hio_mortality_understory_si_scpf(io_si,i_scpf) = hio_mortality_understory_si_scpf(io_si,i_scpf) + & + sites(s)%fmort_rate(i_scls, i_pft,2) + hio_mortality_understory_si_scls(io_si,i_scls) = hio_mortality_understory_si_scls(io_si,i_scls) + & + sites(s)%fmort_rate(i_scls, i_pft,2) + ! + ! carbon flux associated with mortality of trees dying by fire + hio_canopy_mortality_carbonflux_si(io_si) = hio_canopy_mortality_carbonflux_si(io_si) + & + sites(s)%fmort_carbonflux(1) + hio_understory_mortality_carbonflux_si(io_si) = hio_understory_mortality_carbonflux_si(io_si) + & + sites(s)%fmort_carbonflux(2) + ! + ! for scag variables, also treat as happening in the newly-disurbed patch + iscag = i_scls ! since imort is by definition something that only happens in newly disturbed patches, treat as such + hio_mortality_canopy_si_scag(io_si,iscag) = hio_mortality_canopy_si_scag(io_si,iscag) + & + sites(s)%fmort_rate(i_scls, i_pft,1) + hio_mortality_understory_si_scag(io_si,iscag) = hio_mortality_understory_si_scag(io_si,iscag) + & + sites(s)%fmort_rate(i_scls, i_pft,2) end do end do ! @@ -2126,7 +2150,8 @@ subroutine update_history_dyn(this,nc,nsites,sites) sites(s)%terminated_nindivs(:,:,:) = 0._r8 sites(s)%imort_carbonflux = 0._r8 sites(s)%imort_rate(:,:) = 0._r8 - sites(s)%fmort_rate(:,:) = 0._r8 + sites(s)%fmort_rate(:,:,:) = 0._r8 + sites(s)%fmort_carbonflux(:) = 0._r8 sites(s)%fmort_rate_cambial(:,:) = 0._r8 sites(s)%fmort_rate_crown(:,:) = 0._r8 diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index 0588832d0a..ea641b531a 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -107,7 +107,6 @@ module FatesRestartInterfaceMod integer, private :: ir_bmort_co integer, private :: ir_hmort_co integer, private :: ir_cmort_co - integer, private :: ir_fmort_co integer, private :: ir_frmort_co !Logging @@ -777,11 +776,6 @@ subroutine define_restart_vars(this, initialize_variables) units='/year', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_cmort_co ) - call this%set_restart_var(vname='fates_fmort', vtype=cohort_r8, & - long_name='ed cohort - fire mortality rate', & - units='/year', flushval = flushzero, & - hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmort_co ) - call this%set_restart_var(vname='fates_frmort', vtype=cohort_r8, & long_name='ed cohort - freezing mortality rate', & units='/year', flushval = flushzero, & @@ -1100,7 +1094,6 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_bmort_co => this%rvars(ir_bmort_co)%r81d, & rio_hmort_co => this%rvars(ir_hmort_co)%r81d, & rio_cmort_co => this%rvars(ir_cmort_co)%r81d, & - rio_fmort_co => this%rvars(ir_fmort_co)%r81d, & rio_frmort_co => this%rvars(ir_frmort_co)%r81d, & rio_lmort_direct_co => this%rvars(ir_lmort_direct_co)%r81d, & rio_lmort_collateral_co => this%rvars(ir_lmort_collateral_co)%r81d, & @@ -1222,7 +1215,6 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_bmort_co(io_idx_co) = ccohort%bmort rio_hmort_co(io_idx_co) = ccohort%hmort rio_cmort_co(io_idx_co) = ccohort%cmort - rio_fmort_co(io_idx_co) = ccohort%fmort rio_frmort_co(io_idx_co) = ccohort%frmort !Logging @@ -1686,7 +1678,6 @@ subroutine get_restart_vectors(this, nc, nsites, sites) rio_bmort_co => this%rvars(ir_bmort_co)%r81d, & rio_hmort_co => this%rvars(ir_hmort_co)%r81d, & rio_cmort_co => this%rvars(ir_cmort_co)%r81d, & - rio_fmort_co => this%rvars(ir_fmort_co)%r81d, & rio_frmort_co => this%rvars(ir_frmort_co)%r81d, & rio_lmort_direct_co => this%rvars(ir_lmort_direct_co)%r81d, & @@ -1794,7 +1785,6 @@ subroutine get_restart_vectors(this, nc, nsites, sites) ccohort%bmort = rio_bmort_co(io_idx_co) ccohort%hmort = rio_hmort_co(io_idx_co) ccohort%cmort = rio_cmort_co(io_idx_co) - ccohort%fmort = rio_fmort_co(io_idx_co) ccohort%frmort = rio_frmort_co(io_idx_co) !Logging From eff4c3f78656f59677cb7a7eadf49018af45b0f3 Mon Sep 17 00:00:00 2001 From: Jacquelyn Shuman Date: Wed, 3 Oct 2018 13:12:11 -0600 Subject: [PATCH 03/23] Typo update in support of fire mortality diagnostics Update typos within patch dynamics to link cambial and crown scorch mortality for diagnostics. Remove hard coding of canopy layer Fixes: 412 User interface changes?: No Code review: JKShuman, CKoven, RKnox, RFisher Test suite: Hobart Test baseline: Test namelist changes: Test answer changes: expect changes Test summary: Run on Hobart and then test on Cheyenne. --- biogeochem/EDPatchDynamicsMod.F90 | 12 ++++-------- main/EDInitMod.F90 | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 1118b7fd6d..9dcc8aa839 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -498,22 +498,18 @@ subroutine spawn_patches( currentSite, bc_in) ! loss of individuals from source patch due to area shrinking currentCohort%n = currentCohort%n * (1._r8 - patch_site_areadis/currentPatch%area) - if (currentCohort%canopy_layer .eq. 1) then - levcan = 1 - else - levcan = 2 - endif + levcan = currentCohort%canopy_layer - ! before changing number densities, keep track of the total rate of trees that died due to fire, as well as from each fire mortality term + ! before changing number densities, track total rate of trees that died due to fire, as well as from each fire mortality term currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft, levcan) = & currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft, levcan) + & nc%n * currentCohort%fire_mort / hlm_freq_day currentSite%fmort_rate_cambial(currentCohort%size_class, currentCohort%pft) = & currentSite%fmort_rate_cambial(currentCohort%size_class, currentCohort%pft) + & - nc%n * currentCohort%crownfire_mort / hlm_freq_day + nc%n * currentCohort%cambial_mort / hlm_freq_day currentSite%fmort_rate_crown(currentCohort%size_class, currentCohort%pft) = & currentSite%fmort_rate_crown(currentCohort%size_class, currentCohort%pft) + & - nc%n * currentCohort%cambial_mort / hlm_freq_day + nc%n * currentCohort%crownfire_mort / hlm_freq_day currentSite%fmort_carbonflux(levcan) = currentSite%fmort_carbonflux(levcan) + & (nc%n * currentCohort%fire_mort) * & currentCohort%b_total() * g_per_kg * days_per_sec * ha_per_m2 diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 7f6a94f44b..95aca35cf4 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -72,7 +72,7 @@ subroutine init_site_vars( site_in ) allocate(site_in%demotion_rate(1:nlevsclass)) allocate(site_in%promotion_rate(1:nlevsclass)) allocate(site_in%imort_rate(1:nlevsclass,1:numpft)) - allocate(site_in%fmort_rate(1:nlevsclass,1:numpft,1:2)) + allocate(site_in%fmort_rate(1:nlevsclass,1:numpft,1:nclmax)) allocate(site_in%fmort_rate_cambial(1:nlevsclass,1:numpft)) allocate(site_in%fmort_rate_crown(1:nlevsclass,1:numpft)) ! From 040a2c48ff4d70e8894a05acf14ed7be8bfc485f Mon Sep 17 00:00:00 2001 From: Jacquelyn Shuman Date: Wed, 3 Oct 2018 14:36:42 -0600 Subject: [PATCH 04/23] Correct typo for diffuse surface albedo Correct typo to set the diffuse surface albedo correctly as identified by JHolm Fixes:408 User interface changes?: No Code review: JKShuman, JHolm, RKnox, RFisher Test suite: Hobart and Cheyenne Test baseline: Test namelist changes: none Test answer changes:expect changes Test summary: will run on Hobart and follow with baseline tests on Cheyenne --- biogeophys/EDSurfaceAlbedoMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeophys/EDSurfaceAlbedoMod.F90 b/biogeophys/EDSurfaceAlbedoMod.F90 index ee525cd479..86df910ac2 100644 --- a/biogeophys/EDSurfaceAlbedoMod.F90 +++ b/biogeophys/EDSurfaceAlbedoMod.F90 @@ -196,7 +196,7 @@ subroutine ED_Norman_Radiation (nsites, sites, bc_in, bc_out ) bc_out(s)%fabi_parb(ifp,:) = 0.0_r8 do ib = 1,hlm_numSWb bc_out(s)%albd_parb(ifp,ib) = bc_in(s)%albgr_dir_rb(ib) - bc_out(s)%albd_parb(ifp,ib) = bc_in(s)%albgr_dif_rb(ib) + bc_out(s)%albi_parb(ifp,ib) = bc_in(s)%albgr_dif_rb(ib) bc_out(s)%ftdd_parb(ifp,ib)= 1.0_r8 bc_out(s)%ftid_parb(ifp,ib)= 1.0_r8 bc_out(s)%ftii_parb(ifp,ib)= 1.0_r8 From 96a28d601b6d7d8927e539217c51bb1f22095a93 Mon Sep 17 00:00:00 2001 From: Jacquelyn Shuman Date: Thu, 20 Dec 2018 15:21:35 -0700 Subject: [PATCH 05/23] Remove Lasslop et al 2014 wind effect Remove the reducing effect of high wind speeds on fire behavior. Also remove the fire_wind_max that triggers this reducing effect. New reserach shows that there is not a reducing link between wind speed and fire behavior, specifically rate of spread. Andela et al 2018 https://doi.org/10.5194/essd-2018-89 User interface changes?: Yes, remove fire_wind_max parameter Code review: JKShuman Test suite: Cheyenne Test baseline: Test namelist changes: none Test answer changes: expect changes, dependant on wind conditions Test summary: tested for compile on Cheyenne --- fire/SFMainMod.F90 | 19 +++---------------- parameter_files/fates_params_14pfts.cdl | 5 ----- parameter_files/fates_params_coastal_veg.cdl | 5 ----- parameter_files/fates_params_default.cdl | 5 ----- 4 files changed, 3 insertions(+), 31 deletions(-) diff --git a/fire/SFMainMod.F90 b/fire/SFMainMod.F90 index 2a7a1ca01c..e42e2e3cbc 100644 --- a/fire/SFMainMod.F90 +++ b/fire/SFMainMod.F90 @@ -426,7 +426,6 @@ subroutine rate_of_spread ( currentSite ) real(r8) beta_ratio ! ratio of beta/beta_op real(r8) a_beta ! dummy variable for product of a* beta_ratio for react_v_opt equation real(r8) a,b,c,e ! function of fuel sav - real(r8) wind_elev_fire !wind speed (m/min) at elevevation relevant for fire logical,parameter :: debug_windspeed = .false. !for debugging @@ -493,21 +492,9 @@ subroutine rate_of_spread ( currentSite ) ! Equation A5 in Thonicke et al. 2010 ! phi_wind (unitless) - ! convert wind_elev_fire from m/min to ft/min for Rothermel ROS eqn - ! wind max per Lasslop et al 2014 to linearly reduce ROS for high wind speeds - !OLD! phi_wind = c * ((3.281_r8*currentPatch%effect_wspeed)**b)*(beta_ratio**(-e)) - if (currentPatch%effect_wspeed .le. SF_val_wind_max) then - wind_elev_fire = currentPatch%effect_wspeed - phi_wind = c * ((3.281_r8*wind_elev_fire)**b)*(beta_ratio**(-e)) - if (debug_windspeed) write(fates_log(),*) 'SF wind LESS max ', currentPatch%effect_wspeed - if (debug_windspeed) write(fates_log(),*) 'month and day', hlm_current_month, hlm_current_day - else - !max condition 225 ft/min (FIREMIP Rabin table A10 JSBACH-Spitfire) convert to 68.577 m/min - wind_elev_fire = max(0.0_r8,(68.577_r8-0.5_r8*currentPatch%effect_wspeed)) - phi_wind = c * ((3.281_r8*wind_elev_fire)**b)*(beta_ratio**(-e)) - if (debug_windspeed) write(fates_log(),*) 'SF wind GREATER max ', currentPatch%effect_wspeed - if (debug_windspeed) write(fates_log(),*) 'month and day', hlm_current_month, hlm_current_day - endif + ! convert current_wspeed (wind at elev relevant to fire) from m/min to ft/min for Rothermel ROS eqn + phi_wind = c * ((3.281_r8*currentPatch%effect_wspeed)**b)*(beta_ratio**(-e)) + ! ---propagating flux---- ! Equation A2 in Thonicke et al.2010 and Eq. 42 Rothermal 1972 diff --git a/parameter_files/fates_params_14pfts.cdl b/parameter_files/fates_params_14pfts.cdl index fca12515c9..cf3d4de880 100644 --- a/parameter_files/fates_params_14pfts.cdl +++ b/parameter_files/fates_params_14pfts.cdl @@ -569,9 +569,6 @@ variables: float fates_fdi_b ; fates_fdi_b:units = "NA" ; fates_fdi_b:long_name = "spitfire parameter (unknown) " ; - float fates_fire_wind_max ; - fates_fire_wind_max:units = "m/min" ; - fates_fire_wind_max:long_name = "maximum wind speed expected by the fire model" ; float fates_fuel_energy ; fates_fuel_energy:units = "kJ/kg" ; fates_fuel_energy:long_name = "pitfire parameter, heat content of fuel" ; @@ -1189,8 +1186,6 @@ data: fates_fdi_b = 243.12 ; - fates_fire_wind_max = 45.718 ; - fates_fuel_energy = 18000 ; fates_max_durat = 240 ; diff --git a/parameter_files/fates_params_coastal_veg.cdl b/parameter_files/fates_params_coastal_veg.cdl index dddcc9d159..a6b1ac59d3 100644 --- a/parameter_files/fates_params_coastal_veg.cdl +++ b/parameter_files/fates_params_coastal_veg.cdl @@ -527,9 +527,6 @@ variables: float fates_fdi_b ; fates_fdi_b:units = "NA" ; fates_fdi_b:long_name = "spitfire parameter (unknown) " ; - float fates_fire_wind_max ; - fates_fire_wind_max:units = "m/min" ; - fates_fire_wind_max:long_name = "maximum wind speed expected by the fire model" ; float fates_fuel_energy ; fates_fuel_energy:units = "kJ/kg" ; fates_fuel_energy:long_name = "pitfire parameter, heat content of fuel" ; @@ -947,8 +944,6 @@ data: fates_fdi_b = 243.12 ; - fates_fire_wind_max = 45.718 ; - fates_fuel_energy = 18000 ; fates_max_durat = 240 ; diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 179eefa42d..bed07aed11 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -569,9 +569,6 @@ variables: float fates_fdi_b ; fates_fdi_b:units = "NA" ; fates_fdi_b:long_name = "spitfire parameter (unknown) " ; - float fates_fire_wind_max ; - fates_fire_wind_max:units = "m/min" ; - fates_fire_wind_max:long_name = "maximum wind speed expected by the fire model" ; float fates_fuel_energy ; fates_fuel_energy:units = "kJ/kg" ; fates_fuel_energy:long_name = "pitfire parameter, heat content of fuel" ; @@ -1066,8 +1063,6 @@ data: fates_fdi_b = 243.12 ; - fates_fire_wind_max = 45.718 ; - fates_fuel_energy = 18000 ; fates_max_durat = 240 ; From 3fe14e5ab3a41cf51dc8f1f25a792e30ae103e3f Mon Sep 17 00:00:00 2001 From: Jacquelyn Shuman Date: Thu, 20 Dec 2018 16:14:09 -0700 Subject: [PATCH 06/23] Remove SF_val_wind_max from SFParams Code review: JKShuman Test suite: Hobart Test summary: 2 year test run --- fire/SFParamsMod.F90 | 9 --------- 1 file changed, 9 deletions(-) diff --git a/fire/SFParamsMod.F90 b/fire/SFParamsMod.F90 index a8556577fa..f40fea7a39 100644 --- a/fire/SFParamsMod.F90 +++ b/fire/SFParamsMod.F90 @@ -23,7 +23,6 @@ module SFParamsMod real(r8),protected :: SF_val_miner_damp real(r8),protected :: SF_val_max_durat real(r8),protected :: SF_val_durat_slope - real(r8),protected :: SF_val_wind_max ! Maximum wind speed expected by fire model (m/min) real(r8),protected :: SF_val_alpha_FMC(NFSC) real(r8),protected :: SF_val_CWD_frac(NCWD) real(r8),protected :: SF_val_max_decomp(NFSC) @@ -56,7 +55,6 @@ module SFParamsMod character(len=param_string_length),parameter :: SF_name_low_moisture_Slope = "fates_low_moisture_Slope" character(len=param_string_length),parameter :: SF_name_mid_moisture_Coeff = "fates_mid_moisture_Coeff" character(len=param_string_length),parameter :: SF_name_mid_moisture_Slope = "fates_mid_moisture_Slope" - character(len=param_string_length),parameter :: SF_name_wind_max = "fates_fire_wind_max" public :: SpitFireRegisterParams public :: SpitFireReceiveParams @@ -90,7 +88,6 @@ subroutine SpitFireParamsInit() SF_val_miner_damp = nan SF_val_max_durat = nan SF_val_durat_slope = nan - SF_val_wind_max = nan SF_val_CWD_frac(:) = nan @@ -150,9 +147,6 @@ subroutine SpitFireRegisterScalars(fates_params) character(len=param_string_length), parameter :: dim_names_scalar(1) = (/dimension_name_scalar/) - call fates_params%RegisterParameter(name=SF_name_wind_max, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) - call fates_params%RegisterParameter(name=SF_name_fdi_a, dimension_shape=dimension_shape_scalar, & dimension_names=dim_names_scalar) @@ -191,9 +185,6 @@ subroutine SpitFireReceiveScalars(fates_params) class(fates_parameters_type), intent(inout) :: fates_params - call fates_params%RetreiveParameter(name=SF_name_wind_max, & - data=SF_val_wind_max) - call fates_params%RetreiveParameter(name=SF_name_fdi_a, & data=SF_val_fdi_a) From 34f580c411d5bc91b8af2ef726f46cf7a132db7f Mon Sep 17 00:00:00 2001 From: Jacqueline Shuman Date: Thu, 20 Dec 2018 16:27:13 -0700 Subject: [PATCH 07/23] remove wind_max from SFMainMod --- fire/SFMainMod.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fire/SFMainMod.F90 b/fire/SFMainMod.F90 index e42e2e3cbc..44f8d8d2e5 100644 --- a/fire/SFMainMod.F90 +++ b/fire/SFMainMod.F90 @@ -408,8 +408,8 @@ subroutine rate_of_spread ( currentSite ) use SFParamsMod, only : SF_val_miner_total, & SF_val_part_dens, & SF_val_miner_damp, & - SF_val_fuel_energy, & - SF_val_wind_max + SF_val_fuel_energy + use FatesInterfaceMod, only : hlm_current_day, hlm_current_month type(ed_site_type), intent(in), target :: currentSite From 9f5b6a462dfdf626fd05d6fc7f83f24afd54b08e Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 24 Dec 2018 13:10:27 -0700 Subject: [PATCH 08/23] Expanded reporting of carbon conservation failure. Updated cohort and area minimums for termination --- main/EDMainMod.F90 | 41 +++++++++++++++++++++++++++-------------- main/EDTypesMod.F90 | 10 +++++----- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index aca5a3df14..71533d7608 100644 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -538,6 +538,12 @@ subroutine ed_total_balance_check (currentSite, call_index ) real(r8) :: error ! How much carbon did we gain or lose (should be zero!) real(r8) :: error_frac ! Error as a fraction of total biomass real(r8) :: net_flux ! Difference between recorded fluxes in and out. KgC/site + real(r8) :: leaf_c + real(r8) :: fnrt_c + real(r8) :: sapw_c + real(r8) :: store_c + real(r8) :: struct_c + real(r8) :: repro_c ! nb. There is no time associated with these variables ! because this routine can be called between any two @@ -579,7 +585,7 @@ subroutine ed_total_balance_check (currentSite, call_index ) ! burned_litter * new_patch%area !kG/site/day ! ----------------------------------------------------------------------------------- - if ( error_frac > 10e-6 ) then + if ( error_frac > 10e-6_r8 ) then write(fates_log(),*) 'carbon balance error detected' write(fates_log(),*) 'error fraction relative to biomass stock:',error_frac write(fates_log(),*) 'call index: ',call_index @@ -593,13 +599,17 @@ subroutine ed_total_balance_check (currentSite, call_index ) write(fates_log(),*) 'seeds',seed_stock write(fates_log(),*) 'previous total',currentSite%old_stock - if(debug)then + write(fates_log(),*) 'lat lon',currentSite%lat,currentSite%lon + + ! If this is the first day of simulation, carbon balance reports but does not end the run + if( int(hlm_current_year*10000 + hlm_current_month*100 + hlm_current_day).ne.hlm_reference_date ) then + change_in_stock = 0.0_r8 biomass_stock = 0.0_r8 litter_stock = 0.0_r8 seed_stock = sum(currentSite%seed_bank)*AREA - currentPatch => currentSite%oldest_patch + currentPatch => currentSite%oldest_patch do while(associated(currentPatch)) write(fates_log(),*) '---------------------------------------' write(fates_log(),*) currentPatch%area , sum(currentPatch%cwd_ag), sum(currentPatch%cwd_bg) @@ -607,19 +617,22 @@ subroutine ed_total_balance_check (currentSite, call_index ) write(fates_log(),*)'---' currentCohort => currentPatch%tallest do while(associated(currentCohort)) - write(fates_log(),*) 'structure: ',currentCohort%prt%GetState(struct_organ,all_carbon_elements) - write(fates_log(),*) 'storage: ',currentCohort%prt%GetState(store_organ,all_carbon_elements) + write(fates_log(),*) 'pft: ',currentCohort%pft + write(fates_log(),*) 'dbh: ',currentCohort%dbh + leaf_c = currentCohort%prt%GetState(leaf_organ,all_carbon_elements) + struct_c = currentCohort%prt%GetState(struct_organ,all_carbon_elements) + store_c = currentCohort%prt%GetState(store_organ,all_carbon_elements) + fnrt_c = currentCohort%prt%GetState(fnrt_organ,all_carbon_elements) + repro_c = currentCohort%prt%GetState(repro_organ,all_carbon_elements) + sapw_c = currentCohort%prt%GetState(sapw_organ,all_carbon_elements) + + write(fates_log(),*) 'lc: ',leaf_c,' dc: ',struct_c,' stc: ',store_c + write(fates_log(),*) 'fc: ',fnrt_c,' rc: ',repro_c,' sac: ',sapw_c write(fates_log(),*) 'N plant: ',currentCohort%n - currentCohort => currentCohort%shorter; - enddo !end cohort loop + currentCohort => currentCohort%shorter + enddo !end cohort loop currentPatch => currentPatch%younger - enddo !end patch loop - end if - - write(fates_log(),*) 'lat lon',currentSite%lat,currentSite%lon - - ! If this is the first day of simulation, carbon balance reports but does not end the run - if( int(hlm_current_year*10000 + hlm_current_month*100 + hlm_current_day).ne.hlm_reference_date ) then + enddo !end patch loop write(fates_log(),*) 'aborting on date:',hlm_current_year,hlm_current_month,hlm_current_day call endrun(msg=errMsg(sourcefile, __LINE__)) end if diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 16bd7db647..0b37d7d714 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -145,11 +145,11 @@ module EDTypesMod integer , parameter :: N_HITE_BINS = 60 ! no. of hite bins used to distribute LAI ! COHORT TERMINATION - real(r8), parameter :: min_npm2 = 1.0E-8_r8 ! minimum cohort number density per m2 before termination - real(r8), parameter :: min_patch_area = 0.001_r8 ! smallest allowable patch area before termination - real(r8), parameter :: min_nppatch = 1.0E-11_r8 ! minimum number of cohorts per patch (min_npm2*min_patch_area) - real(r8), parameter :: min_n_safemath = 1.0E-15_r8 ! in some cases, we want to immediately remove super small - ! number densities of cohorts to prevent FPEs + real(r8), parameter :: min_npm2 = 1.0E-7_r8 ! minimum cohort number density per m2 before termination + real(r8), parameter :: min_patch_area = 0.01_r8 ! smallest allowable patch area before termination + real(r8), parameter :: min_nppatch = min_npm2*min_patch_area ! minimum number of cohorts per patch (min_npm2*min_patch_area) + real(r8), parameter :: min_n_safemath = 1.0E-12_r8 ! in some cases, we want to immediately remove super small + ! number densities of cohorts to prevent FPEs character*4 yearchar From e64f26a0567bf9d931a8c92927af4e336068d6ee Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Wed, 26 Dec 2018 18:39:07 -0700 Subject: [PATCH 09/23] Add some numerical protections to zero area patch spawning --- biogeochem/EDPatchDynamicsMod.F90 | 48 +++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 98546557e3..0bd3cce793 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -301,6 +301,7 @@ subroutine spawn_patches( currentSite, bc_in) use EDParamsMod , only : ED_val_understorey_death, logging_coll_under_frac use EDCohortDynamicsMod , only : zero_cohort, copy_cohort, terminate_cohorts + use ChecksBalancesMod , only : SiteCarbonStock ! ! !ARGUMENTS: @@ -329,11 +330,24 @@ subroutine spawn_patches( currentSite, bc_in) real(r8) :: store_c ! storage carbon [kg] real(r8) :: struct_c ! structure carbon [kg] real(r8) :: total_c ! total carbon of plant [kg] + +! May remove at later date if carbon balances cooperate (rgk 12-18) +!! integer, parameter :: n_checks = 3 +!! real(r8) :: total_stock(n_checks) +!! real(r8) :: biomass_stock(n_checks) +!! real(r8) :: litter_stock(n_checks) +!! real(r8) :: seed_stock(n_checks) + !--------------------------------------------------------------------- storesmallcohort => null() ! storage of the smallest cohort for insertion routine storebigcohort => null() ! storage of the largest cohort for insertion routine + + ! Calculate the total carbon stock for error checking +!! call SiteCarbonStock(currentSite,total_stock(1),biomass_stock(1),litter_stock(1),seed_stock(1)) + + ! calculate area of disturbed land, in this timestep, by summing contributions from each existing patch. currentPatch => currentSite%youngest_patch @@ -351,12 +365,17 @@ subroutine spawn_patches( currentSite, bc_in) call endrun(msg=errMsg(sourcefile, __LINE__)) end if - site_areadis = site_areadis + currentPatch%area * currentPatch%disturbance_rate + ! Only create new patches that have non-negligible amount of land + if((currentPatch%area*currentPatch%disturbance_rate) > nearzero ) then + site_areadis = site_areadis + currentPatch%area * currentPatch%disturbance_rate + end if + currentPatch => currentPatch%older enddo ! end loop over patches. sum area disturbed for all patches. - if (site_areadis > 0.0_r8) then + if (site_areadis > nearzero) then + cwd_ag_local = 0.0_r8 cwd_bg_local = 0.0_r8 leaf_litter_local = 0.0_r8 @@ -378,6 +397,8 @@ subroutine spawn_patches( currentSite, bc_in) ! This is the amount of patch area that is disturbed, and donated by the donor patch_site_areadis = currentPatch%area * currentPatch%disturbance_rate + if (patch_site_areadis > nearzero) then + call average_patch_properties(currentPatch, new_patch, patch_site_areadis) if (currentPatch%disturbance_rates(dtype_ilog) > currentPatch%disturbance_rates(dtype_ifall) .and. & @@ -682,6 +703,7 @@ subroutine spawn_patches( currentSite, bc_in) enddo ! currentCohort call sort_cohorts(currentPatch) + !zero disturbance accumulators currentPatch%disturbance_rate = 0._r8 currentPatch%disturbance_rates = 0._r8 @@ -698,6 +720,8 @@ subroutine spawn_patches( currentSite, bc_in) call terminate_cohorts(currentSite, currentPatch, 2) call sort_cohorts(currentPatch) + end if + currentPatch => currentPatch%younger enddo ! currentPatch patch loop. @@ -723,9 +747,29 @@ subroutine spawn_patches( currentSite, bc_in) endif !end new_patch area +!! call SiteCarbonStock(currentSite,total_stock(2),biomass_stock(2),litter_stock(2),seed_stock(2)) + +!! if( abs(total_stock(1)-total_stock(2))/total_stock(1) > 1.e-6_r8 ) then +!! write(fates_log(),*) 'Carbon conservation error on patch spawning [1]' +!! write(fates_log(),*) total_stock(1) +!! write(fates_log(),*) total_stock(2) +!! currentPatch => currentSite%youngest_patch +!! do while(associated(currentPatch)) +!! write(fates_log(),*) 'age: ',currentPatch%age +!! write(fates_log(),*) 'rates: ',currentPatch%disturbance_rates(1:3) +!! currentPatch%disturbance_rate = 0._r8 +!! currentPatch%disturbance_rates = 0._r8 +!! +!! currentPatch => currentPatch%older +!! enddo +!! call endrun(msg=errMsg(sourcefile, __LINE__)) +!! end if + + call check_patch_area(currentSite) call set_patchno(currentSite) + return end subroutine spawn_patches ! ============================================================================ From b8df885666f1d2964472ea951d58299c7ced7119 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 27 Dec 2018 10:27:44 -0800 Subject: [PATCH 10/23] Fix to net assimilation tracker used for trimming --- biogeophys/FatesPlantRespPhotosynthMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index 2fae4eceb2..4b181ed7b3 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -938,7 +938,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in if ( parsun_lsl <= 0._r8 ) then ! night time - anet_av_out = 0._r8 + anet_av_out = -lmr psn_out = 0._r8 rstoma_out = min(rsmax0, 1._r8/bbb * cf) From 0990f54e20f2c98cc66c718b8791a4c02ed4cd4f Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 3 Jan 2019 12:45:32 -0700 Subject: [PATCH 11/23] Moved a cal to zero distrubance rates to outside of a conditional. --- biogeochem/EDPatchDynamicsMod.F90 | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 0bd3cce793..f1613c9144 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -703,11 +703,6 @@ subroutine spawn_patches( currentSite, bc_in) enddo ! currentCohort call sort_cohorts(currentPatch) - - !zero disturbance accumulators - currentPatch%disturbance_rate = 0._r8 - currentPatch%disturbance_rates = 0._r8 - !update area of donor patch currentPatch%area = currentPatch%area - patch_site_areadis @@ -720,8 +715,12 @@ subroutine spawn_patches( currentSite, bc_in) call terminate_cohorts(currentSite, currentPatch, 2) call sort_cohorts(currentPatch) - end if - + end if ! if (patch_site_areadis > nearzero) then + + !zero disturbance rate trackers + currentPatch%disturbance_rate = 0._r8 + currentPatch%disturbance_rates = 0._r8 + currentPatch => currentPatch%younger enddo ! currentPatch patch loop. From b879547dcb98f28bd48620f7e53c3bc13400aca9 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 4 Jan 2019 11:18:55 -0800 Subject: [PATCH 12/23] Removed unused global call to SiteCarbonStock and removed commented out code --- biogeochem/EDPatchDynamicsMod.F90 | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index f1613c9144..31335a0348 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -301,7 +301,6 @@ subroutine spawn_patches( currentSite, bc_in) use EDParamsMod , only : ED_val_understorey_death, logging_coll_under_frac use EDCohortDynamicsMod , only : zero_cohort, copy_cohort, terminate_cohorts - use ChecksBalancesMod , only : SiteCarbonStock ! ! !ARGUMENTS: @@ -343,11 +342,6 @@ subroutine spawn_patches( currentSite, bc_in) storesmallcohort => null() ! storage of the smallest cohort for insertion routine storebigcohort => null() ! storage of the largest cohort for insertion routine - - ! Calculate the total carbon stock for error checking -!! call SiteCarbonStock(currentSite,total_stock(1),biomass_stock(1),litter_stock(1),seed_stock(1)) - - ! calculate area of disturbed land, in this timestep, by summing contributions from each existing patch. currentPatch => currentSite%youngest_patch @@ -746,24 +740,6 @@ subroutine spawn_patches( currentSite, bc_in) endif !end new_patch area -!! call SiteCarbonStock(currentSite,total_stock(2),biomass_stock(2),litter_stock(2),seed_stock(2)) - -!! if( abs(total_stock(1)-total_stock(2))/total_stock(1) > 1.e-6_r8 ) then -!! write(fates_log(),*) 'Carbon conservation error on patch spawning [1]' -!! write(fates_log(),*) total_stock(1) -!! write(fates_log(),*) total_stock(2) -!! currentPatch => currentSite%youngest_patch -!! do while(associated(currentPatch)) -!! write(fates_log(),*) 'age: ',currentPatch%age -!! write(fates_log(),*) 'rates: ',currentPatch%disturbance_rates(1:3) -!! currentPatch%disturbance_rate = 0._r8 -!! currentPatch%disturbance_rates = 0._r8 -!! -!! currentPatch => currentPatch%older -!! enddo -!! call endrun(msg=errMsg(sourcefile, __LINE__)) -!! end if - call check_patch_area(currentSite) call set_patchno(currentSite) From a6ac612addb4ee2e95d50f6d856c5166a23e08c0 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 4 Jan 2019 11:53:33 -0800 Subject: [PATCH 13/23] Removed commented out code --- biogeochem/EDPatchDynamicsMod.F90 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 31335a0348..64e660cc88 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -330,14 +330,6 @@ subroutine spawn_patches( currentSite, bc_in) real(r8) :: struct_c ! structure carbon [kg] real(r8) :: total_c ! total carbon of plant [kg] -! May remove at later date if carbon balances cooperate (rgk 12-18) -!! integer, parameter :: n_checks = 3 -!! real(r8) :: total_stock(n_checks) -!! real(r8) :: biomass_stock(n_checks) -!! real(r8) :: litter_stock(n_checks) -!! real(r8) :: seed_stock(n_checks) - - !--------------------------------------------------------------------- storesmallcohort => null() ! storage of the smallest cohort for insertion routine storebigcohort => null() ! storage of the largest cohort for insertion routine From 1828428d59913672a1b4e2cf0203693639d6e48d Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Mon, 7 Jan 2019 18:01:04 -0700 Subject: [PATCH 14/23] Minor fixes related to new fire mortality diagnostics --- biogeochem/EDPatchDynamicsMod.F90 | 2 +- main/FatesHistoryInterfaceMod.F90 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index e6e8afeb0a..2c4cf1b7e7 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -550,7 +550,7 @@ subroutine spawn_patches( currentSite, bc_in) nc%n * currentCohort%crownfire_mort / hlm_freq_day currentSite%fmort_carbonflux(levcan) = currentSite%fmort_carbonflux(levcan) + & (nc%n * currentCohort%fire_mort) * & - currentCohort%b_total() * g_per_kg * days_per_sec * ha_per_m2 + total_c * g_per_kg * days_per_sec * ha_per_m2 ! loss of individual from fire in new patch. nc%n = nc%n * (1.0_r8 - currentCohort%fire_mort) diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index a50f0f7ae3..1160eb8bfd 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -8,7 +8,8 @@ module FatesHistoryInterfaceMod use FatesConstantsMod , only : calloc_abs_error use FatesGlobals , only : fates_log use FatesGlobals , only : endrun => fates_endrun - + use EDTypesMod , only : nclmax + use EDTypesMod , only : ican_upper use FatesIODimensionsMod , only : fates_io_dimension_type use FatesIOVariableKindMod , only : fates_io_variable_kind_type use FatesHistoryVariableType , only : fates_history_variable_type From 90b603e114ff99acb9aee911db630de7d3facb2b Mon Sep 17 00:00:00 2001 From: Jacqueline Shuman Date: Tue, 8 Jan 2019 13:05:01 -0700 Subject: [PATCH 15/23] Remove SF_alpha_FMC, add SF_drying_ratio With this update, a change in SAV will result in an updated alpha_FMC based on new calcualtion from SF_drying_ratio to calculate weighted avg of relative fuel moisture content --- fire/SFMainMod.F90 | 7 +++++-- fire/SFParamsMod.F90 | 12 ++++++------ parameter_files/fates_params_14pfts.cdl | 10 +++++----- parameter_files/fates_params_coastal_veg.cdl | 10 +++++----- parameter_files/fates_params_default.cdl | 10 +++++----- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/fire/SFMainMod.F90 b/fire/SFMainMod.F90 index 44f8d8d2e5..2d2b50b4a1 100644 --- a/fire/SFMainMod.F90 +++ b/fire/SFMainMod.F90 @@ -158,14 +158,15 @@ end subroutine fire_danger_index subroutine charecteristics_of_fuel ( currentSite ) !***************************************************************** - use SFParamsMod, only : SF_val_alpha_FMC, SF_val_SAV, SF_val_FBD + use SFParamsMod, only : SF_val_drying_ratio, SF_val_SAV, SF_val_FBD type(ed_site_type), intent(in), target :: currentSite type(ed_patch_type), pointer :: currentPatch type(ed_cohort_type), pointer :: currentCohort - real(r8) timeav_swc + real(r8) timeav_swc + real(r8) SF_val_FMC(nfsc) ! Relative fuel moisture adjusted per drying ratio real(r8) fuel_moisture(nfsc) ! Scaled moisture content of small litter fuels. real(r8) MEF(nfsc) ! Moisture extinction factor of fuels integer n @@ -235,6 +236,8 @@ subroutine charecteristics_of_fuel ( currentSite ) ! Equation 6 in Thonicke et al. 2010. across leaves,twig, small branch, and large branch ! dead leaves and twigs included in 1hr pool per Thonicke (2010) ! Calculate fuel moisture for trunks to hold value for fuel consumption + SF_val_alpha_FMC(dl_sf:tr_sf) = SF_val_SAV(dl_sf:tr_sf)/SF_val_drying_ratio + fuel_moisture(dl_sf:tr_sf) = exp(-1.0_r8 * SF_val_alpha_FMC(dl_sf:tr_sf) * currentSite%acc_NI) if(write_SF == itrue)then diff --git a/fire/SFParamsMod.F90 b/fire/SFParamsMod.F90 index f40fea7a39..59c91bc5c0 100644 --- a/fire/SFParamsMod.F90 +++ b/fire/SFParamsMod.F90 @@ -23,7 +23,7 @@ module SFParamsMod real(r8),protected :: SF_val_miner_damp real(r8),protected :: SF_val_max_durat real(r8),protected :: SF_val_durat_slope - real(r8),protected :: SF_val_alpha_FMC(NFSC) + real(r8),protected :: SF_val_drying_ratio real(r8),protected :: SF_val_CWD_frac(NCWD) real(r8),protected :: SF_val_max_decomp(NFSC) real(r8),protected :: SF_val_SAV(NFSC) @@ -44,7 +44,7 @@ module SFParamsMod character(len=param_string_length),parameter :: SF_name_miner_damp = "fates_miner_damp" character(len=param_string_length),parameter :: SF_name_max_durat = "fates_max_durat" character(len=param_string_length),parameter :: SF_name_durat_slope = "fates_durat_slope" - character(len=param_string_length),parameter :: SF_name_alpha_FMC = "fates_alpha_FMC" + character(len=param_string_length),parameter :: SF_name_drying_ratio = "fates_drying_ratio" character(len=param_string_length),parameter :: SF_name_CWD_frac = "fates_CWD_frac" character(len=param_string_length),parameter :: SF_name_max_decomp = "fates_max_decomp" character(len=param_string_length),parameter :: SF_name_SAV = "fates_SAV" @@ -88,10 +88,10 @@ subroutine SpitFireParamsInit() SF_val_miner_damp = nan SF_val_max_durat = nan SF_val_durat_slope = nan + SF_val_drying_ratio = nan SF_val_CWD_frac(:) = nan - SF_val_alpha_FMC(:) = nan SF_val_max_decomp(:) = nan SF_val_SAV(:) = nan @@ -279,7 +279,7 @@ subroutine SpitFireRegisterNFSC(fates_params) call fates_params%RegisterParameter(name=SF_name_mid_moisture_Slope, dimension_shape=dimension_shape_1d, & dimension_names=dim_names) - call fates_params%RegisterParameter(name=SF_name_alpha_FMC, dimension_shape=dimension_shape_1d, & + call fates_params%RegisterParameter(name=SF_name_drying_ratio, dimension_shape=dimension_shape_1d, & dimension_names=dim_names) call fates_params%RegisterParameter(name=SF_name_max_decomp, dimension_shape=dimension_shape_1d, & @@ -321,8 +321,8 @@ subroutine SpitFireReceiveNFSC(fates_params) call fates_params%RetreiveParameter(name=SF_name_mid_moisture_Slope, & data=SF_val_mid_moisture_Slope) - call fates_params%RetreiveParameter(name=SF_name_alpha_FMC, & - data=SF_val_alpha_FMC) + call fates_params%RetreiveParameter(name=SF_name_drying_ratio, & + data=SF_val_drying_ratio) call fates_params%RetreiveParameter(name=SF_name_max_decomp, & data=SF_val_max_decomp) diff --git a/parameter_files/fates_params_14pfts.cdl b/parameter_files/fates_params_14pfts.cdl index cf3d4de880..6f62156708 100644 --- a/parameter_files/fates_params_14pfts.cdl +++ b/parameter_files/fates_params_14pfts.cdl @@ -524,9 +524,6 @@ variables: float fates_z0mr(fates_pft) ; fates_z0mr:units = "unitless" ; fates_z0mr:long_name = "Ratio of momentum roughness length to canopy top height" ; - float fates_alpha_FMC(fates_litterclass) ; - fates_alpha_FMC:units = "NA" ; - fates_alpha_FMC:long_name = "spitfire parameter related to fuel moisture content, Equation 6 Thonicke et al 2010" ; float fates_FBD(fates_litterclass) ; fates_FBD:units = "NA" ; fates_FBD:long_name = "spitfire parameter related to fuel bulk density, see SFMain.F90" ; @@ -557,6 +554,9 @@ variables: float fates_CWD_frac(fates_NCWD) ; fates_CWD_frac:units = "fraction" ; fates_CWD_frac:long_name = "fraction of woody (bdead+bsw) biomass destined for CWD pool" ; + float fates_drying_ratio ; + fates_drying_ratio:units = "NA" ; + fates_drying_ratio:long_name = "spitfire parameter, fire drying ratio for fuel moisture, alpha_FMC EQ 6 Thonicke et al 2010" ; float fates_durat_slope ; fates_durat_slope:units = "NA" ; fates_durat_slope:long_name = "spitfire parameter, fire max duration slope, Equation 14 Thonicke et al 2010" ; @@ -1156,8 +1156,6 @@ data: fates_z0mr = 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055, 0.055 ; - fates_alpha_FMC = 0.0050769, 0.001, 0.0002754, 7.54e-05, 1.54e-05, 999 ; - fates_FBD = 4, 15.4, 16.8, 19.6, 999, 4 ; fates_low_moisture_Coeff = 1.15, 1.12, 1.09, 0.98, 0.8, 1.15 ; @@ -1178,6 +1176,8 @@ data: fates_CWD_frac = 0.045, 0.075, 0.21, 0.67 ; + fates_drying_ratio = 13000 ; + fates_durat_slope = -11.06 ; fates_fdi_a = 17.62 ; diff --git a/parameter_files/fates_params_coastal_veg.cdl b/parameter_files/fates_params_coastal_veg.cdl index a6b1ac59d3..60c887fb83 100644 --- a/parameter_files/fates_params_coastal_veg.cdl +++ b/parameter_files/fates_params_coastal_veg.cdl @@ -23,9 +23,6 @@ variables: float fates_SAV(fates_litterclass) ; fates_SAV:units = "NA" ; fates_SAV:long_name = "spitfire parameter related to surface area to volume ratio, see SFMain.F90" ; - float fates_alpha_FMC(fates_litterclass) ; - fates_alpha_FMC:units = "NA" ; - fates_alpha_FMC:long_name = "spitfire parameter related to fuel moisture content, Equation 6 Thonicke et al 2010" ; float fates_history_height_bin_edges(fates_history_height_bins) ; fates_history_height_bin_edges:units = "m" ; fates_history_height_bin_edges:long_name = "Lower edges for height bins used in height-resolved history output" ; @@ -515,6 +512,9 @@ variables: float fates_phen_ncolddayslim(fates_scalar) ; fates_phen_ncolddayslim:units = "days" ; fates_phen_ncolddayslim:long_name = "day threshold exceedance for temperature leaf-drop" ; + float fates_drying_ratio ; + fates_drying_ratio:units = "NA" ; + fates_drying_ratio:long_name = "spitfire parameter, fire drying ratio for fuel moisture, alpha_FMC EQ 6 Thonicke et al 2010" ; float fates_durat_slope ; fates_durat_slope:units = "NA" ; fates_durat_slope:long_name = "spitfire parameter, fire max duration slope, Equation 14 Thonicke et al 2010" ; @@ -568,8 +568,6 @@ data: fates_SAV = 66, 13, 3.58, 0.98, 0.2, 66 ; - fates_alpha_FMC = 0.0050769, 0.001, 0.0002754, 7.54e-05, 1.54e-05, 999 ; - fates_history_height_bin_edges = 0, 0.1, 0.3, 0.5, 1, 2 ; fates_low_moisture_Coeff = 1.15, 1.12, 1.09, 0.98, 0.8, 1.15 ; @@ -936,6 +934,8 @@ data: fates_phen_ncolddayslim = 5 ; + fates_drying_ratio = 13000 ; + fates_durat_slope = -11.06 ; fates_fdi_a = 17.62 ; diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index bed07aed11..84c645f3b0 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -24,9 +24,6 @@ variables: float fates_SAV(fates_litterclass) ; fates_SAV:units = "NA" ; fates_SAV:long_name = "spitfire parameter related to surface area to volume ratio, see SFMain.F90" ; - float fates_alpha_FMC(fates_litterclass) ; - fates_alpha_FMC:units = "NA" ; - fates_alpha_FMC:long_name = "spitfire parameter related to fuel moisture content, Equation 6 Thonicke et al 2010" ; float fates_history_height_bin_edges(fates_history_height_bins) ; fates_history_height_bin_edges:units = "m" ; fates_history_height_bin_edges:long_name = "Lower edges for height bins used in height-resolved history output" ; @@ -557,6 +554,9 @@ variables: float fates_phen_ncolddayslim(fates_scalar) ; fates_phen_ncolddayslim:units = "days" ; fates_phen_ncolddayslim:long_name = "day threshold exceedance for temperature leaf-drop" ; + float fates_drying_ratio ; + fates_drying_ratio:units = "NA" ; + fates_drying_ratio:long_name = "spitfire parameter, fire drying ratio for fuel moisture, alpha_FMC EQ 6 Thonicke et al 2010" ; float fates_durat_slope ; fates_durat_slope:units = "NA" ; fates_durat_slope:long_name = "spitfire parameter, fire max duration slope, Equation 14 Thonicke et al 2010" ; @@ -611,8 +611,6 @@ data: fates_SAV = 66, 13, 3.58, 0.98, 0.2, 66 ; - fates_alpha_FMC = 0.0050769, 0.001, 0.0002754, 7.54e-05, 1.54e-05, 999 ; - fates_history_height_bin_edges = 0, 0.1, 0.3, 1, 3, 10 ; fates_low_moisture_Coeff = 1.15, 1.12, 1.09, 0.98, 0.8, 1.15 ; @@ -1055,6 +1053,8 @@ data: fates_phen_ncolddayslim = 5 ; + fates_drying_ratio = 13000 ; + fates_durat_slope = -11.06 ; fates_fdi_a = 17.62 ; From b47e931c48264f303958f874f755693de788c6f4 Mon Sep 17 00:00:00 2001 From: Jacqueline Shuman Date: Tue, 8 Jan 2019 13:20:02 -0700 Subject: [PATCH 16/23] Remove extra space --- parameter_files/fates_params_default.cdl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parameter_files/fates_params_default.cdl b/parameter_files/fates_params_default.cdl index 84c645f3b0..6285a874aa 100644 --- a/parameter_files/fates_params_default.cdl +++ b/parameter_files/fates_params_default.cdl @@ -1053,7 +1053,7 @@ data: fates_phen_ncolddayslim = 5 ; - fates_drying_ratio = 13000 ; + fates_drying_ratio = 13000 ; fates_durat_slope = -11.06 ; From 0641a3eb84170320b852af2a3ee2459c3ebfeca3 Mon Sep 17 00:00:00 2001 From: Jacqueline Shuman Date: Tue, 8 Jan 2019 13:34:14 -0700 Subject: [PATCH 17/23] Fix typo --- fire/SFMainMod.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fire/SFMainMod.F90 b/fire/SFMainMod.F90 index 2d2b50b4a1..505437634d 100644 --- a/fire/SFMainMod.F90 +++ b/fire/SFMainMod.F90 @@ -166,7 +166,7 @@ subroutine charecteristics_of_fuel ( currentSite ) type(ed_cohort_type), pointer :: currentCohort real(r8) timeav_swc - real(r8) SF_val_FMC(nfsc) ! Relative fuel moisture adjusted per drying ratio + real(r8) alpha_FMC(nfsc) ! Relative fuel moisture adjusted per drying ratio real(r8) fuel_moisture(nfsc) ! Scaled moisture content of small litter fuels. real(r8) MEF(nfsc) ! Moisture extinction factor of fuels integer n @@ -236,15 +236,15 @@ subroutine charecteristics_of_fuel ( currentSite ) ! Equation 6 in Thonicke et al. 2010. across leaves,twig, small branch, and large branch ! dead leaves and twigs included in 1hr pool per Thonicke (2010) ! Calculate fuel moisture for trunks to hold value for fuel consumption - SF_val_alpha_FMC(dl_sf:tr_sf) = SF_val_SAV(dl_sf:tr_sf)/SF_val_drying_ratio + alpha_FMC(dl_sf:tr_sf) = SF_val_SAV(dl_sf:tr_sf)/SF_val_drying_ratio - fuel_moisture(dl_sf:tr_sf) = exp(-1.0_r8 * SF_val_alpha_FMC(dl_sf:tr_sf) * currentSite%acc_NI) + fuel_moisture(dl_sf:tr_sf) = exp(-1.0_r8 * alpha_FMC(dl_sf:tr_sf) * currentSite%acc_NI) if(write_SF == itrue)then if ( hlm_masterproc == itrue ) write(fates_log(),*) 'ff3 ',currentPatch%fuel_frac if ( hlm_masterproc == itrue ) write(fates_log(),*) 'fm ',fuel_moisture if ( hlm_masterproc == itrue ) write(fates_log(),*) 'csa ',currentSite%acc_NI - if ( hlm_masterproc == itrue ) write(fates_log(),*) 'sfv ',SF_val_alpha_FMC + if ( hlm_masterproc == itrue ) write(fates_log(),*) 'sfv ',alpha_FMC endif ! FIX(RF,032414): needs refactoring. ! average water content !is this the correct metric? From f686da8d1b416f312ea33e1aca1b6e68ea075eb3 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Tue, 8 Jan 2019 12:36:49 -0800 Subject: [PATCH 18/23] Updated termination diagnostic arrays to fill over canopy layer --- biogeochem/EDCohortDynamicsMod.F90 | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/biogeochem/EDCohortDynamicsMod.F90 b/biogeochem/EDCohortDynamicsMod.F90 index d09b90393e..334bd34313 100644 --- a/biogeochem/EDCohortDynamicsMod.F90 +++ b/biogeochem/EDCohortDynamicsMod.F90 @@ -602,12 +602,9 @@ subroutine terminate_cohorts( currentSite, currentPatch, level ) endif ! if (.not.currentCohort%isnew .and. level == 2) then if (terminate == 1) then + ! preserve a record of the to-be-terminated cohort for mortality accounting - if (currentCohort%canopy_layer .eq. 1) then - levcan = 1 - else - levcan = 2 - endif + levcan = currentCohort%canopy_layer currentSite%terminated_nindivs(currentCohort%size_class,currentCohort%pft,levcan) = & currentSite%terminated_nindivs(currentCohort%size_class,currentCohort%pft,levcan) + currentCohort%n From 5f7a45257d26410b7dd61ca06b6bc61c747f0721 Mon Sep 17 00:00:00 2001 From: Jacquelyn Shuman Date: Tue, 8 Jan 2019 18:44:25 -0700 Subject: [PATCH 19/23] Correct dimensions for drying_ratio --- fire/SFParamsMod.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fire/SFParamsMod.F90 b/fire/SFParamsMod.F90 index 59c91bc5c0..3c153dbd9a 100644 --- a/fire/SFParamsMod.F90 +++ b/fire/SFParamsMod.F90 @@ -174,6 +174,9 @@ subroutine SpitFireRegisterScalars(fates_params) call fates_params%RegisterParameter(name=SF_name_durat_slope, dimension_shape=dimension_shape_scalar, & dimension_names=dim_names_scalar) + call fates_params%RegisterParameter(name=SF_name_drying_ratio, dimension_shape=dimension_shape_scalar, & + dimension_names=dim_names_scalar) + end subroutine SpitFireRegisterScalars !----------------------------------------------------------------------- @@ -212,6 +215,9 @@ subroutine SpitFireReceiveScalars(fates_params) call fates_params%RetreiveParameter(name=SF_name_durat_slope, & data=SF_val_durat_slope) + call fates_params%RetreiveParameter(name=SF_name_drying_ratio & + data=SF_val_drying_ratio) + end subroutine SpitFireReceiveScalars !----------------------------------------------------------------------- @@ -279,9 +285,6 @@ subroutine SpitFireRegisterNFSC(fates_params) call fates_params%RegisterParameter(name=SF_name_mid_moisture_Slope, dimension_shape=dimension_shape_1d, & dimension_names=dim_names) - call fates_params%RegisterParameter(name=SF_name_drying_ratio, dimension_shape=dimension_shape_1d, & - dimension_names=dim_names) - call fates_params%RegisterParameter(name=SF_name_max_decomp, dimension_shape=dimension_shape_1d, & dimension_names=dim_names) @@ -321,9 +324,6 @@ subroutine SpitFireReceiveNFSC(fates_params) call fates_params%RetreiveParameter(name=SF_name_mid_moisture_Slope, & data=SF_val_mid_moisture_Slope) - call fates_params%RetreiveParameter(name=SF_name_drying_ratio, & - data=SF_val_drying_ratio) - call fates_params%RetreiveParameter(name=SF_name_max_decomp, & data=SF_val_max_decomp) From 5c77081f151663abf63c7c05f4313a4e8f18476a Mon Sep 17 00:00:00 2001 From: Jacquelyn Shuman Date: Tue, 8 Jan 2019 19:04:22 -0700 Subject: [PATCH 20/23] Add missing comma to SFParamsMod --- fire/SFParamsMod.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fire/SFParamsMod.F90 b/fire/SFParamsMod.F90 index 3c153dbd9a..ecf4751f81 100644 --- a/fire/SFParamsMod.F90 +++ b/fire/SFParamsMod.F90 @@ -215,7 +215,7 @@ subroutine SpitFireReceiveScalars(fates_params) call fates_params%RetreiveParameter(name=SF_name_durat_slope, & data=SF_val_durat_slope) - call fates_params%RetreiveParameter(name=SF_name_drying_ratio & + call fates_params%RetreiveParameter(name=SF_name_drying_ratio, & data=SF_val_drying_ratio) end subroutine SpitFireReceiveScalars From c079597073878367b1fb54472b823385d9ebd09f Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 10 Jan 2019 10:31:10 -0800 Subject: [PATCH 21/23] Half-way through adding new restarts for site level diagnostics --- main/EDTypesMod.F90 | 21 ++-- main/FatesRestartInterfaceMod.F90 | 170 +++++++++++++++++++++++++++++- 2 files changed, 179 insertions(+), 12 deletions(-) diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index d9c5f5c9d9..dce1f89773 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -605,13 +605,19 @@ module EDTypesMod ! PLANT HYDRAULICS type(ed_site_hydr_type), pointer :: si_hydr - + + ! DIAGNOSTICS ! TERMINATION, RECRUITMENT, DEMOTION, and DISTURBANCE - - real(r8), allocatable :: terminated_nindivs(:,:,:) ! number of individuals that were in cohorts which were terminated this timestep, on size x pft x canopy array. - real(r8) :: termination_carbonflux(nclmax) ! carbon flux from live to dead pools associated with termination mortality, per canopy level - real(r8) :: recruitment_rate(1:maxpft) ! number of individuals that were recruited into new cohorts - real(r8), allocatable :: demotion_rate(:) ! rate of individuals demoted from canopy to understory per FATES timestep + + 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) :: term_carbonflux_canopy ! carbon flux from live to dead pools associated + ! with termination mortality, per canopy level + real(r8) :: term_carbonflux_ustory ! carbon flux from live to dead pools associated + ! with termination mortality, per canopy level + + real(r8) :: recruitment_rate(1:maxpft) ! number of individuals that were recruited into new cohorts + real(r8), allocatable :: demotion_rate(:) ! rate of individuals demoted from canopy to understory per FATES timestep real(r8) :: demotion_carbonflux ! biomass of demoted individuals from canopy to understory [kgC/ha/day] real(r8), allocatable :: promotion_rate(:) ! rate of individuals promoted from understory to canopy per FATES timestep real(r8) :: promotion_carbonflux ! biomass of promoted individuals from understory to canopy [kgC/ha/day] @@ -620,7 +626,8 @@ module EDTypesMod real(r8), allocatable :: fmort_rate(:,:,:) ! rate of individuals killed due to fire mortality per year. on size x pft x can-layer array ! (1:nlevsclass,1:numpft,1:nclmax) - real(r8) :: fmort_carbonflux(nclmax) ! biomass of individuals killed due to fire mortality per year. [gC/m2/sec] + real(r8) :: fmort_carbonflux_canopy ! biomass of canopy indivs killed due to fire per year. [gC/m2/sec] + real(r8) :: fmort_carbonflux_ustory ! biomass of understory indivs killed due to fire per year [gC/m2/sec] real(r8), allocatable :: fmort_rate_cambial(:,:) ! rate of individuals killed due to fire mortality from cambial damage per year. on size x pft array real(r8), allocatable :: fmort_rate_crown(:,:) ! rate of individuals killed due to fire mortality from crown damage per year. on size x pft array diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index 24eaa07311..ea99ddd45c 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -123,13 +123,35 @@ module FatesRestartInterfaceMod integer, private :: ir_root_litter_paft integer, private :: ir_leaf_litter_in_paft integer, private :: ir_root_litter_in_paft - integer, private :: ir_seed_bank_sift - integer, private :: ir_spread_si + integer, private :: ir_livegrass_pa integer, private :: ir_age_pa integer, private :: ir_area_pa + ! Site level integer, private :: ir_watermem_siwm + integer, private :: ir_seed_bank_sift + integer, private :: ir_spread_si + integer, private :: ir_recrate_sift + integer, private :: ir_fmortrate_cano_siscpf + integer, private :: ir_fmortrate_usto_siscpf + integer, private :: ir_imortrate_siscpf + integer, private :: ir_fmortrate_crown_siscpf + integer, private :: ir_fmortrate_cambi_siscpf + integer, private :: ir_termnindiv_cano_siscpf + integer, private :: ir_termnindiv_usto_siscpf + integer, private :: ir_growflx_fusion_siscpf + integer, private :: ir_demorate_sisc + integer, private :: ir_promrate_sisc + integer, private :: ir_termcflux_cano_si + integer, private :: ir_termcflux_usto_si + integer, private :: ir_democflux_si + integer, private :: ir_promcflux_si + integer, private :: ir_imortcflux_si + integer, private :: ir_fmortcflux_cano_si + integer, private :: ir_fmortcflux_usto_si + + integer, private :: ir_prt_base ! Base index for all PRT variables @@ -827,6 +849,66 @@ subroutine define_restart_vars(this, initialize_variables) units='m3/m3', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_watermem_siwm ) + + call this%set_restart_var(vname='fates_', vtype=cohort_r8, & + long_name='', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_recrate_sift + + call this%set_restart_var(vname='fates_', vtype=cohort_r8, & + long_name='', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = + + call this%set_restart_var(vname='fates_', vtype=cohort_r8, & + long_name='', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = + + call this%set_restart_var(vname='fates_', vtype=cohort_r8, & + long_name='', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = + + call this%set_restart_var(vname='fates_', vtype=cohort_r8, & + long_name='', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = + + call this%set_restart_var(vname='fates_', vtype=cohort_r8, & + long_name='', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = + + call this%set_restart_var(vname='fates_', vtype=cohort_r8, & + long_name='', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = + + + + integer, private :: ir_recrate_sift + integer, private :: ir_fmortrate_cano_siscpf + integer, private :: ir_fmortrate_usto_siscpf + integer, private :: ir_imortrate_siscpf + integer, private :: ir_fmortrate_crown_siscpf + integer, private :: ir_fmortrate_cambi_siscpf + integer, private :: ir_termnindiv_cano_siscpf + integer, private :: ir_termnindiv_usto_siscpf + integer, private :: ir_growflx_fusion_siscpf + integer, private :: ir_demorate_sisc + integer, private :: ir_promrate_sisc + integer, private :: ir_termcflux_cano_si + integer, private :: ir_termcflux_usto_si + integer, private :: ir_democflux_si + integer, private :: ir_promcflux_si + integer, private :: ir_imortcflux_si + integer, private :: ir_fmortcflux_cano_si + integer, private :: ir_fmortcflux_usto_si + + + + ! Register all of the PRT states and fluxes @@ -1143,7 +1225,26 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_livegrass_pa => this%rvars(ir_livegrass_pa)%r81d, & rio_age_pa => this%rvars(ir_age_pa)%r81d, & rio_area_pa => this%rvars(ir_area_pa)%r81d, & - rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d ) + rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d, & + rio_recrate_sift => this%rvars(ir_recrate_sift)%r81d, & + rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf), & + rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf), & + rio_imortrate_siscpf => this%rvars(ir_imortrate_siscpf), & + rio_fmortrate_crown_siscpf => this%rvars(ir_fmortrate_crown_siscpf), & + rio_fmortrate_cambi_siscpf => this%rvars(ir_fmortrate_cambi_siscpf), & + rio_termnindiv_cano_siscpf => this%rvars(ir_termnindiv_cano_siscpf), & + rio_termnindiv_usto_siscpf => this%rvars(ir_termnindiv_usto_siscpf), & + rio_growflx_fusion_siscpf => this%rvars(ir_growflx_fusion_siscpf), & + rio_demorate_sisc => this%rvars(ir_demorate_sisc), & + rio_promrate_sisc => this%rvars(ir_promrate_sisc), & + rio_termcflux_cano_si => this%rvars(ir_termcflux_cano_si), & + rio_termcflux_usto_si => this%rvars(ir_termcflux_usto_si), & + rio_democflux_si => this%rvars(ir_democflux_si), & + rio_promcflux_si => this%rvars(ir_promcflux_si), & + rio_imortcflux_si => this%rvars(ir_imortcflux_si), & + rio_fmortcflux_cano_si => this%rvars(ir_fmortcflux_cano_si), & + rio_fmortcflux_usto_si => this%rvars(ir_fmortcflux_usto_si)) + totalCohorts = 0 @@ -1641,6 +1742,8 @@ subroutine get_restart_vectors(this, nc, nsites, sites) integer :: io_idx_pa_cwd ! each cwd class within each patch (pa_cwd) integer :: io_idx_pa_ib ! each SW radiation band per patch (pa_ib) integer :: io_idx_si_wmem ! each water memory class within each site + integer :: io_idx_si_scpf ! each size-class x pft index within site + integer :: io_idx_si_sc ! each size-class index within site ! Some counters (for checking mostly) integer :: totalcohorts ! total cohort count on this thread (diagnostic) @@ -1717,8 +1820,27 @@ subroutine get_restart_vectors(this, nc, nsites, sites) rio_livegrass_pa => this%rvars(ir_livegrass_pa)%r81d, & rio_age_pa => this%rvars(ir_age_pa)%r81d, & rio_area_pa => this%rvars(ir_area_pa)%r81d, & - rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d ) + rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d, & + rio_recrate_sift => this%rvars(ir_recrate_sift)%r81d, & + rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf), & + rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf), & + rio_imortrate_siscpf => this%rvars(ir_imortrate_siscpf), & + rio_fmortrate_crown_siscpf => this%rvars(ir_fmortrate_crown_siscpf), & + rio_fmortrate_cambi_siscpf => this%rvars(ir_fmortrate_cambi_siscpf), & + rio_termnindiv_cano_siscpf => this%rvars(ir_termnindiv_cano_siscpf), & + rio_termnindiv_usto_siscpf => this%rvars(ir_termnindiv_usto_siscpf), & + rio_growflx_fusion_siscpf => this%rvars(ir_growflx_fusion_siscpf), & + rio_demorate_sisc => this%rvars(ir_demorate_sisc), & + rio_promrate_sisc => this%rvars(ir_promrate_sisc), & + rio_termcflux_cano_si => this%rvars(ir_termcflux_cano_si), & + rio_termcflux_usto_si => this%rvars(ir_termcflux_usto_si), & + rio_democflux_si => this%rvars(ir_democflux_si), & + rio_promcflux_si => this%rvars(ir_promcflux_si), & + rio_imortcflux_si => this%rvars(ir_imortcflux_si), & + rio_fmortcflux_cano_si => this%rvars(ir_fmortcflux_cano_si), & + rio_fmortcflux_usto_si => this%rvars(ir_fmortcflux_usto_si)) + totalcohorts = 0 do s = 1,nsites @@ -1731,10 +1853,15 @@ subroutine get_restart_vectors(this, nc, nsites, sites) io_idx_pa_cwd = io_idx_co_1st io_idx_pa_ib = io_idx_co_1st io_idx_si_wmem = io_idx_co_1st + + io_idx_si_scpf = io_idx_co_1st + io_idx_si_sc = io_idx_co_1st + ! read seed_bank info(site-level, but PFT-resolved) - do i = 1,numpft + do i_pft = 1,numpft sites(s)%seed_bank(i) = rio_seed_bank_sift(io_idx_co_1st+i-1) + sites(s)%recruitment_rate(i_pft) = rio_recrate_sift(io_idx_co_1st+i-1) enddo sites(s)%spread = rio_spread_si(io_idx_si) @@ -1915,6 +2042,39 @@ subroutine get_restart_vectors(this, nc, nsites, sites) io_idx_si_wmem = io_idx_si_wmem + 1 end do + + ! Fill the site level diagnostics arrays + do i_scls = 1,nlevsclass + + do i_pft = 1, numpft + + sites(s)%fmort_rate_canopy(i_scls, i_pft) = rio_fmortrate_cano_siscpf(io_idx_si_scpf) + sites(s)%fmort_rate_ustory(i_scls, i_pft) = rio_fmortrate_usto_siscpf(io_idx_si_scpf) + 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) + + io_idx_si_scpf = io_idx_si_scpf + 1 + end do + + sites(s)%demotion_rate(i_scls) = rio_demorate_sisc(io_idx_si_sc) + sites(s)%promotion_rate(i_scls) = rio_promrate_sisc(io_idx_si_sc) + + io_idx_si_sc = io_idx_si_sc + 1 + end do + + + sites(s)%term_carbonflux_canopy = rio_termcflux_cano_si(io_idx_si) + sites(s)%term_carbonflux_ustory = rio_termcflux_usto_si(io_idx_si) + sites(s)%demotion_carbonflux = rio_democflux_si(io_idx_si) + sites(s)%promotion_carbonflux = rio_promcflux_si(io_idx_si) + sites(s)%imort_carbonflux = rio_imortcflux_si(io_idx_si) + sites(s)%fmort_carbonflux_canopy = rio_fmortcflux_cano_si(io_idx_si) + sites(s)%fmort_carbonflux_ustory = rio_fmortcflux_usto_si(io_idx_si) + sites(s)%old_stock = rio_old_stock_si(io_idx_si) sites(s)%status = rio_cd_status_si(io_idx_si) sites(s)%dstatus = rio_dd_status_si(io_idx_si) From 82be6b05b6d3d57cd36c1a82275e89294750ba9b Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Thu, 10 Jan 2019 17:16:42 -0800 Subject: [PATCH 22/23] First pass through adding site diagnostics fmort/nindivs etc, to restarts --- biogeochem/EDCohortDynamicsMod.F90 | 20 ++- biogeochem/EDPatchDynamicsMod.F90 | 32 +++- main/EDInitMod.F90 | 18 +- main/EDTypesMod.F90 | 17 +- main/FatesHistoryInterfaceMod.F90 | 60 ++++--- main/FatesRestartInterfaceMod.F90 | 266 +++++++++++++++++------------ 6 files changed, 257 insertions(+), 156 deletions(-) diff --git a/biogeochem/EDCohortDynamicsMod.F90 b/biogeochem/EDCohortDynamicsMod.F90 index 334bd34313..3ee1a44e2e 100644 --- a/biogeochem/EDCohortDynamicsMod.F90 +++ b/biogeochem/EDCohortDynamicsMod.F90 @@ -21,6 +21,7 @@ module EDCohortDynamicsMod use EDTypesMod , only : min_npm2, min_nppatch use EDTypesMod , only : min_n_safemath use EDTypesMod , only : nlevleaf + use EDTypesMod , only : ican_upper use FatesInterfaceMod , only : hlm_use_planthydro use FatesInterfaceMod , only : hlm_parteh_mode use FatesPlantHydraulicsMod, only : FuseCohortHydraulics @@ -606,12 +607,19 @@ subroutine terminate_cohorts( currentSite, currentPatch, level ) ! preserve a record of the to-be-terminated cohort for mortality accounting levcan = currentCohort%canopy_layer - currentSite%terminated_nindivs(currentCohort%size_class,currentCohort%pft,levcan) = & - currentSite%terminated_nindivs(currentCohort%size_class,currentCohort%pft,levcan) + currentCohort%n - ! - currentSite%termination_carbonflux(levcan) = currentSite%termination_carbonflux(levcan) + & - currentCohort%n * (struct_c+sapw_c+leaf_c+fnrt_c+store_c+repro_c) - + 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_carbonflux_canopy = currentSite%term_carbonflux_canopy + & + 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_carbonflux_ustory = currentSite%term_carbonflux_ustory + & + currentCohort%n * (struct_c+sapw_c+leaf_c+fnrt_c+store_c+repro_c) + end if !put the litter from the terminated cohorts straight into the fragmenting pools if (currentCohort%n.gt.0.0_r8) then diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 2c4cf1b7e7..c7f059ca9d 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -17,6 +17,7 @@ module EDPatchDynamicsMod use EDTypesMod , only : dtype_ifall use EDTypesMod , only : dtype_ilog use EDTypesMod , only : dtype_ifire + use EDTypesMod , only : ican_upper use FatesInterfaceMod , only : hlm_use_planthydro use FatesInterfaceMod , only : hlm_numSWb use FatesInterfaceMod , only : bc_in_type @@ -538,20 +539,35 @@ subroutine spawn_patches( currentSite, bc_in) levcan = currentCohort%canopy_layer - ! before changing number densities, track total rate of trees that died due to fire, as well as from each fire mortality term - currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft, levcan) = & - currentSite%fmort_rate(currentCohort%size_class, currentCohort%pft, levcan) + & - nc%n * currentCohort%fire_mort / hlm_freq_day + if(levcan==ican_upper) then + + ! before changing number densities, track total rate of trees that died + ! due to fire, as well as from each fire mortality term + currentSite%fmort_rate_canopy(currentCohort%size_class, currentCohort%pft) = & + currentSite%fmort_rate_canopy(currentCohort%size_class, currentCohort%pft) + & + nc%n * currentCohort%fire_mort / hlm_freq_day + + currentSite%fmort_carbonflux_canopy = currentSite%fmort_carbonflux_canopy + & + (nc%n * currentCohort%fire_mort) * & + total_c * g_per_kg * days_per_sec * ha_per_m2 + + else + currentSite%fmort_rate_ustory(currentCohort%size_class, currentCohort%pft) = & + currentSite%fmort_rate_ustory(currentCohort%size_class, currentCohort%pft) + & + nc%n * currentCohort%fire_mort / hlm_freq_day + + currentSite%fmort_carbonflux_ustory = currentSite%fmort_carbonflux_ustory + & + (nc%n * currentCohort%fire_mort) * & + total_c * g_per_kg * days_per_sec * ha_per_m2 + end if + currentSite%fmort_rate_cambial(currentCohort%size_class, currentCohort%pft) = & currentSite%fmort_rate_cambial(currentCohort%size_class, currentCohort%pft) + & nc%n * currentCohort%cambial_mort / hlm_freq_day currentSite%fmort_rate_crown(currentCohort%size_class, currentCohort%pft) = & currentSite%fmort_rate_crown(currentCohort%size_class, currentCohort%pft) + & nc%n * currentCohort%crownfire_mort / hlm_freq_day - currentSite%fmort_carbonflux(levcan) = currentSite%fmort_carbonflux(levcan) + & - (nc%n * currentCohort%fire_mort) * & - total_c * g_per_kg * days_per_sec * ha_per_m2 - + ! loss of individual from fire in new patch. nc%n = nc%n * (1.0_r8 - currentCohort%fire_mort) diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 8f0090d332..50aa6d77c2 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -70,11 +70,13 @@ subroutine init_site_vars( site_in ) ! !LOCAL VARIABLES: !---------------------------------------------------------------------- ! - allocate(site_in%terminated_nindivs(1:nlevsclass,1:numpft,1:nclmax)) + allocate(site_in%term_nindivs_canopy(1:nlevsclass,1:numpft)) + allocate(site_in%term_nindivs_ustory(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)) - allocate(site_in%fmort_rate(1:nlevsclass,1:numpft,1:nclmax)) + allocate(site_in%fmort_rate_canopy(1:nlevsclass,1:numpft)) + allocate(site_in%fmort_rate_ustory(1:nlevsclass,1:numpft)) allocate(site_in%fmort_rate_cambial(1:nlevsclass,1:numpft)) allocate(site_in%fmort_rate_crown(1:nlevsclass,1:numpft)) allocate(site_in%growthflux_fusion(1:nlevsclass,1:numpft)) @@ -127,13 +129,17 @@ subroutine zero_site( site_in ) site_in%fates_to_bgc_last_ts = 0.0_r8 ! termination and recruitment info - site_in%terminated_nindivs(:,:,:) = 0._r8 - site_in%termination_carbonflux(:) = 0._r8 + site_in%term_nindivs_canopy(:,:) = 0._r8 + site_in%term_nindivs_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 - site_in%fmort_rate(:,:,:) = 0._r8 - site_in%fmort_carbonflux(:) = 0._r8 + site_in%fmort_rate_canopy(:,:) = 0._r8 + site_in%fmort_rate_ustory(:,:) = 0._r8 + site_in%fmort_carbonflux_canopy = 0._r8 + site_in%fmort_carbonflux_ustory = 0._r8 site_in%fmort_rate_cambial(:,:) = 0._r8 site_in%fmort_rate_crown(:,:) = 0._r8 diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index dce1f89773..8f07bfb4c5 100644 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -611,6 +611,8 @@ module EDTypesMod 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) :: term_carbonflux_canopy ! carbon flux from live to dead pools associated ! with termination mortality, per canopy level real(r8) :: term_carbonflux_ustory ! carbon flux from live to dead pools associated @@ -624,14 +626,19 @@ module EDTypesMod real(r8), allocatable :: imort_rate(:,:) ! rate of individuals killed due to impact mortality per year. on size x pft array real(r8) :: imort_carbonflux ! biomass of individuals killed due to impact mortality per year. [kgC/ha/day] - real(r8), allocatable :: fmort_rate(:,:,:) ! rate of individuals killed due to fire mortality per year. on size x pft x can-layer array - ! (1:nlevsclass,1:numpft,1:nclmax) + real(r8), allocatable :: fmort_rate_canopy(:,:) ! rate of canopy individuals killed due to fire mortality per year. + ! on size x pft array (1:nlevsclass,1:numpft) + real(r8), allocatable :: fmort_rate_ustory(:,:) ! rate of understory individuals killed due to fire mortality per year. + ! on size x pft array (1:nlevsclass,1:numpft) real(r8) :: fmort_carbonflux_canopy ! biomass of canopy indivs killed due to fire per year. [gC/m2/sec] real(r8) :: fmort_carbonflux_ustory ! biomass of understory indivs killed due to fire per year [gC/m2/sec] - real(r8), allocatable :: fmort_rate_cambial(:,:) ! rate of individuals killed due to fire mortality from cambial damage per year. on size x pft array - real(r8), allocatable :: fmort_rate_crown(:,:) ! rate of individuals killed due to fire mortality from crown damage per year. on size x pft array + real(r8), allocatable :: fmort_rate_cambial(:,:) ! rate of individuals killed due to fire mortality + ! from cambial damage per year. on size x pft array + real(r8), allocatable :: fmort_rate_crown(:,:) ! rate of individuals killed due to fire mortality + ! from crown damage per year. on size x pft array - real(r8), allocatable :: growthflux_fusion(:,:) ! rate of individuals moving into a given size class bin due to fusion in a given day. on size x pft array + real(r8), allocatable :: growthflux_fusion(:,:) ! rate of individuals moving into a given size class bin + ! due to fusion in a given day. on size x pft array ! some diagnostic-only (i.e. not resolved by ODE solver) flux of carbon to CWD and litter pools from termination and canopy mortality diff --git a/main/FatesHistoryInterfaceMod.F90 b/main/FatesHistoryInterfaceMod.F90 index 1160eb8bfd..dfa13845cb 100644 --- a/main/FatesHistoryInterfaceMod.F90 +++ b/main/FatesHistoryInterfaceMod.F90 @@ -2123,24 +2123,27 @@ subroutine update_history_dyn(this,nc,nsites,sites) i_scpf = (i_pft-1)*nlevsclass + i_scls ! ! termination mortality. sum of canopy and understory indices - hio_m6_si_scpf(io_si,i_scpf) = sum(sites(s)%terminated_nindivs(i_scls,i_pft,1:nclmax)) * days_per_year + 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)) * days_per_year hio_m6_si_scls(io_si,i_scls) = hio_m6_si_scls(io_si,i_scls) + & - sum(sites(s)%terminated_nindivs(i_scls,i_pft,1:nclmax)) * days_per_year + (sites(s)%term_nindivs_canopy(i_scls,i_pft) + & + sites(s)%term_nindivs_ustory(i_scls,i_pft)) * days_per_year + ! ! add termination mortality to canopy and understory mortality hio_mortality_canopy_si_scls(io_si,i_scls) = hio_mortality_canopy_si_scls(io_si,i_scls) + & - sites(s)%terminated_nindivs(i_scls,i_pft,ican_upper) * days_per_year + sites(s)%term_nindivs_canopy(i_scls,i_pft) * days_per_year hio_mortality_understory_si_scls(io_si,i_scls) = hio_mortality_understory_si_scls(io_si,i_scls) + & - sum(sites(s)%terminated_nindivs(i_scls,i_pft,ican_upper+1:nclmax)) * days_per_year + sites(s)%term_nindivs_ustory(i_scls,i_pft) * days_per_year hio_mortality_canopy_si_scpf(io_si,i_scpf) = hio_mortality_canopy_si_scpf(io_si,i_scpf) + & - sites(s)%terminated_nindivs(i_scls,i_pft,ican_upper) * days_per_year + sites(s)%term_nindivs_canopy(i_scls,i_pft) * days_per_year hio_mortality_understory_si_scpf(io_si,i_scpf) = hio_mortality_understory_si_scpf(io_si,i_scpf) + & - sum(sites(s)%terminated_nindivs(i_scls,i_pft,ican_upper+1:nclmax)) * days_per_year + sites(s)%term_nindivs_ustory(i_scls,i_pft) * days_per_year ! ! imort on its own @@ -2158,44 +2161,45 @@ subroutine update_history_dyn(this,nc,nsites,sites) iscag = i_scls ! since imort is by definition something that only happens in newly disturbed patches, treat as such hio_mortality_understory_si_scag(io_si,iscag) = hio_mortality_understory_si_scag(io_si,iscag) + & sites(s)%imort_rate(i_scls, i_pft) - ! ! fire mortality from the site-level diagnostic rates - hio_m5_si_scpf(io_si,i_scpf) = sum(sites(s)%fmort_rate(i_scls, i_pft,1:nclmax)) - hio_m5_si_scls(io_si,i_scls) = hio_m5_si_scls(io_si,i_scls) + sum(sites(s)%fmort_rate(i_scls, i_pft,1:nclmax)) + hio_m5_si_scpf(io_si,i_scpf) = sites(s)%fmort_rate_canopy(i_scls, i_pft) + & + sites(s)%fmort_rate_ustory(i_scls, i_pft) + hio_m5_si_scls(io_si,i_scls) = hio_m5_si_scls(io_si,i_scls) + & + sites(s)%fmort_rate_canopy(i_scls, i_pft) + sites(s)%fmort_rate_ustory(i_scls, i_pft) ! hio_crownfiremort_si_scpf(io_si,i_scpf) = sites(s)%fmort_rate_crown(i_scls, i_pft) hio_cambialfiremort_si_scpf(io_si,i_scpf) = sites(s)%fmort_rate_cambial(i_scls, i_pft) ! ! fire components of overall canopy and understory mortality hio_mortality_canopy_si_scpf(io_si,i_scpf) = hio_mortality_canopy_si_scpf(io_si,i_scpf) + & - sites(s)%fmort_rate(i_scls, i_pft,ican_upper) + sites(s)%fmort_rate_canopy(i_scls, i_pft) hio_mortality_canopy_si_scls(io_si,i_scls) = hio_mortality_canopy_si_scls(io_si,i_scls) + & - sites(s)%fmort_rate(i_scls, i_pft,ican_upper) + sites(s)%fmort_rate_canopy(i_scls, i_pft) ! the fire mortality rates for each layer are total dead, since the usable ! output will then normalize by the counts, we are allowed to sum over layers hio_mortality_understory_si_scpf(io_si,i_scpf) = hio_mortality_understory_si_scpf(io_si,i_scpf) + & - sum(sites(s)%fmort_rate(i_scls, i_pft,ican_upper+1:nclmax)) + sites(s)%fmort_rate_ustory(i_scls, i_pft) hio_mortality_understory_si_scls(io_si,i_scls) = hio_mortality_understory_si_scls(io_si,i_scls) + & - sum(sites(s)%fmort_rate(i_scls, i_pft,ican_upper+1:nclmax)) + sites(s)%fmort_rate_ustory(i_scls, i_pft) ! ! carbon flux associated with mortality of trees dying by fire hio_canopy_mortality_carbonflux_si(io_si) = hio_canopy_mortality_carbonflux_si(io_si) + & - sites(s)%fmort_carbonflux(ican_upper) - + sites(s)%fmort_carbonflux_canopy + hio_understory_mortality_carbonflux_si(io_si) = hio_understory_mortality_carbonflux_si(io_si) + & - sum(sites(s)%fmort_carbonflux(ican_upper+1:nclmax)) - + sites(s)%fmort_carbonflux_ustory + ! ! for scag variables, also treat as happening in the newly-disurbed patch hio_mortality_canopy_si_scag(io_si,iscag) = hio_mortality_canopy_si_scag(io_si,iscag) + & - sites(s)%fmort_rate(i_scls, i_pft,ican_upper) + sites(s)%fmort_rate_canopy(i_scls, i_pft) hio_mortality_understory_si_scag(io_si,iscag) = hio_mortality_understory_si_scag(io_si,iscag) + & - sum(sites(s)%fmort_rate(i_scls, i_pft,ican_upper+1:nclmax)) + sites(s)%fmort_rate_ustory(i_scls, i_pft) ! while in this loop, pass the fusion-induced growth rate flux to history hio_growthflux_fusion_si_scpf(io_si,i_scpf) = hio_growthflux_fusion_si_scpf(io_si,i_scpf) + & @@ -2208,11 +2212,14 @@ subroutine update_history_dyn(this,nc,nsites,sites) hio_understory_mortality_carbonflux_si(io_si) = hio_understory_mortality_carbonflux_si(io_si) + & sites(s)%imort_carbonflux ! - sites(s)%terminated_nindivs(:,:,:) = 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(:,:,:) = 0._r8 - sites(s)%fmort_carbonflux(:) = 0._r8 + sites(s)%fmort_rate_canopy(:,:) = 0._r8 + sites(s)%fmort_rate_ustory(:,:) = 0._r8 + sites(s)%fmort_carbonflux_canopy = 0._r8 + sites(s)%fmort_carbonflux_ustory = 0._r8 sites(s)%fmort_rate_cambial(:,:) = 0._r8 sites(s)%fmort_rate_crown(:,:) = 0._r8 sites(s)%growthflux_fusion(:,:) = 0._r8 @@ -2254,13 +2261,14 @@ subroutine update_history_dyn(this,nc,nsites,sites) ! mortality-associated carbon fluxes hio_canopy_mortality_carbonflux_si(io_si) = hio_canopy_mortality_carbonflux_si(io_si) + & - sites(s)%termination_carbonflux(ican_upper) * g_per_kg * days_per_sec * ha_per_m2 - + sites(s)%term_carbonflux_canopy * g_per_kg * days_per_sec * ha_per_m2 + hio_understory_mortality_carbonflux_si(io_si) = hio_understory_mortality_carbonflux_si(io_si) + & - sum(sites(s)%termination_carbonflux(ican_upper+1:nclmax)) * g_per_kg * days_per_sec * ha_per_m2 + sites(s)%term_carbonflux_ustory * g_per_kg * days_per_sec * ha_per_m2 ! and zero the site-level termination carbon flux variable - sites(s)%termination_carbonflux(:) = 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 do i_cwd = 1, ncwd diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index ea99ddd45c..f38af0bae4 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -1,22 +1,22 @@ module FatesRestartInterfaceMod - use FatesConstantsMod , only : r8 => fates_r8 - use FatesConstantsMod , only : fates_avg_flag_length - use FatesConstantsMod , only : fates_short_string_length - use FatesConstantsMod , only : fates_long_string_length - use FatesConstantsMod , only : itrue - use FatesConstantsMod , only : ifalse - use FatesGlobals , only : fates_log - use FatesGlobals , only : endrun => fates_endrun + use FatesConstantsMod, only : r8 => fates_r8 + use FatesConstantsMod, only : fates_avg_flag_length + use FatesConstantsMod, only : fates_short_string_length + use FatesConstantsMod, only : fates_long_string_length + use FatesConstantsMod, only : itrue + use FatesConstantsMod, only : ifalse + use FatesGlobals, only : fates_log + use FatesGlobals, only : endrun => fates_endrun use FatesIODimensionsMod, only : fates_io_dimension_type use FatesIOVariableKindMod, only : fates_io_variable_kind_type use FatesRestartVariableMod, only : fates_restart_variable_type use FatesInterfaceMod, only : bc_in_type use FatesInterfaceMod, only : bc_out_type use FatesSizeAgeTypeIndicesMod, only : get_sizeage_class_index - - use PRTGenericMod, only : prt_global + use FatesInterfaceMod, only : nlevsclass + use PRTGenericMod, only : prt_global ! CIME GLOBALS @@ -850,62 +850,75 @@ subroutine define_restart_vars(this, initialize_variables) hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_watermem_siwm ) - call this%set_restart_var(vname='fates_', vtype=cohort_r8, & - long_name='', & - units='', flushval = flushzero, & - hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_recrate_sift - - call this%set_restart_var(vname='fates_', vtype=cohort_r8, & - long_name='', & - units='', flushval = flushzero, & - hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = - - call this%set_restart_var(vname='fates_', vtype=cohort_r8, & - long_name='', & - units='', flushval = flushzero, & - hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = - - call this%set_restart_var(vname='fates_', vtype=cohort_r8, & - long_name='', & - units='', flushval = flushzero, & - hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = - - call this%set_restart_var(vname='fates_', vtype=cohort_r8, & - long_name='', & - units='', flushval = flushzero, & - hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = - - call this%set_restart_var(vname='fates_', vtype=cohort_r8, & - long_name='', & - units='', flushval = flushzero, & - hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = - - call this%set_restart_var(vname='fates_', vtype=cohort_r8, & - long_name='', & - units='', flushval = flushzero, & - hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = - - - - integer, private :: ir_recrate_sift - integer, private :: ir_fmortrate_cano_siscpf - integer, private :: ir_fmortrate_usto_siscpf - integer, private :: ir_imortrate_siscpf - integer, private :: ir_fmortrate_crown_siscpf - integer, private :: ir_fmortrate_cambi_siscpf - integer, private :: ir_termnindiv_cano_siscpf - integer, private :: ir_termnindiv_usto_siscpf - integer, private :: ir_growflx_fusion_siscpf - integer, private :: ir_demorate_sisc - integer, private :: ir_promrate_sisc - integer, private :: ir_termcflux_cano_si - integer, private :: ir_termcflux_usto_si - integer, private :: ir_democflux_si - integer, private :: ir_promcflux_si - integer, private :: ir_imortcflux_si - integer, private :: ir_fmortcflux_cano_si - integer, private :: ir_fmortcflux_usto_si + call this%set_restart_var(vname='fates_recrate', vtype=cohort_r8, & + long_name='fates diagnostics on recruitment - site x pft', & + units='indiv/ha/day', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_recrate_sift) + + call this%set_restart_var(vname='fates_fmortrate_canopy', vtype=cohort_r8, & + long_name='fates diagnostics on fire mortality in the canopy - site x pft', & + units='indiv/ha/year', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortrate_cano_siscpf) + + call this%set_restart_var(vname='fates_fmortrate_ustory', vtype=cohort_r8, & + long_name='fates diagnostics on fire mortality in understory - site x pft', & + units='indiv/ha/year', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortrate_usto_siscpf) + + call this%set_restart_var(vname='fates_imortrate', vtype=cohort_r8, & + long_name='fates diagnostics on impact mortality (understory only) - site x size x pft', & + units='indiv/ha/year', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_imortrate_siscpf) + + call this%set_restart_var(vname='fates_fmortrate_crown', vtype=cohort_r8, & + long_name='fates diagnostics on fire mortality via crown scorching - site x size x pft', & + units='indiv/ha/year', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortrate_crown_siscpf) + + call this%set_restart_var(vname='fates_fmortrate_cambi', vtype=cohort_r8, & + long_name='fates diagnostics on fire mortality via cambial damage - site x size x pft', & + units='indiv/ha/year', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortrate_cambi_siscpf) + + call this%set_restart_var(vname='fates_termn_canopy', vtype=cohort_r8, & + long_name='fates diagnostics on termination mortality in the canopy - site x size x pft', & + units='indiv/ha/day', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_termnindiv_cano_siscpf) + + call this%set_restart_var(vname='fates_termn_ustory', vtype=cohort_r8, & + long_name='fates diagnostics on termination mortality in the understory - site x size x pft', & + units='indiv/ha/day', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_termnindiv_usto_siscpf) + + call this%set_restart_var(vname='fates_growflx_fusion', vtype=cohort_r8, & + long_name='fates diag: rate of indivs moving into a size class bin due to fusion', & + units='indiv/ha/day', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_growflx_fusion_siscpf) + + call this%set_restart_var(vname='fates_demorate', vtype=cohort_r8, & + long_name='fates diagnoatic rate of indivs demoted from canopy to understory', & + units='indiv/ha/day', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_demorate_sisc) + + call this%set_restart_var(vname='fates_promrate', vtype=cohort_r8, & + long_name='fates diagnostic rate of indivs demoted from canopy to understory', & + units='indiv/ha/da', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_promrate_sisc) + + call this%set_restart_var(vname='fates_imortcflux', vtype=cohort_r8, & + long_name='biomass of individuals killed due to impact mortality per year', & + units='kgC/ha/day', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_imortcflux_si) + + call this%set_restart_var(vname='fates_fmortcflux_canopy', vtype=cohort_r8, & + long_name='fates diagnostic biomass of canopy indivs killed due to fire per year', & + units='gC/m2/sec', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortcflux_cano_si) + call this%set_restart_var(vname='fates_fmortcflux_canopy', vtype=cohort_r8, & + long_name='fates diagnostic biomass of understory indivs killed due to fire per year', & + units='gC/m2/sec', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortcflux_usto_si) @@ -1142,7 +1155,9 @@ subroutine set_restart_vectors(this,nc,nsites,sites) integer :: io_idx_pa_cwd ! each cwd class within each patch (pa_cwd) integer :: io_idx_pa_ib ! each SW band (vis/ir) per patch (pa_ib) integer :: io_idx_si_wmem ! each water memory class within each site - + integer :: io_idx_si_scpf ! each size-class x pft index within site + integer :: io_idx_si_sc ! each size-class index within site + ! Some counters (for checking mostly) integer :: totalcohorts ! total cohort count on this thread (diagnostic) integer :: patchespersite ! number of patches per site @@ -1153,6 +1168,8 @@ subroutine set_restart_vectors(this,nc,nsites,sites) integer :: ir_prt_var ! loop counter for var x position integer :: i_var ! loop counter for PRT variables integer :: i_pos ! loop counter for discrete PRT positions + integer :: i_scls ! loop counter for size-class + integer :: i_pft ! loop counter for pft type(fates_restart_variable_type) :: rvar type(ed_patch_type),pointer :: cpatch @@ -1227,23 +1244,23 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_area_pa => this%rvars(ir_area_pa)%r81d, & rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d, & rio_recrate_sift => this%rvars(ir_recrate_sift)%r81d, & - rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf), & - rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf), & - rio_imortrate_siscpf => this%rvars(ir_imortrate_siscpf), & - rio_fmortrate_crown_siscpf => this%rvars(ir_fmortrate_crown_siscpf), & - rio_fmortrate_cambi_siscpf => this%rvars(ir_fmortrate_cambi_siscpf), & - rio_termnindiv_cano_siscpf => this%rvars(ir_termnindiv_cano_siscpf), & - rio_termnindiv_usto_siscpf => this%rvars(ir_termnindiv_usto_siscpf), & - rio_growflx_fusion_siscpf => this%rvars(ir_growflx_fusion_siscpf), & - rio_demorate_sisc => this%rvars(ir_demorate_sisc), & - rio_promrate_sisc => this%rvars(ir_promrate_sisc), & - rio_termcflux_cano_si => this%rvars(ir_termcflux_cano_si), & - rio_termcflux_usto_si => this%rvars(ir_termcflux_usto_si), & - rio_democflux_si => this%rvars(ir_democflux_si), & - rio_promcflux_si => this%rvars(ir_promcflux_si), & - rio_imortcflux_si => this%rvars(ir_imortcflux_si), & - rio_fmortcflux_cano_si => this%rvars(ir_fmortcflux_cano_si), & - rio_fmortcflux_usto_si => this%rvars(ir_fmortcflux_usto_si)) + rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf)%r81d, & + rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf)%r81d, & + rio_imortrate_siscpf => this%rvars(ir_imortrate_siscpf)%r81d, & + rio_fmortrate_crown_siscpf => this%rvars(ir_fmortrate_crown_siscpf)%r81d, & + rio_fmortrate_cambi_siscpf => this%rvars(ir_fmortrate_cambi_siscpf)%r81d, & + rio_termnindiv_cano_siscpf => this%rvars(ir_termnindiv_cano_siscpf)%r81d, & + rio_termnindiv_usto_siscpf => this%rvars(ir_termnindiv_usto_siscpf)%r81d, & + rio_growflx_fusion_siscpf => this%rvars(ir_growflx_fusion_siscpf)%r81d, & + rio_demorate_sisc => this%rvars(ir_demorate_sisc)%r81d, & + rio_promrate_sisc => this%rvars(ir_promrate_sisc)%r81d, & + rio_termcflux_cano_si => this%rvars(ir_termcflux_cano_si)%r81d, & + rio_termcflux_usto_si => this%rvars(ir_termcflux_usto_si)%r81d, & + rio_democflux_si => this%rvars(ir_democflux_si)%r81d, & + rio_promcflux_si => this%rvars(ir_promcflux_si)%r81d, & + rio_imortcflux_si => this%rvars(ir_imortcflux_si)%r81d, & + rio_fmortcflux_cano_si => this%rvars(ir_fmortcflux_cano_si)%r81d, & + rio_fmortcflux_usto_si => this%rvars(ir_fmortcflux_usto_si)%r81d) totalCohorts = 0 @@ -1269,10 +1286,13 @@ subroutine set_restart_vectors(this,nc,nsites,sites) io_idx_pa_cwd = io_idx_co_1st io_idx_pa_ib = io_idx_co_1st io_idx_si_wmem = io_idx_co_1st + io_idx_si_scpf = io_idx_co_1st + io_idx_si_sc = io_idx_co_1st ! write seed_bank info(site-level, but PFT-resolved) - do i = 1,numpft - rio_seed_bank_sift(io_idx_co_1st+i-1) = sites(s)%seed_bank(i) + do i_pft = 1,numpft + rio_seed_bank_sift(io_idx_co_1st+i_pft-1) = sites(s)%seed_bank(i_pft) + rio_recrate_sift(io_idx_co_1st+i_pft-1) = sites(s)%recruitment_rate(i_pft) end do ! canopy spread term @@ -1449,6 +1469,41 @@ subroutine set_restart_vectors(this,nc,nsites,sites) enddo ! cpatch do while + + ! Fill the site level diagnostics arrays + do i_scls = 1, nlevsclass + + do i_pft = 1, numpft + + rio_fmortrate_cano_siscpf(io_idx_si_scpf) = sites(s)%fmort_rate_canopy(i_scls, i_pft) + rio_fmortrate_usto_siscpf(io_idx_si_scpf) = sites(s)%fmort_rate_ustory(i_scls, i_pft) + 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) + + io_idx_si_scpf = io_idx_si_scpf + 1 + end do + + rio_demorate_sisc(io_idx_si_sc) = sites(s)%demotion_rate(i_scls) + rio_promrate_sisc(io_idx_si_sc) = sites(s)%promotion_rate(i_scls) + + io_idx_si_sc = io_idx_si_sc + 1 + end do + + + rio_termcflux_cano_si(io_idx_si) = sites(s)%term_carbonflux_canopy + rio_termcflux_usto_si(io_idx_si) = sites(s)%term_carbonflux_ustory + rio_democflux_si(io_idx_si) = sites(s)%demotion_carbonflux + rio_promcflux_si(io_idx_si) = sites(s)%promotion_carbonflux + rio_imortcflux_si(io_idx_si) = sites(s)%imort_carbonflux + rio_fmortcflux_cano_si(io_idx_si) = sites(s)%fmort_carbonflux_canopy + rio_fmortcflux_usto_si(io_idx_si) = sites(s)%fmort_carbonflux_ustory + + + rio_old_stock_si(io_idx_si) = sites(s)%old_stock rio_cd_status_si(io_idx_si) = sites(s)%status rio_dd_status_si(io_idx_si) = sites(s)%dstatus @@ -1752,7 +1807,8 @@ subroutine get_restart_vectors(this, nc, nsites, sites) integer :: ir_prt_var ! loop counter for var x position integer :: i_var ! loop counter for PRT variables integer :: i_pos ! loop counter for discrete PRT positions - + integer :: i_pft ! loop counter for pft + integer :: i_scls ! loop counter for size-class associate( rio_npatch_si => this%rvars(ir_npatch_si)%int1d, & rio_old_stock_si => this%rvars(ir_oldstock_si)%r81d, & @@ -1822,23 +1878,23 @@ subroutine get_restart_vectors(this, nc, nsites, sites) rio_area_pa => this%rvars(ir_area_pa)%r81d, & rio_watermem_siwm => this%rvars(ir_watermem_siwm)%r81d, & rio_recrate_sift => this%rvars(ir_recrate_sift)%r81d, & - rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf), & - rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf), & - rio_imortrate_siscpf => this%rvars(ir_imortrate_siscpf), & - rio_fmortrate_crown_siscpf => this%rvars(ir_fmortrate_crown_siscpf), & - rio_fmortrate_cambi_siscpf => this%rvars(ir_fmortrate_cambi_siscpf), & - rio_termnindiv_cano_siscpf => this%rvars(ir_termnindiv_cano_siscpf), & - rio_termnindiv_usto_siscpf => this%rvars(ir_termnindiv_usto_siscpf), & - rio_growflx_fusion_siscpf => this%rvars(ir_growflx_fusion_siscpf), & - rio_demorate_sisc => this%rvars(ir_demorate_sisc), & - rio_promrate_sisc => this%rvars(ir_promrate_sisc), & - rio_termcflux_cano_si => this%rvars(ir_termcflux_cano_si), & - rio_termcflux_usto_si => this%rvars(ir_termcflux_usto_si), & - rio_democflux_si => this%rvars(ir_democflux_si), & - rio_promcflux_si => this%rvars(ir_promcflux_si), & - rio_imortcflux_si => this%rvars(ir_imortcflux_si), & - rio_fmortcflux_cano_si => this%rvars(ir_fmortcflux_cano_si), & - rio_fmortcflux_usto_si => this%rvars(ir_fmortcflux_usto_si)) + rio_fmortrate_cano_siscpf => this%rvars(ir_fmortrate_cano_siscpf)%r81d, & + rio_fmortrate_usto_siscpf => this%rvars(ir_fmortrate_usto_siscpf)%r81d, & + rio_imortrate_siscpf => this%rvars(ir_imortrate_siscpf)%r81d, & + rio_fmortrate_crown_siscpf => this%rvars(ir_fmortrate_crown_siscpf)%r81d, & + rio_fmortrate_cambi_siscpf => this%rvars(ir_fmortrate_cambi_siscpf)%r81d, & + rio_termnindiv_cano_siscpf => this%rvars(ir_termnindiv_cano_siscpf)%r81d, & + rio_termnindiv_usto_siscpf => this%rvars(ir_termnindiv_usto_siscpf)%r81d, & + rio_growflx_fusion_siscpf => this%rvars(ir_growflx_fusion_siscpf)%r81d, & + rio_demorate_sisc => this%rvars(ir_demorate_sisc)%r81d, & + rio_promrate_sisc => this%rvars(ir_promrate_sisc)%r81d, & + rio_termcflux_cano_si => this%rvars(ir_termcflux_cano_si)%r81d, & + rio_termcflux_usto_si => this%rvars(ir_termcflux_usto_si)%r81d, & + rio_democflux_si => this%rvars(ir_democflux_si)%r81d, & + rio_promcflux_si => this%rvars(ir_promcflux_si)%r81d, & + rio_imortcflux_si => this%rvars(ir_imortcflux_si)%r81d, & + rio_fmortcflux_cano_si => this%rvars(ir_fmortcflux_cano_si)%r81d, & + rio_fmortcflux_usto_si => this%rvars(ir_fmortcflux_usto_si)%r81d) totalcohorts = 0 @@ -1860,8 +1916,8 @@ subroutine get_restart_vectors(this, nc, nsites, sites) ! read seed_bank info(site-level, but PFT-resolved) do i_pft = 1,numpft - sites(s)%seed_bank(i) = rio_seed_bank_sift(io_idx_co_1st+i-1) - sites(s)%recruitment_rate(i_pft) = rio_recrate_sift(io_idx_co_1st+i-1) + sites(s)%seed_bank(i_pft) = rio_seed_bank_sift(io_idx_co_1st+i_pft-1) + sites(s)%recruitment_rate(i_pft) = rio_recrate_sift(io_idx_co_1st+i_pft-1) enddo sites(s)%spread = rio_spread_si(io_idx_si) From 3df34c2ae278a904adfda46a981ed323663cdb39 Mon Sep 17 00:00:00 2001 From: Ryan Knox Date: Fri, 11 Jan 2019 15:01:59 -0700 Subject: [PATCH 23/23] Fixed various problems with first implementation of site level diagnostics restarts --- main/FatesRestartInterfaceMod.F90 | 56 +++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index f38af0bae4..374fd8ff0a 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -851,75 +851,95 @@ subroutine define_restart_vars(this, initialize_variables) call this%set_restart_var(vname='fates_recrate', vtype=cohort_r8, & - long_name='fates diagnostics on recruitment - site x pft', & + long_name='fates diagnostics on recruitment', & units='indiv/ha/day', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_recrate_sift) call this%set_restart_var(vname='fates_fmortrate_canopy', vtype=cohort_r8, & - long_name='fates diagnostics on fire mortality in the canopy - site x pft', & + long_name='fates diagnostics on fire mortality canopy', & units='indiv/ha/year', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortrate_cano_siscpf) call this%set_restart_var(vname='fates_fmortrate_ustory', vtype=cohort_r8, & - long_name='fates diagnostics on fire mortality in understory - site x pft', & + long_name='fates diagnostics on fire mortality ustory', & units='indiv/ha/year', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortrate_usto_siscpf) call this%set_restart_var(vname='fates_imortrate', vtype=cohort_r8, & - long_name='fates diagnostics on impact mortality (understory only) - site x size x pft', & + long_name='fates diagnostics on impact mortality', & units='indiv/ha/year', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_imortrate_siscpf) call this%set_restart_var(vname='fates_fmortrate_crown', vtype=cohort_r8, & - long_name='fates diagnostics on fire mortality via crown scorching - site x size x pft', & + long_name='fates diagnostics on crown fire mortality', & units='indiv/ha/year', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortrate_crown_siscpf) call this%set_restart_var(vname='fates_fmortrate_cambi', vtype=cohort_r8, & - long_name='fates diagnostics on fire mortality via cambial damage - site x size x pft', & + long_name='fates diagnostics on fire cambial mortality', & units='indiv/ha/year', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortrate_cambi_siscpf) call this%set_restart_var(vname='fates_termn_canopy', vtype=cohort_r8, & - long_name='fates diagnostics on termination mortality in the canopy - site x size x pft', & + long_name='fates diagnostics on termin mortality canopy', & units='indiv/ha/day', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_termnindiv_cano_siscpf) call this%set_restart_var(vname='fates_termn_ustory', vtype=cohort_r8, & - long_name='fates diagnostics on termination mortality in the understory - site x size x pft', & + long_name='fates diagnostics on term mortality ustory', & units='indiv/ha/day', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_termnindiv_usto_siscpf) call this%set_restart_var(vname='fates_growflx_fusion', vtype=cohort_r8, & - long_name='fates diag: rate of indivs moving into a size class bin due to fusion', & + long_name='fates diag: rate of indivs moving via fusion', & units='indiv/ha/day', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_growflx_fusion_siscpf) call this%set_restart_var(vname='fates_demorate', vtype=cohort_r8, & - long_name='fates diagnoatic rate of indivs demoted from canopy to understory', & + long_name='fates diagnoatic rate of indivs demoted', & units='indiv/ha/day', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_demorate_sisc) call this%set_restart_var(vname='fates_promrate', vtype=cohort_r8, & - long_name='fates diagnostic rate of indivs demoted from canopy to understory', & + long_name='fates diagnostic rate of indivs promoted', & units='indiv/ha/da', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_promrate_sisc) - call this%set_restart_var(vname='fates_imortcflux', vtype=cohort_r8, & - long_name='biomass of individuals killed due to impact mortality per year', & + call this%set_restart_var(vname='fates_imortcflux', vtype=site_r8, & + long_name='biomass of indivs killed due to impact mort', & units='kgC/ha/day', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_imortcflux_si) - call this%set_restart_var(vname='fates_fmortcflux_canopy', vtype=cohort_r8, & - long_name='fates diagnostic biomass of canopy indivs killed due to fire per year', & + call this%set_restart_var(vname='fates_fmortcflux_canopy', vtype=site_r8, & + long_name='fates diagnostic biomass of canopy fire', & units='gC/m2/sec', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortcflux_cano_si) - call this%set_restart_var(vname='fates_fmortcflux_canopy', vtype=cohort_r8, & - long_name='fates diagnostic biomass of understory indivs killed due to fire per year', & + call this%set_restart_var(vname='fates_fmortcflux_ustory', vtype=site_r8, & + long_name='fates diagnostic biomass of understory fire', & units='gC/m2/sec', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_fmortcflux_usto_si) + call this%set_restart_var(vname='fates_termcflux_canopy', vtype=site_r8, & + long_name='fates diagnostic term carbon flux canopy', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_termcflux_cano_si ) + + call this%set_restart_var(vname='fates_termcflux_ustory', vtype=site_r8, & + long_name='fates diagnostic term carbon flux understory', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_termcflux_usto_si ) + + call this%set_restart_var(vname='fates_democflux', vtype=site_r8, & + long_name='fates diagnostic demotion carbon flux', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_democflux_si ) + + call this%set_restart_var(vname='fates_promcflux', vtype=site_r8, & + long_name='fates diagnostic promotion carbon flux ', & + units='', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_promcflux_si ) + @@ -1470,7 +1490,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) enddo ! cpatch do while - ! Fill the site level diagnostics arrays + ! Fill the site level diagnostics arrays do i_scls = 1, nlevsclass do i_pft = 1, numpft