Model#
- class fridom.framework.model.Model(mset: ModelSettingsBase)[source]#
Bases:
objectThe 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
The module container for all diagnostics.
The NaN checker module.
The progress bar module.
The restart module.
The module container for all tendencies.
The time stepper.
The timing module.
Returns the current state variable.
Examples using
fridom.framework.Model#- 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.
- 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.