LADiM configuration¶
The LADiM model system is highly configurable using a separate configuration file. The goal is that a user should not have to touch the code, every necessary aspect should be customizable by the configuration file.
The name of the configuration file is given as a command line argument to the
main ladim script. If the name is missing, a default name of ladim.yaml
is supposed.
It is a goal to provide sane defaults in the configuration file, so that enhancements of the configuration setup do not break existing configuration files.
The configuration file format is a subset of yaml (YAML Ain’t Markup
Language). Knowledge of yaml is not necessary. The
example configuration files are self-describing and can easily be modified.
Note
The indentation in a yaml file is mandatory, it is part of the syntax. In particular note that the indentation has to be done by spaces, not tabs. Reasonable editors will recognize yaml-files by the extension and will automatically produce spaces when you hit the tab key.
See also
- Module
configuration - Documentation of the
configurationmodule
An example configuration file¶
Below is an example configuration file, models/salmon_lice/ladim.yaml.
# Configuration file for salmon lice model using ROMS output
time_control:
# Start and stop of simulation
start_time : 2015-04-01 00:00:00
stop_time : 2015-04-01 12:00:00
# reference_time is optional. default = start_time
reference_time : 2015-01-01
files:
particle_release_file : salmon_lice.rls
output_file : out.nc
# For warm start, the warm_start_file goes here
gridforce:
# Module name is mandatory.
# The other items are module dependent
module: ladim.gridforce.ROMS
# An optional grid_file name can be given
# Here using the default = first input file
# grid_file: /scratch/Data/NK800/file_0000.nc
input_file: /scratch/Data/NK800/file_????.nc
# subgrid format [i0, i1, j0, j1]
subgrid: [200, 750, 300, 900]
# Any extra forcing besides horizontal velocity
ibm_forcing: [temp, salt]
# IBM section is optional
# When using an IBM the module name is mandatory
# The optional item variables is standardized, default = []
# Other items are module dependent
ibm:
module: ladim.ibms.ibm_salmon_lice
variables: [super, age]
particle_release:
# Discrete or continuous release in time
release_type: continuous
# Frequency of continuous particle release, ignored if discrete
release_frequency: [1, h] # Hourly release
# List of variables in the release file
variables: [mult, release_time, X, Y, Z, farmid, super]
# Converters (for variables that are not float)
mult: int
release_time: time # np.datetime64[s]
farmid: int
# Mark variables as time independent
particle_variables: [release_time, farmid]
output_variables:
# Frequency of output
outper: [1, h] # Output every hour
# Variables included in output
particle: [release_time, farmid]
instance: [pid, X, Y, Z, super, age]
# NetCDF arguments
# format string and attributes
release_time:
ncformat: f8 # 64 bit float
long_name: particle release time
# Reference_time becomes substituted with value set above
units: seconds since reference_time
farmid: {ncformat: i4, long_name: fish farm location number}
pid: {ncformat: i4, long_name: particle identifier}
X: {ncformat: f4, long_name: particle X-coordinate}
Y: {ncformat: f4, long_name: particle Y-coordinate}
Z:
ncformat: f4
long_name: particle depth
standard_name: depth_below_surface
units: m
positive: down
age:
ncformat: f4
long_name: particle age in degree-days
units: Celcius days
standard_name: integral_of_sea_water_temperature_wrt_time
super: {ncformat: f4, long_name: number of individuals in instance}
numerics:
# Model time step
dt: [600, s] # Format = [value, unit]
# Advection method, EF, RK2, or RK4
advection: RK2 # Second order Runge Kutta
# Horizontal random walk diffusion coefficient
# omit or set to zero if no diffusion
diffusion: 10 # [m/s**2]