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

Migrate FATES parameter file switches to the namelist #2904

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
10 changes: 8 additions & 2 deletions bld/CLMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,10 @@ 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", "use_fates_photosynth_acclimation","fates_stomatal_assimilation",
"fates_cstarvation_model", "fates_regeneration_model", "fates_hydro_solver", "fates_radiation_model"
);

# dis-allow fates specific namelist items with non-fates runs
foreach my $var ( @list ) {
Expand Down Expand Up @@ -4702,7 +4705,10 @@ 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", "use_fates_photosynth_acclimation","fates_stomatal_assimilation",
"fates_cstarvation_model", "fates_regeneration_model", "fates_hydro_solver", "fates_radiation_model"
);

foreach my $var ( @list ) {
add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'},
Expand Down
7 changes: 7 additions & 0 deletions bld/namelist_files/namelist_defaults_ctsm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2386,11 +2386,18 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2
<use_nitrif_denitrif >.true.</use_nitrif_denitrif>

<!-- ===== FATES DEFAULTS =========== -->
<use_fates_photosynth_acclimation use_fates=".true.">.false.</use_fates_photosynth_acclimation>
<fates_spitfire_mode use_fates=".true.">0</fates_spitfire_mode>
<fates_harvest_mode use_fates=".true.">no_harvest</fates_harvest_mode>
<fates_stomatal_assimilation use_fates=".true.">net</fates_stomatal_assimilation>
<fates_cstarvation_model use_fates=".true.">linear</fates_cstarvation_model>
<fates_regeneration_model use_fates=".true.">default</fates_regeneration_model>
<fates_radiation_model use_fates=".true.">norman</fates_radiation_model>
<fates_hydro_solver use_fates=".true.">1D_Taylor</fates_hydro_solver>
<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
41 changes: 41 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,47 @@ Allowed values are:
This option is older than the luhdata options and may be depricated at some point in the future.
</entry>

<entry id="fates_radiation_model" type="char*256" category="physics"
group="clm_inparm" valid_values="norman, twostream" value="norman">
Set the FATES radiation model
</entry>

<entry id="fates_hydro_solver" type="char*256" category="physics"
group="clm_inparm" valid_values="1D_Taylor, 2D_Picard, 2D_Newton" value="1D_Taylor">
Set the FATES hydro solver method
</entry>

<entry id="fates_regeneration_model" type="char*256" category="physics"
group="clm_inparm" valid_values="default, trs, trs_no_seed_dyn" value="default">
Set the FATES seed regeneration model
Valid values:
default: default scheme
trs: Tree Recruitment Scheme (Hanbury-Brown et al., 2022)
trs_no_seed_dyn: Tree Recruitment Scheme (Hanbury-Brown et al., 2022) without seed dynamics
</entry>

<entry id="fates_cstarvation_model" type="char*256" category="physics"
group="clm_inparm" valid_values="linear, exponential" value="linear">
Set the FATES carbon starvation model
</entry>

<entry id="fates_stomatal_assimilation" type="char*256" category="physics"
group="clm_inparm" valid_values="net, gross" value="net">
Set net or gross asslimiation for the FATES stomatal model
</entry>

<entry id="use_fates_photosynth_acclimation" type="logical" category="physics"
group="clm_inparm" valid_values="" value=".false.">
If TRUE, enable FATES to use a photosynthesis temperature acclimation model.
(Only relevant if FATES is on)
</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
4 changes: 2 additions & 2 deletions src/biogeophys/PhotosynthesisMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ module PhotosynthesisMod
integer, parameter, public :: root=4 ! index for root
integer, parameter, public :: veg=vegetation_weibull ! index for vegetation
integer, parameter, public :: soil=1 ! index for soil
integer, parameter, private :: stomatalcond_mtd_bb1987 = 1 ! Ball-Berry 1987 method for photosynthesis
integer, parameter, private :: stomatalcond_mtd_medlyn2011 = 2 ! Medlyn 2011 method for photosynthesis
integer, parameter, public :: stomatalcond_mtd_bb1987 = 1 ! Ball-Berry 1987 method for photosynthesis
integer, parameter, public :: stomatalcond_mtd_medlyn2011 = 2 ! Medlyn 2011 method for photosynthesis

real(r8), parameter, private :: bbbopt_c3 = 10000._r8 ! Ball-Berry Photosynthesis intercept to use for C3 vegetation
real(r8), parameter, private :: bbbopt_c4 = 40000._r8 ! Ball-Berry Photosynthesis intercept to use for C4 vegetation
Expand Down
8 changes: 8 additions & 0 deletions src/main/clm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -331,13 +331,21 @@ module clm_varctl
! see bld/namelist_files/namelist_definition_clm4_5.xml for details
logical, public :: use_fates_tree_damage = .false. ! true => turn on tree damage module
character(len=256), public :: fates_harvest_mode = '' ! five different harvest modes; see namelist definition
character(len=256), public :: fates_stomatal_assimilation = '' ! net or gross assimilation modes
character(len=256), public :: fates_cstarvation_model = '' ! linear or exponential function
character(len=256), public :: fates_regeneration_model = '' ! default, TRS, or TRS without seed dynamics
character(len=256), public :: fates_radiation_model = '' ! Norman or two-stream radiation model
character(len=256), public :: fates_hydro_solver = '' ! 1D Taylor, 2D Picard, 2D Newton
logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro
logical, public :: use_fates_cohort_age_tracking = .false. ! true => turn on cohort age tracking
logical, public :: use_fates_ed_st3 = .false. ! true => static stand structure
logical, public :: use_fates_ed_prescribed_phys = .false. ! true => prescribed physiology
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

logical, public :: use_fates_photosynth_acclimation = .false. ! true => enable fates to use photosynthetic temperature acclimation

! FATES history dimension level
! fates can produce history at either the daily timescale (dynamics)
Expand Down
21 changes: 21 additions & 0 deletions src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,16 @@ subroutine control_init(dtime)
fluh_timeseries, &
flandusepftdat, &
fates_inventory_ctrl_filename, &
fates_stomatal_assimilation, &
fates_cstarvation_model, &
fates_regeneration_model, &
fates_radiation_model, &
fates_hydro_solver, &
fates_parteh_mode, &
fates_seeddisp_cadence, &
use_fates_tree_damage, &
use_fates_daylength_factor, &
use_fates_photosynth_acclimation, &
fates_history_dimlevel

! Ozone vegetation stress method
Expand Down Expand Up @@ -799,6 +806,11 @@ subroutine control_spmd()

call mpi_bcast (fates_spitfire_mode, 1, MPI_INTEGER, 0, mpicom, ier)
call mpi_bcast (fates_harvest_mode, len(fates_harvest_mode) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_stomatal_assimilation, len(fates_stomatal_assimilation) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_cstarvation_model, len(fates_cstarvation_model) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_regeneration_model, len(fates_regeneration_model) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_radiation_model, len(fates_radiation_model) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_hydro_solver, len(fates_hydro_solver) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (use_fates_planthydro, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_fates_tree_damage, 1, MPI_LOGICAL, 0, mpicom, ier)
call mpi_bcast (use_fates_cohort_age_tracking, 1, MPI_LOGICAL, 0, mpicom, ier)
Expand All @@ -812,6 +824,8 @@ 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 (use_fates_photosynth_acclimation, 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 @@ -1200,11 +1214,18 @@ subroutine control_print ()
if (use_fates) then
write(iulog, *) ' fates_spitfire_mode = ', fates_spitfire_mode
write(iulog, *) ' fates_harvest_mode = ', fates_harvest_mode
write(iulog, *) ' fates_stomatal_assimilation = ', fates_stomatal_assimilation
write(iulog, *) ' fates_cstarvation_model = ', fates_cstarvation_model
write(iulog, *) ' fates_regeneration_model = ', fates_regeneration_model
write(iulog, *) ' fates_radiation_model = ', fates_radiation_model
write(iulog, *) ' fates_hydro_solver = ', fates_hydro_solver
write(iulog, *) ' fates_paramfile = ', fates_paramfile
write(iulog, *) ' fates_parteh_mode = ', fates_parteh_mode
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_photosynth_acclimation = ', use_fates_photosynth_acclimation
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
79 changes: 79 additions & 0 deletions src/utils/clmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,15 @@ 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_photosynth_acclimation
use clm_varctl , only : use_fates_ed_st3
use clm_varctl , only : use_fates_ed_prescribed_phys
use clm_varctl , only : fates_harvest_mode
use clm_varctl , only : fates_stomatal_assimilation
use clm_varctl , only : fates_cstarvation_model
use clm_varctl , only : fates_regeneration_model
use clm_varctl , only : fates_hydro_solver
use clm_varctl , only : use_fates_inventory_init
use clm_varctl , only : use_fates_fixed_biogeog
use clm_varctl , only : use_fates_nocomp
Expand All @@ -81,6 +87,10 @@ module CLMFatesInterfaceMod
use clm_varpar , only : nlevdecomp_full
use clm_varpar , only : nlevsoi
use PhotosynthesisMod , only : photosyns_type
use PhotosynthesisMod , only : leafresp_method
use PhotosynthesisMod , only : stomatalcond_method
use PhotosynthesisMod , only : stomatalcond_mtd_bb1987
use PhotosynthesisMod , only : stomatalcond_mtd_medlyn2011
use atm2lndType , only : atm2lnd_type
use SurfaceAlbedoType , only : surfalb_type
use SolarAbsorbedType , only : solarabs_type
Expand Down Expand Up @@ -399,6 +409,13 @@ subroutine CLMFatesGlobals2()
integer :: pass_use_potentialveg
integer :: pass_num_luh_states
integer :: pass_num_luh_transitions
integer :: pass_daylength_factor_switch
integer :: pass_stomatal_model
integer :: pass_stomatal_assimilation
integer :: fates_cstarvation_model
integer :: fates_regeneration_model
integer :: pass_hydro_solver
integer :: pass_radiation_model

call t_startf('fates_globals2')

Expand Down Expand Up @@ -515,6 +532,68 @@ subroutine CLMFatesGlobals2()
end if
call set_fates_ctrlparms('use_cohort_age_tracking',ival=pass_cohort_age_tracking)

if(use_fates_photosynth_acclimation) then
pass_photosynth_acclimation_switch = 1
else
pass_photosynth_acclimation_switch = 0
end if
call set_fates_ctrlparms('use_photosynth_acclimation',ival=pass_photosynth_acclimation_switch)

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)

if (trim(stomatalcond_method) == 'Ball-Berry1987') then
pass_stomatal_model = stomatalcond_mtd_bb1987
else if (trim(stomatalcond_method) == 'Medlyn2011') then
pass_stomatal_model = stomatalcond_mtd_medlyn2011
end if
call set_fates_ctrlparms('stomatal_model',ival=pass_stomatal_model)

if (trim(fates_stomatal_assimilation) == 'net') then
pass_stomatal_assimilation = 1
else if (trim(fates_stomatal_assimilation) == 'gross') then
pass_stomatal_assimilation = 2
end if
call set_fates_ctrlparms('stomatal_assim_model',ival=pass_stomatal_assimilation)

call set_fates_ctrlparms('maintresp_leaf_model',ival=leafresp_method)

if (trim(fates_cstarvation_model) == 'linear') then
pass_cstarvation_model = 1
else if (trim(fates_cstarvation_model) == 'expontential') then
pass_cstarvation_model = 2
end if
call set_fates_ctrlparms('mort_cstarvation_model',ival=pass_cstarvation_model)

if (trim(fates_regeneration_model) == 'default') then
pass_regeneration_model = 1
else if (trim(fates_regeneration_model) == 'trs') then
pass_regeneration_model = 2
else if (trim(fates_regeneration_model) == 'trs_no_seed_dyn') then
pass_regeneration_model = 3
end if
call set_fates_ctrlparms('regeneration_model',ival=pass_regeneration_model)

if (trim(fates_hydro_solver) == '1D_Taylor') then
pass_hydro_solver = 1
else if (trim(fates_hydro_solver) == '2D_Picard') then
pass_hydro_solver = 2
else if (trim(fates_hydro_solver) == '2D_Taylor') then
pass_hydro_solver = 3
end if
call set_fates_ctrlparms('hydr_solver',ival=pass_hydro_solver)

if (trim(fates_radiation_model) == 'norman') then
pass_radiation_model = 1
else if (trim(fates_hydro_solver) == 'twostream') then
pass_radiation_model = 2
end if
call set_fates_ctrlparms('radiation_model',ival=pass_radiation_model)

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