Main setings.
First we define which model to run and where to run:
HESM. Host “Earth System Model”. (E3SM, CESM, CTSM)PROJECT. Project (may not be needed)MACH. Machine used for preparing the case
export HESM="E3SM"
export MACH="eschweilera"
Job submission settings. These settings depend on the machine select, and may not be used.
Configuration relevant for all submissions:
AUTO_SUBMIT. Submit the job upon successful creation? (true or false)IS_INTERACTIVE. Should the jib be submitted interactively (as opposed to submitted as a batch job)? (true or false)PROJECT. Project account to be used for this submission. Set it to empty (PROJECT="") in case this is not applicable.PARTITION. Specify the partition for the job to be run. Set it to empty (PARTITION="") to use the default.RUN_TIME. Run time for job, in HH:MM:SS format. Make sure this does not exceed maximum allowed.CPUS_PER_TASK. Number of CPUS requested for each task. Set it to 1 unless using multi-threading (shared memory parallelisation, OpenMP).
export AUTO_SUBMIT=false
export IS_INTERACTIVE=true
export PROJECT="m2420"
export PARTITION="regular"
export RUN_TIME="23:59:59"
export CPUS_PER_TASK=1
The settings below are useful for debugging the code:
DEBUG_LEVEL. The higher the number, the more information will be provided (at the expense of running slower). 0 means no debugging (typical setting for scientific analysis), 6 means very strict debugging (useful when developing the code).USE_FATES. Logical flag (trueorfalse). This option allows running the native host land model (CLM or ELM) without FATES, which may be useful for some debugging.
export DEBUG_LEVEL=0
export USE_FATES=true
Path settings:
WORK_PATH. The main working path (typically/cime/scripts) BASE_PATH. The main path where cases and simulations are written.CASE_ROOT. The main path where to create the directory for this case.SIMUL_ROOT. The main path where to create the directory for the simulation output.
Note. In all cases, use XXXX in the part you
want to be replaced with either E3SM or CTSM.
case "${MACH}" in
eschweilera)
export WORK_PATH="${HOME}/Models/XXXX/cime/scripts"
export BASE_PATH="${HOME}/Documents/LocalData/FATES"
export CASE_ROOT="${BASE_PATH}/SingleRuns/Cases"
export SIMUL_ROOT="${BASE_PATH}/SingleRuns/Simulations"
;;
*)
export WORK_PATH="${HOME}/Models/XXXX/cime/scripts"
export CASE_ROOT="${HOME}/SingleRuns/Cases"
export SIMUL_ROOT="${SCRATCH}/SingleRuns/Simulations"
;;
esac
Define a base directory using SITE_BASE_PATH. If using a standard
data file structure, this is the directory where all site data are
located, one sub-directory per site. The names of these sub-directories
match site_name. Each site-specific path
(i.e. <SITE_BASE_PATH>/<SITE_INFO%site_name>
should contain:
- A sub-directory
CLM1PTcontaining the meteorological drivers. Check documentation for script make_fates_met_driver.Rmd for more details. - The domain and surface data specific for this site. Check documentation for script make_fates_domain+surface.Rmd for further information.
- Optional. A FATES parameter file, which is defined by
variable
fates_param_base, defined a bit below in the chunk. This file is assumed to be in the<site_name>sub-directory. In case none is provided (i.e.,<fates_param_base>=""), the case will use the default parameter file. Beware that the default is not optimised and may yield bad results. - Optional. The forest structure control data, which should
contain the full paths to ED2-style pss (patch) and css (cohort) files.
This file base name should be
<site_name>_<inv_suffix>.txt, or blank in case inventories should not be used. Check the ED2 Wiki (https://github.com/EDmodel/ED2/wiki/Initial-conditions) for details on how to generate the files.
The actual scripts are available on GitHub: https://github.com/mpaiao/ED2_Support_Files/tree/master/pss%2Bcss_processing.
export SITE_BASE_PATH="${HOME}/Data/FATES_DataSets"
Set the cases. These variables will control compilation settings and
the case name for this simulation.
It is fine to leave these blank, in which case the script will use
default settings.
export COMP=""
export CASE_PREFIX=""
Set variable APPEND_GIT_HASH to decide whether
(true) or not (false) to append the current
git commit hash to the case names. Appending the hash can be useful for
reproducibility and is encouraged for scientific work. If just testing
or debugging the code, setting it to false makes the case name shorter
and more friendly.
export APPEND_GIT_HASH=false
Set the grid resolution (variable RESOL). This must be a
standard ELM/CLM grid resolution. In case you want to use the site
information, set RESOL=YYY_USRDAT. The host model will be
replaced later in the script.
export RESOL="YYY_USRDAT" # Grid resolution
Site information (SITE_INFO). In case RESOL
is set to YYY_USRDAT, this allows the user to pick one of
their favourite sites, and load the pre-defined settings for each of
them. This should be an array with each line containing the following
elements:
site_id. A unique site id. Typically a sequential order (but the code checks it). Do not use zero or negative numbers, though.site_desc. A descriptive but short name for site (no spaces, please).site_name. The full site name, typically the sub-directory where all the site-specific data are stored.datm_first. First year with meteorological driver. This is normally fixed unless new versions of the data become available.datm_last. Last year with meteorological driver. This is normally fixed unless new versions of the data become available.calendar. Which calendar type should we use? This must be consistent with the meteorological drivers. Options are"NO_LEAP", for non-leap years and"GREGORIAN", for Gregorian calendar. Note that"GREGORIAN"calendar requires meteorological drivers that extend to entire simulation time span (i.e., no recycling), otherwise, the simulation will likely crash in one of the Februaries outside the meteorological driver range.
# site_id site_desc site_name datm_first datm_last calendar
export SITE_INFO=(" 1 BarroColorado 1x1pt-bciPAN_v5.0_c20240616 2003 2016 NO_LEAP"
" 2 Paracou 1x1pt-paracouGUF_v1.8_c20220114 2004 2019 NO_LEAP"
" 3 Tapajos 1x1pt-tapajosPABR_v1.0_c20231201 1999 2020 NO_LEAP"
" 4 Tanguro 1x1pt-tanguroMTBR_v1.2_c20210913 2008 2018 NO_LEAP"
" 5 SerraTalhada 1x1pt-serratalhadaPEBR_v1.0_c20220114 2008 2021 NO_LEAP"
" 6 ESECSerido 1x1pt-esecseridoRNBR_v1.0_c20220119 2008 2021 NO_LEAP"
" 7 Petrolina 1x1pt-petrolinaPEBR_v1.2_c20210913 2004 2012 NO_LEAP")
#---~---
# Variable SITE_USE lets you pick which site to use. This is an integer variable that
# must correspond to one of the site_id listed in SITE_INFO.
#---~---
if [[ "${SITE_USE}" == "" ]]
then
export SITE_USE=1
fi
#---~---
Configuration information. This allows setting multiple FATES
configurations. Note that this is different from changing parameter
values or running parameter sensitivity experiments. Variable
CONFIG_INFO in this current setting contains the following
elements, but this may need to be edited (along with the places in the
script where CONFIG_INFO is used) depending on the
simulation tests.
config_id. A unique configuration ID. Typically a sequential order (but the code checks it). Do not use zero or negative numbers, though.config_desc. Suffix to append to site name that summarises configuration.inv_suffix. Suffix for the forest inventory plot initialisation instructions. The base file name with instructions should be like:<site_name>_<inv_suffix>.txt. In case you do not want to use inventory initialisation, set this to NA.fates_hydro. Use plant hydrodynamics?.true.turns it on,.false.turns it off.fates_st3. Used Static Stand Structure (ST3)? If TRUE, FATES will disable changes in vegetation structure and leaf area index (effectively halting competition amongst PFTs), but it will still compute gross primary productivity, evapotranspiration, etc.yeara. First year of the simulation. The actual meaning depends on the sign.- Positive. Calendar year (e.g., 2022)
- Zero/Negative. Year relative to the first year of the meteorological cycle. The absolute value of yeara will determine how many years BEFORE the first met driver year the model run. (e.g., -5 means start five years before the first met driver year).
yearz. Last year of the simulation. The actual meaning depends on the sign.- Positive. Calendar year (e.g., 2022)
- Zero/Negative. Year relative to the first year of the meteorological cycle. The absolute value of yeara will determine how many years AFTER the first met driver year the model run. (e.g., -5 means stop five years after the last met driver year).
stress_decid. Which drought deciduous approach should be used for those PFTs that are drought deciduous: 1 - Obligate (“hard”) deciduous; 2 - Semi-deciduousdrought_thresh. Drought threshold for full abscission. If positive, this represents the soil moisture [\(\mathrm{m}^{3} mathrm{m}^{-3}\)]. If negative, it represents the soil matric potential [\(mathrm{mm}\)]. This is applied only for drought deciduous PFTs.moist_thresh. Drought threshold for full flushing. If positive, this represents the soil moisture [\(\mathrm{m}^{3} mathrm{m}^{-3}\)]. If negative, it represents the soil matric potential [\(mathrm{mm}\)]. Relevant only when running semi-deciduous.
# config_id config_desc inv_suffix fates_hydro fates_st3 yeara yearz stress_decid drought_thresh moist_thresh
export CONFIG_INFO=(" 1 InitBare_CompeteON_HydroOFF NA .false. .false. 1700 2025 1 -152957.4 -122365.9"
" 2 InitPlot_CompeteON_HydroOFF nopft_info .false. .false. -5 0 1 -152957.4 -122365.9"
" 3 InitPlot_CompeteOFF_HydroOFF nopft_info .false. .true. -5 0 1 -152957.4 -122365.9"
" 4 InitBare_CompeteON_HydroON NA .true. .false. 1700 2025 1 -152957.4 -122365.9"
" 5 InitPlot_CompeteON_HydroON nopft_info .true. .false. -5 0 1 -152957.4 -122365.9"
" 6 InitPlot_CompeteOFF_HydroON nopft_info .true. .true. -5 0 1 -152957.4 -122365.9")
#---~---
# Variable CONFIG_USE lets you pick which configuration setting to use. This is an
# integer variable that must correspond to one of the config_id listed in CONFIG_INFO.
#---~---
if [[ "${CONFIG_USE}" == "" ]]
then
export CONFIG_USE=5
fi
#---~---
Set the base parameter path and file, in case a specific file exists.
If the file is a site-specific one, set FATES_PARAMS_FILE
without directories. This will mean that the path is the
SITE_PATH. If a specific parameter file is to be used
across sites, set FATES_PARAMS_FILE with full path. Leaving the variable
empty (i.e., FATES_PARAMS_FILE="") means that we should be
using the default parameter file.
export FATES_PARAMS_FILE="${SITE_BASE_PATH}/ParameterFiles/fates_params_4pfts_opt224_api33.cdl"
The variable below lists all variables to be updated using the
xmlchange functionality of CIME.
- In case you do not want to change any settings, set the variable as
an empty vector (i.e.,
xml_settings=()). - Otherwise, create an vector with multi-word strings separated by space. Within each string, the first word should be the variable name, the second argument is the value. For string values, make sure to enclose it in single quotes when needed. If you want, you can use the generic wildcard YYY for variables that may be either CLM or ELM (lower case yyy will replace with the lower-case model name). The code will interpret it accordingly.
xml_settings=("DEBUG FALSE"
"STOP_OPTION nyears"
"REST_N 1"
"YYY_FORCE_COLDSTART on")
List of parameters to be updated. In case you do not want to change
any parameter, leave this part blank (i.e., set
prm_settings=()). Otherwise, the first argument is the
variable name, the second argument is the PFT number (or zero for global
parameter), and the third argument is the value. For parameters that are
linked to multiple organs, list the values for all organs separated by
commas and with no spaces in between the values, like
in the example below.
prm_settings=("fates_pftname 1 DroughtDeciduousStrr"
"fates_pftname 2 EarlyEvergreenThsg"
"fates_pftname 3 MidEvergreenPlnv"
"fates_pftname 4 LateEvergreenCryp"
# PFT-specific parameters
"fates_wood_density 1 0.598"
"fates_wood_density 2 0.503"
"fates_wood_density 3 0.561"
"fates_wood_density 4 0.692"
"fates_leaf_slatop 1 0.0285"
"fates_leaf_slatop 2 0.0336"
"fates_leaf_slatop 3 0.0211"
"fates_leaf_slatop 4 0.0176"
# PFT-specific, organ-related parameters. All organs must be edited,
# commas for separating organs and NO SPACES.
"fates_hydro_epsil_node 1 15.990,13.330,13.330,10.660"
"fates_hydro_epsil_node 2 14.970,12.480,12.480,09.980"
"fates_hydro_epsil_node 3 10.850,09.040,09.040,07.230"
"fates_hydro_epsil_node 4 11.070,09.230,09.230,07.380"
# Global parameters, use PFT index 0 for these.
"fates_mort_disturb_frac 0 0.5"
"fates_comp_excln 0 -1"
"fates_mort_cstarvation_model 0 2"
"fates_mort_understorey_death 0 1"
"fates_regeneration_model 0 3"
"fates_rad_model 0 2"
"fates_maintresp_leaf_model 0 1")
Additional settings for the host land model namelist.
Step 1. Define the output variables by setting
variable hlm_variables, which should have six entries: -
variable. The variable name (case sensitive) -
add_fates. A flag to decide whether or not to include the
variable based on whether or not this is a FATES run. This is case
insensitive. Possible options: - yes. Add variable only
when running FATES - no. Add variable only when NOT running
FATES - both. Add variable regardless of whether or not
running FATES - add_hlm. List of the host land models (case
insensitive) that can use the variable. To list more than one model, use
+ as a separator. - monthly. Add the variable
to monthly output? Use yes/no (case
insensitive) - daily. Add the variable to daily output? Use
yes/no (case insensitive) -
hourly. Add the variable to hourly output? Use
yes/no (case insenstive)
Alternatively, one can define the default list of variables by not
changing the default variables (hlm_variables=()). In this
case, the code will only produce monthly output. In this case, set
hist_empty_tapes to .false. in
hlm_settings (Step 2), otherwise the model will not write
any output.
Step 2. Define other namelist settings by setting
variable hlm_settings. This normally contains variable
hist_empty_htapes, which decides whether or not to include
the default variables. In case the default configurations are sought,
set hlm_settings=().
# variable add_fates add_hlm monthly daily hourly"
hlm_variables=("AR no clm+elm yes no no"
"BTRAN both clm+elm yes no no"
"BTRANMN both clm yes no no"
"EFLX_LH_TOT both clm+elm yes no no"
"ELAI both clm+elm yes no no"
"ESAI both clm+elm yes no no"
"FATES_AGSAPMAINTAR_SZPF yes clm+elm yes no no"
"FATES_AGSAPWOOD_ALLOC_SZPF yes clm+elm yes no no"
"FATES_AGSTRUCT_ALLOC_SZPF yes clm+elm yes no no"
"FATES_AUTORESP yes clm+elm yes no no"
"FATES_AUTORESP_SZPF yes clm+elm yes no no"
"FATES_BASALAREA_SZPF yes clm+elm yes no no"
"FATES_BGSAPMAINTAR_SZPF yes clm+elm yes no no"
"FATES_BGSAPWOOD_ALLOC_SZPF yes clm+elm yes no no"
"FATES_BGSTRUCT_ALLOC_SZPF yes clm+elm yes no no"
"FATES_CANOPYAREA_AP yes clm+elm yes no no"
"FATES_CROWNAREA_CANOPY_SZPF yes clm+elm yes no no"
"FATES_CROWNAREA_USTORY_SZPF yes clm+elm yes no no"
"FATES_DAYSINCE_DROUGHTLEAFOFF_PF yes clm+elm yes no no"
"FATES_DAYSINCE_DROUGHTLEAFON_PF yes clm+elm yes no no"
"FATES_DDBH_CANOPY_SZPF yes clm+elm yes no no"
"FATES_DDBH_USTORY_SZPF yes clm+elm yes no no"
"FATES_DEMOTION_RATE_SZ yes clm+elm yes no no"
"FATES_DROUGHT_STATUS_PF yes clm+elm yes no no"
"FATES_ELONG_FACTOR_PF yes clm+elm yes no no"
"FATES_FROOT_ALLOC_SZPF yes clm+elm yes no no"
"FATES_FROOTMAINTAR_SZPF yes clm+elm yes no no"
"FATES_GPP yes clm+elm yes no no"
"FATES_GPP_AP yes clm+elm yes no no"
"FATES_GPP_SZPF yes clm+elm yes no no"
"FATES_GROWAR_SZPF yes clm+elm yes no no"
"FATES_HET_RESP yes clm+elm yes no no"
"FATES_LAI_AP yes clm+elm yes no no"
"FATES_LAI_CANOPY_SZPF yes clm+elm yes no no"
"FATES_LAI_USTORY_SZPF yes clm+elm yes no no"
"FATES_LBLAYER_COND yes clm+elm yes no no"
"FATES_LBLAYER_COND_AP yes clm+elm yes no no"
"FATES_LEAF_ALLOC_SZPF yes clm+elm yes no no"
"FATES_LEAFC_CANOPY_SZPF yes clm+elm yes no no"
"FATES_LEAFC_USTORY_SZPF yes clm+elm yes no no"
"FATES_MEANLIQVOL_DROUGHTPHEN_PF yes clm+elm yes no no"
"FATES_MEANSMP_DROUGHTPHEN_PF yes clm+elm yes no no"
"FATES_MORTALITY_AGESCEN_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_BACKGROUND_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_CANOPY_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_CSTARV_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_FREEZING_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_FIRE_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_HYDRAULIC_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_IMPACT_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_LOGGING_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_SENESCENCE_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_TERMINATION_SZPF yes clm+elm yes no no"
"FATES_MORTALITY_USTORY_SZPF yes clm+elm yes no no"
"FATES_NEP yes clm+elm yes no no"
"FATES_NPLANT_CANOPY_SZPF yes clm+elm yes no no"
"FATES_NPLANT_USTORY_SZPF yes clm+elm yes no no"
"FATES_NPP_SZPF yes clm+elm yes no no"
"FATES_NPP_CANOPY_SZ yes clm+elm yes no no"
"FATES_NPP_USTORY_SZ yes clm+elm yes no no"
"FATES_PATCHAREA_AP yes clm+elm yes no no"
"FATES_PROMOTION_RATE_SZ yes clm+elm yes no no"
"FATES_RDARK_SZPF yes clm+elm yes no no"
"FATES_SEED_ALLOC_SZPF yes clm+elm yes no no"
"FATES_STOMATAL_COND yes clm+elm yes no no"
"FATES_STOMATAL_COND_AP yes clm+elm yes no no"
"FATES_STORE_ALLOC_SZPF yes clm+elm yes no no"
"FATES_STOREC_CANOPY_SZPF yes clm+elm yes no no"
"FATES_STOREC_USTORY_SZPF yes clm+elm yes no no"
"FATES_TRIMMING_CANOPY_SZ yes clm+elm yes no no"
"FATES_TRIMMING_USTORY_SZ yes clm+elm yes no no"
"FATES_VEGC_ABOVEGROUND yes clm+elm yes no no"
"FATES_VEGC_ABOVEGROUND_SZPF yes clm+elm yes no no"
"FIRE both clm+elm yes no no"
"FGR both clm+elm yes no no"
"FLDS both clm+elm yes no no"
"FSH both clm+elm yes no no"
"FSH_V both clm+elm yes no no"
"FSH_G both clm+elm yes no no"
"FSDS both clm+elm yes no no"
"FSR both clm+elm yes no no"
"GPP no clm+elm yes no no"
"HR no clm+elm yes no no"
"NEP no clm+elm yes no no"
"PBOT both clm+elm yes no no"
"Q2M both clm+elm yes no no"
"QAF both clm yes no no"
"QBOT both clm+elm yes no no"
"QDIRECT_THROUGHFALL both clm yes no no"
"QDRAI both clm+elm yes no no"
"QDRIP both clm+elm yes no no"
"QINTR both clm+elm yes no no"
"QOVER both clm+elm yes no no"
"QSOIL both clm+elm yes no no"
"Qtau both clm yes no no"
"QVEGE both clm+elm yes no no"
"QVEGT both clm+elm yes no no"
"RAIN both clm+elm yes no no"
"SMP both clm+elm yes no no"
"TAF both clm yes no no"
"TBOT both clm+elm yes no no"
"TG both clm+elm yes no no"
"TLAI both clm+elm yes no no"
"TREFMNAV both clm+elm yes no no"
"TREFMXAV both clm+elm yes no no"
"TSA both clm+elm yes no no"
"TSAI both clm+elm yes no no"
"TSOI both clm+elm yes no no"
"TV both clm+elm yes no no"
"U10 both clm+elm yes no no"
"UAF both clm yes no no"
"USTAR both clm yes no no"
"ZWT both clm+elm yes no no"
"ZWT_PERCH both clm+elm yes no no")
#--- Step 2: Additional namelist settings.
hlm_settings=("hist_empty_htapes .true.")
#---~---
Additional settings for output files. These include the following:
month_mfilt. How many steps to put in each monthly file. The other R scripts expect 1, so unless you are willing to change the other scripts, keep it 1.day_mfilt. How many steps to put in each daily file.hour_mfilt. How many steps to put in each hourly file.
month_mfilt=1 # 1 # How many steps to put in each monthly file?
day_mfilt=365 # 30 # How many steps to put in each daily file?
hour_mfilt=8760 # 720 # How many steps to put in each hour file?