ModelSettings#

class fridom.shallowwater.model_settings.ModelSettings(grid: GridBase, **kwargs: any)[source]#

Bases: ModelSettingsBase

Model settings for the 2D shallow water model.

Parameters#

gridGrid

The grid object.

__init__(grid: GridBase, **kwargs: any) None[source]#

Methods

__init__(grid, **kwargs)

diagnostic_state_constructor()

Construct the diagnostic state vector from this model settings.

set_attributes(**kwargs)

Set model settings attributes from keyword arguments.

setup([setup_mode])

Set the model settings up.

setup_grid([setup_mode])

Set the grid object up.

setup_settings_parameters()

Set the model settings parameters up.

state_constructor()

Construct the state vector from this model settings.

Attributes

Ro

The Rossby number.

beta

The beta term of the Coriolis parameter (f=f0 + beta*y).

csqr

The phase speed of the gravity waves.

csqr_field

The variable c²(x,y) field.

custom_diagnostic_fields

List of custom diagnostic fields.

custom_state_fields

List of custom state fields.

diagnostics

The module container for all diagnostics.

f0

The constant term of the Coriolis parameter (f=f0 + beta*y).

f_coriolis

The Coriolis parameter (f=f0 + beta*y).

grid

The spatial grid.

halo

Return the halo size of the model.

is_setup

Return whether the model settings are set up.

model_name

nan_checker

The NaN checker object (default: NaNChecker).

parameters

Return a dictionary with all parameters of the model settings.

progress_bar

The progress bar object (default: ProgressBar).

raise_error_when_something_goes_wrong

Raise an error when something goes wrong.

restart_module

The restart module.

tendencies

The module container for all tendencies.

time_stepper

The time stepper object (default: AdamBashforth).

timer

The timing module.

Examples using fridom.shallowwater.ModelSettings#

Barotropic Instability.

Barotropic Instability.

Equatorial Waves.

Equatorial Waves.
model_name = 'ShallowWater'#
setup_settings_parameters() None[source]#

Set the model settings parameters up.

state_constructor() State[source]#

Construct the state vector from this model settings.

property parameters: dict#

Return a dictionary with all parameters of the model settings.

Description#

This method should be overridden by the child class to return a dictionary with all parameters of the model settings. This dictionary is used to print the model settings in the __repr__ method.

property f0: float#

The constant term of the Coriolis parameter (f=f0 + beta*y).

property beta: float#

The beta term of the Coriolis parameter (f=f0 + beta*y).

Unscaled System#

For the unscaled system, the beta term is given by:

\[\beta = \frac{df}{dy} = \frac{2\Omega \cos(\phi)}{R}\]

where \(\Omega\) is the angular velocity of the Earth, \(\phi\) is the latitude, and \(R\) is the radius of the Earth.

Scaled System#

In the scaled system, the beta term is given by:

\[\beta = \frac{\beta' L}{\Omega}\]

where \(\beta'\) is the unscaled beta term, \(L\) is the domain extent in the y-direction, and \(\Omega\) is the angular velocity of the Earth. We can rewrite the domain extent in terms of the latitude extent \(\Delta \phi\):

\[L = R \Delta \phi\]

where \(R\) is the radius of the Earth. Thus, the beta term in the scaled system is given by:

\[\beta = 2 \cos(\phi) \Delta \phi\]
property f_coriolis: ScalarField#

The Coriolis parameter (f=f0 + beta*y).

property csqr: float#

The phase speed of the gravity waves.

property csqr_field: ScalarField#

The variable c²(x,y) field.

property Ro: float#

The Rossby number.