stilt.migration.StiltRConfig#

class stilt.migration.StiltRConfig(*, n_hours: int, seed: int | None = None, numpar: Annotated[int, Ge(ge=1)] = 2500, directory: pathlib.Path | None = None, varsiwant: list[typing.Literal['time', 'indx', 'long', 'lati', 'zagl', 'sigw', 'tlgr', 'zsfc', 'icdx', 'temp', 'samt', 'foot', 'shtf', 'tcld', 'dmas', 'dens', 'rhfr', 'sphu', 'lcld', 'zloc', 'dswf', 'wout', 'mlht', 'rain', 'crai', 'pres', 'whtf', 'temz', 'zcfx']]=<factory>, capemin: float | None = None, cmass: int = 0, conage: int = 24, cpack: int | None = None, delt: float = 0.0, dxf: float = 1.0, dyf: float = 1.0, dzf: float = 0.01, efile: str = '', emisshrs: Annotated[float, Ge(ge=0)] = 0.01, frhmax: float = 3.0, frhs: float = 1.0, frme: float = 0.1, frmr: float = 0.0, frts: float = 0.1, frvs: float = 0.01, hscale: float = 10800.0, initd: int = 0, k10m: int = 1, kagl: int = 0, kbls: int = 1, kblt: int | None = None, kdef: int = 0, khinp: int = 0, khmax: int = 9999, kmix0: int = 150, kmixd: int | None = None, kpuff: int = 0, krand: Literal[0, 1, 2, 3, 4, 10, 11, 12, 13] | None=None, krnd: int = 6, kspl: int = 1, kwet: int = 1, kzmix: int = 0, maxdim: int = 1, maxpar: int | None = None, mgmin: int = 10, mhrs: int = 0, nbptyp: int = 1, ncycl: int = 0, ndump: int = 0, ninit: int = 1, nstr: int = 0, nturb: int = 0, nver: int = 0, outdt: Annotated[int, Ge(ge=0)] = 0, p10f: float = 1.0, pinbc: str = 'PARINBC', pinpf: str = 'PARINIT', poutf: str = 'PARDUMP', qcycle: float = 0.0, rhb: int = 80, rht: int = 60, splitf: float = 1.0, tkerd: float = 0.18, tkern: float = 0.18, tlfrac: float = 0.1, tout: int = 0, tratio: float = 0.75, tvmix: float = 1.0, veght: Annotated[float, Gt(gt=0)] = 0.5, vscale: float = 200.0, vscaleu: float = 200.0, vscales: float | None = None, w_option: int = 0, wbbh: float = 0.0, wbwf: float = 0.0, wbwr: float = 0.0, wvert: bool = True, z_top: Annotated[float, Gt(gt=0)] = 25000.0, ziscale: float | list[float] = 1.0, siguverr: Annotated[float | None, Ge(ge=0)] = None, tluverr: Annotated[float | None, Ge(ge=0)] = None, zcoruverr: Annotated[float | None, Ge(ge=0)] = None, horcoruverr: Annotated[float | None, Ge(ge=0)] = None, sigzierr: Annotated[float | None, Ge(ge=0)] = None, tlzierr: Annotated[float | None, Ge(ge=0)] = None, horcorzierr: Annotated[float | None, Ge(ge=0)] = None, version: str | None = None) → None[source]#

The settings of imported STILT-R runs: HYSPLIT’s, as STILT-R ran it, and the STILT-R version.

The settings are HysplitConfig’s, under the same names, as STILT-R’s files record them (SETUP.CFG, CONTROL, and the .rds file; see stilt.migration.import_stilt_r()). Every one must be given: none has a default, because an imported run’s settings name its folder, and a default would stand in for a value no file gave. The config.yaml variant the import prints gives them all.

Parameters#

Parameter

Description

Default

n_hours

Length of each simulation, in hours. Negative runs backward in time. It has no default: a config must say it.

Required

seed

Random seed for a reproducible run. Different seeds give different runs. Requires krand: 2. HYSPLIT 5.1.0 ignores the seed under krand 4 and 10 to 13, and under 1 uses it only for the initial turbulent velocity. runtraj writes it to SETUP.CFG as -(abs(seed) + 1), because HYSPLIT reseeds its generator only from a negative value and gives every SEED of 0 or more the same stream. Realization k of a variant runs with seed + k, so realization 0 shares the unperturbed run’s seed.

None

numpar

Number of particles released per simulation. More particles sample the turbulence better and take longer to run.

2500

directory

The HYSPLIT folder as unpacked: runtraj runs exec/hycs_std under it and reads the data tables (ASCDATA.CFG, LANDUSE.ASC, ROUGLEN.ASC, TERRAIN.ASC) from its bdyfiles/. Unset, the first hycs_std on PATH runs, with the tables of a bdyfiles/ folder beside its folder; runtraj includes neither. The SHA-256 of hycs_std and of each table is part of each run’s settings, so runs of different builds are kept apart.

