Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding day length factor switch #1161

Merged
merged 7 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions biogeophys/FatesPlantRespPhotosynthMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ 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
Expand Down Expand Up @@ -109,6 +110,10 @@ module FATESPlantRespPhotosynthMod
integer, parameter :: medlyn_model = 2
integer, parameter :: ballberry_model = 1

! Constants used to define day_length switch for scaling photosynthetic parameters
integer, parameter :: dayl_on = 1
integer, parameter :: dayl_off = 2

! Alternatively, Gross Assimilation can be used to estimate
! leaf co2 partial pressure and therefore conductance. The default
! is to use anet
Expand Down Expand Up @@ -595,6 +600,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
nscaler, & ! in
ft, & ! in
bc_in(s)%t_veg_pa(ifp), & ! in
bc_in(s)%dayl_factor_pa(ifp), & ! in
currentPatch%tveg_lpa%GetMean(), & ! in
lmr_z(iv,ft,cl)) ! out

Expand Down Expand Up @@ -680,6 +686,7 @@ subroutine FatesPlantRespPhotosynthDrive (nsites, sites,bc_in,bc_out,dtime)
currentCohort%kp25top, & ! in
nscaler, & ! in
bc_in(s)%t_veg_pa(ifp), & ! in
bc_in(s)%dayl_factor_pa(ifp), & ! in
currentPatch%tveg_lpa%GetMean(), & ! in
currentPatch%tveg_longterm%GetMean(),& ! in
btran_eff, & ! in
Expand Down Expand Up @@ -2325,6 +2332,7 @@ subroutine LeafLayerMaintenanceRespiration_Atkin_etal_2017(lnc_top, &
nscaler, &
ft, &
veg_tempk, &
dayl_factor, &
tgrowth, &
lmr)

Expand All @@ -2343,6 +2351,7 @@ subroutine LeafLayerMaintenanceRespiration_Atkin_etal_2017(lnc_top, &
integer, intent(in) :: ft ! (plant) Functional Type Index
real(r8), intent(in) :: nscaler ! Scale for leaf nitrogen profile
real(r8), intent(in) :: veg_tempk ! vegetation temperature (degrees K)
real(r8), intent(in) :: dayl_factor ! daylength scaling factor (0-1)
glemieux marked this conversation as resolved.
Show resolved Hide resolved
real(r8), intent(in) :: tgrowth ! lagged vegetation temperature averaged over acclimation timescale (degrees K)
real(r8), intent(out) :: lmr ! Leaf Maintenance Respiration (umol CO2/m**2/s)

Expand Down Expand Up @@ -2386,6 +2395,7 @@ subroutine LeafLayerBiophysicalRates( parsun_per_la, &
co2_rcurve_islope25top_ft, &
nscaler, &
veg_tempk, &
dayl_factor, &
t_growth, &
t_home, &
btran, &
Expand Down Expand Up @@ -2421,6 +2431,7 @@ subroutine LeafLayerBiophysicalRates( parsun_per_la, &
real(r8), intent(in) :: co2_rcurve_islope25top_ft ! initial slope of CO2 response curve
! (C4 plants) at 25C, canopy top, this pft
real(r8), intent(in) :: veg_tempk ! vegetation temperature
real(r8), intent(in) :: dayl_factor ! daylength scaling factor (0-1)
real(r8), intent(in) :: t_growth ! T_growth (short-term running mean temperature) (K)
real(r8), intent(in) :: t_home ! T_home (long-term running mean temperature) (K)
real(r8), intent(in) :: btran ! transpiration wetness factor (0 to 1)
Expand Down Expand Up @@ -2486,18 +2497,34 @@ subroutine LeafLayerBiophysicalRates( parsun_per_la, &
co2_rcurve_islope = 0._r8
else ! day time

if ( dayl_switch == dayl_on ) then
! Vcmax25top was already calculated to derive the nscaler function
vcmax25 = vcmax25top_ft * nscaler
vcmax25 = vcmax25top_ft * nscaler * dayl_factor
select case(photo_tempsens_model)
case (photosynth_acclim_model_none)
jmax25 = jmax25top_ft * nscaler
jmax25 = jmax25top_ft * nscaler * dayl_factor
case (photosynth_acclim_model_kumarathunge_etal_2019)
jmax25 = vcmax25*jvr
case default
write (fates_log(),*)'error, incorrect leaf photosynthesis temperature acclimation model specified'
call endrun(msg=errMsg(sourcefile, __LINE__))
end select

else if ( dayl_switch == dayl_off ) then
! Vcmax25top was already calculated to derive the nscaler function
vcmax25 = vcmax25top_ft * nscaler
select case(photo_tempsens_model)
case (photosynth_acclim_model_none)
jmax25 = jmax25top_ft * nscaler
case (photosynth_acclim_model_kumarathunge_etal_2019)
jmax25 = vcmax25*jvr
case default
write (fates_log(),*)'error, incorrect leaf photosynthesis temperature acclimation model specified'
call endrun(msg=errMsg(sourcefile, __LINE__))
end select

end if

co2_rcurve_islope25 = co2_rcurve_islope25top_ft * nscaler

! Adjust for temperature
Expand Down
13 changes: 12 additions & 1 deletion main/EDParamsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ 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)
Expand Down Expand Up @@ -166,6 +167,7 @@ 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"
Expand Down Expand Up @@ -338,6 +340,7 @@ 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
Expand Down Expand Up @@ -493,6 +496,9 @@ 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)
Expand Down Expand Up @@ -715,6 +721,10 @@ 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)
Expand Down Expand Up @@ -882,7 +892,8 @@ 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) '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
Expand Down
5 changes: 5 additions & 0 deletions parameter_files/fates_params_default.cdl
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,9 @@ variables:
double fates_damage_recovery_scalar(fates_pft) ;
fates_damage_recovery_scalar:units = "unitless" ;
fates_damage_recovery_scalar:long_name = "fraction of the cohort that recovers from damage" ;
double fates_daylength_factor_switch ;
fates_daylength_factor_switch:units = "unitless" ;
fates_daylength_factor_switch:long_name = "user switch for turning on (1) or off (2) the day length factor scaling for photosynthetic parameters" ;
double fates_dev_arbitrary_pft(fates_pft) ;
fates_dev_arbitrary_pft:units = "unknown" ;
fates_dev_arbitrary_pft:long_name = "Unassociated pft dimensioned free parameter that developers can use for testing arbitrary new hypotheses" ;
Expand Down Expand Up @@ -1613,6 +1616,8 @@ data:

fates_damage_event_code = 1 ;

fates_daylength_factor_switch = 1 ;

fates_dev_arbitrary = _ ;

fates_fire_active_crown_fire = 0 ;
Expand Down