diff --git a/biogeochem/EDLoggingMortalityMod.F90 b/biogeochem/EDLoggingMortalityMod.F90 index ea787ce2..2e3c20b3 100644 --- a/biogeochem/EDLoggingMortalityMod.F90 +++ b/biogeochem/EDLoggingMortalityMod.F90 @@ -55,7 +55,7 @@ module EDLoggingMortalityMod contains - subroutine IsItLoggingTime(is_master) + subroutine IsItLoggingTime(is_master,currentSite) ! ------------------------------------------------------------------------------- ! This subroutine determines if the current dynamics step should enact @@ -63,8 +63,9 @@ subroutine IsItLoggingTime(is_master) ! This is done by comparing the current model time to the logging event ! ids. If there is a match, it is logging time. ! ------------------------------------------------------------------------------- - + integer, intent(in) :: is_master + type(ed_site_type), intent(inout), target :: currentSite ! site structure integer :: icode ! Integer equivalent of the event code (parameter file only allows reals) integer :: log_date ! Day of month for logging exctracted from event code @@ -125,6 +126,12 @@ subroutine IsItLoggingTime(is_master) call endrun(msg=errMsg(sourcefile, __LINE__)) end if + ! Initialize some site level diagnostics that are calculated for each event + currentSite%resources_management%delta_litter_stock = 0.0_r8 + currentSite%resources_management%delta_biomass_stock = 0.0_r8 + currentSite%resources_management%delta_individual = 0.0_r8 + + if(logging_time .and. (is_master.eq.itrue) ) then write(fates_log(),fmt) 'Logging Event Enacted on date: ', & hlm_current_month,'-',hlm_current_day,'-',hlm_current_year @@ -240,190 +247,190 @@ subroutine logging_litter_fluxes(cp_Site, cp_target, new_patch_target, patch_sit delta_biomass_stock=0.0_r8 delta_individual=0.0_r8 !****************************************** - if (currentPatch%logging==1) then ! - patch_site_areadis = currentPatch%area * currentPatch%disturbance_rate - currentCohort => currentPatch%shortest - do while(associated(currentCohort)) - p = currentCohort%pft - if(currentPatch%disturbance_rates(dtype_ilog) > currentPatch%disturbance_rates(dtype_ifire) .and. & - currentPatch%disturbance_rates(dtype_ilog) > currentPatch%disturbance_rates(dtype_ifall) )then - !mortality is dominant disturbance - - if(EDPftvarcon_inst%woody(p) == 1)then - !woody=1 trees only, woody=0 grass, canopy_layer=0 woody=1 small trees - !******************************************/ - ! PART 1) Put twig, small branch and large branch of dead trees biomass from logging - ! and damage into above ground litter pool. - ! Put below ground dead trees biomass - ! from logging and damage into below ground litter pool - ! This happens before the plant number was updated, caused by selective logging. - ! but the plant number caused by other mortalities have been updated - ! in ED_integrate_state_variable - - !************************************/ - ! Number of trees that died because of the selective logging, per m2 of ground. - ! stem biomass per tree goes to CWD_ag - ! Total stem biomass = dead biomass + alive biomass + store biomass (bstore) - - ! root biomoass (br+bstore) - leaf biomass(bl) - ! = dead biomass + alive biomass - br - bl - - ! balive = bl + br + bsw - ! stem biomass per tree - bstem = (currentCohort%bsw + currentCohort%bdead) * & - EDPftvarcon_inst%allom_agb_frac(p) - - ! coarse root biomass per tree - bcroot = (currentCohort%bsw + currentCohort%bdead) * & - (1.0_r8 - EDPftvarcon_inst%allom_agb_frac(p)) - - ! density of dead trees per m2. Beware /AREA= 10000.0_r8 - ! This is site-level density, not patch level - dead_tree_density = (currentCohort%lmort_logging + & - currentCohort%lmort_collateral + currentCohort%lmort_infra )* & - currentCohort%n / AREA - - ! direct logged dead tree per m2 Beware /AREA= 10000.0_r8 - ! This is site-level density, not patch level - damaged_dead_tree_density = (currentCohort%lmort_collateral + & - currentCohort%lmort_infra )* currentCohort%n / AREA - - new_patch%leaf_litter(p) = new_patch%leaf_litter(p) + & - dead_tree_density * (currentCohort%bl) * AREA/currentPatch%area * & - patch_site_areadis/new_patch%area - new_patch%root_litter(p) = new_patch%root_litter(p) + & - dead_tree_density * (currentCohort%br+currentCohort%bstore)* & - AREA/currentPatch%area*patch_site_areadis/new_patch%area - - !KGC/m2 this is patch level density, integrated from site level - currentPatch%leaf_litter(p) = currentPatch%leaf_litter(p) + & - dead_tree_density * (currentCohort%bl)*AREA/currentPatch%area - currentPatch%root_litter(p) = currentPatch%root_litter(p) + & - dead_tree_density * (currentCohort%br+currentCohort%bstore) * & - AREA/currentPatch%area - - !debug****************************************************** + + patch_site_areadis = currentPatch%area * currentPatch%disturbance_rate + currentCohort => currentPatch%shortest + do while(associated(currentCohort)) + p = currentCohort%pft + if(currentPatch%disturbance_rates(dtype_ilog) > currentPatch%disturbance_rates(dtype_ifire) .and. & + currentPatch%disturbance_rates(dtype_ilog) > currentPatch%disturbance_rates(dtype_ifall) )then + !mortality is dominant disturbance + + if(EDPftvarcon_inst%woody(p) == 1)then + !woody=1 trees only, woody=0 grass, canopy_layer=0 woody=1 small trees + !******************************************/ + ! PART 1) Put twig, small branch and large branch of dead trees biomass from logging + ! and damage into above ground litter pool. + ! Put below ground dead trees biomass + ! from logging and damage into below ground litter pool + ! This happens before the plant number was updated, caused by selective logging. + ! but the plant number caused by other mortalities have been updated + ! in ED_integrate_state_variable + + !************************************/ + ! Number of trees that died because of the selective logging, per m2 of ground. + ! stem biomass per tree goes to CWD_ag + ! Total stem biomass = dead biomass + alive biomass + store biomass (bstore) - + ! root biomoass (br+bstore) - leaf biomass(bl) + ! = dead biomass + alive biomass - br - bl + + ! balive = bl + br + bsw + ! stem biomass per tree + bstem = (currentCohort%bsw + currentCohort%bdead) * & + EDPftvarcon_inst%allom_agb_frac(p) + + ! coarse root biomass per tree + bcroot = (currentCohort%bsw + currentCohort%bdead) * & + (1.0_r8 - EDPftvarcon_inst%allom_agb_frac(p)) + + ! density of dead trees per m2. Beware /AREA= 10000.0_r8 + ! This is site-level density, not patch level + dead_tree_density = (currentCohort%lmort_logging + & + currentCohort%lmort_collateral + currentCohort%lmort_infra )* & + currentCohort%n / AREA + + ! direct logged dead tree per m2 Beware /AREA= 10000.0_r8 + ! This is site-level density, not patch level + damaged_dead_tree_density = (currentCohort%lmort_collateral + & + currentCohort%lmort_infra )* currentCohort%n / AREA + + new_patch%leaf_litter(p) = new_patch%leaf_litter(p) + & + dead_tree_density * (currentCohort%bl) * AREA/currentPatch%area * & + patch_site_areadis/new_patch%area + new_patch%root_litter(p) = new_patch%root_litter(p) + & + dead_tree_density * (currentCohort%br+currentCohort%bstore)* & + AREA/currentPatch%area*patch_site_areadis/new_patch%area + + !KGC/m2 this is patch level density, integrated from site level + currentPatch%leaf_litter(p) = currentPatch%leaf_litter(p) + & + dead_tree_density * (currentCohort%bl)*AREA/currentPatch%area + currentPatch%root_litter(p) = currentPatch%root_litter(p) + & + dead_tree_density * (currentCohort%br+currentCohort%bstore) * & + AREA/currentPatch%area + + !debug****************************************************** + !kGC/m2 delta litter !kGC/m2 + delta_litter_stock = delta_litter_stock +dead_tree_density * & + (currentCohort%bl) + dead_tree_density * & + (currentCohort%br+currentCohort%bstore) + delta_biomass_stock = delta_biomass_stock +dead_tree_density * & + (currentCohort%bdead + currentCohort%balive +currentCohort%bstore ) + delta_individual = delta_individual +dead_tree_density + !*********************************************************** + + ! track as diagnostic fluxes + currentSite%leaf_litter_diagnostic_input_carbonflux(p) = & + currentSite%leaf_litter_diagnostic_input_carbonflux(p) + & + (currentCohort%bl) * dead_tree_density + + currentSite%root_litter_diagnostic_input_carbonflux(p) = & + currentSite%root_litter_diagnostic_input_carbonflux(p) + & + (currentCohort%br+currentCohort%bstore) * dead_tree_density + + !above ground coarse woody debris of twigs, + !small branches and large branches are from logged and damaged trees + do c = 1,3 + new_patch%cwd_ag(c) = new_patch%cwd_ag(c) + dead_tree_density * & + SF_val_CWD_frac(c) * bstem *AREA/currentPatch%area * & + patch_site_areadis/new_patch%area + currentPatch%cwd_ag(c) = currentPatch%cwd_ag(c) + & + dead_tree_density * SF_val_CWD_frac(c) * & + bstem *AREA/currentPatch%area + + !debug*************************************************** !kGC/m2 delta litter !kGC/m2 - delta_litter_stock = delta_litter_stock +dead_tree_density * & - (currentCohort%bl) + dead_tree_density * & - (currentCohort%br+currentCohort%bstore) - delta_biomass_stock = delta_biomass_stock +dead_tree_density * & - (currentCohort%bdead + currentCohort%balive +currentCohort%bstore ) - delta_individual = delta_individual +dead_tree_density - !*********************************************************** + delta_litter_stock =delta_litter_stock + dead_tree_density & + * SF_val_CWD_frac(c) * bstem + !******************************************************** ! track as diagnostic fluxes - currentSite%leaf_litter_diagnostic_input_carbonflux(p) = & - currentSite%leaf_litter_diagnostic_input_carbonflux(p) + & - (currentCohort%bl) * dead_tree_density - - currentSite%root_litter_diagnostic_input_carbonflux(p) = & - currentSite%root_litter_diagnostic_input_carbonflux(p) + & - (currentCohort%br+currentCohort%bstore) * dead_tree_density - - !above ground coarse woody debris of twigs, - !small branches and large branches are from logged and damaged trees - do c = 1,3 - new_patch%cwd_ag(c) = new_patch%cwd_ag(c) + dead_tree_density * & - SF_val_CWD_frac(c) * bstem *AREA/currentPatch%area * & - patch_site_areadis/new_patch%area - currentPatch%cwd_ag(c) = currentPatch%cwd_ag(c) + & - dead_tree_density * SF_val_CWD_frac(c) * & - bstem *AREA/currentPatch%area - - !debug*************************************************** - !kGC/m2 delta litter !kGC/m2 - delta_litter_stock =delta_litter_stock + dead_tree_density & - * SF_val_CWD_frac(c) * bstem - !******************************************************** - - ! track as diagnostic fluxes - currentSite%CWD_AG_diagnostic_input_carbonflux(c) = & - currentSite%CWD_AG_diagnostic_input_carbonflux(c) + & - SF_val_CWD_frac(c) * bstem * dead_tree_density - enddo - - ! above ground coarse woody debris of trunk are only from damaged trees. - !The logged trees of this part are transported off-site. - do c = 4,4 - !This is patch level density, integrated from site level - new_patch%cwd_ag(c) = new_patch%cwd_ag(c) + & - damaged_dead_tree_density * SF_val_CWD_frac(c) * & - bstem *AREA/currentPatch%area * patch_site_areadis/new_patch%area - currentPatch%cwd_ag(c) = currentPatch%cwd_ag(c) + & - damaged_dead_tree_density * SF_val_CWD_frac(c) * & - bstem*AREA/currentPatch%area - - !kGC/m2 delta litter !kGC/m2 - delta_litter_stock =delta_litter_stock + & - damaged_dead_tree_density * SF_val_CWD_frac(c) * bstem - - !*******************************************************************/ - ! PART 2 Save logged trunk into product tool - ! PART 3 Pass product tool into flux out for carbon balance check - !*******************************************************************/ - logging_density = (currentCohort%lmort_logging * currentCohort%n) / AREA - - !kGC/m2 - flux_out = flux_out + logging_density * SF_val_CWD_frac(c) * bstem - trunk_product_site = trunk_product_site + & - logging_density * SF_val_CWD_frac(c) * bstem - - ! track as diagnostic fluxes - currentSite%CWD_AG_diagnostic_input_carbonflux(c) = & - currentSite%CWD_AG_diagnostic_input_carbonflux(c) + & - SF_val_CWD_frac(c) * bstem * damaged_dead_tree_density - enddo - - !below ground coarse woody debris of all sizes are from logged and damaged trees - do c = 1,ncwd - new_patch%cwd_bg(c) = new_patch%cwd_bg(c) + dead_tree_density * & - SF_val_CWD_frac(c) * bcroot *AREA/currentPatch%area * & - patch_site_areadis/new_patch%area - - currentPatch%cwd_bg(c) = currentPatch%cwd_bg(c) + & - dead_tree_density * SF_val_CWD_frac(c) * bcroot * & - AREA/currentPatch%area - - !kGC/m2 delta litter !kGC/m2 - delta_litter_stock =delta_litter_stock + & - dead_tree_density * SF_val_CWD_frac(c) * bcroot - - ! track as diagnostic fluxes - currentSite%CWD_BG_diagnostic_input_carbonflux(c) = & - currentSite%CWD_BG_diagnostic_input_carbonflux(c) + & - SF_val_CWD_frac(c) * bcroot * dead_tree_density - enddo - end if + currentSite%CWD_AG_diagnostic_input_carbonflux(c) = & + currentSite%CWD_AG_diagnostic_input_carbonflux(c) + & + SF_val_CWD_frac(c) * bstem * dead_tree_density + enddo + + ! above ground coarse woody debris of trunk are only from damaged trees. + !The logged trees of this part are transported off-site. + do c = 4,4 + !This is patch level density, integrated from site level + new_patch%cwd_ag(c) = new_patch%cwd_ag(c) + & + damaged_dead_tree_density * SF_val_CWD_frac(c) * & + bstem *AREA/currentPatch%area * patch_site_areadis/new_patch%area + currentPatch%cwd_ag(c) = currentPatch%cwd_ag(c) + & + damaged_dead_tree_density * SF_val_CWD_frac(c) * & + bstem*AREA/currentPatch%area + + !kGC/m2 delta litter !kGC/m2 + delta_litter_stock =delta_litter_stock + & + damaged_dead_tree_density * SF_val_CWD_frac(c) * bstem + + !*******************************************************************/ + ! PART 2 Save logged trunk into product tool + ! PART 3 Pass product tool into flux out for carbon balance check + !*******************************************************************/ + logging_density = (currentCohort%lmort_logging * currentCohort%n) / AREA + + !kGC/m2 + flux_out = flux_out + logging_density * SF_val_CWD_frac(c) * bstem + trunk_product_site = trunk_product_site + & + logging_density * SF_val_CWD_frac(c) * bstem + + ! track as diagnostic fluxes + currentSite%CWD_AG_diagnostic_input_carbonflux(c) = & + currentSite%CWD_AG_diagnostic_input_carbonflux(c) + & + SF_val_CWD_frac(c) * bstem * damaged_dead_tree_density + enddo + + !below ground coarse woody debris of all sizes are from logged and damaged trees + do c = 1,ncwd + new_patch%cwd_bg(c) = new_patch%cwd_bg(c) + dead_tree_density * & + SF_val_CWD_frac(c) * bcroot *AREA/currentPatch%area * & + patch_site_areadis/new_patch%area + + currentPatch%cwd_bg(c) = currentPatch%cwd_bg(c) + & + dead_tree_density * SF_val_CWD_frac(c) * bcroot * & + AREA/currentPatch%area + + !kGC/m2 delta litter !kGC/m2 + delta_litter_stock =delta_litter_stock + & + dead_tree_density * SF_val_CWD_frac(c) * bcroot + + ! track as diagnostic fluxes + currentSite%CWD_BG_diagnostic_input_carbonflux(c) = & + currentSite%CWD_BG_diagnostic_input_carbonflux(c) + & + SF_val_CWD_frac(c) * bcroot * dead_tree_density + enddo end if - currentCohort => currentCohort%taller - enddo !currentCohort - - !flux_out has been averaged to site level , not patch level - currentSite%flux_out = currentSite%flux_out + flux_out*AREA - - ! NOTE (RGK): Are these components being initialized correctly in all cases? - currentSite%resources_management%trunk_product_site = & - currentSite%resources_management%trunk_product_site + & - trunk_product_site*AREA - - currentSite%resources_management%delta_litter_stock = & - currentSite%resources_management%delta_litter_stock + & - delta_litter_stock* AREA - - currentSite%resources_management%delta_biomass_stock = & - currentSite%resources_management%delta_biomass_stock + & - delta_biomass_stock* AREA - - currentSite%resources_management%delta_individual = & - currentSite%resources_management%delta_individual + & - delta_individual* AREA - - currentCohort => new_patch%shortest - do while(associated(currentCohort)) - currentCohort%c_area = c_area(currentCohort) - currentCohort => currentCohort%taller - enddo - end if + end if + currentCohort => currentCohort%taller + enddo !currentCohort + + !flux_out has been averaged to site level , not patch level + currentSite%flux_out = currentSite%flux_out + flux_out*AREA + + + currentSite%resources_management%trunk_product_site = & + currentSite%resources_management%trunk_product_site + & + trunk_product_site*AREA + + currentSite%resources_management%delta_litter_stock = & + currentSite%resources_management%delta_litter_stock + & + delta_litter_stock* AREA + + currentSite%resources_management%delta_biomass_stock = & + currentSite%resources_management%delta_biomass_stock + & + delta_biomass_stock* AREA + + currentSite%resources_management%delta_individual = & + currentSite%resources_management%delta_individual + & + delta_individual* AREA + + currentCohort => new_patch%shortest + do while(associated(currentCohort)) + currentCohort%c_area = c_area(currentCohort) + currentCohort => currentCohort%taller + enddo + end subroutine logging_litter_fluxes end module EDLoggingMortalityMod diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index bfe24ee1..37b3636d 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -9,7 +9,7 @@ module EDPatchDynamicsMod use EDCohortDynamicsMod , only : fuse_cohorts, sort_cohorts, insert_cohort use EDtypesMod , only : ncwd, n_dbh_bins, ntol, area, dbhmax use EDTypesMod , only : maxPatchesPerSite - use EDTypesMod , only : ed_site_type, ed_patch_type, ed_cohort_type, ed_resources_management_type + use EDTypesMod , only : ed_site_type, ed_patch_type, ed_cohort_type use EDTypesMod , only : min_patch_area use EDTypesMod , only : nclmax use EDTypesMod , only : maxpft @@ -86,8 +86,6 @@ subroutine disturbance_rates( site_in) type (ed_patch_type) , pointer :: currentPatch type (ed_cohort_type), pointer :: currentCohort - type (ed_resources_management_type) :: resources_management - real(r8) :: cmort real(r8) :: bmort real(r8) :: hmort @@ -142,7 +140,7 @@ subroutine disturbance_rates( site_in) ! Yi Xu 2017 ! --------------------------------------------------------------- - if (currentPatch%logging==1 .and. logging_time) then + if (logging_time) then ! always call this function if turn on logging at the beginning call LoggingMortality_rates(site_in, currentCohort%pft, currentCohort%dbh, & @@ -630,11 +628,6 @@ subroutine spawn_patches( currentSite, bc_in) call terminate_cohorts(currentSite, currentPatch, 2) call sort_cohorts(currentPatch) - if (currentPatch%logging==1 .and. logging_time) then - currentPatch%after_spawn_patch= 1 - else - currentPatch%after_spawn_patch= 0 - endif currentPatch => currentPatch%younger enddo ! currentPatch patch loop. @@ -1294,13 +1287,6 @@ subroutine zero_patch(cp_p) currentPatch%sabs_dif(:) = 0.0_r8 currentPatch%zstar = 0.0_r8 - !LOGGING - !kGC/m2 - currentPatch%trunk_product = 0.0_r8 - currentPatch%logging = 1 ! Currently, assume all patch=1, need to change in future - currentPatch%after_spawn_patch = 0 - - end subroutine zero_patch ! ============================================================================ diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 73bda67f..3bcaf438 100755 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -107,6 +107,9 @@ subroutine zero_site( site_in ) site_in%CWD_BG_diagnostic_input_carbonflux(:) = 0._r8 site_in%leaf_litter_diagnostic_input_carbonflux(:) = 0._r8 site_in%root_litter_diagnostic_input_carbonflux(:) = 0._r8 + + ! Resources management (logging/harvesting, etc) + site_in%resources_management%trunk_product_site = 0.0_r8 end subroutine zero_site diff --git a/main/EDMainMod.F90 b/main/EDMainMod.F90 index 91e2fc2d..ede04ab2 100755 --- a/main/EDMainMod.F90 +++ b/main/EDMainMod.F90 @@ -88,7 +88,7 @@ subroutine ed_ecosystem_dynamics(currentSite, bc_in) ! Call a routine that simply identifies if logging should occur ! This is limited to a global event until more structured event handling is enabled - call IsItLoggingTime(hlm_masterproc) + call IsItLoggingTime(hlm_masterproc,currentSite) !************************************************************************** ! Fire, growth, biogeochemistry. @@ -500,19 +500,6 @@ subroutine ed_total_balance_check (currentSite, call_index ) enddo !end cohort loop - ! Modify biomass for logging - ! Yi Xu - ! 03/2017 - - if (currentPatch%logging==1 .and. currentPatch%after_spawn_patch==1) then - - ! turn off this flag after spawn patch , since flux_in and flux_out are cleaned in every balance check - currentPatch%after_spawn_patch = 0 - - end if - - - currentPatch => currentPatch%younger enddo !end patch loop diff --git a/main/EDTypesMod.F90 b/main/EDTypesMod.F90 index 5ac44076..9ea29bfb 100755 --- a/main/EDTypesMod.F90 +++ b/main/EDTypesMod.F90 @@ -443,12 +443,6 @@ module EDTypesMod ! PLANT HYDRAULICS type(ed_patch_hydr_type) , pointer :: pa_hydr ! All patch hydraulics data, see FatesHydraulicsMemMod.F90 - ! LOGGING EFFECTS - - integer :: logging ! 1=logging; 0=no logging - integer :: after_spawn_patch ! 1=after spawn patch; 0=before spawn patch - real(r8) :: trunk_product ! kGC/m2 - contains end type ed_patch_type diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index ed4ade83..8fd645f3 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -69,6 +69,7 @@ module FatesRestartInterfaceMod integer, private :: ir_fates_to_bgc_this_ts_si integer, private :: ir_fates_to_bgc_last_ts_si integer, private :: ir_seedrainflux_si + integer, private :: ir_trunk_product_si integer, private :: ir_ncohort_pa integer, private :: ir_balive_co integer, private :: ir_bdead_co @@ -591,6 +592,12 @@ subroutine define_restart_vars(this, initialize_variables) units='kgC/m2/year', flushval = flushzero, & hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_seedrainflux_si ) + call this%set_restart_var(vname='fates_trunk_product_site', vtype=site_r8, & + long_name='Accumulate trunk product flux at site', & + units='kgC/m2', flushval = flushzero, & + hlms='CLM:ALM', initialize=initialize_variables, ivar=ivar, index = ir_trunk_product_si ) + + ! ----------------------------------------------------------------------------------- ! Variables stored within cohort vectors ! Note: Some of these are multi-dimensional variables in the patch/site dimension @@ -1025,6 +1032,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_fates_to_bgc_this_ts_si => this%rvars(ir_fates_to_bgc_this_ts_si)%r81d, & rio_fates_to_bgc_last_ts_si => this%rvars(ir_fates_to_bgc_last_ts_si)%r81d, & rio_seedrainflux_si => this%rvars(ir_seedrainflux_si)%r81d, & + rio_trunk_product_si => this%rvars(ir_trunk_product_si)%r81d, & rio_ncohort_pa => this%rvars(ir_ncohort_pa)%int1d, & rio_balive_co => this%rvars(ir_balive_co)%r81d, & rio_bdead_co => this%rvars(ir_bdead_co)%r81d, & @@ -1310,8 +1318,11 @@ subroutine set_restart_vectors(this,nc,nsites,sites) rio_fates_to_bgc_this_ts_si(io_idx_si) = sites(s)%fates_to_bgc_this_ts rio_fates_to_bgc_last_ts_si(io_idx_si) = sites(s)%fates_to_bgc_last_ts rio_seedrainflux_si(io_idx_si) = sites(s)%tot_seed_rain_flux - + + ! Accumulated trunk product + rio_trunk_product_si(io_idx_si) = sites(s)%resources_management%trunk_product_site ! set numpatches for this column + rio_npatch_si(io_idx_si) = patchespersite do i = 1,numWaterMem ! numWaterMem currently 10 @@ -1611,6 +1622,7 @@ subroutine get_restart_vectors(this, nc, nsites, sites) rio_fates_to_bgc_this_ts_si => this%rvars(ir_fates_to_bgc_this_ts_si)%r81d, & rio_fates_to_bgc_last_ts_si => this%rvars(ir_fates_to_bgc_last_ts_si)%r81d, & rio_seedrainflux_si => this%rvars(ir_seedrainflux_si)%r81d, & + rio_trunk_product_si => this%rvars(ir_trunk_product_si)%r81d, & rio_ncohort_pa => this%rvars(ir_ncohort_pa)%int1d, & rio_balive_co => this%rvars(ir_balive_co)%r81d, & rio_bdead_co => this%rvars(ir_bdead_co)%r81d, & @@ -1893,7 +1905,8 @@ subroutine get_restart_vectors(this, nc, nsites, sites) sites(s)%fates_to_bgc_this_ts = rio_fates_to_bgc_this_ts_si(io_idx_si) sites(s)%fates_to_bgc_last_ts = rio_fates_to_bgc_last_ts_si(io_idx_si) sites(s)%tot_seed_rain_flux = rio_seedrainflux_si(io_idx_si) - + sites(s)%resources_management%trunk_product_site = rio_trunk_product_si(io_idx_si) + end do if ( DEBUG ) then