None

varsiwant

Particle variables hycs_std writes to the trajectory output, by the lowercase four-letter names HYSPLIT reads. Each is a column of the particles under the same name, except indx, time, long, and lati. zcfx is the vertical displacement by convective flux along the trajectory, in m. The default is HYSPLIT’s own list of 20.

['time', 'indx', 'long', 'lati', 'zagl', 'sigw', 'tlgr', 'zsfc', 'temp', 'samt', 'foo...

capemin

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 ICHEM=8.

None

cmass

Compute grid concentrations (0) or grid mass (1). Read only for HYSPLIT’s concentration grid, which runtraj does not read.

0

conage

Particle age at which particles and puffs convert, in hours, when initd is 3 or 4.

24

cpack

Packing of the binary concentration grid: 0 every point, 1 only nonzero points. Unset, HYSPLIT chooses. Read only for HYSPLIT’s concentration grid, which runtraj does not read.

None

delt

Integration time step, in minutes. 0 lets HYSPLIT choose; a negative value sets the minimum step. With ICHEM=8 HYSPLIT always steps 1 minute, so this setting has no effect.

0.0

dxf

Horizontal x offset factor for HYSPLIT’s meteorological ensemble.

1.0

dyf

Horizontal y offset factor for HYSPLIT’s meteorological ensemble.

1.0

dzf

Vertical offset factor for HYSPLIT’s meteorological ensemble (0.01 is about 250 m).

0.01

efile

Name of a time-varying emissions file. Blank uses none.

''

emisshrs

Duration of the particle release, in hours.

0.01

frhmax

Maximum horizontal puff-rounding parameter. Used only for puffs, when initd is not 0.

3.0

frhs

Horizontal puff-rounding fraction for merging. Used only for puffs, when initd is not 0.

1.0

frme

Mass-rounding fraction for enhanced puff merging. Used only for puffs, when initd is not 0.

0.1

frmr

Mass-removal fraction for enhanced puff merging. Used only for puffs, when initd is not 0.

0.0

frts

Temporal puff-rounding fraction. Used only for puffs, when initd is not 0.

0.1

frvs

Vertical puff-rounding fraction. Used only for puffs, when initd is not 0.

0.01

hscale

Horizontal Lagrangian timescale, in seconds.

10800.0

initd

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.

0

k10m

Use the 10 m winds and 2 m temperature as the lowest meteorology level (1) or skip them (0).

1

kagl

Trajectory heights above ground (1) or above sea level (0). Read only by HYSPLIT’s trajectory model, not by hycs_std.

0

kbls

Derive boundary-layer stability from surface fluxes (1) or from wind and temperature profiles (2).

1

kblt

Boundary-layer turbulence scheme: 1 Beljaars, 2 Kantha-Clayson, 3 TKE, 4 measured variances, 5 Hanna. Unset, HYSPLIT chooses 5 with ICHEM=8.

None

kdef

Horizontal turbulence from vertical mixing (0) or wind deformation (1).

0

khinp

Age, in hours, given to particles read from pinpf. 0 keeps their own age.

0

khmax

Maximum particle age, in hours. HYSPLIT drops a particle older than this.

9999

kmix0

Minimum mixed-layer depth, in meters.

150

kmixd

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 ICHEM=8.

None

kpuff

Horizontal puff growth: linear (0) or empirical (1). Used only for puffs, when initd is not 0.

0

krand

How HYSPLIT draws the random numbers for turbulence. 0, or unset, picks 2 when numpar is 5000 or less and 1 otherwise. 1 uses a precomputed table. 2 draws them during the run and is the only mode that uses seed. 3 uses no random numbers (a diagnostic mode). 4 draws them during the run from a clock-based seed, so every run differs; there are about 5000 possible seeds. 10 to 13 are modes 0 to 3 with a random initial seed. HYSPLIT does not check this value and other values silently break the turbulence, so runtraj rejects them.

None

krnd

Enhanced puff-merging interval, in hours. Used only for puffs, when initd is not 0.

6

kspl

Standard puff-splitting interval, in hours. Used only for puffs, when initd is not 0.

1

kwet

Precipitation for wet removal from the meteorology (1) or from an external file (2). Read only for deposition, which runtraj’s CONTROL turns off.

1

kzmix

Vertical mixing adjustment: 0 none, 1 a single PBL-average value, 2 scale by tvmix.

0

maxdim

Maximum number of pollutants carried on one particle.

1

maxpar

Maximum number of particles in a simulation. Unset gives every release location its full share: numpar for one location, n \* (numpar // n + 1) for n. A set value that stops a multipoint release before its last location fails the run.

None

mgmin

Minimum meteorological subgrid size, in grid points.

10

mhrs

Trajectory restart duration limit, in hours. Read only by HYSPLIT’s trajectory model, not by hycs_std.

0

nbptyp

Number of particle-size bins per pollutant type.

1

ncycl

Cycle time of the particle dump file, in hours.

0

ndump

Interval between particle dumps to poutf, in hours. 0 writes none. runtraj does not keep the dump file.

0

ninit

Particle initialization from pinpf: 0 none, 1 once at the start, 2 add every hour, 3 replace every hour. A file that does not exist is skipped.

1

nstr

Trajectory restart interval, in hours. Read only by HYSPLIT’s trajectory model, not by hycs_std.

0

nturb

Turbulence on (0) or off (1).

0

nver

Trajectory vertical split number. Read only by HYSPLIT’s trajectory model, not by hycs_std.

0

outdt

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.

0

p10f

Dust threshold velocity sensitivity factor, read only by HYSPLIT’s dust emission module.

1.0

pinbc

Particle input file for time-varying boundary conditions.

'PARINBC'

pinpf

Particle input file read at initialization (ninit).

'PARINIT'

poutf

Particle dump output file (ndump).

'PARDUMP'

qcycle

Emission cycling period, in hours. 0 turns cycling off.

0.0

rhb

Relative humidity that defines a cloud base, in percent, for wet removal.

80

rht

Relative humidity that defines a cloud top, in percent, for wet removal.

60

splitf

Factor for the automatic horizontal splitting size. A negative value turns the automatic sizing off. Used only for puffs, when initd is not 0.

1.0

tkerd

Ratio w’²/(u’²+v’²) of TKE components when unstable.

0.18

tkern

Ratio w’²/(u’²+v’²) of TKE components when stable.

0.18

tlfrac

Fraction of the vertical Lagrangian timescale used as the time step of the dispersion scheme.

0.1

tout

Trajectory output interval, in minutes. Read only by HYSPLIT’s trajectory model, not by hycs_std.

0

tratio

Advection stability ratio: the fraction of a grid cell a particle may move in one time step.

0.75

tvmix

Vertical mixing scale factor, used by the kzmix scaling modes.

1.0

veght

Height below which HYSPLIT counts a particle’s time toward its foot: the depth surface fluxes are mixed through. A value of 1 or less is a fraction of the mixed-layer height; a larger value is meters above ground.

0.5

vscale

Vertical Lagrangian timescale, in seconds.

200.0

vscaleu

Vertical Lagrangian timescale in an unstable boundary layer, in seconds.

200.0

vscales

Vertical Lagrangian timescale in a stable boundary layer, in seconds. -1 uses the Hanna timescale, which varies with the turbulence, and then vscaleu is not used. Unset, HYSPLIT chooses -1 with ICHEM=8.

None

w_option

Vertical motion method: 0 the meteorology’s vertical velocity, 1 isobaric, 2 isentropic, 3 constant density, 4 constant sigma.

0

wbbh

Height at which the fixed vertical velocity switches from rise to fall, in meters. Used by vertical motion option 9.

0.0

wbwf

Fixed fall velocity, in m/s. Used by vertical motion options 9 and 10.

0.0

wbwr

Fixed rise velocity, in m/s. Used by vertical motion option 9.

0.0

wvert

Interpolate WRF fields vertically with the WRF scheme instead of HYSPLIT’s.

True

z_top

Top of HYSPLIT’s computational domain, in meters above ground.

25000.0

ziscale

Factor applied to the mixed-layer height, written to HYSPLIT’s ZICONTROL file. 1.0 leaves it unscaled. A single value applies to every hour of the run. A list gives one factor per hour from the release (at most 150), and later hours are unscaled. HYSPLIT applies kmix0 after the factor, so the mixed layer never drops below kmix0. A negative value uses the meteorology’s own PBL height where the met files carry one.

1.0

siguverr

Standard deviation of the horizontal wind error, in m/s.

None

tluverr

Correlation timescale of the horizontal wind error, in minutes.

None

zcoruverr

Vertical correlation length of the horizontal wind error, in meters.

None

horcoruverr

Horizontal correlation length of the horizontal wind error, in km.

None

sigzierr

Standard deviation of the mixed-layer height error, in percent.

None

tlzierr

Correlation timescale of the mixed-layer height error, in minutes.

None

horcorzierr

Horizontal correlation length of the mixed-layer height error, in km.

None

version

The STILT-R version that made the runs, such as a commit of uataq/stilt. No STILT-R file records it, so the import is given it. Recorded with the runs’ settings.

None