tracmass.GridFields#

class tracmass.GridFields(*, kmt, dxdy, imt, jmt, km, timestep, reverse, iperio, jperio, i_offset=0, j_offset=0)[source]#

Bases: object

Static grid geometry and metadata for a TRACMASS run.

These fields are fixed for the lifetime of a run. The advection kernels close over a GridFields instance so that kmt and dxdy become XLA constants in the compiled graph.

Parameters:
kmt#

Bottom-level index (integer), shape (imt, jmt). A value of 0 indicates a land cell.

Type:

jnp.ndarray

dxdy#

Horizontal cell area, shape (imt, jmt).

Type:

jnp.ndarray

imt#

Number of grid cells in the zonal (x) direction.

Type:

int

jmt#

Number of grid cells in the meridional (y) direction.

Type:

int

km#

Number of vertical levels.

Type:

int

timestep#

Duration between consecutive time levels.

Type:

pd.Timedelta

reverse#

If True, fluxes have been negated for backward-in-time tracking.

Type:

bool

iperio#

East-west periodicity flag (1 = cyclic, 0 = closed).

Type:

int

jperio#

North-fold periodicity flag (1 = north-fold, 0 = closed).

Type:

int

i_offset, j_offset

Position of this grid’s cell (0, 0) in the adapter’s full (un-subset) grid — the subset i1 / j1, else 0. Particle positions are relative to this grid; the trajectory recorder adds the offsets so saved x / y / ia / ja are absolute.

Type:

int

__init__(*, kmt, dxdy, imt, jmt, km, timestep, reverse, iperio, jperio, i_offset=0, j_offset=0)#
Parameters:
Return type:

None

Methods

__init__(*, kmt, dxdy, imt, jmt, km, ...[, ...])

Attributes

i_offset

j_offset

kmt

dxdy

imt

jmt

km

timestep

reverse

iperio

jperio