From 5c4c87e17a1d7fc33f9c318fae0d9ddd3f16d226 Mon Sep 17 00:00:00 2001 From: Gregory Lemieux Date: Wed, 11 Dec 2024 13:36:58 -0800 Subject: [PATCH] move stomatal model switch from EDParamsMod to FatesInterfaceTypesMod --- biogeophys/FatesPlantRespPhotosynthMod.F90 | 12 ++++++------ main/EDParamsMod.F90 | 11 ----------- main/FatesInterfaceMod.F90 | 12 ++++++++++++ main/FatesInterfaceTypesMod.F90 | 3 +++ 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/biogeophys/FatesPlantRespPhotosynthMod.F90 b/biogeophys/FatesPlantRespPhotosynthMod.F90 index bee8635c16..887dfe76c3 100644 --- a/biogeophys/FatesPlantRespPhotosynthMod.F90 +++ b/biogeophys/FatesPlantRespPhotosynthMod.F90 @@ -61,7 +61,6 @@ module FATESPlantRespPhotosynthMod use PRTGenericMod, only : repro_organ use PRTGenericMod, only : struct_organ use EDParamsMod, only : maintresp_nonleaf_baserate - use EDParamsMod, only : stomatal_model use PRTParametersMod, only : prt_params use EDPftvarcon , only : EDPftvarcon_inst use TemperatureType, only : temperature_type @@ -1191,6 +1190,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in use EDParamsMod , only : theta_cj_c3, theta_cj_c4 use FatesInterfaceTypesMod, only : hlm_stomatal_assim_model + use FatesInterfaceTypesMod, only : hlm_stomatal_model ! Arguments ! ------------------------------------------------------------------------------------ @@ -1458,7 +1458,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in anet = agross - lmr if ( hlm_stomatal_assim_model == gross_assim_model ) then - if ( stomatal_model == medlyn_model ) then + if ( hlm_stomatal_model == medlyn_model ) then write (fates_log(),*) 'Gross Assimilation conductance is incompatible with the Medlyn model' call endrun(msg=errMsg(sourcefile, __LINE__)) end if @@ -1499,7 +1499,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in ! ------------------------------------------------------------------------------------ - if ( stomatal_model == medlyn_model ) then + if ( hlm_stomatal_model == medlyn_model ) then !stomatal conductance calculated from Medlyn et al. (2011), the numerical & !implementation was adapted from the equations in CLM5.0 vpd = max((veg_esat - ceair), 50._r8) * 0.001_r8 !addapted from CLM5. Put some constraint on VPD @@ -1515,7 +1515,7 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in call QuadraticRoots(aquad, bquad, cquad, r1, r2) gs_mol = max(r1,r2) - else if ( stomatal_model == ballberry_model ) then !stomatal conductance calculated from Ball et al. (1987) + else if ( hlm_stomatal_model == ballberry_model ) then !stomatal conductance calculated from Ball et al. (1987) aquad = leaf_co2_ppress bquad = leaf_co2_ppress*(gb_mol - stomatal_intercept_btran) - bb_slope(ft) * a_gs * can_press cquad = -gb_mol*(leaf_co2_ppress*stomatal_intercept_btran + & @@ -1588,10 +1588,10 @@ subroutine LeafLayerPhotosynthesis(f_sun_lsl, & ! in end if ! Compare with Medlyn model: gs_mol = 1.6*(1+m/sqrt(vpd)) * an/leaf_co2_ppress*p + b - if ( stomatal_model == 2 ) then + if ( hlm_stomatal_model == 2 ) then gs_mol_err = h2o_co2_stoma_diffuse_ratio*(1 + medlyn_slope(ft)/sqrt(vpd))*max(anet,0._r8)/leaf_co2_ppress*can_press + stomatal_intercept_btran ! Compare with Ball-Berry model: gs_mol = m * an * hs/leaf_co2_ppress*p + b - else if ( stomatal_model == 1 ) then + else if ( hlm_stomatal_model == 1 ) then hs = (gb_mol*ceair + gs_mol* veg_esat ) / ((gb_mol+gs_mol)*veg_esat ) gs_mol_err = bb_slope(ft)*max(anet, 0._r8)*hs/leaf_co2_ppress*can_press + stomatal_intercept_btran end if diff --git a/main/EDParamsMod.F90 b/main/EDParamsMod.F90 index 373c666372..d24c905ccb 100644 --- a/main/EDParamsMod.F90 +++ b/main/EDParamsMod.F90 @@ -72,7 +72,6 @@ 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 :: stomatal_model ! switch for choosing between stomatal conductance models, 1 for Ball-Berry, 2 for Medlyn 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) @@ -163,7 +162,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_stomatal_model= "fates_leaf_stomatal_model" 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" @@ -320,7 +318,6 @@ subroutine FatesParamsInit() ED_val_cohort_age_fusion_tol = nan ED_val_patch_fusion_tol = nan ED_val_canopy_closure_thresh = nan - stomatal_model = -9 regeneration_model = -9 max_cohort_per_patch = -9 hydr_kmax_rsurf1 = nan @@ -467,9 +464,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_stomatal_model, 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) @@ -680,10 +674,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_stomatal_model, & - data=tmpreal) - stomatal_model = nint(tmpreal) - call fates_params%RetrieveParameter(name=ED_name_regeneration_model, & data=tmpreal) regeneration_model = nint(tmpreal) @@ -854,7 +844,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) 'stomatal_model = ',stomatal_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/FatesInterfaceMod.F90 b/main/FatesInterfaceMod.F90 index 08c7b9a6d1..01cfba4da6 100644 --- a/main/FatesInterfaceMod.F90 +++ b/main/FatesInterfaceMod.F90 @@ -1477,6 +1477,7 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) hlm_daylength_factor_switch = unset_int hlm_photo_tempsens_model = unset_int hlm_stomatal_assim_model = unset_int + hlm_stomatal_model = unset_int hlm_hydr_solver = unset_int hlm_use_logging = unset_int hlm_use_ed_st3 = unset_int @@ -1777,6 +1778,11 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) call endrun(msg=errMsg(sourcefile, __LINE__)) end if + if(hlm_stomatal_model .eq. unset_int) then + write(fates_log(), *) 'stomatal model conductance is unset: hlm_stomatal_model exiting' + call endrun(msg=errMsg(sourcefile, __LINE__)) + end if + if(hlm_hydr_solver .eq. unset_int) then write(fates_log(), *) 'FATES hydro solver is unset: hlm_hydr_solver, exiting' call endrun(msg=errMsg(sourcefile, __LINE__)) @@ -2003,6 +2009,12 @@ subroutine set_fates_ctrlparms(tag,ival,rval,cval) write(fates_log(),*) 'Transfering hlm_stomatal_assim_model ',ival,' to FATES' end if + case('stomatal_model') + hlm_stomatal_model = ival + if (fates_global_verbose()) then + write(fates_log(),*) 'Transfering hlm_stomatal_model ',ival,' to FATES' + end if + case('hydr_solver') hlm_hydr_solver = ival if (fates_global_verbose()) then diff --git a/main/FatesInterfaceTypesMod.F90 b/main/FatesInterfaceTypesMod.F90 index 09e22aa4b7..f2bb64ec90 100644 --- a/main/FatesInterfaceTypesMod.F90 +++ b/main/FatesInterfaceTypesMod.F90 @@ -176,6 +176,9 @@ module FatesInterfaceTypesMod integer, public :: hlm_stomatal_assim_model ! Switch designating whether to use net or gross assimilation in the stomata model ! 1 for net, 2 for gross + integer, public :: hlm_stomatal_model ! switch for choosing between stomatal conductance models + ! 1 for Ball-Berry, 2 for Medlyn + 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