Configuration#
config.yaml is blocks, each a field of ProjectConfig:
mets:
hrrr: /path/to/hrrr_arl
models:
hysplit: {n_hours: -24, numpar: 200}
variants:
hrrr: {}
hrrr-long: {n_hours: -72}
execution:
backend: local
output: output
mets names the meteorology (for HYSPLIT,
MetConfig). models names the transport
models, each block with that model’s settings
(HysplitConfig for hysplit).
stages names what is made from each simulation’s particles after the
model runs, each block with the import path of its stage’s class and then
the stage’s settings. A stage’s block is named for its stage, which is also
the name of its folder in the output directory and of its column in
project.status(). Without a stages block, a project makes particles
only.
variants says what runs, and execution where
(ExecutionConfig). Each class lives next to the code that uses it
(runtraj.execution.config, runtraj.models.hysplit).
No setting sits at the top level. One written there is refused with a
message that names its block, such as 'n_hours' is a hysplit setting.
Write it under models: hysplit:. A key may be written once in each
block: YAML would keep the last of two, so runtraj refuses the file and
names the line of the second.
Each page below lists its fields with their defaults and is generated from
the code.
A config runs code#
A class in a model’s or a stage’s block, and a transform’s kind,
name a Python object by its import path. runtraj imports that module and
calls the object, which is how a project uses a model or a stage from any
installed package. runtraj does not check what the path names: any
installed module is imported and any callable is called, even by
runtraj check. So treat a config.yaml as you would a Python script,
and run one only if you would run a script from the same person.
A service that runs configs other people send should not pass their YAML to
runtraj. Build the ProjectConfig yourself from the fields you
allow, with the import paths you choose.
Every key#
These tables are generated from the code, so they always match the installed version.
Top level#
The blocks, and where the results go.
Parameter |
Description |
Default |
|---|---|---|
|
Meteorology by name, such as |
|
|
Transport models by name, each a block of its settings: the defaults of every variant that runs it. A block named |
|
|
What is made from each simulation’s results after the transport model runs, by name, each a block that gives the stage’s import path as |
|
|
Variants by name, each a set of overrides of the defaults. A variant’s own keys are |
|
|
Where the releases run and with what resources, such as |
|
|
Directory the results go to, relative to the project directory unless absolute. A URL such as |
|
HYSPLIT#
The keys of the hysplit block under models:, the transport model’s
settings (HYSPLIT Integration). They are the defaults of every variant that runs
HYSPLIT, and a variant may override any of them by writing the key itself.
Every key but n_hours has the default below, so a block may be as
short as hysplit: {n_hours: -24}; n_hours has no default, and a
config without it is refused. capemin, kblt, kmixd,
krand and vscales are unset unless given: HYSPLIT chooses them when
it runs.
Parameter |
Description |
Default |
|---|---|---|
|
Length of each simulation, in hours. Negative runs backward in time. It has no default: a config must say it. |
Required |
|
Random seed for a reproducible run. Different seeds give different runs. Requires |
|
|
What HYSPLIT makes: |
|
|
The pollutants of a concentration run, each released at every release location and counted on every grid. At least one in |
|
|
The grids of a concentration run. At least one in |
|
|
The conversions of a concentration run with |
|
|
HYSPLIT’s |
|
|
Number of particles released per simulation. More particles sample the turbulence better and take longer to run. |
|
|
The HYSPLIT folder as unpacked: runtraj runs |
|
|
Particle variables |
|
|
Convection option. -1 turns convection off, -2 uses the Grell scheme, and a positive value mixes vertically when CAPE exceeds it, in J/kg. Unset, HYSPLIT chooses -2 with |
|
|
Compute grid concentrations (0) or grid mass (1). Read only for HYSPLIT’s concentration grids ( |
|
|
Particle age at which particles and puffs convert, in hours, when |
|
|
Packing of the binary concentration grid: 0 every point, 1 only nonzero points. Unset, HYSPLIT chooses 1. Read only for HYSPLIT’s concentration grids ( |
|
|
Integration time step, in minutes. 0 lets HYSPLIT choose; a negative value sets the minimum step. With |
|
|
Horizontal x offset factor for HYSPLIT’s meteorological ensemble. |
|
|
Horizontal y offset factor for HYSPLIT’s meteorological ensemble. |
|
|
Vertical offset factor for HYSPLIT’s meteorological ensemble (0.01 is about 250 m). |
|
|
Name of a time-varying emissions file. Blank uses none. |
|
|
Duration of the particle release, in hours. |
|
|
Maximum horizontal puff-rounding parameter. Used only for puffs, when |
|
|
Horizontal puff-rounding fraction for merging. Used only for puffs, when |
|
|
Mass-rounding fraction for enhanced puff merging. Used only for puffs, when |
|
|
Mass-removal fraction for enhanced puff merging. Used only for puffs, when |
|
|
Temporal puff-rounding fraction. Used only for puffs, when |
|
|
Vertical puff-rounding fraction. Used only for puffs, when |
|
|
Horizontal Lagrangian timescale, in seconds. |
|
|
Initial distribution: 0 3D particles, 1 and 2 3D puffs, 3 and 4 puffs horizontally and particles vertically. Other values are HYSPLIT’s conversions and special modes. |
|
|
Use the 10 m winds and 2 m temperature as the lowest meteorology level (1) or skip them (0). |
|
|
Trajectory heights above ground (1) or above sea level (0). Read only by HYSPLIT’s trajectory model, not by |
|
|
Derive boundary-layer stability from surface fluxes (1) or from wind and temperature profiles (2). |
|
|
Boundary-layer turbulence scheme: 1 Beljaars, 2 Kantha-Clayson, 3 TKE, 4 measured variances, 5 Hanna. Unset, HYSPLIT chooses 5 with |
|
|
Horizontal turbulence from vertical mixing (0) or wind deformation (1). |
|
|
Age, in hours, given to particles read from |
|
|
Maximum particle age, in hours. HYSPLIT drops a particle older than this. |
|
|
Minimum mixed-layer depth, in meters. 0 by default in |
|
|
Mixed-layer depth source: 0 from the meteorology, 1 from the temperature profile, 2 from the TKE profile, 3 from a modified Richardson number. Unset, HYSPLIT chooses 3 with |
|
|
Horizontal puff growth: linear (0) or empirical (1). Used only for puffs, when |
|
|
How HYSPLIT draws the random numbers for turbulence. 0, or unset, picks 2 when |
|
|
Enhanced puff-merging interval, in hours. Used only for puffs, when |
|
|
Standard puff-splitting interval, in hours. Used only for puffs, when |
|
|
Precipitation for wet removal from the meteorology (1) or from an external file (2). Read only for deposition, which runtraj’s |
|
|
Vertical mixing adjustment: 0 none, 1 a single PBL-average value, 2 scale by |
|
|
Maximum number of pollutants carried on one particle. |
|
|
Maximum number of particles in a simulation. Unset gives every release location its full share: |
|
|
Minimum meteorological subgrid size, in grid points. |
|
|
Trajectory restart duration limit, in hours. Read only by HYSPLIT’s trajectory model, not by |
|
|
Number of particle-size bins per pollutant type. |
|
|
Cycle time of the particle dump file, in hours. |
|
|
Interval between particle dumps to |
|
|
Particle initialization from |
|
|
Trajectory restart interval, in hours. Read only by HYSPLIT’s trajectory model, not by |
|
|
Turbulence on (0) or off (1). |
|
|
Trajectory vertical split number. Read only by HYSPLIT’s trajectory model, not by |
|
|
Interval between particle outputs in the particle file, in minutes. 0 writes every time step. HYSPLIT writes no particles for a negative value, so it is refused. Only at 0 does runtraj check where the particles of a run that stopped early ended, to tell met that ran out from particles that left the met’s domain. |
|
|
Dust threshold velocity sensitivity factor, read only by HYSPLIT’s dust emission module. |
|
|
Particle input file for time-varying boundary conditions. |
|
|
Particle input file read at initialization ( |
|
|
Particle dump output file ( |
|
|
Emission cycling period, in hours. 0 turns cycling off. |
|
|
Relative humidity that defines a cloud base, in percent, for wet removal. |
|
|
Relative humidity that defines a cloud top, in percent, for wet removal. |
|
|
Factor for the automatic horizontal splitting size. A negative value turns the automatic sizing off. Used only for puffs, when |
|
|
Ratio w’²/(u’²+v’²) of TKE components when unstable. |
|
|
Ratio w’²/(u’²+v’²) of TKE components when stable. |
|
|
Fraction of the vertical Lagrangian timescale used as the time step of the dispersion scheme. |
|
|
Trajectory output interval, in minutes: the time between the rows of a trajectory. Read only in |
|
|
Write the potential temperature along each trajectory (1), as |
|
|
Write the air temperature along each trajectory (1), as |
|
|
Write the rainfall along each trajectory (1), as |
|
|
Write the mixed-layer depth along each trajectory (1), as |
|
|
Write the relative humidity along each trajectory (1), as |
|
|
Write the specific humidity along each trajectory (1), as |
|
|
Write the water vapor mixing ratio along each trajectory (1), as |
|
|
Write the terrain height along each trajectory (1), as |
|
|
Write the downward shortwave flux along each trajectory (1), as |
|
|
Advection stability ratio: the fraction of a grid cell a particle may move in one time step. |
|
|
Vertical mixing scale factor, used by the |
|
|
Height below which HYSPLIT counts a particle’s time toward its |
|
|
Vertical Lagrangian timescale, in seconds. |
|
|
Vertical Lagrangian timescale in an unstable boundary layer, in seconds. |
|
|
Vertical Lagrangian timescale in a stable boundary layer, in seconds. -1 uses the Hanna timescale, which varies with the turbulence, and then |
|
|
Vertical motion method: 0 the meteorology’s vertical velocity, 1 isobaric, 2 isentropic, 3 constant density, 4 constant sigma. |
|
|
Height at which the fixed vertical velocity switches from rise to fall, in meters. Used by vertical motion option 9. |
|
|
Fixed fall velocity, in m/s. Used by vertical motion options 9 and 10. |
|
|
Fixed rise velocity, in m/s. Used by vertical motion option 9. |
|
|
Interpolate WRF fields vertically with the WRF scheme instead of HYSPLIT’s. |
|
|
Top of HYSPLIT’s computational domain, in meters above ground. |
|
|
Factor applied to the mixed-layer height, written to HYSPLIT’s |
|
|
Standard deviation of the horizontal wind error, in m/s. |
|
|
Correlation timescale of the horizontal wind error, in minutes. |
|
|
Vertical correlation length of the horizontal wind error, in meters. |
|
|
Horizontal correlation length of the horizontal wind error, in km. |
|
|
Standard deviation of the mixed-layer height error, in percent. |
|
|
Correlation timescale of the mixed-layer height error, in minutes. |
|
|
Horizontal correlation length of the mixed-layer height error, in km. |
|
The keys of one entry under pollutants:, in mode: concentration
(Concentration Grids).
Parameter |
Description |
Default |
|---|---|---|
|
Up to four letters or digits: HYSPLIT’s identifier, and the name of the pollutant’s variable in each grid. Not |
Required |
|
Emission rate, per hour, at each release location. Its mass unit is the concentration’s: 1 per hour for an hour gives a mass of 1. |
|
|
How long the pollutant is released, in hours, from the release time. |
|
|
Particle diameter, in micrometers. 0 for a gas. |
|
|
Particle density, in g/cm3. 0 for a gas. |
|
|
Particle shape factor. 0 for a gas. |
|
|
Dry deposition velocity, in m/s. 0 for none, or to compute it from the settings below. |
|
|
Molecular weight, in g/mol, for the resistance method. |
|
|
Surface reactivity ratio, for the resistance method. |
|
|
Diffusivity ratio, for the resistance method. |
|
|
Effective Henry’s constant, in M/atm, for the resistance method. |
|
|
Henry’s constant for wet removal of a gas, in M/atm. |
|
|
In-cloud wet removal, in L/L (particles). |
|
|
Below-cloud wet removal, in 1/s (particles). |
|
|
Radioactive decay half-life, in days. 0 for none. |
|
|
Resuspension factor of deposited mass, in 1/m. |
|
The keys of one entry under grids:, in mode: concentration.
Parameter |
Description |
Default |
|---|---|---|
|
The grid’s name: its group in the result’s file, and its child in the tree. |
Required |
|
Longitude of the grid’s center, in degrees. Unset with |
|
|
Latitude of the grid’s center, in degrees. Set with |
|
|
Distance between rows of cells, in degrees of latitude. |
|
|
Distance between columns of cells, in degrees of longitude. |
|
|
How far the grid reaches in latitude, in degrees. |
|
|
How far the grid reaches in longitude, in degrees. |
|
|
Top of each level, in whole meters above ground, from the bottom. A level of 0 counts deposition on the ground. |
|
|
What each sample is: the average over its interval, the value at its end, or the maximum. |
|
|
Length of each sample, in minutes: under an hour, any number; an hour or more, a whole number of hours (60, 120, …), which is how HYSPLIT reads it. |
|
The keys of one entry under conversions:, with ichem: 2.
Parameter |
Description |
Default |
|---|---|---|
|
The name of the pollutant that is converted. |
Required |
|
The name of the pollutant it becomes. |
Required |
|
The fraction of |
Required |
|
Mass of |
|
A model in another package gets a block of any name that gives the model
class’s import path as class, then that model’s own settings:
models:
hysplit: {n_hours: -24}
mine: {class: mypkg.models.MyModel, n_hours: -24}
variants:
hrrr: {model: hysplit}
hrrr-mine: {model: mine, met: hrrr}
With two or more models, each variant names its own with model. A model
has one block: a second set of settings for it is a second variant.
A stage#
A stage’s block under stages: gives the import path of the stage’s class
as class, then that stage’s own settings, which are the defaults of
every variant. A variant changes some under its own stages key, under
the stage’s name, and sets the stage to null to go without it. PYSTILT’s
footprint is such a stage:
stages:
footprint:
class: stilt.footprint.FootprintStage
grid: {xmin: -113.0, xmax: -110.5, ymin: 40.0, ymax: 42.0, xres: 0.01, yres: 0.01}
variants:
hrrr: {}
hrrr-coarse: {stages: {footprint: {grid: {xres: 0.05, yres: 0.05}}}}
hrrr-particles: {stages: {footprint: null}}
A met#
The keys of one entry under mets:, for HYSPLIT
(Meteorology).
Parameter |
Description |
Default |
|---|---|---|
|
Directory holding the ARL meteorology files. Downloads are saved here. In a project, a relative path starts from the project directory; |
Required |
|
Directory for the cropped files, shared by every simulation that uses this meteorology. Each crop box gets its own folder inside it. Required when cropping your own files; not used with |
|
|
Name of a NOAA ARL archive to download files from with arlmet, such as |
|
|
Server to download from: |
|
|
Crop the meteorology to |
|
|
Longitude/latitude box to crop the meteorology to. Particles that leave it stop, so make it wide enough for the whole run. |
|
|
Number of vertical levels to keep, counted from the surface. Unset keeps all. |
|
Execution#
The keys under execution: (Running). backend names
where the project runs, and every setting of that place is in the block of
its name. Only that block is read, so a config can hold several.
Parameter |
Description |
Default |
|---|---|---|
|
Where to run: on this machine ( |
|
|
How a local run goes ( |
|
|
The job array of a Slurm run ( |
|
|
The indexed Job of a Kubernetes run ( |
|
|
Time limit for one transport model run, in seconds. A run that exceeds it is stopped and recorded as a failed simulation, and the worker moves on. Unset waits indefinitely, so a hung run can hold a worker until its job ends. |
|
|
Keep every run’s workdir, as the transport model left it, under |
|
The keys under execution: local:, a run on this machine.
Parameter |
Description |
Default |
|---|---|---|
|
Releases run at once, each in a process of its own. |
|
|
Get the met files a met with |
|
The keys under execution: slurm:, a Slurm job array
(On An HPC Cluster (Slurm)). Any other key is an sbatch option by its name.
Parameter |
Description |
Default |
|---|---|---|
|
Number of array tasks, which the releases are split evenly among. |
|
|
Releases each task runs at once, and the CPUs each task asks for. |
|
|
Time limit per task, as |
|
|
Memory per task, such as |
|
|
Slurm partition. |
|
|
Slurm account. |
|
|
Slurm quality of service. |
|
|
Most tasks running at once. Unset leaves it to Slurm. |
|
|
Shell commands run in each task before the worker, such as |
|
|
Get the met files a met with |
|
The keys under execution: slurm: fetch:, the Slurm resources of the job
that gets the met files before a job array (Met files that download).
Parameter |
Description |
Default |
|---|---|---|
|
Slurm partition of the fetch job. Unset is the array’s. |
|
|
Slurm account of the fetch job. Unset is the array’s. |
|
|
Slurm quality of service of the fetch job. Unset is the array’s. |
|
|
Time limit of the fetch job, as for |
|
|
Memory of the fetch job, such as |
|
The keys under execution: kubernetes:, a Kubernetes indexed Job
(Submitting to Kubernetes), in Kubernetes’ own names and units.
Parameter |
Description |
Default |
|---|---|---|
|
Container image of the pods, with runtraj, the transport model and the project’s stages. Required with |
|
|
Number of tasks (pods to complete), which the releases are split evenly among. |
|
|
Most pods running at once. Unset runs every task at once. |
|
|
Releases each pod runs at once, and the CPUs each pod requests. |
|
|
Memory each pod requests, and its limit, in Kubernetes’ binary units such as |
|
|
Namespace of the Job. Unset is |
|
|
Bucket URL the project’s inputs ( |
|
|
PersistentVolumeClaims mounted in every pod ( |
|
|
Secrets whose keys become each pod’s environment variables, such as a bucket’s credentials. |
|
|
Service account of the pods, on a cluster that grants bucket access through one. |
|
|
Seconds the whole Job may run before Kubernetes stops it. Unset lets it run as long as its simulations take. |
|
|
Get the met files once, before the pods run, for a met with |
|
The keys of one entry under execution: kubernetes: volumes:, a
PersistentVolumeClaim mounted in every pod.
Parameter |
Description |
Default |
|---|---|---|
|
Name of the PersistentVolumeClaim. |
Required |
|
Where the volume is mounted in each pod, an absolute path. |
Required |
|
Mount it read-only, as for a met archive the pods only read. |
|
Boxes#
A Bounds is a longitude/latitude box, in degrees, such as a met’s
crop box. Longitudes count modulo 360, so a box across 180° can be written
xmin: 170, xmax: 190 or xmin: 170, xmax: -170, and a box
360° wide or more holds every longitude (Bounds.contains()).
Config objects#
A config is what you write. project.variants turns each declared
variant into a runtraj.config.Variant: its transport settings
checked by the model’s config class, and what the file alone does not
say, such as the transport model build. A variant with realizations: N
stays one variant.
The RUNTRAJ_COMPUTE_ROOT environment variable sets the compute root,
where each run’s workdir is made. It never changes a result, and projects
can share one.
A project's configuration, as read from |
|
Where a project's releases run, and with what resources. |
|
How a project's releases run on this machine: the |
|
The Slurm job array a project's releases run as: the |
|
The Slurm resources of the job that gets the met files before a job array. |
|
The Kubernetes indexed Job a project's releases run as: the |
|
A PersistentVolumeClaim mounted in every pod: one entry of |
|
Longitude/latitude bounding box, in degrees. |
Parameters#
The settings that shape a run’s particles belong to the transport model,
and are written in its block under models: (hysplit when the config
has no models). HYSPLIT’s are in
runtraj.models.hysplit.HysplitConfig, under HYSPLIT’s names (see
HYSPLIT Integration). Each model’s block holds all of its settings, the ones
runtraj reads itself among them (n_hours and seed): nothing passes
from one model’s block to another’s. What a stage does with the particles
afterwards is in the stage’s block, and does not change the particles or
their settings folder.