From c89b77057c0c1a1d12f6ee17e26f01000fd35216 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 11 Dec 2024 14:56:26 -0800 Subject: [PATCH] move seed regen model switch from EDParamsMod to FatesInterfaceTypesMod --- biogeochem/EDPatchDynamicsMod.F90 | 18 +++++++++--------- biogeochem/EDPhysiologyMod.F90 | 28 ++++++++++++++-------------- main/EDInitMod.F90 | 6 +++--- main/EDParamsMod.F90 | 17 +---------------- main/EDPftvarcon.F90 | 11 ----------- main/FatesInterfaceMod.F90 | 13 ++++++++++++- main/FatesInterfaceTypesMod.F90 | 5 +++++ main/FatesInventoryInitMod.F90 | 4 ++-- main/FatesRestartInterfaceMod.F90 | 12 ++++++------ parteh/PRTAllometricCNPMod.F90 | 20 ++++++++++---------- parteh/PRTAllometricCarbonMod.F90 | 11 +++++------ 11 files changed, 67 insertions(+), 78 deletions(-) diff --git a/biogeochem/EDPatchDynamicsMod.F90 b/biogeochem/EDPatchDynamicsMod.F90 index 9b02c9e14a..1528711524 100644 --- a/biogeochem/EDPatchDynamicsMod.F90 +++ b/biogeochem/EDPatchDynamicsMod.F90 @@ -29,7 +29,7 @@ module EDPatchDynamicsMod use EDTypesMod , only : elem_diag_type use EDTypesMod , only : min_patch_area use EDTypesMod , only : min_patch_area_forced - use EDParamsMod , only : regeneration_model + use FatesInterfaceTypesMod, only : hlm_regeneration_model use FatesInterfaceTypesMod, only : numpft use FatesConstantsMod , only : dtype_ifall use FatesConstantsMod , only : dtype_ilog @@ -697,7 +697,7 @@ subroutine spawn_patches( currentSite, bc_in) call newPatch%Create(age, site_areadis, i_landusechange_receiverpatchlabel, i_nocomp_pft, & num_swb, numpft, currentSite%nlevsoil, hlm_current_tod, & - regeneration_model) + hlm_regeneration_model) ! Initialize the litter pools to zero, these ! pools will be populated by looping over the existing patches @@ -1410,7 +1410,7 @@ subroutine spawn_patches( currentSite, bc_in) call buffer_patch%Create(0._r8, 0._r8, i_land_use_label, 0, & num_swb, numpft, currentSite%nlevsoil, hlm_current_tod, & - regeneration_model) + hlm_regeneration_model) ! Initialize the litter pools to zero do el=1,num_elements @@ -1598,7 +1598,7 @@ subroutine spawn_patches( currentSite, bc_in) if ( .not. buffer_patch_in_linked_list) then if (buffer_patch%area .lt. rsnbl_math_prec) then ! here we need to deallocate the buffer patch so that we don't get a memory leak. - call buffer_patch%FreeMemory(regeneration_model, numpft) + call buffer_patch%FreeMemory(hlm_regeneration_model, numpft) deallocate(buffer_patch, stat=istat, errmsg=smsg) if (istat/=0) then write(fates_log(),*) 'dealloc: fail on deallocate(dp):'//trim(smsg) @@ -1615,7 +1615,7 @@ subroutine spawn_patches( currentSite, bc_in) end if else ! buffer patch was never even used. deallocate. - call buffer_patch%FreeMemory(regeneration_model, numpft) + call buffer_patch%FreeMemory(hlm_regeneration_model, numpft) deallocate(buffer_patch, stat=istat, errmsg=smsg) if (istat/=0) then write(fates_log(),*) 'dealloc: fail on deallocate(dp):'//trim(smsg) @@ -1707,7 +1707,7 @@ subroutine split_patch(currentSite, currentPatch, new_patch, fraction_to_keep, a call new_patch%Create(0._r8, temp_area, & currentPatch%land_use_label, currentPatch%nocomp_pft_label, & num_swb, numpft, currentSite%nlevsoil, hlm_current_tod, & - regeneration_model) + hlm_regeneration_model) ! Initialize the litter pools to zero, these ! pools will be populated shortly @@ -3285,7 +3285,7 @@ subroutine fuse_2_patches(csite, dp, rp) call rp%tveg24%FuseRMean(dp%tveg24,rp%area*inv_sum_area) call rp%tveg_lpa%FuseRMean(dp%tveg_lpa,rp%area*inv_sum_area) - if ( regeneration_model == TRS_regeneration ) then + if ( hlm_regeneration_model == TRS_regeneration ) then call rp%seedling_layer_par24%FuseRMean(dp%seedling_layer_par24,rp%area*inv_sum_area) call rp%sdlng_mort_par%FuseRMean(dp%sdlng_mort_par,rp%area*inv_sum_area) call rp%sdlng2sap_par%FuseRMean(dp%sdlng2sap_par,rp%area*inv_sum_area) @@ -3378,7 +3378,7 @@ subroutine fuse_2_patches(csite, dp, rp) end if ! We have no need for the dp pointer anymore, we have passed on it's legacy - call dp%FreeMemory(regeneration_model, numpft) + call dp%FreeMemory(hlm_regeneration_model, numpft) deallocate(dp, stat=istat, errmsg=smsg) if (istat/=0) then write(fates_log(),*) 'dealloc006: fail on deallocate(dp):'//trim(smsg) @@ -3927,7 +3927,7 @@ subroutine CopyPatchMeansTimers(dp, rp) call rp%tveg_lpa%CopyFromDonor(dp%tveg_lpa) call rp%tveg_longterm%CopyFromDonor(dp%tveg_longterm) - if ( regeneration_model == TRS_regeneration ) then + if ( hlm_regeneration_model == TRS_regeneration ) then call rp%seedling_layer_par24%CopyFromDonor(dp%seedling_layer_par24) call rp%sdlng_mort_par%CopyFromDonor(dp%sdlng_mort_par) call rp%sdlng2sap_par%CopyFromDonor(dp%sdlng2sap_par) diff --git a/biogeochem/EDPhysiologyMod.F90 b/biogeochem/EDPhysiologyMod.F90 index 8d689a759a..2dfa9dc4b5 100644 --- a/biogeochem/EDPhysiologyMod.F90 +++ b/biogeochem/EDPhysiologyMod.F90 @@ -99,7 +99,6 @@ module EDPhysiologyMod use EDParamsMod , only : q10_mr use EDParamsMod , only : q10_froz use EDParamsMod , only : logging_export_frac - use EDParamsMod , only : regeneration_model use EDParamsMod , only : sdlng_mort_par_timescale use FatesPlantHydraulicsMod , only : AccumulateMortalityWaterStorage use FatesConstantsMod , only : itrue,ifalse @@ -144,7 +143,8 @@ module EDPhysiologyMod use FatesParameterDerivedMod, only : param_derived use FatesPlantHydraulicsMod, only : InitHydrCohort use PRTInitParamsFatesMod, only : NewRecruitTotalStoichiometry - use FatesInterfaceTypesMod , only : hlm_use_luh + use FatesInterfaceTypesMod, only : hlm_use_luh + use FatesInterfaceTypesMod, only : hlm_regeneration_model implicit none private @@ -2161,7 +2161,7 @@ subroutine SeedUpdate( currentSite ) litt%seed_in_local(pft) = litt%seed_in_local(pft) + site_seed_rain(pft)*(1.0_r8-site_disp_frac(pft))/area ![kg/m2/day] ! If we are using the Tree Recruitment Scheme (TRS) with or w/o seedling dynamics - if ( any(regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & + if ( any(hlm_regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & prt_params%allom_dbh_maxheight(pft) > min_max_dbh_for_trees) then ! Send a fraction of reproductive carbon to litter to account for @@ -2219,7 +2219,7 @@ subroutine SeedDecay( litt , currentPatch, bc_in ) ! ! !DESCRIPTION: ! 1. Flux from seed pool into leaf litter pool - ! 2. If the TRS with seedling dynamics is on (regeneration_model = 3) + ! 2. If the TRS with seedling dynamics is on (hlm_regeneration_model = 3) ! then we calculate seedling mortality here (i.e. flux from seedling pool ! (into leaf litter pool) ! @@ -2253,7 +2253,7 @@ subroutine SeedDecay( litt , currentPatch, bc_in ) ! If the TRS is switched off or the pft can't get big enough to be considered a tree ! then use FATES default regeneration. - if ( regeneration_model == default_regeneration .or. & + if ( hlm_regeneration_model == default_regeneration .or. & prt_params%allom_dbh_maxheight(pft) < min_max_dbh_for_trees ) then ! Default seed decay (TRS is off) @@ -2265,7 +2265,7 @@ subroutine SeedDecay( litt , currentPatch, bc_in ) ! If the TRS is switched on and the pft is a tree then add non-seed reproductive biomass ! to the seed decay flux. This was added to litt%seed_decay in the previously called SeedIn ! subroutine - if ( any(regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & + if ( any(hlm_regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & prt_params%allom_dbh_maxheight(pft) > min_max_dbh_for_trees ) then litt%seed_decay(pft) = litt%seed_decay(pft) + &! From non-seed reproductive biomass (added in @@ -2275,9 +2275,9 @@ subroutine SeedDecay( litt , currentPatch, bc_in ) end if - ! If the TRS is switched on with seedling dynamics (regeneration_model = 2) + ! If the TRS is switched on with seedling dynamics (hlm_regeneration_model = 2) ! then calculate seedling mortality. - if_trs_germ_decay: if ( regeneration_model == TRS_regeneration .and. & + if_trs_germ_decay: if ( hlm_regeneration_model == TRS_regeneration .and. & prt_params%allom_dbh_maxheight(pft) > min_max_dbh_for_trees ) then !---------------------------------------------------------------------- @@ -2383,8 +2383,8 @@ subroutine SeedGermination( litt, cold_stat, drought_stat, bc_in, currentPatch ) ! If the TRS's seedling dynamics is switched off, then we use FATES's default approach ! to germination - if_tfs_or_def: if ( regeneration_model == default_regeneration .or. & - regeneration_model == TRS_no_seedling_dyn .or. & + if_tfs_or_def: if ( hlm_regeneration_model == default_regeneration .or. & + hlm_regeneration_model == TRS_no_seedling_dyn .or. & prt_params%allom_dbh_maxheight(pft) < min_max_dbh_for_trees ) then litt%seed_germ_in(pft) = min(litt%seed(pft) * EDPftvarcon_inst%germination_rate(pft), & @@ -2392,7 +2392,7 @@ subroutine SeedGermination( litt, cold_stat, drought_stat, bc_in, currentPatch ) ! If TRS seedling dynamics is switched on we calculate seedling emergence (i.e. germination) ! as a pft-specific function of understory light and soil moisture. - else if ( regeneration_model == TRS_regeneration .and. & + else if ( hlm_regeneration_model == TRS_regeneration .and. & prt_params%allom_dbh_maxheight(pft) > min_max_dbh_for_trees ) then ! Step 1. Calculate how germination rate is modified by understory light @@ -2638,15 +2638,15 @@ subroutine recruitment(currentSite, currentPatch, bc_in) ! If TRS seedling dynamics is switched off then the available mass to make new recruits ! is everything in the seed_germ pool. - if (regeneration_model == default_regeneration .or. & - regeneration_model == TRS_no_seedling_dyn .or. & + if (hlm_regeneration_model == default_regeneration .or. & + hlm_regeneration_model == TRS_no_seedling_dyn .or. & prt_params%allom_dbh_maxheight(ft) < min_max_dbh_for_trees) then mass_avail = currentPatch%area * currentPatch%litter(el)%seed_germ(ft) ! If TRS seedling dynamics is on then calculate the available mass to make new recruits ! as a pft-specific function of light and soil moisture in the seedling layer. - else if (regeneration_model == TRS_regeneration .and. & + else if (hlm_regeneration_model == TRS_regeneration .and. & prt_params%allom_dbh_maxheight(ft) > min_max_dbh_for_trees) then sdlng2sap_par = currentPatch%sdlng2sap_par%GetMean()* & diff --git a/main/EDInitMod.F90 b/main/EDInitMod.F90 index 9fc11491c1..a88ac1cb1c 100644 --- a/main/EDInitMod.F90 +++ b/main/EDInitMod.F90 @@ -18,10 +18,10 @@ module EDInitMod use FatesConstantsMod , only : nearzero, area_error_4, area_error_3 use FatesGlobals , only : endrun => fates_endrun use EDParamsMod , only : nclmax - use EDParamsMod , only : regeneration_model use FatesGlobals , only : fates_log use FatesInterfaceTypesMod , only : hlm_is_restart use FatesInterfaceTypesMod , only : hlm_current_tod + use FatesInterfaceTypesMod , only : hlm_regeneration_model use EDPftvarcon , only : EDPftvarcon_inst use PRTParametersMod , only : prt_params use EDCohortDynamicsMod , only : create_cohort, fuse_cohorts, sort_cohorts @@ -782,7 +782,7 @@ subroutine init_patches( nsites, sites, bc_in) call newp%Create(age, newparea, nocomp_bareground_land, nocomp_bareground, & num_swb, numpft, sites(s)%nlevsoil, hlm_current_tod, & - regeneration_model) + hlm_regeneration_model) ! set pointers for first patch (or only patch, if nocomp is false) newp%patchno = 1 @@ -861,7 +861,7 @@ subroutine init_patches( nsites, sites, bc_in) call newp%Create(age, newparea, i_lu_state, nocomp_pft, & num_swb, numpft, sites(s)%nlevsoil, hlm_current_tod, & - regeneration_model) + hlm_regeneration_model) if (is_first_patch) then !is this the first patch? ! set pointers for first patch (or only patch, if nocomp is false) diff --git a/main/EDParamsMod.F90 b/main/EDParamsMod.F90 index 107fd65396..57eaeefb1c 100644 --- a/main/EDParamsMod.F90 +++ b/main/EDParamsMod.F90 @@ -63,12 +63,7 @@ module EDParamsMod real(r8),protected, public :: ED_val_cohort_age_fusion_tol ! minimum fraction in differece in cohort age between cohorts real(r8),protected, public :: ED_val_patch_fusion_tol ! minimum fraction in difference in profiles between patches real(r8),protected, public :: ED_val_canopy_closure_thresh ! site-level canopy closure point where trees take on forest (narrow) versus savannah (wide) crown allometry - integer,protected, public :: regeneration_model ! Switch for choosing between regeneration models: - ! (1) for Fates default - ! (2) for the Tree Recruitment Scheme (Hanbury-Brown et al., 2022) - ! (3) for the Tree Recruitment Scheme without seedling dynamics - - + logical,protected, public :: active_crown_fire ! flag, 1=active crown fire 0=no active crown fire character(len=param_string_length),parameter :: fates_name_active_crown_fire = "fates_fire_active_crown_fire" @@ -150,7 +145,6 @@ module EDParamsMod character(len=param_string_length),parameter,public :: ED_name_cohort_age_fusion_tol = "fates_cohort_age_fusion_tol" character(len=param_string_length),parameter,public :: ED_name_patch_fusion_tol= "fates_patch_fusion_tol" character(len=param_string_length),parameter,public :: ED_name_canopy_closure_thresh= "fates_canopy_closure_thresh" - character(len=param_string_length),parameter,public :: ED_name_regeneration_model= "fates_regeneration_model" character(len=param_string_length),parameter,public :: name_theta_cj_c3 = "fates_leaf_theta_cj_c3" character(len=param_string_length),parameter,public :: name_theta_cj_c4 = "fates_leaf_theta_cj_c4" @@ -303,7 +297,6 @@ subroutine FatesParamsInit() ED_val_cohort_age_fusion_tol = nan ED_val_patch_fusion_tol = nan ED_val_canopy_closure_thresh = nan - regeneration_model = -9 max_cohort_per_patch = -9 hydr_kmax_rsurf1 = nan hydr_kmax_rsurf2 = nan @@ -440,9 +433,6 @@ subroutine FatesRegisterParams(fates_params) call fates_params%RegisterParameter(name=ED_name_canopy_closure_thresh, dimension_shape=dimension_shape_scalar, & dimension_names=dim_names_scalar) - call fates_params%RegisterParameter(name=ED_name_regeneration_model, dimension_shape=dimension_shape_scalar, & - dimension_names=dim_names_scalar) - call fates_params%RegisterParameter(name=maxcohort_name, dimension_shape=dimension_shape_scalar, & dimension_names=dim_names_scalar) @@ -638,10 +628,6 @@ subroutine FatesReceiveParams(fates_params) call fates_params%RetrieveParameter(name=ED_name_canopy_closure_thresh, & data=ED_val_canopy_closure_thresh) - call fates_params%RetrieveParameter(name=ED_name_regeneration_model, & - data=tmpreal) - regeneration_model = nint(tmpreal) - call fates_params%RetrieveParameter(name=maxcohort_name, & data=tmpreal) max_cohort_per_patch = nint(tmpreal) @@ -807,7 +793,6 @@ subroutine FatesReportParams(is_master) write(fates_log(),fmt0) 'ED_val_cohort_age_fusion_tol = ',ED_val_cohort_age_fusion_tol write(fates_log(),fmt0) 'ED_val_patch_fusion_tol = ',ED_val_patch_fusion_tol write(fates_log(),fmt0) 'ED_val_canopy_closure_thresh = ',ED_val_canopy_closure_thresh - write(fates_log(),fmt0) 'regeneration_model = ',regeneration_model write(fates_log(),fmt0) 'hydro_kmax_rsurf1 = ',hydr_kmax_rsurf1 write(fates_log(),fmt0) 'hydro_kmax_rsurf2 = ',hydr_kmax_rsurf2 write(fates_log(),fmt0) 'hydro_psi0 = ',hydr_psi0 diff --git a/main/EDPftvarcon.F90 b/main/EDPftvarcon.F90 index cb7522a929..a7d9f630ba 100644 --- a/main/EDPftvarcon.F90 +++ b/main/EDPftvarcon.F90 @@ -29,7 +29,6 @@ module EDPftvarcon use FatesConstantsMod , only : default_regeneration use FatesConstantsMod , only : TRS_regeneration use FatesConstantsMod , only : TRS_no_seedling_dyn - use EDParamsMod , only : regeneration_model ! CIME Globals use shr_log_mod , only : errMsg => shr_log_errMsg @@ -1857,16 +1856,6 @@ subroutine FatesCheckParams(is_master) if(.not.is_master) return - if(.not.any(regeneration_model == [default_regeneration, & - TRS_regeneration, & - TRS_no_seedling_dyn] )) then - write(fates_log(),*) 'The regeneration model must be set to a known model type' - write(fates_log(),*) 'the default is 1, and the Hanbury-Brown models are 2 and 3' - write(fates_log(),*) 'You specified fates_regeneration_model = ',regeneration_model - write(fates_log(),*) 'Aborting' - call endrun(msg=errMsg(sourcefile, __LINE__)) - end if - select case (hlm_parteh_mode) case (prt_cnp_flex_allom_hyp) diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 96aa16c730..7999042010 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -19,7 +19,6 @@ module FatesInterfaceMod use EDParamsMod , only : maxpatches_by_landuse use EDParamsMod , only : max_cohort_per_patch use FatesRadiationMemMod , only : num_swb,ivis,inir - use EDParamsMod , only : regeneration_model use EDParamsMod , only : nclmax use EDParamsMod , only : nlevleaf use EDParamsMod , only : maxpft @@ -1482,6 +1481,7 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) hlm_maintresp_leaf_model = unset_int hlm_mort_cstarvation_model = unset_int hlm_radiation_model = unset_int + hlm_regeneration_model = unset_int hlm_use_logging = unset_int hlm_use_ed_st3 = unset_int hlm_use_ed_prescribed_phys = unset_int @@ -1806,6 +1806,11 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) call endrun(msg=errMsg(sourcefile, __LINE__)) end if + if(hlm_regeneration_model .eq. unset_int) then + write(fates_log(), *) 'seed regeneration model is unset: hlm_regeneration_model exiting' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + if(hlm_use_sp.eq.itrue.and.hlm_use_nocomp.eq.ifalse)then write(fates_log(), *) 'SP cannot be on if nocomp mode is off. Exiting. ' call endrun(msg=errMsg(sourcefile, __LINE__)) @@ -2057,6 +2062,12 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) write(fates_log(),*) 'Transfering hlm_radiation_model ',ival,' to FATES' end if + case('regeneration_model') + hlm_regeneration_model = ival + if (fates_global_verbose()) then + write(fates_log(),*) 'Transfering hlm_regeneration_model ',ival,' to FATES' + end if + case('use_logging') hlm_use_logging = ival if (fates_global_verbose()) then diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 8aab325678..5c3fef321c 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -189,6 +189,11 @@ module FatesInterfaceTypesMod integer, public :: hlm_radiation_model ! Switch for radiation model ! Norman (1) and Two-stream (2) + integer, public :: hlm_regeneration_model ! Switch for choosing between regeneration models: + ! (1) for Fates default + ! (2) for the Tree Recruitment Scheme (Hanbury-Brown et al., 2022) + ! (3) for the Tree Recruitment Scheme without seedling dynamics + integer, public :: hlm_use_ed_st3 ! This flag signals whether or not to use ! (ST)atic (ST)and (ST)ructure mode (ST3) ! Essentially, this gives us the ability diff --git a/main/FatesInventoryInitMod.F90 b/main/FatesInventoryInitMod.F90 index 4b945741fd..61ccb9aee3 100644 --- a/main/FatesInventoryInitMod.F90 +++ b/main/FatesInventoryInitMod.F90 @@ -32,7 +32,7 @@ module FatesInventoryInitMod use FatesConstantsMod, only : nearzero use FatesGlobals , only : endrun => fates_endrun use FatesGlobals , only : fates_log - use EDParamsMod , only : regeneration_model + use FatesInterfaceTypesMod, only : hlm_regeneration_model use FatesInterfaceTypesMod, only : bc_in_type use FatesInterfaceTypesMod, only : hlm_inventory_ctrl_file use FatesInterfaceTypesMod, only : nleafage @@ -285,7 +285,7 @@ subroutine initialize_sites_by_inventory(nsites,sites,bc_in) allocate(newpatch) call newpatch%Create(age_init, area_init, primaryland, & fates_unset_int, num_swb, numpft, sites(s)%nlevsoil, & - hlm_current_tod, regeneration_model) + hlm_current_tod, hlm_regeneration_model) newpatch%patchno = ipa newpatch%younger => null() diff --git a/main/FatesRestartInterfaceMod.F90 b/main/FatesRestartInterfaceMod.F90 index 8f6d3f3802..d752e70850 100644 --- a/main/FatesRestartInterfaceMod.F90 +++ b/main/FatesRestartInterfaceMod.F90 @@ -40,6 +40,7 @@ module FatesRestartInterfaceMod use FatesInterfaceTypesMod, only : nlevsclass use FatesInterfaceTypesMod, only : nlevdamage use FatesInterfaceTypesMod, only : hlm_radiation_model + use FatesInterfaceTypesMod, only : hlm_regeneration_model use FatesLitterMod, only : litter_type use FatesLitterMod, only : ncwd use FatesFuelClassesMod, only : num_fuel_classes @@ -52,7 +53,6 @@ module FatesRestartInterfaceMod use FatesRunningMeanMod, only : ema_lpa use FatesRadiationMemMod, only : num_swb,norman_solver,twostr_solver use TwoStreamMLPEMod, only : normalized_upper_boundary - use EDParamsMod, only : regeneration_model use FatesConstantsMod, only : n_term_mort_types use FatesConstantsMod, only : n_landuse_cats use FatesConstantsMod, only : N_DIST_TYPES @@ -1575,7 +1575,7 @@ subroutine define_restart_vars(this, initialize_variables) long_name='disturbance rates by donor land-use type, receiver land-use type, and disturbance type', & units='1/day', initialize=initialize_variables,ivar=ivar, index = ir_disturbance_rates_siluludi) - if ( regeneration_model == TRS_regeneration ) then + if ( hlm_regeneration_model == TRS_regeneration ) then call this%DefineRMeanRestartVar(vname='fates_seedling_layer_par24',vtype=cohort_r8, & long_name='24-hour seedling layer PAR', & @@ -2539,7 +2539,7 @@ subroutine set_restart_vectors(this,nc,nsites,sites) call this%SetRMeanRestartVar(cpatch%tveg_lpa, ir_tveglpa_pa, io_idx_co_1st) call this%SetRMeanRestartVar(cpatch%tveg_longterm, ir_tveglongterm_pa, io_idx_co_1st) - if ( regeneration_model == TRS_regeneration ) then + if ( hlm_regeneration_model == TRS_regeneration ) then call this%SetRMeanRestartVar(cpatch%seedling_layer_par24, ir_seedling_layer_par24_pa, io_idx_co_1st) call this%SetRMeanRestartVar(cpatch%sdlng_mort_par, ir_sdlng_mort_par_pa,io_idx_co_1st) call this%SetRMeanRestartVar(cpatch%sdlng2sap_par, ir_sdlng2sap_par_pa,io_idx_co_1st) @@ -2814,7 +2814,7 @@ subroutine create_patchcohort_structure(this, nc, nsites, sites, bc_in, bc_out) use EDTypesMod, only : ed_site_type use FatesCohortMod, only : fates_cohort_type use FatesPatchMod, only : fates_patch_type - use EDParamsMod, only : regeneration_model + use FatesInterfaceTypesMod, only : hlm_regeneration_model use FatesInterfaceTypesMod, only : fates_maxElementsPerPatch use FatesInterfaceTypesMod, only : hlm_current_tod, numpft use EDTypesMod, only : area @@ -2888,7 +2888,7 @@ subroutine create_patchcohort_structure(this, nc, nsites, sites, bc_in, bc_out) ! make new patch call newp%Create(fates_unset_r8, fates_unset_r8, primaryland, & nocomp_pft, num_swb, numpft, sites(s)%nlevsoil, & - hlm_current_tod, regeneration_model) + hlm_current_tod, hlm_regeneration_model) ! Initialize the litter pools to zero, these ! pools will be populated by looping over the existing patches @@ -3531,7 +3531,7 @@ subroutine get_restart_vectors(this, nc, nsites, sites) call this%GetRMeanRestartVar(cpatch%tveg_lpa, ir_tveglpa_pa, io_idx_co_1st) call this%GetRMeanRestartVar(cpatch%tveg_longterm, ir_tveglongterm_pa, io_idx_co_1st) - if ( regeneration_model == TRS_regeneration ) then + if ( hlm_regeneration_model == TRS_regeneration ) then call this%GetRMeanRestartVar(cpatch%seedling_layer_par24, ir_seedling_layer_par24_pa, io_idx_co_1st) call this%GetRMeanRestartVar(cpatch%sdlng_mort_par, ir_sdlng_mort_par_pa,io_idx_co_1st) call this%GetRMeanRestartVar(cpatch%sdlng2sap_par, ir_sdlng2sap_par_pa,io_idx_co_1st) diff --git a/parteh/PRTAllometricCNPMod.F90 b/parteh/PRTAllometricCNPMod.F90 index afa8e58259..320e4ea3e1 100644 --- a/parteh/PRTAllometricCNPMod.F90 +++ b/parteh/PRTAllometricCNPMod.F90 @@ -68,7 +68,7 @@ module PRTAllometricCNPMod use FatesConstantsMod , only : prescribed_p_uptake use FatesConstantsMod , only : prescribed_n_uptake use EDPftvarcon, only : EDPftvarcon_inst - use EDParamsMod , only : regeneration_model + use FatesInterfaceTypesMod, only : hlm_regeneration_model @@ -1491,7 +1491,7 @@ subroutine CNPStatureGrowth(this,c_gain, n_gain, p_gain, & ! We designate a plant a shrub or grass if its dbh at maximum height ! is less than 15 cm - if ( regeneration_model == default_regeneration .or. & + if ( hlm_regeneration_model == default_regeneration .or. & prt_params%allom_dbh_maxheight(ipft) < min_max_dbh_for_trees ) then if (dbh <= prt_params%dbh_repro_threshold(ipft)) then @@ -1503,7 +1503,7 @@ subroutine CNPStatureGrowth(this,c_gain, n_gain, p_gain, & ! If the TRS is switched on (with or w/o seedling dynamics) then reproductive allocation is ! a pft-specific function of dbh. This allows for the representation of different ! reproductive schedules (Wenk and Falster, 2015) - else if ( any(regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & + else if ( any(hlm_regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & prt_params%allom_dbh_maxheight(ipft) > min_max_dbh_for_trees ) then repro_c_frac = prt_params%seed_alloc(ipft) * & @@ -1513,7 +1513,7 @@ subroutine CNPStatureGrowth(this,c_gain, n_gain, p_gain, & else write(fates_log(),*) 'unknown seed allocation and regeneration model, exiting' - write(fates_log(),*) 'regeneration_model: ',regeneration_model + write(fates_log(),*) 'hlm_regeneration_model: ',hlm_regeneration_model call endrun(msg=errMsg(sourcefile, __LINE__)) end if ! regeneration switch @@ -2332,7 +2332,7 @@ function AllomCNPGrowthDeriv(l_state_array,l_state_mask,cbalance,intgr_params) r if (mask_repro) then ! If the TRS is switched off then we use FATES's default reproductive allocation. - if ( regeneration_model == default_regeneration .or. & + if ( hlm_regeneration_model == default_regeneration .or. & prt_params%allom_dbh_maxheight(ipft) < min_max_dbh_for_trees ) then ! The Tree Recruitment Scheme ! is only for trees if (dbh <= prt_params%dbh_repro_threshold(ipft)) then @@ -2344,7 +2344,7 @@ function AllomCNPGrowthDeriv(l_state_array,l_state_mask,cbalance,intgr_params) r ! If the TRS is switched on (with or w/o seedling dynamics) then reproductive allocation is ! a pft-specific function of dbh. This allows for the representation of different ! reproductive schedules (Wenk and Falster, 2015) - else if ( any(regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & + else if ( any(hlm_regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & prt_params%allom_dbh_maxheight(ipft) > min_max_dbh_for_trees ) then repro_fraction = prt_params%seed_alloc(ipft) * & @@ -2352,7 +2352,7 @@ function AllomCNPGrowthDeriv(l_state_array,l_state_mask,cbalance,intgr_params) r (1 + exp(prt_params%repro_alloc_b(ipft) + prt_params%repro_alloc_a(ipft)*dbh*mm_per_cm))) else write(fates_log(),*) 'unknown seed allocation and regeneration model, exiting' - write(fates_log(),*) 'regeneration_model: ',regeneration_model + write(fates_log(),*) 'hlm_regeneration_model: ',hlm_regeneration_model call endrun(msg=errMsg(sourcefile, __LINE__)) end if ! regeneration switch @@ -2468,7 +2468,7 @@ subroutine EstimateGrowthNC(this,target_c,target_dcdd,state_mask,avg_nc,avg_pc) if(state_mask(repro_id)) then ! If the TRS is switched off then we use FATES's default reproductive allocation. - if ( regeneration_model == default_regeneration .or. & + if ( hlm_regeneration_model == default_regeneration .or. & prt_params%allom_dbh_maxheight(ipft) < min_max_dbh_for_trees ) then ! The Tree Recruitment Scheme ! is only for trees if (dbh <= prt_params%dbh_repro_threshold(ipft)) then @@ -2480,7 +2480,7 @@ subroutine EstimateGrowthNC(this,target_c,target_dcdd,state_mask,avg_nc,avg_pc) ! If the TRS is switched on (with or w/o seedling dynamics) then reproductive allocation is ! a pft-specific function of dbh. This allows for the representation of different ! reproductive schedules (Wenk and Falster, 2015) - else if ( any(regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & + else if ( any(hlm_regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & prt_params%allom_dbh_maxheight(ipft) > min_max_dbh_for_trees ) then repro_c_frac = prt_params%seed_alloc(ipft) * & @@ -2488,7 +2488,7 @@ subroutine EstimateGrowthNC(this,target_c,target_dcdd,state_mask,avg_nc,avg_pc) (1 + exp(prt_params%repro_alloc_b(ipft) + prt_params%repro_alloc_a(ipft)*dbh*mm_per_cm))) else write(fates_log(),*) 'unknown seed allocation and regeneration model, exiting' - write(fates_log(),*) 'regeneration_model: ',regeneration_model + write(fates_log(),*) 'hlm_regeneration_model: ',hlm_regeneration_model call endrun(msg=errMsg(sourcefile, __LINE__)) end if ! regeneration switch diff --git a/parteh/PRTAllometricCarbonMod.F90 b/parteh/PRTAllometricCarbonMod.F90 index 8a732b24c7..500140b2c8 100644 --- a/parteh/PRTAllometricCarbonMod.F90 +++ b/parteh/PRTAllometricCarbonMod.F90 @@ -52,11 +52,10 @@ module PRTAllometricCarbonMod use FatesConstantsMod , only : nearzero use FatesConstantsMod , only : itrue use FatesConstantsMod , only : years_per_day - use FatesInterfaceTypesMod, only : hlm_day_of_year - + use FatesInterfaceTypesMod, only : hlm_day_of_year + use FatesInterfaceTypesMod, only : hlm_regeneration_model use PRTParametersMod , only : prt_params - use EDParamsMod , only : regeneration_model use FatesConstantsMod , only : leaves_on use FatesConstantsMod , only : leaves_off @@ -1066,7 +1065,7 @@ function AllomCGrowthDeriv(c_pools,c_mask,cbalance,intgr_params) result(dCdx) ! We designate a plant a shrub or grass if its dbh at maximum height ! is less than 15 cm - if ( regeneration_model == default_regeneration .or. & + if ( hlm_regeneration_model == default_regeneration .or. & prt_params%allom_dbh_maxheight(ipft) < min_max_dbh_for_trees ) then ! TRS is only for tree pfts @@ -1080,7 +1079,7 @@ function AllomCGrowthDeriv(c_pools,c_mask,cbalance,intgr_params) result(dCdx) ! If the TRS is switched on (with or w/o seedling dynamics) then reproductive allocation is ! a pft-specific function of dbh. This allows for the representation of different ! reproductive schedules (Wenk and Falster, 2015) - else if ( any(regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & + else if ( any(hlm_regeneration_model == [TRS_regeneration, TRS_no_seedling_dyn]) .and. & prt_params%allom_dbh_maxheight(ipft) > min_max_dbh_for_trees ) then repro_fraction = prt_params%seed_alloc(ipft) * & @@ -1088,7 +1087,7 @@ function AllomCGrowthDeriv(c_pools,c_mask,cbalance,intgr_params) result(dCdx) (1 + exp(prt_params%repro_alloc_b(ipft) + prt_params%repro_alloc_a(ipft)*dbh*mm_per_cm))) else write(fates_log(),*) 'unknown seed allocation and regeneration model, exiting' - write(fates_log(),*) 'regeneration_model: ',regeneration_model + write(fates_log(),*) 'hlm_regeneration_model: ',hlm_regeneration_model call endrun(msg=errMsg(sourcefile, __LINE__)) end if ! TRS switch