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 all commits
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
18 changes: 15 additions & 3 deletions biogeophys/FatesPlantRespPhotosynthMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,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 @@ -685,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 @@ -2269,6 +2271,7 @@ subroutine LeafLayerBiophysicalRates( parsun_per_la, &
co2_rcurve_islope25top_ft, &
nscaler, &
veg_tempk, &
dayl_factor, &
t_growth, &
t_home, &
btran, &
Expand Down Expand Up @@ -2304,6 +2307,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 All @@ -2321,7 +2325,8 @@ subroutine LeafLayerBiophysicalRates( parsun_per_la, &
! (umol electrons/m**2/s)
real(r8) :: co2_rcurve_islope25 ! leaf layer: Initial slope of CO2 response curve
! (C4 plants) at 25C
integer :: c3c4_path_index ! Index for which photosynthetic pathway
integer :: c3c4_path_index ! Index for which photosynthetic pathway
real(r8) :: dayl_factor_local ! Local version of daylength factor

! Parameters
! ---------------------------------------------------------------------------------
Expand Down Expand Up @@ -2369,11 +2374,18 @@ subroutine LeafLayerBiophysicalRates( parsun_per_la, &
co2_rcurve_islope = 0._r8
else ! day time

! update the daylength factor local variable if the switch is on
if ( dayl_switch == itrue ) then
dayl_factor_local = dayl_factor
else
dayl_factor_local = 1.0_r8
endif

! Vcmax25top was already calculated to derive the nscaler function
vcmax25 = vcmax25top_ft * nscaler
vcmax25 = vcmax25top_ft * nscaler * dayl_factor_local
select case(photo_tempsens_model)
case (photosynth_acclim_model_none)
jmax25 = jmax25top_ft * nscaler
jmax25 = jmax25top_ft * nscaler * dayl_factor_local
case (photosynth_acclim_model_kumarathunge_etal_2019)
jmax25 = vcmax25*jvr
case default
Expand Down
6 changes: 3 additions & 3 deletions main/EDParamsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ subroutine FatesRegisterParams(fates_params)

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 @@ -889,9 +889,9 @@ 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) 'dayl_switch = ',dayl_switch
write(fates_log(),fmt0) 'stomatal_assim_model = ',stomatal_assim_model
write(fates_log(),fmt0) 'hydro_kmax_rsurf1 = ',hydr_kmax_rsurf1
write(fates_log(),fmt0) 'hydro_kmax_rsurf2 = ',hydr_kmax_rsurf2
Expand Down
9 changes: 8 additions & 1 deletion main/EDPftvarcon.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1790,7 +1790,7 @@ subroutine FatesCheckParams(is_master)
use FatesConstantsMod, only : lmr_r_2
use EDParamsMod , only : logging_mechanical_frac, logging_collateral_frac
use EDParamsMod , only : logging_direct_frac,logging_export_frac
use EDParamsMod , only : radiation_model
use EDParamsMod , only : radiation_model, dayl_switch
use FatesInterfaceTypesMod, only : hlm_use_fixed_biogeog,hlm_use_sp, hlm_name
use FatesInterfaceTypesMod, only : hlm_use_inventory_init

Expand Down Expand Up @@ -1836,6 +1836,13 @@ subroutine FatesCheckParams(is_master)
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

if(.not.any(dayl_switch == [itrue,ifalse])) then
write(fates_log(),*) 'The only valid switch options for '
write(fates_log(),*) 'fates_daylength_factor_switch is 0 or 1 ...'
write(fates_log(),*) 'You specified fates_daylength_factor_switch = ',dayl_switch
write(fates_log(),*) 'Aborting'
call endrun(msg=errMsg(sourcefile, __LINE__))
end if

select case (hlm_parteh_mode)
case (prt_cnp_flex_allom_hyp)
Expand Down