From e8ae7468ff323118fcda4807d509fb4009af1e73 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Tue, 10 Dec 2024 17:06:17 -0800 Subject: [PATCH] move daylength factor switch from EDParams to FatesInterfaceMod --- biogeophys/FatesPlantRespPhotosynthMod.F90 | 6 +++--- main/EDParamsMod.F90 | 11 ----------- main/FatesInterfaceMod.F90 | 12 ++++++++++++ main/FatesInterfaceTypesMod.F90 | 5 ++++- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index d1413f1b15..5ffb87de8b 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -63,7 +63,6 @@ module FATESPlantRespPhotosynthMod use EDParamsMod, only : maintresp_nonleaf_baserate use EDParamsMod, only : stomatal_model use EDParamsMod, only : stomatal_assim_model - use EDParamsMod, only : dayl_switch use EDParamsMod, only : photo_tempsens_model use PRTParametersMod, only : prt_params use EDPftvarcon , only : EDPftvarcon_inst @@ -2315,7 +2314,8 @@ subroutine LeafLayerBiophysicalRates( parsun_per_la, & ! co2_rcurve_islope: initial slope of CO2 response curve (C4 plants) ! --------------------------------------------------------------------------------- - use EDPftvarcon , only : EDPftvarcon_inst + use EDPftvarcon , only : EDPftvarcon_inst + use FatesInterfaceTypesMod, only : hlm_daylength_factor_switch ! Arguments ! ------------------------------------------------------------------------------ @@ -2398,7 +2398,7 @@ subroutine LeafLayerBiophysicalRates( parsun_per_la, & else ! day time ! update the daylength factor local variable if the switch is on - if ( dayl_switch == itrue ) then + if ( hlm_daylength_factor_switch == itrue ) then dayl_factor_local = dayl_factor else dayl_factor_local = 1.0_r8 diff --git a/main/EDParamsMod.F90 b/main/EDParamsMod.F90 index cc906fecef..c1c74b648c 100644 --- a/main/EDParamsMod.F90 +++ b/main/EDParamsMod.F90 @@ -77,7 +77,6 @@ module EDParamsMod 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 :: stomatal_model ! switch for choosing between stomatal conductance models, 1 for Ball-Berry, 2 for Medlyn - integer,protected, public :: dayl_switch ! switch for turning on or off day length factor scaling for photosynthetic parameters 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) @@ -170,7 +169,6 @@ module EDParamsMod 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_stomatal_model= "fates_leaf_stomatal_model" - character(len=param_string_length),parameter,public :: ED_name_dayl_switch= "fates_daylength_factor_switch" 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" @@ -345,7 +343,6 @@ subroutine FatesParamsInit() ED_val_patch_fusion_tol = nan ED_val_canopy_closure_thresh = nan stomatal_model = -9 - dayl_switch = -9 regeneration_model = -9 stomatal_assim_model = -9 max_cohort_per_patch = -9 @@ -500,9 +497,6 @@ subroutine FatesRegisterParams(fates_params) call fates_params%RegisterParameter(name=ED_name_stomatal_model, dimension_shape=dimension_shape_scalar, & dimension_names=dim_names_scalar) - call fates_params%RegisterParameter(name=ED_name_dayl_switch, 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) @@ -727,10 +721,6 @@ subroutine FatesReceiveParams(fates_params) data=tmpreal) stomatal_model = nint(tmpreal) - call fates_params%RetrieveParameter(name=ED_name_dayl_switch, & - data=tmpreal) - dayl_switch = nint(tmpreal) - call fates_params%RetrieveParameter(name=ED_name_regeneration_model, & data=tmpreal) regeneration_model = nint(tmpreal) @@ -909,7 +899,6 @@ subroutine FatesReportParams(is_master) 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) 'dayl_switch = ',dayl_switch write(fates_log(),fmt0) 'stomatal_model = ',stomatal_model write(fates_log(),fmt0) 'stomatal_assim_model = ',stomatal_assim_model write(fates_log(),fmt0) 'hydro_kmax_rsurf1 = ',hydr_kmax_rsurf1 diff --git a/main/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index e77b3e34bc..671a102204 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -1474,6 +1474,7 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) hlm_num_luh2_states = unset_int hlm_num_luh2_transitions = unset_int hlm_use_cohort_age_tracking = unset_int + hlm_daylength_factor_switch = unset_int hlm_use_logging = unset_int hlm_use_ed_st3 = unset_int hlm_use_ed_prescribed_phys = unset_int @@ -1758,6 +1759,11 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) call endrun(msg=errMsg(sourcefile, __LINE__)) end if + if(hlm_daylength_factor_switch .eq. unset_int) then + write(fates_log(), *) 'use daylength factor switch is unset: hlm_daylength_factor_switch, 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__)) @@ -1961,6 +1967,12 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) write(fates_log(),*) 'Transfering hlm_use_cohort_age_tracking= ',ival,' to FATES' end if + case('use_daylength_factor_switch') + hlm_daylength_factor_switch = ival + if (fates_global_verbose()) then + write(fates_log(),*) 'Transfering hlm_daylength_factor_switch= ',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 75e64307a5..3757ddca62 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -157,7 +157,10 @@ module FatesInterfaceTypesMod integer, public :: hlm_use_tree_damage ! This flag signals whether or not to turn on the ! tree damage module - + + integer, public :: hlm_daylength_factor_switch ! This switch enables the use of the daylength factor from the HLM + ! 1 = TRUE, 0 = FALSE + 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