From a5efb18f0dac7cbdcfa677cff8949ea2ce283823 Mon Sep 17 00:00:00 2001 From: Jessica Needham Date: Fri, 10 Oct 2025 17:39:31 +0200 Subject: [PATCH 1/4] add new namelist variable for fates --- bld/CLMBuildNamelist.pm | 6 +++--- bld/namelist_files/namelist_defaults_ctsm.xml | 10 ++++++++++ bld/namelist_files/namelist_definition_ctsm.xml | 7 +++++++ src/main/clm_varctl.F90 | 1 + src/main/controlMod.F90 | 6 +++++- src/utils/clmfates_interfaceMod.F90 | 3 ++- 6 files changed, 28 insertions(+), 5 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index 9562cca9bd..2b6e35c96b 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -812,8 +812,7 @@ sub setup_cmdl_fates_mode { "use_fates_daylength_factor", "fates_photosynth_acclimation", "fates_stomatal_model", "fates_stomatal_assimilation", "fates_leafresp_model", "fates_cstarvation_model", "fates_regeneration_model", "fates_hydro_solver", "fates_radiation_model", "fates_electron_transport_model", - "use_fates_managed_fire" - ); + "use_fates_managed_fire", "fates_lu_transition_logic"); # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { @@ -4778,7 +4777,7 @@ sub setup_logic_fates { "use_fates_daylength_factor", "fates_photosynth_acclimation", "fates_stomatal_model", "fates_stomatal_assimilation", "fates_leafresp_model", "fates_cstarvation_model", "fates_regeneration_model", "fates_hydro_solver", "fates_radiation_model", "fates_electron_transport_model", - "use_fates_managed_fire" + "use_fates_managed_fire","fates_lu_transition_logic" ); foreach my $var ( @list ) { @@ -4791,6 +4790,7 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_luh', 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), 'use_fates_potentialveg'=>$nl->get_value('use_fates_potentialveg'), + 'fates_lu_transition_logic'=>$nl->get_value('fates_lu_transition_logic'), 'fates_harvest_mode'=>remove_leading_and_trailing_quotes($nl->get_value('fates_harvest_mode')) ); add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'use_fates_nocomp', 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_lupft'=>$nl->get_value('use_fates_lupft'), diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 0498da2790..700cf3bc68 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2522,6 +2522,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 0 1 no_harvest +0 ballberry1987 net ryan1991 @@ -2545,6 +2546,15 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.3.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 .true. .true. .false. +.true. +.true. +.true. +.true. +.true. +.true. +.true. +.true. +.true. 1 0 .true. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 69a243bd27..c591342f73 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -944,6 +944,13 @@ which processes the raw land use data from the THEMIS tool data sets (https://doi.org/10.5065/29s7-7b41) + +Select the logic for land use class transitions. +Allowed values are 0 (off) and 1-9. See the FATES user guide for an explanation of the options. +(Only relevant if FATES with land use is on) + + Toggle to turn on the LUNA model, to effect Photosynthesis by leaf Nitrogen diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 9a0d2901b9..eb93252193 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -332,6 +332,7 @@ module clm_varctl ! > 1 for external data (lightning and/or anthropogenic ignitions) ! see bld/namelist_files/namelist_definition_clm4_5.xml for details logical, public :: use_fates_managed_fire = .false. ! true => turn on managed fire + integer, public :: fates_lu_transition_logic = -9 ! controls logic around transition between land use classes 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_model = '' ! stomatal conductance model, Ball-berry or Medlyn diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index 089503dc8b..fd9da72878 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -258,7 +258,9 @@ subroutine control_init(dtime) use_fates_daylength_factor, & fates_photosynth_acclimation, & fates_history_dimlevel, & - use_fates_managed_fire + use_fates_managed_fire, & + fates_lu_transition_logic, & + fates_history_dimlevel ! Ozone vegetation stress method namelist / clm_inparm / o3_veg_stress_method @@ -818,6 +820,7 @@ subroutine control_spmd() call mpi_bcast (for_testing_allow_interp_non_ciso_to_ciso, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (fates_spitfire_mode, 1, MPI_INTEGER, 0, mpicom, ier) + call mpi_bcast (fates_lu_transition_logic, 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_model, len(fates_stomatal_model) , MPI_CHARACTER, 0, mpicom, ier) call mpi_bcast (fates_stomatal_assimilation, len(fates_stomatal_assimilation) , MPI_CHARACTER, 0, mpicom, ier) @@ -1234,6 +1237,7 @@ 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_lu_transition_logic = ', fates_lu_transition_logic write(iulog, *) ' fates_stomatal_model = ', fates_stomatal_model write(iulog, *) ' fates_stomatal_assimilation = ', fates_stomatal_assimilation write(iulog, *) ' fates_leafresp_model = ', fates_leafresp_model diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index da43b30b18..2924ee7a37 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -58,6 +58,7 @@ module CLMFatesInterfaceMod 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_lu_transition_logic use clm_varctl , only : fates_stomatal_model use clm_varctl , only : fates_stomatal_assimilation use clm_varctl , only : fates_leafresp_model @@ -405,7 +406,6 @@ subroutine CLMFatesGlobals2() integer :: pass_vertsoilc integer :: pass_ch4 - integer :: pass_spitfire integer :: pass_ed_st3 integer :: pass_num_lu_harvest_cats integer :: pass_lu_harvest @@ -663,6 +663,7 @@ subroutine CLMFatesGlobals2() end if call set_fates_ctrlparms('num_luh2_states',ival=pass_num_luh_states) call set_fates_ctrlparms('num_luh2_transitions',ival=pass_num_luh_transitions) + call set_fates_ctrlparms('fates_lu_transition_logic',ival=fates_lu_transition_logic) if ( use_fates_potentialveg ) then pass_use_potentialveg = 1 From 819a84e8fdb05d51ea8158656a5eb698f36f23dd Mon Sep 17 00:00:00 2001 From: Jessica Needham Date: Mon, 13 Oct 2025 11:40:00 +0200 Subject: [PATCH 2/4] fix merge error --- src/main/controlMod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index fd9da72878..d83c7bf015 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -257,7 +257,6 @@ subroutine control_init(dtime) use_fates_tree_damage, & use_fates_daylength_factor, & fates_photosynth_acclimation, & - fates_history_dimlevel, & use_fates_managed_fire, & fates_lu_transition_logic, & fates_history_dimlevel From 782c9779f56ca031ba7410099bd4d2ac5732098f Mon Sep 17 00:00:00 2001 From: Jessica Needham Date: Fri, 30 Jan 2026 11:35:43 +0100 Subject: [PATCH 3/4] remove 0 option for lu transition namelist --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- bld/namelist_files/namelist_definition_ctsm.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index fa004f8f94..f935854dda 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2660,7 +2660,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.4.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 0 1 no_harvest -0 +1 ballberry1987 net ryan1991 diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 013c14e0a8..bccf312375 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -946,9 +946,9 @@ which processes the raw land use data from the THEMIS tool data sets + group="clm_inparm" valid_values="1,2,3,4,5,6,7,8,9"> Select the logic for land use class transitions. -Allowed values are 0 (off) and 1-9. See the FATES user guide for an explanation of the options. +Allowed values are 1-9. See the FATES user guide for an explanation of the options. (Only relevant if FATES with land use is on) From 66189bea0db999b40e1e6cfded5eca3815a47076 Mon Sep 17 00:00:00 2001 From: Jessica Needham Date: Mon, 9 Feb 2026 09:34:33 +0100 Subject: [PATCH 4/4] update default to match current code --- bld/namelist_files/namelist_defaults_ctsm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index f935854dda..359d765a50 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2660,7 +2660,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.4.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 0 1 no_harvest -1 +4 ballberry1987 net ryan1991