Skip to content

Commit

Permalink
add fates daylength factor switch
Browse files Browse the repository at this point in the history
This commit facilitates moving this switch from the fates parameter file
to the API.  Note that the actual daylength factor value is always
passed through the API.  This just adds the switch to tell FATES to use it.
  • Loading branch information
glemieux committed Dec 10, 2024
1 parent 1d824b8 commit 0400411
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,8 @@ sub setup_cmdl_fates_mode {
"use_fates_cohort_age_tracking","use_fates_inventory_init","use_fates_fixed_biogeog",
"use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","fates_harvest_mode",
"fates_parteh_mode","use_fates_tree_damage","fates_seeddisp_cadence","use_fates_luh","fluh_timeseries",
"flandusepftdat","use_fates_potentialveg","use_fates_lupft","fates_history_dimlevel" );
"flandusepftdat","use_fates_potentialveg","use_fates_lupft","fates_history_dimlevel",
"use_fates_daylength_factor");

# dis-allow fates specific namelist items with non-fates runs
foreach my $var ( @list ) {
Expand Down Expand Up @@ -4702,7 +4703,8 @@ sub setup_logic_fates {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'});
my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys",
"use_fates_inventory_init","fates_seeddisp_cadence","fates_history_dimlevel",
"fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage" );
"fates_harvest_mode","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage",
"use_fates_daylength_factor");

foreach my $var ( @list ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'},
Expand Down
1 change: 1 addition & 0 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2391,6 +2391,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2
<use_fates_planthydro use_fates=".true.">.false.</use_fates_planthydro>
<use_fates_tree_damage use_fates=".true.">.false.</use_fates_tree_damage>
<use_fates_cohort_age_tracking use_fates=".true.">.false.</use_fates_cohort_age_tracking>
<use_fates_daylength_factor use_fates=".true.">.true.</use_fates_daylength_factor>
<use_fates_ed_st3 use_fates=".true.">.false.</use_fates_ed_st3>
<use_fates_ed_prescribed_phys use_fates=".true.">.false.</use_fates_ed_prescribed_phys>
<use_fates_inventory_init use_fates=".true.">.false.</use_fates_inventory_init>
Expand Down
6 changes: 6 additions & 0 deletions bld/namelist_files/namelist_definition_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,12 @@ Allowed values are:
This option is older than the luhdata options and may be depricated at some point in the future.
</entry>

<entry id="use_fates_daylength_factor" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".true.">
If TRUE, enable FATES to utilize the day length factor from the host land model.
(Only relevant if FATES is on)
</entry>

<entry id="use_fates_planthydro" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
Toggle to turn on plant hydraulics
Expand Down
1 change: 1 addition & 0 deletions src/main/clm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ module clm_varctl
logical, public :: use_fates_inventory_init = .false. ! true => initialize fates from inventory
logical, public :: use_fates_fixed_biogeog = .false. ! true => use fixed biogeography mode
logical, public :: use_fates_nocomp = .false. ! true => use no comopetition mode
logical, public :: use_fates_daylength_factor = .false. ! true => enable fates to use host land model daylength factor

! FATES history dimension level
! fates can produce history at either the daily timescale (dynamics)
Expand Down
3 changes: 3 additions & 0 deletions src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ subroutine control_init(dtime)
fates_parteh_mode, &
fates_seeddisp_cadence, &
use_fates_tree_damage, &
use_fates_daylength_factor, &
fates_history_dimlevel

! Ozone vegetation stress method
Expand Down Expand Up @@ -812,6 +813,7 @@ subroutine control_spmd()
call mpi_bcast (use_fates_lupft, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_fates_potentialveg, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_fates_bgc, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_fates_daylength_factor, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_paramfile, len(fates_paramfile) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fluh_timeseries, len(fluh_timeseries) , MPI_CHARACTER, 0, mpicom, ier)
Expand Down Expand Up @@ -1205,6 +1207,7 @@ subroutine control_print ()
write(iulog, *) ' use_fates_planthydro = ', use_fates_planthydro
write(iulog, *) ' use_fates_tree_damage = ', use_fates_tree_damage
write(iulog, *) ' use_fates_cohort_age_tracking = ', use_fates_cohort_age_tracking
write(iulog, *) ' use_fates_daylength_factor = ', use_fates_daylength_factor
write(iulog, *) ' use_fates_ed_st3 = ',use_fates_ed_st3
write(iulog, *) ' use_fates_ed_prescribed_phys = ',use_fates_ed_prescribed_phys
write(iulog, *) ' use_fates_inventory_init = ',use_fates_inventory_init
Expand Down
8 changes: 8 additions & 0 deletions src/utils/clmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module CLMFatesInterfaceMod
use clm_varctl , only : use_fates_tree_damage
use clm_varctl , only : use_fates_planthydro
use clm_varctl , only : use_fates_cohort_age_tracking
use clm_varctl , only : use_fates_daylength_factor
use clm_varctl , only : use_fates_ed_st3
use clm_varctl , only : use_fates_ed_prescribed_phys
use clm_varctl , only : fates_harvest_mode
Expand Down Expand Up @@ -515,6 +516,13 @@ subroutine CLMFatesGlobals2()
end if
call set_fates_ctrlparms('use_cohort_age_tracking',ival=pass_cohort_age_tracking)

if(use_fates_daylength_factor) then
pass_daylength_factor_switch = 1
else
pass_daylength_factor_switch = 0
end if
call set_fates_ctrlparms('use_daylength_factor_switch',ival=pass_daylength_factor_switch)

! FATES logging and harvest modes
pass_logging = 0
pass_lu_harvest = 0
Expand Down

0 comments on commit 0400411

Please sign in to comment.