diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d433ba8698..5e2494687a 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -823,8 +823,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 ) { @@ -4886,7 +4885,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 ) { @@ -4899,6 +4898,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'), @@ -4975,6 +4975,7 @@ sub setup_logic_fates { # check that fates landuse change mode has the necessary luh2 landuse timeseries data # and add the default if not defined. Do not add default if use_fates_potentialveg is true. # If fixed biogeography is on, make sure that flandusepftdat is avilable. + # Check that fates landuse mode is on when the transitional logic is set to greater than zero my $var = "use_fates_luh"; if ( defined($nl->get_value($var)) ) { if ( &value_is_true($nl->get_value($var)) ) { @@ -5002,6 +5003,15 @@ sub setup_logic_fates { } } } + $var = "fates_lu_transition_logic"; + if ( defined($nl->get_value($var)) ) { + if ( $nl->get_value($var) < 1 || $nl->get_value($var) > 9) { + $log->fatal_error("$var must be set to between 1 and 9" ); + } + } + else { + $log->fatal_error("$var must be set when use_fates_luh is true" ); + } } } # check that fates landuse is on and harvest mode is off when potential veg switch is true diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 289d24fb49..2e2e4a7ee6 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2655,6 +2655,8 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.4.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 0 1 no_harvest +4 ballberry1987 net ryan1991 @@ -2678,6 +2680,7 @@ lnd/clm2/surfdata_esmf/NEON/ctsm5.4.0/surfdata_1x1_NEON_TOOL_hist_2000_78pfts_c2 .true. .true. .false. +4 1 0 .true. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index 11c232615c..2ef728309b 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -939,6 +939,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 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/bld/unit_testers/build-namelist_test.pl b/bld/unit_testers/build-namelist_test.pl index 91e0d95ca6..3cbd92cb24 100755 --- a/bld/unit_testers/build-namelist_test.pl +++ b/bld/unit_testers/build-namelist_test.pl @@ -1207,6 +1207,10 @@ sub cat_and_create_namelistinfile { namelst=>"use_fates_luh=.true., fluh_timeseries='zztop'", phys=>"clm4_5", }, + "useFATESLUH2invalidlogic" =>{ options=>"-bgc fates -envxml_dir . -no-megan", + namelst=>"use_fates_luh=.true., fates_lu_transition_logic=0", + phys=>"clm6_0", + }, "useMEGANwithFATES" =>{ options=>"-bgc fates -envxml_dir . -megan", namelst=>"", phys=>"clm4_5", diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 83133acf2b..0d1f681830 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 082e3bb710..74b08a53a8 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -258,8 +258,9 @@ subroutine control_init(dtime) use_fates_tree_damage, & 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 +819,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) @@ -1235,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 19b247218e..c0374e4f9b 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 @@ -403,7 +404,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 @@ -637,6 +637,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