SWAN#

TODO: Ensure the model_type is shown next to each class in the autosummaries.

TODO: Fix broken links to classes and modules.

Grid#

rompy.swan.grid.SwanGrid

Regular SWAN grid in geographic space.

Data#

rompy.swan.data.SwanDataGrid

This class is used to write SWAN data from a dataset.

rompy.swan.boundary.Boundnest1

SWAN BOUNDNEST1 NEST data class.

Components#

SWAN command instructions are described in Rompy by a set of pydantic models defined as components. Each component defines a full command instruction such as PROJECT, CGRID, GEN3, NUMERIC, etc. Inputs to the components may include other pydantic models called subcomponents to handle more complex arguments.

Components are subclasses of rompy.swan.components.base.BaseComponent. The base component class implements the following attribues:

  • The model_type field that should be overwritten in each component subclass. The model_type field is defined as a Literal type and is used to discriminate the exact components to use in fields defined by a Union type of two or more components in a declarative framework (i.e., instantiating with a dict from yaml or json file).

  • The cmd() method that must be overwritten in each component subclass. The cmd() method should return either a string or a list of strings to fully define a SWAN command line instruction. A list of strings defines multiple command line instructions that are executed in sequence such as the INPGRID/READGRID components.

  • The render() method that constructs the command line instruction from the content returned from the cmd() method. The render() method is typically called inside the __call__ method of the config class to construct the specific command line instruction from that component, taking care of maximum line size, line break and line continuation.

Components are defined within the rompy.swan.components subpackage and render an entire SWAN command line specification. The following modules are available:

Subcomponents#

Subcomponents are defined within the rompy.swan.subcomponents subpackage and render part of a SWAN command line specification. They typically define specific arguments to one or more component. The following modules are available:

Interface#

Interface classes provide an interface between swan components and higher level objects such as TimeRange, Data and Grid objects. They are used inside the __call__ method of the config classes to pass instances of these objects to the appropriate components and define consistent parameters to the config after instantiating them.

rompy.swan.interface.DataInterface

SWAN forcing data interface.

rompy.swan.interface.BoundaryInterface

SWAN forcing boundary interface.

rompy.swan.interface.OutputInterface

Output group component with consistent times.

rompy.swan.interface.LockupInterface

Lockup group component with consistent times.

Types#

SWAN types provide valid values for a specific SWAN command line argument.