Skip to content

Commit

Permalink
move daylength factor switch from EDParams to FatesInterfaceMod
Browse files Browse the repository at this point in the history
  • Loading branch information
glemieux committed Dec 11, 2024
1 parent 723c6d8 commit e8ae746
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
6 changes: 3 additions & 3 deletions biogeophys/FatesPlantRespPhotosynthMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
! ------------------------------------------------------------------------------
Expand Down Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions main/EDParamsMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions main/FatesInterfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__))
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion main/FatesInterfaceTypesMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e8ae746

Please sign in to comment.