tracmass.steady_state#
- tracmass.steady_state(state, grid, fluxes, *, iter_sub=1, max_iter=100_000, timax_seconds=_UNSET, traj_max_time=_UNSET, scheme='tstep', no_wflux=_UNSET, n_particle_batches=_UNSET)[source]#
Single-window steady-state integration.
The flux direction (forward/backward) is determined by
grid.reverse, as set when the grid was created viatracmass.gcm.new_grid()ortracmass.gcm.new_flux().- Parameters:
state (
ParticleState) – Initial particle state.grid (
gcm.GridFields) – Static grid geometry fromtracmass.gcm.new_grid()ortracmass.gcm.new_flux(). Passdtm_endearlier thandtm_startto either for backward-in-time trajectories.fluxes (
gcm.FluxFields) – Time-varying flux data for the current time window.iter_sub (
int) – Number of sub-cycles per GCM step (ignored when scheme=’analytical’).max_iter (
int) – Maximum number of sub-cycles.timax_seconds (
float, optional) – Maximum trajectory lifetime in seconds, counted from each particle’s release (tt - t0). Pass this or traj_max_time, not both.traj_max_time (
strorNone, optional) – The same lifetime as apd.Timedeltastring ("30D","12h") or in calendar units ("1M","6M","1Q","1Y", measured from the run’s start,fluxes.dtm). Particles past it stop with reasontime. When neither is passed, from thetraj_max_timesetting (default: no limit). Seetracmass.runsetup.traj_max_seconds().scheme (
str) – Advection scheme:"tstep"(default) or"analytical".no_wflux (
bool, optional) – When True, vertical (w) fluxes are ignored and particles are confined to their initial depth layer (ka never changes). When not passed, resolved from themove_verticallysetting asno_wflux = not move_vertically(defaultmove_vertically=True, i.e.no_wflux=False). Seetracmass.config.move_vertically().n_particle_batches (
int, optional) – Split particles into this many equal-sized groups and run each group throughlax.while_loopseparately, capping the peak per-call GPU scratch allocation to roughly1 / n_particle_batches. When not passed, taken from then_particle_batchessetting (default1— no batching); an explicit value wins. Seetracmass.config.n_particle_batches()andtime_dependent()for the full rationale.
- Returns:
ParticleState with final positions.For multi-window integration with field updates,use :func:`time_dependent.`
- Return type: