Model#
- class fridom.framework.model.Model(mset: ModelSettingsBase)[source]#
Bases:
objectBase class for the model.
- Attributes:
mset (ModelSettings) : Model settings. grid (Grid) : Grid. z (State) : State variable. dz_list (list) : List of tendency terms (for time stepping). pointer (np.ndarray) : Pointer for time stepping. coeff_AB (np.ndarray) : Adam-Bashforth coefficients. timer (TimingModule) : Timer. it (int) : Iteration counter. time (float) : Model time. dz (State) : Current tendency term.
- Methods:
run() : Run the model for a given number of steps. step() : Perform one time step. reset() : Reset the model (pointers, tendencies)
Methods
__init__(mset)Constructor.
load(file)reset()Reset the model (pointers, tendencies).
restart()run([steps, runlen, start_time, end_time, ...])Run the model
save(file)start()Prepare the model for running.
step()Update the model state by one time step.
stop()Finish the model run.
Attributes
Returns the current state variable.
Examples using
fridom.framework.Model#- run(steps: int | None = None, runlen: timedelta64 | float | int | None = None, start_time: datetime64 | float | int = 0, end_time: datetime64 | float | int | None = None, progress_bar=True) 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_timenp.datetime64 | float | int (default: 0)
Start time of the run.
- end_timenp.datetime64 | float | int (default: None)
End time of the run.
- progress_barbool (default: True)
Show progress bar.
Raises#
- ValueError
Only one of steps, runlen or end_time can be given.
- property z#
Returns the current state variable.