Model#

class fridom.framework.model.Model(mset: ModelSettingsBase)[source]#

Bases: object

The main model class.

Parameters#

msetModelSettingsBase

The model settings.

__init__(mset: ModelSettingsBase) None[source]#

Methods

__init__(mset)

load(file)

Load a model from a file.

reset()

Reset the model (pointers, tendencies).

run([steps, runlen, start_step, start_time, ...])

Run the model.

run_backward([steps])

Run the model backward in time.

save(file)

Save the full model to a file.

start()

Prepare the model for running.

step()

Update the model state by one time step.

stop()

Finish the model run.

Attributes

diagnostics

The module container for all diagnostics.

nan_checker

The NaN checker module.

progress_bar

The progress bar module.

restart_module

The restart module.

tendencies

The module container for all tendencies.

time_stepper

The time stepper.

timer

The timing module.

z

Returns the current state variable.

Examples using fridom.framework.Model#

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.
start() None[source]#

Prepare the model for running.

stop() None[source]#

Finish the model run.

reset() None[source]#

Reset the model (pointers, tendencies).

run_backward(steps: int | None = None) None[source]#

Run the model backward in time.

Description#

This method runs the model backward in time for a given number of steps.

run(steps: int | None = None, runlen: timedelta64 | float | None = None, start_step: int = 0, start_time: datetime64 | float = 0, end_time: datetime64 | float | None = None) None[source]#

Run the model.

Parameters#

stepsint (default: None)

Number of steps to run.

runlennp.timedelta64 | float | int (default: None)

Length of the run.

start_stepint (default: 0)

Start iteration of the run.

start_timenp.datetime64 | float | int (default: 0)

Start time of the run.

end_timenp.datetime64 | float | int (default: None)

End time of the run.

step() None[source]#

Update the model state by one time step.

property z: VectorField#

Returns the current state variable.

property timer: fr.Timer#

The timing module.

property nan_checker: NaNChecker#

The NaN checker module.

property progress_bar: ProgressBar#

The progress bar module.

property restart_module: RestartModule#

The restart module.

property time_stepper: TimeStepper#

The time stepper.

property tendencies: ModuleContainer#

The module container for all tendencies.

property diagnostics: ModuleContainer#

The module container for all diagnostics.

load(file: str) None[source]#

Load a model from a file.

Parameters#

filestr

The filename to load the model from

save(file: str) None[source]#

Save the full model to a file.

Parameters#

filestr

The filename to save the model to