FLAREr configurations
flare-config-vignette.RmdA guide to the variables in configure_run.yml,
configure_flare.yml, observations_config.csv,
parameter_calibration_config.csv,
states_config.csv, and depth_model_sd.csv.
All configuration files are required to be located in your
{lake_directory}/configuration/{config_set_name} directory
unless otherwise noted.
configure_run.yml
configure_run.yml controls the timing and top-level
settings for a single FLARE run.
restart_file: .na
start_datetime: 2022-09-28 00:00:00
end_datetime: .na
forecast_start_datetime: 2022-10-02 00:00:00
forecast_horizon: 16
sim_name: test
configure_flare: configure_flare.yml
configure_obs: observation_processing.yml
use_s3: FALSE
use_faasr: FALSErestart_file: path to a restart file (a zip file) from a previous run, or
.nato start fromdefault_initvalues inconfigure_flare.ymlstart_datetime: start date and time of the simulation (
YYYY-MM-DD HH:MM:SS)end_datetime: end date and time of the simulation, or
.nato run to the most recent available observationsforecast_start_datetime: the date and time at which the forecast begins (i.e., the transition from hindcast to forecast mode)
forecast_horizon: number of days to forecast beyond
forecast_start_datetimesim_name: a label for the simulation, used in output file naming to support scenario-based workflows
configure_flare: file name of the FLARE configuration file (relative to the configuration directory)
configure_obs: file name of the observation processing configuration file (relative to the configuration directory)
use_s3: access drivers, targets, and output on an S3 bucket (
TRUEorFALSE)use_faasr: route all object I/O through the FaaSr serverless runtime instead of calling
aws.s3directly (TRUEorFALSE; optional, defaults toFALSE). Set this only when FLAREr runs as a FaaSr action.use_faasr: TRUErequiresuse_s3: TRUE— FaaSr mode is always cloud-backed and FLAREr errors at startup ifuse_faasris set whileuse_s3isFALSE. If the FaaSr runtime helpers are not present (e.g. the configuration is run outside a FaaSr container) FLAREr warns and falls back to plain S3 access.
Together use_s3 and use_faasr select the
storage backend for a run:
use_s3 |
use_faasr |
Mode | Where data lives |
|---|---|---|---|
FALSE |
FALSE |
local |
local filesystem under lake_directory
|
TRUE |
FALSE |
s3 |
S3-compatible bucket via aws.s3 /
arrow
|
TRUE |
TRUE |
faasr |
FaaSr DataStore via the FaaSr runtime |
configure_flare.yml
configure_flare.yml defines the model structure, data
assimilation settings, inputs, and outputs.
location:
site_id: four-letter code for the lake
name: name of the lake
latitude: latitude in degrees north
longitude: longitude in degrees east
da_setup:
-
da_method: data assimilation algorithm to use. Options:
enkf: Ensemble Kalman Filter. The classic stochastic EnKF — perturbs observations with random noise and updates the full ensemble covariance. Supports localization vialocalization_distance.none: No data assimilation. The model runs in open-loop forecast mode; observations are not assimilated even ifuse_obs_constraint: TRUE.
-
par_fit_method: method for parameter fitting
inflateinflates the parameter ensemble after each DA update usingperturb_paras a per-parameter multiplicative inflation factor (≥ 1). Counteracts ensemble collapse without adding random noise.perturbadds normal random noise to each parameter at every step usingperturb_paras the standard deviation.perturb_constrescales the parameter ensemble around its current mean so the spread equalsperturb_parat every step.perturb_initinitialises each ensemble member with a different parameter draw but holds each member’s value fixed thereafter (no DA update, no ongoing noise). Spread collapses to the ensemble mean during the forecast period whenuncertainty: parameter: FALSE.
All methods support the optional
par_min_sdcolumn inparameter_calibration_config.csv, which sets a per-parameter floor on the posterior ensemble SD after each DA update to guard against ensemble collapse. ensemble_size: number of ensemble members
localization_distance: distance in meters over which covariances are diminished via exponential decay. Set to
.nato disable localization.inflation_factor: multiplicative inflation factor applied to the state ensemble after each DA update (value ≥ 1; only used when
use_inflation_factor: TRUE). Per-parameter inflation forpar_fit_method: inflateis controlled separately byperturb_parin the parameter configuration file.use_inflation_factor: apply covariance inflation to the state ensemble after each DA update (
TRUEorFALSE; defaultFALSE). Seeinflation_factor.use_one_step_lag: update parameters with a one-step lag — the state update runs first using only state–state covariances, then a separate parameter EnKF update uses the just-updated state as the forecast (
TRUEorFALSE; defaultFALSE). Reduces spurious state–parameter covariances.no_negative_states: force non-temperature states to be non-negative (
TRUEorFALSE)assimilate_first_step: assimilate observations at the first timestep. Set to
FALSEif initial conditions already reflect assimilated data. (TRUEorFALSE)use_obs_constraint: assimilate observations (
TRUEorFALSE)obs_filename: file name of the targets file, required to be located in
lake_directory/targets/{site_id}/add_random_noise: enable process noise during the forecast (
1= on,0= off). When enabled, small random perturbations are added to the model state at each timestep to represent irreducible model error. Set to0to run a deterministic ensemble with no process noise.
model_settings:
ncore: number of process cores to use for parallel ensemble runs
model_name: name of process model (
glmorglm_aed)base_GLM_nml: name of base GLM namelist file, required to be in the configuration directory
max_model_layers: maximum number of layers allowed in GLM simulations
modeled_depths: vector of depths (m) for which output is requested. Values represent the top of each layer.
par_config_file: name of the parameter calibration CSV (
parameter_calibration_config.csv)obs_config_file: name of the observation configuration CSV (
observations_config.csv)states_config_file: name of the state configuration CSV (
states_config.csv)depth_model_sd_config_file: optional CSV specifying depth-varying process uncertainty. Required to be in the configuration directory if used.
default_init:
lake_depth: initial lake depth (meters)
temp: vector of initial temperature profile values (°C)
temp_depths: vector of depths (m) corresponding to the initial temperature profile
salinity: initial salinity (g/kg)
snow_thickness: initial snow thickness (m)
white_ice_thickness: initial white ice thickness (m)
blue_ice_thickness: initial blue ice thickness (m)
flows:
include_inflow: include inflows in simulations (
TRUEorFALSE)include_outflow: include outflows in simulations (
TRUEorFALSE)future_inflow_model: path to the inflow model used for forecast days, relative to
s3$inflow$bucketorlocal_inflow_directory. Supportsglue-style substitution, e.g.f/model_id=h/reference_datetime={reference_date}/site_id={site_id}historical_inflow_model: path to the inflow model used for historical days. Supports
glue-style substitution, e.g.h/model_id=h/site_id={site_id}local_inflow_directory: directory for inflow files when not using S3, relative to
lake_directoryfuture_outflow_model: path to the outflow model used for forecast days (same substitution syntax as
future_inflow_model)historical_outflow_model: path to the outflow model used for historical days
local_outflow_directory: directory for outflow files when not using S3, relative to
lake_directoryuse_ler_vars: use LER standardised variable names for flows (
TRUEorFALSE)use_flows_s3: access flow driver files from an S3 bucket (
TRUEorFALSE)
met:
future_met_model: path to the met model used for forecast days, relative to
s3$drivers$bucketorlocal_met_directory. Supportsglue-style substitution, e.g.met/gefs-v12/stage2/reference_datetime={reference_date}/site_id={site_id}historical_met_model: path to the met model used for historical days. Supports
glue-style substitution, e.g.met/gefs-v12/stage3/site_id={site_id}forecast_lag_days: number of days to look backward when searching for a forecast
use_ler_vars: use LER standardised met variable names (
TRUEorFALSE)historical_met_use_s3: access historical met data from an S3 bucket (
TRUEorFALSE)future_met_use_s3: access forecast met data from an S3 bucket (
TRUEorFALSE)use_openmeteo: use the Open-Meteo ensemble forecast API for meteorological inputs instead of
future_met_model/historical_met_model(TRUEorFALSE). Only the ensemble-forecast API is supported (max 35-day forecast horizon, max 3-day lookback); requires theropenmeteopackage.openmeteo_model: Open-Meteo ensemble model name (only used when
use_openmeteo: TRUE; default"ncep_gefs_seamless"); see https://open-meteo.com/en/docs/ensemble-api for available modelslocal_met_directory: directory for met files when not using S3 or Open-Meteo, relative to
lake_directory
uncertainty:
observation: include uncertainty in observations (
TRUEorFALSE)process: add normal random noise to states during the forecast (
TRUEorFALSE)weather: use multiple weather forecast ensemble members (
TRUEorFALSE)initial_condition: include uncertainty in states at forecast initiation (
TRUEorFALSE)parameter: include parameter uncertainty during the forecast (
TRUEorFALSE)inflow: include inflow uncertainty during the forecast (
TRUEorFALSE)
output_settings:
generate_plot: generate diagnostic plots (
TRUEorFALSE)restart_save_timesteps: days relative to
forecast_start_datetimeat which restart files are saved. Use"all"to save every timestep. Example:[-2, 0]saves two days before and on the forecast start date.diagnostics_names: names of non-state GLM variables to save in the forecast output (e.g.
[extc])
s3:
Defines the S3-compatible DataStores used when
use_s3: TRUE (or use_faasr: TRUE) in
configure_run.yml. Each entry is a server name
that FLAREr looks up by key when reading or writing the corresponding
data. The block is ignored in local mode. Each store
accepts an optional anonymous: flag (TRUE
for public, read-only buckets); non-anonymous access reads
AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
from the environment.
-
drivers:
- endpoint: S3 endpoint for met drivers
- bucket: S3 bucket for met drivers
-
inflow_drivers:
- endpoint: S3 endpoint for inflow drivers
- bucket: S3 bucket for inflow drivers
-
outflow_drivers:
- endpoint: S3 endpoint for outflow drivers
- bucket: S3 bucket for outflow drivers
-
targets:
- endpoint: S3 endpoint for target files
- bucket: S3 bucket for target files
-
forecasts_parquet:
- endpoint: S3 endpoint for forecast parquet files
- bucket: S3 bucket for forecast parquet files
-
restart:
- endpoint: S3 endpoint for restart YAML files
- bucket: S3 bucket for restart YAML files
-
scores:
- endpoint: S3 endpoint for scores
- bucket: S3 bucket for scores
parameter_calibration_config.csv
Example:
par_names,par_names_save,par_file,par_init_mean,par_init_sd,par_init_lowerbound,par_init_upperbound,par_lowerbound,par_upperbound,perturb_par,par_units,fix_par,par_min_sd
sed_temp_mean,zone1temp,glm3.nml,12,NA,10,12,-100,100,1,deg_C,0,0.1
sed_temp_mean,zone2temp,glm3.nml,15,NA,12,16,-100,100,1,deg_C,0,0.1
lw_factor,lw_factor,glm3.nml,1,NA,0.9,1.1,-10,10,0.02,unitless,0,0.001
par_names: GLM namelist name of the parameter to estimate. The same
par_namesvalue can appear on multiple rows to fit individual elements of a vector parameter (e.g. separate sediment temperature zones from a sharedsed_temp_meanvector).par_names_save: name used for the parameter in FLARE output and plots
par_file: nml or CSV file that contains the parameter
par_init_mean: mean of the distribution used to initialise the parameter ensemble. For fixed parameters (
fix_par = 1) this is the exact value used for all ensemble members.-
par_init_sd (optional): controls the shape of the initial ensemble distribution for free parameters (
fix_par = 0):-
NA— draw each ensemble member independently from a uniform distribution on [par_init_lowerbound,par_init_upperbound] (original behaviour; use this when you want to specify the initial range directly). -
a positive number — draw each ensemble member from
N(
par_init_mean,par_init_sd), then reflect any values that fall outside [par_lowerbound,par_upperbound] back into the feasible region and clamp any remaining outliers.
-
par_init_lowerbound: lower bound of the uniform distribution used when
par_init_sdisNA. Ignored otherwise.par_init_upperbound: upper bound of the uniform distribution used when
par_init_sdisNA. Ignored otherwise.par_lowerbound: hard lower bound — parameter values are clamped to this during assimilation and during normal-distribution initialisation
par_upperbound: hard upper bound — parameter values are clamped to this during assimilation and during normal-distribution initialisation
-
perturb_par: noise/spread parameter used by all fitting methods. Interpretation depends on
par_fit_method:-
perturb: standard deviation of the random noise added each step -
perturb_const: target standard deviation of the parameter distribution (spread is rescaled to this value each step) -
inflate: per-parameter multiplicative inflation factor (≥ 1) applied to the parameter ensemble after each DA update -
perturb_init: not used (column must still be present)
-
par_units: units string used in plots
fix_par:
0= fit the parameter;1= hold atpar_init_meanpar_min_sd (optional): minimum posterior ensemble standard deviation for this parameter, in the parameter’s units. After each DA update (and after inflation), if the ensemble SD falls below this value the spread is restored: members are rescaled symmetrically around the posterior mean when SD > 0, or resampled from N(posterior mean,
par_min_sd) in the rare case of complete collapse (SD = 0). Omit the column or set the value toNAto disable the floor for a given parameter. A starting value of 1–5 % of the parameter’s physical range is recommended.
states_config.csv
Example:
state_names,initial_conditions,model_sd,vert_decorr_length,initial_model_sd,states_to_obs_1,states_to_obs_mapping_1,states_to_obs_2,states_to_obs_mapping_2,states_to_obs_3,states_to_obs_mapping_3,init_obs_name,init_obs_mapping,da_updated
temp,20,1.35,2,1.35,temp,1,NA,NA,NA,NA,temp,1,1
salt,0.1,0.001,2,0.001,NA,NA,NA,NA,NA,NA,salt,1,1
state_names: name of the state variable
initial_conditions: default initial value used when observations are not available. Applies uniformly across all depths, except for
tempwhich uses thedefault_inittemperature profile fromconfigure_flare.yml.model_sd: standard deviation of the process error for the state
vert_decorr_length: vertical decorrelation length (m) used in the EnKF covariance structure
initial_model_sd: standard deviation of the initial ensemble spread for the state
states_to_obs_1 / states_to_obs_mapping_1: the first observation type this state maps to, and the multiplier applied to the state to convert it to the observation scale (e.g. mmol/m³ biomass → µg/L chla). Use
NAif no observation corresponds.states_to_obs_2 / states_to_obs_mapping_2: a second observation type the state contributes to (same rules as above)
states_to_obs_3 / states_to_obs_mapping_3: a third observation type the state contributes to (same rules as above)
init_obs_name: name of the observation used to initialise this state when an observation is available
init_obs_mapping: multiplier on the observation when used for initialisation. For example, if a combined DOC measurement initialises two DOC states, set each to the fraction of the observation assigned to that state.
da_updated: integer flag (
1or0) controlling whether this state participates in data assimilation.1(default) = the state is included in the EnKF state vector and its ensemble is updated by observations.0= the state is still simulated by GLM and initialised/output by FLAREr, but it is excluded from the EnKF update and its GLM restart value is carried forward unchanged. The column is optional; if absent orNA, every state defaults to1. At least one state must haveda_updated = 1.
depth_model_sd.csv
depth_model_sd.csv is optional.
Example:
depth,temp
0.1,0.8
1,0.8
5,0.7
9,0.3
- depth: depth (m)
- additional columns: one column per state variable that has depth-varying process uncertainty. Values are the standard deviation of process error at each listed depth; values are linearly interpolated between and extrapolated beyond listed depths.
observations_config.csv
Example:
state_names_obs,obs_units,obs_sd,target_variable,multi_depth,model_source,model_variable,model_depth_m,assimilate
temp,degC,0.5,temperature,1,NA,NA,NA,1
state_names_obs: name of the observed state (must match a name in
states_config.csv)obs_units: units of the observation (used in output metadata)
obs_sd: standard deviation of observation uncertainty
target_variable: column name in the targets file that contains this observation
multi_depth:
1= observation is resolved by depth;0= observation has no depth dimension (e.g. Secchi depth)model_source: source of the model variable used to compute this observation when it is a derived diagnostic rather than a direct state. Use
NAfor direct state observations. Options:diagnostic,state.model_variable: name of the GLM diagnostic variable used to derive the observation (e.g.
extc_coefffor Secchi depth). UseNAfor direct state observations.model_depth_m: depth (m) at which the diagnostic variable is evaluated when computing the derived observation. Use
NAfor direct state observations or depth-resolved variables.assimilate (optional): integer flag (
1or0) controlling whether this observation is used in the data assimilation update. Default is1(assimilated) when the column is absent. Setting0keeps the variable simulated, tracked, and written to forecast output but excludes it from the EnKF update. Use this to retain an observation for forecast scoring without letting it influence the DA step.