ModelState#

class fridom.framework.model_state.ModelState(mset: ModelSettingsBase, clock: Clock | None = None)[source]#

Bases: object

Stores the model state variables and the time information.

Description#

The base class for model states. It contains the state vector, the time step and the model time. Child classes may add more attributes as for example the diagnostic variables needed for the model. All model state variables should be stored in this class.

Parameters#

msetModelSettings

The model settings object.

clockClock, optional

The clock object to keep track of the model time.

__init__(mset: ModelSettingsBase, clock: Clock | None = None) None[source]#

Methods

__init__(mset[, clock])

reset()

Reset the model state.

Attributes

clock

The clock of the model.

dz

The tendency vector.

it

The iteration number.

panicked

Flag to cancel the model run in case something goes wrong.

xr

Model State as xarray dataset

xrs

Model State of sliced domain as xarray dataset

z

The state vector.

z_diag

The diagnostic state vector.

Examples using fridom.framework.ModelState#

Barotropic Jet

Barotropic Jet

Convection and Closures

Convection and Closures

Dancing Eddies

Dancing Eddies

Internal Gravity Wave Maker

Internal Gravity Wave Maker

Multiple Wave Makers

Multiple Wave Makers

Rayleigh-Bénard Convection

Rayleigh-Bénard Convection

Rayleigh-Taylor Instability

Rayleigh-Taylor Instability

Single Internal Wave

Single Internal Wave

Symmetric Instability

Symmetric Instability

Tracers and Eddies

Tracers and Eddies

Reflecting Wave Package

Reflecting Wave Package

Barotropic Instability.

Barotropic Instability.

Equatorial Waves.

Equatorial Waves.
reset() None[source]#

Reset the model state.

property xr#

Model State as xarray dataset

property xrs#

Model State of sliced domain as xarray dataset

property z: VectorField#

The state vector.

property z_diag: VectorField#

The diagnostic state vector.

property dz: VectorField#

The tendency vector.

property it: int#

The iteration number.

property clock: Clock#

The clock of the model.

property panicked: bool#

Flag to cancel the model run in case something goes wrong.