Skip to content

Commit

Permalink
add FATES radiation model switch to the namelist
Browse files Browse the repository at this point in the history
This commit facilitates moving this switch from the FATES parameter file
to the namelist
  • Loading branch information
glemieux committed Jan 21, 2025
1 parent e4e41d9 commit db8e2cb
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/elm/bld/ELMBuildNamelist.pm
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,8 @@ sub setup_cmdl_fates_mode {
"fates_leafresp_model",
"fates_cstarvation_model",
"fates_regeneration_model",
"fates_hydro_solver");
"fates_hydro_solver",
"fates_radiation_model");

foreach my $var ( @list ) {
if ( defined($nl->get_value($var)) ) {
Expand Down Expand Up @@ -3446,7 +3447,8 @@ sub setup_logic_fates {
"fates_leafresp_model",
"fates_cstarvation_model",
"fates_regeneration_model",
"fates_hydro_solver");
"fates_hydro_solver",
"fates_radiation_model");

foreach my $var (@list) {
add_default($test_files, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var,'use_fates'=>$nl_flags->{'use_fates'});
Expand Down
1 change: 1 addition & 0 deletions components/elm/bld/namelist_files/namelist_defaults.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2234,6 +2234,7 @@ this mask will have smb calculated over the entire global land surface
<fates_cstarvation_model use_fates=".true.">linear</fates_cstarvation_model>
<fates_regeneration_model use_fates=".true.">default</fates_regeneration_model>
<fates_hydro_solver use_fates=".true.">1D_Taylor</fates_hydro_solver>
<fates_radiation_model use_fates=".true.">norman</fates_radiation_model>
<use_fates_luh use_fates=".true." fates_harvest_mode="luhdata_area" >.true.</use_fates_luh>
<use_fates_luh use_fates=".true." fates_harvest_mode="luhdata_mass" >.true.</use_fates_luh>
<use_fates_luh use_fates=".true." use_fates_lupft=".true.">.true.</use_fates_luh>
Expand Down
5 changes: 5 additions & 0 deletions components/elm/bld/namelist_files/namelist_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,11 @@ Toggle to turn on FATES no competition mode (only relevant if FATES is being use
Toggle to turn on FATES satellite phenology mode (only relevant if FATES is being used).
</entry>

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

<entry id="fates_hydro_solver" type="char*256" category="physics"
group="elm_inparm" valid_values="1D_Taylor, 2D_Picard, 2D_Newton" value="1D_Taylor">
Set the FATES hydro solver method
Expand Down
3 changes: 3 additions & 0 deletions components/elm/src/main/controlMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ subroutine control_init( )
fates_cstarvation_model, &
fates_regeneration_model, &
fates_hydro_solver, &
fates_radiation_model, &
fates_history_dimlevel

namelist /elm_inparm / use_betr
Expand Down Expand Up @@ -845,6 +846,7 @@ subroutine control_spmd()
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_hydro_solver, len(fates_hydro_solver) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_radiation_model, len(fates_radiation_model) , MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_inventory_ctrl_filename, len(fates_inventory_ctrl_filename), &
MPI_CHARACTER, 0, mpicom, ier)
call mpi_bcast (fates_parteh_mode, 1, MPI_INTEGER, 0, mpicom, ier)
Expand Down Expand Up @@ -1275,6 +1277,7 @@ subroutine control_print ()
write(iulog, *) ' fates_cstarvation_model = ', fates_cstarvation_model
write(iulog, *) ' fates_regeneration_model = ', fates_regeneration_model
write(iulog, *) ' fates_hydro_solver = ', fates_hydro_solver
write(iulog, *) ' fates_radiation_model = ', fates_radiation_model
write(iulog, *) ' fates_inventory_ctrl_filename = ',fates_inventory_ctrl_filename
write(iulog, *) ' fates_seeddisp_cadence = ', fates_seeddisp_cadence
write(iulog, *) ' fates_seeddisp_cadence: 0, 1, 2, 3 => off, daily, monthly, or yearly dispersal'
Expand Down
1 change: 1 addition & 0 deletions components/elm/src/main/elm_varctl.F90
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ module elm_varctl
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_hydro_solver = '' ! 1D Taylor, 2D Picard, 2D Newton
character(len=256), public :: fates_radiation_model = '' ! Norman or two-stream radiation model
logical, public :: use_fates_fixed_biogeog = .false. ! true => use fixed biogeography mode
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
Expand Down
9 changes: 9 additions & 0 deletions components/elm/src/main/elmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ module ELMFatesInterfaceMod
use elm_varctl , only : fates_cstarvation_model
use elm_varctl , only : fates_regeneration_model
use elm_varctl , only : fates_hydro_solver
use elm_varctl , only : fates_radiation_model
use elm_varctl , only : flandusepftdat
use elm_varctl , only : use_fates_tree_damage
use elm_varctl , only : nsrest, nsrBranch
Expand Down Expand Up @@ -426,6 +427,7 @@ subroutine ELMFatesGlobals2()
integer :: pass_cstarvation_model
integer :: pass_regeneration_model
integer :: pass_hydro_solver
integer :: pass_radiation_model

! ----------------------------------------------------------------------------------
! FATES lightning definitions
Expand Down Expand Up @@ -611,6 +613,13 @@ subroutine ELMFatesGlobals2()
end if
call set_fates_ctrlparms('use_cohort_age_tracking',ival=pass_cohort_age_tracking)

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)

if (trim(fates_hydro_solver) == '1D_Taylor') then
pass_hydro_solver = 1
else if (trim(fates_hydro_solver) == '2D_Picard') then
Expand Down

0 comments on commit db8e2cb

Please sign in to comment.