API Documentation#

Core Classes#

Model#

A model run.

It is intented to be model agnostic. It deals primarily with how the model is to be run, i.e. the period of the run and where the output is going. The actual configuration of the run is provided by the config object.

Further explanation is given in the rompy.core.Baseconfig docstring.

Config#

pydantic model rompy.core.config.BaseConfig[source]

Base class for model templates.

The template class provides the object that is used to set up the model configuration. When implemented for a given model, can move along a scale of complexity to suit the application.

In its most basic form, as implemented in this base object, it consists of path to a cookiecutter template with the class providing the context for the {{config}} values in that template. Note that any {{runtime}} values are filled from the ModelRun object.

If the template is a git repo, the checkout parameter can be used to specify a branch or tag and it will be cloned and used.

If the object is callable, it will be colled prior to rendering the template. This mechanism can be used to perform tasks such as fetching exteral data, or providing additional context to the template beyond the arguments provided by the user..

Show JSON schema
{
   "title": "BaseConfig",
   "description": "Base class for model templates.\n\nThe template class provides the object that is used to set up the model configuration.\nWhen implemented for a given model, can move along a scale of complexity\nto suit the application.\n\nIn its most basic form, as implemented in this base object, it consists of path to a cookiecutter template\nwith the class providing the context for the {{config}} values in that template. Note that any\n{{runtime}} values are filled from the ModelRun object.\n\nIf the template is a git repo, the checkout parameter can be used to specify a branch or tag and it\nwill be cloned and used.\n\nIf the object is callable, it will be colled prior to rendering the template. This mechanism can be\nused to perform tasks such as fetching exteral data, or providing additional context to the template\nbeyond the arguments provided by the user..",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "base",
         "default": "base",
         "title": "Model Type",
         "type": "string"
      },
      "template": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/rompy/templates/base",
         "description": "The path to the model template",
         "title": "Template"
      },
      "checkout": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "main",
         "description": "The git branch to use if the template is a git repo",
         "title": "Checkout"
      }
   },
   "additionalProperties": true
}

Fields:
  • checkout (str | None)

  • model_type (Literal['base'])

  • template (str | None)

field checkout: str | None = 'main'

The git branch to use if the template is a git repo

field model_type: Literal['base'] = 'base'
field template: str | None = '/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/rompy/templates/base'

The path to the model template

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

Time#

pydantic model rompy.core.time.TimeRange[source]

A time range object

Examples

>>> from rompy import TimeRange
>>> tr = TimeRange(start="2020-01-01", end="2020-01-02")
>>> tr
TimeRange(start=datetime.datetime(2020, 1, 1, 0, 0), end=datetime.datetime(2020, 1, 2, 0, 0), duration=None, interval=None, include_end=True)
>>> tr = TimeRange(start="2020-01-01", duration="1d")
>>> tr
TimeRange(start=datetime.datetime(2020, 1, 1, 0, 0), end=datetime.datetime(2020, 1, 2, 0, 0), duration=timedelta(days=1), interval=None, include_end=True)
>>> tr = TimeRange(start="2020-01-01", duration="1d", interval="1h")
>>> tr
TimeRange(start=datetime.datetime(2020, 1, 1, 0, 0), end=None, duration=timedelta(days=1), interval=timedelta(hours=1), include_end=True)

Show JSON schema
{
   "title": "TimeRange",
   "description": "A time range object\n\nExamples\n--------\n>>> from rompy import TimeRange\n>>> tr = TimeRange(start=\"2020-01-01\", end=\"2020-01-02\")\n>>> tr\nTimeRange(start=datetime.datetime(2020, 1, 1, 0, 0), end=datetime.datetime(2020, 1, 2, 0, 0), duration=None, interval=None, include_end=True)\n>>> tr = TimeRange(start=\"2020-01-01\", duration=\"1d\")\n>>> tr\nTimeRange(start=datetime.datetime(2020, 1, 1, 0, 0), end=datetime.datetime(2020, 1, 2, 0, 0), duration=timedelta(days=1), interval=None, include_end=True)\n>>> tr = TimeRange(start=\"2020-01-01\", duration=\"1d\", interval=\"1h\")\n>>> tr\nTimeRange(start=datetime.datetime(2020, 1, 1, 0, 0), end=None, duration=timedelta(days=1), interval=timedelta(hours=1), include_end=True)",
   "type": "object",
   "properties": {
      "start": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The start date of the time range",
         "examples": [
            "2020-01-01"
         ],
         "title": "Start"
      },
      "end": {
         "anyOf": [
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The end date of the time range",
         "examples": [
            "2020-01-02"
         ],
         "title": "End"
      },
      "duration": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "format": "duration",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The duration of the time range",
         "examples": [
            "1d"
         ],
         "title": "Duration"
      },
      "interval": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "format": "duration",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "1h",
         "description": "The frequency of the time range",
         "examples": [
            "1h",
            "'1h'"
         ],
         "title": "Interval"
      },
      "include_end": {
         "default": true,
         "description": "Determines if the end date should be included in the range",
         "title": "Include End",
         "type": "boolean"
      }
   }
}

Fields:
  • duration (str | datetime.timedelta | None)

  • end (datetime.datetime | None)

  • include_end (bool)

  • interval (str | datetime.timedelta | None)

  • start (datetime.datetime | None)

Validators:
  • parse_start_end_duration » all fields

  • valid_duration_interval » duration

  • valid_duration_interval » interval

  • validate_start_end » end

  • validate_start_end » start

  • validate_start_end_duration » all fields

field duration: str | timedelta | None = None

The duration of the time range

Validated by:
  • parse_start_end_duration

  • valid_duration_interval

  • validate_start_end_duration

field end: datetime | None = None

The end date of the time range

Validated by:
  • parse_start_end_duration

  • validate_start_end

  • validate_start_end_duration

field include_end: bool = True

Determines if the end date should be included in the range

Validated by:
  • parse_start_end_duration

  • validate_start_end_duration

field interval: str | timedelta | None = '1h'

The frequency of the time range

Validated by:
  • parse_start_end_duration

  • valid_duration_interval

  • validate_start_end_duration

field start: datetime | None = None

The start date of the time range

Validated by:
  • parse_start_end_duration

  • validate_start_end

  • validate_start_end_duration

common_times(date_range: TimeRange) list[datetime][source]
contains(date: datetime) bool[source]
contains_range(date_range: TimeRange) bool[source]
validator parse_start_end_duration  »  all fields[source]
serialize_model() dict[source]
validator valid_duration_interval  »  duration, interval[source]
validator validate_start_end  »  start, end[source]
validator validate_start_end_duration  »  all fields[source]
property date_range: list[datetime]

Grid#

pydantic model rompy.core.grid.BaseGrid[source]

Representation of a grid in geographic space.

This is the base class for all Grid objects. The minimum representation of a grid are two NumPy array’s representing the vertices or nodes of some structured or unstructured grid, its bounding box and a boundary polygon. No knowledge of the grid connectivity is expected.

Show JSON schema
{
   "title": "BaseGrid",
   "description": "Representation of a grid in geographic space.\n\nThis is the base class for all Grid objects. The minimum representation of a grid\nare two NumPy array's representing the vertices or nodes of some structured or\nunstructured grid, its bounding box and a boundary polygon. No knowledge of the\ngrid connectivity is expected.",
   "type": "object",
   "properties": {
      "grid_type": {
         "const": "base",
         "default": "base",
         "title": "Grid Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field grid_type: Literal['base'] = 'base'
bbox(buffer=0.0) Bbox[source]

Returns a bounding box for the spatial grid

This function returns a list [ll_x, ll_y, ur_x, ur_y] where ll_x, ll_y (ur_x, ur_y) are the lower left (upper right) x and y coordinates bounding box of the model domain

boundary(tolerance=0.2) Polygon[source]

Returns the convex hull boundary polygon from the grid.

Parameters:

tolerance (float) – Simplify polygon shape based on maximum distance from original geometry, see https://shapely.readthedocs.io/en/stable/manual.html#object.simplify.

Returns:

polygon – See https://shapely.readthedocs.io/en/stable/manual.html#Polygon

Return type:

shapely.Polygon

boundary_points(spacing=None, tolerance=0.2) tuple[source]

Returns array of coordinates from boundary polygon.

Parameters:
  • tolerance (float) – Simplify polygon shape based on maximum distance from original geometry, see https://shapely.readthedocs.io/en/stable/manual.html#object.simplify.

  • spacing (float) – If specified, points are returned evenly spaced along the boundary at the specified spacing, otherwise all points are returned.

  • Returns

  • --------

  • points (tuple) – Tuple of x and y coordinates of the boundary points.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

plot(ax=None, figsize=None, fscale=10, buffer=0.1, borders=True, land=True, coastline=True)[source]

Plot the grid

property maxx: float
property maxy: float
property minx: float
property miny: float
property x: ndarray
property y: ndarray
pydantic model rompy.core.grid.RegularGrid[source]

Regular grid in geographic space.

This object provides an abstract representation of a regular grid in some geographic space.

Show JSON schema
{
   "title": "RegularGrid",
   "description": "Regular grid in geographic space.\n\nThis object provides an abstract representation of a regular grid in some\ngeographic space.",
   "type": "object",
   "properties": {
      "grid_type": {
         "const": "regular",
         "default": "regular",
         "description": "Type of grid, must be 'regular'",
         "title": "Grid Type",
         "type": "string"
      },
      "x0": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "X coordinate of the grid origin",
         "title": "X0"
      },
      "y0": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Y coordinate of the grid origin",
         "title": "Y0"
      },
      "rot": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": 0.0,
         "description": "Rotation angle of the grid in degrees",
         "title": "Rot"
      },
      "dx": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Spacing between grid points in the x direction",
         "title": "Dx"
      },
      "dy": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Spacing between grid points in the y direction",
         "title": "Dy"
      },
      "nx": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of grid points in the x direction",
         "title": "Nx"
      },
      "ny": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of grid points in the y direction",
         "title": "Ny"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
field dx: float | None = None

Spacing between grid points in the x direction

Validated by:
field dy: float | None = None

Spacing between grid points in the y direction

Validated by:
field grid_type: Literal['regular'] = 'regular'

Type of grid, must be ‘regular’

Validated by:
field nx: int | None = None

Number of grid points in the x direction

Validated by:
field ny: int | None = None

Number of grid points in the y direction

Validated by:
field rot: float | None = 0.0

Rotation angle of the grid in degrees

Validated by:
field x0: float | None = None

X coordinate of the grid origin

Validated by:
field y0: float | None = None

Y coordinate of the grid origin

Validated by:
bbox(buffer=0.0) Bbox

Returns a bounding box for the spatial grid

This function returns a list [ll_x, ll_y, ur_x, ur_y] where ll_x, ll_y (ur_x, ur_y) are the lower left (upper right) x and y coordinates bounding box of the model domain

boundary(tolerance=0.2) Polygon

Returns the convex hull boundary polygon from the grid.

Parameters:

tolerance (float) – Simplify polygon shape based on maximum distance from original geometry, see https://shapely.readthedocs.io/en/stable/manual.html#object.simplify.

Returns:

polygon – See https://shapely.readthedocs.io/en/stable/manual.html#Polygon

Return type:

shapely.Polygon

boundary_points(spacing=None, tolerance=0.2) tuple

Returns array of coordinates from boundary polygon.

Parameters:
  • tolerance (float) – Simplify polygon shape based on maximum distance from original geometry, see https://shapely.readthedocs.io/en/stable/manual.html#object.simplify.

  • spacing (float) – If specified, points are returned evenly spaced along the boundary at the specified spacing, otherwise all points are returned.

  • Returns

  • --------

  • points (tuple) – Tuple of x and y coordinates of the boundary points.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator generate  »  all fields[source]

Generate the grid from the provided parameters.

plot(ax=None, figsize=None, fscale=10, buffer=0.1, borders=True, land=True, coastline=True)

Plot the grid

property maxx: float
property maxy: float
property minx: float
property miny: float
property x: ndarray
property xlen
property y: ndarray
property ylen

Data#

Rompy core data objects.

pydantic model rompy.core.data.DataBlob[source]

Data source for model ingestion.

Generic data source for files that either need to be copied to the model directory or linked if link is set to True.

Show JSON schema
{
   "title": "DataBlob",
   "description": "Data source for model ingestion.\n\nGeneric data source for files that either need to be copied to the model directory\nor linked if `link` is set to True.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "data_blob",
         "description": "Model type discriminator",
         "enum": [
            "data_blob",
            "data_link"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "id": {
         "default": "data",
         "description": "Unique identifier for this data source",
         "title": "Id",
         "type": "string"
      },
      "source": {
         "description": "URI of the data source, either a local file path or a remote uri",
         "title": "Source"
      },
      "link": {
         "default": false,
         "description": "Whether to create a symbolic link instead of copying the file",
         "title": "Link",
         "type": "boolean"
      }
   },
   "additionalProperties": false,
   "required": [
      "source"
   ]
}

Fields:
field id: str = 'data'

Unique identifier for this data source

field link: bool = False

Whether to create a symbolic link instead of copying the file

field model_type: Literal['data_blob', 'data_link'] = 'data_blob'

Model type discriminator

field source: AnyPath [Required]

URI of the data source, either a local file path or a remote uri

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

get(destdir: str | Path, name: str | None = None, *args, **kwargs) Path[source]

Copy or link the data source to a new directory.

Parameters:

destdir (str | Path) – The destination directory to copy or link the data source to.

Returns:

The path to the copied file or created symlink.

Return type:

Path

pydantic model rompy.core.data.DataGrid[source]

Data object for gridded source data.

Generic data object for xarray datasets that with gridded spatial dimensions

Note

The fields filter_grid and filter_time trigger updates to the crop filter from the grid and time range objects passed to the get method. This is useful for data sources that are not defined on the same grid as the model grid or the same time range as the model run.

Show JSON schema
{
   "title": "DataGrid",
   "description": "Data object for gridded source data.\n\nGeneric data object for xarray datasets that with gridded spatial dimensions\n\nNote\n----\nThe fields `filter_grid` and `filter_time` trigger updates to the crop filter from\nthe grid and time range objects passed to the get method. This is useful for data\nsources that are not defined on the same grid as the model grid or the same time\nrange as the model run.",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "grid",
         "default": "grid",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "id": {
         "default": "data",
         "description": "Unique identifier for this data source",
         "title": "Id",
         "type": "string"
      },
      "source": {
         "description": "Source reader, must return an xarray gridded dataset in the open method",
         "discriminator": {
            "mapping": {
               "csv": "#/$defs/SourceTimeseriesCSV",
               "datamesh": "#/$defs/SourceDatamesh",
               "file": "#/$defs/SourceFile",
               "intake": "#/$defs/SourceIntake",
               "wavespectra": "#/$defs/SourceWavespectra"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/SourceTimeseriesCSV"
            },
            {
               "$ref": "#/$defs/SourceDatamesh"
            },
            {
               "$ref": "#/$defs/SourceFile"
            },
            {
               "$ref": "#/$defs/SourceIntake"
            },
            {
               "$ref": "#/$defs/SourceWavespectra"
            }
         ],
         "title": "Source"
      },
      "link": {
         "default": false,
         "description": "Whether to create a symbolic link instead of copying the file",
         "title": "Link",
         "type": "boolean"
      },
      "filter": {
         "anyOf": [
            {
               "$ref": "#/$defs/Filter"
            },
            {
               "type": "null"
            }
         ],
         "description": "Optional filter specification to apply to the dataset"
      },
      "variables": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": [],
         "description": "Subset of variables to extract from the dataset",
         "title": "Variables"
      },
      "coords": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetCoords"
            },
            {
               "type": "null"
            }
         ],
         "default": {
            "t": "time",
            "x": "longitude",
            "y": "latitude",
            "z": "depth",
            "s": "site"
         },
         "description": "Names of the coordinates in the dataset"
      },
      "crop_data": {
         "default": true,
         "description": "Update crop filters from Grid and Time objects if passed to get method",
         "title": "Crop Data",
         "type": "boolean"
      },
      "buffer": {
         "default": 0.0,
         "description": "Space to buffer the grid bounding box if `filter_grid` is True",
         "title": "Buffer",
         "type": "number"
      },
      "time_buffer": {
         "default": [
            0,
            0
         ],
         "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
         "items": {
            "type": "integer"
         },
         "title": "Time Buffer",
         "type": "array"
      }
   },
   "$defs": {
      "DatasetCoords": {
         "additionalProperties": false,
         "description": "Coordinates representation.",
         "properties": {
            "t": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "time",
               "description": "Name of the time coordinate",
               "title": "T"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "longitude",
               "description": "Name of the x coordinate",
               "title": "X"
            },
            "y": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "latitude",
               "description": "Name of the y coordinate",
               "title": "Y"
            },
            "z": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "depth",
               "description": "Name of the z coordinate",
               "title": "Z"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "site",
               "description": "Name of the site coordinate",
               "title": "S"
            }
         },
         "title": "DatasetCoords",
         "type": "object"
      },
      "Filter": {
         "additionalProperties": false,
         "properties": {
            "sort": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Sort"
            },
            "subset": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Subset"
            },
            "crop": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Crop"
            },
            "timenorm": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Timenorm"
            },
            "rename": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Rename"
            },
            "derived": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Derived"
            }
         },
         "title": "Filter",
         "type": "object"
      },
      "SourceDatamesh": {
         "additionalProperties": false,
         "description": "Source dataset from Datamesh.\n\nDatamesh documentation: https://docs.oceanum.io/datamesh/index.html",
         "properties": {
            "model_type": {
               "const": "datamesh",
               "default": "datamesh",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "datasource": {
               "description": "The id of the datasource on Datamesh",
               "title": "Datasource",
               "type": "string"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Datamesh API token, taken from the environment if not provided",
               "title": "Token"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to `oceanum.datamesh.Connector`",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "datasource",
            "token"
         ],
         "title": "SourceDatamesh",
         "type": "object"
      },
      "SourceFile": {
         "additionalProperties": false,
         "description": "Source dataset from file to open with xarray.open_dataset.",
         "properties": {
            "model_type": {
               "const": "file",
               "default": "file",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to xarray.open_dataset",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri"
         ],
         "title": "SourceFile",
         "type": "object"
      },
      "SourceIntake": {
         "additionalProperties": false,
         "description": "Source dataset from intake catalog.\n\nnote\n----\nThe intake catalog can be prescribed either by the URI of an existing catalog file\nor by a YAML string defining the catalog. The YAML string can be obtained from\ncalling the `yaml()` method on an intake dataset instance.",
         "properties": {
            "model_type": {
               "const": "intake",
               "default": "intake",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "dataset_id": {
               "description": "The id of the dataset to read in the catalog",
               "title": "Dataset Id",
               "type": "string"
            },
            "catalog_uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URI of the catalog to read from",
               "title": "Catalog Uri"
            },
            "catalog_yaml": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The YAML string of the catalog to read from",
               "title": "Catalog Yaml"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to define intake dataset parameters",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "dataset_id"
         ],
         "title": "SourceIntake",
         "type": "object"
      },
      "SourceTimeseriesCSV": {
         "additionalProperties": false,
         "description": "Timeseries source class from CSV file.\n\nThis class should return a timeseries from a CSV file. The dataset variables are\ndefined from the column headers, therefore the appropriate read_csv kwargs must be\npassed to allow defining the columns. The time index is defined from column name\nidentified by the tcol field.",
         "properties": {
            "model_type": {
               "const": "csv",
               "default": "csv",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the csv file",
               "title": "Filename"
            },
            "tcol": {
               "default": "time",
               "description": "Name of the column containing the time data",
               "title": "Tcol",
               "type": "string"
            },
            "read_csv_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to pandas.read_csv",
               "title": "Read Csv Kwargs",
               "type": "object"
            }
         },
         "required": [
            "filename"
         ],
         "title": "SourceTimeseriesCSV",
         "type": "object"
      },
      "SourceWavespectra": {
         "additionalProperties": false,
         "description": "Wavespectra dataset from wavespectra reader.",
         "properties": {
            "model_type": {
               "const": "wavespectra",
               "default": "wavespectra",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "reader": {
               "description": "Name of the wavespectra reader to use, e.g., read_swan",
               "title": "Reader",
               "type": "string"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to the wavespectra reader",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri",
            "reader"
         ],
         "title": "SourceWavespectra",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "source"
   ]
}

Fields:
field buffer: float = 0.0

Space to buffer the grid bounding box if filter_grid is True

field coords: DatasetCoords | None = DatasetCoords(t='time', x='longitude', y='latitude', z='depth', s='site')

Names of the coordinates in the dataset

field crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

field filter: Filter | None [Optional]

Optional filter specification to apply to the dataset

field id: str = 'data'

Unique identifier for this data source

field link: bool = False

Whether to create a symbolic link instead of copying the file

field model_type: Literal['grid'] = 'grid'

Model type discriminator

field source: SourceTimeseriesCSV | SourceDatamesh | SourceFile | SourceIntake | SourceWavespectra [Required]

Source reader, must return an xarray gridded dataset in the open method

field time_buffer: list[int] = [0, 0]

Number of source data timesteps to buffer the time range if filter_time is True

field variables: list[str] | None = []

Subset of variables to extract from the dataset

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

get(destdir: str | Path, grid: BaseGrid | RegularGrid | None = None, time: TimeRange | None = None) Path

Write the data source to a new location.

Parameters:
  • destdir (str | Path) – The destination directory to write the netcdf data to.

  • grid (GRID_TYPES, optional) – The grid to filter the data to, only used if self.crop_data is True.

  • time (TimeRange, optional) – The times to filter the data to, only used if self.crop_data is True.

Returns:

outfile – The path to the written file.

Return type:

Path

plot(param, isel={}, model_grid=None, cmap='turbo', figsize=None, fscale=10, borders=True, land=True, coastline=True, **kwargs)[source]

Plot the grid.

property ds

Return the xarray dataset for this data source.

property outfile: str
pydantic model rompy.core.data.DataPoint[source]

Data object for timeseries source data.

Generic data object for xarray datasets that only have time as a dimension and do not need to be cropped to a specific grid.

Show JSON schema
{
   "title": "DataPoint",
   "description": "Data object for timeseries source data.\n\nGeneric data object for xarray datasets that only have time as a dimension and do\nnot need to be cropped to a specific grid.",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "point",
         "default": "point",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "id": {
         "default": "data",
         "description": "Unique identifier for this data source",
         "title": "Id",
         "type": "string"
      },
      "source": {
         "description": "Source reader, must return an xarray timeseries point dataset in the open method",
         "discriminator": {
            "mapping": {
               "csv": "#/$defs/SourceTimeseriesCSV"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/SourceTimeseriesCSV"
            }
         ],
         "title": "Source"
      },
      "link": {
         "default": false,
         "description": "Whether to create a symbolic link instead of copying the file",
         "title": "Link",
         "type": "boolean"
      },
      "filter": {
         "anyOf": [
            {
               "$ref": "#/$defs/Filter"
            },
            {
               "type": "null"
            }
         ],
         "description": "Optional filter specification to apply to the dataset"
      },
      "variables": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": [],
         "description": "Subset of variables to extract from the dataset",
         "title": "Variables"
      },
      "coords": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetCoords"
            },
            {
               "type": "null"
            }
         ],
         "default": {
            "t": "time",
            "x": "longitude",
            "y": "latitude",
            "z": "depth",
            "s": "site"
         },
         "description": "Names of the coordinates in the dataset"
      },
      "crop_data": {
         "default": true,
         "description": "Update crop filters from Grid and Time objects if passed to get method",
         "title": "Crop Data",
         "type": "boolean"
      },
      "buffer": {
         "default": 0.0,
         "description": "Space to buffer the grid bounding box if `filter_grid` is True",
         "title": "Buffer",
         "type": "number"
      },
      "time_buffer": {
         "default": [
            0,
            0
         ],
         "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
         "items": {
            "type": "integer"
         },
         "title": "Time Buffer",
         "type": "array"
      }
   },
   "$defs": {
      "DatasetCoords": {
         "additionalProperties": false,
         "description": "Coordinates representation.",
         "properties": {
            "t": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "time",
               "description": "Name of the time coordinate",
               "title": "T"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "longitude",
               "description": "Name of the x coordinate",
               "title": "X"
            },
            "y": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "latitude",
               "description": "Name of the y coordinate",
               "title": "Y"
            },
            "z": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "depth",
               "description": "Name of the z coordinate",
               "title": "Z"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "site",
               "description": "Name of the site coordinate",
               "title": "S"
            }
         },
         "title": "DatasetCoords",
         "type": "object"
      },
      "Filter": {
         "additionalProperties": false,
         "properties": {
            "sort": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Sort"
            },
            "subset": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Subset"
            },
            "crop": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Crop"
            },
            "timenorm": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Timenorm"
            },
            "rename": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Rename"
            },
            "derived": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Derived"
            }
         },
         "title": "Filter",
         "type": "object"
      },
      "SourceTimeseriesCSV": {
         "additionalProperties": false,
         "description": "Timeseries source class from CSV file.\n\nThis class should return a timeseries from a CSV file. The dataset variables are\ndefined from the column headers, therefore the appropriate read_csv kwargs must be\npassed to allow defining the columns. The time index is defined from column name\nidentified by the tcol field.",
         "properties": {
            "model_type": {
               "const": "csv",
               "default": "csv",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the csv file",
               "title": "Filename"
            },
            "tcol": {
               "default": "time",
               "description": "Name of the column containing the time data",
               "title": "Tcol",
               "type": "string"
            },
            "read_csv_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to pandas.read_csv",
               "title": "Read Csv Kwargs",
               "type": "object"
            }
         },
         "required": [
            "filename"
         ],
         "title": "SourceTimeseriesCSV",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "source"
   ]
}

Fields:
  • buffer (float)

  • coords (rompy.core.types.DatasetCoords | None)

  • crop_data (bool)

  • filter (rompy.core.filters.Filter | None)

  • id ()

  • link ()

  • model_type (Literal['point'])

  • source (rompy.core.source.SourceTimeseriesCSV)

  • time_buffer (list[int])

  • variables (list[str] | None)

field buffer: float = 0.0

Space to buffer the grid bounding box if filter_grid is True

field coords: DatasetCoords | None = DatasetCoords(t='time', x='longitude', y='latitude', z='depth', s='site')

Names of the coordinates in the dataset

field crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

field filter: Filter | None [Optional]

Optional filter specification to apply to the dataset

field id: str = 'data'

Unique identifier for this data source

field link: bool = False

Whether to create a symbolic link instead of copying the file

field model_type: Literal['point'] = 'point'

Model type discriminator

field source: SourceTimeseriesCSV [Required]

Source reader, must return an xarray timeseries point dataset in the open method

field time_buffer: list[int] = [0, 0]

Number of source data timesteps to buffer the time range if filter_time is True

field variables: list[str] | None = []

Subset of variables to extract from the dataset

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

get(destdir: str | Path, grid: BaseGrid | RegularGrid | None = None, time: TimeRange | None = None) Path[source]

Write the data source to a new location.

Parameters:
  • destdir (str | Path) – The destination directory to write the netcdf data to.

  • grid (GRID_TYPES, optional) – The grid to filter the data to, only used if self.crop_data is True.

  • time (TimeRange, optional) – The times to filter the data to, only used if self.crop_data is True.

Returns:

outfile – The path to the written file.

Return type:

Path

property ds

Return the xarray dataset for this data source.

property outfile: str

Filters#

pydantic model rompy.core.filters.Filter[source]

Show JSON schema
{
   "title": "Filter",
   "type": "object",
   "properties": {
      "sort": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": {},
         "title": "Sort"
      },
      "subset": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": {},
         "title": "Subset"
      },
      "crop": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": {},
         "title": "Crop"
      },
      "timenorm": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": {},
         "title": "Timenorm"
      },
      "rename": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": {},
         "title": "Rename"
      },
      "derived": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "type": "null"
            }
         ],
         "default": {},
         "title": "Derived"
      }
   },
   "additionalProperties": false
}

Fields:
  • crop (dict | None)

  • derived (dict | None)

  • rename (dict | None)

  • sort (dict | None)

  • subset (dict | None)

  • timenorm (dict | None)

Validators:
  • convert_slices » crop

field crop: dict | None = {}
Validated by:
  • convert_slices

field derived: dict | None = {}
field rename: dict | None = {}
field sort: dict | None = {}
field subset: dict | None = {}
field timenorm: dict | None = {}
validator convert_slices  »  crop[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

rompy.core.filters.crop_filter(ds, **data_slice) Dataset[source]

Crop dataset.

Parameters:
  • ds (xr.Dataset) – Input dataset to transform.

  • data_slice (Iterable) – Data slice to crop

Returns:

ds

Return type:

xr.Dataset

rompy.core.filters.derived_filter(ds, derived_variables)[source]

Add derived variable to Dataset.

Parameters:
  • ds (xarray.Dataset) – Input dataset to add derived variables to.

  • derived_variables (dict) – Mapping {derived_variable_name: derived_variable_definition} where derived_variable_definition is a string to be evaluated defining some transformation based on existing variables in the input dataset ds.

Returns:

ds – Input dataset with extra derived variables.

Return type:

xarray.Dataset

Example

>>> import xarray as xr
>>> ds = xr.DataArray([-10, -11], coords={"x": [0, 1]}).to_dataset(name="elevation")
>>> ds = derived_filter(ds, {"depth": "ds.elevation * -1"})
rompy.core.filters.get_filter_fns() dict[source]

Get dictionary of filter functions

rompy.core.filters.rename_filter(ds, **varmap) Dataset[source]

Rename variables in dataset

Parameters:
  • ds (xr.Dataset) – Input dataset to transform.

  • varmap (dict) – Dictionary of variable names to rename

Returns:

ds

Return type:

xr.Dataset

rompy.core.filters.subset_filter(ds, data_vars=None) Dataset[source]

Subset data variables from dataset.

Parameters:
  • ds (xr.Dataset) – Input dataset to transform.

  • data_vars (Iterable) – Variables to subset from ds.

Returns:

ds

Return type:

xr.Dataset

rompy.core.filters.timenorm_filter(ds, interval='hour', reftime=None) Dataset[source]

Normalize time to lead time in hours

Parameters:
  • ds (xr.Dataset) – Input dataset to transform.

  • interval (str, optional) – Time interval to normalize to, by default “hour”

  • reftime (str, optional) – Reference time variable, by default None

Returns:

ds

Return type:

xr.Dataset

Boundary#

rompy.core.render.find_template(repo_dir, env)[source]

Determine which child directory of repo_dir is the project template.

Parameters:

repo_dir – Local directory of newly cloned repo.

Returns project_template:

Relative path to project template.

rompy.core.render.repository_has_cookiecutter_json(repo_directory)[source]

Determine if repo_directory contains a cookiecutter.json file.

Parameters:

repo_directory – The candidate repository directory.

Returns:

True if the repo_directory is valid, else False.

Types#

Rompy types.

pydantic model rompy.core.types.Bbox[source]

Bounding box

Show JSON schema
{
   "title": "Bbox",
   "description": "Bounding box",
   "type": "object",
   "properties": {
      "minlon": {
         "$ref": "#/$defs/Longitude",
         "description": "Minimum longitude"
      },
      "minlat": {
         "$ref": "#/$defs/Latitude",
         "description": "Minimum latitude"
      },
      "maxlon": {
         "$ref": "#/$defs/Longitude",
         "description": "Maximum longitude"
      },
      "maxlat": {
         "$ref": "#/$defs/Latitude",
         "description": "Maximum latitude"
      }
   },
   "$defs": {
      "Latitude": {
         "description": "Latitude",
         "properties": {
            "lat": {
               "description": "Latitude",
               "maximum": 90,
               "minimum": -90,
               "title": "Lat",
               "type": "number"
            }
         },
         "required": [
            "lat"
         ],
         "title": "Latitude",
         "type": "object"
      },
      "Longitude": {
         "description": "Longitude",
         "properties": {
            "lon": {
               "description": "Longitude",
               "maximum": 180,
               "minimum": -180,
               "title": "Lon",
               "type": "number"
            }
         },
         "required": [
            "lon"
         ],
         "title": "Longitude",
         "type": "object"
      }
   },
   "required": [
      "minlon",
      "minlat",
      "maxlon",
      "maxlat"
   ]
}

Fields:
  • maxlat (rompy.core.types.Latitude)

  • maxlon (rompy.core.types.Longitude)

  • minlat (rompy.core.types.Latitude)

  • minlon (rompy.core.types.Longitude)

Validators:
  • validate_coords » all fields

field maxlat: Latitude [Required]

Maximum latitude

Validated by:
  • validate_coords

field maxlon: Longitude [Required]

Maximum longitude

Validated by:
  • validate_coords

field minlat: Latitude [Required]

Minimum latitude

Validated by:
  • validate_coords

field minlon: Longitude [Required]

Minimum longitude

Validated by:
  • validate_coords

contains(other)[source]
expand(amount)[source]
classmethod from_geojson(geojson)[source]
classmethod from_polygon(polygon)[source]
classmethod from_wkb(wkb)[source]
classmethod from_wkt(wkt)[source]
intersection(other)[source]
intersects(other)[source]
scale(amount)[source]
shrink(amount)[source]
to_geojson()[source]
to_wkb()[source]
to_wkt()[source]
translate(amount)[source]
union(other)[source]
validator validate_coords  »  all fields[source]
property area
property center
property height
property width
pydantic model rompy.core.types.Coordinate[source]

Coordinate

Show JSON schema
{
   "title": "Coordinate",
   "description": "Coordinate",
   "type": "object",
   "properties": {
      "lon": {
         "description": "Longitude",
         "title": "Lon",
         "type": "number"
      },
      "lat": {
         "description": "Latitude",
         "title": "Lat",
         "type": "number"
      }
   },
   "required": [
      "lon",
      "lat"
   ]
}

Fields:
  • lat (float)

  • lon (float)

Validators:
  • validate_lat » lat

  • validate_lon » lon

field lat: float [Required]

Latitude

Validated by:
  • validate_lat

field lon: float [Required]

Longitude

Validated by:
  • validate_lon

validator validate_lat  »  lat[source]
validator validate_lon  »  lon[source]
pydantic model rompy.core.types.DatasetCoords[source]

Coordinates representation.

Show JSON schema
{
   "title": "DatasetCoords",
   "description": "Coordinates representation.",
   "type": "object",
   "properties": {
      "t": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "time",
         "description": "Name of the time coordinate",
         "title": "T"
      },
      "x": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "longitude",
         "description": "Name of the x coordinate",
         "title": "X"
      },
      "y": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "latitude",
         "description": "Name of the y coordinate",
         "title": "Y"
      },
      "z": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "depth",
         "description": "Name of the z coordinate",
         "title": "Z"
      },
      "s": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "site",
         "description": "Name of the site coordinate",
         "title": "S"
      }
   },
   "additionalProperties": false
}

Fields:
  • s (str | None)

  • t (str | None)

  • x (str | None)

  • y (str | None)

  • z (str | None)

field s: str | None = 'site'

Name of the site coordinate

field t: str | None = 'time'

Name of the time coordinate

field x: str | None = 'longitude'

Name of the x coordinate

field y: str | None = 'latitude'

Name of the y coordinate

field z: str | None = 'depth'

Name of the z coordinate

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

pydantic model rompy.core.types.Latitude[source]

Latitude

Show JSON schema
{
   "title": "Latitude",
   "description": "Latitude",
   "type": "object",
   "properties": {
      "lat": {
         "description": "Latitude",
         "maximum": 90,
         "minimum": -90,
         "title": "Lat",
         "type": "number"
      }
   },
   "required": [
      "lat"
   ]
}

Fields:
  • lat (float)

Validators:
  • validate_lat » lat

field lat: float [Required]

Latitude

Constraints:
  • ge = -90

  • le = 90

Validated by:
  • validate_lat

validator validate_lat  »  lat[source]
pydantic model rompy.core.types.Longitude[source]

Longitude

Show JSON schema
{
   "title": "Longitude",
   "description": "Longitude",
   "type": "object",
   "properties": {
      "lon": {
         "description": "Longitude",
         "maximum": 180,
         "minimum": -180,
         "title": "Lon",
         "type": "number"
      }
   },
   "required": [
      "lon"
   ]
}

Fields:
  • lon (float)

Validators:
  • validate_lon » lon

field lon: float [Required]

Longitude

Constraints:
  • ge = -180

  • le = 180

Validated by:
  • validate_lon

validator validate_lon  »  lon[source]
pydantic model rompy.core.types.RompyBaseModel[source]

Show JSON schema
{
   "title": "RompyBaseModel",
   "type": "object",
   "properties": {},
   "additionalProperties": false
}

dump_inputs_dict() dict[source]

Return the original inputs as a dictionary.

dump_inputs_json() str[source]

Return the original inputs as a JSON string.

pydantic model rompy.core.types.Slice[source]

Basic float or datetime slice representation

Show JSON schema
{
   "title": "Slice",
   "description": "Basic float or datetime slice representation",
   "type": "object",
   "properties": {
      "start": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Slice start",
         "title": "Start"
      },
      "stop": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "format": "date-time",
               "type": "string"
            },
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Slice stop",
         "title": "Stop"
      }
   }
}

Fields:
  • start (float | datetime.datetime | str | None)

  • stop (float | datetime.datetime | str | None)

field start: float | datetime | str | None = None

Slice start

field stop: float | datetime | str | None = None

Slice stop

classmethod from_dict(d: dict)[source]
classmethod from_slice(s: slice)[source]
to_slice() slice[source]
pydantic model rompy.core.types.Spectrum[source]

A class to represent a wave spectrum.

Show JSON schema
{
   "title": "Spectrum",
   "description": "A class to represent a wave spectrum.",
   "type": "object",
   "properties": {
      "fmin": {
         "default": 0.0464,
         "description": "Minimum frequency in Hz",
         "title": "Fmin",
         "type": "number"
      },
      "fmax": {
         "default": 1.0,
         "description": "Maximum frequency in Hz",
         "title": "Fmax",
         "type": "number"
      },
      "nfreqs": {
         "default": 31,
         "description": "Number of frequency components",
         "title": "Nfreqs",
         "type": "integer"
      },
      "ndirs": {
         "default": 36,
         "description": "Number of directional components",
         "title": "Ndirs",
         "type": "integer"
      }
   },
   "additionalProperties": false
}

Fields:
  • fmax (float)

  • fmin (float)

  • ndirs (int)

  • nfreqs (int)

field fmax: float = 1.0

Maximum frequency in Hz

field fmin: float = 0.0464

Minimum frequency in Hz

field ndirs: int = 36

Number of directional components

field nfreqs: int = 31

Number of frequency components

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

Swan classes#

Config#

pydantic model rompy.swan.config.SwanConfig[source]

SWAN configuration

Show JSON schema
{
   "title": "SwanConfig",
   "description": "SWAN configuration",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "swan",
         "default": "swan",
         "description": "The model type for SWAN.",
         "title": "Model Type",
         "type": "string"
      },
      "template": {
         "default": "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/rompy/templates/swan",
         "description": "The template for SWAN.",
         "title": "Template",
         "type": "string"
      },
      "checkout": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "main",
         "description": "The git branch to use if the template is a git repo",
         "title": "Checkout"
      },
      "grid": {
         "$ref": "#/$defs/SwanGrid",
         "description": "The model grid for the SWAN run"
      },
      "spectral_resolution": {
         "$ref": "#/$defs/SwanSpectrum",
         "default": {
            "fmin": 0.0464,
            "fmax": 1.0,
            "nfreqs": 31,
            "ndirs": 36
         },
         "description": "The spectral resolution for SWAN."
      },
      "forcing": {
         "$ref": "#/$defs/ForcingData",
         "default": {
            "bottom": null,
            "wind": null,
            "current": null,
            "boundary": null
         },
         "description": "The forcing data for SWAN."
      },
      "physics": {
         "$ref": "#/$defs/SwanPhysics",
         "default": {
            "friction": "MAD",
            "friction_coeff": 0.1
         },
         "description": "The physics options for SWAN."
      },
      "outputs": {
         "$ref": "#/$defs/Outputs",
         "default": {
            "grid": {
               "period": null,
               "variables": [
                  "DEPTH",
                  "UBOT",
                  "HSIGN",
                  "HSWELL",
                  "DIR",
                  "TPS",
                  "TM01",
                  "WIND"
               ]
            },
            "spec": {
               "locations": {
                  "coords": []
               },
               "period": null
            }
         },
         "description": "The outputs for SWAN."
      },
      "spectra_file": {
         "default": "boundary.spec",
         "description": "The spectra file for SWAN.",
         "title": "Spectra File",
         "type": "string"
      }
   },
   "$defs": {
      "Boundnest1": {
         "additionalProperties": false,
         "description": "SWAN BOUNDNEST1 NEST data class.",
         "properties": {
            "model_type": {
               "default": "boundnest1",
               "description": "Model type discriminator",
               "enum": [
                  "boundnest1",
                  "BOUNDNEST1"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "id": {
               "description": "Unique identifier for this data source",
               "title": "Id",
               "type": "string"
            },
            "source": {
               "description": "Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method",
               "discriminator": {
                  "mapping": {
                     "csv": "#/$defs/SourceTimeseriesCSV",
                     "datamesh": "#/$defs/SourceDatamesh",
                     "file": "#/$defs/SourceFile",
                     "intake": "#/$defs/SourceIntake",
                     "wavespectra": "#/$defs/SourceWavespectra"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/SourceTimeseriesCSV"
                  },
                  {
                     "$ref": "#/$defs/SourceDatamesh"
                  },
                  {
                     "$ref": "#/$defs/SourceFile"
                  },
                  {
                     "$ref": "#/$defs/SourceIntake"
                  },
                  {
                     "$ref": "#/$defs/SourceWavespectra"
                  }
               ],
               "title": "Source"
            },
            "link": {
               "default": false,
               "description": "Whether to create a symbolic link instead of copying the file",
               "title": "Link",
               "type": "boolean"
            },
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Filter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Optional filter specification to apply to the dataset"
            },
            "variables": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": [],
               "description": "Subset of variables to extract from the dataset",
               "title": "Variables"
            },
            "coords": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetCoords"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "t": "time",
                  "x": "longitude",
                  "y": "latitude",
                  "z": "depth",
                  "s": "site"
               },
               "description": "Names of the coordinates in the dataset"
            },
            "crop_data": {
               "default": true,
               "description": "Update crop filter from Time object if passed to get method",
               "title": "Crop Data",
               "type": "boolean"
            },
            "buffer": {
               "default": 2.0,
               "description": "Space to buffer the grid bounding box if `filter_grid` is True",
               "title": "Buffer",
               "type": "number"
            },
            "time_buffer": {
               "default": [
                  0,
                  0
               ],
               "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
               "items": {
                  "type": "integer"
               },
               "title": "Time Buffer",
               "type": "array"
            },
            "spacing": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "const": "parent",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the `get` method. If 'parent', the resolution of the parent dataset is used to define the spacing.",
               "title": "Spacing"
            },
            "sel_method": {
               "default": "idw",
               "description": "Wavespectra method to use for selecting boundary points from the dataset",
               "enum": [
                  "idw",
                  "nearest"
               ],
               "title": "Sel Method",
               "type": "string"
            },
            "sel_method_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments for sel_method",
               "title": "Sel Method Kwargs",
               "type": "object"
            },
            "grid_type": {
               "const": "boundary_wave_station",
               "default": "boundary_wave_station",
               "description": "Model type discriminator",
               "title": "Grid Type",
               "type": "string"
            },
            "rectangle": {
               "default": "closed",
               "description": "Defines whether boundary is defined over an closed or open rectangle",
               "enum": [
                  "closed",
                  "open"
               ],
               "title": "Rectangle",
               "type": "string"
            }
         },
         "required": [
            "id",
            "source"
         ],
         "title": "Boundnest1",
         "type": "object"
      },
      "Coordinate": {
         "description": "Coordinate",
         "properties": {
            "lon": {
               "description": "Longitude",
               "title": "Lon",
               "type": "number"
            },
            "lat": {
               "description": "Latitude",
               "title": "Lat",
               "type": "number"
            }
         },
         "required": [
            "lon",
            "lat"
         ],
         "title": "Coordinate",
         "type": "object"
      },
      "DatasetCoords": {
         "additionalProperties": false,
         "description": "Coordinates representation.",
         "properties": {
            "t": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "time",
               "description": "Name of the time coordinate",
               "title": "T"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "longitude",
               "description": "Name of the x coordinate",
               "title": "X"
            },
            "y": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "latitude",
               "description": "Name of the y coordinate",
               "title": "Y"
            },
            "z": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "depth",
               "description": "Name of the z coordinate",
               "title": "Z"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "site",
               "description": "Name of the site coordinate",
               "title": "S"
            }
         },
         "title": "DatasetCoords",
         "type": "object"
      },
      "Filter": {
         "additionalProperties": false,
         "properties": {
            "sort": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Sort"
            },
            "subset": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Subset"
            },
            "crop": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Crop"
            },
            "timenorm": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Timenorm"
            },
            "rename": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Rename"
            },
            "derived": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Derived"
            }
         },
         "title": "Filter",
         "type": "object"
      },
      "ForcingData": {
         "additionalProperties": false,
         "description": "SWAN forcing data.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.forcing import ForcingData",
         "properties": {
            "bottom": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SwanDataGrid"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Bathymetry data"
            },
            "wind": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SwanDataGrid"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Wind input data"
            },
            "current": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SwanDataGrid"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Current input data"
            },
            "boundary": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Boundnest1"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Boundary input data"
            }
         },
         "title": "ForcingData",
         "type": "object"
      },
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "GridOutput": {
         "additionalProperties": false,
         "description": "Gridded outputs for SWAN",
         "properties": {
            "period": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRange"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "variables": {
               "default": [
                  "DEPTH",
                  "UBOT",
                  "HSIGN",
                  "HSWELL",
                  "DIR",
                  "TPS",
                  "TM01",
                  "WIND"
               ],
               "items": {
                  "type": "string"
               },
               "title": "Variables",
               "type": "array"
            }
         },
         "title": "GridOutput",
         "type": "object"
      },
      "OutputLocs": {
         "additionalProperties": false,
         "description": "Output locations",
         "properties": {
            "coords": {
               "default": [],
               "description": "list of coordinates to output spectra",
               "items": {
                  "$ref": "#/$defs/Coordinate"
               },
               "title": "Coords",
               "type": "array"
            }
         },
         "title": "OutputLocs",
         "type": "object"
      },
      "Outputs": {
         "additionalProperties": false,
         "description": "Outputs for SWAN",
         "properties": {
            "grid": {
               "$ref": "#/$defs/GridOutput",
               "default": {
                  "period": null,
                  "variables": [
                     "DEPTH",
                     "UBOT",
                     "HSIGN",
                     "HSWELL",
                     "DIR",
                     "TPS",
                     "TM01",
                     "WIND"
                  ]
               }
            },
            "spec": {
               "$ref": "#/$defs/SpecOutput",
               "default": {
                  "period": null,
                  "locations": {
                     "coords": []
                  }
               }
            }
         },
         "title": "Outputs",
         "type": "object"
      },
      "SourceDatamesh": {
         "additionalProperties": false,
         "description": "Source dataset from Datamesh.\n\nDatamesh documentation: https://docs.oceanum.io/datamesh/index.html",
         "properties": {
            "model_type": {
               "const": "datamesh",
               "default": "datamesh",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "datasource": {
               "description": "The id of the datasource on Datamesh",
               "title": "Datasource",
               "type": "string"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Datamesh API token, taken from the environment if not provided",
               "title": "Token"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to `oceanum.datamesh.Connector`",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "datasource",
            "token"
         ],
         "title": "SourceDatamesh",
         "type": "object"
      },
      "SourceFile": {
         "additionalProperties": false,
         "description": "Source dataset from file to open with xarray.open_dataset.",
         "properties": {
            "model_type": {
               "const": "file",
               "default": "file",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to xarray.open_dataset",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri"
         ],
         "title": "SourceFile",
         "type": "object"
      },
      "SourceIntake": {
         "additionalProperties": false,
         "description": "Source dataset from intake catalog.\n\nnote\n----\nThe intake catalog can be prescribed either by the URI of an existing catalog file\nor by a YAML string defining the catalog. The YAML string can be obtained from\ncalling the `yaml()` method on an intake dataset instance.",
         "properties": {
            "model_type": {
               "const": "intake",
               "default": "intake",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "dataset_id": {
               "description": "The id of the dataset to read in the catalog",
               "title": "Dataset Id",
               "type": "string"
            },
            "catalog_uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URI of the catalog to read from",
               "title": "Catalog Uri"
            },
            "catalog_yaml": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The YAML string of the catalog to read from",
               "title": "Catalog Yaml"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to define intake dataset parameters",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "dataset_id"
         ],
         "title": "SourceIntake",
         "type": "object"
      },
      "SourceTimeseriesCSV": {
         "additionalProperties": false,
         "description": "Timeseries source class from CSV file.\n\nThis class should return a timeseries from a CSV file. The dataset variables are\ndefined from the column headers, therefore the appropriate read_csv kwargs must be\npassed to allow defining the columns. The time index is defined from column name\nidentified by the tcol field.",
         "properties": {
            "model_type": {
               "const": "csv",
               "default": "csv",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the csv file",
               "title": "Filename"
            },
            "tcol": {
               "default": "time",
               "description": "Name of the column containing the time data",
               "title": "Tcol",
               "type": "string"
            },
            "read_csv_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to pandas.read_csv",
               "title": "Read Csv Kwargs",
               "type": "object"
            }
         },
         "required": [
            "filename"
         ],
         "title": "SourceTimeseriesCSV",
         "type": "object"
      },
      "SourceWavespectra": {
         "additionalProperties": false,
         "description": "Wavespectra dataset from wavespectra reader.",
         "properties": {
            "model_type": {
               "const": "wavespectra",
               "default": "wavespectra",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "reader": {
               "description": "Name of the wavespectra reader to use, e.g., read_swan",
               "title": "Reader",
               "type": "string"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to the wavespectra reader",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri",
            "reader"
         ],
         "title": "SourceWavespectra",
         "type": "object"
      },
      "SpecOutput": {
         "additionalProperties": false,
         "description": "Spectral outputs for SWAN",
         "properties": {
            "period": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRange"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Time range for which the spectral outputs are requested"
            },
            "locations": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/OutputLocs"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "coords": []
               },
               "description": "Output locations for which the spectral outputs are requested"
            }
         },
         "title": "SpecOutput",
         "type": "object"
      },
      "SwanDataGrid": {
         "additionalProperties": false,
         "description": "This class is used to write SWAN data from a dataset.",
         "properties": {
            "model_type": {
               "const": "grid",
               "default": "grid",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "id": {
               "default": "data",
               "description": "Unique identifier for this data source",
               "title": "Id",
               "type": "string"
            },
            "source": {
               "description": "Source reader, must return an xarray gridded dataset in the open method",
               "discriminator": {
                  "mapping": {
                     "csv": "#/$defs/SourceTimeseriesCSV",
                     "datamesh": "#/$defs/SourceDatamesh",
                     "file": "#/$defs/SourceFile",
                     "intake": "#/$defs/SourceIntake",
                     "wavespectra": "#/$defs/SourceWavespectra"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/SourceTimeseriesCSV"
                  },
                  {
                     "$ref": "#/$defs/SourceDatamesh"
                  },
                  {
                     "$ref": "#/$defs/SourceFile"
                  },
                  {
                     "$ref": "#/$defs/SourceIntake"
                  },
                  {
                     "$ref": "#/$defs/SourceWavespectra"
                  }
               ],
               "title": "Source"
            },
            "link": {
               "default": false,
               "description": "Whether to create a symbolic link instead of copying the file",
               "title": "Link",
               "type": "boolean"
            },
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Filter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Optional filter specification to apply to the dataset"
            },
            "variables": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": [],
               "description": "Subset of variables to extract from the dataset",
               "title": "Variables"
            },
            "coords": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetCoords"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "t": "time",
                  "x": "longitude",
                  "y": "latitude",
                  "z": "depth",
                  "s": "site"
               },
               "description": "Names of the coordinates in the dataset"
            },
            "crop_data": {
               "default": true,
               "description": "Update crop filters from Grid and Time objects if passed to get method",
               "title": "Crop Data",
               "type": "boolean"
            },
            "buffer": {
               "default": 0.0,
               "description": "Space to buffer the grid bounding box if `filter_grid` is True",
               "title": "Buffer",
               "type": "number"
            },
            "time_buffer": {
               "default": [
                  0,
                  0
               ],
               "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
               "items": {
                  "type": "integer"
               },
               "title": "Time Buffer",
               "type": "array"
            },
            "z1": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the data variable in dataset representing either a scaler parameter or the u-componet of a vector field",
               "title": "Z1"
            },
            "z2": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the data variable in dataset representing the v-componet of a vector field",
               "title": "Z2"
            },
            "var": {
               "$ref": "#/$defs/GridOptions",
               "description": "SWAN input grid name"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "title": "Fac",
               "type": "number"
            }
         },
         "required": [
            "source",
            "var"
         ],
         "title": "SwanDataGrid",
         "type": "object"
      },
      "SwanGrid": {
         "additionalProperties": false,
         "description": "Regular SWAN grid in geographic space.",
         "properties": {
            "grid_type": {
               "default": "REG",
               "description": "Type of grid (REG=regular, CURV=curvilinear)",
               "enum": [
                  "REG",
                  "CURV"
               ],
               "title": "Grid Type",
               "type": "string"
            },
            "x0": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "X coordinate of the grid origin",
               "title": "X0"
            },
            "y0": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Y coordinate of the grid origin",
               "title": "Y0"
            },
            "rot": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 0.0,
               "description": "Rotation angle of the grid in degrees",
               "title": "Rot"
            },
            "dx": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Spacing between grid points in the x direction",
               "title": "Dx"
            },
            "dy": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Spacing between grid points in the y direction",
               "title": "Dy"
            },
            "nx": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of grid points in the x direction",
               "title": "Nx"
            },
            "ny": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of grid points in the y direction",
               "title": "Ny"
            },
            "exc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Missing value",
               "title": "Exc"
            },
            "gridfile": {
               "anyOf": [
                  {
                     "maxLength": 36,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of grid file to load",
               "title": "Gridfile"
            }
         },
         "title": "SwanGrid",
         "type": "object"
      },
      "SwanPhysics": {
         "additionalProperties": false,
         "description": "Container class represting configuraable SWAN physics options",
         "properties": {
            "friction": {
               "default": "MAD",
               "description": "The type of friction, either MAD, COLL, JON or RIP",
               "title": "Friction",
               "type": "string"
            },
            "friction_coeff": {
               "default": 0.1,
               "description": "The coefficient of friction for the given surface and object.",
               "title": "Friction Coeff",
               "type": "number"
            }
         },
         "title": "SwanPhysics",
         "type": "object"
      },
      "SwanSpectrum": {
         "additionalProperties": false,
         "description": "SWAN Spectrum",
         "properties": {
            "fmin": {
               "default": 0.0464,
               "description": "Minimum frequency in Hz",
               "title": "Fmin",
               "type": "number"
            },
            "fmax": {
               "default": 1.0,
               "description": "Maximum frequency in Hz",
               "title": "Fmax",
               "type": "number"
            },
            "nfreqs": {
               "default": 31,
               "description": "Number of frequency components",
               "title": "Nfreqs",
               "type": "integer"
            },
            "ndirs": {
               "default": 36,
               "description": "Number of directional components",
               "title": "Ndirs",
               "type": "integer"
            }
         },
         "title": "SwanSpectrum",
         "type": "object"
      },
      "TimeRange": {
         "description": "A time range object\n\nExamples\n--------\n>>> from rompy import TimeRange\n>>> tr = TimeRange(start=\"2020-01-01\", end=\"2020-01-02\")\n>>> tr\nTimeRange(start=datetime.datetime(2020, 1, 1, 0, 0), end=datetime.datetime(2020, 1, 2, 0, 0), duration=None, interval=None, include_end=True)\n>>> tr = TimeRange(start=\"2020-01-01\", duration=\"1d\")\n>>> tr\nTimeRange(start=datetime.datetime(2020, 1, 1, 0, 0), end=datetime.datetime(2020, 1, 2, 0, 0), duration=timedelta(days=1), interval=None, include_end=True)\n>>> tr = TimeRange(start=\"2020-01-01\", duration=\"1d\", interval=\"1h\")\n>>> tr\nTimeRange(start=datetime.datetime(2020, 1, 1, 0, 0), end=None, duration=timedelta(days=1), interval=timedelta(hours=1), include_end=True)",
         "properties": {
            "start": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The start date of the time range",
               "examples": [
                  "2020-01-01"
               ],
               "title": "Start"
            },
            "end": {
               "anyOf": [
                  {
                     "format": "date-time",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The end date of the time range",
               "examples": [
                  "2020-01-02"
               ],
               "title": "End"
            },
            "duration": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "duration",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The duration of the time range",
               "examples": [
                  "1d"
               ],
               "title": "Duration"
            },
            "interval": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "duration",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "1h",
               "description": "The frequency of the time range",
               "examples": [
                  "1h",
                  "'1h'"
               ],
               "title": "Interval"
            },
            "include_end": {
               "default": true,
               "description": "Determines if the end date should be included in the range",
               "title": "Include End",
               "type": "boolean"
            }
         },
         "title": "TimeRange",
         "type": "object"
      }
   },
   "additionalProperties": true,
   "required": [
      "grid"
   ]
}

Fields:
  • checkout ()

  • forcing (rompy.swan.legacy.ForcingData)

  • grid (rompy.swan.grid.SwanGrid)

  • model_type (Literal['swan'])

  • outputs (rompy.swan.legacy.Outputs)

  • physics (rompy.swan.legacy.SwanPhysics)

  • spectra_file (str)

  • spectral_resolution (rompy.swan.legacy.SwanSpectrum)

  • template (str)

field checkout: str | None = 'main'

The git branch to use if the template is a git repo

field forcing: ForcingData = ForcingData(bottom=None, wind=None, current=None, boundary=None)

The forcing data for SWAN.

field grid: SwanGrid [Required]

The model grid for the SWAN run

field model_type: Literal['swan'] = 'swan'

The model type for SWAN.

field outputs: Outputs = Outputs(grid=GridOutput(period=None, variables=['DEPTH', 'UBOT', 'HSIGN', 'HSWELL', 'DIR', 'TPS', 'TM01', 'WIND']), spec=SpecOutput(period=None, locations=OutputLocs ))

The outputs for SWAN.

field physics: SwanPhysics = SwanPhysics(friction='MAD', friction_coeff=0.1)

The physics options for SWAN.

field spectra_file: str = 'boundary.spec'

The spectra file for SWAN.

field spectral_resolution: SwanSpectrum = SwanSpectrum(fmin=0.0464, fmax=1.0, nfreqs=31, ndirs=36)

The spectral resolution for SWAN.

field template: str = '/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/rompy/templates/swan'

The template for SWAN.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

property domain
pydantic model rompy.swan.config.SwanConfigComponents[source]

SWAN config class.

TODO: Combine boundary and inpgrid into a single input type.

Note

The cgrid is the only required field since it is used to define the swan grid object which is passed to other components.

Show JSON schema
{
   "title": "SwanConfigComponents",
   "description": "SWAN config class.\n\nTODO: Combine boundary and inpgrid into a single input type.\n\nNote\n----\nThe `cgrid` is the only required field since it is used to define the swan grid\nobject which is passed to other components.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "swanconfig",
         "description": "Model type discriminator",
         "enum": [
            "swanconfig",
            "SWANCONFIG"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "template": {
         "default": "/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/rompy/templates/swancomp",
         "description": "The template for SWAN.",
         "title": "Template",
         "type": "string"
      },
      "checkout": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "main",
         "description": "The git branch to use if the template is a git repo",
         "title": "Checkout"
      },
      "cgrid": {
         "description": "Cgrid component",
         "discriminator": {
            "mapping": {
               "CURVILINEAR": "#/$defs/rompy__swan__components__cgrid__CURVILINEAR",
               "REGULAR": "#/$defs/rompy__swan__components__cgrid__REGULAR",
               "curvilinear": "#/$defs/rompy__swan__components__cgrid__CURVILINEAR",
               "regular": "#/$defs/rompy__swan__components__cgrid__REGULAR",
               "unstructured": "#/$defs/rompy__swan__components__cgrid__UNSTRUCTURED"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/rompy__swan__components__cgrid__REGULAR"
            },
            {
               "$ref": "#/$defs/rompy__swan__components__cgrid__CURVILINEAR"
            },
            {
               "$ref": "#/$defs/rompy__swan__components__cgrid__UNSTRUCTURED"
            }
         ],
         "title": "Cgrid"
      },
      "startup": {
         "anyOf": [
            {
               "$ref": "#/$defs/STARTUP",
               "description": "Startup components"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "inpgrid": {
         "anyOf": [
            {
               "description": "Input grid components",
               "discriminator": {
                  "mapping": {
                     "DATA_INTERFACE": "#/$defs/DataInterface",
                     "data_interface": "#/$defs/DataInterface",
                     "inpgrids": "#/$defs/INPGRIDS"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/INPGRIDS"
                  },
                  {
                     "$ref": "#/$defs/DataInterface"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Inpgrid"
      },
      "boundary": {
         "anyOf": [
            {
               "description": "Boundary component",
               "discriminator": {
                  "mapping": {
                     "BOUNDARY_INTERFACE": "#/$defs/BoundaryInterface",
                     "BOUNDNEST1": "#/$defs/BOUNDNEST1",
                     "BOUNDNEST2": "#/$defs/BOUNDNEST2",
                     "BOUNDNEST3": "#/$defs/BOUNDNEST3",
                     "BOUNDSPEC": "#/$defs/BOUNDSPEC",
                     "boundary_interface": "#/$defs/BoundaryInterface",
                     "boundnest1": "#/$defs/BOUNDNEST1",
                     "boundnest2": "#/$defs/BOUNDNEST2",
                     "boundnest3": "#/$defs/BOUNDNEST3",
                     "boundspec": "#/$defs/BOUNDSPEC"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/BOUNDSPEC"
                  },
                  {
                     "$ref": "#/$defs/BOUNDNEST1"
                  },
                  {
                     "$ref": "#/$defs/BOUNDNEST2"
                  },
                  {
                     "$ref": "#/$defs/BOUNDNEST3"
                  },
                  {
                     "$ref": "#/$defs/BoundaryInterface"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Boundary"
      },
      "initial": {
         "anyOf": [
            {
               "$ref": "#/$defs/INITIAL",
               "description": "Initial component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "physics": {
         "anyOf": [
            {
               "$ref": "#/$defs/PHYSICS",
               "description": "Physics components"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "prop": {
         "anyOf": [
            {
               "$ref": "#/$defs/PROP",
               "description": "Propagation components"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "numeric": {
         "anyOf": [
            {
               "$ref": "#/$defs/NUMERIC",
               "description": "Numerics components"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "output": {
         "anyOf": [
            {
               "$ref": "#/$defs/OUTPUT",
               "description": "Output components"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "lockup": {
         "anyOf": [
            {
               "$ref": "#/$defs/LOCKUP",
               "description": "Output components"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "ABS": {
         "additionalProperties": false,
         "description": "Absolute frequency spectra.\n\n.. code-block:: text\n\n    ABS\n\nSpectra are computed as a function of absolute frequency, i.e., the frequency as\nmeasured in a fixed point.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.output import ABS\n    freq = ABS()\n    print(freq.render())",
         "properties": {
            "model_type": {
               "default": "abs",
               "description": "Model type discriminator",
               "enum": [
                  "abs",
                  "ABS"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "ABS",
         "type": "object"
      },
      "ACCUR": {
         "additionalProperties": false,
         "description": "Stop the iterative procedure.\n\n.. code-block:: text\n\n    ACCUR [drel] [dhoval] [dtoval] [npnts] ->STAT|NONSTAT [limiter]\n\nWith this option the user can influence the criterion for terminating the iterative\nprocedure in the SWAN computations (both stationary and non-stationary modes).\nSWAN stops the iterations if (a), (b) and (c) are all satisfied:\n\na) The change in the local significant wave height Hs from one iteration to the\n   next is less than (1) fraction `drel` of that height or (2) fraction `dhoval`\n   of the average Hs over all grid points.\n\nb) The change in the local mean wave period Tm01 from one iteration to the next is\n   less than (1) fraction `drel` of that period or (2) fraction `dtoval` of the\n   average mean wave period over all wet grid points.\n\nc) Conditions (a) and (b) are fulfilled in more than fraction `npnts%` of all wet\n   grid points.\n\nNote\n----\nThis command has become obsolete in SWAN 41.01. The command STOPC should be used.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import ACCUR\n    accur = ACCUR()\n    print(accur.render())\n    accur = ACCUR(\n        drel=0.01,\n        dhoval=0.02,\n        dtoval=0.02,\n        npnts=98.0,\n        mode=dict(model_type=\"nonstat\", mxitns=1),\n        limiter=0.1,\n    )\n    print(accur.render())",
         "properties": {
            "model_type": {
               "default": "accur",
               "description": "Model type discriminator",
               "enum": [
                  "accur",
                  "ACCUR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "drel": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum relative change in Hs or Tm01 from one iteration to the next (SWAN default: 0.02)",
               "title": "Drel"
            },
            "dhoval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Fraction of the average Hs over all wet grid points below which the the stopping criteria needs to be satisfied (SWAN default: 0.02)",
               "title": "Dhoval"
            },
            "dtoval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Fraction of the average Tm01 over all wet grid points below which the the stopping criteria needs to be satisfied (SWAN default: 0.02)",
               "title": "Dtoval"
            },
            "npnts": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 98)",
               "title": "Npnts"
            },
            "mode": {
               "anyOf": [
                  {
                     "discriminator": {
                        "mapping": {
                           "NONSTAT": "#/$defs/NONSTAT",
                           "STAT": "#/$defs/STAT",
                           "nonstat": "#/$defs/NONSTAT",
                           "stat": "#/$defs/STAT"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/STAT"
                        },
                        {
                           "$ref": "#/$defs/NONSTAT"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Termination criteria for stationary or nonstationary runs",
               "title": "Mode"
            },
            "limiter": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)",
               "title": "Limiter"
            }
         },
         "title": "ACCUR",
         "type": "object"
      },
      "BIN": {
         "additionalProperties": false,
         "description": "Single frequency bin spectral shape.\n\n.. code-block:: text\n\n    BIN\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import BIN\n    shape = BIN()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "bin",
               "description": "Model type discriminator",
               "enum": [
                  "bin",
                  "BIN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "BIN",
         "type": "object"
      },
      "BLOCK": {
         "additionalProperties": false,
         "description": "Write spatial distributions.\n\n.. code-block:: text\n\n    BLOCK 'sname' ->HEADER|NOHEADER 'fname' (LAYOUT [idla]) < output > &\n        [unit] (OUTPUT [tbegblk] [deltblk]) SEC|MIN|HR|DAY\n\nWith this optional command the user indicates that one or more spatial\ndistributions should be written to a file.\n\nNote\n----\nThe SWAN special frames 'BOTTGRID' or 'COMPGRID' can be set with the `sname` field.\n\nNote\n----\nThe text of the header indicates run identification (see command `PROJECT`), time,\nframe or group name ('sname'), variable and unit. The number of header lines is 8.\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import BLOCK\n    block = BLOCK(sname=\"outgrid\", fname=\"./depth-frame.nc\", output=[\"depth\"])\n    print(block.render())\n    block = BLOCK(\n        sname=\"COMPGRID\",\n        header=False,\n        fname=\"./output-grid.nc\",\n        idla=3,\n        output=[\"hsign\", \"hswell\", \"dir\", \"tps\", \"tm01\", \"watlev\", \"qp\"],\n        times=dict(\n            tbeg=\"2012-01-01T00:00:00\",\n            delt=\"PT30M\",\n            tfmt=1,\n            dfmt=\"min\",\n            suffix=\"\",\n        )\n    )\n    print(block.render())",
         "properties": {
            "model_type": {
               "default": "block",
               "description": "Model type discriminator",
               "enum": [
                  "block",
                  "BLOCK"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations in which the output is to be written",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the data file where the output is written to The file format is defined by the file extension, use `.mat` for MATLAB binary (single precision) or `.nc` for netCDF format. If any other extension is used the ASCII format is assumed",
               "title": "Fname",
               "type": "string"
            },
            "times": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRangeOpen"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Time specification if the user requires output at various times. If this option is not specified data will be written for the last time step of the computation"
            },
            "header": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicate if the output should be written to a file with header lines (SWAN default: True)",
               "title": "Header"
            },
            "idla": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/IDLA"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Prescribe the lay-out of the output to file (supported options here are 1, 3, 4). Option 4 is recommended for postprocessing an ASCII file by MATLAB, however option 3 is recommended in case of binary MATLAB output (SWAN default: 1)"
            },
            "output": {
               "description": "The output variables to output to block file",
               "items": {
                  "$ref": "#/$defs/BlockOptions"
               },
               "minItems": 1,
               "title": "Output",
               "type": "array"
            },
            "unit": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the scaling of the output. The program divides computed values by `unit` before writing to file, so the user should multiply the written value by `unit` to obtain the proper value. By default, if HEADER is selected, value is written as a 5 position integer. SWAN takes `unit` such that the largest number occurring in the block can be printed. If NOHEADER is selected, values are printed in floating-point format by default (`unit=1`)",
               "title": "Unit"
            }
         },
         "required": [
            "sname",
            "fname",
            "output"
         ],
         "title": "BLOCK",
         "type": "object"
      },
      "BLOCKS": {
         "additionalProperties": false,
         "description": "Write multiple spatial distributions.\n\n.. code-block:: text\n\n    BLOCK 'sname' ->HEADER|NOHEADER 'fname1' (LAYOUT [idla]) < output > &\n        [unit] (OUTPUT [tbegblk] [deltblk]) SEC|MIN|HR|DAY\n    BLOCK 'sname' ->HEADER|NOHEADER 'fname2' (LAYOUT [idla]) < output > &\n        [unit] (OUTPUT [tbegblk] [deltblk]) SEC|MIN|HR|DAY\n    ..\n\nThis component can be used to prescribe and render multiple BLOCK components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import BLOCK, BLOCKS\n    block1 = BLOCK(sname=\"outgrid\", fname=\"./depth.txt\", output=[\"depth\"])\n    block2 = BLOCK(sname=\"outgrid\", fname=\"./output.nc\", output=[\"hsign\", \"hswell\"])\n    blocks = BLOCKS(components=[block1, block2])\n    print(blocks.render())",
         "properties": {
            "model_type": {
               "const": "blocks",
               "default": "blocks",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "components": {
               "description": "BLOCK components",
               "items": {
                  "$ref": "#/$defs/BLOCK"
               },
               "title": "Components",
               "type": "array"
            }
         },
         "required": [
            "components"
         ],
         "title": "BLOCKS",
         "type": "object"
      },
      "BOUNDNEST1": {
         "additionalProperties": false,
         "description": "Boundary spectra from a coarser SWAN nest.\n\n.. code-block:: text\n\n    BOUNDNEST1 NEST 'fname' ->CLOSED|OPEN\n\nWith this optional command a nested SWAN run can be carried out with the boundary\nconditions obtained from a coarse grid SWAN run (generated in that previous SWAN\nrun with command NESTOUT). The spectral frequencies and directions of the coarse\ngrid run do not have to coincide with the frequencies and directions used in the\nnested SWAN run; SWAN will interpolate to these frequencies and directions in the\nnested run (see Section 2.6.3). To generate the nest boundary in the coarse grid\nrun, use command NGRID. For the nested run, use the command CGRID with identical\ngeographical information except the number of meshes (which will be much higher for\nthe nested run). This BOUNDNEST1 command is not available for 1D computations; in\nsuch cases the commands SPECOUT and BOUNDSPEC can be used for the same purpose. A\nnested SWAN run must use the same coordinate system as the coarse grid SWAN run.\nFor a curvilinear grid, it is advised to use the commands POINTS or CURVE and\nSPECOUT instead of NGRID and NESTOUT.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDNEST1\n    boundary = BOUNDNEST1(fname=\"boundary.swn\", rectangle=\"closed\")\n    print(boundary.render())",
         "properties": {
            "model_type": {
               "default": "boundnest1",
               "description": "Model type discriminator",
               "enum": [
                  "boundnest1",
                  "BOUNDNEST1"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the boundary conditions for the present run, created by the previous SWAN coarse grid run. This file is structured according to the rules given in Appendix D for 2D spectra",
               "maxLength": 36,
               "minLength": 1,
               "title": "Fname",
               "type": "string"
            },
            "rectangle": {
               "default": "closed",
               "description": "Boundary is defined over a closed (default) or an open rectangle. Boundary generated from the NESTOUT command is aways closed",
               "enum": [
                  "closed",
                  "open"
               ],
               "title": "Rectangle",
               "type": "string"
            }
         },
         "required": [
            "fname"
         ],
         "title": "BOUNDNEST1",
         "type": "object"
      },
      "BOUNDNEST2": {
         "additionalProperties": false,
         "description": "Boundary spectra from WAM.\n\n.. code-block:: text\n\n    BOUNDNEST2 WAMNEST 'fname' FREE|UNFORMATTED ->CRAY|WKSTAT [xgc] [ygc] [lwdate]\n\nWith this optional command (not fully tested) a nested SWAN run can be carried out\nwith the boundary conditions obtained from a coarse grid WAM run (WAM Cycle 4.5,\nsource code as distributed by the Max Planck Institute in Hamburg). The spectral\nfrequencies and directions of the coarse grid run do not have to coincide with the\nfrequencies and directions used in the nested SWAN run; SWAN will interpolate to\nthese frequencies and directions in the nested run (see Section 2.6.3). Note that\nSWAN will accept output of a WAM output location only if the SWAN grid point on the\nnest boundary lies within a rectangle between two consecutive WAM output locations\nwith a width equal to 0.1 times the distance between these output locations on\neither side of the line between these WAM output locations. This BOUNDNEST2 command\nis not available for 1D computations. Only boundary conditions generated by WAM\nCycle 4.5 can be read properly by SWAN. A nested SWAN run may use either Cartesian\nor spherical coordinates. A curvilinear grid may be used in the nested grid but the\nboundaries of this nest should conform to the rectangular course grid nest\nboundaries. WAM output files are unformatted (binary); this usually implies that\nWAM and SWAN have to run on the same computer. For those cases where WAM and SWAN\nrun on different types of machines (binary files do not transfer properly), the\noption FREE is available in this command. The distributed version of WAM does not\nsupport the required free format nesting output; WAM users who modify WAM such that\nit can make formatted output, must modify WAM such that the files made by WAM can\nbe read in free format, i.e. with at least a blank or comma between numbers.\n\nNote\n----\nthe contents of 'fname' file could look like:\n\n.. code-block:: text\n\n    CBO9212010000\n    CBO9212020000\n    CBO9212030000\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDNEST2\n    boundary = BOUNDNEST2(fname=\"boundary.wam\", format=\"cray\", lwdate=12)\n    print(boundary.render())",
         "properties": {
            "model_type": {
               "default": "boundnest2",
               "description": "Model type discriminator",
               "enum": [
                  "boundnest2",
                  "BOUNDNEST2"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "A file name that contains all the names of WAM files containing the nested boundary conditions in time-sequence (usually one file per day)",
               "maxLength": 36,
               "minLength": 1,
               "title": "Fname",
               "type": "string"
            },
            "format": {
               "description": "Format of the WAM file. `cray`: CRAY version of WAM, `wkstat`: WORKSTATION version of WAM, `free`: Free format (these files are not generated standard by WAM)",
               "enum": [
                  "cray",
                  "wkstat",
                  "free"
               ],
               "title": "Format",
               "type": "string"
            },
            "xgc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If SWAN is used with Cartesian coordinates: longitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `xgc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file",
               "title": "Xgc"
            },
            "ygc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If SWAN is used with Cartesian coordinates: latitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `ygc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file",
               "title": "Ygc"
            },
            "lwdate": {
               "default": 12,
               "description": "Length of character string for date-time as used in the WAM files. Possible values are: 10 (i.e. YYMMDDHHMM), 12 (i.e. YYMMDDHHMMSS) or 14 (i.e. YYYYMMDDHHMMSS) (SWAN default: `lwdate` = 12)",
               "enum": [
                  10,
                  12,
                  14
               ],
               "title": "Lwdate",
               "type": "integer"
            }
         },
         "required": [
            "fname",
            "format"
         ],
         "title": "BOUNDNEST2",
         "type": "object"
      },
      "BOUNDNEST3": {
         "additionalProperties": false,
         "description": "Boundary spectra from WAVEWATCHIII.\n\n.. code-block:: text\n\n    BOUNDNEST3 WW3 'fname' FREE|UNFORMATTED ->CLOSED|OPEN [xgc] [ygc]\n\nWith this optional command a nested SWAN run can be carried out with the boundary\nconditions obtained from a coarse grid WAVEWATCH III run. The spectral frequencies\nand directions of the coarse grid run do not have to coincide with the frequencies\nand directions used in the nested SWAN run; SWAN will interpolate to these\nfrequencies and directions in the nested run (see Section 2.6.3). The output files\nof WAVEWATCH III have to be created with the post-processor of WAVEWATCH III as\noutput transfer files (formatted or unformatted) with WW_3 OUTP (output type 1 sub\ntype 3) at the locations along the nest boundary (i.e. computational grid points in\nWAVEWATCH III). These locations are equal to the corner points of the SWAN nested\ngrid and optionally also distributed between the corner points of the SWAN nested\ngrid (the boundary of the WAVEWATCH III nested grid need not be closed and may\ncover land). The locations should be output by WAVEWATCH III in sequence (going\nalong the nest boundary, clockwise or counterclockwise). Note that SWAN will accept\noutput of a WAVEWATCH III output location only if the SWAN grid point on the nest\nboundary lies within a rectangle between two consecutive WAVEWATCH III output\nlocations with a width equal to 0.1 times the distance between these output\nlocations on either side of the line between these WAVEWATCH III output locations.\nThis BOUNDNEST3 command is not available for 1D computations. A nested SWAN run may\nuse either Cartesian or spherical coordinates. A curvilinear grid may be used in\nthe nested grid but the boundaries of this nest should conform to the rectangular\ncourse grid nest boundaries.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDNEST3\n    boundary = BOUNDNEST3(\n        fname=\"boundary.ww3\",\n        format=\"free\",\n        rectangle=\"closed\",\n    )\n    print(boundary.render())",
         "properties": {
            "model_type": {
               "default": "boundnest3",
               "description": "Model type discriminator",
               "enum": [
                  "boundnest3",
                  "BOUNDNEST3"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "The name of the file that contains the spectra computed by WAVEWATCH III",
               "maxLength": 36,
               "minLength": 1,
               "title": "Fname",
               "type": "string"
            },
            "format": {
               "description": "Format of the WW3 file. `unformatted`: The input WW3 files are binary, `free`: The input WW3 files are formatted",
               "enum": [
                  "unformatted",
                  "free"
               ],
               "title": "Format",
               "type": "string"
            },
            "rectangle": {
               "default": "closed",
               "description": "Boundary is defined over a closed (default) or an open rectangle. Boundary generated from the NESTOUT command is aways closed",
               "enum": [
                  "closed",
                  "open"
               ],
               "title": "Rectangle",
               "type": "string"
            },
            "xgc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If SWAN is used with Cartesian coordinates: longitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `xgc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file. ",
               "title": "Xgc"
            },
            "ygc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "If SWAN is used with Cartesian coordinates: latitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `ygc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file. ",
               "title": "Ygc"
            }
         },
         "required": [
            "fname",
            "format"
         ],
         "title": "BOUNDNEST3",
         "type": "object"
      },
      "BOUNDSPEC": {
         "additionalProperties": false,
         "description": "Boundary along sides or segment.\n\n.. code-block:: text\n\n    BOUNDSPEC ->SIDE|SEGMENT CONSTANT|VARIABLE PAR|FILE\n\nThis command BOUNDSPEC defines parametric spectra at the boundary. It consists of\ntwo parts, the first part defines the boundary side or segment where the spectra\nwill be given, the second part defines the spectral parameters of these spectra.\nNote that in fact only the incoming wave components of these spectra are used by\nSWAN. The fact that complete spectra are calculated at the model boundaries from\nthe spectral parameters should not be misinterpreted. Only the incoming components\nare effective in the computation.\n\nTODO: Add support for unstructured grid (k).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDSPEC\n    boundary = BOUNDSPEC(\n        shapespec=dict(model_type=\"shapespec\", shape=dict(model_type=\"pm\")),\n        location=dict(model_type=\"side\", side=\"west\", direction=\"ccw\"),\n        data=dict(model_type=\"constantpar\", hs=2, per=8, dir=270, dd=30),\n    )\n    print(boundary.render())\n    boundary = BOUNDSPEC(\n        shapespec=dict(model_type=\"shapespec\", shape=dict(model_type=\"pm\")),\n        location=dict(\n            model_type=\"segment\",\n            points=dict(model_type=\"ij\", i=[0, 0], j=[0, 3])\n        ),\n        data=dict(model_type=\"constantpar\", hs=2, per=8, dir=270, dd=30),\n    )\n    print(boundary.render())",
         "properties": {
            "model_type": {
               "default": "boundspec",
               "description": "Model type discriminator",
               "enum": [
                  "boundspec",
                  "BOUNDSPEC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "shapespec": {
               "$ref": "#/$defs/SHAPESPEC",
               "description": "Spectral shape specification"
            },
            "location": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SIDE"
                  },
                  {
                     "$ref": "#/$defs/SEGMENT"
                  }
               ],
               "description": "Location to apply the boundary",
               "title": "Location"
            },
            "data": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CONSTANTPAR"
                  },
                  {
                     "$ref": "#/$defs/CONSTANTFILE"
                  },
                  {
                     "$ref": "#/$defs/VARIABLEPAR"
                  },
                  {
                     "$ref": "#/$defs/VARIABLEFILE"
                  }
               ],
               "description": "Spectral data",
               "title": "Data"
            }
         },
         "required": [
            "location",
            "data"
         ],
         "title": "BOUNDSPEC",
         "type": "object"
      },
      "BRAGG": {
         "additionalProperties": false,
         "description": "Bragg scattering.\n\n.. code-block:: text\n\n    BRAGG [ibrag] [nreg] [cutoff]\n\nUsing this optional command, the user activates a source term to represent the\nscattering of waves due to changes in the small-scale bathymetry based on the\ntheory of Ardhuin and Herbers (2002). If this command is not used, SWAN will not\naccount for Bragg scattering.\n\nThe underlying process is related to the bed elevation spectrum that describes the\nrandom variability of the bathymetry at the scale of the wave length on top of a\nslowly varying depth. To input this spectrum in the model, two options are\navailable. One option is to read a spectrum from a file. This single bottom\nspectrum will subsequently be applied in all active grid points. The assumption\nbeing made here is that the inputted bottom is gently sloping. Note that the bottom\nspectrum must be given as a function of the wave number `k`.\n\nAnother option is to compute the spectrum by a Fourier transform from `x` to `k` of\nthe bed modulations around a computational grid point. First, one must define a\nsquare region with a fixed size around the grid point in order to perform the\nFourier transform. The size should correspond to a multiple of the wave length at\nwhich refraction is resolved (i.e. consistent with the mild slope assumption).\nNext, the amplitude modulation of the small-scale bathymetry is obtained by\nsubstracting a slowly varying bed level from the inputted high-resolution\nbathymetric data within this square region. Here, the smooth bed level is achieved\nusing a bilinear fit. During the computation, however, SWAN employs the gently\nsloping bed as the mean of the original bathymetry within the given square around\neach computational grid point. Finally, the corresponding bottom spectrum is\ncomputed with an FFT.\n\nNotes\n-----\nThe Bragg scattering source term to the action balance equation gives rise to a\nfairly stiff equation. The best remedy is to run SWAN in the nonstationary mode\nwith a relatively small time step or in the stationary mode with some under\nrelaxation (see command `NUM STAT [alfa]`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BRAGG\n    bragg = BRAGG(nreg=200)\n    print(bragg.render())\n    bragg = BRAGG(ibrag=1, nreg=200, cutoff=5.0)\n    print(bragg.render())",
         "properties": {
            "model_type": {
               "default": "bragg",
               "description": "Model type discriminator",
               "enum": [
                  "bragg",
                  "BRAGG"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ibrag": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)",
               "title": "Ibrag"
            },
            "nreg": {
               "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid",
               "title": "Nreg",
               "type": "integer"
            },
            "cutoff": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)",
               "title": "Cutoff"
            }
         },
         "required": [
            "nreg"
         ],
         "title": "BRAGG",
         "type": "object"
      },
      "BRAGG_FILE": {
         "additionalProperties": false,
         "description": "Bragg scattering with bottom spectrum from file.\n\n.. code-block:: text\n\n    BRAGG [ibrag] [nreg] [cutoff] FILE 'fname' [idla] [mkx] [mky] [dkx] [dky]\n\nThe bed elevation spectrum `FB(kx, ky)` is read from a file.\n\nNotes\n-----\nThis spectrum is taken to be uniform over the entire computational domain.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BRAGG_FILE\n    bragg = BRAGG_FILE(fname=\"bottom_spectrum.txt\", nreg=500, mkx=99, dkx=0.1)\n    print(bragg.render())\n    kwargs = dict(\n        ibrag=3,\n        nreg=500,\n        cutoff=5.0,\n        fname=\"bottom_spectrum.txt\",\n        mkx=99,\n        mky=149,\n        dkx=0.1,\n        dky=0.1,\n    )\n    bragg = BRAGG_FILE(**kwargs)\n    print(bragg.render())",
         "properties": {
            "model_type": {
               "default": "file",
               "description": "Model type discriminator",
               "enum": [
                  "file",
                  "FILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ibrag": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)",
               "title": "Ibrag"
            },
            "nreg": {
               "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid",
               "title": "Nreg",
               "type": "integer"
            },
            "cutoff": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)",
               "title": "Cutoff"
            },
            "fname": {
               "description": "Name of file containing the bottom spectrum",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            },
            "idla": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/IDLA"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Order in which the values should be given in the input files"
            },
            "mkx": {
               "description": "Number of cells in x-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)",
               "title": "Mkx",
               "type": "integer"
            },
            "mky": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of cells in y-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)(SWAN default: `mky = mkx`)",
               "title": "Mky"
            },
            "dkx": {
               "description": "Mesh size in x-direction of the wave number grid related to bottom spectrum (1/m)",
               "title": "Dkx",
               "type": "number"
            },
            "dky": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Mesh size in y-direction of the wave number grid related to bottom spectrum (1/m) (SWAN default: `dky = dkx`)",
               "title": "Dky"
            }
         },
         "required": [
            "nreg",
            "fname",
            "mkx",
            "dkx"
         ],
         "title": "BRAGG_FILE",
         "type": "object"
      },
      "BRAGG_FT": {
         "additionalProperties": false,
         "description": "Bragg scattering with bottom spectrum computed from FFT.\n\n.. code-block:: text\n\n    BRAGG [ibrag] [nreg] [cutoff] FT\n\nIf this keyword is present the bottom spectrum will be computed in each active\ngrid point using a Fast Fourier Transform (FFT).\n\nNotes\n-----\nThe depth in each computational grid point is computed as the average of the\ninputted (high-resolution) bed levels within the square region.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BRAGG_FT\n    bragg = BRAGG_FT(nreg=350)\n    print(bragg.render())\n    bragg = BRAGG_FT(ibrag=2, nreg=350, cutoff=5.0)\n    print(bragg.render())",
         "properties": {
            "model_type": {
               "default": "ft",
               "description": "Model type discriminator",
               "enum": [
                  "ft",
                  "FT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ibrag": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)",
               "title": "Ibrag"
            },
            "nreg": {
               "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid",
               "title": "Nreg",
               "type": "integer"
            },
            "cutoff": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)",
               "title": "Cutoff"
            }
         },
         "required": [
            "nreg"
         ],
         "title": "BRAGG_FT",
         "type": "object"
      },
      "BREAKING_BKD": {
         "additionalProperties": false,
         "description": "Variable wave breaking index.\n\n.. code-block:: text\n\n    BREAKING BKD [alpha] [gamma0] [a1] [a2] [a3]\n\nIndicates that the breaker index scales with both the bottom slope (`beta`)\nand the dimensionless depth (kd).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BREAKING_BKD\n    breaking = BREAKING_BKD()\n    print(breaking.render())\n    breaking = BREAKING_BKD(alpha=1.0, gamma0=0.54, a1=7.59, a2=-8.06, a3=8.09)\n    print(breaking.render())",
         "properties": {
            "model_type": {
               "default": "bkd",
               "description": "Model type discriminator",
               "enum": [
                  "bkd",
                  "BKD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)",
               "title": "Alpha"
            },
            "gamma0": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The reference $gamma$ for horizontal slopes (SWAN default: 0.54)",
               "title": "Gamma0"
            },
            "a1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "First tunable coefficient for the breaker index (SWAN default: 7.59)",
               "title": "A1"
            },
            "a2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Second tunable coefficient for the breaker index (SWAN default: -8.06)",
               "title": "A2"
            },
            "a3": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Third tunable coefficient for the breaker index (SWAN default: 8.09)",
               "title": "A3"
            }
         },
         "title": "BREAKING_BKD",
         "type": "object"
      },
      "BREAKING_CONSTANT": {
         "additionalProperties": false,
         "description": "Constant wave breaking index.\n\n.. code-block:: text\n\n    BREAKING CONSTANT [alpha] [gamma]\n\nIndicates that a constant breaker index is to be used.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BREAKING_CONSTANT\n    breaking = BREAKING_CONSTANT()\n    print(breaking.render())\n    breaking = BREAKING_CONSTANT(alpha=1.0, gamma=0.73)\n    print(breaking.render())",
         "properties": {
            "model_type": {
               "default": "constant",
               "description": "Model type discriminator",
               "enum": [
                  "constant",
                  "CONSTANT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)",
               "title": "Alpha"
            },
            "gamma": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The breaker index, i.e. the ratio of maximum individual wave height over depth (SWAN default: 0.73)",
               "title": "Gamma"
            }
         },
         "title": "BREAKING_CONSTANT",
         "type": "object"
      },
      "BSBT": {
         "additionalProperties": false,
         "description": "BSBT first order propagation scheme.\n\n.. code-block:: text\n\n    BSTB\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import BSBT\n    scheme = BSBT()\n    print(scheme.render())",
         "properties": {
            "model_type": {
               "default": "bsbt",
               "description": "Model type discriminator",
               "enum": [
                  "bsbt",
                  "BSBT"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "BSBT",
         "type": "object"
      },
      "BlockOptions": {
         "description": "Valid options for block output parameters.\n\nAttributes\n----------\nHSIGN: \"hsign\"\n    Significant wave height (in m).\nHSWELL: \"hswell\"\n    Swell wave height (in m).\nDIR: \"dir\"\n    Mean wave direction (in degrees).\nDPM: \"dpm\"\n    Mean wave direction at the peak frequency (in degrees).\nPDIR: \"pdir\"\n    Peak wave direction (in degrees).\nTDIR: \"tdir\"\n    Direction of energy transport (in degrees).\nTM01: \"tm01\"\n    Mean absolute wave period (in s).\nRTM01: \"rtm01\"\n    Mean relative wave period (in s).\nRTP: \"rtp\"\n    Peak period of the (relative frequency) variance density spectrum (in s).\nTPS: \"tps\"\n    Smoothed peak period (in s).\nPER: \"per\"\n    Mean absolute wave period (in s).\nRPER: \"rper\"\n    Mean relative wave period (in s).\nTMM10: \"tmm10\"\n    Mean absolute wave period (in s).\nRTMM10: \"rtmm10\"\n    Mean relative wave period (in s).\nTM02: \"tm02\"\n    Mean absolute zero-crossing period (in s).\nFSPR: \"fspr\"\n    The normalised width of the frequency spectrum.\nDSPR: \"dspr\"\n    Directional spreading of the waves (in degrees).\nQP: \"qp\"\n    Peakedness of the wave spectrum (dimensionless).\nDEPTH: \"depth\"\n    Water depth (in m).\nWATLEV: \"watlev\"\n    Water level (in m).\nBOTLEV: \"botlev\"\n    Bottom level (in m).\nVEL: \"vel\"\n    Current velocity (vector; in m/s).\nFRCOEF: \"frcoef\"\n    Friction coefficient (equal to `cfw` or `kn` in command `FRICTION`).\nWIND: \"wind\"\n    Wind velocity (vector; in m/s).\nAICE: \"aice\"\n    Ice concentration (as a fraction from 0 to 1).\nPROPAGAT: \"propagat\"\n    Sum of PROPXY, PROPTHETA and PROPSIGMA (in W/m2 or m2/s).\nPROPXY: \"propxy\"\n    Energy propagation in geographic space; sum of x- and y-direction\n    (in W/m2 or m2/s).\nPROPTHETA: \"proptheta\"\n    Energy propagation in theta space (in W/m2 or m2/s).\nPROPSIGMA: \"propsigma\"\n    Energy propagation in sigma space (in W/m2 or m2/s).\nGENERAT: \"generat\"\n    Total energy generation (in W/m2 or m2/s).\nGENWIND: \"genwind\"\n    Energy generation due to wind (in W/m2 or m2/s).\nREDIST: \"redist\"\n    Total energy redistribution (in W/m2 or m2/s).\nREDQUAD: \"redquad\"\n    Energy redistribution due to quadruplets (in W/m2 or m2/s).\nREDTRIAD: \"redtriad\"\n    Energy redistribution due to triads (in W/m2 or m2/s).\nDISSIP: \"dissip\"\n    Total energy dissipation (in W/m2 or m2/s).\nDISBOT: \"disbot\"\n    Energy dissipation due to bottom friction (in W/m2 or m2/s).\nDISSURF: \"dissurf\"\n    Energy dissipation due to surf breaking (in W/m2 or m2/s).\nDISWCAP: \"diswcap\"\n    Energy dissipation due to whitecapping (in W/m2 or m2/s).\nDISSWELL: \"disswell\"\n    Energy dissipation due to swell dissipation (in W/m2 or m2/s).\nDISVEG: \"disveg\"\n    Energy dissipation due to vegetation (in W/m2 or m2/s).\nDISMUD: \"dismud\"\n    Energy dissipation due to mud (in W/m2 or m2/s).\nDISICE: \"disice\"\n    Energy dissipation due to sea ice (in W/m2 or m2/s).\nRADSTR: \"radstr\"\n    Energy transfer between waves and currents due to radiation stress\n    (in W/m2 or m2/s).\nQB: \"qb\"\n    Fraction of breaking waves due to depth-induced breaking.\nTRANSP: \"transp\"\n    Transport of energy (vector; in W/m2 or m2/s).\nFORCE: \"force\"\n    Wave-induced force per unit surface area (vector; in N/m2).\nUBOT: \"ubot\"\n    The rms-value of the maxima of the orbital velocity near the bottom (in m/s).\nURMS: \"urms\"\n    The rms-value of the orbital velocity near the bottom (in m/s).\nTMBOT: \"tmbot\"\n    The bottom wave period (in s).\nWLENGTH: \"wlength\"\n    Average wave length (in m).\nLWAVP: \"lwavp\"\n    Peak wave length (in m).\nSTEEPNESS: \"steepness\"\n    Average wave steepness (dimensionless).\nBFI: \"bfi\"\n    Benjamin-Feir index (dimensionless).\nNPLANTS: \"nplants\"\n    Number of plants per square meter.\nDHSIGN: \"dhsign\"\n    Difference in significant wave height from the last two iterations (in m).\nDRTM01: \"drtm01\"\n    Difference in average wave period (RTM01) from the last two iterations (in s).\nLEAK: \"leak\"\n    Numerical loss of energy equal to `cthetaE(omega,theta)` across boundaries.\nTIME: \"time\"\n    Full date-time string as part of line used in TABLE only.\nTSEC: \"tsec\"\n    Time in seconds with respect to a reference time (see command QUANTITY).\nXP: \"xp\"\n    The x-coordinate in the problem coordinate system of the output location.\nYP: \"yp\"\n    The y-coordinate in the problem coordinate system of the output location.\nDIST: \"dist\"\n    If output has been requested along a curve then the distance along the curve\n    can be obtained with the command TABLE. DIST is the distance along the curve\n    measured from teh first point on the curve to the output location on the curve\n    in meters (also in the case of spherical coordinates).\nSETUP: \"setup\"\n    Set-up due to waves (in m).\nPTHSIGN: \"pthsign\"\n    Watershed partitions of the significant wave height (in m).\nPTRTP: \"ptrtp\"\n    Watershed partitions of the relative peak period (in s).\nPTWLEN: \"ptwlen\"\n    Watershed partitions of the average wave length (in m).\nPTDIR: \"ptdir\"\n    Watershed partitions of the peak wave direction (in degrees).\nPTDSPR: \"ptdspr\"\n    Watershed partitions of the directional spreading (in degrees).\nPTWFRAC: \"ptwfrac\"\n    Watershed partitions of the wind fraction (dimensionless).\nPTSTEEPNE: \"ptsteepne\"\n    Watershed partition of the wave steepness (dimensionless).\nPARTITION: \"partition\"\n    The raw spectral partition for wave system tracking post-processing.\n\nNote\n----\nEnergy given in W/m2 or m2/s depending on command SET.\n\nNote\n----\nUBOT and URMS required command `FRICTION` to be used. If friction is ignored in the\ncomputation, then one should use the command `FRICTION` with the value of the\nfriction set to zero (e.g., `FRICTION COLLINS 0`).",
         "enum": [
            "hsign",
            "hswell",
            "dir",
            "dpm",
            "pdir",
            "tdir",
            "tm01",
            "rtm01",
            "rtp",
            "tps",
            "per",
            "rper",
            "tmm10",
            "rtmm10",
            "tm02",
            "fspr",
            "dspr",
            "qp",
            "depth",
            "watlev",
            "botlev",
            "vel",
            "frcoef",
            "wind",
            "aice",
            "propagat",
            "propxy",
            "proptheta",
            "propsigma",
            "generat",
            "genwind",
            "redist",
            "redquad",
            "redtriad",
            "dissip",
            "disbot",
            "dissurf",
            "diswcap",
            "disswell",
            "disveg",
            "dismud",
            "disice",
            "radstr",
            "qb",
            "transp",
            "force",
            "ubot",
            "urms",
            "tmbot",
            "wlength",
            "lwavp",
            "steepness",
            "bfi",
            "nplants",
            "dhsign",
            "drtm01",
            "leak",
            "time",
            "tsec",
            "xp",
            "yp",
            "dist",
            "setup",
            "pthsign",
            "ptrtp",
            "ptwlen",
            "ptdir",
            "ptdspr",
            "ptwfrac",
            "ptsteepne",
            "partition"
         ],
         "title": "BlockOptions",
         "type": "string"
      },
      "BoundaryInterface": {
         "additionalProperties": false,
         "description": "SWAN forcing boundary interface.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.interface import BoundaryInterface",
         "properties": {
            "model_type": {
               "default": "boundary_interface",
               "description": "Model type discriminator",
               "enum": [
                  "boundary_interface",
                  "BOUNDARY_INTERFACE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "kind": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Boundnest1"
                  },
                  {
                     "$ref": "#/$defs/BoundspecSide"
                  },
                  {
                     "$ref": "#/$defs/BoundspecSegmentXY"
                  }
               ],
               "default": null,
               "description": "Boundary data object",
               "title": "Kind"
            }
         },
         "title": "BoundaryInterface",
         "type": "object"
      },
      "Boundnest1": {
         "additionalProperties": false,
         "description": "SWAN BOUNDNEST1 NEST data class.",
         "properties": {
            "model_type": {
               "default": "boundnest1",
               "description": "Model type discriminator",
               "enum": [
                  "boundnest1",
                  "BOUNDNEST1"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "id": {
               "description": "Unique identifier for this data source",
               "title": "Id",
               "type": "string"
            },
            "source": {
               "description": "Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method",
               "discriminator": {
                  "mapping": {
                     "csv": "#/$defs/SourceTimeseriesCSV",
                     "datamesh": "#/$defs/SourceDatamesh",
                     "file": "#/$defs/SourceFile",
                     "intake": "#/$defs/SourceIntake",
                     "wavespectra": "#/$defs/SourceWavespectra"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/SourceTimeseriesCSV"
                  },
                  {
                     "$ref": "#/$defs/SourceDatamesh"
                  },
                  {
                     "$ref": "#/$defs/SourceFile"
                  },
                  {
                     "$ref": "#/$defs/SourceIntake"
                  },
                  {
                     "$ref": "#/$defs/SourceWavespectra"
                  }
               ],
               "title": "Source"
            },
            "link": {
               "default": false,
               "description": "Whether to create a symbolic link instead of copying the file",
               "title": "Link",
               "type": "boolean"
            },
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Filter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Optional filter specification to apply to the dataset"
            },
            "variables": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": [],
               "description": "Subset of variables to extract from the dataset",
               "title": "Variables"
            },
            "coords": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetCoords"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "t": "time",
                  "x": "longitude",
                  "y": "latitude",
                  "z": "depth",
                  "s": "site"
               },
               "description": "Names of the coordinates in the dataset"
            },
            "crop_data": {
               "default": true,
               "description": "Update crop filter from Time object if passed to get method",
               "title": "Crop Data",
               "type": "boolean"
            },
            "buffer": {
               "default": 2.0,
               "description": "Space to buffer the grid bounding box if `filter_grid` is True",
               "title": "Buffer",
               "type": "number"
            },
            "time_buffer": {
               "default": [
                  0,
                  0
               ],
               "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
               "items": {
                  "type": "integer"
               },
               "title": "Time Buffer",
               "type": "array"
            },
            "spacing": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "const": "parent",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the `get` method. If 'parent', the resolution of the parent dataset is used to define the spacing.",
               "title": "Spacing"
            },
            "sel_method": {
               "default": "idw",
               "description": "Wavespectra method to use for selecting boundary points from the dataset",
               "enum": [
                  "idw",
                  "nearest"
               ],
               "title": "Sel Method",
               "type": "string"
            },
            "sel_method_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments for sel_method",
               "title": "Sel Method Kwargs",
               "type": "object"
            },
            "grid_type": {
               "const": "boundary_wave_station",
               "default": "boundary_wave_station",
               "description": "Model type discriminator",
               "title": "Grid Type",
               "type": "string"
            },
            "rectangle": {
               "default": "closed",
               "description": "Defines whether boundary is defined over an closed or open rectangle",
               "enum": [
                  "closed",
                  "open"
               ],
               "title": "Rectangle",
               "type": "string"
            }
         },
         "required": [
            "id",
            "source"
         ],
         "title": "Boundnest1",
         "type": "object"
      },
      "BoundspecSegmentXY": {
         "additionalProperties": false,
         "description": "SWAN BOUNDSPEC SEGMENT data class.\n\nTODO: Handle side definition on a rotated grid.\nTODO: Should SIDE VARIABE be supported?\nTODO: Support option to choose between mid-point or averaging?\nTODO: Does PAR need to be supported? Guess not as nonstationary isn't supported\nTODO: If SIDES, ensure continuous\n\nNote\n----\nSegments are defined from adjacent point locations so the order in which the points\nare defined is important. When using SIDES, please ensure SIDES are adjacent to\neach other and have correct directions (ccw or clockwise) accordint to the order in\nwhich each side is prescribed.\n\nNote\n----\nThe 'spec1d' file type is not supported yet.",
         "properties": {
            "model_type": {
               "default": "boundspecside",
               "description": "Model type discriminator",
               "enum": [
                  "boundspecside",
                  "BOUNDSPECSIDE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "id": {
               "description": "Unique identifier for this data source",
               "title": "Id",
               "type": "string"
            },
            "source": {
               "description": "Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method",
               "discriminator": {
                  "mapping": {
                     "csv": "#/$defs/SourceTimeseriesCSV",
                     "datamesh": "#/$defs/SourceDatamesh",
                     "file": "#/$defs/SourceFile",
                     "intake": "#/$defs/SourceIntake",
                     "wavespectra": "#/$defs/SourceWavespectra"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/SourceTimeseriesCSV"
                  },
                  {
                     "$ref": "#/$defs/SourceDatamesh"
                  },
                  {
                     "$ref": "#/$defs/SourceFile"
                  },
                  {
                     "$ref": "#/$defs/SourceIntake"
                  },
                  {
                     "$ref": "#/$defs/SourceWavespectra"
                  }
               ],
               "title": "Source"
            },
            "link": {
               "default": false,
               "description": "Whether to create a symbolic link instead of copying the file",
               "title": "Link",
               "type": "boolean"
            },
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Filter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Optional filter specification to apply to the dataset"
            },
            "variables": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": [],
               "description": "Subset of variables to extract from the dataset",
               "title": "Variables"
            },
            "coords": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetCoords"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "t": "time",
                  "x": "longitude",
                  "y": "latitude",
                  "z": "depth",
                  "s": "site"
               },
               "description": "Names of the coordinates in the dataset"
            },
            "crop_data": {
               "default": true,
               "description": "Update crop filter from Time object if passed to get method",
               "title": "Crop Data",
               "type": "boolean"
            },
            "buffer": {
               "default": 2.0,
               "description": "Space to buffer the grid bounding box if `filter_grid` is True",
               "title": "Buffer",
               "type": "number"
            },
            "time_buffer": {
               "default": [
                  0,
                  0
               ],
               "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
               "items": {
                  "type": "integer"
               },
               "title": "Time Buffer",
               "type": "array"
            },
            "spacing": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "const": "parent",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the `get` method. If 'parent', the resolution of the parent dataset is used to define the spacing.",
               "title": "Spacing"
            },
            "sel_method": {
               "default": "idw",
               "description": "Wavespectra method to use for selecting boundary points from the dataset",
               "enum": [
                  "idw",
                  "nearest"
               ],
               "title": "Sel Method",
               "type": "string"
            },
            "sel_method_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments for sel_method",
               "title": "Sel Method Kwargs",
               "type": "object"
            },
            "grid_type": {
               "const": "boundary_wave_station",
               "default": "boundary_wave_station",
               "description": "Model type discriminator",
               "title": "Grid Type",
               "type": "string"
            },
            "shapespec": {
               "$ref": "#/$defs/SHAPESPEC",
               "default": {
                  "model_type": "shapespec",
                  "shape": {
                     "gamma": 3.3,
                     "model_type": "jonswap"
                  },
                  "per_type": "peak",
                  "dspr_type": "degrees"
               },
               "description": "Spectral shape specification"
            },
            "variable": {
               "default": false,
               "description": "Whether the spectra can vary along the side",
               "title": "Variable",
               "type": "boolean"
            },
            "file_type": {
               "default": "tpar",
               "description": "The type of file to write",
               "enum": [
                  "tpar",
                  "spec2d"
               ],
               "title": "File Type",
               "type": "string"
            },
            "location": {
               "description": "The side of the grid to apply the boundary to",
               "discriminator": {
                  "mapping": {
                     "SIDE": "#/$defs/SIDE",
                     "SIDES": "#/$defs/SIDES",
                     "XY": "#/$defs/XY",
                     "side": "#/$defs/SIDE",
                     "sides": "#/$defs/SIDES",
                     "xy": "#/$defs/XY"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/SIDE"
                  },
                  {
                     "$ref": "#/$defs/SIDES"
                  },
                  {
                     "$ref": "#/$defs/XY"
                  }
               ],
               "title": "Location"
            }
         },
         "required": [
            "id",
            "source",
            "location"
         ],
         "title": "BoundspecSegmentXY",
         "type": "object"
      },
      "BoundspecSide": {
         "additionalProperties": false,
         "description": "SWAN BOUNDSPEC SIDE data class.\n\nTODO: Handle side definition on a rotated grid.\nTODO: Should SIDE VARIABE be supported?\nTODO: Support option to choose between mid-point or averaging?\nTODO: Does PAR need to be supported? Guess not as nonstationary isn't supported\n\nNote\n----\nThe 'spec1d' file type is not supported yet.",
         "properties": {
            "model_type": {
               "default": "boundspecside",
               "description": "Model type discriminator",
               "enum": [
                  "boundspecside",
                  "BOUNDSPECSIDE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "id": {
               "description": "Unique identifier for this data source",
               "title": "Id",
               "type": "string"
            },
            "source": {
               "description": "Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method",
               "discriminator": {
                  "mapping": {
                     "csv": "#/$defs/SourceTimeseriesCSV",
                     "datamesh": "#/$defs/SourceDatamesh",
                     "file": "#/$defs/SourceFile",
                     "intake": "#/$defs/SourceIntake",
                     "wavespectra": "#/$defs/SourceWavespectra"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/SourceTimeseriesCSV"
                  },
                  {
                     "$ref": "#/$defs/SourceDatamesh"
                  },
                  {
                     "$ref": "#/$defs/SourceFile"
                  },
                  {
                     "$ref": "#/$defs/SourceIntake"
                  },
                  {
                     "$ref": "#/$defs/SourceWavespectra"
                  }
               ],
               "title": "Source"
            },
            "link": {
               "default": false,
               "description": "Whether to create a symbolic link instead of copying the file",
               "title": "Link",
               "type": "boolean"
            },
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Filter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Optional filter specification to apply to the dataset"
            },
            "variables": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": [],
               "description": "Subset of variables to extract from the dataset",
               "title": "Variables"
            },
            "coords": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetCoords"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "t": "time",
                  "x": "longitude",
                  "y": "latitude",
                  "z": "depth",
                  "s": "site"
               },
               "description": "Names of the coordinates in the dataset"
            },
            "crop_data": {
               "default": true,
               "description": "Update crop filter from Time object if passed to get method",
               "title": "Crop Data",
               "type": "boolean"
            },
            "buffer": {
               "default": 2.0,
               "description": "Space to buffer the grid bounding box if `filter_grid` is True",
               "title": "Buffer",
               "type": "number"
            },
            "time_buffer": {
               "default": [
                  0,
                  0
               ],
               "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
               "items": {
                  "type": "integer"
               },
               "title": "Time Buffer",
               "type": "array"
            },
            "spacing": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "const": "parent",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the `get` method. If 'parent', the resolution of the parent dataset is used to define the spacing.",
               "title": "Spacing"
            },
            "sel_method": {
               "default": "idw",
               "description": "Wavespectra method to use for selecting boundary points from the dataset",
               "enum": [
                  "idw",
                  "nearest"
               ],
               "title": "Sel Method",
               "type": "string"
            },
            "sel_method_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments for sel_method",
               "title": "Sel Method Kwargs",
               "type": "object"
            },
            "grid_type": {
               "const": "boundary_wave_station",
               "default": "boundary_wave_station",
               "description": "Model type discriminator",
               "title": "Grid Type",
               "type": "string"
            },
            "shapespec": {
               "$ref": "#/$defs/SHAPESPEC",
               "default": {
                  "model_type": "shapespec",
                  "shape": {
                     "gamma": 3.3,
                     "model_type": "jonswap"
                  },
                  "per_type": "peak",
                  "dspr_type": "degrees"
               },
               "description": "Spectral shape specification"
            },
            "variable": {
               "default": false,
               "description": "Whether the spectra can vary along the side",
               "title": "Variable",
               "type": "boolean"
            },
            "file_type": {
               "default": "tpar",
               "description": "The type of file to write",
               "enum": [
                  "tpar",
                  "spec2d"
               ],
               "title": "File Type",
               "type": "string"
            },
            "location": {
               "$ref": "#/$defs/SIDE",
               "description": "The side of the grid to apply the boundary to"
            }
         },
         "required": [
            "id",
            "source",
            "location"
         ],
         "title": "BoundspecSide",
         "type": "object"
      },
      "CARTESIAN": {
         "additionalProperties": false,
         "description": "Cartesian coordinates.\n\n.. code-block:: text\n\n    CARTESIAN\n\nAll locations and distances are in m. Coordinates are given with respect\nto x- and y-axes chosen by the user in the various commands.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import CARTESIAN\n    coords = CARTESIAN()\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "cartesian",
               "description": "Model type discriminator",
               "enum": [
                  "cartesian",
                  "CARTESIAN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "CARTESIAN",
         "type": "object"
      },
      "COMPUTE_NONSTAT": {
         "additionalProperties": false,
         "description": "Multiple SWAN nonstationary computations.\n\n.. code-block:: text\n\n    COMPUTE NONSTATIONARY [tbegc] [deltc] SEC|MIN|HR|DAY [tendc]\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n    COMPUTE NONSTATIONARY [tbegc] [deltc] SEC|MIN|HR|DAY [tendc]\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n    .\n    .\n\nThis component can be used to define multiple nonstationary compute commands and\nwrite intermediate results as hotfiles between then.\n\nNote\n----\nThe field `times` is optional to allow for the case where the user wants to set\ntimes dynamically after instantiating this component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    from rompy.swan.components.lockup import COMPUTE_NONSTAT\n    times = NONSTATIONARY(\n        tbeg=\"1990-01-01T00:00:00\",\n        tend=\"1990-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    comp = COMPUTE_NONSTAT(times=times)\n    print(comp.render())\n    comp = COMPUTE_NONSTAT(\n        times=times,\n        hotfile=dict(fname=\"hotfile.swn\", format=\"free\"),\n        hottimes=[\"1990-02-01T00:00:00\"],\n    )\n    print(comp.render())\n    comp = COMPUTE_NONSTAT(\n        times=times,\n        initstat=True,\n        hotfile=dict(fname=\"hotfile\", format=\"free\"),\n        hottimes=[6, 12, 18, -1],\n    )\n    print(comp.render())",
         "properties": {
            "model_type": {
               "default": "nonstat",
               "description": "Model type discriminator",
               "enum": [
                  "nonstat",
                  "NONSTAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "times": {
               "$ref": "#/$defs/NONSTATIONARY",
               "description": "Compute times"
            },
            "hotfile": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HOTFILE"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Write results to restart files"
            },
            "hottimes": {
               "anyOf": [
                  {
                     "items": {
                        "format": "date-time",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  }
               ],
               "default": [],
               "description": "Times to write hotfiles, can be a list of datetimes or times indices",
               "title": "Hottimes"
            },
            "suffix": {
               "default": "_%Y%m%dT%H%M%S",
               "description": "Time-template suffix to add to hotfile fname",
               "title": "Suffix",
               "type": "string"
            },
            "initstat": {
               "default": false,
               "description": "Run a STATIONARY computation at the initial time prior to the NONSTATIONARY computation(s) to prescribe initial conditions",
               "title": "Initstat",
               "type": "boolean"
            }
         },
         "title": "COMPUTE_NONSTAT",
         "type": "object"
      },
      "COMPUTE_STAT": {
         "additionalProperties": false,
         "description": "Multiple SWAN stationary computations.\n\n.. code-block:: text\n\n    COMPUTE STATIONARY [time]\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n    COMPUTE STATIONARY [time]\n    COMPUTE STATIONARY [time]\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n    .\n    .\n\nThis component can be used to define multiple stationary compute commands and\nwrite intermediate results as hotfiles between then.\n\nNote\n----\nThe field `times` is optional to allow for the case where the user wants to set\ntimes dynamically after instantiating this component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import STATIONARY, NONSTATIONARY\n    from rompy.swan.components.lockup import COMPUTE_STAT\n    time = STATIONARY(time=\"1990-01-01T00:00:00\")\n    comp = COMPUTE_STAT(times=time)\n    print(comp.render())\n    times = NONSTATIONARY(\n        tbeg=\"1990-01-01T00:00:00\",\n        tend=\"1990-01-01T03:00:00\",\n        delt=\"PT1H\",\n    )\n    comp = COMPUTE_STAT(times=times)\n    print(comp.render())\n    hotfile = dict(fname=\"./hotfile.swn\")\n    hottimes=[\"1990-01-01T03:00:00\"]\n    comp = COMPUTE_STAT(times=times, hotfile=hotfile, hottimes=hottimes)\n    print(comp.render())\n    comp = COMPUTE_STAT(times=times, hotfile=hotfile, hottimes=[2, -1])\n    print(comp.render())",
         "properties": {
            "model_type": {
               "default": "stat",
               "description": "Model type discriminator",
               "enum": [
                  "stat",
                  "STAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "times": {
               "description": "Compute times",
               "discriminator": {
                  "mapping": {
                     "NONSTATIONARY": "#/$defs/NONSTATIONARY",
                     "STATIONARY": "#/$defs/STATIONARY",
                     "nonstationary": "#/$defs/NONSTATIONARY",
                     "stationary": "#/$defs/STATIONARY"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/STATIONARY"
                  },
                  {
                     "$ref": "#/$defs/NONSTATIONARY"
                  }
               ],
               "title": "Times"
            },
            "hotfile": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HOTFILE"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Write results to restart files"
            },
            "hottimes": {
               "anyOf": [
                  {
                     "items": {
                        "format": "date-time",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  }
               ],
               "default": [],
               "description": "Times to write hotfiles, can be a list of datetimes or times indices",
               "title": "Hottimes"
            },
            "suffix": {
               "default": "_%Y%m%dT%H%M%S",
               "description": "Time-template suffix to add to hotfile fname",
               "title": "Suffix",
               "type": "string"
            }
         },
         "title": "COMPUTE_STAT",
         "type": "object"
      },
      "CONSTANTFILE": {
         "additionalProperties": false,
         "description": "Constant file specification.\n\n.. code-block:: text\n\n    CONSTANT FILE 'fname' [seq]\n\nThere are three types of files:\n\n- TPAR files containing nonstationary wave parameters\n- files containing stationary or nonstationary 1D spectra\n  (usually from measurements)\n- files containing stationary or nonstationary 2D spectra\n  (from other computer programs or other SWAN runs)\n\nA TPAR file is for only one location; it has the string TPAR on the first\nline of the file and a number of lines which each contain 5 numbers, i.e.:\nTime (ISO-notation), Hs, Period (average or peak period depending on the\nchoice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian,\ndepending on command SET), Directional spread (in degrees or as power of cos\ndepending on the choice given in command BOUND SHAPE).\n\nNote\n----\nExample of a TPAR file:\n\n.. code-block:: text\n\n    TPAR\n    19920516.130000 4.2 12. -110. 22.\n    19920516.180000 4.2 12. -110. 22.\n    19920517.000000 1.2 8. -110. 22.\n    19920517.120000 1.4 8.5 -80. 26\n    19920517.200000 0.9 6.5 -95. 28\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import CONSTANTFILE\n    par = CONSTANTFILE(fname=\"tpar.txt\")\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "constantfile",
               "description": "Model type discriminator",
               "enum": [
                  "constantfile",
                  "CONSTANTFILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the boundary condition.",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            },
            "seq": {
               "anyOf": [
                  {
                     "minimum": 1,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case `seq` must always be 1",
               "title": "Seq"
            }
         },
         "required": [
            "fname"
         ],
         "title": "CONSTANTFILE",
         "type": "object"
      },
      "CONSTANTPAR": {
         "additionalProperties": false,
         "description": "Constant spectral parameters.\n\n.. code-block:: text\n\n    CONSTANT PAR [hs] [per] [dir] ([dd])\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import CONSTANTPAR\n    par = CONSTANTPAR(hs=1.5, per=8.1, dir=225)\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "constantpar",
               "description": "Model type discriminator",
               "enum": [
                  "constantpar",
                  "CONSTANTPAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hs": {
               "description": "The significant wave height (m)",
               "exclusiveMinimum": 0.0,
               "title": "Hs",
               "type": "number"
            },
            "per": {
               "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE.",
               "exclusiveMinimum": 0.0,
               "title": "Per",
               "type": "number"
            },
            "dir": {
               "description": "The peak wave direction thetapeak (degree), constant over frequencies",
               "maximum": 360.0,
               "minimum": -360.0,
               "title": "Dir",
               "type": "number"
            },
            "dd": {
               "anyOf": [
                  {
                     "maximum": 360.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient of directional spreading; a `cos^m(\u03b8)` distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
               "title": "Dd"
            }
         },
         "required": [
            "hs",
            "per",
            "dir"
         ],
         "title": "CONSTANTPAR",
         "type": "object"
      },
      "COORDINATES": {
         "additionalProperties": false,
         "description": "SWAN Coordinates.\n\n.. code-block:: text\n\n    COORDINATES ->CARTESIAN|SPHERICAL REPEATING\n\nCommand to choose between Cartesian and spherical coordinates (see Section 2.5).\nA nested SWAN run must use the same coordinate system as the coarse grid SWAN run.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import COORDINATES\n    coords = COORDINATES()\n    print(coords.render())\n    coords = COORDINATES(\n        kind=dict(model_type=\"spherical\", projection=\"ccm\"),\n        reapeating=True,\n    )\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "coordinates",
               "description": "Model type discriminator",
               "enum": [
                  "coordinates",
                  "COORDINATES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "kind": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CARTESIAN"
                  },
                  {
                     "$ref": "#/$defs/SPHERICAL"
                  }
               ],
               "description": "Coordinates kind",
               "title": "Kind"
            },
            "reapeating": {
               "default": false,
               "description": "This option is only for academic cases. It means that wave energy leaving at one end of the domain (in computational x-direction) enter at the other side; it is as if the wave field repeats itself in x-direction with the length of the domain in x-direction. This option cannot be used in combination with computation of set-up (see command SETUP). This option is available only with regular grids",
               "title": "Reapeating",
               "type": "boolean"
            }
         },
         "title": "COORDINATES",
         "type": "object"
      },
      "CSIGMA": {
         "additionalProperties": false,
         "description": "Prevents excessive directional turning.\n\n.. code-block:: text\n\n    CSigma [cfl]\n\nThis option prevents an excessive frequency shifting at a single grid point or\nvertex due to a very coarse bathymetry or current locally. This option limits the\nfrequency shifting rate csigma based on the CFL restriction. See also the final\nremark in Section 2.6.3. Note that if this command is not specified, then the\nlimiter is not activated.\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import CSIGMA\n    csigma = CSIGMA()\n    print(csigma.render())\n    csigma = CSIGMA(cfl=0.9)\n    print(csigma.render())",
         "properties": {
            "model_type": {
               "default": "ctheta",
               "description": "Model type discriminator",
               "enum": [
                  "ctheta",
                  "CTHETA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cfl": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Upper limit for the CFL restriction for csigma. A suggestion for this parameter is `cfl = 0.9` (SWAN default: 0.9 when CSIGMA is activated)",
               "title": "Cfl"
            }
         },
         "title": "CSIGMA",
         "type": "object"
      },
      "CTHETA": {
         "additionalProperties": false,
         "description": "Prevents excessive directional turning.\n\n.. code-block:: text\n\n    CTheta [cfl]\n\nThis option prevents an excessive directional turning at a single grid point or\nvertex due to a very coarse bathymetry or current locally. This option limits the\ndirectional turning rate c\u03b8 based on the CFL restriction. (See Eq. 3.41 of\nScientific/Technical documentation). See also the final remark in Section 2.6.3.\nNote that if this command is not specified, then the limiter is not activated.\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import CTHETA\n    ctheta = CTHETA()\n    print(ctheta.render())\n    ctheta = CTHETA(cfl=0.9)\n    print(ctheta.render())",
         "properties": {
            "model_type": {
               "default": "ctheta",
               "description": "Model type discriminator",
               "enum": [
                  "ctheta",
                  "CTHETA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cfl": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Upper limit for the CFL restriction for ctheta. A suggestion for this parameter is `cfl = 0.9` (SWAN default: 0.9 when CTHETA is activated)",
               "title": "Cfl"
            }
         },
         "title": "CTHETA",
         "type": "object"
      },
      "CURVE": {
         "additionalProperties": false,
         "description": "Output locations along a curve.\n\n.. code-block:: text\n\n    CURVE 'sname' [xp1] [yp1] < [int] [xp] [yp] >\n\nWith this optional command the user defines output along a curved line. Actually\nthis curve is a broken line, defined by the user with its corner points. The values\nof the output quantities along the curve are interpolated from the computational\ngrid. This command may be used more than once to define more curves.\n\nNote\n----\nThe following pre-defined curves are available and could be used instead of a CURVE\ncomponent: 'BOUNDARY' and `BOUND_0N` where `N` is boundary part number.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nNote\n----\nRepeat the group `< int xp yp` > in proper order if there are more corner points\non the curve.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import CURVE\n    loc = CURVE(\n        sname=\"outcurve\",\n        xp1=172,\n        yp1=-40,\n        npts=[3, 3],\n        xp=[172.0, 174.0],\n        yp=[-38.0, -38.0],\n    )\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "curve",
               "description": "Model type discriminator",
               "enum": [
                  "curve",
                  "CURVE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "xp1": {
               "description": "Problem coordinate of the first point of the curve in the x-direction",
               "title": "Xp1",
               "type": "number"
            },
            "yp1": {
               "description": "Problem coordinate of the first point of the curve in the y-direction",
               "title": "Yp1",
               "type": "number"
            },
            "npts": {
               "description": "The `int` CURVE parameter, SWAN will generate `npts-1` equidistant locations between two subsequent corner points of the curve including the two corner points",
               "items": {
                  "type": "integer"
               },
               "minItems": 1,
               "title": "Npts",
               "type": "array"
            },
            "xp": {
               "description": "problem coordinates of a corner point of the curve in the x-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "problem coordinates of a corner point of the curve in the y-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Yp",
               "type": "array"
            }
         },
         "required": [
            "sname",
            "xp1",
            "yp1",
            "npts",
            "xp",
            "yp"
         ],
         "title": "CURVE",
         "type": "object"
      },
      "CURVES": {
         "additionalProperties": false,
         "description": "Output locations along multiple curves.\n\n.. code-block:: text\n\n    CURVE 'sname1' [xp1] [yp1] < [int] [xp] [yp] >\n    CURVE 'sname2' [xp1] [yp1] < [int] [xp] [yp] >\n    ..\n\nThis component can be used to prescribe and render multiple CURVE components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import CURVE, CURVES\n    loc1 = CURVE(\n        sname=\"c1\", xp1=7, yp1=-40, npts=[3, 3], xp=[7, 9], yp=[-38, -38],\n    )\n    loc2 = CURVE(\n        sname=\"c2\", xp1=3, yp1=-37, npts=[5, 5], xp=[4, 5], yp=[-37, -36],\n    )\n    locs = CURVES(curves=[loc1, loc2])\n    print(locs.render())",
         "properties": {
            "model_type": {
               "default": "curves",
               "description": "Model type discriminator",
               "enum": [
                  "curves",
                  "CURVES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "curves": {
               "description": "CURVE components",
               "items": {
                  "$ref": "#/$defs/CURVE"
               },
               "title": "Curves",
               "type": "array"
            }
         },
         "required": [
            "curves"
         ],
         "title": "CURVES",
         "type": "object"
      },
      "DANGREMOND": {
         "additionalProperties": false,
         "description": "DAM transmission of d'Angremond et al. (1996).\n\n.. code-block:: text\n\n    DAM DANGREMOND [hgt] [slope] [Bk]\n\nThis option specifies transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nd'Angremond, K., Van Der Meer, J.W. and De Jong, R.J., 1996. Wave transmission at\nlow-crested structures. In Coastal Engineering 1996 (pp. 2418-2427).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DANGREMOND\n    transm = DANGREMOND(hgt=3.0, slope=60, Bk=10.0)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "dangremond",
               "description": "Model type discriminator",
               "enum": [
                  "dangremond",
                  "DANGREMOND"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
               "title": "Hgt",
               "type": "number"
            },
            "slope": {
               "description": "The slope of the obstacle (in degrees)",
               "maximum": 90.0,
               "minimum": 0.0,
               "title": "Slope",
               "type": "number"
            },
            "Bk": {
               "description": "The crest width of the obstacle",
               "title": "Bk",
               "type": "number"
            }
         },
         "required": [
            "hgt",
            "slope",
            "Bk"
         ],
         "title": "DANGREMOND",
         "type": "object"
      },
      "DEFAULT": {
         "additionalProperties": false,
         "description": "Default initial conditions.\n\n.. code-block:: text\n\n    DEFAULT\n\nThe initial spectra are computed from the local wind velocities, using the\ndeep-water growth curve of Kahma and Calkoen (1992), cut off at values of\nsignificant wave height and peak frequency from Pierson and Moskowitz (1964).\nThe average (over the model area) spatial step size is used as fetch with local\nwind. The shape of the spectrum is default JONSWAP with a cos2-directional\ndistribution (options are available: see command BOUND SHAPE).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import DEFAULT\n    init = DEFAULT()\n    print(init.render())",
         "properties": {
            "model_type": {
               "default": "default",
               "description": "Model type discriminator",
               "enum": [
                  "default",
                  "DEFAULT"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "DEFAULT",
         "type": "object"
      },
      "DEWIT": {
         "additionalProperties": false,
         "description": "Biphase of De Wit (2022).\n\n.. code-block:: text\n\n    BIPHASE DEWIT [lpar]\n\nBiphase parameterization based on bed slope and peak period of De Wit (2022).\n\nReferences\n----------\nDe Wit, F.P., 2022. Wave shape prediction in complex coastal systems (Doctoral\ndissertation, PhD. thesis. Delft University of Technology. https://repository.\ntudelft. nl/islandora/object/uuid% 3A0fb850a4-4294-4181-9d74-857de21265c2).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DEWIT\n    biphase = DEWIT()\n    print(biphase.render())\n    biphase = DEWIT(lpar=0.0)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "dewit",
               "default": "dewit",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "lpar": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scales spatial averaging of the De Wit's biphase in terms of a multiple of peak wave length of the incident wave field. Note: `lpar` = 0` means no averaging (SWAN default: 0)",
               "title": "Lpar"
            }
         },
         "title": "DEWIT",
         "type": "object"
      },
      "DIFFRACTION": {
         "additionalProperties": false,
         "description": "Wave diffraction.\n\n.. code-block:: text\n\n    DIFFRACTION [idiffr] [smpar] [smnum] [cgmod]\n\nIf this optional command is given, the diffraction is included in the wave\ncomputation. But the diffraction approximation in SWAN does not properly handle\ndiffraction in harbours or in front of reflecting obstacles (see\nScientific/Technical documentation). Behind breakwaters with a down-wave beach, the\nSWAN results seem reasonable. The spatial resolution near (the tip of) the\ndiffraction obstacle should be 1/5 to 1/10 of the dominant wave length.\n\nNotes\n-----\nWithout extra measures, the diffraction computations with SWAN often converge\npoorly or not at all. Two measures can be taken:\n\n1. (RECOMMENDED) The user can request under-relaxation. See command `NUMERIC`\nparameter `alpha` and Scientific/Technical documentation (Eq. (3.31)). Very limited\nexperience suggests `alpha = 0.01`.\n\n2. Alternatively, the user can request smoothing of the wave field for the\ncomputation of the diffraction parameter (the wave field remains intact for all\nother computations and output). This is done with a repeated convolution filtering.\n\nExamples\n--------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import DIFFRACTION\n    diffraction = DIFFRACTION()\n    print(diffraction.render())\n    diffraction = DIFFRACTION(idiffr=True, smpar=0.0, smnum=1.0)\n    print(diffraction.render())",
         "properties": {
            "model_type": {
               "default": "diffraction",
               "description": "Model type discriminator",
               "enum": [
                  "diffraction",
                  "DIFFRACTION"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "idiffr": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the use of diffraction. If `idiffr=0` then no diffraction is taken into account (SWAN default: 1)",
               "title": "Idiffr"
            },
            "smpar": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Smoothing parameter for the calculation of \u2207 \u00b7 \u221aEtot. During every smoothing step all grid points exchange `smpar` times the energy with their neighbours. Note that `smpar` is parameter a in the above text (SWAN default: 0.0)",
               "title": "Smpar"
            },
            "smnum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of smoothing steps relative to `smpar` (SWAN default: 0)",
               "title": "Smnum"
            },
            "cgmod": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Adaption of propagation velocities in geographic space due to diffraction. If `cgmod=0` then no adaption (SWAN default: 1.0)",
               "title": "Cgmod"
            }
         },
         "title": "DIFFRACTION",
         "type": "object"
      },
      "DIRIMPL": {
         "additionalProperties": false,
         "description": "Numerical scheme for refraction.\n\n.. code-block:: text\n\n    DIRIMPL [cdd]\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import DIRIMPL\n    dirimpl = DIRIMPL()\n    print(dirimpl.render())\n    dirimpl = DIRIMPL(cdd=0.5)\n    print(dirimpl.render())",
         "properties": {
            "model_type": {
               "default": "dirimpl",
               "description": "Model type discriminator",
               "enum": [
                  "dirimpl",
                  "DIRIMPL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cdd": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A value of `cdd=0` corresponds to a central scheme and has the largest accuracy (diffusion \u2248 0) but the computation may more easily generatespurious fluctuations. A value of `cdd=1` corresponds to a first orderupwind scheme and it is more diffusive and therefore preferable if (strong) gradients in depth or current are present (SWAN default: 0.5)",
               "title": "Cdd"
            }
         },
         "title": "DIRIMPL",
         "type": "object"
      },
      "DataInterface": {
         "additionalProperties": false,
         "description": "SWAN forcing data interface.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.interface import DataInterface",
         "properties": {
            "model_type": {
               "default": "data_interface",
               "description": "Model type discriminator",
               "enum": [
                  "data_interface",
                  "DATA_INTERFACE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "bottom": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SwanDataGrid"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Bathymetry data"
            },
            "input": {
               "default": [],
               "description": "Input grid data",
               "items": {
                  "$ref": "#/$defs/SwanDataGrid"
               },
               "title": "Input",
               "type": "array"
            }
         },
         "title": "DataInterface",
         "type": "object"
      },
      "DatasetCoords": {
         "additionalProperties": false,
         "description": "Coordinates representation.",
         "properties": {
            "t": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "time",
               "description": "Name of the time coordinate",
               "title": "T"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "longitude",
               "description": "Name of the x coordinate",
               "title": "X"
            },
            "y": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "latitude",
               "description": "Name of the y coordinate",
               "title": "Y"
            },
            "z": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "depth",
               "description": "Name of the z coordinate",
               "title": "Z"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "site",
               "description": "Name of the site coordinate",
               "title": "S"
            }
         },
         "title": "DatasetCoords",
         "type": "object"
      },
      "Delt": {
         "additionalProperties": false,
         "description": "Time interval specification in SWAN.\n\n.. code-block:: text\n\n    [delt] SEC|MIN|HR|DAY\n\nNote\n----\nThe `tdelta` field can be specified as:\n\n* existing timedelta object\n* int or float, assumed as seconds\n* ISO 8601 duration string, following formats work:\n\n  * `[-][DD ][HH:MM]SS[.ffffff]`\n  * `[\u00b1]P[DD]DT[HH]H[MM]M[SS]S` (ISO 8601 format for timedelta)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import Delt\n    from datetime import timedelta\n    delt = Delt(delt=timedelta(minutes=30))\n    print(delt.render())\n    delt = Delt(delt=\"PT1H\", dfmt=\"hr\")\n    print(delt.render())",
         "properties": {
            "model_type": {
               "const": "delt",
               "default": "delt",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "delt": {
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            }
         },
         "required": [
            "delt"
         ],
         "title": "Delt",
         "type": "object"
      },
      "ELDEBERKY": {
         "additionalProperties": false,
         "description": "Biphase of Eldeberky (1999).\n\n.. code-block:: text\n\n    BIPHASE ELDEBERKY [urcrit]\n\nBiphase parameterisation as a funtion of the Ursell number of Eldeberky (1999).\n\nReferences\n----------\nEldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for\nmodeling triad interactions in dispersive waves. In Coastal Engineering 1996\n(pp. 1088-1101).\n\nEldeberky, Y. and Madsen, P.A., 1999. Deterministic and stochastic evolution\nequations for fully dispersive and weakly nonlinear waves. Coastal Engineering,\n38(1), pp.1-24.\n\nDoering, J.C. and Bowen, A.J., 1995. Parametrization of orbital velocity\nasymmetries of shoaling and breaking waves using bispectral analysis. Coastal\nengineering, 26(1-2), pp.15-33.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ELDEBERKY\n    biphase = ELDEBERKY()\n    print(biphase.render())\n    biphase = ELDEBERKY(urcrit=0.63)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "eldeberky",
               "default": "eldeberky",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "urcrit": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The critical Ursell number appearing in the parametrization. Note: the value of `urcrit` is setted by Eldeberky (1996) at 0.2 based on a laboratory experiment, whereas Doering and Bowen (1995) employed the value of 0.63 based on the field experiment data (SWAN default: 0.63)",
               "title": "Urcrit"
            }
         },
         "title": "ELDEBERKY",
         "type": "object"
      },
      "FRAME": {
         "additionalProperties": false,
         "description": "Output locations on a regular grid.\n\n.. code-block:: text\n\n    FRAME 'sname' [xpfr] [ypfr] [alpfr] [xlenfr] [ylenfr] [mxfr] [myfr]\n\nWith this optional command the user defines output on a rectangular, uniform grid\nin a regular frame.\n\nIf the set of output locations is identical to a part of the computational grid,\nthen the user can use the alternative command GROUP.\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import FRAME\n    loc = FRAME(\n        sname=\"outgrid\",\n        grid=dict(xp=173, yp=-40, xlen=2, ylen=2, mx=19, my=19),\n    )\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "frame",
               "description": "Model type discriminator",
               "enum": [
                  "frame",
                  "FRAME"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "grid": {
               "$ref": "#/$defs/GRIDREGULAR",
               "description": "Frame grid definition"
            }
         },
         "required": [
            "sname",
            "grid"
         ],
         "title": "FRAME",
         "type": "object"
      },
      "FREEBOARD": {
         "additionalProperties": false,
         "description": "Freeboard dependent transmission and reflection.\n\n.. code-block:: text\n\n    FREEBOARD [hgt] [gammat] [gammar] [QUAY]\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nSee the Scientific/Technical documentation for background information on the\n`gammat` and `gammar` shape parameters.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import FREEBOARD\n    freeboard = FREEBOARD(hgt=2.0)\n    print(freeboard.render())\n    freeboard = FREEBOARD(hgt=2.0, gammat=1.0, gammar=1.0, quay=True)\n    print(freeboard.render())",
         "properties": {
            "model_type": {
               "default": "freeboard",
               "description": "Model type discriminator",
               "enum": [
                  "freeboard",
                  "FREEBOARD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle or height of the quay above the reference level (same reference level as for the bottom). Use a negative value if the top is below that reference level. In case `hgt` is also specified in the DAM option, both values of `hgt` should be equal for consistency",
               "title": "Hgt",
               "type": "number"
            },
            "gammat": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape parameter of relative freeboard dependency of transmission coefficient. This parameter should be higher than zero (SWAN default 1.0)",
               "title": "Gammat"
            },
            "gammar": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape parameter of relative freeboard dependency of reflection coefficient. This parameter should be higher than zero (SWAN default 1.0)",
               "title": "Gammar"
            },
            "quay": {
               "default": false,
               "description": "With this option the user indicates that the freeboard dependency of the transmission and reflection coefficients also depends on the relative position of an obstacle-linked grid point with respect to the position of the obstacle line representing the edge of a quay. In case the active grid point is on the deeper side of the obstacle, then the correction factors are applied using the parameters `hgt`, `gammat` and `gammar`.In case the active grid point is on the shallower side of the obstacle, the reflection coefficient is set to 0 and the transmission coefficient to 1.",
               "title": "Quay",
               "type": "boolean"
            }
         },
         "required": [
            "hgt"
         ],
         "title": "FREEBOARD",
         "type": "object"
      },
      "FRICTION_COLLINS": {
         "additionalProperties": false,
         "description": "Collins (1972) friction.\n\n.. code-block:: text\n\n    FRICTION COLLINS [cfw]\n\nNote that `cfw` is allowed to vary over the computational region; in that case use\nthe commands INPGRID FRICTION and READINP FRICTION to define and read the friction\ndata. This command FRICTION is still required to define the type of friction\nexpression. The value of `cfw` in this command is then not required (it will be\nignored).\n\nReferences\n----------\nCollins, J.I., 1972. Prediction of shallow-water spectra. Journal of Geophysical\nResearch, 77(15), pp.2693-2707.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_COLLINS\n    friction = FRICTION_COLLINS()\n    print(friction.render())\n    friction = FRICTION_COLLINS(cfw=0.038)\n    print(friction.render())",
         "properties": {
            "model_type": {
               "default": "collins",
               "description": "Model type discriminator",
               "enum": [
                  "collins",
                  "COLLINS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cfw": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Collins bottom friction coefficient (SWAN default: 0.015)",
               "title": "Cfw"
            }
         },
         "title": "FRICTION_COLLINS",
         "type": "object"
      },
      "FRICTION_JONSWAP": {
         "additionalProperties": false,
         "description": "Hasselmann et al. (1973) Jonswap friction.\n\n.. code-block:: text\n\n    FRICTION JONSWAP CONSTANT [cfjon]\n\nIndicates that the semi-empirical expression derived from the JONSWAP results for\nbottom friction dissipation (Hasselmann et al., 1973, JONSWAP) should be activated.\nThis option is default.\n\nReferences\n----------\nHasselmann, K., Barnett, T.P., Bouws, E., Carlson, H., Cartwright, D.E., Enke, K.,\nEwing, J.A., Gienapp, A., Hasselmann, D.E., Kruseman, P. and Meerburg, A., 1973.\nMeasurements of wind-wave growth and swell decay during the Joint North Sea Wave\nProject (JONSWAP). Deutches Hydrographisches Institut, Hamburg, Germany,\nRep. No. 12, 95 pp.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_JONSWAP\n    friction = FRICTION_JONSWAP()\n    print(friction.render())\n    friction = FRICTION_JONSWAP(cfjon=0.038)\n    print(friction.render())\n\nTODO: Implement VARIABLE option?",
         "properties": {
            "model_type": {
               "default": "jonswap",
               "description": "Model type discriminator",
               "enum": [
                  "jonswap",
                  "JONSWAP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cfjon": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient of the JONSWAP formulation (SWAN default: 0.038)",
               "title": "Cfjon"
            }
         },
         "title": "FRICTION_JONSWAP",
         "type": "object"
      },
      "FRICTION_MADSEN": {
         "additionalProperties": false,
         "description": "Madsen et al (1988) friction.\n\n.. code-block:: text\n\n    FRICTION MADSEN [kn]\n\nNote that `kn` is allowed to vary over the computational region; in that case use\nthe commands INPGRID FRICTION and READINP FRICTION to define and read the friction\ndata. This command FRICTION is still required to define the type of friction\nexpression. The value of `kn` in this command is then not required (it will be\nignored).\n\nReferences\n----------\nMadsen, O.S., Poon, Y.K. and Graber, H.C., 1988. Spectral wave attenuation by\nbottom friction: Theory. In Coastal engineering 1988 (pp. 492-504).\n\nMadsen, O.S. and Rosengaus, M.M., 1988. Spectral wave attenuation by bottom\nfriction: Experiments. In Coastal Engineering 1988 (pp. 849-857).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_MADSEN\n    friction = FRICTION_MADSEN()\n    print(friction.render())\n    friction = FRICTION_MADSEN(kn=0.038)\n    print(friction.render())",
         "properties": {
            "model_type": {
               "default": "madsen",
               "description": "Model type discriminator",
               "enum": [
                  "madsen",
                  "MADSEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "kn": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "equivalent roughness length scale of the bottom (in m) (SWAN default: 0.05)",
               "title": "Kn"
            }
         },
         "title": "FRICTION_MADSEN",
         "type": "object"
      },
      "FRICTION_RIPPLES": {
         "additionalProperties": false,
         "description": "Smith et al. (2011) Ripples friction.\n\n.. code-block:: text\n\n    FRICTION RIPPLES [S] [D]\n\nIndicates that the expression of Smith et al. (2011) should be activated. Here\nfriction depends on the formation of bottom ripples and sediment size.\n\nReferences\n----------\nSmith, G.A., Babanin, A.V., Riedel, P., Young, I.R., Oliver, S. and Hubbert, G.,\n2011. Introduction of a new friction routine into the SWAN model that evaluates\nroughness due to bedform and sediment size changes. Coastal Engineering, 58(4),\npp.317-326.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_RIPPLES\n    friction = FRICTION_RIPPLES()\n    print(friction.render())\n    friction = FRICTION_RIPPLES(s=2.65, d=0.0001)\n    print(friction.render())",
         "properties": {
            "model_type": {
               "default": "ripples",
               "description": "Model type discriminator",
               "enum": [
                  "ripples",
                  "RIPPLES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The specific gravity of the sediment (SWAN default: 2.65)",
               "title": "S"
            },
            "d": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The sediment diameter (in m) (SWAN default: 0.0001)",
               "title": "D"
            }
         },
         "title": "FRICTION_RIPPLES",
         "type": "object"
      },
      "Filter": {
         "additionalProperties": false,
         "properties": {
            "sort": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Sort"
            },
            "subset": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Subset"
            },
            "crop": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Crop"
            },
            "timenorm": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Timenorm"
            },
            "rename": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Rename"
            },
            "derived": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Derived"
            }
         },
         "title": "Filter",
         "type": "object"
      },
      "GAUSS": {
         "additionalProperties": false,
         "description": "Gaussian spectral shape.\n\n.. code-block:: text\n\n    GAUSS [sigfr]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import GAUSS\n    shape = GAUSS(sigfr=0.02)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "gauss",
               "description": "Model type discriminator",
               "enum": [
                  "gauss",
                  "GAUSS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sigfr": {
               "description": "Width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.",
               "exclusiveMinimum": 0.0,
               "title": "Sigfr",
               "type": "number"
            }
         },
         "required": [
            "sigfr"
         ],
         "title": "GAUSS",
         "type": "object"
      },
      "GEN1": {
         "additionalProperties": false,
         "description": "First generation source terms GEN1.\n\n.. code-block:: text\n\n    GEN1 [cf10] [cf20] [cf30] [cf40] [edmlpm] [cdrag] [umin] [cfpm]\n\nWith this command the user indicates that SWAN should run in first-generation mode\n(see Scientific/Technical documentation).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import GEN1\n    gen = GEN1()\n    print(gen.render())\n    kwargs = dict(\n        cf10=188.0,\n        cf20=0.59,\n        cf30=0.12,\n        cf40=250.0,\n        edmlpm=0.0036,\n        cdrag=0.0012,\n        umin=1.0,\n        cfpm=0.13\n    )\n    gen = GEN1(**kwargs)\n    print(gen.render())",
         "properties": {
            "model_type": {
               "default": "gen1",
               "description": "Model type discriminator",
               "enum": [
                  "gen1",
                  "GEN1"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cf10": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the linear wave growth (SWAN default: 188.0)",
               "title": "Cf10"
            },
            "cf20": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the exponential wave growth (SWAN default: 0.59)",
               "title": "Cf20"
            },
            "cf30": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the exponential wave growth (SWAN default: 0.12)",
               "title": "Cf30"
            },
            "cf40": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the dissipation rate, i.e., the time decay scale (SWAN default: 250.0)",
               "title": "Cf40"
            },
            "edmlpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum non-dimensionless energy density of the wind sea part of the spectrum according to Pierson Moskowitz (SWAN default: 0.0036)",
               "title": "Edmlpm"
            },
            "cdrag": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Drag coefficient (SWAN default: 0.0012)",
               "title": "Cdrag"
            },
            "umin": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Minimum wind velocity (relative to current; all wind speeds are taken at 10 m above sea level) (SWAN default: 1)",
               "title": "Umin"
            },
            "cfpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient which determines the Pierson Moskowitz frequency: `delta_PM = 2pi g / U_10` (SWAN default: 0.13)",
               "title": "Cfpm"
            }
         },
         "title": "GEN1",
         "type": "object"
      },
      "GEN2": {
         "additionalProperties": false,
         "description": "Second generation source terms GEN2.\n\n.. code-block:: text\n\n    GEN2 [cf10] [cf20] [cf30] [cf40] [cf50] [cf60] [edmlpm] [cdrag] [umin] [cfpm]\n\nWith this command the user indicates that SWAN should run in second-generation mode\n(see Scientific/Technical documentation).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import GEN2\n    gen = GEN2()\n    print(gen.render())\n    kwargs = dict(\n        cf10=188.0,\n        cf20=0.59,\n        cf30=0.12,\n        cf40=250.0,\n        cf50=0.0023,\n        cf60=-0.223,\n        edmlpm=0.0036,\n        cdrag=0.0012,\n        umin=1.0,\n        cfpm=0.13\n    )\n    gen = GEN2(**kwargs)\n    print(gen.render())",
         "properties": {
            "model_type": {
               "default": "gen2",
               "description": "Model type discriminator",
               "enum": [
                  "gen2",
                  "GEN2"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cf10": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the linear wave growth (SWAN default: 188.0)",
               "title": "Cf10"
            },
            "cf20": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the exponential wave growth (SWAN default: 0.59)",
               "title": "Cf20"
            },
            "cf30": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the exponential wave growth (SWAN default: 0.12)",
               "title": "Cf30"
            },
            "cf40": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the dissipation rate, i.e., the time decay scale (SWAN default: 250.0)",
               "title": "Cf40"
            },
            "edmlpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum non-dimensionless energy density of the wind sea part of the spectrum according to Pierson Moskowitz (SWAN default: 0.0036)",
               "title": "Edmlpm"
            },
            "cdrag": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Drag coefficient (SWAN default: 0.0012)",
               "title": "Cdrag"
            },
            "umin": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Minimum wind velocity (relative to current; all wind speeds are taken at 10 m above sea level) (SWAN default: 1)",
               "title": "Umin"
            },
            "cfpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient which determines the Pierson Moskowitz frequency: `delta_PM = 2pi g / U_10` (SWAN default: 0.13)",
               "title": "Cfpm"
            },
            "cf50": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the spectral energy scale of the limit spectrum (SWAN default: 0.0023)",
               "title": "Cf50"
            },
            "cf60": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ccontrols the spectral energy scale of the limit spectrum (SWAN default: -0.223",
               "title": "Cf60"
            }
         },
         "title": "GEN2",
         "type": "object"
      },
      "GEN3": {
         "additionalProperties": false,
         "description": "Third generation source terms GEN3.\n\n.. code-block:: text\n\n    GEN3 JANSSEN|KOMEN|->WESTHUYSEN|ST6 AGROW [a]\n\nWith this command the user indicates that SWAN should run in third-generation mode\nfor wind input, quadruplet interactions and whitecapping.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import GEN3\n    gen = GEN3(\n        source_terms=dict(\n            model_type=\"westhuysen\",\n            wind_drag=\"wu\",\n            agrow=True,\n        ),\n    )\n    print(gen.render())\n    from rompy.swan.subcomponents.physics import ST6C1\n    gen = GEN3(source_terms=ST6C1())\n    print(gen.render())",
         "properties": {
            "model_type": {
               "default": "gen3",
               "description": "Model type discriminator",
               "enum": [
                  "gen3",
                  "GEN3"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "source_terms": {
               "description": "SWAN source terms to be used (SWAN default: WESTHUYSEN)",
               "discriminator": {
                  "mapping": {
                     "JANSSEN": "#/$defs/JANSSEN",
                     "KOMEN": "#/$defs/KOMEN",
                     "WESTHUYSEN": "#/$defs/WESTHUYSEN",
                     "janssen": "#/$defs/JANSSEN",
                     "komen": "#/$defs/KOMEN",
                     "st6": "#/$defs/ST6",
                     "st6c1": "#/$defs/ST6C1",
                     "st6c2": "#/$defs/ST6C2",
                     "st6c3": "#/$defs/ST6C3",
                     "st6c4": "#/$defs/ST6C4",
                     "st6c5": "#/$defs/ST6C5",
                     "westhuysen": "#/$defs/WESTHUYSEN"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/JANSSEN"
                  },
                  {
                     "$ref": "#/$defs/KOMEN"
                  },
                  {
                     "$ref": "#/$defs/WESTHUYSEN"
                  },
                  {
                     "$ref": "#/$defs/ST6"
                  },
                  {
                     "$ref": "#/$defs/ST6C1"
                  },
                  {
                     "$ref": "#/$defs/ST6C2"
                  },
                  {
                     "$ref": "#/$defs/ST6C3"
                  },
                  {
                     "$ref": "#/$defs/ST6C4"
                  },
                  {
                     "$ref": "#/$defs/ST6C5"
                  }
               ],
               "title": "Source Terms"
            }
         },
         "title": "GEN3",
         "type": "object"
      },
      "GODA": {
         "additionalProperties": false,
         "description": "DAM transmission of Goda/Seelig (1979).\n\n.. code-block:: text\n\n    DAM GODA [hgt] [alpha] [beta]\n\nThis option specified transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nGoda, Y. and Suzuki, Y., 1976. Estimation of incident and reflected waves in random\nwave experiments. In Coastal Engineering 1976 (pp. 828-845).\n\nSeelig, W.N., 1979. Effects of breakwaters on waves: Laboratory test of wave\ntransmission by overtopping. In Proc. Conf. Coastal Structures, 1979\n(Vol. 79, No. 2, pp. 941-961).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import GODA\n    transm = GODA(hgt=3.0)\n    print(transm.render())\n    transm = GODA(hgt=3.0, alpha=2.6, beta=0.15)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "goda",
               "description": "Model type discriminator",
               "enum": [
                  "goda",
                  "GODA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
               "title": "Hgt",
               "type": "number"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 2.6)",
               "title": "Alpha"
            },
            "beta": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Another coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 0.15)",
               "title": "Beta"
            }
         },
         "required": [
            "hgt"
         ],
         "title": "GODA",
         "type": "object"
      },
      "GRIDREGULAR": {
         "additionalProperties": false,
         "description": "SWAN Regular Grid subcomponent.\n\n.. code-block:: text\n\n    xp yp alp xlen ylen mx my\n\nNote\n----\nThe direction of the x-axis `alp` must be 0 in case of spherical coordinates\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import GRIDREGULAR\n    kwargs = dict(xp=173, yp=-40, alp=0, xlen=2, ylen=2, mx=199, my=199)\n    grid = GRIDREGULAR(suffix=\"c\", **kwargs)\n    print(grid.render())\n    grid = GRIDREGULAR(suffix=\"inp\", **kwargs)\n    print(grid.render())",
         "properties": {
            "model_type": {
               "default": "gridregular",
               "description": "Model type discriminator",
               "enum": [
                  "gridregular",
                  "GRIDREGULAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "xp": {
               "description": "The x-coordinate of the origin in problem coordinates",
               "title": "Xp",
               "type": "number"
            },
            "yp": {
               "description": "The y-coordinate of the origin in problem coordinates",
               "title": "Yp",
               "type": "number"
            },
            "alp": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 0.0,
               "description": "Direction of the xaxis in degrees",
               "title": "Alp"
            },
            "xlen": {
               "description": "Length of the computational grid in the x-direction",
               "title": "Xlen",
               "type": "number"
            },
            "ylen": {
               "description": "Length of the computational grid in the y-direction",
               "title": "Ylen",
               "type": "number"
            },
            "mx": {
               "description": "Number of meshes in computational grid in x-direction (this number is one less than the number of grid points in this domain)",
               "title": "Mx",
               "type": "integer"
            },
            "my": {
               "description": "Number of meshes in computational grid in y-direction (this number is one less than the number of grid points in this domain)",
               "title": "My",
               "type": "integer"
            },
            "suffix": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "",
               "description": "Suffix for rendering with each output grid parameter.",
               "title": "Suffix"
            }
         },
         "required": [
            "xp",
            "yp",
            "xlen",
            "ylen",
            "mx",
            "my"
         ],
         "title": "GRIDREGULAR",
         "type": "object"
      },
      "GROUP": {
         "additionalProperties": false,
         "description": "Output locations on subset of a grid.\n\n.. code-block:: text\n\n    GROUP 'sname' SUBGRID [ix1] [ix2] [iy1] [iy2]\n\nWith this optional command the user defines a group of output locations on a\nrectangular or curvilinear grid that is identical with (part of) the computational\ngrid (rectilinear or curvilinear). Such a group may be convenient for the user to\nobtain output that is not affected by interpolation errors.\n\nThe subgrid contains those points (`ix`,`iy`) of the computational grid for which:\n`ix1` <= `ix` <= `ix2` and `iy1` <= `iy` <= `iy2` (The origin of the computational\ngrid is `ix=0`, `iy=0`)\n\nLimitations: `ix1>=0`, `ix2<=mxc`, `iy1>=0`, `iy2<=myc` (`mxc` and `myc` as\ndefined in the command `CGRID` which should always precede this command `GROUP`)\n\nNote\n----\nCannot be used in 1D-mode or in case of unstructured grids.\n\nNote\n----\nRegular and curvilinear grids are supported.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import GROUP\n    loc = GROUP(sname=\"subgrid\", ix1=20, iy1=0, ix2=50, iy2=100)\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "group",
               "description": "Model type discriminator",
               "enum": [
                  "group",
                  "GROUP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "ix1": {
               "description": "Lowest index of the computational grid in the ix-direction",
               "minimum": 0,
               "title": "Ix1",
               "type": "integer"
            },
            "iy1": {
               "description": "Lowest index of the computational grid in the iy-direction",
               "minimum": 0,
               "title": "Iy1",
               "type": "integer"
            },
            "ix2": {
               "description": "Highest index of the computational grid in the ix-direction",
               "title": "Ix2",
               "type": "integer"
            },
            "iy2": {
               "description": "Highest index of the computational grid in the ix-direction",
               "title": "Iy2",
               "type": "integer"
            }
         },
         "required": [
            "sname",
            "ix1",
            "iy1",
            "ix2",
            "iy2"
         ],
         "title": "GROUP",
         "type": "object"
      },
      "GSE": {
         "additionalProperties": false,
         "description": "Garden-sprinkler effect.\n\n.. code-block:: text\n\n    GSE [waveage] Sec|MIn|HR|DAy\n\nGarden-sprinkler effect is to be counteracted in the S&L propagation scheme\n(default for nonstationary regular grid computations) or in the propagation\nscheme for unstructured grids by adding a diffusion term to the basic equation.\nThis may affect the numerical stability of SWAN.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import GSE\n    scheme = GSE(waveage=dict(delt=86400, dfmt=\"day\"))\n    print(scheme.render())",
         "properties": {
            "model_type": {
               "default": "gse",
               "description": "Model type discriminator",
               "enum": [
                  "gse",
                  "GSE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "waveage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Delt"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time interval used to determine the diffusion which counteracts the so-called garden-sprinkler effect. The default value of `waveage` is zero, i.e. no added diffusion. The value of `waveage` should correspond to the travel time of the waves over the computational region."
            }
         },
         "title": "GSE",
         "type": "object"
      },
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "HOTFILE": {
         "additionalProperties": false,
         "description": "Write intermediate results.\n\n.. code-block:: text\n\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n\nThis command can be used to write the entire wave field at the end of a computation\nto a so-called hotfile, to be used as initial condition in a subsequent SWAN run\n(see command `INITIAL HOTSTART`). This command must be entered immediately after a\n`COMPUTE` command.\n\nThe user may choose the format of the hotfile to be written either as free or\nunformatted. If the free format is chosen, then this format is identical to the\nformat of the files written by the `SPECOUT` command (option `SPEC2D`). This\nhotfile is therefore an ASCII file which is human readable.\n\nAn unformatted (or binary) file usually requires less space on your computer than\nan ASCII file. Moreover, it can be readed by a subsequent SWAN run much faster than\nan ASCII file. Especially, when the hotfile might become a big file, the choice for\nunformatted is preferable. Note that your compiler and OS should follow the same\nABI (Application Binary Interface) conventions (e.g. word size, endianness), so\nthat unformatted hotfiles may transfer properly between different OS or platforms.\nThis implies that the present and subsequent SWAN runs do not have to be carried\nout on the same operating system (e.g. Windows, Linux) or on the same computer,\nprovided that distinct ABI conventions have been followed.\n\nNote\n----\nFor parallel MPI runs, more than one hotfile will be generated depending on the\nnumber of processors (`fname-001`, `fname-002`, etc).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.lockup import HOTFILE\n    hotfile = HOTFILE(fname=\"hotfile.swn\")\n    print(hotfile.render())\n    hotfile = HOTFILE(fname=\"hotfile.dat\", format=\"unformatted\")\n    print(hotfile.render())",
         "properties": {
            "model_type": {
               "default": "hotfile",
               "description": "Model type discriminator",
               "enum": [
                  "hotfile",
                  "HOTFILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file to which the wave field is written",
               "format": "path",
               "title": "Fname",
               "type": "string"
            },
            "format": {
               "anyOf": [
                  {
                     "enum": [
                        "free",
                        "unformatted"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Choose between free (SWAN ASCII) or unformatted (binary) format",
               "title": "Format"
            }
         },
         "required": [
            "fname"
         ],
         "title": "HOTFILE",
         "type": "object"
      },
      "HOTMULTIPLE": {
         "additionalProperties": false,
         "description": "Hotstart multiple initial conditions.\n\n.. code-block:: text\n\n    HOTSTART MULTIPLE fname='fname' FREE|UNFORMATTED\n\nInitial wave field is read from file; this file was generated in a previous SWAN\nrun by means of the HOTFILE command. If the previous run was nonstationary,\nthe time found on the file will be assumed to be the initial time of computation. It\ncan also be used for stationary computation as first guess. The computational grid\n(both in geographical space and in spectral space) must be identical to the one in\nthe run in which the initial wave field was computed\n\nInput will be read from multiple hotfiles obtained from a previous parallel MPI run.\nThe number of files equals the number of processors. Hence, for the present run the\nsame number of processors must be chosen.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import HOTMULTIPLE\n    init = HOTMULTIPLE(fname=\"hotstart.swn\", format=\"free\")\n    print(init.render())",
         "properties": {
            "model_type": {
               "default": "hotmultiple",
               "description": "Model type discriminator",
               "enum": [
                  "hotmultiple",
                  "HOTMULTIPLE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the initial wave field",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            },
            "format": {
               "default": "free",
               "description": "Format of the file containing the initial wave field. FREE: free format, UNFORMATTED: binary format",
               "enum": [
                  "free",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            }
         },
         "required": [
            "fname"
         ],
         "title": "HOTMULTIPLE",
         "type": "object"
      },
      "HOTSINGLE": {
         "additionalProperties": false,
         "description": "Hotstart single initial conditions.\n\n.. code-block:: text\n\n    HOTSTART SINGLE fname='fname' FREE|UNFORMATTED\n\nInitial wave field is read from file; this file was generated in a previous SWAN\nrun by means of the HOTFILE command. If the previous run was nonstationary,\nthe time found on the file will be assumed to be the initial time of computation. It\ncan also be used for stationary computation as first guess. The computational grid\n(both in geographical space and in spectral space) must be identical to the one in\nthe run in which the initial wave field was computed\n\nInput will be read from a single (concatenated) hotfile. In the case of a previous\nparallel MPI run, the concatenated hotfile can be created from a set of multiple\nhotfiles using the program hcat.exe, see Implementation Manual.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import HOTSINGLE\n    init = HOTSINGLE(fname=\"hotstart.swn\", format=\"free\")\n    print(init.render())",
         "properties": {
            "model_type": {
               "default": "hotsingle",
               "description": "Model type discriminator",
               "enum": [
                  "hotsingle",
                  "HOTSINGLE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the initial wave field",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            },
            "format": {
               "default": "free",
               "description": "Format of the file containing the initial wave field. FREE: free format, UNFORMATTED: binary format",
               "enum": [
                  "free",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            }
         },
         "required": [
            "fname"
         ],
         "title": "HOTSINGLE",
         "type": "object"
      },
      "ICE": {
         "additionalProperties": false,
         "description": "Constant wind input field.\n\n.. code-block:: text\n\n    ICE [aice] [hice]\n\nWith this optional command, the user indicates that one or more ice fields are\nconstant.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import ICE\n    ice = ICE(aice=0.1, hice=0.1)\n    print(ice.render())",
         "properties": {
            "model_type": {
               "default": "ice",
               "description": "Model type discriminator",
               "enum": [
                  "ice",
                  "ICE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "description": "Areal ice fraction, a number from 0 to 1",
               "maximum": 1.0,
               "minimum": 0.0,
               "title": "Aice",
               "type": "number"
            },
            "hice": {
               "description": "Ice thickness (m)",
               "minimum": 0.0,
               "title": "Hice",
               "type": "number"
            }
         },
         "required": [
            "aice",
            "hice"
         ],
         "title": "ICE",
         "type": "object"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      },
      "IJ": {
         "additionalProperties": false,
         "description": "Points in grid indices coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import IJ\n    points = IJ(i=[0, 0, 5], j=[0, 19, 19])\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "ij",
               "description": "Model type discriminator",
               "enum": [
                  "ij",
                  "IJ"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "i": {
               "description": "i-index values",
               "items": {
                  "type": "integer"
               },
               "title": "I",
               "type": "array"
            },
            "j": {
               "description": "j-index values",
               "items": {
                  "type": "integer"
               },
               "title": "J",
               "type": "array"
            }
         },
         "required": [
            "i",
            "j"
         ],
         "title": "IJ",
         "type": "object"
      },
      "INITIAL": {
         "additionalProperties": false,
         "description": "Initial conditions.\n\n.. code-block:: text\n\n    INITIAL -> DEFAULT|ZERO|PAR|HOTSTART\n\nThis command can be used to specify the initial values for a stationary (INITIAL\nHOTSTART only) or nonstationary computation. The initial values thus specified\noverride the default initialization (see Section 2.6.3). Note that it is possible\nto obtain an initial state by carrying out a previous stationary or nonstationary\ncomputation.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import INITIAL\n    init = INITIAL()\n    print(init.render())\n    init = INITIAL(\n        kind=dict(model_type=\"hotmultiple\", fname=\"hotstart.swn\", format=\"free\")\n    )\n    print(init.render())",
         "properties": {
            "model_type": {
               "default": "initial",
               "description": "Model type discriminator",
               "enum": [
                  "initial",
                  "INITIAL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "kind": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DEFAULT"
                  },
                  {
                     "$ref": "#/$defs/ZERO"
                  },
                  {
                     "$ref": "#/$defs/PAR"
                  },
                  {
                     "$ref": "#/$defs/HOTSINGLE"
                  },
                  {
                     "$ref": "#/$defs/HOTMULTIPLE"
                  }
               ],
               "description": "Initial condition type",
               "title": "Kind"
            }
         },
         "title": "INITIAL",
         "type": "object"
      },
      "INPGRIDS": {
         "additionalProperties": false,
         "description": "SWAN input grids group component.\n\n.. code-block:: text\n\n    INPGRID ...\n    READGRID ...\n\n    INPGRID ...\n    READGRID ...\n\n    ...\n\nThis group component is a convenience to allow defining and rendering\na list of input grid components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import REGULAR, ICE\n    from rompy.swan.components.group import INPGRIDS\n    inpgrid_bottom = REGULAR(\n        grid_type=\"bottom\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"bottom.txt\"),\n    )\n    inpgrid_wind = REGULAR(\n        grid_type=\"wind\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"wind.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    inpgrid_ice_cte = ICE(aice=0.8, hice=2.0)\n    inpgrids = INPGRIDS(inpgrids=[inpgrid_bottom, inpgrid_wind, inpgrid_ice_cte])\n    print(inpgrids.render())",
         "properties": {
            "model_type": {
               "const": "inpgrids",
               "default": "inpgrids",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "inpgrids": {
               "description": "List of input grid components",
               "items": {
                  "discriminator": {
                     "mapping": {
                        "CURVILINEAR": "#/$defs/rompy__swan__components__inpgrid__CURVILINEAR",
                        "ICE": "#/$defs/ICE",
                        "REGULAR": "#/$defs/rompy__swan__components__inpgrid__REGULAR",
                        "UNSTRUCTURED": "#/$defs/rompy__swan__components__inpgrid__UNSTRUCTURED",
                        "WIND": "#/$defs/WIND",
                        "curvilinear": "#/$defs/rompy__swan__components__inpgrid__CURVILINEAR",
                        "ice": "#/$defs/ICE",
                        "regular": "#/$defs/rompy__swan__components__inpgrid__REGULAR",
                        "unstructured": "#/$defs/rompy__swan__components__inpgrid__UNSTRUCTURED",
                        "wind": "#/$defs/WIND"
                     },
                     "propertyName": "model_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/rompy__swan__components__inpgrid__REGULAR"
                     },
                     {
                        "$ref": "#/$defs/rompy__swan__components__inpgrid__CURVILINEAR"
                     },
                     {
                        "$ref": "#/$defs/rompy__swan__components__inpgrid__UNSTRUCTURED"
                     },
                     {
                        "$ref": "#/$defs/WIND"
                     },
                     {
                        "$ref": "#/$defs/ICE"
                     }
                  ]
               },
               "minItems": 1,
               "title": "Inpgrids",
               "type": "array"
            }
         },
         "required": [
            "inpgrids"
         ],
         "title": "INPGRIDS",
         "type": "object"
      },
      "ISOLINE": {
         "additionalProperties": false,
         "description": "Output locations along a depth contour.\n\n.. code-block:: text\n\n    ISOLINE 'sname' 'rname' DEPTH|BOTTOM [dep]\n\nWith this optional command the user defines a set of output locations along one\ndepth or bottom level contour line (in combination with command RAY).\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import ISOLINE\n    loc = ISOLINE(sname=\"outcurve\", rname=\"outray\", dep_type=\"depth\", dep=12.0)\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "isoline",
               "description": "Model type discriminator",
               "enum": [
                  "isoline",
                  "ISOLINE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "rname": {
               "description": "Name of the set of rays defined by this command",
               "maxLength": 8,
               "title": "Rname",
               "type": "string"
            },
            "dep": {
               "description": "The depth (in m) of the depth contour line along which output locations are generated by SWAN.",
               "title": "Dep",
               "type": "number"
            },
            "dep_type": {
               "anyOf": [
                  {
                     "enum": [
                        "depth",
                        "bottom"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Define if the depth contour is extracted from the DEPTH output (the stationary water depth) or from the BOTTOM output (the depth relative to the datum level with the water level ignored) (SWAN default: DEPTH)",
               "title": "Dep Type"
            }
         },
         "required": [
            "sname",
            "rname",
            "dep"
         ],
         "title": "ISOLINE",
         "type": "object"
      },
      "JANSSEN": {
         "additionalProperties": false,
         "description": "Janssen source terms subcomponent.\n\n.. code-block:: text\n\n    JANSSEN [cds1] [delta] (AGROW [a])\n\nReferences\n----------\nJanssen, P.A., 1989. Wave-induced stress and the drag of air flow over sea waves.\nJournal of Physical Oceanography, 19(6), pp.745-754.\n\nJanssen, P.A.E.M., Lionello, P. and Zambresky, L., 1989. On the interaction of wind\nand waves. Philosophical transactions of the royal society of London. Series A,\nMathematical and Physical Sciences, 329(1604), pp.289-301.\n\nJanssen, P.A., 1991. Quasi-linear theory of wind-wave generation applied to wave\nforecasting. Journal of physical oceanography, 21(11), pp.1631-1642.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import JANSSEN\n    janssen = JANSSEN()\n    print(janssen.render())\n    janssen = JANSSEN(cds1=4.5, delta=0.5, agrow=True)\n    print(janssen.render())",
         "properties": {
            "model_type": {
               "default": "janssen",
               "description": "Model type discriminator",
               "enum": [
                  "janssen",
                  "JANSSEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "wu",
               "description": "Indicates the wind drag formulation",
               "enum": [
                  "wu",
                  "fit"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "cds1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for determining the rate of whitecapping dissipation ($Cds / s^4_{PM}$) (SWAN default: 4.5)",
               "title": "Cds1"
            },
            "delta": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient which determines the dependency of the whitecapping on wave number (mix with Komen et al. formulation) (SWAN default: 0.5)",
               "title": "Delta"
            }
         },
         "title": "JANSSEN",
         "type": "object"
      },
      "JONSWAP": {
         "additionalProperties": false,
         "description": "Jonswap spectral shape.\n\n.. code-block:: text\n\n    JONSWAP [gamma]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import JONSWAP\n    shape = JONSWAP(gamma=3.3)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "jonswap",
               "description": "Model type discriminator",
               "enum": [
                  "jonswap",
                  "JONSWAP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            }
         },
         "title": "JONSWAP",
         "type": "object"
      },
      "KOMEN": {
         "additionalProperties": false,
         "description": "Komen source terms subcomponent.\n\n.. code-block:: text\n\n    KOMEN [cds2] [stpm] (AGROW [a])\n\nReferences\n----------\nKomen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully\ndeveloped wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import KOMEN\n    komen = KOMEN()\n    print(komen.render())\n    komen = KOMEN(cds2=2.36e-5, stpm=3.02e-3, agrow=True, a=0.0015)\n    print(komen.render())",
         "properties": {
            "model_type": {
               "default": "komen",
               "description": "Model type discriminator",
               "enum": [
                  "komen",
                  "KOMEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "wu",
               "description": "Indicates the wind drag formulation",
               "enum": [
                  "wu",
                  "fit"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for determining the rate of whitecapping dissipation (`Cds`) (SWAN default: 2.36e-5)",
               "title": "Cds2"
            },
            "stpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Value of the wave steepness for a Pierson-Moskowitz spectrum (`s^2_PM`) (SWAN default: 3.02e-3)",
               "title": "Stpm"
            }
         },
         "title": "KOMEN",
         "type": "object"
      },
      "LIMITER": {
         "additionalProperties": false,
         "description": "Physics limiter.\n\n.. code-block:: text\n\n    LIMITER [ursell] [qb]\n\nWith this command the user can de-activate permanently the quadruplets when\nthe actual Ursell number exceeds `ursell`. Moreover, as soon as the actual\nfraction of breaking waves exceeds `qb` then the action limiter will not be\nused in case of decreasing action density.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import LIMITER\n    limiter = LIMITER()\n    print(limiter.render())\n    limiter = LIMITER(ursell=10.0, qb=1.0)\n    print(limiter.render())",
         "properties": {
            "model_type": {
               "default": "limiter",
               "description": "Model type discriminator",
               "enum": [
                  "limiter",
                  "LIMITER"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ursell": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The upper threshold for Ursell number (SWAN default: 10.0)",
               "title": "Ursell"
            },
            "qb": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The threshold for fraction of breaking waves (SWAN default: 1.0)",
               "title": "Qb"
            }
         },
         "title": "LIMITER",
         "type": "object"
      },
      "LINE": {
         "additionalProperties": false,
         "description": "Line of points to define obstacle location.\n\n.. code-block:: text\n\n    LINE < [xp] [yp] >\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nPoints coordinates should be provided in m If Cartesian coordinates are used or in\ndegrees if spherical coordinates are used (see command `COORD`). At least two\ncorner points must be provided.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import LINE\n    line = LINE(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1])\n    print(line.render())",
         "properties": {
            "model_type": {
               "default": "line",
               "description": "Model type discriminator",
               "enum": [
                  "line",
                  "LINE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "xp": {
               "description": "The x-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "The y-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Yp",
               "type": "array"
            }
         },
         "required": [
            "xp",
            "yp"
         ],
         "title": "LINE",
         "type": "object"
      },
      "LOCKUP": {
         "additionalProperties": false,
         "description": "Lockup group component.\n\n.. code-block:: text\n\n    COMPUTE ...\n    HOTFILE ...\n    COMPUTE ...\n    HOTFILE ...\n    ...\n    STOP\n\nThis is a group component to specify SWAN \"Lockup\" commands including multiple\n`COMPUTE` commands that may or may not be interleaved with `HOTFILE` commands,\nand a final `STOP` command.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.group import LOCKUP\n    lockup = LOCKUP(\n        compute=dict(\n            model_type=\"stat\",\n            times=dict(\n                model_type=\"nonstationary\",\n                tbeg=\"1990-01-01T00:00:00\",\n                tend=\"1990-01-01T03:00:00\",\n                delt=\"PT1H\",\n                dfmt=\"hr\",\n            ),\n            hotfile=dict(fname=\"hotfile\"),\n            hottimes=[-1],\n        ),\n    )\n    print(lockup.render())",
         "properties": {
            "model_type": {
               "default": "lockup",
               "description": "Model type discriminator",
               "enum": [
                  "lockup",
                  "LOCKUP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "compute": {
               "description": "Compute components",
               "discriminator": {
                  "mapping": {
                     "NONSTAT": "#/$defs/COMPUTE_NONSTAT",
                     "STAT": "#/$defs/COMPUTE_STAT",
                     "nonstat": "#/$defs/COMPUTE_NONSTAT",
                     "stat": "#/$defs/COMPUTE_STAT"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/COMPUTE_STAT"
                  },
                  {
                     "$ref": "#/$defs/COMPUTE_NONSTAT"
                  }
               ],
               "title": "Compute"
            }
         },
         "required": [
            "compute"
         ],
         "title": "LOCKUP",
         "type": "object"
      },
      "MODE": {
         "additionalProperties": false,
         "description": "SWAN Mode.\n\n.. code-block:: text\n\n    MODE ->STATIONARY|NONSTATIONARY ->TWODIMENSIONAL|ONEDIMENSIONAL\n\nWith this optional command the user indicates that the run will be either\nstationary or nonstationary and one-dimensional (1D-mode) or two-dimensional\n(2D-mode). Nonstationary means either (see command COMPUTE):\n\n* (a) one nonstationary computations or\n* (b) a sequence of stationary computations or\n* (c) a mix of (a) and (b)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import MODE\n    mode = MODE()\n    print(mode.render())\n    mode = MODE(kind=\"nonstationary\", dim=\"twodimensional\")\n    print(mode.render())",
         "properties": {
            "model_type": {
               "default": "mode",
               "description": "Model type discriminator.",
               "enum": [
                  "mode",
                  "MODE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "kind": {
               "default": "stationary",
               "description": "Indicates if run will be stationary or nonstationary",
               "enum": [
                  "stationary",
                  "nonstationary"
               ],
               "title": "Kind",
               "type": "string"
            },
            "dim": {
               "default": "twodimensional",
               "description": "Indicates that the run will be either one-dimensional (1D-mode) or two-dimensional (2D-mode)",
               "enum": [
                  "onedimensional",
                  "twodimensional"
               ],
               "title": "Dim",
               "type": "string"
            }
         },
         "title": "MODE",
         "type": "object"
      },
      "MUD": {
         "additionalProperties": false,
         "description": "Mud dumping.\n\n.. code-block:: text\n\n    MUD [layer] [rhom] [viscm]\n\nWith this command the user can activate wave damping due to mud based on Ng (2000).\nIf this command or the commands INPGRID MUDLAY and READINP MUDLAY are not used,\nSWAN will not account for muddy bottom effects.\n\nReferences\n----------\nNg, C., 2000, Water waves over a muddy bed: A two layer Stokes' boundary layer\nmodel, Coastal Eng., 40, 221-242.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import MUD\n    mud = MUD()\n    print(mud.render())\n    mud = MUD(\n        layer=2.0,\n        rhom=1300,\n        viscm=0.0076,\n    )\n    print(mud.render())\n\nTODO: Validate `layer` must be prescribed if `INPGRID MUDLAY` isn't used.",
         "properties": {
            "model_type": {
               "default": "mud",
               "description": "Model type discriminator",
               "enum": [
                  "mud",
                  "MUD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "layer": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The thickness of the mud layer (in m). Note that `layer` is allowed to vary over the computational region to account for the zonation of muddy bottom. In that case use the commands `INPGRID MUDLAY` and `READINP MUDLAY` to define and read the layer thickness of mud. The value of `layer` in this command is then not required (it will be ignored)",
               "title": "Layer"
            },
            "rhom": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The density of the mud layer (in kg/m3) (SWAN default: 1300)",
               "title": "Rhom"
            },
            "viscm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The kinematic viscosity of the mud layer (in m2/s) (SWAN default: 0.0076)",
               "title": "Viscm"
            }
         },
         "title": "MUD",
         "type": "object"
      },
      "NEGATINP": {
         "additionalProperties": false,
         "description": "Negative wind input.\n\n.. code-block:: text\n\n    NEGATINP [rdcoef]\n\nWith this optional command the user activates negative wind input. **This is\nintended only for use with non-breaking swell dissipation SSWELL ZIEGER**.\nParameter `rdcoef` is a fraction between 0 and 1, representing the strength of\nnegative wind input. As an example, with [rdcoef]=0.04, for a spectral bin that is\nopposed to the wind direction, the wind input factor W(k, \u03b8) is negative, and its\nmagnitude is 4% of the corresponding value of the spectral bin that is in the\nopposite direction (i.e. in the wind direction). See Zieger et al. (2015) eq. 11,\nwhere a0 is their notation for [rdcoef]. Default [rdcoef]=0.0 and `rdcoef=0.04` is\nrecommended, though as implied by Zieger et al. (2015), this value is not\nwell-established, so the user is encouraged to experiment with other values.\n\nReferences\n----------\nZieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based\nsource terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96,\npp.2-25.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import NEGATINP\n    negatinp = NEGATINP()\n    print(negatinp.render())\n    negatinp = NEGATINP(rdcoef=0.04)\n    print(negatinp.render())",
         "properties": {
            "model_type": {
               "default": "negatinp",
               "description": "Model type discriminator",
               "enum": [
                  "negatinp",
                  "NEGATINP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "rdcoef": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient representing the strength of negative wind input",
               "title": "Rdcoef"
            }
         },
         "title": "NEGATINP",
         "type": "object"
      },
      "NESTOUT": {
         "additionalProperties": false,
         "description": "Write to 2D boundary spectra.\n\n.. code-block:: text\n\n    NESTOUT 'sname' 'fname' (OUTPUT [tbegnst] [deltnst] ->SEC|MIN|HR|DAY)\n\nWrite to data file two-dimensional action density spectra (relative frequency)\nalong the boundary of a nested grid (see command NGRID) to be used in a subsequent\nSWAN run.\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import NESTOUT\n    out = NESTOUT(\n        sname=\"outnest\",\n        fname=\"./nestout.swn\",\n        times=dict(tbeg=\"2012-01-01T00:00:00\", delt=\"PT30M\", dfmt=\"min\"),\n    )\n    print(out.render())",
         "properties": {
            "model_type": {
               "default": "nestout",
               "description": "Model type discriminator",
               "enum": [
                  "nestout",
                  "NESTOUT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations in which the output is to be written",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the data file where the output is written to The file format is defined by the file extension, use `.mat` for MATLAB binary (single precision) or `.nc` for netCDF format. If any other extension is used the ASCII format is assumed",
               "title": "Fname",
               "type": "string"
            },
            "times": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRangeOpen"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Time specification if the user requires output at various times. If this option is not specified data will be written for the last time step of the computation"
            }
         },
         "required": [
            "sname",
            "fname"
         ],
         "title": "NESTOUT",
         "type": "object"
      },
      "NGRID": {
         "additionalProperties": false,
         "description": "Output locations for a nested grid.\n\n.. code-block:: text\n\n    NGRID 'sname' [xpn] [ypn] [alpn] [xlenn] [ylenn] [mxn] [myn]\n\nIf the user wishes to carry out nested SWAN runs, a separate coarse-grid SWAN run\nis required. With this optional command `NGRID`, the user defines in the present\ncoarse-grid run, a set of output locations along the boundary of the subsequent\nnested computational grid. The set of output locations thus defined is of the type\nNGRID.\n\nNote\n----\nCommand `NESTOUT` is required after this command `NGRID` to generate some data for\nthe (subsequent) nested run.\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import NGRID\n    loc = NGRID(\n        sname=\"outnest\",\n        grid=dict(xp=173, yp=-40, xlen=2, ylen=2, mx=19, my=19),\n    )\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "ngrid",
               "description": "Model type discriminator",
               "enum": [
                  "ngrid",
                  "NGRID"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "grid": {
               "$ref": "#/$defs/GRIDREGULAR",
               "description": "NGRID grid definition"
            }
         },
         "required": [
            "sname",
            "grid"
         ],
         "title": "NGRID",
         "type": "object"
      },
      "NGRID_UNSTRUCTURED": {
         "additionalProperties": false,
         "description": "Output locations for a nested grid.\n\n.. code-block:: text\n\n    NGRID 'sname' UNSTRUCTURED ->TRIANGLE|EASYMESH 'fname'\n\nIf the user wishes to carry out nested SWAN runs, a separate coarse-grid SWAN run\nis required. With this optional command `NGRID`, the user defines in the present\ncoarse-grid run, a set of output locations along the boundary of the subsequent\nnested computational grid. The set of output locations thus defined is of the type\nNGRID.\n\nWith this option the user indicates that the subsequent nested grid is unstructured\nOnly grids generated by Triangle and Easymesh are supported by SWAN.\n\nNote\n----\nCommand `NESTOUT` is required after this command `NGRID` to generate some data for\nthe (subsequent) nested run.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import NGRID_UNSTRUCTURED\n    loc = NGRID_UNSTRUCTURED(sname=\"outnest\", kind=\"triangle\", fname=\"ngrid.txt\")\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "ngrid_unstructured",
               "description": "Model type discriminator",
               "enum": [
                  "ngrid_unstructured",
                  "NGRID_UNSTRUCTURED"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "kind": {
               "anyOf": [
                  {
                     "enum": [
                        "triangle",
                        "easymesh"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "triangle",
               "description": "Indicate if nested grid is generated by Triangle or Easymesh. The base name of the grid specified in the `fname` parameter is used internally by SWAN to define the `.node` and `.ele` files in case of the former or the `.n` and `.e` files in case of the latter.",
               "title": "Kind"
            },
            "fname": {
               "description": "Basename of the required files, i.e. without extension",
               "maxLength": 32,
               "title": "Fname",
               "type": "string"
            }
         },
         "required": [
            "sname",
            "fname"
         ],
         "title": "NGRID_UNSTRUCTURED",
         "type": "object"
      },
      "NONSTAT": {
         "additionalProperties": false,
         "description": "Computation parameters in nonstationary computation.",
         "properties": {
            "model_type": {
               "default": "nonstat",
               "description": "Model type discriminator",
               "enum": [
                  "nonstat",
                  "NONSTAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mxitns": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of iterations per time step for nonstationary computations. The computation moves to the next time step when this number is exceeded (SWAN default: `mxitns = 1`",
               "title": "Mxitns"
            }
         },
         "title": "NONSTAT",
         "type": "object"
      },
      "NONSTATIONARY": {
         "additionalProperties": false,
         "description": "Nonstationary time specification.\n\n.. code-block:: text\n\n    NONSTATIONARY [tbeg] [delt] SEC|MIN|HR|DAY [tend]\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    nonstat = NONSTATIONARY(\n        tbeg=\"2012-01-01T00:00:00\",\n        tend=\"2012-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    print(nonstat.render())\n    from datetime import datetime, timedelta\n    nonstat = NONSTATIONARY(\n        tbeg=datetime(1990, 1, 1),\n        tend=datetime(1990, 1, 7),\n        delt=timedelta(minutes=30),\n        tfmt=1,\n        dfmt=\"min\",\n        suffix=\"tbl\",\n    )\n    print(nonstat.render())",
         "properties": {
            "model_type": {
               "default": "nonstationary",
               "description": "Model type discriminator",
               "enum": [
                  "nonstationary",
                  "NONSTATIONARY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "tbeg": {
               "default": "1970-01-01T00:00:00",
               "description": "Start time",
               "format": "date-time",
               "title": "Tbeg",
               "type": "string"
            },
            "delt": {
               "default": "PT1H",
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            },
            "suffix": {
               "default": "",
               "description": "Suffix to prepend to argument names when rendering",
               "title": "Suffix",
               "type": "string"
            },
            "tend": {
               "default": "1970-01-02T00:00:00",
               "description": "End time",
               "format": "date-time",
               "title": "Tend",
               "type": "string"
            }
         },
         "title": "NONSTATIONARY",
         "type": "object"
      },
      "NUMERIC": {
         "additionalProperties": false,
         "description": "Numerical properties.\n\n.. code-block:: text\n\n    NUMeric ( STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter] ) &\n        ( DIRimpl [cdd] ) ( SIGIMpl [css] [eps2] [outp] [niter] ) &\n        ( CTheta [cfl] ) ( CSigma [cfl] ) ( SETUP [eps2] [outp] [niter] )\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.numerics import NUMERIC\n    numeric = NUMERIC()\n    print(numeric.render())\n    numeric = NUMERIC(\n        stop=dict(\n            model_type=\"stopc\",\n            dabs=0.05,\n            drel=0.01,\n            curvat=0.05,\n            npnts=99.5,\n        ),\n        dirimpl=dict(cdd=0.5),\n        sigimpl=dict(css=0.5, eps2=1e-4, outp=0, niter=20),\n        ctheta=dict(cfl=0.9),\n        csigma=dict(cfl=0.9),\n        setup=dict(eps2=1e-4, outp=0, niter=20),\n    )\n    print(numeric.render())",
         "properties": {
            "model_type": {
               "default": "numeric",
               "description": "Model type discriminator",
               "enum": [
                  "numeric",
                  "NUMERIC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "stop": {
               "anyOf": [
                  {
                     "discriminator": {
                        "mapping": {
                           "ACCUR": "#/$defs/ACCUR",
                           "STOPC": "#/$defs/STOPC",
                           "accur": "#/$defs/ACCUR",
                           "stopc": "#/$defs/STOPC"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/STOPC"
                        },
                        {
                           "$ref": "#/$defs/ACCUR"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Iteration termination criteria",
               "title": "Stop"
            },
            "dirimpl": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DIRIMPL"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Numerical scheme for refraction"
            },
            "sigimpl": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SIGIMPL"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Frequency shifting accuracy"
            },
            "ctheta": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CTHETA"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Prevents excessive directional turning"
            },
            "csigma": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CSIGMA"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Prevents excessive frequency shifting"
            },
            "setup": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/rompy__swan__subcomponents__numerics__SETUP"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Stop criteria in the computation of wave setup"
            }
         },
         "title": "NUMERIC",
         "type": "object"
      },
      "OBSTACLE": {
         "additionalProperties": false,
         "description": "Subgrid obstacle.\n\n.. code-block:: text\n\n    OBSTACLE ->TRANSM|TRANS1D|TRANS2D|GODA|DANGREMOND REFL [reflc] ->RSPEC|RDIFF &\n        (FREEBOARD [hgt] [gammat] [gammar] QUAY) LINE < [xp] [yp] >\n\nWith this optional command the user provides the characteristics of a (line\nof) sub-grid obstacle(s) through which waves are transmitted or against which\nwaves are reflected (possibly both at the same time). The obstacle is sub-grid\nin the sense that it is narrow compared to the spatial meshes; its length should\nbe at least one mesh length.\n\nThe location of the obstacle is defined by a sequence of corner points of a line.\nThe obstacles interrupt the propagation of the waves from one grid point to the\nnext wherever this obstacle line is located between two neighbouring grid points\n(of the computational grid; the resolution of the obstacle is therefore equal to\nthe computational grid spacing). This implies that an obstacle to be effective must\nbe located such that it crosses at least one grid line. This is always the case\nwhen an obstacle is larger than one mesh length.\n\nNotes\n-----\n\n* The advise is to define obstacles with the least amount of points possible.\n* SWAN checks if the criterion `reflc^2 + trcoef^2 LE 1` is fulfilled.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLE\n    obs = OBSTACLE(\n        transmission=dict(model_type=\"transm\", trcoef=0.5),\n        reflection=dict(reflc=0.5),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())",
         "properties": {
            "model_type": {
               "default": "obstacle",
               "description": "Model type discriminator",
               "enum": [
                  "obstacle",
                  "OBSTACLE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "transmission": {
               "anyOf": [
                  {
                     "description": "Wave transmission",
                     "discriminator": {
                        "mapping": {
                           "DANGREMOND": "#/$defs/DANGREMOND",
                           "GODA": "#/$defs/GODA",
                           "TRANS1D": "#/$defs/TRANS1D",
                           "TRANS2D": "#/$defs/TRANS2D",
                           "TRANSM": "#/$defs/TRANSM",
                           "dangremond": "#/$defs/DANGREMOND",
                           "goda": "#/$defs/GODA",
                           "trans1d": "#/$defs/TRANS1D",
                           "trans2d": "#/$defs/TRANS2D",
                           "transm": "#/$defs/TRANSM"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/TRANSM"
                        },
                        {
                           "$ref": "#/$defs/TRANS1D"
                        },
                        {
                           "$ref": "#/$defs/TRANS2D"
                        },
                        {
                           "$ref": "#/$defs/GODA"
                        },
                        {
                           "$ref": "#/$defs/DANGREMOND"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Transmission"
            },
            "reflection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/REFL"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Wave reflection"
            },
            "reflection_type": {
               "anyOf": [
                  {
                     "description": "Wave reflection type",
                     "discriminator": {
                        "mapping": {
                           "RDIFF": "#/$defs/RDIFF",
                           "RSPEC": "#/$defs/RSPEC",
                           "rdiff": "#/$defs/RDIFF",
                           "rspec": "#/$defs/RSPEC"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/RSPEC"
                        },
                        {
                           "$ref": "#/$defs/RDIFF"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Reflection Type"
            },
            "freeboard": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FREEBOARD"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Freeboard"
            },
            "line": {
               "$ref": "#/$defs/LINE",
               "default": null,
               "description": "Line of obstacle"
            }
         },
         "title": "OBSTACLE",
         "type": "object"
      },
      "OBSTACLES": {
         "additionalProperties": false,
         "description": "List of swan obstacles.\n\n.. code-block:: text\n\n    OBSTACLE ... LINE < [xp] [yp] >\n    OBSTACLE ... LINE < [xp] [yp] >\n    .\n\nThis group component is a convenience to allow defining and rendering\na list of obstacle components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLES, OBSTACLE, OBSTACLE_FIG\n    obst1 = dict(\n        model_type=\"obstacle\",\n        reflection=dict(reflc=1.0),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    obst2 = OBSTACLE(\n        transmission=dict(model_type=\"transm\"),\n        line=dict(xp=[174.3, 174.3], yp=[-39.1, -39.2]),\n    )\n    obst3 = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    obstacles = OBSTACLES(obstacles=[obst1, obst2, obst3])\n    for obst in obstacles.render():\n        print(obst)",
         "properties": {
            "model_type": {
               "default": "obstacles",
               "description": "Model type discriminator",
               "enum": [
                  "obstacles",
                  "OBSTACLES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "obstacles": {
               "description": "List of obstacles",
               "items": {
                  "discriminator": {
                     "mapping": {
                        "FIG": "#/$defs/OBSTACLE_FIG",
                        "OBSTACLE": "#/$defs/OBSTACLE",
                        "fig": "#/$defs/OBSTACLE_FIG",
                        "obstacle": "#/$defs/OBSTACLE"
                     },
                     "propertyName": "model_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/OBSTACLE"
                     },
                     {
                        "$ref": "#/$defs/OBSTACLE_FIG"
                     }
                  ]
               },
               "title": "Obstacles",
               "type": "array"
            }
         },
         "required": [
            "obstacles"
         ],
         "title": "OBSTACLES",
         "type": "object"
      },
      "OBSTACLE_FIG": {
         "additionalProperties": false,
         "description": "Obstacle for free infragravity radiation.\n\n.. code-block:: text\n\n    OBSTACLE FIG [alpha1] [hss] [tss] (REFL [reflc]) LINE <[xp] [yp]>\n\nWith this optional command the user specifies the obstacles along which the\nfree infra-gravity (FIG) energy is radiated. By placing the obstacles close to\nthe shorelines SWAN will include the FIG source term along the coastlines\naccording to the parametrization of Ardhuin et al. (2014).\n\nThe location of the obstacle is defined by a sequence of corner points of a line.\nFor an obstacle line to be effective its length is at least one mesh size large. It\nis recommended to place the obstacles at the inner area of the computational grid,\nnot at or through the boundaries. In particular, each obstacle line must be\nbordered by wet points on both sides.\n\nIn addition, the orientation of the obstacle line determines from which side of the\nobstacle the FIG wave energy is radiated away. If the begin point of the line is\nbelow or left of the end point, that is, pointing upwards/to the right, then FIG\nenergy is radiated from the west/north side of the line. If the begin point is\nabove or right of the end point (pointing downwards/to the left), then FIG energy\nis radiated away from the east/south side of the obstacle line.\n\nReferences\n----------\nArdhuin, F., Rawat, A. and Aucan, J., 2014. A numerical model for free\ninfragravity waves: Definition and validation at regional and global scales.\nOcean Modelling, 77, pp.20-32.\n\nNotes\n-----\nEither `hss` or `tss` or both are allowed to vary over the computational domain.\nIn that case use the commands `INPGRID HSS` and `READINP HSS` and/or the commands\n`INPGRID TSS` and `READINP TSS` to define and read the sea-swell wave height/period\nIt is permissible to have constant sea-swell height and non-constant sea-swell\nperiod, or vice versa. The command `OBST FIG` is still required to define the\nobstacles. The values of `hss` and/or `tss` in this command are then not required\n(they will be ignored).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLE_FIG\n    obs = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())\n    obs = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        reflection=dict(reflc=0.5),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())",
         "properties": {
            "model_type": {
               "default": "fig",
               "description": "Model type discriminator",
               "enum": [
                  "fig",
                  "FIG"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "alpha1": {
               "description": "Calibration parameter (in 1/s) for determining the rate of radiating FIG energy from the shorelines, values in Table 1 of Ardhuin et al. (2014) are between 4e-4 and 8.1e-4",
               "title": "Alpha1",
               "type": "number"
            },
            "hss": {
               "description": "The sea-swell significant wave height (in m)",
               "minimum": 0.0,
               "title": "Hss",
               "type": "number"
            },
            "tss": {
               "description": "The sea-swell mean wave period (in s)",
               "minimum": 0.0,
               "title": "Tss",
               "type": "number"
            },
            "reflection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/REFL"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Wave reflection"
            },
            "line": {
               "$ref": "#/$defs/LINE",
               "description": "Line of obstacle"
            }
         },
         "required": [
            "alpha1",
            "hss",
            "tss",
            "line"
         ],
         "title": "OBSTACLE_FIG",
         "type": "object"
      },
      "OFF": {
         "additionalProperties": false,
         "description": "Deactivate physics commands.\n\n.. code-block:: text\n\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n\nThis command deactivates physics commands. The command can be used to switch off\nthe computation of a certain physics component without having to remove the command\nfrom the input file. This is useful for testing purposes.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import OFF\n    off = OFF(physics=\"windgrowth\")\n    print(off.render())",
         "properties": {
            "model_type": {
               "default": "off",
               "description": "Model type discriminator",
               "enum": [
                  "off",
                  "OFF"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "physics": {
               "$ref": "#/$defs/PhysicsOff",
               "description": "Physics command to be switched off"
            }
         },
         "required": [
            "physics"
         ],
         "title": "OFF",
         "type": "object"
      },
      "OFFS": {
         "additionalProperties": false,
         "description": "Deactivate multiple physics commands.\n\n.. code-block:: text\n\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n    .\n\nThis group component is a convenience to allow defining and rendering\na list of `OFF` components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OFFS\n    off1 = dict(physics=\"windgrowth\")\n    off2 = dict(physics=\"wcapping\")\n    offs = OFFS(offs=[off1, off2])\n    for off in offs.render():\n        print(off)",
         "properties": {
            "model_type": {
               "default": "offs",
               "description": "Model type discriminator",
               "enum": [
                  "offs",
                  "OFFS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "offs": {
               "description": "Physics commands to deactivate",
               "items": {
                  "$ref": "#/$defs/OFF"
               },
               "title": "Offs",
               "type": "array"
            }
         },
         "required": [
            "offs"
         ],
         "title": "OFFS",
         "type": "object"
      },
      "OUTPUT": {
         "additionalProperties": false,
         "description": "Output group component.\n\n.. code-block:: text\n\n    FRAME 'sname' ...\n    GROUP 'sname' ...\n    CURVE 'sname' ...\n    RAY 'rname' ...\n    ISOLINE 'sname' 'rname' ...\n    POINTS 'sname ...\n    NGRID 'sname' ...\n    QUANTITY ...\n    OUTPUT OPTIONS ...\n    BLOCK 'sname' ...\n    TABLE 'sname' ...\n    SPECOUT 'sname' ...\n    NESTOUT 'sname ...\n\nThis group component is used to define multiple types of output locations and\nwrite components in a single model. Only fields that are explicitly prescribed are\nrendered by this group component.\n\nNote\n----\nThe components prescribed are validated according to some constraints as defined\nin the SWAN manual:\n\n- The name `'sname'` of each Locations component must be unique.\n- The Locations `'sname'` assigned to each write component must be defined.\n- The BLOCK component must be associated with either a `FRAME` or `GROUP`.\n- The ISOLINE write component must be associated with a `RAY` component.\n- The NGRID and NESTOUT components must be defined together.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import POINTS, BLOCK, QUANTITIES, TABLE\n    from rompy.swan.components.group import OUTPUT\n    points = POINTS(sname=\"outpts\", xp=[172.3, 172.4], yp=[-39, -39])\n    quantity = QUANTITIES(\n        quantities=[\n            dict(output=[\"depth\", \"hsign\", \"tps\", \"dir\", \"tm01\"], excv=-9),\n        ]\n    )\n    times = dict(tbeg=\"2012-01-01T00:00:00\", delt=\"PT30M\", tfmt=1, dfmt=\"min\")\n    block = BLOCK(\n        model_type=\"block\",\n        sname=\"COMPGRID\",\n        fname=\"./swangrid.nc\",\n        output=[\"depth\", \"hsign\", \"tps\", \"dir\"],\n        times=times,\n    )\n    table = TABLE(\n        sname=\"outpts\",\n        format=\"noheader\",\n        fname=\"./swantable.nc\",\n        output=[\"hsign\", \"hswell\", \"dir\", \"tps\", \"tm01\", \"watlev\", \"qp\"],\n        times=times,\n    )\n    out = OUTPUT(\n        points=points,\n        quantity=quantity,\n        block=block,\n        table=table,\n    )\n    print(out.render())",
         "properties": {
            "model_type": {
               "default": "output",
               "description": "Model type discriminator",
               "enum": [
                  "output",
                  "OUTPUT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "frame": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FRAME",
                     "description": "Frame locations component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "group": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GROUP",
                     "description": "Group locations component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "curve": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CURVES",
                     "description": "Curve locations component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "ray": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/RAY",
                     "description": "Ray locations component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "isoline": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ISOLINE",
                     "description": "Isoline locations component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "points": {
               "anyOf": [
                  {
                     "description": "Points locations component",
                     "discriminator": {
                        "mapping": {
                           "POINTS": "#/$defs/POINTS",
                           "POINTS_FILE": "#/$defs/POINTS_FILE",
                           "points": "#/$defs/POINTS",
                           "points_file": "#/$defs/POINTS_FILE"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/POINTS"
                        },
                        {
                           "$ref": "#/$defs/POINTS_FILE"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Points"
            },
            "ngrid": {
               "anyOf": [
                  {
                     "description": "Ngrid locations component",
                     "discriminator": {
                        "mapping": {
                           "NGRID": "#/$defs/NGRID",
                           "NGRID_UNSTRUCTURED": "#/$defs/NGRID_UNSTRUCTURED",
                           "ngrid": "#/$defs/NGRID",
                           "ngrid_unstructured": "#/$defs/NGRID_UNSTRUCTURED"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/NGRID"
                        },
                        {
                           "$ref": "#/$defs/NGRID_UNSTRUCTURED"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Ngrid"
            },
            "quantity": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/QUANTITIES",
                     "description": "Quantity component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "output_options": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/OUTPUT_OPTIONS",
                     "description": "Output options component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "block": {
               "anyOf": [
                  {
                     "description": "Block write component",
                     "discriminator": {
                        "mapping": {
                           "BLOCK": "#/$defs/BLOCK",
                           "block": "#/$defs/BLOCK",
                           "blocks": "#/$defs/BLOCKS"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/BLOCK"
                        },
                        {
                           "$ref": "#/$defs/BLOCKS"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Block"
            },
            "table": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TABLE",
                     "description": "Table write component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "specout": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SPECOUT",
                     "description": "Spectra write component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "nestout": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/NESTOUT",
                     "description": "Nest write component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "test": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TEST",
                     "description": "Intermediate write component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "OUTPUT",
         "type": "object"
      },
      "OUTPUT_OPTIONS": {
         "additionalProperties": false,
         "description": "Set format of output.\n\n.. code-block:: text\n\n    OUTPUT OPTIons 'comment' (TABLE [field]) (BLOCK [ndec] [len]) (SPEC [ndec])\n\nThis command enables the user to influence the format of block, table and spectral\noutput.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import OUTPUT_OPTIONS\n    opts = OUTPUT_OPTIONS(\n        comment=\"!\", field=10, ndec_block=4, len=20, ndec_spec=6,\n    )\n    print(opts.render())",
         "properties": {
            "model_type": {
               "default": "block",
               "description": "Model type discriminator",
               "enum": [
                  "block",
                  "BLOCK"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "comment": {
               "anyOf": [
                  {
                     "maxLength": 1,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Comment character used in comment lines in the output (SWAN default: %)",
               "title": "Comment"
            },
            "field": {
               "anyOf": [
                  {
                     "maximum": 16,
                     "minimum": 8,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Length of one data field in a table (SWAN default: 12)",
               "title": "Field"
            },
            "ndec_block": {
               "anyOf": [
                  {
                     "maximum": 9,
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of decimals in block output (SWAN default: 4)",
               "title": "Ndec Block"
            },
            "len": {
               "anyOf": [
                  {
                     "maximum": 9999,
                     "minimum": 1,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of data on one line of block output (SWAN default: 6)",
               "title": "Len"
            },
            "ndec_spec": {
               "anyOf": [
                  {
                     "maximum": 9,
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of decimals in spectra output (SWAN default: 4)",
               "title": "Ndec Spec"
            }
         },
         "title": "OUTPUT_OPTIONS",
         "type": "object"
      },
      "PAR": {
         "additionalProperties": false,
         "description": "Spectral parameters.\n\n.. code-block:: text\n\n    PAR [hs] [per] [dir] [dd]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import PAR\n    par = PAR(hs=1.5, per=8.1, dir=225)\n    print(par.render())",
         "properties": {
            "model_type": {
               "const": "par",
               "default": "par",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "hs": {
               "description": "The significant wave height (m)",
               "exclusiveMinimum": 0.0,
               "title": "Hs",
               "type": "number"
            },
            "per": {
               "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE.",
               "exclusiveMinimum": 0.0,
               "title": "Per",
               "type": "number"
            },
            "dir": {
               "description": "The peak wave direction thetapeak (degree), constant over frequencies",
               "maximum": 360.0,
               "minimum": -360.0,
               "title": "Dir",
               "type": "number"
            },
            "dd": {
               "anyOf": [
                  {
                     "maximum": 360.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient of directional spreading; a `cos^m(\u03b8)` distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
               "title": "Dd"
            }
         },
         "required": [
            "hs",
            "per",
            "dir"
         ],
         "title": "PAR",
         "type": "object"
      },
      "PHYSICS": {
         "additionalProperties": false,
         "description": "Physics group component.\n\nThe physics group component is a convenience to allow specifying several individual\ncomponents in a single command and check for consistency between them.\n\nExemples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.group import PHYSICS\n    gen = {\"model_type\": \"gen3\", \"source_terms\": {\"model_type\": \"komen\"}}\n    phys = PHYSICS(gen=gen)\n    print(phys.render())\n    phys = PHYSICS(\n        gen=dict(model_type=\"gen3\", source_terms={\"model_type\": \"st6c1\"}),\n        negatinp={\"model_type\": \"negatinp\", \"rdcoef\": 0.04},\n        sswell={\"model_type\": \"zieger\"},\n        breaking={\"model_type\": \"constant\", \"alpha\": 1.0, \"gamma\": 0.73},\n        friction={\"model_type\": \"jonswap\", \"cfjon\": 0.038},\n    )\n    print(phys.render())",
         "properties": {
            "model_type": {
               "default": "physics",
               "description": "Model type discriminator",
               "enum": [
                  "physics",
                  "PHYSICS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gen": {
               "anyOf": [
                  {
                     "description": "Wave generation component",
                     "discriminator": {
                        "mapping": {
                           "GEN1": "#/$defs/GEN1",
                           "GEN2": "#/$defs/GEN2",
                           "GEN3": "#/$defs/GEN3",
                           "gen1": "#/$defs/GEN1",
                           "gen2": "#/$defs/GEN2",
                           "gen3": "#/$defs/GEN3"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/GEN1"
                        },
                        {
                           "$ref": "#/$defs/GEN2"
                        },
                        {
                           "$ref": "#/$defs/GEN3"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Gen"
            },
            "sswell": {
               "anyOf": [
                  {
                     "description": "Swell dissipation component",
                     "discriminator": {
                        "mapping": {
                           "ARDHUIN": "#/$defs/SSWELL_ARDHUIN",
                           "ROGERS": "#/$defs/SSWELL_ROGERS",
                           "ZIEGER": "#/$defs/SSWELL_ZIEGER",
                           "ardhuin": "#/$defs/SSWELL_ARDHUIN",
                           "rogers": "#/$defs/SSWELL_ROGERS",
                           "zieger": "#/$defs/SSWELL_ZIEGER"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/SSWELL_ROGERS"
                        },
                        {
                           "$ref": "#/$defs/SSWELL_ARDHUIN"
                        },
                        {
                           "$ref": "#/$defs/SSWELL_ZIEGER"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sswell"
            },
            "negatinp": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/NEGATINP",
                     "description": "Negative wind input component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "wcapping": {
               "anyOf": [
                  {
                     "description": "Whitecapping component",
                     "discriminator": {
                        "mapping": {
                           "AB": "#/$defs/WCAPPING_AB",
                           "KOMEN": "#/$defs/WCAPPING_KOMEN",
                           "ab": "#/$defs/WCAPPING_AB",
                           "komen": "#/$defs/WCAPPING_KOMEN"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/WCAPPING_KOMEN"
                        },
                        {
                           "$ref": "#/$defs/WCAPPING_AB"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Wcapping"
            },
            "quadrupl": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/QUADRUPL",
                     "description": "Quadruplets component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "breaking": {
               "anyOf": [
                  {
                     "description": "Wave breaking component",
                     "discriminator": {
                        "mapping": {
                           "BKD": "#/$defs/BREAKING_BKD",
                           "CONSTANT": "#/$defs/BREAKING_CONSTANT",
                           "bkd": "#/$defs/BREAKING_BKD",
                           "constant": "#/$defs/BREAKING_CONSTANT"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/BREAKING_CONSTANT"
                        },
                        {
                           "$ref": "#/$defs/BREAKING_BKD"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Breaking"
            },
            "friction": {
               "anyOf": [
                  {
                     "description": "Bottom friction component",
                     "discriminator": {
                        "mapping": {
                           "COLLINS": "#/$defs/FRICTION_COLLINS",
                           "JONSWAP": "#/$defs/FRICTION_JONSWAP",
                           "MADSEN": "#/$defs/FRICTION_MADSEN",
                           "RIPPLES": "#/$defs/FRICTION_RIPPLES",
                           "collins": "#/$defs/FRICTION_COLLINS",
                           "jonswap": "#/$defs/FRICTION_JONSWAP",
                           "madsen": "#/$defs/FRICTION_MADSEN",
                           "ripples": "#/$defs/FRICTION_RIPPLES"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/FRICTION_JONSWAP"
                        },
                        {
                           "$ref": "#/$defs/FRICTION_COLLINS"
                        },
                        {
                           "$ref": "#/$defs/FRICTION_MADSEN"
                        },
                        {
                           "$ref": "#/$defs/FRICTION_RIPPLES"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Friction"
            },
            "triad": {
               "anyOf": [
                  {
                     "description": "Triad interactions component",
                     "discriminator": {
                        "mapping": {
                           "DCTA": "#/$defs/TRIAD_DCTA",
                           "LTA": "#/$defs/TRIAD_LTA",
                           "SPB": "#/$defs/TRIAD_SPB",
                           "TRIAD": "#/$defs/TRIAD",
                           "dcta": "#/$defs/TRIAD_DCTA",
                           "lta": "#/$defs/TRIAD_LTA",
                           "spb": "#/$defs/TRIAD_SPB",
                           "triad": "#/$defs/TRIAD"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/TRIAD"
                        },
                        {
                           "$ref": "#/$defs/TRIAD_DCTA"
                        },
                        {
                           "$ref": "#/$defs/TRIAD_LTA"
                        },
                        {
                           "$ref": "#/$defs/TRIAD_SPB"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Triad"
            },
            "vegetation": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/VEGETATION",
                     "description": "Vegetation component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "mud": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MUD",
                     "description": "Mud component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "sice": {
               "anyOf": [
                  {
                     "description": "Sea ice component",
                     "discriminator": {
                        "mapping": {
                           "D15": "#/$defs/SICE_D15",
                           "M18": "#/$defs/SICE_M18",
                           "R19": "#/$defs/SICE_R19",
                           "R21B": "#/$defs/SICE_R21B",
                           "SICE": "#/$defs/SICE",
                           "d15": "#/$defs/SICE_D15",
                           "m18": "#/$defs/SICE_M18",
                           "r19": "#/$defs/SICE_R19",
                           "r21b": "#/$defs/SICE_R21B",
                           "sice": "#/$defs/SICE"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/SICE"
                        },
                        {
                           "$ref": "#/$defs/SICE_R19"
                        },
                        {
                           "$ref": "#/$defs/SICE_D15"
                        },
                        {
                           "$ref": "#/$defs/SICE_M18"
                        },
                        {
                           "$ref": "#/$defs/SICE_R21B"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Sice"
            },
            "turbulence": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TURBULENCE",
                     "description": "Turbulence component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "bragg": {
               "anyOf": [
                  {
                     "description": "Bragg scattering component",
                     "discriminator": {
                        "mapping": {
                           "BRAGG": "#/$defs/BRAGG",
                           "FILE": "#/$defs/BRAGG_FILE",
                           "FT": "#/$defs/BRAGG_FT",
                           "bragg": "#/$defs/BRAGG",
                           "file": "#/$defs/BRAGG_FILE",
                           "ft": "#/$defs/BRAGG_FT"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/BRAGG"
                        },
                        {
                           "$ref": "#/$defs/BRAGG_FT"
                        },
                        {
                           "$ref": "#/$defs/BRAGG_FILE"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Bragg"
            },
            "limiter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/LIMITER",
                     "description": "Limiter component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "obstacle": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/OBSTACLES",
                     "description": "Obstacle group component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "setup": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/rompy__swan__components__physics__SETUP",
                     "description": "Setup component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "diffraction": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DIFFRACTION",
                     "description": "Diffraction component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "surfbeat": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SURFBEAT",
                     "description": "Surfbeat component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "scat": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SCAT",
                     "description": "Scattering component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "deactivate": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/OFFS",
                     "description": "Deactivate components"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "PHYSICS",
         "type": "object"
      },
      "PM": {
         "additionalProperties": false,
         "description": "Pearson-Moskowitz spectral shape.\n\n.. code-block:: text\n\n    PM\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import PM\n    shape = PM()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "pm",
               "description": "Model type discriminator",
               "enum": [
                  "pm",
                  "PM"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "PM",
         "type": "object"
      },
      "POINTS": {
         "additionalProperties": false,
         "description": "Isolated output locations.\n\n.. code-block:: text\n\n    POINTS 'sname' < [xp] [yp] >\n\nWith this optional command the user defines a set of individual output point\nlocations.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import POINTS\n    loc = POINTS(sname=\"outpts\", xp=[172.3, 172.4], yp=[-39, -39])\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "points",
               "description": "Model type discriminator",
               "enum": [
                  "points",
                  "POINTS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "xp": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "minItems": 1,
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "problem coordinates of the points in the x-direction",
               "title": "Xp"
            },
            "yp": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "minItems": 1,
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "problem coordinates of the points in the y-direction",
               "title": "Yp"
            }
         },
         "required": [
            "sname",
            "xp",
            "yp"
         ],
         "title": "POINTS",
         "type": "object"
      },
      "POINTS_FILE": {
         "additionalProperties": false,
         "description": "Isolated output locations.\n\n.. code-block:: text\n\n    POINTS 'sname' FILE 'fname'\n\nWith this optional command the user defines a set of individual output point\nlocations from text file. The file should have one point per row with x-coordinates\nand y-coordinates in the first and second columns respectively.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import POINTS_FILE\n    loc = POINTS_FILE(sname=\"outpts\", fname=\"./output_locations.txt\")\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "points_file",
               "description": "Model type discriminator",
               "enum": [
                  "points_file",
                  "POINTS_FILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the output locations",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            }
         },
         "required": [
            "sname",
            "fname"
         ],
         "title": "POINTS_FILE",
         "type": "object"
      },
      "PROJECT": {
         "additionalProperties": false,
         "description": "SWAN Project.\n\n.. code-block:: text\n\n    PROJECT 'name' 'nr' 'title' 'title2 'title3'\n\nWith this required command the user defines a number of strings to identify the\nSWAN run (project name e.g., an engineering project) in the print and plot file.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import PROJECT\n    proj = PROJECT(nr=\"01\")\n    print(proj.render())\n    proj = PROJECT(\n        name=\"waus\",\n        nr=\"001\",\n        title1=\"Western Australia\",\n        title2=\"Perth Nest\"\n    )\n    print(proj.render())",
         "properties": {
            "model_type": {
               "default": "project",
               "description": "Model type discriminator",
               "enum": [
                  "project",
                  "PROJECT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "name": {
               "anyOf": [
                  {
                     "maxLength": 16,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Is the name of the project, at most 16 characters long",
               "title": "Name"
            },
            "nr": {
               "description": "Is the run identification (to be provided as a character string; e.g. the run number) to distinguish this run among other runs for the same project; it is at most 4 characters long. It is the only required information in this command.",
               "maxLength": 4,
               "title": "Nr",
               "type": "string"
            },
            "title1": {
               "anyOf": [
                  {
                     "maxLength": 72,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A string of at most 72 characters provided by the user to appear in the output of the program for the user's convenience (SWAN default: blanks)",
               "title": "Title1"
            },
            "title2": {
               "anyOf": [
                  {
                     "maxLength": 72,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Same as 'title1'",
               "title": "Title2"
            },
            "title3": {
               "anyOf": [
                  {
                     "maxLength": 72,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Same as 'title1'",
               "title": "Title3"
            }
         },
         "required": [
            "nr"
         ],
         "title": "PROJECT",
         "type": "object"
      },
      "PROP": {
         "additionalProperties": false,
         "description": "Propagation scheme.\n\n.. code-block:: text\n\n    PROP BSTB|GSE\n\nNotes\n-----\n* The scheme defaults to `S&L` and `SORDUP` for nonstationary and stationary\n  simulations if not specified.\n* All schemes (BSBT, SORDUP and S&L) can be used in combination with curvilinear\n  grids. With the higher order schemes (S&L and SORDUP) it is important to use a\n  gradually varying grid otherwise there may be a severe loss of accuracy. If sharp\n  transitions in the grid cannot be avoided it is safer to use the BSBT scheme.\n* In the computation with unstructured meshes, a lowest order upwind scheme will be\n  employed. This scheme is very robust but rather diffusive. This may only be\n  significant for the case when swell waves propagate over relative large distances\n  (in the order of thousands of kilometers) within the model domain. However and\n  most fortunately, in such a case this will alleviate the garden-sprinkler effect.\n* Alleviating the garden-sprinkler effect by adding some diffusion makes the SWAN\n  computation conditionally stable. You can either use (i) a smaller time step,\n  (ii) a lower value of `waveage`, (iii) better resolution in the directional\n  space, or (iv) worse resolution in the geographic space, in order of preference,\n  to make the model stable when necessary.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.numerics import PROP\n    prop = PROP()\n    print(prop.render())\n    prop = PROP(scheme=dict(model_type=\"bsbt\"))\n    print(prop.render())\n    prop = PROP(\n        scheme=dict(\n            model_type=\"gse\",\n            waveage=dict(delt=\"PT5H\", dfmt=\"hr\"),\n        ),\n    )\n    print(prop.render())",
         "properties": {
            "model_type": {
               "default": "prop",
               "description": "Model type discriminator",
               "enum": [
                  "prop",
                  "PROP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "scheme": {
               "anyOf": [
                  {
                     "description": "Propagation scheme",
                     "discriminator": {
                        "mapping": {
                           "BSBT": "#/$defs/BSBT",
                           "GSE": "#/$defs/GSE",
                           "bsbt": "#/$defs/BSBT",
                           "gse": "#/$defs/GSE"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/BSBT"
                        },
                        {
                           "$ref": "#/$defs/GSE"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Propagation scheme, by default S&L for nonstationary and SORDUP for stationary computation.",
               "title": "Scheme"
            }
         },
         "title": "PROP",
         "type": "object"
      },
      "PhysicsOff": {
         "description": "Physics commands to be switched off.\n\nAttributes\n----------\nWINDGROWTH : str = \"windgrowth\"\n    Switches off wind growth (in commands GEN1, GEN2, GEN3).\nQUADRUPL : str = \"quadrupl\"\n    Switches off quadruplet wave interactions (in command GEN3).\nWCAPPING : str = \"wcapping\"\n    Switches off whitecapping (in command GEN3).\nBREAKING : str = \"breaking\"\n    Switches off wave breaking dissipation.\nREFRAC : str = \"refrac\"\n    Switches off wave refraction (action transport in theta space).\nFSHIFT : str = \"fshift\"\n    Switches off frequency shifting (action transport in sigma space).\nBNDCHK : str = \"bndchk\"\n    Switches off the checking of the delta imposed and computed Hs at the boundary.",
         "enum": [
            "windgrowth",
            "quadrupl",
            "wcapping",
            "breaking",
            "refrac",
            "fshift",
            "bndchk"
         ],
         "title": "PhysicsOff",
         "type": "string"
      },
      "QUADRUPL": {
         "additionalProperties": false,
         "description": "Nonlinear quadruplet wave interactions.\n\n.. code-block:: text\n\n    QUADRUPL [iquad] [lambda] [cnl4] [Csh1] [Csh2] [Csh3]\n\nWith this option the user can influence the computation of nonlinear quadruplet\nwave interactions which are usually included in the computations. Can be\nde-activated with command OFF QUAD. Note that the DIA approximation of the\nquadruplet interactions is a poor approximation for long-crested waves and\nfrequency resolutions that are deviating much more than 10% (see command CGRID).\nNote that DIA is usually updated per sweep, either semi-implicit (`iquad = 1`) or\nexplicit (`iquad = 2`). However, when ambient current is included, the bounds of\nthe directional sector within a sweep may be different for each frequency bin\n(particularly the higher frequencies are modified by the current). So there may be\nsome overlap of frequency bins between the sweeps, implying non-conservation of\nwave energy. To prevent this the user is advised to choose the integration of DIA\nper iteration instead of per sweep, i.e. `iquad = 3`. If you want to speed up your\ncomputation a bit more, than the choice `iquad = 8` is a good choice.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import QUADRUPL\n    quadrupl = QUADRUPL()\n    print(quadrupl.render())\n    kwargs = dict(\n        iquad=3, lambd=0.25, cnl4=3.0e7, csh1=5.5, csh2=0.833333, csh3=-1.25\n    )\n    quadrupl = QUADRUPL(**kwargs)\n    print(quadrupl.render())",
         "properties": {
            "model_type": {
               "default": "quadrupl",
               "description": "Model type discriminator",
               "enum": [
                  "quadrupl",
                  "QUADRUPL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "iquad": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        8,
                        4,
                        51,
                        52,
                        53
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Numerical procedures for integrating the quadruplets: 1 = semi-implicit per sweep, 2 = explicit per sweep, 3 = explicit per iteration, 8 = explicit per iteration, but with a more efficient implementation, 4 = multiple DIA, 51 = XNL (deep water transfer), 52 = XNL (deep water transfer with WAM depth scaling), 53  XNL (finite depth transfer) (SWAN default: 2)",
               "title": "Iquad"
            },
            "lambd": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for quadruplet configuration in case of DIA (SWAN default: 0.25)",
               "title": "Lambd"
            },
            "cnl4": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient for quadruplet interactions in case of DIA (SWAN default: 3.0e7",
               "title": "Cnl4"
            },
            "csh1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for shallow water scaling in case of DIA (SWAN default: 5.5)",
               "title": "Csh1"
            },
            "csh2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for shallow water scaling in case of DIA (SWAN default: 0.833333)",
               "title": "Csh2"
            },
            "csh3": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for shallow water scaling in case of DIA (SWAN default: -1.25)",
               "title": "Csh3"
            }
         },
         "title": "QUADRUPL",
         "type": "object"
      },
      "QUANTITIES": {
         "additionalProperties": false,
         "description": "Define output settings for multiple output.\n\n.. code-block:: text\n\n    QUANTITY < output > ...\n    QUANTITY < output > ...\n    ..\n\nThis component can be used to prescribe and render multiple QUANTITY components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import QUANTITY, QUANTITIES\n    q1 = QUANTITY(output=[\"xp\"], hexp=100)\n    q2 = QUANTITY(output=[\"hsign\", \"tm01\", \"rtmm10\"], excv=-9)\n    q3 = QUANTITY(output=[\"hsign\", \"tm02\", \"fspr\"], fmin=0.03, fmax=0.5)\n    q4 = QUANTITY(output=[\"hsign\"], fswell=0.08)\n    q5 = QUANTITY(output=[\"per\"], short=\"Tm-1,0\", power=0)\n    q6 = QUANTITY(output=[\"transp\", \"force\"], coord=\"frame\")\n    quantities = QUANTITIES(quantities=[q1, q2, q3, q4, q5, q6])\n    print(quantities.render())",
         "properties": {
            "model_type": {
               "default": "quantities",
               "description": "Model type discriminator",
               "enum": [
                  "quantities",
                  "QUANTITIES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "quantities": {
               "description": "QUANTITY components",
               "items": {
                  "$ref": "#/$defs/QUANTITY"
               },
               "title": "Quantities",
               "type": "array"
            }
         },
         "required": [
            "quantities"
         ],
         "title": "QUANTITIES",
         "type": "object"
      },
      "QUANTITY": {
         "additionalProperties": false,
         "description": "Define output settings.\n\n.. code-block:: text\n\n    QUANTITY < output > 'short' 'long' [lexp] [hexp] [excv] [power] [ref] &\n        [fswell] [fmin] [fmax] ->PROBLEMCOORD|FRAME\n\n    Examples:\n    ---------\n    QUANTITY Xp hexp=100.\n    QUANTITY HS TM01 RTMM10 excv=-9.\n    QUANTITY HS TM02 FSPR fmin=0.03 fmax=0.5\n    QUANTITY Hswell fswell=0.08\n    QUANTITY Per short='Tm-1,0' power=0.\n    QUANTITY Transp Force Frame\n\nWith this command the user can influence:\n\n* The naming of output quantities\n* The accuracy of writing output quantities\n* The definition of some output quantities\n* Reference direction for vectors\n\nNote\n----\nThe following data are accepted only in combination with some specific quantities:\n\n* power\n* ref\n* fswell\n* fmin\n* fmax\n* PROBLEMCOORD\n* FRAME\n\nNote\n----\n**PROBLEMCOORD**: Vector components are relative to the x- and y-axes of the\nproblem coordinate system (see command `SET`):\n\n* Directions are counterclockwise relative to the positive x-axis of the problem\n  coordinate system if Cartesian direction convention is used.\n* Directions are relative to North (clockwise) if Nautical direction convention is\n  used.\n\nNote\n----\n**FRAME**: If output is requested on sets created by command FRAME or\nautomatically (see command `SET`) (`COMPGRID` or `BOTTGRID`):\n\n* Vector components are relative to the x- and y-axes of the frame coordinate\n  system.\n* Directions are counterclockwise relative to the positive x-axis of the frame\n  coordinate system if Cartesian direction convention is used.\n* Directions are relative to North (clockwise) if Nautical direction convention\n  is used.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import QUANTITY\n    quant = QUANTITY(output=[\"xp\"], hexp=100)\n    print(quant.render())\n    quant = QUANTITY(output=[\"hsign\", \"tm01\", \"rtmm10\"], excv=-9)\n    print(quant.render())\n    quant = QUANTITY(output=[\"hsign\", \"tm02\", \"fspr\"], fmin=0.03, fmax=0.5)\n    print(quant.render())\n    quant = QUANTITY(output=[\"hsign\"], fswell=0.08)\n    print(quant.render())\n    quant = QUANTITY(output=[\"per\"], short=\"Tm-1,0\", power=0)\n    print(quant.render())\n    quant = QUANTITY(output=[\"transp\", \"force\"], coord=\"frame\")\n    print(quant.render())",
         "properties": {
            "model_type": {
               "default": "quantity",
               "description": "Model type discriminator",
               "enum": [
                  "quantity",
                  "QUANTITY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "output": {
               "description": "The output variables to define settings for",
               "items": {
                  "$ref": "#/$defs/BlockOptions"
               },
               "minItems": 1,
               "title": "Output",
               "type": "array"
            },
            "short": {
               "anyOf": [
                  {
                     "maxLength": 16,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Short name of the output quantity (e.g. the name in the heading of a table written by SWAN). If this option is not used, SWAN will use a realistic name",
               "title": "Short"
            },
            "long": {
               "anyOf": [
                  {
                     "maxLength": 16,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Long name of the output quantity (e.g. the name in the heading of a block output written by SWAN). If this option is not used, SWAN will use a realistic name",
               "title": "Long"
            },
            "lexp": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lowest expected value of the output quantity",
               "title": "Lexp"
            },
            "hexp": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Highest expected value of the output quantity; the highest expected value is used by SWAN to determine the number of decimals in a table with heading. So the `QUANTITY` command can be used in case the default number of decimals in a table is unsatisfactory",
               "title": "Hexp"
            },
            "excv": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "In case there is no valid value (e.g. wave height in a dry point) this exception value is written in a table or block output",
               "title": "Excv"
            },
            "power": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "power `p` appearing in the definition of `PER`, `RPER` and `WLEN`. Note that the value for `power` given for `PER` affects also the value of `RPER`; the power for `WLEN` is independent of that of `PER` or `RPER` (SWAN default: 1)",
               "title": "Power"
            },
            "ref": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Reference time used for the quantity `TSEC`. Default value: starting time of the first computation, except in cases where this is later than the time of the earliest input. In these cases, the time of the earliest input is used",
               "title": "Ref"
            },
            "fswell": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Upper limit of frequency range used for computing the quantity HSWELL (SWAN default: 0.1 Hz)",
               "title": "Fswell"
            },
            "noswll": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of swells to output for watershed quantities ",
               "title": "Noswll"
            },
            "fmin": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lower limit of frequency range used for computing integral parameters (SWAN Default: 0.0 Hz)",
               "title": "Fmin"
            },
            "fmax": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Upper limit of frequency range used for computing integral parameters (SWAN default: 1000.0 Hz, acts as infinity)",
               "title": "Fmax"
            },
            "coord": {
               "anyOf": [
                  {
                     "enum": [
                        "problemcoord",
                        "frame"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Define if vectors and directions refer to the problem coordinate system ('problemcoord') or sets created by command FRAME ('frame') (SWAN default: problemcoord)",
               "title": "Coord"
            }
         },
         "required": [
            "output"
         ],
         "title": "QUANTITY",
         "type": "object"
      },
      "RAY": {
         "additionalProperties": false,
         "description": "Output locations along a depth contour.\n\n.. code-block:: text\n\n    RAY 'rname' [xp1] [yp1] [xq1] [yq1] < [int] [xp] [yp] [xq] [yq] >\n\nWith this optional command the user provides SWAN with information to determine\noutput locations along the depth contour line(s) defined subsequently in command\n`ISOLINE` (see below).\n\nThese locations are determined by SWAN as the intersections of the depth contour\nline(s) and the set of straight rays defined in this command RAY. These rays are\ncharacterized by a set of master rays defined by their start and end positions\n(`xp`,`yp`) and (`xq`,`yq`). Between each pair of sequential master rays thus\ndefined SWAN generates `int-1` intermediate rays by linear interpolation of the\nstart and end positions.\n\nRays defined by this component have nothing in common with wave rays (e.g. as\nobtained from conventional refraction computations).\n\nNote\n----\nCannot be used in 1D-mode.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command `COORD`).\n\nNote\n----\nWhen using rays the input grid for bottom and water level should not be curvilinear.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import RAY\n    loc = RAY(\n        rname=\"outray\",\n        xp1=171.9,\n        yp1=-40.1,\n        xq1=172.1,\n        yq1=-39.9,\n        npts=[3, 3],\n        xp=[171.9, 173.9],\n        yp=[-38.1, -38.1],\n        xq=[172.1, 174.1],\n        yq=[-37.9, -37.9],\n    )\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "ray",
               "description": "Model type discriminator",
               "enum": [
                  "ray",
                  "RAY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "rname": {
               "description": "Name of the set of rays defined by this command",
               "maxLength": 32,
               "title": "Rname",
               "type": "string"
            },
            "xp1": {
               "description": "Problem coordinate of the begin point of the first master ray in the x-direction",
               "title": "Xp1",
               "type": "number"
            },
            "yp1": {
               "description": "Problem coordinate of the begin point of the first master ray in the y-direction",
               "title": "Yp1",
               "type": "number"
            },
            "xq1": {
               "description": "Problem coordinate of the end point of the first master ray in the x-direction",
               "title": "Xq1",
               "type": "number"
            },
            "yq1": {
               "description": "Problem coordinate of the end point of the first master ray in the y-direction",
               "title": "Yq1",
               "type": "number"
            },
            "npts": {
               "description": "The `int` RAY parameter, number of subdivisions between the previous master ray and the following master ray defined by the following data (number of subdivisions is one morethan the number of interpolated rays)",
               "items": {
                  "type": "integer"
               },
               "minItems": 1,
               "title": "Npts",
               "type": "array"
            },
            "xp": {
               "description": "problem coordinates of the begin of each subsequent master ray in the x-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "problem coordinates of the begin of each subsequent master ray in the y-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Yp",
               "type": "array"
            },
            "xq": {
               "description": "problem coordinates of the end of each subsequent master ray in the x-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Xq",
               "type": "array"
            },
            "yq": {
               "description": "problem coordinates of the end of each subsequent master ray in the y-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Yq",
               "type": "array"
            }
         },
         "required": [
            "rname",
            "xp1",
            "yp1",
            "xq1",
            "yq1",
            "npts",
            "xp",
            "yp",
            "xq",
            "yq"
         ],
         "title": "RAY",
         "type": "object"
      },
      "RDIFF": {
         "additionalProperties": false,
         "description": "Diffuse reflection.\n\n.. code-block:: text\n\n    RDIFF [pown]\n\nSpecular reflection where incident waves are scattered over reflected direction.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RDIFF\n    refl = RDIFF()\n    print(refl.render())\n    refl = RDIFF(pown=1.0)\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "rdiff",
               "description": "Model type discriminator",
               "enum": [
                  "rdiff",
                  "RDIFF"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "pown": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Each incoming direction \u03b8 is scattered over reflected direction \u03b8_refl according to cos^pown(\u03b8-\u03b8_refl). The parameter `pown` indicates the widthof the redistribution function (SWAN default: 1.0)",
               "title": "Pown"
            }
         },
         "title": "RDIFF",
         "type": "object"
      },
      "READCOORD": {
         "additionalProperties": false,
         "description": "SWAN coordinates reader.\n\n.. code-block:: text\n\n    READGRID COORDINATES [fac] 'fname' [idla] [nhedf] [nhedvec] &\n        FREE|FORMAT ('form'|idfm)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READCOORD\n    readcoord = READCOORD(\n        fac=1.0,\n        fname=\"coords.txt\",\n        idla=3,\n        format=\"free\",\n    )\n    print(readcoord.render())",
         "properties": {
            "model_type": {
               "default": "readcoord",
               "description": "Model type discriminator",
               "enum": [
                  "readcoord",
                  "READCOORD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "const": "coordinates",
               "default": "coordinates",
               "description": "Type of the SWAN grid file",
               "title": "Grid Type",
               "type": "string"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "exclusiveMinimum": 0.0,
               "title": "Fac",
               "type": "number"
            },
            "idla": {
               "$ref": "#/$defs/IDLA",
               "default": 1,
               "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
            },
            "nhedf": {
               "default": 0,
               "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
               "minimum": 0,
               "title": "Nhedf",
               "type": "integer"
            },
            "nhedvec": {
               "default": 0,
               "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
               "minimum": 0,
               "title": "Nhedvec",
               "type": "integer"
            },
            "format": {
               "default": "free",
               "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
               "enum": [
                  "free",
                  "fixed",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            },
            "form": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
               "title": "Form"
            },
            "idfm": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        5,
                        6,
                        8
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "File format identifier, only used if `format='fixed'`",
               "title": "Idfm"
            },
            "fname": {
               "description": "Name of the SWAN coordinates file",
               "title": "Fname",
               "type": "string"
            }
         },
         "required": [
            "fname"
         ],
         "title": "READCOORD",
         "type": "object"
      },
      "READINP": {
         "additionalProperties": false,
         "description": "SWAN input grid reader.\n\n.. code-block:: text\n\n    READINP GRID_TYPE [fac] ('fname1' | SERIES 'fname2') [idla] [nhedf] &\n        ([nhedt]) [nhedvec] FREE|FORMAT ('form'|idfm)|UNFORMATTED`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READINP\n    readinp = READINP(\n        grid_type=\"wind\",\n        fname1=\"wind.txt\",\n        fac=1.0,\n        idla=3,\n        format=\"free\",\n    )\n    print(readinp.render())",
         "properties": {
            "model_type": {
               "default": "readinp",
               "description": "Model type discriminator",
               "enum": [
                  "readinp",
                  "READINP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GridOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of the SWAN grid file"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "exclusiveMinimum": 0.0,
               "title": "Fac",
               "type": "number"
            },
            "idla": {
               "$ref": "#/$defs/IDLA",
               "default": 1,
               "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
            },
            "nhedf": {
               "default": 0,
               "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
               "minimum": 0,
               "title": "Nhedf",
               "type": "integer"
            },
            "nhedvec": {
               "default": 0,
               "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
               "minimum": 0,
               "title": "Nhedvec",
               "type": "integer"
            },
            "format": {
               "default": "free",
               "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
               "enum": [
                  "free",
                  "fixed",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            },
            "form": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
               "title": "Form"
            },
            "idfm": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        5,
                        6,
                        8
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "File format identifier, only used if `format='fixed'`",
               "title": "Idfm"
            },
            "fname1": {
               "description": "Name of the file with the values of the variable.",
               "title": "Fname1",
               "type": "string"
            },
            "fname2": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of file that contains the names of the files where the variables are given when the SERIES option is used. These names are to be given in proper time sequence. SWAN reads the next file when the previous file end has been encountered. In these files the input should be given in the same format as in the above file 'fname1' (that implies that a file should start with the start of an input time step)",
               "title": "Fname2"
            },
            "nhedt": {
               "default": 0,
               "description": "Only if variable is time dependent: number of header lines in the file at the start of each time level. A time step may start with more header lines than `nhedt` because the variable may be a vector variable which has its own header lines (see `nhedvec`)",
               "minimum": 0,
               "title": "Nhedt",
               "type": "integer"
            }
         },
         "required": [
            "fname1"
         ],
         "title": "READINP",
         "type": "object"
      },
      "REFL": {
         "additionalProperties": false,
         "description": "Obstacle reflections.\n\n.. code-block:: text\n\n    REFL [reflc]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import REFL\n    refl = REFL()\n    print(refl.render())\n    refl = REFL(reflc=0.5)\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "refl",
               "description": "Model type discriminator",
               "enum": [
                  "refl",
                  "REFL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "reflc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Constant reflection coefficient (ratio of reflected over incoming significant wave height) (SWAN default: 1.0)",
               "title": "Reflc"
            }
         },
         "title": "REFL",
         "type": "object"
      },
      "REL": {
         "additionalProperties": false,
         "description": "Relative frequency spectra.\n\n.. code-block:: text\n\n    REL\n\nSpectra are computed as a function of relative frequency, i.e., the frequency as\nmeasured when moving with current.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.output import REL\n    freq = REL()\n    print(freq.render())",
         "properties": {
            "model_type": {
               "default": "rel",
               "description": "Model type discriminator",
               "enum": [
                  "rel",
                  "REL"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "REL",
         "type": "object"
      },
      "RSPEC": {
         "additionalProperties": false,
         "description": "Specular reflection.\n\n.. code-block:: text\n\n    RSPEC\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RSPEC\n    refl = RSPEC()\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "rspec",
               "description": "Model type discriminator",
               "enum": [
                  "rspec",
                  "RSPEC"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "RSPEC",
         "type": "object"
      },
      "SCAT": {
         "additionalProperties": false,
         "description": "Scattering.\n\n.. code-block:: text\n\n    SCAT [iqcm] (GRID [rfac]) (TRUNC [alpha] [qmax])\n\nUsing this optional command, the user activates a source term that allows for the\ngeneration and propagation of cross correlations between scattered waves due to\nvariations in the bathymetry and mean currents. Such variations are rapid compared\nto the distancebetween the crossing waves (at the scale of 100-1000 m) and is\nparticularly relevant for cases involving narrowband waves (swells) in coastal\nregions with shallow water and ambient currents. In turn, the immediate spatial\neffects of coherent scattering, interference, refraction and diffraction can cause\nlarge-scale changes in the wave parameters.\n\nReferences\n----------\nSmit, P.B. and Janssen, T.T., 2013. The evolution of inhomogeneous wave statistics\nthrough a variable medium. Journal of Physical Oceanography, 43(8), pp.1741-1758.\n\nSmit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of\ninhomogeneous ocean waves. Ocean Modelling, 96, pp.26-35.\n\nSmit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of\ncoherent wave fields over variable depth. Journal of Physical Oceanography, 45(4),\npp.1139-1154.\n\nAkrish, G., Smit, P., Zijlema, M. and Reniers, A., 2020. Modelling statistical wave\ninterferences over shear currents. Journal of Fluid Mechanics, 891, p.A2.\n\nNotes\n-----\nImplemented in SWAN 41.41.\n\nIf both `alpha` and `qmax` options are provided to truncate the infinite\nconvolution sum their mimimum is considered as the final limit on the sum.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import SCAT\n    scat = SCAT()\n    print(scat.render())\n    scat = SCAT(iqcm=2, rfac=1.0, alpha=1.0)\n    print(scat.render())",
         "properties": {
            "model_type": {
               "default": "scat",
               "description": "Model type discriminator",
               "enum": [
                  "scat",
                  "SCAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "iqcm": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1,
                        2
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the modelling and computation of QC scattering:\n\n* 0: no scattering\n* 1: scattering due to non-uniform bathymetry and currents (the latter only if applicable; see command `INPGRID CURRENT`)\n* 2: wave-current interaction under the assumption of a slowly varying bathymetry\n\n(SWAN default: 1)",
               "title": "Iqcm"
            },
            "rfac": {
               "anyOf": [
                  {
                     "minimum": 1.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The resolution factor through which the incident spectral width ismultiplied (SWAN default: 1.0)",
               "title": "Rfac"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The coefficient by which the mean wave number is multiplied to set thelimit on the convolution sum (SWAN default: 1.0)",
               "title": "Alpha"
            },
            "qmax": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum scattering wave number (in 1/m)",
               "title": "Qmax"
            }
         },
         "title": "SCAT",
         "type": "object"
      },
      "SEGMENT": {
         "additionalProperties": false,
         "description": "Boundary over a segment defined from points.\n\n.. code-block:: text\n\n    SEGMENT XY < [x] [y] >\n    SEGMENT IJ < [i] [j] >\n\nThe segment is defined either by means of a series of points in terms of problem\ncoordinates (`XY`) or by means of a series of points in terms of grid indices\n(`IJ`). The points do not have to include all or coincide with actual grid points.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SEGMENT\n    seg = SEGMENT(\n        points=dict(\n            model_type=\"xy\",\n            x=[172, 172, 172, 172.5, 173],\n            y=[-41, -40.5, -40, -40, -40],\n            fmt=\"0.2f\",\n        ),\n    )\n    print(seg.render())\n    seg = SEGMENT(\n        points=dict(\n            model_type=\"ij\",\n            i=[0, 0, 5],\n            j=[0, 19, 19],\n        ),\n    )\n    print(seg.render())",
         "properties": {
            "model_type": {
               "default": "segment",
               "description": "Model type discriminator",
               "enum": [
                  "segment",
                  "SEGMENT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "points": {
               "description": "Points to define the segment",
               "discriminator": {
                  "mapping": {
                     "IJ": "#/$defs/IJ",
                     "XY": "#/$defs/XY",
                     "ij": "#/$defs/IJ",
                     "xy": "#/$defs/XY"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/XY"
                  },
                  {
                     "$ref": "#/$defs/IJ"
                  }
               ],
               "title": "Points"
            }
         },
         "required": [
            "points"
         ],
         "title": "SEGMENT",
         "type": "object"
      },
      "SET": {
         "additionalProperties": false,
         "description": "SWAN setting commands.\n\n.. code-block:: text\n\n    SET [level] [nor] [depmin] [maxmes] [maxerr] [grav] [rho] [cdcap] &\n        [inrhog] [hsrerr] NAUTICAL|->CARTESIAN [pwtail] [froudmax] [icewind]\n\nWith this optional command the user assigns values to various general parameters.\n\nNotes\n-----\nThe error level `maxerr` is coded as follows:\n\n* 1: warnings\n* 2: errors (possibly automatically repaired or repairable by SWAN)\n* 3: severe errors\n\nDefault values for `pwtail` depend on formulations of physics:\n\n* command GEN1: `pwtail = 5`\n* command GEN2: `pwtail = 5`\n* command GEN3 KOMEN: `pwtail = 4`\n* command GEN3 WESTH: `pwtail = 4`\n* command GEN3 JANSSEN: `pwtail = 5`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import SET\n    set = SET(level=0.5, direction_convention=\"nautical\")\n    print(set.render())\n    set = SET(\n        level=-1.0,\n        nor=90,\n        depmin=0.01,\n        maxerr=3,\n        grav=9.81,\n        rho=1025,\n        cdcap=2.5e-3,\n        inrhog=0,\n        hsrerr=0.1,\n        direction_convention=\"nautical\",\n    )\n    print(set.render())",
         "properties": {
            "model_type": {
               "default": "set",
               "description": "Model type discriminator",
               "enum": [
                  "set",
                  "SET"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "level": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Increase in water level that is constant in space and time can be given with this option, `level` is the value of this increase (in m). For a variable water level reference is made to the commands INPGRID and READINP (SWAN default: 0)",
               "examples": [
                  0
               ],
               "title": "Level"
            },
            "nor": {
               "anyOf": [
                  {
                     "maximum": 360.0,
                     "minimum": -360.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Direction of North with respect to the x-axis (measured counterclockwise); default `nor = 90`, i.e. x-axis of the problem coordinate system points East. When spherical coordinates are used (see command COORD) the value of `nor` may not be modified",
               "title": "Nor"
            },
            "depmin": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Threshold depth (in m). In the computation any positive depth smaller than `depmin` is made equal to `depmin` (SWAN default: 0.05)",
               "title": "Depmin"
            },
            "maxmes": {
               "anyOf": [
                  {
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of error messages during the computation at which the computation is terminated. During the computational process messages are written to the print file (SWAN default: 200)",
               "title": "Maxmes"
            },
            "maxerr": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "During pre-processing SWAN checks input data. Depending on the severity of the errors encountered during this pre-processing, SWAN does not start computations. The user can influence the error level above which SWAN will  not start computations (at the level indicated the computations will continue) (SWAN default: 1)",
               "title": "Maxerr"
            },
            "grav": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The gravitational acceleration (in m/s2) (SWAN default: 9.81)",
               "title": "Grav"
            },
            "rho": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The water density (in kg/m3) (SWAN default: 1025)",
               "title": "Rho"
            },
            "cdcap": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum value for the wind drag coefficient. A value of 99999 meansno cutting off the drag coefficient. A suggestion for this parameter is `cdcap = 2.5x 10-3` (SWAN default: 99999) ",
               "title": "Cdcap"
            },
            "inrhog": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "To indicate whether the user requires output based on variance or based on true energy (see Section 2.5). `inrhog` = 0: output based on variance, `inrhog` = 1: output based on true energy (SWAN default: 0)",
               "title": "Inrhog"
            },
            "hsrerr": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The relative difference between the user imposed significant wave height and the significant wave height computed by SWAN (anywhere along the computational grid boundary) above which a warning will be given. This relative difference is the difference normalized with the user provided significant wave height. This warning will be given for each boundary grid point where the problem occurs (with its x- and y-index number of the computational grid). The cause of the difference is explained in Section 2.6.3. To suppress these warnings (in particular for nonstationary computations), set `hsrerr` at a very high value or use command OFF BNDCHK (SWAN default: 0.10) (ONLY MEANT FOR STRUCTURED GRIDS)",
               "title": "Hsrerr"
            },
            "direction_convention": {
               "description": "Direction convention: `nautical` indicates that the Nautical convention for wind and wave direction (SWAN input and output) will be used, `cartesian` indicates that the Cartesian convention for wind and wave direction will be used. For definition, see Section 2.5 or Appendix A (SWAN default: `cartesian`)",
               "enum": [
                  "nautical",
                  "cartesian"
               ],
               "title": "Direction Convention",
               "type": "string"
            },
            "pwtail": {
               "anyOf": [
                  {
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power of high frequency tail; defines the shape of the spectral tail above the highest prognostic frequency `fhigh` (see command CGRID). The energy density is assumed to be proportional to frequency to the power `pwtail`. If the user wishes to use another value, then this SET command should be located in the command file after GEN1, GEN2 or GEN3 command (these will override the SET command with respect to `pwtail`)",
               "title": "Pwtail"
            },
            "froudmax": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Is the maximum Froude number (`U/\u221agd` with `U` the current and `d` the water depth). The currents taken from a circulation model may mismatch with given water depth `d` in the sense that the Froude number becomes larger than 1. For this, the current velocities will be maximized by Froude number times `sqrt(gh)` (SWAN default: 0.8)",
               "title": "Froudmax"
            },
            "icewind": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the scaling of wind input by open water fraction. Default value of zero corresponds to the case where wind input is scaled by the open water fraction. If `icewind = 1` then sea ice does not affect wind input directly. (Though there is still indirect effect via the sea ice sink term; see command SICE) (SWAN default: 0)",
               "title": "Icewind"
            }
         },
         "required": [
            "direction_convention"
         ],
         "title": "SET",
         "type": "object"
      },
      "SHAPESPEC": {
         "additionalProperties": false,
         "description": "Spectral shape specification.\n\n.. code-block:: text\n\n    BOUND SHAPESPEC JONSWAP|PM|GAUSS|BIN|TMA PEAK|MEAN DSPR [POWER|DEGREES]\n\nThis command BOUND SHAPESPEC defines the shape of the spectra (both in frequency\nand direction) at the boundary of the computational grid in case of parametric\nspectral input.\n\nNotes\n-----\nWhile technically a component `BOUND SHAPESPEC`, this is only intended to be used\nas a subcomponent of the `BOUNDSPEC` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SHAPESPEC\n    shapespec = SHAPESPEC()\n    print(shapespec.render())\n    shapespec = SHAPESPEC(\n        shape=dict(model_type=\"tma\", gamma=3.1, d=12),\n        per_type=\"mean\",\n        dspr_type=\"degrees\",\n    )\n    print(shapespec.render())",
         "properties": {
            "model_type": {
               "default": "shapespec",
               "description": "Model type discriminator",
               "enum": [
                  "shapespec",
                  "SHAPESPEC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "shape": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JONSWAP"
                  },
                  {
                     "$ref": "#/$defs/PM"
                  },
                  {
                     "$ref": "#/$defs/GAUSS"
                  },
                  {
                     "$ref": "#/$defs/BIN"
                  },
                  {
                     "$ref": "#/$defs/TMA"
                  }
               ],
               "description": "The spectral shape",
               "title": "Shape"
            },
            "per_type": {
               "default": "peak",
               "description": "The type of characteristic wave period",
               "enum": [
                  "peak",
                  "mean"
               ],
               "title": "Per Type",
               "type": "string"
            },
            "dspr_type": {
               "default": "power",
               "description": "The type of directional spreading",
               "enum": [
                  "power",
                  "degrees"
               ],
               "title": "Dspr Type",
               "type": "string"
            }
         },
         "title": "SHAPESPEC",
         "type": "object"
      },
      "SICE": {
         "additionalProperties": false,
         "description": "Sea ice dissipation.\n\n.. code-block:: text\n\n    SICE [aice]\n\nUsing this command, the user activates a sink term to represent the dissipation of\nwave energy by sea ice. The default method is R19 empirical/parametric: a\npolynomial based on wave frequency (Rogers, 2019). This polynomial (in 1/m) has\nseven dimensional coefficients; see Scientific/Technical documentation for details.\nIf this command is not used, SWAN will not account for sea ice effects.\n\nReferences\n----------\nDoble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015.\nRelating wave attenuation to pancake ice thickness, using field measurements and\nmodel results. Geophysical Research Letters, 42(11), pp.4473-4481.\n\nMeylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and\nanalysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research\nLetters, 41(14), pp.5046-5051.\n\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of\ndissipation of energy of ocean waves by sea ice using data from Wave Array 3 of\nthe ONR \u201cSea State\u201d field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.\n\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave\nattenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science\nand Technology, 182, p.103198.\n\nNotes\n-----\nIis also necessary to describe the ice, using the `ICE` command (for uniform and\nstationary ice) or `INPGRID`/`READINP` commands (for variable ice).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE\n    sice = SICE()\n    print(sice.render())\n    sice = SICE(aice=0.5)\n    print(sice.render())\n\nTODO: Verify if the `aice` parameter should be used with SICE command, it is not\nshown in the command tree but it is described as an option in the description.",
         "properties": {
            "model_type": {
               "default": "sice",
               "description": "Model type discriminator",
               "enum": [
                  "sice",
                  "SICE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            }
         },
         "title": "SICE",
         "type": "object"
      },
      "SICE_D15": {
         "additionalProperties": false,
         "description": "Sea ice dissipation based on the method of Doble et al. (2015).\n\n.. code-block:: text\n\n    SICE [aice] D15 [chf]\n\nReferences\n----------\nDoble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015.\nRelating wave attenuation to pancake ice thickness, using field measurements and\nmodel results. Geophysical Research Letters, 42(11), pp.4473-4481.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_D15\n    sice = SICE_D15()\n    print(sice.render())\n    sice = SICE_D15(aice=0.2, chf=0.1)\n    print(sice.render())",
         "properties": {
            "model_type": {
               "default": "d15",
               "description": "Model type discriminator",
               "enum": [
                  "d15",
                  "D15"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            },
            "chf": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A simple coefficient of proportionality (SWAN default: 0.1)",
               "title": "Chf"
            }
         },
         "title": "SICE_D15",
         "type": "object"
      },
      "SICE_M18": {
         "additionalProperties": false,
         "description": "Sea ice dissipation based on the method of Meylan et al. (2018).\n\n.. code-block:: text\n\n    SICE [aice] M18 [chf]\n\nReferences\n----------\nMeylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and\nanalysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research\nLetters, 41(14), pp.5046-5051.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_M18\n    sice = SICE_M18()\n    print(sice.render())\n    sice = SICE_M18(aice=0.8, chf=0.059)\n    print(sice.render())",
         "properties": {
            "model_type": {
               "default": "m18",
               "description": "Model type discriminator",
               "enum": [
                  "m18",
                  "M18"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            },
            "chf": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A simple coefficient of proportionality (SWAN default: 0.059)",
               "title": "Chf"
            }
         },
         "title": "SICE_M18",
         "type": "object"
      },
      "SICE_R19": {
         "additionalProperties": false,
         "description": "Sea ice dissipation based on the method of Rogers et al (2019).\n\n.. code-block:: text\n\n    SICE [aice] R19 [c0] [c1] [c2] [c3] [c4] [c5] [c6]\n\nThe default options recover the polynomial of Meylan et al. (2014), calibrated for\na case of ice floes, mostly 10 to 25 m in diameter, in the marginal ice zone near\nAntarctica. Examples for other calibrations can be found in the\nScientific/Technical documentation.\n\nReferences\n----------\nMeylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and\nanalysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research\nLetters, 41(14), pp.5046-5051.\n\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of\ndissipation of energy of ocean waves by sea ice using data from Wave Array 3 of\nthe ONR \u201cSea State\u201d field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_R19\n    sice = SICE_R19()\n    print(sice.render())\n    kwargs = dict(\n        aice=0.5,\n        c0=0.0,\n        c1=0.0,\n        c2=1.06e-3,\n        c3=0.0,\n        c4=0.0,\n        c5=0.0,\n        c6=0.0,\n    )\n    sice = SICE_R19(**kwargs)\n    print(sice.render())",
         "properties": {
            "model_type": {
               "default": "r19",
               "description": "Model type discriminator",
               "enum": [
                  "r19",
                  "R19"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            },
            "c0": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in 1/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C0"
            },
            "c1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C1"
            },
            "c2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s2/m) for determining the rate of sea ice dissipation (SWAN default: 1.06E-3)",
               "title": "C2"
            },
            "c3": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s3/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C3"
            },
            "c4": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s4/m) for determining the rate of sea ice dissipation (SWAN default: 2.3E-2)",
               "title": "C4"
            },
            "c5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s5/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C5"
            },
            "c6": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s6/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C6"
            }
         },
         "title": "SICE_R19",
         "type": "object"
      },
      "SICE_R21B": {
         "additionalProperties": false,
         "description": "Sea ice dissipation based on the method of Rogers et al. (2021).\n\n.. code-block:: text\n\n    SICE [aice] R21B [chf] [npf]\n\nReferences\n----------\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave\nattenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science\nand Technology, 182, p.103198.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_R21B\n    sice = SICE_R21B()\n    print(sice.render())\n    sice = SICE_R21B(aice=0.8, chf=2.9, npf=4.5)\n    print(sice.render())",
         "properties": {
            "model_type": {
               "default": "r21b",
               "description": "Model type discriminator",
               "enum": [
                  "r21b",
                  "R21B"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            },
            "chf": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A simple coefficient of proportionality (SWAN default: 2.9)",
               "title": "Chf"
            },
            "npf": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the degree of dependence on frequency and ice thickness (SWAN default: 4.5)",
               "title": "Npf"
            }
         },
         "title": "SICE_R21B",
         "type": "object"
      },
      "SIDE": {
         "additionalProperties": false,
         "description": "Boundary over one side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n\nThe boundary is one full side of the computational grid (in 1D cases either of the\ntwo ends of the 1D-grid).\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE\n    side = SIDE(side=\"west\", direction=\"ccw\")\n    print(side.render())",
         "properties": {
            "model_type": {
               "default": "side",
               "description": "Model type discriminator",
               "enum": [
                  "side",
                  "SIDE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "side": {
               "description": "The side of the grid to apply the boundary to",
               "enum": [
                  "north",
                  "nw",
                  "west",
                  "sw",
                  "south",
                  "se",
                  "east",
                  "ne"
               ],
               "title": "Side",
               "type": "string"
            },
            "direction": {
               "default": "ccw",
               "description": "The direction to apply the boundary in",
               "enum": [
                  "ccw",
                  "clockwise"
               ],
               "title": "Direction",
               "type": "string"
            }
         },
         "required": [
            "side"
         ],
         "title": "SIDE",
         "type": "object"
      },
      "SIDES": {
         "additionalProperties": false,
         "description": "Boundary over multiple side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n    ...\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE, SIDES\n    side1 = SIDE(side=\"west\", direction=\"ccw\")\n    side2 = SIDE(side=\"north\", direction=\"ccw\")\n    sides = SIDES(sides=[side1, side2])\n    print(sides.render())",
         "properties": {
            "model_type": {
               "default": "sides",
               "description": "Model type discriminator",
               "enum": [
                  "sides",
                  "SIDES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sides": {
               "description": "The sides of the grid to apply the boundary to",
               "items": {
                  "$ref": "#/$defs/SIDE"
               },
               "title": "Sides",
               "type": "array"
            }
         },
         "required": [
            "sides"
         ],
         "title": "SIDES",
         "type": "object"
      },
      "SIGIMPL": {
         "additionalProperties": false,
         "description": "Frequency shifting accuracy.\n\n.. code-block:: text\n\n    SIGIMpl [cfl] [eps2] [outp] [niter]\n\nControls the accuracy of computing the frequency shifting and the stopping\ncriterion and amount of output for the SIP solver (used in the computations in the\npresence of currents or time varying depth)\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import SIGIMPL\n    sigimpl = SIGIMPL()\n    print(sigimpl.render())\n    sigimpl = SIGIMPL(css=0.5, eps2=1e-4, outp=0, niter=20)\n    print(sigimpl.render())",
         "properties": {
            "model_type": {
               "default": "sigimpl",
               "description": "Model type discriminator",
               "enum": [
                  "sigimpl",
                  "SIGIMPL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "css": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A value of `css=0` corresponds to a central scheme and has the largest accuracy (diffusion \u2248 0) but the computation may more easily generate spurious fluctuations. A value of `css=1` corresponds to a first order upwind scheme and it is more diffusive and therefore preferable if (strong) gradients in depth or current are present (SWAN default: 0.5)",
               "title": "Css"
            },
            "eps2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Relative stopping criterion to terminate the linear solver (SIP or SOR). (SWAN default: 1.e-4 in case of SIP and 1.e-6 in case of SOR)",
               "title": "Eps2"
            },
            "outp": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output for the iterative solver:\n\n* 0 = no output\n* 1 = additional information about the iteration process is written to the PRINT file \n* 2 = gives a maximal amount of output concerning the iteration process\n* 3 = summary of the iteration process\n\n(SWAN default: 0)",
               "title": "Outp"
            },
            "niter": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of iterations for the linear solver (SWAN default: 20 in case of SIP and 1000 in case of SOR)",
               "title": "Niter"
            }
         },
         "title": "SIGIMPL",
         "type": "object"
      },
      "SPEC1D": {
         "additionalProperties": false,
         "description": "Frequency 1D spectra.\n\n.. code-block:: text\n\n    SPEC1D\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.output import SPEC1D\n    spec = SPEC1D()\n    print(spec.render())",
         "properties": {
            "model_type": {
               "default": "spec1d",
               "description": "Model type discriminator",
               "enum": [
                  "spec1d",
                  "SPEC1D"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "SPEC1D",
         "type": "object"
      },
      "SPEC2D": {
         "additionalProperties": false,
         "description": "Frequency-direction 2D spectra.\n\n.. code-block:: text\n\n    SPEC2D\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.output import SPEC2D\n    spec = SPEC2D()\n    print(spec.render())",
         "properties": {
            "model_type": {
               "default": "spec2d",
               "description": "Model type discriminator",
               "enum": [
                  "spec2d",
                  "SPEC2D"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "SPEC2D",
         "type": "object"
      },
      "SPECOUT": {
         "additionalProperties": false,
         "description": "Write to data file the wave spectra.\n\n.. code-block:: text\n\n    SPECOUT 'sname' SPEC1D|->SPEC2D ->ABS|REL 'fname' &\n        (OUTPUT [tbeg] [delt] SEC|MIN|HR|DAY)\n\nWith this optional command the user indicates that for each location of the output\nlocation set 'sname' (see commands `POINTS`, `CURVE`, `FRAME` or `GROUP`) the 1D\nor 2D variance / energy (see command `SET`) density spectrum (either the relative\nfrequency or the absolute frequency spectrum) is to be written to a data file.\n\nNote\n----\nThis write command supports the following location types: `POINTS`, `CURVE`,\n`FRAME` and `GROUP`.\n\nNote\n----\nThis output file can be used for defining boundary conditions for subsequent SWAN\nruns (command `BOUNDSPEC`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import SPECOUT\n    out = SPECOUT(sname=\"outpts\", fname=\"./specout.swn\")\n    print(out.render())\n    out = SPECOUT(\n        sname=\"outpts\",\n        dim=dict(model_type=\"spec2d\"),\n        freq=dict(model_type=\"rel\"),\n        fname=\"./specout.nc\",\n        times=dict(tbeg=\"2012-01-01T00:00:00\", delt=\"PT30M\", dfmt=\"min\"),\n    )\n    print(out.render())",
         "properties": {
            "model_type": {
               "default": "specout",
               "description": "Model type discriminator",
               "enum": [
                  "specout",
                  "SPECOUT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations in which the output is to be written",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the data file where the output is written to The file format is defined by the file extension, use `.mat` for MATLAB binary (single precision) or `.nc` for netCDF format. If any other extension is used the ASCII format is assumed",
               "title": "Fname",
               "type": "string"
            },
            "times": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRangeOpen"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Time specification if the user requires output at various times. If this option is not specified data will be written for the last time step of the computation"
            },
            "dim": {
               "anyOf": [
                  {
                     "description": "Choose between 1D or 2D spectra output",
                     "discriminator": {
                        "mapping": {
                           "SPEC1D": "#/$defs/SPEC1D",
                           "SPEC2D": "#/$defs/SPEC2D",
                           "spec1d": "#/$defs/SPEC1D",
                           "spec2d": "#/$defs/SPEC2D"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/SPEC1D"
                        },
                        {
                           "$ref": "#/$defs/SPEC2D"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Dim"
            },
            "freq": {
               "anyOf": [
                  {
                     "description": "Choose between absolute or relative frequency spectra",
                     "discriminator": {
                        "mapping": {
                           "ABS": "#/$defs/ABS",
                           "REL": "#/$defs/REL",
                           "abs": "#/$defs/ABS",
                           "rel": "#/$defs/REL"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/ABS"
                        },
                        {
                           "$ref": "#/$defs/REL"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Freq"
            }
         },
         "required": [
            "sname",
            "fname"
         ],
         "title": "SPECOUT",
         "type": "object"
      },
      "SPECTRUM": {
         "additionalProperties": false,
         "description": "SWAN spectrum specification.\n\n.. code-block:: text\n\n    ->CIRCLE|SECTOR ([dir1] [dir2]) [mdc] [flow] [fhigh] [msc]\n\nNotes\n-----\n\nDirections in the spectra are defined either as a CIRCLE or as a SECTOR. In the\ncase of a SECTOR, both `dir1` and `dir2` must be specified. In the case of a\nCIRCLE, neither `dir1` nor `dir2` should be specified.\n\nAt least two of `flow`, `fhigh` and `msc` must be specified in which case the\nthird parameter will be calculated by SWAN such that the frequency resolution\n`df/f = 0.1` (10% increments).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SPECTRUM\n    spec = SPECTRUM(mdc=36, flow=0.04, fhigh=1.0)\n    print(spec.render())\n    spec = SPECTRUM(mdc=36, dir1=0, dir2=180, flow=0.04, msc=31)\n    print(spec.render())",
         "properties": {
            "model_type": {
               "default": "spectrum",
               "description": "Model type discriminator",
               "enum": [
                  "spectrum",
                  "SPECTRUM"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mdc": {
               "description": "Number of meshes in theta-space. In the case of CIRCLE, this is the number of subdivisions of the 360 degrees of a circle so `dtheta = [360]/[mdc]` is the spectral directional resolution. In the case of SECTOR, `dtheta = ([dir2] - [dir1])/[mdc]`. The minimum number of directional bins is 3 per directional quadrant.",
               "title": "Mdc",
               "type": "integer"
            },
            "flow": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lowest discrete frequency that is used in the calculation (in Hz).",
               "title": "Flow"
            },
            "fhigh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Highest discrete frequency that is used in the calculation (in Hz).",
               "title": "Fhigh"
            },
            "msc": {
               "anyOf": [
                  {
                     "minimum": 3,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "One less than the number of frequencies. This defines the grid resolution in frequency-space between the lowest discrete frequency `flow` and the highest discrete frequency `fhigh`. This resolution is not constant, since the frequencies are distributed logarithmical: `fi+1 = yfi` where `y` is a constant. The minimum number of frequencies is 4",
               "title": "Msc"
            },
            "dir1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the right-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir1"
            },
            "dir2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the left-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir2"
            }
         },
         "required": [
            "mdc"
         ],
         "title": "SPECTRUM",
         "type": "object"
      },
      "SPHERICAL": {
         "additionalProperties": false,
         "description": "Spherical coordinates.\n\n.. code-block:: text\n\n    SPHERICAL [->CCM|QC]\n\nNotes\n-----\n\nprojection options:\n\n* CCM: central conformal Mercator. The horizontal and vertical scales are\n  uniform in terms of cm/degree over the area shown. In the centre of the scale\n  is identical to that of the conventional Mercator projection (but only at\n  that centre). The area in the projection centre is therefore exactly conformal.\n* QC: the projection method is quasi-cartesian, i.e. the horizontal and vertical\n  scales are equal to one another in terms of cm/degree.\n\nAll coordinates of locations and geographical grid sizes are given in degrees;`x`\nis longitude with `x = 0` being the Greenwich meridian and `x > 0` is East of this\nmeridian; `y` is latitude with `y > 0` being the Northern hemisphere. Input and\noutput grids have to be oriented with their x-axis to the East; mesh sizes are in\ndegrees. All other distances are in meters.\n\nNote that spherical coordinates can also be used for relatively small areas, say 10\nor 20 km horizontal dimension. This may be useful if one obtains the boundary\nconditions by nesting in an oceanic model which is naturally formulated in\nspherical coordinates. Note that in case of spherical coordinates regular grids\nmust always be oriented E-W, N-S, i.e. `alpc=0`, `alpinp=0`, `alpfr=0`\n(see commands CGRID, INPUT GRID and FRAME, respectively).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import SPHERICAL\n    coords = SPHERICAL()\n    print(coords.render())\n    coords = SPHERICAL(projection=\"qc\")\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "spherical",
               "description": "Model type discriminator",
               "enum": [
                  "spherical",
                  "SPHERICAL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "projection": {
               "default": "ccm",
               "description": "Defines the projection method in case of spherical coordinates, `ccm` Central Conformal Mercator, `qc` means Quasi-cartesian",
               "enum": [
                  "ccm",
                  "qc"
               ],
               "title": "Projection",
               "type": "string"
            }
         },
         "title": "SPHERICAL",
         "type": "object"
      },
      "SSWELL_ARDHUIN": {
         "additionalProperties": false,
         "description": "Nonbreaking dissipation of Ardhuin et al. (2010).\n\n.. code-block:: text\n\n    SSWELL ARDHUIN [cdsv]\n\nReferences\n----------\nArdhuin, F., Rogers, E., Babanin, A.V., Filipot, J.F., Magne, R., Roland, A.,\nVan Der Westhuysen, A., Queffeulou, P., Lefevre, J.M., Aouf, L. and Collard, F.,\n2010. Semiempirical dissipation source functions for ocean waves. Part I:\nDefinition, calibration, and validation. Journal of Physical Oceanography, 40(9),\npp.1917-1941.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SSWELL_ARDHUIN\n    sswell = SSWELL_ARDHUIN()\n    print(sswell.render())\n    sswell = SSWELL_ARDHUIN(cdsv=1.2)\n    print(sswell.render())",
         "properties": {
            "model_type": {
               "default": "ardhuin",
               "description": "Model type discriminator",
               "enum": [
                  "ardhuin",
                  "ARDHUIN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cdsv": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)",
               "title": "Cdsv"
            }
         },
         "title": "SSWELL_ARDHUIN",
         "type": "object"
      },
      "SSWELL_ROGERS": {
         "additionalProperties": false,
         "description": "Nonbreaking dissipation of Rogers et al. (2012).\n\n.. code-block:: text\n\n    SSWELL ROGERS [cdsv] [feswell]\n\nReferences\n----------\nRogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and\nwhitecapping dissipation in a model for wind-generated surface waves: Description\nand simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9),\npp.1329-1346.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SSWELL_ROGERS\n    sswell = SSWELL_ROGERS()\n    print(sswell.render())\n    sswell = SSWELL_ROGERS(cdsv=1.2, feswell=0.5)\n    print(sswell.render())",
         "properties": {
            "model_type": {
               "default": "rogers",
               "description": "Model type discriminator",
               "enum": [
                  "rogers",
                  "ROGERS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cdsv": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)",
               "title": "Cdsv"
            },
            "feswell": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Swell dissipation factor",
               "title": "Feswell"
            }
         },
         "title": "SSWELL_ROGERS",
         "type": "object"
      },
      "SSWELL_ZIEGER": {
         "additionalProperties": false,
         "description": "Nonbreaking dissipation of Zieger et al. (2015).\n\n.. code-block:: text\n\n    SSWELL ZIEGER [b1]\n\nSwell dissipation of Young et al. (2013) updated by Zieger et al. (2015). The\nZieger option is intended for use with negative wind input via the NEGATINP\ncommand. Zieger non-breaking dissipation follows the method used in WAVEWATCH III\nversion 4 and does not include the steepness-dependent swell coefficient introduced\nin WAVEWATCH III version 5.\n\nReferences\n----------\nZieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based\nsource terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96,\npp.2-25.\n\nYoung, I.R., Babanin, A.V. and Zieger, S., 2013. The decay rate of ocean swell\nobserved by altimeter. Journal of physical oceanography, 43(11), pp.2322-2333.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SSWELL_ZIEGER\n    sswell = SSWELL_ZIEGER()\n    print(sswell.render())\n    sswell = SSWELL_ZIEGER(b1=0.00025)\n    print(sswell.render())",
         "properties": {
            "model_type": {
               "default": "zieger",
               "description": "Model type discriminator",
               "enum": [
                  "zieger",
                  "ZIEGER"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "b1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Non-dimensional proportionality coefficient (SWAN default: 0.00025)",
               "title": "B1"
            }
         },
         "title": "SSWELL_ZIEGER",
         "type": "object"
      },
      "ST6": {
         "additionalProperties": false,
         "description": "St6 source terms subcomponent.\n\n.. code-block:: text\n\n    ST6 [a1sds] [a2sds] [p1sds] [p2sds] UP|DOWN HWANG|FAN|ECMWF VECTAU|SCATAU &\n        TRUE10|U10PROXY [windscaling] DEBIAS [cdfac] (AGROW [a])\n\nwind input and whitecapping from Rogers et al. (2012) (RBW12).\n\nNotes\n-----\nThe two arguments are specified in the Appendix C of the User manual but not in the\ncommand description for WESTH in Section 4.5.4. They are also options in the\nWCAPPING command. It is not entirely clear if they should/could be specified here.\n\nReferences\n----------\nFan, Y., Lin, S.J., Held, I.M., Yu, Z. and Tolman, H.L., 2012. Global ocean surface\nwave simulation using a coupled atmosphere\u2013wave model. Journal of Climate, 25(18),\npp.6233-6252.\n\nRogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and\nwhitecapping dissipation in a model for wind-generated surface waves: Description\nand simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9),\npp.1329-1346.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6\n    st6 = ST6(a1sds=4.7e-7, a2sds=6.6e-6)\n    print(st6.render())\n    kwargs = dict(\n        a1sds=2.8e-6,\n        a2sds=3.5e-5,\n        normalization=\"up\",\n        wind_drag=\"hwang\",\n        tau=\"vectau\",\n        u10=\"u10proxy\",\n        windscaling=32.0,\n        cdfac=0.89,\n        agrow=True,\n        a=0.0015,\n    )\n    st6 = ST6(**kwargs)\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6",
               "default": "st6",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "description": "Coefficient related to local dissipation term T1 (a1 in RBW12)",
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "description": "Coefficient related to local dissipation term T2 (a2 in RBW12)",
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power coefficient controlling strength of dissipation term T1 (L in RBW12, SWAN default: 4)",
               "title": "P1Sds"
            },
            "p2sds": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power coefficient controlling strength of dissipation term T2 (M in RBW12, SWAN default: 4)",
               "title": "P2Sds"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 32.0,
               "description": "Factor to scale U10 with U* when using U10PROXY",
               "title": "Windscaling"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "required": [
            "a1sds",
            "a2sds"
         ],
         "title": "ST6",
         "type": "object"
      },
      "ST6C1": {
         "additionalProperties": false,
         "description": "First ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C1\n    st6 = ST6C1()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c1",
               "default": "st6c1",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 4.7e-07,
               "default": 4.7e-07,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 6.6e-06,
               "default": 6.6e-06,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 28.0,
               "default": 28.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "title": "ST6C1",
         "type": "object"
      },
      "ST6C2": {
         "additionalProperties": false,
         "description": "Second ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP FAN VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C2\n    st6 = ST6C2()\n    print(st6.render())\n\nTODO: Ensure validator is reused here so fan and debias are not used together.",
         "properties": {
            "model_type": {
               "const": "st6c2",
               "default": "st6c2",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "const": "fan",
               "default": "fan",
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 4.7e-07,
               "default": 4.7e-07,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 6.6e-06,
               "default": 6.6e-06,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 28.0,
               "default": 28.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "title": "ST6C2",
         "type": "object"
      },
      "ST6C3": {
         "additionalProperties": false,
         "description": "Third ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C3\n    st6 = ST6C3()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c3",
               "default": "st6c3",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 2.8e-06,
               "default": 2.8e-06,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 3.5e-05,
               "default": 3.5e-05,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 32.0,
               "default": 32.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "title": "ST6C3",
         "type": "object"
      },
      "ST6C4": {
         "additionalProperties": false,
         "description": "Fourth ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 DEBIAS 0.89 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C4\n    st6 = ST6C4()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c4",
               "default": "st6c4",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 2.8e-06,
               "default": 2.8e-06,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 3.5e-05,
               "default": 3.5e-05,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 32.0,
               "default": 32.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "const": 0.89,
               "default": 0.89,
               "title": "Cdfac",
               "type": "number"
            }
         },
         "title": "ST6C4",
         "type": "object"
      },
      "ST6C5": {
         "additionalProperties": false,
         "description": "Fifth ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C5\n    st6 = ST6C5()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c5",
               "default": "st6c5",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 6.5e-06,
               "default": 6.5e-06,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 8.5e-05,
               "default": 8.5e-05,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 35.0,
               "default": 35.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "const": 0.89,
               "default": 0.89,
               "title": "Cdfac",
               "type": "number"
            }
         },
         "title": "ST6C5",
         "type": "object"
      },
      "STARTUP": {
         "additionalProperties": false,
         "description": "Startup group component.\n\n.. code-block:: text\n\n    PROJECT ...\n    SET ...\n    MODE ...\n    COORDINATES ...\n\nThis group component is used to group individual startup components. Only fields\nthat are explicitly prescribed are rendered by this group component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import PROJECT, SET, MODE, COORDINATES\n    from rompy.swan.components.group import STARTUP\n    proj = PROJECT(nr=\"01\")\n    set = SET(level=0.5, direction_convention=\"nautical\")\n    mode = MODE(kind=\"nonstationary\", dim=\"twodimensional\")\n    coords = COORDINATES(kind=dict(model_type=\"spherical\", projection=\"ccm\"))\n    startup = STARTUP(\n        project=proj,\n        set=set,\n        mode=mode,\n        coordinates=coords,\n    )\n    print(startup.render())",
         "properties": {
            "model_type": {
               "default": "startup",
               "description": "Model type discriminator",
               "enum": [
                  "startup",
                  "STARTUP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "project": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/PROJECT",
                     "description": "Project component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "set": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/SET",
                     "description": "Set component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "mode": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/MODE",
                     "description": "Mode component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            },
            "coordinates": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/COORDINATES",
                     "description": "Coordinates component"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null
            }
         },
         "title": "STARTUP",
         "type": "object"
      },
      "STAT": {
         "additionalProperties": false,
         "description": "Computation parameters in stationary computation.",
         "properties": {
            "model_type": {
               "default": "stat",
               "description": "Model type discriminator",
               "enum": [
                  "stat",
                  "STAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mxitst": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of iterations for stationary computations. The computation stops when this number is exceeded (SWAN default:  50)",
               "title": "Mxitst"
            },
            "alfa": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality constant used in the frequency-dependent under-relaxation technique. Based on experiences, a suggestion for this parameter is `alfa = 0.01`. In case of diffraction computations, the use of this parameter is recommended (SWAN default: 0.00)",
               "title": "Alfa"
            }
         },
         "title": "STAT",
         "type": "object"
      },
      "STATIONARY": {
         "additionalProperties": false,
         "description": "Stationary time specification.\n\n.. code-block:: text\n\n    STATIONARY [time]\n\nNote\n----\nThe field `time` is optional to allow for the case where the user wants to set the\ntime dynamically after instantiating this component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import STATIONARY\n    stat = STATIONARY(time=\"2012-01-01T00:00:00\")\n    print(stat.render())",
         "properties": {
            "model_type": {
               "default": "stationary",
               "description": "Model type discriminator",
               "enum": [
                  "stationary",
                  "STATIONARY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "time": {
               "default": "1970-01-01T00:00:00",
               "description": "Stationary time",
               "format": "date-time",
               "title": "Time",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            }
         },
         "title": "STATIONARY",
         "type": "object"
      },
      "STOPC": {
         "additionalProperties": false,
         "description": "Stopping criteria of  Zijlema and Van der Westhuysen (2005).\n\n.. code-block:: text\n\n    STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter]\n\nWith this option the user can influence the criterion for terminating the iterative\nprocedure in the SWAN computations (both stationary and nonstationary). The\ncriterion makes use of the second derivative, or curvature, of the iteration curve\nof the significant wave height. As the solution of a simulation approaches full\nconvergence, the curvature of the iteration curve will tend to zero. SWAN stops the\nprocess if the relative change in Hs from one iteration to the next is less than\n`drel` and the curvature of the iteration curve of Hs normalized with Hs is less\nthan `curvat` or the absolute change in Hs from one iteration to the next is less\nthan `dabs`. Both conditions need to be fulfilled in more than fraction `npnts`\npercent of all wet grid points.\n\nWith respect to the QC modelling, another stopping criteria will be employed.\nNamely, SWAN stops the iteration process if the absolute change in Hs from one\niterate to another is less than `dabs` * Hinc, where Hinc is the representative\nincident wave height, or the relative change in Hs from one to the next iteration\nis less than `drel`. These criteria must be fulfilled in more than `npnts`\npercent of all active, well-defined points.\n\nReferences\n----------\n- Zijlema, M. and Van der Westhuysen, A. (2005). On convergence behaviour and\n  numerical accuracy in stationary SWAN simulations of nearshore wind wave spectra,\n  Coastal Engineering, 52(3), p. 337-256.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import STOPC\n    stop = STOPC()\n    print(stop.render())\n    stop = STOPC(\n        dabs=0.005,\n        drel=0.01,\n        curvat=0.005,\n        npnts=99.5,\n        mode=dict(model_type=\"nonstat\", mxitns=1),\n        limiter=0.1,\n    )\n    print(stop.render())",
         "properties": {
            "model_type": {
               "default": "stopc",
               "description": "Model type discriminator",
               "enum": [
                  "stopc",
                  "STOPC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "dabs": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum absolute change in Hs from one iteration to the next (SWAN default: 0.005 [m] or 0.05 [-] in case of QC model)",
               "title": "Dabs"
            },
            "drel": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum relative change in Hs from one iteration to the next (SWAN default: 0.01 [-])",
               "title": "Drel"
            },
            "curvat": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum curvature of the iteration curve of Hs normalised with Hs (SWAN default: 0.005 [-] (not used in the QC model))",
               "title": "Curvat"
            },
            "npnts": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 99.5 [-])",
               "title": "Npnts"
            },
            "mode": {
               "anyOf": [
                  {
                     "discriminator": {
                        "mapping": {
                           "NONSTAT": "#/$defs/NONSTAT",
                           "STAT": "#/$defs/STAT",
                           "nonstat": "#/$defs/NONSTAT",
                           "stat": "#/$defs/STAT"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/STAT"
                        },
                        {
                           "$ref": "#/$defs/NONSTAT"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Termination criteria for stationary or nonstationary runs",
               "title": "Mode"
            },
            "limiter": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)",
               "title": "Limiter"
            }
         },
         "title": "STOPC",
         "type": "object"
      },
      "SURFBEAT": {
         "additionalProperties": false,
         "description": "Surfbeat.\n\n.. code-block:: text\n\n    SURFBEAT [df] [nmax] [emin] UNIFORM/LOGARITHMIC\n\nUsing this optional command, the user activates the Infragravity Energy Module\n(IEM) of Reniers and Zijlema (2022). Besides the energy balance equation for a\nsea-swell wave field, another energy balance is included to account for the\ntransfer of sea-swell energy to the bound infragravity (BIG) wave. This\ninfragravity energy balance also involves a nonlinear transfer, expressed by the\nbiphase, through the phase coupling between the radiation stress forcing and the\nBIG wave. For the prediction of the biphase for obliquely incident waves, an\nevolution equation is provided under the assumption that the bottom slopes are mild\nand alongshore uniform.\n\nReferences\n----------\nReniers, A. and Zijlema, M., 2022. Swan surfbeat-1d. Coastal Engineering, 172,\np.104068.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import SURFBEAT\n    surfbeat = SURFBEAT()\n    print(surfbeat.render())\n    surfbeat = SURFBEAT(df=0.01, nmax=50000, emin=0.05, spacing=\"logarithmic\")\n    print(surfbeat.render())",
         "properties": {
            "model_type": {
               "default": "surfbeat",
               "description": "Model type discriminator",
               "enum": [
                  "surfbeat",
                  "SURFBEAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "df": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The constant size of BIG frequency bin (in Hz) (SWAN default: 0.01)",
               "title": "Df"
            },
            "nmax": {
               "anyOf": [
                  {
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of short-wave pairs for creating bichromatic wave groups (SWAN default: 50000)",
               "title": "Nmax"
            },
            "emin": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The energy threshold in fraction of energy spectrum peak. With this threshold one takes into account those short wave components to create bichromatic wave groups while their energy levels are larger than `emin x E_max` with `E_max` the peak of the spectrum (SWAN default: 0.05)",
               "title": "Emin"
            },
            "spacing": {
               "anyOf": [
                  {
                     "enum": [
                        "uniform",
                        "logarithmic"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Define if frequencies for reflected ig waves are uniformly or logarithmically distributed",
               "title": "Spacing"
            }
         },
         "title": "SURFBEAT",
         "type": "object"
      },
      "SourceDatamesh": {
         "additionalProperties": false,
         "description": "Source dataset from Datamesh.\n\nDatamesh documentation: https://docs.oceanum.io/datamesh/index.html",
         "properties": {
            "model_type": {
               "const": "datamesh",
               "default": "datamesh",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "datasource": {
               "description": "The id of the datasource on Datamesh",
               "title": "Datasource",
               "type": "string"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Datamesh API token, taken from the environment if not provided",
               "title": "Token"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to `oceanum.datamesh.Connector`",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "datasource",
            "token"
         ],
         "title": "SourceDatamesh",
         "type": "object"
      },
      "SourceFile": {
         "additionalProperties": false,
         "description": "Source dataset from file to open with xarray.open_dataset.",
         "properties": {
            "model_type": {
               "const": "file",
               "default": "file",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to xarray.open_dataset",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri"
         ],
         "title": "SourceFile",
         "type": "object"
      },
      "SourceIntake": {
         "additionalProperties": false,
         "description": "Source dataset from intake catalog.\n\nnote\n----\nThe intake catalog can be prescribed either by the URI of an existing catalog file\nor by a YAML string defining the catalog. The YAML string can be obtained from\ncalling the `yaml()` method on an intake dataset instance.",
         "properties": {
            "model_type": {
               "const": "intake",
               "default": "intake",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "dataset_id": {
               "description": "The id of the dataset to read in the catalog",
               "title": "Dataset Id",
               "type": "string"
            },
            "catalog_uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URI of the catalog to read from",
               "title": "Catalog Uri"
            },
            "catalog_yaml": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The YAML string of the catalog to read from",
               "title": "Catalog Yaml"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to define intake dataset parameters",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "dataset_id"
         ],
         "title": "SourceIntake",
         "type": "object"
      },
      "SourceTimeseriesCSV": {
         "additionalProperties": false,
         "description": "Timeseries source class from CSV file.\n\nThis class should return a timeseries from a CSV file. The dataset variables are\ndefined from the column headers, therefore the appropriate read_csv kwargs must be\npassed to allow defining the columns. The time index is defined from column name\nidentified by the tcol field.",
         "properties": {
            "model_type": {
               "const": "csv",
               "default": "csv",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the csv file",
               "title": "Filename"
            },
            "tcol": {
               "default": "time",
               "description": "Name of the column containing the time data",
               "title": "Tcol",
               "type": "string"
            },
            "read_csv_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to pandas.read_csv",
               "title": "Read Csv Kwargs",
               "type": "object"
            }
         },
         "required": [
            "filename"
         ],
         "title": "SourceTimeseriesCSV",
         "type": "object"
      },
      "SourceWavespectra": {
         "additionalProperties": false,
         "description": "Wavespectra dataset from wavespectra reader.",
         "properties": {
            "model_type": {
               "const": "wavespectra",
               "default": "wavespectra",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "reader": {
               "description": "Name of the wavespectra reader to use, e.g., read_swan",
               "title": "Reader",
               "type": "string"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to the wavespectra reader",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri",
            "reader"
         ],
         "title": "SourceWavespectra",
         "type": "object"
      },
      "SwanDataGrid": {
         "additionalProperties": false,
         "description": "This class is used to write SWAN data from a dataset.",
         "properties": {
            "model_type": {
               "const": "grid",
               "default": "grid",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "id": {
               "default": "data",
               "description": "Unique identifier for this data source",
               "title": "Id",
               "type": "string"
            },
            "source": {
               "description": "Source reader, must return an xarray gridded dataset in the open method",
               "discriminator": {
                  "mapping": {
                     "csv": "#/$defs/SourceTimeseriesCSV",
                     "datamesh": "#/$defs/SourceDatamesh",
                     "file": "#/$defs/SourceFile",
                     "intake": "#/$defs/SourceIntake",
                     "wavespectra": "#/$defs/SourceWavespectra"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/SourceTimeseriesCSV"
                  },
                  {
                     "$ref": "#/$defs/SourceDatamesh"
                  },
                  {
                     "$ref": "#/$defs/SourceFile"
                  },
                  {
                     "$ref": "#/$defs/SourceIntake"
                  },
                  {
                     "$ref": "#/$defs/SourceWavespectra"
                  }
               ],
               "title": "Source"
            },
            "link": {
               "default": false,
               "description": "Whether to create a symbolic link instead of copying the file",
               "title": "Link",
               "type": "boolean"
            },
            "filter": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Filter"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Optional filter specification to apply to the dataset"
            },
            "variables": {
               "anyOf": [
                  {
                     "items": {
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": [],
               "description": "Subset of variables to extract from the dataset",
               "title": "Variables"
            },
            "coords": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/DatasetCoords"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {
                  "t": "time",
                  "x": "longitude",
                  "y": "latitude",
                  "z": "depth",
                  "s": "site"
               },
               "description": "Names of the coordinates in the dataset"
            },
            "crop_data": {
               "default": true,
               "description": "Update crop filters from Grid and Time objects if passed to get method",
               "title": "Crop Data",
               "type": "boolean"
            },
            "buffer": {
               "default": 0.0,
               "description": "Space to buffer the grid bounding box if `filter_grid` is True",
               "title": "Buffer",
               "type": "number"
            },
            "time_buffer": {
               "default": [
                  0,
                  0
               ],
               "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
               "items": {
                  "type": "integer"
               },
               "title": "Time Buffer",
               "type": "array"
            },
            "z1": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the data variable in dataset representing either a scaler parameter or the u-componet of a vector field",
               "title": "Z1"
            },
            "z2": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the data variable in dataset representing the v-componet of a vector field",
               "title": "Z2"
            },
            "var": {
               "$ref": "#/$defs/GridOptions",
               "description": "SWAN input grid name"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "title": "Fac",
               "type": "number"
            }
         },
         "required": [
            "source",
            "var"
         ],
         "title": "SwanDataGrid",
         "type": "object"
      },
      "TABLE": {
         "additionalProperties": false,
         "description": "Write spatial distributions.\n\n.. code-block:: text\n\n    TABLE 'sname' ->HEADER|NOHEADER|INDEXED 'fname'  < output > &\n        (OUTPUT [tbegblk] [deltblk]) SEC|MIN|HR|DAY\n\nWith this optional command the user indicates that for each location of the output\nlocation set 'sname' (see commands `POINTS`, `CURVE`, `FRAME` or `GROUP`) one or\nmore variables should be written to a file. The keywords `HEADER` and `NOHEADER`\ndetermine the appearance of the table; the filename determines the destination of\nthe data.\n\nNote\n----\n**HEADER**:\noutput is written in fixed format to file with headers giving name of variable\nand unit per column (numbers too large to be written will be shown as `****`.\nThe number of header lines is 4.\n\n**NOHEADER**:\noutput is written in floating point format to file and has no headers.\n\n**INDEXED**:\noutput compatible with GIS tools such as ARCVIEW, ARCINFO, etc. The user should\ngive two TABLE commands, one to produce one file with `XP` and `YP` as output\nquantities, the other with `HS`, `RTM01` or other output quantities.\n\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import TABLE\n    table = TABLE(\n        sname=\"outpts\",\n        format=\"noheader\",\n        fname=\"./output_table.nc\",\n        output=[\"hsign\", \"hswell\", \"dir\", \"tps\", \"tm01\", \"watlev\", \"qp\"],\n        times=dict(tbeg=\"2012-01-01T00:00:00\", delt=\"PT30M\", dfmt=\"min\"),\n    )\n    print(table.render())",
         "properties": {
            "model_type": {
               "default": "table",
               "description": "Model type discriminator",
               "enum": [
                  "table",
                  "TABLE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations in which the output is to be written",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the data file where the output is written to The file format is defined by the file extension, use `.mat` for MATLAB binary (single precision) or `.nc` for netCDF format. If any other extension is used the ASCII format is assumed",
               "title": "Fname",
               "type": "string"
            },
            "times": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRangeOpen"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Time specification if the user requires output at various times. If this option is not specified data will be written for the last time step of the computation"
            },
            "format": {
               "anyOf": [
                  {
                     "enum": [
                        "header",
                        "noheader",
                        "indexed"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicate if the table should be written to a file as a HEADER, NOHEADER or INDEXED table format (SWAN default: HEADER)",
               "title": "Format"
            },
            "output": {
               "description": "The output variables to output to block file",
               "items": {
                  "$ref": "#/$defs/BlockOptions"
               },
               "minItems": 1,
               "title": "Output",
               "type": "array"
            }
         },
         "required": [
            "sname",
            "fname",
            "output"
         ],
         "title": "TABLE",
         "type": "object"
      },
      "TEST": {
         "additionalProperties": false,
         "description": "Write intermediate results.\n\n.. code-block:: text\n\n    TEST [itest] [itrace] POINTS XY|IJ (PAR 'fname') (S1D 'fname') (S2D 'fname')\n\nNote\n----\nThe 6 source terms written due to the presence of the keyword S1D or S2D are: wind\ninput, whitecapping, bottom friction, breaking, 3- and 4- wave interactions.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import TEST\n    test = TEST(\n        itest=10,\n        points=dict(model_type=\"ij\", i=[0, 0], j=[10, 20]),\n        fname_par=\"integral_parameters.test\",\n        fname_s1d=\"1d_variance_density.test\",\n        fname_s2d=\"2d_variance_density.test\",\n    )\n    print(test.render())\n    import numpy as np\n    test = TEST(\n        points=dict(\n            model_type=\"xy\",\n            x=np.linspace(172.5, 174.0, 25),\n            y=25*[-38],\n        ),\n        fname_s2d=\"2d_variance_density.test\",\n    )\n    print(test.render())\n\nTODO: Support `k` in POINTS IJ.",
         "properties": {
            "model_type": {
               "default": "test",
               "description": "Model type discriminator",
               "enum": [
                  "test",
                  "TEST"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "itest": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The level of test output, for values under 100 the amount is usually reasonable, for values above 200 it can be very large. Values of up to 50 can be interpreted by the user (SWAN default: 1)",
               "title": "Itest"
            },
            "itrace": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "SWAN writes a message (name of subroutine) to the PRINT file at the first `itrace` entries of each subroutine (SWAN default: 0)",
               "title": "Itrace"
            },
            "points": {
               "description": "Points where detailed print output is produced (max of 50 points)",
               "discriminator": {
                  "mapping": {
                     "IJ": "#/$defs/IJ",
                     "XY": "#/$defs/XY",
                     "ij": "#/$defs/IJ",
                     "xy": "#/$defs/XY"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/XY"
                  },
                  {
                     "$ref": "#/$defs/IJ"
                  }
               ],
               "title": "Points"
            },
            "fname_par": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the file where the integral parameters are written to",
               "title": "Fname Par"
            },
            "fname_s1d": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the file where the 1D variance density and 6 source terms are written to",
               "title": "Fname S1D"
            },
            "fname_s2d": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the file where the 2D variance density and 6 source terms are written to",
               "title": "Fname S2D"
            }
         },
         "required": [
            "points"
         ],
         "title": "TEST",
         "type": "object"
      },
      "TMA": {
         "additionalProperties": false,
         "description": "TMA spectral shape.\n\n.. code-block:: text\n\n    TMA [gamma] [d]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import TMA\n    shape = TMA(gamma=2.0, d=18)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "tma",
               "description": "Model type discriminator",
               "enum": [
                  "tma",
                  "TMA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            },
            "d": {
               "description": "The reference depth at the wave maker in meters.",
               "exclusiveMinimum": 0.0,
               "title": "D",
               "type": "number"
            }
         },
         "required": [
            "d"
         ],
         "title": "TMA",
         "type": "object"
      },
      "TRANS1D": {
         "additionalProperties": false,
         "description": "Frequency dependent transmission.\n\n.. code-block:: text\n\n    TRANS1D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS1D\n    transm = TRANS1D(trcoef=[0.0, 0.0, 0.2, 0.5, 0.2, 0.0, 0.0])\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "trans1d",
               "description": "Model type discriminator",
               "enum": [
                  "trans1d",
                  "TRANS1D"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency. The number of these transmission values must be equal to the number of frequencies, i.e. `msc` + 1",
               "items": {
                  "maximum": 1.0,
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Trcoef",
               "type": "array"
            }
         },
         "required": [
            "trcoef"
         ],
         "title": "TRANS1D",
         "type": "object"
      },
      "TRANS2D": {
         "additionalProperties": false,
         "description": "Frequency-direction dependent transmission.\n\n.. code-block:: text\n\n    TRANS2D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS2D\n    trcoef = np.array([[0.0, 0.0], [0.1, 0.1], [0.2, 0.2]])\n    transm = TRANS2D(trcoef=trcoef)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "trans2d",
               "description": "Model type discriminator",
               "enum": [
                  "trans2d",
                  "TRANS2D"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency and direction, rows represent directions and columns represent frequencies",
               "properties": {
                  "data_type": {
                     "default": "Any",
                     "title": "dtype",
                     "type": "string"
                  },
                  "data": {
                     "items_schema": {
                        "items_schema": {
                           "type": "any"
                        },
                        "type": "list"
                     },
                     "max_length": 2,
                     "min_length": 2,
                     "type": "list"
                  }
               },
               "required": [
                  "data_type",
                  "data"
               ],
               "title": "Numpy Array",
               "type": "np.ndarray[tuple[int, int], np.dtype[Any]]"
            }
         },
         "required": [
            "trcoef"
         ],
         "title": "TRANS2D",
         "type": "object"
      },
      "TRANSM": {
         "additionalProperties": false,
         "description": "Constant transmission coefficient.\n\n.. code-block:: text\n\n    TRANSM [trcoef]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANSM\n    transm = TRANSM()\n    print(transm.render())\n    transm = TRANSM(trcoef=0.5)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "transm",
               "description": "Model type discriminator",
               "enum": [
                  "transm",
                  "TRANSM"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Constant transmission coefficient (ratio of transmitted over incoming significant wave height) (SWAN default: 0.0) (no transmission = complete blockage)",
               "title": "Trcoef"
            }
         },
         "title": "TRANSM",
         "type": "object"
      },
      "TRIAD": {
         "additionalProperties": false,
         "description": "Wave triad interactions.\n\n.. code-block:: text\n\n    TRIAD [itriad] [trfac] [cutfr] [a] [b] [urcrit] [urslim]\n\nWith this command the user can activate the triad wave-wave interactions. If this\ncommand is not used, SWAN will not account for triads.\n\nNote\n----\nThis is the TRIAD specification in SWAN < 41.45.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD\n    triad = TRIAD()\n    print(triad.render())\n    triad = TRIAD(\n        itriad=1,\n        trfac=0.8,\n        cutfr=2.5,\n        a=0.95,\n        b=-0.75,\n        ucrit=0.2,\n        urslim=0.01,\n    )\n    print(triad.render())",
         "properties": {
            "model_type": {
               "default": "triad",
               "description": "Model type discriminator",
               "enum": [
                  "triad",
                  "TRIAD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "itriad": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Approximation method for the triad computation: \n\n* 1: the LTA method of Eldeberky (1996) \n* 2: the SPB method of Becq-Girard et al. (1999) (SWAN default: 1)",
               "title": "Itriad"
            },
            "trfac": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient (SWAN default: 0.8 in case of LTA method, 0.9 in case of SPB method)",
               "title": "Trfac"
            },
            "cutfr": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the maximum frequency that is considered in the LTA computation. The value of `cutfr` is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)",
               "title": "Cutfr"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: 0.95)",
               "title": "A"
            },
            "b": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: -0.75 for 1D, 0.0 for 2D",
               "title": "B"
            },
            "ucrit": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The critical Ursell number appearing in the expression for the biphase (SWAN default: 0.2)",
               "title": "Ucrit"
            },
            "urslim": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The lower threshold for Ursell number, if the actual Ursell number is below this value triad interactions are be computed (SWAN default: 0.01)",
               "title": "Urslim"
            }
         },
         "title": "TRIAD",
         "type": "object"
      },
      "TRIAD_DCTA": {
         "additionalProperties": false,
         "description": "Triad interactions with the DCTA method of Booij et al. (2009).\n\n.. code-block:: text\n\n    TRIAD DCTA [trfac] [p] COLL|NONC BIPHHASE ELDEBERKY|DEWIT\n\nReferences\n----------\nBooij, N., Holthuijsen, L.H. and B\u00e9nit, M.P., 2009. A distributed collinear triad\napproximation in SWAN. In Proceedings Of Coastal Dynamics 2009: Impacts of Human\nActivities on Dynamic Coastal Processes (With CD-ROM) (pp. 1-10).\n\nNote\n----\nThis is the default method to compute the triad interactions in SWAN >= 41.45, it\nis not supported in earlier versions of the model.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD_DCTA\n    triad = TRIAD_DCTA()\n    print(triad.render())\n    triad = TRIAD_DCTA(\n        trfac=4.4,\n        p=1.3,\n        noncolinear=True,\n        biphase={\"model_type\": \"dewit\", \"lpar\": 0.0},\n    )\n    print(triad.render())",
         "properties": {
            "model_type": {
               "default": "dcta",
               "description": "Model type discriminator",
               "enum": [
                  "dcta",
                  "DCTA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trfac": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scaling factor that controls the intensity of the triad interaction due to DCTA (SWAN default: 4.4)",
               "title": "Trfac"
            },
            "p": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape coefficient to force the high-frequency tail(SWAN default: 4/3)",
               "title": "P"
            },
            "noncolinear": {
               "default": false,
               "description": "If True, the noncolinear triad interactions with the DCTA framework are accounted for",
               "title": "Noncolinear",
               "type": "boolean"
            },
            "biphase": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ELDEBERKY"
                  },
                  {
                     "$ref": "#/$defs/DEWIT"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)",
               "title": "Biphase"
            }
         },
         "title": "TRIAD_DCTA",
         "type": "object"
      },
      "TRIAD_LTA": {
         "additionalProperties": false,
         "description": "Triad interactions with the LTA method of Eldeberky (1996).\n\n.. code-block:: text\n\n    TRIAD LTA [trfac] [cutfr] BIPHHASE ELDEBERKY|DEWIT\n\nReferences\n----------\nEldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for\nmodeling triad interactions in dispersive waves. In Coastal Engineering 1996\n(pp. 1088-1101).\n\nNote\n----\nThis method to compute the triad interactions is only supported in SWAN >= 41.45.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD_LTA\n    triad = TRIAD_LTA()\n    print(triad.render())\n    triad = TRIAD_LTA(\n        trfac=0.8,\n        cutfr=2.5,\n        biphase={\"model_type\": \"eldeberky\", \"urcrit\": 0.63},\n    )\n    print(triad.render())",
         "properties": {
            "model_type": {
               "default": "lta",
               "description": "Model type discriminator",
               "enum": [
                  "lta",
                  "LTA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trfac": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scaling factor that controls the intensity of the triad interaction due to LTA (SWAN default: 0.8)",
               "title": "Trfac"
            },
            "cutfr": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the maximum frequency that is considered in the LTA computation. The value of `cutfr` is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)",
               "title": "Cutfr"
            },
            "biphase": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ELDEBERKY"
                  },
                  {
                     "$ref": "#/$defs/DEWIT"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)",
               "title": "Biphase"
            }
         },
         "title": "TRIAD_LTA",
         "type": "object"
      },
      "TRIAD_SPB": {
         "additionalProperties": false,
         "description": "Triad interactions with the SPB method of Becq-Girard et al. (1999).\n\n.. code-block:: text\n\n    TRIAD SPB [trfac] [a] [b] BIPHHASE ELDEBERKY|DEWIT\n\nReferences\n----------\nBecq-Girard, F., Forget, P. and Benoit, M., 1999. Non-linear propagation of\nunidirectional wave fields over varying topography. Coastal Engineering, 38(2),\npp.91-113.\n\nNote\n----\nThis method to compute the triad interactions is only supported in SWAN >= 41.45.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD_SPB\n    triad = TRIAD_SPB()\n    print(triad.render())\n    triad = TRIAD_SPB(\n        trfac=0.9,\n        a=0.95,\n        b=0.0,\n        biphase={\"model_type\": \"eldeberky\", \"urcrit\": 0.63},\n    )\n    print(triad.render())",
         "properties": {
            "model_type": {
               "default": "spb",
               "description": "Model type discriminator",
               "enum": [
                  "spb",
                  "SPB"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trfac": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scaling factor that controls the intensity of the triad interaction due to SPB (SWAN default: 0.9)",
               "title": "Trfac"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is 0.95 and is calibrated by means of laboratory experiments (SWAN default: 0.95)",
               "title": "A"
            },
            "b": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is -0.75 and is calibrated by means of laboratory experiments. However, it may not be appropriate for true 2D field cases as it does not scale with the wave field characteristics. Hence, this parameter is set to zero (SWAN default: 0.0)",
               "title": "B"
            },
            "biphase": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ELDEBERKY"
                  },
                  {
                     "$ref": "#/$defs/DEWIT"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)",
               "title": "Biphase"
            }
         },
         "title": "TRIAD_SPB",
         "type": "object"
      },
      "TURBULENCE": {
         "additionalProperties": false,
         "description": "Turbulent viscosity.\n\n.. code-block:: text\n\n    TURBULENCE [ctb] (CURRENT [tbcur])\n\nWith this optional command the user can activate turbulent viscosity. This physical\neffect is also activated by reading values of the turbulent viscosity using the\n`READGRID TURB` command, but then with the default value of `ctb`. The command\n`READGRID TURB` is necessary if this command `TURB` is used since the value of the\nviscosity is assumed to vary over space.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TURBULENCE\n    turbulence = TURBULENCE(current=False)\n    print(turbulence.render())\n    turbulence = TURBULENCE(ctb=0.01, current=True, tbcur=0.004)\n    print(turbulence.render())",
         "properties": {
            "model_type": {
               "default": "turbulence",
               "description": "Model type discriminator",
               "enum": [
                  "turbulence",
                  "TURBULENCE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ctb": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The value of the proportionality coefficient appearing in the energy dissipation term (SWAN default: 0.01)",
               "title": "Ctb"
            },
            "current": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": true,
               "description": "If this keyword is present the turbulent viscosity will be derived from the product of the depth and the absolute value of the current velocity. If the command `READGRID TURB` is used, this option is ignored; the values read from file will prevail",
               "title": "Current"
            },
            "tbcur": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The factor by which depth x current velocity is multiplied in order to get the turbulent viscosity (SWAN default: 0.004)",
               "title": "Tbcur"
            }
         },
         "title": "TURBULENCE",
         "type": "object"
      },
      "TimeRangeOpen": {
         "additionalProperties": false,
         "description": "Regular times with an open boundary.\n\n.. code-block:: text\n\n    [tbeg] [delt] SEC|MIN|HR|DAY\n\nTime is rendered in one of the following formats:\n\n* 1: ISO-notation 19870530.153000\n* 2: (as in HP compiler) '30-May-87 15:30:00'\n* 3: (as in Lahey compiler) 05/30/87.15:30:00\n* 4: 15:30:00\n* 5: 87/05/30 15:30:00'\n* 6: as in WAM 8705301530\n\nNote\n----\nThe `tbeg` field can be specified as:\n\n* existing datetime object\n* int or float, assumed as Unix time, i.e. seconds (if >= -2e10 or <= 2e10) or\n  milliseconds (if < -2e10 or > 2e10) since 1 January 1970.\n* ISO 8601 time string.\n\nNote\n----\nThe `tdelta` field can be specified as:\n\n* existing timedelta object\n* int or float, assumed as seconds\n* ISO 8601 duration string, following formats work:\n\n    * `[-][DD ][HH:MM]SS[.ffffff]`\n    * `[\u00b1]P[DD]DT[HH]H[MM]M[SS]S` (ISO 8601 format for timedelta)\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import TimeRangeOpen\n    from datetime import datetime, timedelta\n    times = TimeRangeOpen(\n        tbeg=datetime(1990, 1, 1), delt=timedelta(minutes=30), dfmt=\"min\"\n    )\n    print(times.render())\n    times = TimeRangeOpen(\n        tbeg=\"2012-01-01T00:00:00\", delt=\"PT1H\", tfmt=2, dfmt=\"hr\", suffix=\"blk\"\n    )\n    print(times.render())",
         "properties": {
            "model_type": {
               "default": "open",
               "description": "Model type discriminator",
               "enum": [
                  "open",
                  "OPEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "tbeg": {
               "default": "1970-01-01T00:00:00",
               "description": "Start time",
               "format": "date-time",
               "title": "Tbeg",
               "type": "string"
            },
            "delt": {
               "default": "PT1H",
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            },
            "suffix": {
               "default": "",
               "description": "Suffix to prepend to argument names when rendering",
               "title": "Suffix",
               "type": "string"
            }
         },
         "title": "TimeRangeOpen",
         "type": "object"
      },
      "VARIABLEFILE": {
         "additionalProperties": false,
         "description": "Variable file specification.\n\n.. code-block:: text\n\n    VARIABLE FILE < [len] 'fname' [seq] >\n\nThere are three types of files:\n\n- TPAR files containing nonstationary wave parameters\n- files containing stationary or nonstationary 1D spectra\n  (usually from measurements)\n- files containing stationary or nonstationary 2D spectra\n  (from other computer programs or other SWAN runs)\n\nA TPAR file is for only one location; it has the string TPAR on the first\nline of the file and a number of lines which each contain 5 numbers, i.e.:\nTime (ISO-notation), Hs, Period (average or peak period depending on the\nchoice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian,\ndepending on command SET), Directional spread (in degrees or as power of cos\ndepending on the choice given in command BOUND SHAPE).\n\nNote\n----\nExample of a TPAR file:\n\n.. code-block:: text\n\n    TPAR\n    19920516.130000 4.2 12. -110. 22.\n    19920516.180000 4.2 12. -110. 22.\n    19920517.000000 1.2 8. -110. 22.\n    19920517.120000 1.4 8.5 -80. 26\n    19920517.200000 0.9 6.5 -95. 28\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import VARIABLEFILE\n    par = VARIABLEFILE(\n        fname=[\"tpar1.txt\", \"tpar2.txt\", \"tpar3.txt\"],\n        len=[0.0, 0.5, 1.0],\n    )\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "variablefile",
               "description": "Model type discriminator",
               "enum": [
                  "variablefile",
                  "VARIABLEFILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Names of the files containing the boundary condition",
               "items": {
                  "maxLength": 36,
                  "type": "string"
               },
               "title": "Fname",
               "type": "array"
            },
            "seq": {
               "anyOf": [
                  {
                     "items": {
                        "minimum": 1,
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case [seq] must always be 1.",
               "title": "Seq"
            },
            "len": {
               "description": "Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. [len] is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of `len` should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment.",
               "items": {
                  "minimum": 0,
                  "type": "number"
               },
               "title": "Len",
               "type": "array"
            }
         },
         "required": [
            "fname",
            "len"
         ],
         "title": "VARIABLEFILE",
         "type": "object"
      },
      "VARIABLEPAR": {
         "additionalProperties": false,
         "description": "Variable spectral parameter.\n\n.. code-block:: text\n\n    VARIABLE PAR < [len] [hs] [per] [dir] [dd] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import VARIABLEPAR\n    par = VARIABLEPAR(\n        hs=[1.5, 1.4, 1.1],\n        per=[8.1, 8.0, 8.1],\n        dir=[225, 226, 228],\n        dd=[25, 22, 23],\n        len=[0, 0.5, 1.0],\n    )\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "variablepar",
               "description": "Model type discriminator",
               "enum": [
                  "variablepar",
                  "VARIABLEPAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hs": {
               "description": "The significant wave height (m)",
               "items": {
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Hs",
               "type": "array"
            },
            "per": {
               "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE",
               "items": {
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Per",
               "type": "array"
            },
            "dir": {
               "description": "The peak wave direction thetapeak (degrees), constant over frequencies",
               "items": {
                  "maximum": 360.0,
                  "minimum": -360.0,
                  "type": "number"
               },
               "title": "Dir",
               "type": "array"
            },
            "dd": {
               "description": "Coefficient of directional spreading; a $cos^m(\u03b8)$ distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
               "items": {
                  "maximum": 360.0,
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Dd",
               "type": "array"
            },
            "len": {
               "description": "Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. `len` is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of `len` should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment",
               "items": {
                  "minimum": 0,
                  "type": "number"
               },
               "title": "Len",
               "type": "array"
            }
         },
         "required": [
            "hs",
            "per",
            "dir",
            "dd",
            "len"
         ],
         "title": "VARIABLEPAR",
         "type": "object"
      },
      "VEGETATION": {
         "additionalProperties": false,
         "description": "Vegetation dumping.\n\n.. code-block:: text\n\n    VEGETATION [iveg] < [height] [diamtr] [nstems] [drag] >\n\nWith this command the user can activate wave damping due to vegetation based on the\nDalrymple's formula (1984) as implemented by Suzuki et al. (2011). This damping is\nuniform over the wave frequencies. An alternative is the frequency-dependent\n(canopy) dissipation model of Jacobsen et al. (2019). If this command is not used,\nSWAN will not account for vegetation effects.\n\nThe vegetation (rigid plants) can be divided over a number of vertical segments and\nso, the possibility to vary the vegetation vertically is included. Each vertical\nlayer represents some characteristics of the plants. These variables as indicated\nbelow can be repeated as many vertical layers to be chosen.\n\nReferences\n----------\nDalrymple, R.A., Kirby, J.T. and Hwang, P.A., 1984. Wave diffraction due to areas\nof energy dissipation. Journal of waterway, port, coastal, and ocean engineering,\n110(1), pp.67-79.\n\nJacobsen, N.G., Bakker, W., Uijttewaal, W.S. and Uittenbogaard, R., 2019.\nExperimental investigation of the wave-induced motion of and force distribution\nalong a flexible stem. Journal of Fluid Mechanics, 880, pp.1036-1069.\n\nSuzuki, T., Zijlema, M., Burger, B., Meijer, M.C. and Narayan, S., 2012. Wave\ndissipation by vegetation with layer schematization in SWAN. Coastal Engineering,\n59(1), pp.64-71.\n\nNotes\n-----\nVertical layering of the vegetation is not yet implemented for the\nJacobsen et al. (2019) method.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import VEGETATION\n    # Single layer\n    vegetation = VEGETATION(\n        height=1.2,\n        diamtr=0.1,\n        drag=0.5,\n        nstems=10,\n    )\n    print(vegetation.render())\n    # 2 vertical layers\n    vegetation = VEGETATION(\n        iveg=1,\n        height=[1.2, 0.8],\n        diamtr=[0.1, 0.1],\n        drag=[0.5, 0.5],\n        nstems=[10, 5],\n    )\n    print(vegetation.render())",
         "properties": {
            "model_type": {
               "default": "vegetation",
               "description": "Model type discriminator",
               "enum": [
                  "vegetation",
                  "VEGETATION"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "iveg": {
               "default": 1,
               "description": "Indicates the method for the vegetation computation (SWAN default: 1):\n\n* 1: Suzuki et al. (2011)\n* 2: Jacobsen et al. (2019)\n",
               "enum": [
                  1,
                  2
               ],
               "title": "Iveg",
               "type": "integer"
            },
            "height": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  }
               ],
               "description": "The plant height per layer (in m)",
               "title": "Height"
            },
            "diamtr": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  }
               ],
               "description": "The diameter of each plant stand per layer (in m)",
               "title": "Diamtr"
            },
            "drag": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  }
               ],
               "description": "The drag coefficient per layer",
               "title": "Drag"
            },
            "nstems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  }
               ],
               "default": 1,
               "description": "The number of plant stands per square meter for each layer. Note that `nstems` is allowed to vary over the computational region to account for the zonation of vegetation. In that case use the commands `IMPGRID NPLANTS` and `READINP NPLANTS` to define and read the vegetation density. The (vertically varying) value of `nstems` in this command will be multiplied by this horizontally varying plant density (SWAN default: 1)",
               "title": "Nstems"
            }
         },
         "required": [
            "height",
            "diamtr",
            "drag"
         ],
         "title": "VEGETATION",
         "type": "object"
      },
      "WCAPPING_AB": {
         "additionalProperties": false,
         "description": "Whitecapping according to Alves and Banner (2003).\n\n.. code-block:: text\n\n    WCAPPING AB [cds2] [br] CURRENT [cds3]\n\nReferences\n----------\nAlves, J.H.G. and Banner, M.L., 2003. Performance of a saturation-based\ndissipation-rate source term in modeling the fetch-limited evolution of wind waves.\nJournal of Physical Oceanography, 33(6), pp.1274-1298.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import WCAPPING_AB\n    wcapping = WCAPPING_AB()\n    print(wcapping.render())\n    wcapping = WCAPPING_AB(cds2=5.0e-5, br=1.75e-3, current=True, cds3=0.8)\n    print(wcapping.render())",
         "properties": {
            "model_type": {
               "default": "ab",
               "description": "Model type discriminator",
               "enum": [
                  "ab",
                  "AB"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5)",
               "title": "Cds2"
            },
            "br": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Threshold saturation level\t(SWAN default: 1.75e-3)",
               "title": "Br"
            },
            "current": {
               "default": false,
               "description": "Indicates that enhanced current-induced dissipation as proposed by Van der Westhuysen (2012) is to be added",
               "title": "Current",
               "type": "boolean"
            },
            "cds3": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient (SWAN default: 0.8)",
               "title": "Cds3"
            }
         },
         "title": "WCAPPING_AB",
         "type": "object"
      },
      "WCAPPING_KOMEN": {
         "additionalProperties": false,
         "description": "Whitecapping according to Komen (1984).\n\n.. code-block:: text\n\n    WCAPPING KOMEN [cds2] [stpm] [powst] [delta] [powk]\n\nNotes\n-----\nThe SWAN default for `delta` has been changed since version 40.91A. The setting\n`delta = 1` will improve the prediction of the wave energy at low frequencies, and\nhence the mean wave period. The original default was `delta = 0`, which corresponds\nto WAM Cycle 3. See the Scientific/Technical documentation for further details.\n\nReferences\n----------\nKomen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully\ndeveloped wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import WCAPPING_KOMEN\n    wcapping = WCAPPING_KOMEN()\n    print(wcapping.render())\n    wcapping = WCAPPING_KOMEN(cds2=2.36e-5, stpm=3.02e-3, powst=2, delta=1, powk=2)\n    print(wcapping.render())",
         "properties": {
            "model_type": {
               "default": "komen",
               "description": "Model type discriminator",
               "enum": [
                  "komen",
                  "KOMEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for determining the rate of whitecapping dissipation ($Cds$) (SWAN default: 2.36e-5)",
               "title": "Cds2"
            },
            "stpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Value of the wave steepness for a Pierson-Moskowitz spectrum ($s^2_{PM}$) (SWAN default: 3.02e-3)",
               "title": "Stpm"
            },
            "powst": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power of steepness normalized with the wave steepness of a Pierson-Moskowitz spectrum (SWAN default: 2)",
               "title": "Powst"
            },
            "delta": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient which determines the dependency of the whitecapping on wave number (SWAN default: 1)",
               "title": "Delta"
            },
            "powk": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "power of wave number normalized with the mean wave number (SWAN default: 1)",
               "title": "Powk"
            }
         },
         "title": "WCAPPING_KOMEN",
         "type": "object"
      },
      "WESTHUYSEN": {
         "additionalProperties": false,
         "description": "Westhuysen source terms subcomponent.\n\n.. code-block:: text\n\n    WESTHUYSEN [cds2] [br] (AGROW [a])\n\nNonlinear saturation-based whitecapping combined with wind input of Yan (1987).\n\nNotes\n-----\nThe two arguments are specified in the Appendix C of the User manual but not in the\ncommand description for WESTH in Section 4.5.4. They are also options in the\nWCAPPING command. It is not entirely clear if they should/could be specified here.\n\nReferences\n----------\nvan der Westhuysen, A.J., Zijlema, M. and Battjes, J.A., 2007. Nonlinear\nsaturation-based whitecapping dissipation in SWAN for deep and shallow water.\nCoastal Engineering, 54(2), pp.151-170.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import WESTHUYSEN\n    westhuysen = WESTHUYSEN()\n    print(westhuysen.render())\n    westhuysen = WESTHUYSEN(cds2=5.0e-5, br=1.75e-3)\n    print(westhuysen.render())",
         "properties": {
            "model_type": {
               "default": "westhuysen",
               "description": "Model type discriminator",
               "enum": [
                  "westhuysen",
                  "WESTHUYSEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "wu",
               "description": "Indicates the wind drag formulation",
               "enum": [
                  "wu",
                  "fit"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5).",
               "title": "Cds2"
            },
            "br": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Threshold saturation level\t(SWAN default: 1.75e-3)",
               "title": "Br"
            }
         },
         "title": "WESTHUYSEN",
         "type": "object"
      },
      "WIND": {
         "additionalProperties": false,
         "description": "Constant wind input field.\n\n.. code-block:: text\n\n    WIND [vel] [dir]\n\nWith this optional command, the user indicates that the wind field is constant.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import WIND\n    wind = WIND(vel=10.0, dir=270.0)\n    print(wind.render())",
         "properties": {
            "model_type": {
               "default": "wind",
               "description": "Model type discriminator",
               "enum": [
                  "wind",
                  "WIND"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "vel": {
               "description": "Wind velocity at 10 m elevation (m/s)",
               "minimum": 0.0,
               "title": "Vel",
               "type": "number"
            },
            "dir": {
               "description": "Wind direction at 10 m elevation (in degrees, Cartesian or Nautical convention, see command SET)",
               "maximum": 360.0,
               "minimum": -180.0,
               "title": "Dir",
               "type": "number"
            }
         },
         "required": [
            "vel",
            "dir"
         ],
         "title": "WIND",
         "type": "object"
      },
      "XY": {
         "additionalProperties": false,
         "description": "Points in problem coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import XY\n    points = XY(\n        x=[172, 172, 172, 172.5, 173],\n        y=[-41, -40.5, -40, -40, -40],\n        fmt=\"0.2f\",\n    )\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "xy",
               "description": "Model type discriminator",
               "enum": [
                  "xy",
                  "XY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "x": {
               "description": "Problem x-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "X",
               "type": "array"
            },
            "y": {
               "description": "Problem y-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "Y",
               "type": "array"
            },
            "fmt": {
               "default": "0.8f",
               "description": "The format to render floats values",
               "title": "Fmt",
               "type": "string"
            }
         },
         "required": [
            "x",
            "y"
         ],
         "title": "XY",
         "type": "object"
      },
      "ZERO": {
         "additionalProperties": false,
         "description": "Zero initial conditions.\n\n.. code-block:: text\n\n    ZERO\n\nThe initial spectral densities are all 0; note that if waves are generated in the\nmodel only by wind, waves can become non-zero only by the presence of the\n\u201dA\u201d term in the growth model; see the keyword AGROW in command GEN3.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import ZERO\n    init = ZERO()\n    print(init.render())",
         "properties": {
            "model_type": {
               "default": "zero",
               "description": "Model type discriminator",
               "enum": [
                  "zero",
                  "ZERO"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "ZERO",
         "type": "object"
      },
      "rompy__swan__components__cgrid__CURVILINEAR": {
         "additionalProperties": false,
         "description": "SWAN curvilinear computational grid.\n\n.. code-block:: text\n\n    CGRID CURVILINEAR [mxc] [myc] (EXCEPTION [xexc] [yexc])\n        ->CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]\n    READGRID COORDINATES [fac] 'fname' [idla] [nhedf] [nhedvec] &\n        FREE|FORMAT ('form'|[idfm])\n\nThis is a group component that includes a `CGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.cgrid import CURVILINEAR\n    cgrid = CURVILINEAR(\n        mxc=199,\n        myc=199,\n        readcoord=dict(fname=\"./coords.txt\"),\n        spectrum=dict(mdc=36, flow=0.04, fhigh=1.0),\n    )\n    print(cgrid.render())",
         "properties": {
            "model_type": {
               "default": "curvilinear",
               "description": "Model type discriminator",
               "enum": [
                  "curvilinear",
                  "CURVILINEAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "spectrum": {
               "$ref": "#/$defs/SPECTRUM",
               "description": "Spectrum subcomponent"
            },
            "mxc": {
               "description": "Number of meshes in computational grid in \u03be-direction (this number is one less than the number of grid points in this domain).",
               "title": "Mxc",
               "type": "integer"
            },
            "myc": {
               "description": "Number of meshes in computational grid in \u03b7-direction (this number is one less than the number of grid points in this domain).",
               "title": "Myc",
               "type": "integer"
            },
            "xexc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "the value which the user uses to indicate that a grid point is to be ignored in the computations (this value is provided by the user at the location of the x-coordinate considered in the file of the x-coordinates, see command READGRID COOR).",
               "title": "Xexc"
            },
            "yexc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "the value which the user uses to indicate that a grid point is to be ignored in the computations (this value is provided by the user at the location of the y-coordinate considered in the file of the y-coordinates, see command READGRID COOR).",
               "title": "Yexc"
            },
            "readcoord": {
               "$ref": "#/$defs/READCOORD",
               "description": "Grid coordinates reader."
            }
         },
         "required": [
            "spectrum",
            "mxc",
            "myc",
            "readcoord"
         ],
         "title": "CURVILINEAR",
         "type": "object"
      },
      "rompy__swan__components__cgrid__REGULAR": {
         "additionalProperties": false,
         "description": "SWAN regular computational grid.\n\n.. code-block:: text\n\n    CGRID REGULAR [xpc] [ypc] [alpc] [xlenc] [ylenc] [mxc] [myc] &\n        ->CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]\n\nThis is a group component that includes a `CGRID` and a `READGRID` component.\n\nNote\n----\nIn 1D-mode, `alpc` should be equal to the direction `alpinp`.\n\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.cgrid import REGULAR\n    cgrid = REGULAR(\n        grid=dict(xp=0, yp=0, alp=0, xlen=2000, ylen=1300, mx=100, my=100),\n        spectrum=dict(mdc=36, flow=0.04, fhigh=1.0),\n    )\n    print(cgrid.render())",
         "properties": {
            "model_type": {
               "default": "regular",
               "description": "Model type discriminator",
               "enum": [
                  "regular",
                  "REGULAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "spectrum": {
               "$ref": "#/$defs/SPECTRUM",
               "description": "Spectrum subcomponent"
            },
            "grid": {
               "$ref": "#/$defs/GRIDREGULAR",
               "description": "Computational grid definition"
            }
         },
         "required": [
            "spectrum",
            "grid"
         ],
         "title": "REGULAR",
         "type": "object"
      },
      "rompy__swan__components__cgrid__UNSTRUCTURED": {
         "additionalProperties": false,
         "description": "SWAN unstructured computational grid.\n\n.. code-block:: text\n\n    CGRID UNSTRUCTURED CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]\n    READGRID UNSTRUCTURED [grid_type] ('fname')\n\nThis is a group component that includes a `CGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.cgrid import UNSTRUCTURED\n    cgrid = UNSTRUCTURED(\n        grid_type=\"adcirc\",\n        spectrum=dict(mdc=36, flow=0.04, fhigh=1.0),\n    )\n    print(cgrid.render())",
         "properties": {
            "model_type": {
               "const": "unstructured",
               "default": "unstructured",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "spectrum": {
               "$ref": "#/$defs/SPECTRUM",
               "description": "Spectrum subcomponent"
            },
            "grid_type": {
               "default": "adcirc",
               "description": "Unstructured grid type",
               "enum": [
                  "adcirc",
                  "triangle",
                  "easymesh"
               ],
               "title": "Grid Type",
               "type": "string"
            },
            "fname": {
               "anyOf": [
                  {
                     "maxLength": 36,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the file containing the unstructured grid",
               "title": "Fname"
            }
         },
         "required": [
            "spectrum"
         ],
         "title": "UNSTRUCTURED",
         "type": "object"
      },
      "rompy__swan__components__inpgrid__CURVILINEAR": {
         "additionalProperties": false,
         "description": "SWAN curvilinear input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] CURVILINEAR [stagrx] [stagry] [mxinp] [myinp] &\n        (EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is a group component that includes an `INPGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import CURVILINEAR\n    inpgrid = CURVILINEAR(\n        grid_type=\"wind\",\n        stagrx=0.0,\n        stagry=0.0,\n        mxinp=199,\n        myinp=199,\n        excval=-99.0,\n        readinp=dict(fname1=\"wind.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    print(inpgrid.render())\n\nTODO: Handle (or not) setting default values for mxinp and myinp from cgrid.",
         "properties": {
            "model_type": {
               "default": "curvilinear",
               "description": "Model type discriminator",
               "enum": [
                  "curvilinear",
                  "CURVILINEAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "$ref": "#/$defs/GridOptions",
               "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
            },
            "excval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
               "title": "Excval"
            },
            "nonstationary": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/NONSTATIONARY"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Nonstationary time specification"
            },
            "readinp": {
               "$ref": "#/$defs/READINP",
               "description": "SWAN input grid file reader specification"
            },
            "stagrx": {
               "default": 0.0,
               "description": "Staggered x'-direction with respect to computational grid, e.g., `stagrx=0.5` means that the input grid points are shifted a half step in x'-direction; in many flow models x-velocities are defined in points shifted a half step in x'-direction",
               "title": "Stagrx",
               "type": "number"
            },
            "stagry": {
               "default": 0.0,
               "description": "Staggered y'-direction with respect to computational grid, e.g., `stagry=0.5` means that the input grid points are shifted a half step in y'-direction; in many flow models y-velocities are defined in points shifted a half step in y'-direction",
               "title": "Stagry",
               "type": "number"
            },
            "mxinp": {
               "description": "Number of meshes in \u03be-direction of the input grid (this number is one less than the number of grid points in this direction)",
               "title": "Mxinp",
               "type": "integer"
            },
            "myinp": {
               "description": "Number of meshes in \u03b7-direction of the input grid (this number is one less than the number of grid points in this direction)",
               "title": "Myinp",
               "type": "integer"
            }
         },
         "required": [
            "grid_type",
            "readinp",
            "mxinp",
            "myinp"
         ],
         "title": "CURVILINEAR",
         "type": "object"
      },
      "rompy__swan__components__inpgrid__REGULAR": {
         "additionalProperties": false,
         "description": "SWAN regular input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] REGULAR [xpinp] [ypinp] [alpinp] [mxinp] [myinp] &\n        [dxinp] [dyinp] (EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is a group component that includes an `INPGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import REGULAR\n    inpgrid = REGULAR(\n        grid_type=\"bottom\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"bottom.txt\"),\n    )\n    print(inpgrid.render())\n    inpgrid = REGULAR(\n        grid_type=\"wind\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"wind.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    print(inpgrid.render())\n\nTODO: Use grid object, requires different grid parameters to be allowed.",
         "properties": {
            "model_type": {
               "default": "regular",
               "description": "Model type discriminator",
               "enum": [
                  "regular",
                  "REGULAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "$ref": "#/$defs/GridOptions",
               "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
            },
            "excval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
               "title": "Excval"
            },
            "nonstationary": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/NONSTATIONARY"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Nonstationary time specification"
            },
            "readinp": {
               "$ref": "#/$defs/READINP",
               "description": "SWAN input grid file reader specification"
            },
            "xpinp": {
               "description": "Geographic location (x-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default",
               "title": "Xpinp",
               "type": "number"
            },
            "ypinp": {
               "description": "Geographic location (y-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default",
               "title": "Ypinp",
               "type": "number"
            },
            "alpinp": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 0.0,
               "description": "Direction of the positive x-axis of the input grid (in degrees, Cartesian convention)",
               "title": "Alpinp"
            },
            "mxinp": {
               "description": "Number of meshes in x-direction of the input grid (this number is one less than the number of grid points in this direction)",
               "title": "Mxinp",
               "type": "integer"
            },
            "myinp": {
               "description": "Number of meshes in y-direction of the input grid (this number is one less than the number of grid points in this direction). In 1D-mode, `myinp` should be 0",
               "title": "Myinp",
               "type": "integer"
            },
            "dxinp": {
               "description": "Mesh size in x-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used",
               "title": "Dxinp",
               "type": "number"
            },
            "dyinp": {
               "description": "Mesh size in y-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used. In 1D-mode, `dyinp` may have any value",
               "title": "Dyinp",
               "type": "number"
            }
         },
         "required": [
            "grid_type",
            "readinp",
            "xpinp",
            "ypinp",
            "mxinp",
            "myinp",
            "dxinp",
            "dyinp"
         ],
         "title": "REGULAR",
         "type": "object"
      },
      "rompy__swan__components__inpgrid__UNSTRUCTURED": {
         "additionalProperties": false,
         "description": "SWAN unstructured input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] UNSTRUCTURED EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is a group component that includes an `INPGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import UNSTRUCTURED\n    inpgrid = UNSTRUCTURED(\n        grid_type=\"bottom\",\n        excval=-99.0,\n        readinp=dict(fname1=\"bottom.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    print(inpgrid.render())",
         "properties": {
            "model_type": {
               "default": "unstructured",
               "description": "Model type discriminator",
               "enum": [
                  "unstructured",
                  "UNSTRUCTURED"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "$ref": "#/$defs/GridOptions",
               "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
            },
            "excval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
               "title": "Excval"
            },
            "nonstationary": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/NONSTATIONARY"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Nonstationary time specification"
            },
            "readinp": {
               "$ref": "#/$defs/READINP",
               "description": "SWAN input grid file reader specification"
            }
         },
         "required": [
            "grid_type",
            "readinp"
         ],
         "title": "UNSTRUCTURED",
         "type": "object"
      },
      "rompy__swan__components__physics__SETUP": {
         "additionalProperties": false,
         "description": "Wave setup.\n\n.. code-block:: text\n\n    SETUP [supcor]\n\nIf this command is given, the wave-induced set-up is computed and accounted for in\nthe wave computations (during the computation it is added to the depth that is\nobtained from the `READ BOTTOM` and `READ WLEVEL` commands). This approximation in\nSWAN can only be applied to open coast (unlimited supply of water from outside the\ndomain, e.g. nearshore coasts) in contrast to closed basin, e.g. lakes and\nestuaries, where this option should not be used. Note that set-up is not computed\ncorrectly with spherical coordinates.\n\nNotes\n-----\n\n* The SETUP command cannot be used in case of unstructured grids.\n* Set-up is not supported in case of parallel runs using either MPI or OpenMP.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SETUP\n    setup = SETUP()\n    print(setup.render())\n    setup = SETUP(supcor=0.5)\n    print(setup.render())",
         "properties": {
            "model_type": {
               "default": "setup",
               "description": "Model type discriminator",
               "enum": [
                  "setup",
                  "SETUP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "supcor": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "By default the wave-induced set-up is computed with a constant added such that the set-up is zero in the deepest point in the computational grid. The user can modify this constant by the value of `supcor`. The user can thus impose a set-up in any one point (and only one) in the computational grid by first running SWAN, then reading the set-up in that point and adding or subtracting the required value of `supcor` (in m; positive if the set-up has to rise) (SWAN default: 0.0)",
               "title": "Supcor"
            }
         },
         "title": "SETUP",
         "type": "object"
      },
      "rompy__swan__subcomponents__numerics__SETUP": {
         "additionalProperties": false,
         "description": "Stop criteria in the computation of wave setup.\n\n.. code-block:: text\n\n    SETUP [eps2] [outp] [niter]\n\nControls the stopping criterion and amount of output for the SOR solver in the\ncomputation of the wave-induced set-up.\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import SETUP\n    setup = SETUP()\n    print(setup.render())\n    setup = SETUP(eps2=1e-4, outp=0, niter=20)\n    print(setup.render())",
         "properties": {
            "model_type": {
               "default": "setup",
               "description": "Model type discriminator",
               "enum": [
                  "setup",
                  "SETUP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "eps2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Relative stopping criterion to terminate the linear solver (SIP or SOR). (SWAN default: 1.e-4 in case of SIP and 1.e-6 in case of SOR)",
               "title": "Eps2"
            },
            "outp": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output for the iterative solver:\n\n* 0 = no output\n* 1 = additional information about the iteration process is written to the PRINT file \n* 2 = gives a maximal amount of output concerning the iteration process \n* 3 = summary of the iteration process\n\n(SWAN default: 0)",
               "title": "Outp"
            },
            "niter": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of iterations for the linear solver (SWAN default: 20 in case of SIP and 1000 in case of SOR)",
               "title": "Niter"
            }
         },
         "title": "SETUP",
         "type": "object"
      }
   },
   "additionalProperties": true,
   "required": [
      "cgrid"
   ]
}

Fields:
  • boundary (rompy.swan.components.boundary.BOUNDSPEC | rompy.swan.components.boundary.BOUNDNEST1 | rompy.swan.components.boundary.BOUNDNEST2 | rompy.swan.components.boundary.BOUNDNEST3 | rompy.swan.interface.BoundaryInterface | None)

  • cgrid (rompy.swan.components.cgrid.REGULAR | rompy.swan.components.cgrid.CURVILINEAR | rompy.swan.components.cgrid.UNSTRUCTURED)

  • checkout ()

  • initial (rompy.swan.components.boundary.INITIAL | None)

  • inpgrid (rompy.swan.components.group.INPGRIDS | rompy.swan.interface.DataInterface | None)

  • lockup (rompy.swan.components.group.LOCKUP | None)

  • model_type (Literal['swanconfig', 'SWANCONFIG'])

  • numeric (rompy.swan.components.numerics.NUMERIC | None)

  • output (rompy.swan.components.group.OUTPUT | None)

  • physics (rompy.swan.components.group.PHYSICS | None)

  • prop (rompy.swan.components.numerics.PROP | None)

  • startup (rompy.swan.components.group.STARTUP | None)

  • template (str)

Validators:
  • alp_is_zero_if_spherical » all fields

  • cgrid_contain_inpgrids » all fields

  • group_within_cgrid » all fields

  • layer_defined_if_no_mud_inpgrid » all fields

  • locations_2d » all fields

  • no_nor_if_spherical » all fields

  • no_repeating_if_setup » all fields

  • not_curvilinear_if_ray » all fields

field boundary: BOUNDSPEC | BOUNDNEST1 | BOUNDNEST2 | BOUNDNEST3 | BoundaryInterface | None = None
Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field cgrid: REGULAR | CURVILINEAR | UNSTRUCTURED [Required]

Cgrid component

Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field checkout: str | None = 'main'

The git branch to use if the template is a git repo

Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field initial: INITIAL | None = None
Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field inpgrid: INPGRIDS | DataInterface | None = None
Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field lockup: LOCKUP | None = None
Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field model_type: Literal['swanconfig', 'SWANCONFIG'] = 'swanconfig'

Model type discriminator

Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field numeric: NUMERIC | None = None
Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field output: OUTPUT | None = None
Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field physics: PHYSICS | None = None
Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field prop: PROP | None = None
Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field startup: STARTUP | None = None
Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

field template: str = '/opt/hostedtoolcache/Python/3.10.17/x64/lib/python3.10/site-packages/rompy/templates/swancomp'

The template for SWAN.

Validated by:
  • alp_is_zero_if_spherical

  • cgrid_contain_inpgrids

  • group_within_cgrid

  • layer_defined_if_no_mud_inpgrid

  • locations_2d

  • no_nor_if_spherical

  • no_repeating_if_setup

  • not_curvilinear_if_ray

validator alp_is_zero_if_spherical  »  all fields[source]

Ensure alp is zero when using spherical coordinates.

validator cgrid_contain_inpgrids  »  all fields[source]

Ensure all inpgrids are inside the cgrid area.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator group_within_cgrid  »  all fields[source]

Ensure group indices are contained in computational grid.

validator layer_defined_if_no_mud_inpgrid  »  all fields[source]

Ensure layer is set in MUD command if not defined with INPGRID MUD.

validator locations_2d  »  all fields[source]

Ensure Location components not used in 1D mode.

validator no_nor_if_spherical  »  all fields[source]

Ensure SET nor is not prescribed when using spherical coordinates.

validator no_repeating_if_setup  »  all fields[source]

Ensure COORD repeating not set when using set-up.

validator not_curvilinear_if_ray  »  all fields[source]

Ensure bottom and water level grids are not curvilinear for RAY.

transm_msc_mdc() SwanConfigComponents[source]

Ensure the number of transmission coefficients match msc and mdc.

property grid

Define a SwanGrid from the cgrid field.

Grid#

pydantic model rompy.swan.grid.SwanGrid[source]

Regular SWAN grid in geographic space.

Show JSON schema
{
   "title": "SwanGrid",
   "description": "Regular SWAN grid in geographic space.",
   "type": "object",
   "properties": {
      "grid_type": {
         "default": "REG",
         "description": "Type of grid (REG=regular, CURV=curvilinear)",
         "enum": [
            "REG",
            "CURV"
         ],
         "title": "Grid Type",
         "type": "string"
      },
      "x0": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "X coordinate of the grid origin",
         "title": "X0"
      },
      "y0": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Y coordinate of the grid origin",
         "title": "Y0"
      },
      "rot": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": 0.0,
         "description": "Rotation angle of the grid in degrees",
         "title": "Rot"
      },
      "dx": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Spacing between grid points in the x direction",
         "title": "Dx"
      },
      "dy": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Spacing between grid points in the y direction",
         "title": "Dy"
      },
      "nx": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of grid points in the x direction",
         "title": "Nx"
      },
      "ny": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of grid points in the y direction",
         "title": "Ny"
      },
      "exc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Missing value",
         "title": "Exc"
      },
      "gridfile": {
         "anyOf": [
            {
               "maxLength": 36,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Name of grid file to load",
         "title": "Gridfile"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
field dx: float | None = None

Spacing between grid points in the x direction

Validated by:
field dy: float | None = None

Spacing between grid points in the y direction

Validated by:
field exc: float | None = None

Missing value

Validated by:
field grid_type: Literal['REG', 'CURV'] = 'REG'

Type of grid (REG=regular, CURV=curvilinear)

Validated by:
field gridfile: str | None = None

Name of grid file to load

Constraints:
  • max_length = 36

Validated by:
field nx: int | None = None

Number of grid points in the x direction

Validated by:
field ny: int | None = None

Number of grid points in the y direction

Validated by:
field rot: float | None = 0.0

Rotation angle of the grid in degrees

Validated by:
field x0: float | None = None

X coordinate of the grid origin

Validated by:
field y0: float | None = None

Y coordinate of the grid origin

Validated by:
bbox(buffer=0.0) Bbox

Returns a bounding box for the spatial grid

This function returns a list [ll_x, ll_y, ur_x, ur_y] where ll_x, ll_y (ur_x, ur_y) are the lower left (upper right) x and y coordinates bounding box of the model domain

boundary(*args, **kwargs) tuple[source]

Returns the grid boundary polygon.

Override the parent method to use the actual points from the regular grid boundary instead of the convex hull which is not always the boundary.

boundary_points(spacing=None, tolerance=0.2) tuple

Returns array of coordinates from boundary polygon.

Parameters:
  • tolerance (float) – Simplify polygon shape based on maximum distance from original geometry, see https://shapely.readthedocs.io/en/stable/manual.html#object.simplify.

  • spacing (float) – If specified, points are returned evenly spaced along the boundary at the specified spacing, otherwise all points are returned.

  • Returns

  • --------

  • points (tuple) – Tuple of x and y coordinates of the boundary points.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

classmethod from_component(component: GRIDREGULAR) SwanGrid[source]

Swan grid from an existing component.

Parameters:

component (GRIDREGULAR) – A GRIDREGULAR SWAN component.

Returns:

A SwanGrid object.

Return type:

SwanGrid

validator generate  »  all fields

Generate the grid from the provided parameters.

nearby_spectra(ds_spec, dist_thres=0.05, plot=True)[source]

Find points nearby and project to the boundary

Parameters:
  • ds_spec (xarray.Dataset) –

    an XArray dataset of wave spectra at a number of points. Dataset variable names standardised using wavespectra.read_* functions.

    See https://wavespectra.readthedocs.io/en/latest/api.html#input-functions

  • dist_thres (float, optional [Default: 0.05]) – Maximum distance to translate the input spectra to the grid boundary

  • plot (boolean, optional [Default: True]) – Generate a plot that shows the applied projections

Returns:

A subset of ds_spec with lat and lon coordinates projected to the boundary

Return type:

xarray.Dataset

plot(ax=None, figsize=None, fscale=10, buffer=0.1, borders=True, land=True, coastline=True)

Plot the grid

validator validate_curvilinear_grid  »  all fields[source]
validator validate_grid_type  »  grid_type[source]
property cgrid
property cgrid_read
property component

Return the respective SWAN component for this grid.

property inpgrid
property maxx: float
property maxy: float
property minx: float
property miny: float
property x: ndarray
property xlen
property y: ndarray
property ylen

Data#

pydantic model rompy.swan.data.SwanDataGrid[source]

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

Show JSON schema
{
   "title": "SwanDataGrid",
   "description": "This class is used to write SWAN data from a dataset.",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "grid",
         "default": "grid",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "id": {
         "default": "data",
         "description": "Unique identifier for this data source",
         "title": "Id",
         "type": "string"
      },
      "source": {
         "description": "Source reader, must return an xarray gridded dataset in the open method",
         "discriminator": {
            "mapping": {
               "csv": "#/$defs/SourceTimeseriesCSV",
               "datamesh": "#/$defs/SourceDatamesh",
               "file": "#/$defs/SourceFile",
               "intake": "#/$defs/SourceIntake",
               "wavespectra": "#/$defs/SourceWavespectra"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/SourceTimeseriesCSV"
            },
            {
               "$ref": "#/$defs/SourceDatamesh"
            },
            {
               "$ref": "#/$defs/SourceFile"
            },
            {
               "$ref": "#/$defs/SourceIntake"
            },
            {
               "$ref": "#/$defs/SourceWavespectra"
            }
         ],
         "title": "Source"
      },
      "link": {
         "default": false,
         "description": "Whether to create a symbolic link instead of copying the file",
         "title": "Link",
         "type": "boolean"
      },
      "filter": {
         "anyOf": [
            {
               "$ref": "#/$defs/Filter"
            },
            {
               "type": "null"
            }
         ],
         "description": "Optional filter specification to apply to the dataset"
      },
      "variables": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": [],
         "description": "Subset of variables to extract from the dataset",
         "title": "Variables"
      },
      "coords": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetCoords"
            },
            {
               "type": "null"
            }
         ],
         "default": {
            "t": "time",
            "x": "longitude",
            "y": "latitude",
            "z": "depth",
            "s": "site"
         },
         "description": "Names of the coordinates in the dataset"
      },
      "crop_data": {
         "default": true,
         "description": "Update crop filters from Grid and Time objects if passed to get method",
         "title": "Crop Data",
         "type": "boolean"
      },
      "buffer": {
         "default": 0.0,
         "description": "Space to buffer the grid bounding box if `filter_grid` is True",
         "title": "Buffer",
         "type": "number"
      },
      "time_buffer": {
         "default": [
            0,
            0
         ],
         "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
         "items": {
            "type": "integer"
         },
         "title": "Time Buffer",
         "type": "array"
      },
      "z1": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Name of the data variable in dataset representing either a scaler parameter or the u-componet of a vector field",
         "title": "Z1"
      },
      "z2": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Name of the data variable in dataset representing the v-componet of a vector field",
         "title": "Z2"
      },
      "var": {
         "$ref": "#/$defs/GridOptions",
         "description": "SWAN input grid name"
      },
      "fac": {
         "default": 1.0,
         "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
         "title": "Fac",
         "type": "number"
      }
   },
   "$defs": {
      "DatasetCoords": {
         "additionalProperties": false,
         "description": "Coordinates representation.",
         "properties": {
            "t": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "time",
               "description": "Name of the time coordinate",
               "title": "T"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "longitude",
               "description": "Name of the x coordinate",
               "title": "X"
            },
            "y": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "latitude",
               "description": "Name of the y coordinate",
               "title": "Y"
            },
            "z": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "depth",
               "description": "Name of the z coordinate",
               "title": "Z"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "site",
               "description": "Name of the site coordinate",
               "title": "S"
            }
         },
         "title": "DatasetCoords",
         "type": "object"
      },
      "Filter": {
         "additionalProperties": false,
         "properties": {
            "sort": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Sort"
            },
            "subset": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Subset"
            },
            "crop": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Crop"
            },
            "timenorm": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Timenorm"
            },
            "rename": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Rename"
            },
            "derived": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Derived"
            }
         },
         "title": "Filter",
         "type": "object"
      },
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "SourceDatamesh": {
         "additionalProperties": false,
         "description": "Source dataset from Datamesh.\n\nDatamesh documentation: https://docs.oceanum.io/datamesh/index.html",
         "properties": {
            "model_type": {
               "const": "datamesh",
               "default": "datamesh",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "datasource": {
               "description": "The id of the datasource on Datamesh",
               "title": "Datasource",
               "type": "string"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Datamesh API token, taken from the environment if not provided",
               "title": "Token"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to `oceanum.datamesh.Connector`",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "datasource",
            "token"
         ],
         "title": "SourceDatamesh",
         "type": "object"
      },
      "SourceFile": {
         "additionalProperties": false,
         "description": "Source dataset from file to open with xarray.open_dataset.",
         "properties": {
            "model_type": {
               "const": "file",
               "default": "file",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to xarray.open_dataset",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri"
         ],
         "title": "SourceFile",
         "type": "object"
      },
      "SourceIntake": {
         "additionalProperties": false,
         "description": "Source dataset from intake catalog.\n\nnote\n----\nThe intake catalog can be prescribed either by the URI of an existing catalog file\nor by a YAML string defining the catalog. The YAML string can be obtained from\ncalling the `yaml()` method on an intake dataset instance.",
         "properties": {
            "model_type": {
               "const": "intake",
               "default": "intake",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "dataset_id": {
               "description": "The id of the dataset to read in the catalog",
               "title": "Dataset Id",
               "type": "string"
            },
            "catalog_uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URI of the catalog to read from",
               "title": "Catalog Uri"
            },
            "catalog_yaml": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The YAML string of the catalog to read from",
               "title": "Catalog Yaml"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to define intake dataset parameters",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "dataset_id"
         ],
         "title": "SourceIntake",
         "type": "object"
      },
      "SourceTimeseriesCSV": {
         "additionalProperties": false,
         "description": "Timeseries source class from CSV file.\n\nThis class should return a timeseries from a CSV file. The dataset variables are\ndefined from the column headers, therefore the appropriate read_csv kwargs must be\npassed to allow defining the columns. The time index is defined from column name\nidentified by the tcol field.",
         "properties": {
            "model_type": {
               "const": "csv",
               "default": "csv",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the csv file",
               "title": "Filename"
            },
            "tcol": {
               "default": "time",
               "description": "Name of the column containing the time data",
               "title": "Tcol",
               "type": "string"
            },
            "read_csv_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to pandas.read_csv",
               "title": "Read Csv Kwargs",
               "type": "object"
            }
         },
         "required": [
            "filename"
         ],
         "title": "SourceTimeseriesCSV",
         "type": "object"
      },
      "SourceWavespectra": {
         "additionalProperties": false,
         "description": "Wavespectra dataset from wavespectra reader.",
         "properties": {
            "model_type": {
               "const": "wavespectra",
               "default": "wavespectra",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "reader": {
               "description": "Name of the wavespectra reader to use, e.g., read_swan",
               "title": "Reader",
               "type": "string"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to the wavespectra reader",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri",
            "reader"
         ],
         "title": "SourceWavespectra",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "source",
      "var"
   ]
}

Fields:
Validators:
field buffer: float = 0.0

Space to buffer the grid bounding box if filter_grid is True

Validated by:
field coords: DatasetCoords | None = DatasetCoords(t='time', x='longitude', y='latitude', z='depth', s='site')

Names of the coordinates in the dataset

Validated by:
field crop_data: bool = True

Update crop filters from Grid and Time objects if passed to get method

Validated by:
field fac: float = 1.0

SWAN multiplies all values that are read from file by fac. For instance if the values are given in unit decimeter, one should make fac=0.1 to obtain values in m. To change sign use a negative fac

Validated by:
field filter: Filter | None [Optional]

Optional filter specification to apply to the dataset

Validated by:
field id: str = 'data'

Unique identifier for this data source

Validated by:
field link: bool = False

Whether to create a symbolic link instead of copying the file

Validated by:
field model_type: Literal['grid'] = 'grid'

Model type discriminator

Validated by:
field source: SOURCE_TYPES [Required]

Source reader, must return an xarray gridded dataset in the open method

Validated by:
field time_buffer: list[int] = [0, 0]

Number of source data timesteps to buffer the time range if filter_time is True

Validated by:
field var: GridOptions [Required]

SWAN input grid name

Validated by:
field variables: list[str] | None = []

Subset of variables to extract from the dataset

Validated by:
field z1: str | None = None

Name of the data variable in dataset representing either a scaler parameter or the u-componet of a vector field

Validated by:
field z2: str | None = None

Name of the data variable in dataset representing the v-componet of a vector field

Validated by:
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator ensure_z1_in_data_vars  »  all fields[source]
get(destdir: str | Path, grid: SwanGrid | None = None, time: TimeRange | None = None) Path[source]

Write the data source to a new location.

Parameters:
  • destdir (str | Path) – The destination directory to write the netcdf data to.

  • grid (SwanGrid, optional) – The grid to filter the data to, only used if self.filter_grid is True.

  • time (TimeRange, optional) – The times to filter the data to, only used if self.filter_time is True.

Returns:

cmd – The command line string with the INPGRID/READINP commands ready to be written to the SWAN input file.

Return type:

str

Note

The data are assumed to not have been rotated. We cannot use the grid.rot attr as this is the rotation from the model grid object which is not necessarily the same as the rotation of the data.

plot(param, isel={}, model_grid=None, cmap='turbo', figsize=None, fscale=10, borders=True, land=True, coastline=True, **kwargs)

Plot the grid.

property ds

Return the xarray dataset for this data source.

property outfile: str
rompy.swan.data.dset_to_swan(dset: Dataset, output_file: str, variables: list, fmt: str = '%4.2f', fill_value: float = -99.0, time_dim='time')[source]

Convert xarray Dataset into SWAN ASCII file.

Parameters:
  • dset (xr.Dataset) – Dataset to write in SWAN ASCII format.

  • output_file (str) – Local file name for the ascii output file.

  • variables (list) – Variables to write to ascii.

  • fmt (str) – String float formatter.

  • fill_value (float) – Fill value.

  • time_dim (str) – Name of the time dimension if available in the dataset.

Boundary#

SWAN boundary classes.

pydantic model rompy.swan.boundary.Boundnest1[source]

SWAN BOUNDNEST1 NEST data class.

Show JSON schema
{
   "title": "Boundnest1",
   "description": "SWAN BOUNDNEST1 NEST data class.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundnest1",
         "description": "Model type discriminator",
         "enum": [
            "boundnest1",
            "BOUNDNEST1"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "id": {
         "description": "Unique identifier for this data source",
         "title": "Id",
         "type": "string"
      },
      "source": {
         "description": "Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method",
         "discriminator": {
            "mapping": {
               "csv": "#/$defs/SourceTimeseriesCSV",
               "datamesh": "#/$defs/SourceDatamesh",
               "file": "#/$defs/SourceFile",
               "intake": "#/$defs/SourceIntake",
               "wavespectra": "#/$defs/SourceWavespectra"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/SourceTimeseriesCSV"
            },
            {
               "$ref": "#/$defs/SourceDatamesh"
            },
            {
               "$ref": "#/$defs/SourceFile"
            },
            {
               "$ref": "#/$defs/SourceIntake"
            },
            {
               "$ref": "#/$defs/SourceWavespectra"
            }
         ],
         "title": "Source"
      },
      "link": {
         "default": false,
         "description": "Whether to create a symbolic link instead of copying the file",
         "title": "Link",
         "type": "boolean"
      },
      "filter": {
         "anyOf": [
            {
               "$ref": "#/$defs/Filter"
            },
            {
               "type": "null"
            }
         ],
         "description": "Optional filter specification to apply to the dataset"
      },
      "variables": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": [],
         "description": "Subset of variables to extract from the dataset",
         "title": "Variables"
      },
      "coords": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetCoords"
            },
            {
               "type": "null"
            }
         ],
         "default": {
            "t": "time",
            "x": "longitude",
            "y": "latitude",
            "z": "depth",
            "s": "site"
         },
         "description": "Names of the coordinates in the dataset"
      },
      "crop_data": {
         "default": true,
         "description": "Update crop filter from Time object if passed to get method",
         "title": "Crop Data",
         "type": "boolean"
      },
      "buffer": {
         "default": 2.0,
         "description": "Space to buffer the grid bounding box if `filter_grid` is True",
         "title": "Buffer",
         "type": "number"
      },
      "time_buffer": {
         "default": [
            0,
            0
         ],
         "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
         "items": {
            "type": "integer"
         },
         "title": "Time Buffer",
         "type": "array"
      },
      "spacing": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "const": "parent",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the `get` method. If 'parent', the resolution of the parent dataset is used to define the spacing.",
         "title": "Spacing"
      },
      "sel_method": {
         "default": "idw",
         "description": "Wavespectra method to use for selecting boundary points from the dataset",
         "enum": [
            "idw",
            "nearest"
         ],
         "title": "Sel Method",
         "type": "string"
      },
      "sel_method_kwargs": {
         "additionalProperties": true,
         "default": {},
         "description": "Keyword arguments for sel_method",
         "title": "Sel Method Kwargs",
         "type": "object"
      },
      "grid_type": {
         "const": "boundary_wave_station",
         "default": "boundary_wave_station",
         "description": "Model type discriminator",
         "title": "Grid Type",
         "type": "string"
      },
      "rectangle": {
         "default": "closed",
         "description": "Defines whether boundary is defined over an closed or open rectangle",
         "enum": [
            "closed",
            "open"
         ],
         "title": "Rectangle",
         "type": "string"
      }
   },
   "$defs": {
      "DatasetCoords": {
         "additionalProperties": false,
         "description": "Coordinates representation.",
         "properties": {
            "t": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "time",
               "description": "Name of the time coordinate",
               "title": "T"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "longitude",
               "description": "Name of the x coordinate",
               "title": "X"
            },
            "y": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "latitude",
               "description": "Name of the y coordinate",
               "title": "Y"
            },
            "z": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "depth",
               "description": "Name of the z coordinate",
               "title": "Z"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "site",
               "description": "Name of the site coordinate",
               "title": "S"
            }
         },
         "title": "DatasetCoords",
         "type": "object"
      },
      "Filter": {
         "additionalProperties": false,
         "properties": {
            "sort": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Sort"
            },
            "subset": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Subset"
            },
            "crop": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Crop"
            },
            "timenorm": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Timenorm"
            },
            "rename": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Rename"
            },
            "derived": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Derived"
            }
         },
         "title": "Filter",
         "type": "object"
      },
      "SourceDatamesh": {
         "additionalProperties": false,
         "description": "Source dataset from Datamesh.\n\nDatamesh documentation: https://docs.oceanum.io/datamesh/index.html",
         "properties": {
            "model_type": {
               "const": "datamesh",
               "default": "datamesh",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "datasource": {
               "description": "The id of the datasource on Datamesh",
               "title": "Datasource",
               "type": "string"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Datamesh API token, taken from the environment if not provided",
               "title": "Token"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to `oceanum.datamesh.Connector`",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "datasource",
            "token"
         ],
         "title": "SourceDatamesh",
         "type": "object"
      },
      "SourceFile": {
         "additionalProperties": false,
         "description": "Source dataset from file to open with xarray.open_dataset.",
         "properties": {
            "model_type": {
               "const": "file",
               "default": "file",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to xarray.open_dataset",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri"
         ],
         "title": "SourceFile",
         "type": "object"
      },
      "SourceIntake": {
         "additionalProperties": false,
         "description": "Source dataset from intake catalog.\n\nnote\n----\nThe intake catalog can be prescribed either by the URI of an existing catalog file\nor by a YAML string defining the catalog. The YAML string can be obtained from\ncalling the `yaml()` method on an intake dataset instance.",
         "properties": {
            "model_type": {
               "const": "intake",
               "default": "intake",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "dataset_id": {
               "description": "The id of the dataset to read in the catalog",
               "title": "Dataset Id",
               "type": "string"
            },
            "catalog_uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URI of the catalog to read from",
               "title": "Catalog Uri"
            },
            "catalog_yaml": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The YAML string of the catalog to read from",
               "title": "Catalog Yaml"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to define intake dataset parameters",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "dataset_id"
         ],
         "title": "SourceIntake",
         "type": "object"
      },
      "SourceTimeseriesCSV": {
         "additionalProperties": false,
         "description": "Timeseries source class from CSV file.\n\nThis class should return a timeseries from a CSV file. The dataset variables are\ndefined from the column headers, therefore the appropriate read_csv kwargs must be\npassed to allow defining the columns. The time index is defined from column name\nidentified by the tcol field.",
         "properties": {
            "model_type": {
               "const": "csv",
               "default": "csv",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the csv file",
               "title": "Filename"
            },
            "tcol": {
               "default": "time",
               "description": "Name of the column containing the time data",
               "title": "Tcol",
               "type": "string"
            },
            "read_csv_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to pandas.read_csv",
               "title": "Read Csv Kwargs",
               "type": "object"
            }
         },
         "required": [
            "filename"
         ],
         "title": "SourceTimeseriesCSV",
         "type": "object"
      },
      "SourceWavespectra": {
         "additionalProperties": false,
         "description": "Wavespectra dataset from wavespectra reader.",
         "properties": {
            "model_type": {
               "const": "wavespectra",
               "default": "wavespectra",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "reader": {
               "description": "Name of the wavespectra reader to use, e.g., read_swan",
               "title": "Reader",
               "type": "string"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to the wavespectra reader",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri",
            "reader"
         ],
         "title": "SourceWavespectra",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "id",
      "source"
   ]
}

Fields:
Validators:
field buffer: float = 2.0

Space to buffer the grid bounding box if filter_grid is True

field coords: DatasetCoords | None = DatasetCoords(t='time', x='longitude', y='latitude', z='depth', s='site')

Names of the coordinates in the dataset

field crop_data: bool = True

Update crop filter from Time object if passed to get method

field filter: Filter | None [Optional]

Optional filter specification to apply to the dataset

field grid_type: Literal['boundary_wave_station'] = 'boundary_wave_station'

Model type discriminator

field id: str [Required]

Unique identifier for this data source

field link: bool = False

Whether to create a symbolic link instead of copying the file

field model_type: Literal['boundnest1', 'BOUNDNEST1'] = 'boundnest1'

Model type discriminator

field rectangle: Literal['closed', 'open'] = 'closed'

Defines whether boundary is defined over an closed or open rectangle

field sel_method: Literal['idw', 'nearest'] = 'idw'

Wavespectra method to use for selecting boundary points from the dataset

field sel_method_kwargs: dict = {}

Keyword arguments for sel_method

field source: SOURCE_TYPES [Required]

Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method

field spacing: float | Literal['parent'] | None = None

Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the get method. If ‘parent’, the resolution of the parent dataset is used to define the spacing.

Validated by:
  • spacing_gt_zero

field time_buffer: list[int] = [0, 0]

Number of source data timesteps to buffer the time range if filter_time is True

field variables: list[str] | None = []

Subset of variables to extract from the dataset

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

get(destdir: str, grid: SwanGrid, time: TimeRange | None = None) str[source]

Write the data source to a new location.

Parameters:
  • destdir (str | Path) – Destination directory for the SWAN ASCII file.

  • grid (RegularGrid) – Grid instance to use for selecting the boundary points.

  • time (TimeRange, optional) – The times to filter the data to, only used if self.crop_data is True.

Returns:

  • filename (Path) – The filename of the written boundary file.

  • cmd (str) – Boundary command string to render in the SWAN INPUT file

plot(model_grid=None, cmap='turbo', fscale=10, ax=None, **kwargs)

Plot the grid.

plot_boundary(grid=None, fscale=10, ax=None, **kwargs)

Plot the boundary points on a map.

validator spacing_gt_zero  »  spacing
property ds

Return the filtered xarray dataset instance.

property outfile: str
pydantic model rompy.swan.boundary.BoundspecBase[source]

Base class for SWAN BOUNDSPEC data classes.

Show JSON schema
{
   "title": "BoundspecBase",
   "description": "Base class for SWAN BOUNDSPEC data classes.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundspecbase",
         "description": "Model type discriminator",
         "enum": [
            "boundspecbase",
            "BOUNDSPECBASE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "id": {
         "description": "Unique identifier for this data source",
         "title": "Id",
         "type": "string"
      },
      "source": {
         "description": "Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method",
         "discriminator": {
            "mapping": {
               "csv": "#/$defs/SourceTimeseriesCSV",
               "datamesh": "#/$defs/SourceDatamesh",
               "file": "#/$defs/SourceFile",
               "intake": "#/$defs/SourceIntake",
               "wavespectra": "#/$defs/SourceWavespectra"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/SourceTimeseriesCSV"
            },
            {
               "$ref": "#/$defs/SourceDatamesh"
            },
            {
               "$ref": "#/$defs/SourceFile"
            },
            {
               "$ref": "#/$defs/SourceIntake"
            },
            {
               "$ref": "#/$defs/SourceWavespectra"
            }
         ],
         "title": "Source"
      },
      "link": {
         "default": false,
         "description": "Whether to create a symbolic link instead of copying the file",
         "title": "Link",
         "type": "boolean"
      },
      "filter": {
         "anyOf": [
            {
               "$ref": "#/$defs/Filter"
            },
            {
               "type": "null"
            }
         ],
         "description": "Optional filter specification to apply to the dataset"
      },
      "variables": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": [],
         "description": "Subset of variables to extract from the dataset",
         "title": "Variables"
      },
      "coords": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetCoords"
            },
            {
               "type": "null"
            }
         ],
         "default": {
            "t": "time",
            "x": "longitude",
            "y": "latitude",
            "z": "depth",
            "s": "site"
         },
         "description": "Names of the coordinates in the dataset"
      },
      "crop_data": {
         "default": true,
         "description": "Update crop filter from Time object if passed to get method",
         "title": "Crop Data",
         "type": "boolean"
      },
      "buffer": {
         "default": 2.0,
         "description": "Space to buffer the grid bounding box if `filter_grid` is True",
         "title": "Buffer",
         "type": "number"
      },
      "time_buffer": {
         "default": [
            0,
            0
         ],
         "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
         "items": {
            "type": "integer"
         },
         "title": "Time Buffer",
         "type": "array"
      },
      "spacing": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "const": "parent",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the `get` method. If 'parent', the resolution of the parent dataset is used to define the spacing.",
         "title": "Spacing"
      },
      "sel_method": {
         "default": "idw",
         "description": "Wavespectra method to use for selecting boundary points from the dataset",
         "enum": [
            "idw",
            "nearest"
         ],
         "title": "Sel Method",
         "type": "string"
      },
      "sel_method_kwargs": {
         "additionalProperties": true,
         "default": {},
         "description": "Keyword arguments for sel_method",
         "title": "Sel Method Kwargs",
         "type": "object"
      },
      "grid_type": {
         "const": "boundary_wave_station",
         "default": "boundary_wave_station",
         "description": "Model type discriminator",
         "title": "Grid Type",
         "type": "string"
      },
      "shapespec": {
         "$ref": "#/$defs/SHAPESPEC",
         "default": {
            "model_type": "shapespec",
            "shape": {
               "gamma": 3.3,
               "model_type": "jonswap"
            },
            "per_type": "peak",
            "dspr_type": "degrees"
         },
         "description": "Spectral shape specification"
      },
      "variable": {
         "default": false,
         "description": "Whether the spectra can vary along the side",
         "title": "Variable",
         "type": "boolean"
      },
      "file_type": {
         "default": "tpar",
         "description": "The type of file to write",
         "enum": [
            "tpar",
            "spec2d"
         ],
         "title": "File Type",
         "type": "string"
      }
   },
   "$defs": {
      "BIN": {
         "additionalProperties": false,
         "description": "Single frequency bin spectral shape.\n\n.. code-block:: text\n\n    BIN\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import BIN\n    shape = BIN()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "bin",
               "description": "Model type discriminator",
               "enum": [
                  "bin",
                  "BIN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "BIN",
         "type": "object"
      },
      "DatasetCoords": {
         "additionalProperties": false,
         "description": "Coordinates representation.",
         "properties": {
            "t": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "time",
               "description": "Name of the time coordinate",
               "title": "T"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "longitude",
               "description": "Name of the x coordinate",
               "title": "X"
            },
            "y": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "latitude",
               "description": "Name of the y coordinate",
               "title": "Y"
            },
            "z": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "depth",
               "description": "Name of the z coordinate",
               "title": "Z"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "site",
               "description": "Name of the site coordinate",
               "title": "S"
            }
         },
         "title": "DatasetCoords",
         "type": "object"
      },
      "Filter": {
         "additionalProperties": false,
         "properties": {
            "sort": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Sort"
            },
            "subset": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Subset"
            },
            "crop": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Crop"
            },
            "timenorm": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Timenorm"
            },
            "rename": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Rename"
            },
            "derived": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Derived"
            }
         },
         "title": "Filter",
         "type": "object"
      },
      "GAUSS": {
         "additionalProperties": false,
         "description": "Gaussian spectral shape.\n\n.. code-block:: text\n\n    GAUSS [sigfr]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import GAUSS\n    shape = GAUSS(sigfr=0.02)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "gauss",
               "description": "Model type discriminator",
               "enum": [
                  "gauss",
                  "GAUSS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sigfr": {
               "description": "Width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.",
               "exclusiveMinimum": 0.0,
               "title": "Sigfr",
               "type": "number"
            }
         },
         "required": [
            "sigfr"
         ],
         "title": "GAUSS",
         "type": "object"
      },
      "JONSWAP": {
         "additionalProperties": false,
         "description": "Jonswap spectral shape.\n\n.. code-block:: text\n\n    JONSWAP [gamma]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import JONSWAP\n    shape = JONSWAP(gamma=3.3)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "jonswap",
               "description": "Model type discriminator",
               "enum": [
                  "jonswap",
                  "JONSWAP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            }
         },
         "title": "JONSWAP",
         "type": "object"
      },
      "PM": {
         "additionalProperties": false,
         "description": "Pearson-Moskowitz spectral shape.\n\n.. code-block:: text\n\n    PM\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import PM\n    shape = PM()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "pm",
               "description": "Model type discriminator",
               "enum": [
                  "pm",
                  "PM"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "PM",
         "type": "object"
      },
      "SHAPESPEC": {
         "additionalProperties": false,
         "description": "Spectral shape specification.\n\n.. code-block:: text\n\n    BOUND SHAPESPEC JONSWAP|PM|GAUSS|BIN|TMA PEAK|MEAN DSPR [POWER|DEGREES]\n\nThis command BOUND SHAPESPEC defines the shape of the spectra (both in frequency\nand direction) at the boundary of the computational grid in case of parametric\nspectral input.\n\nNotes\n-----\nWhile technically a component `BOUND SHAPESPEC`, this is only intended to be used\nas a subcomponent of the `BOUNDSPEC` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SHAPESPEC\n    shapespec = SHAPESPEC()\n    print(shapespec.render())\n    shapespec = SHAPESPEC(\n        shape=dict(model_type=\"tma\", gamma=3.1, d=12),\n        per_type=\"mean\",\n        dspr_type=\"degrees\",\n    )\n    print(shapespec.render())",
         "properties": {
            "model_type": {
               "default": "shapespec",
               "description": "Model type discriminator",
               "enum": [
                  "shapespec",
                  "SHAPESPEC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "shape": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JONSWAP"
                  },
                  {
                     "$ref": "#/$defs/PM"
                  },
                  {
                     "$ref": "#/$defs/GAUSS"
                  },
                  {
                     "$ref": "#/$defs/BIN"
                  },
                  {
                     "$ref": "#/$defs/TMA"
                  }
               ],
               "description": "The spectral shape",
               "title": "Shape"
            },
            "per_type": {
               "default": "peak",
               "description": "The type of characteristic wave period",
               "enum": [
                  "peak",
                  "mean"
               ],
               "title": "Per Type",
               "type": "string"
            },
            "dspr_type": {
               "default": "power",
               "description": "The type of directional spreading",
               "enum": [
                  "power",
                  "degrees"
               ],
               "title": "Dspr Type",
               "type": "string"
            }
         },
         "title": "SHAPESPEC",
         "type": "object"
      },
      "SourceDatamesh": {
         "additionalProperties": false,
         "description": "Source dataset from Datamesh.\n\nDatamesh documentation: https://docs.oceanum.io/datamesh/index.html",
         "properties": {
            "model_type": {
               "const": "datamesh",
               "default": "datamesh",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "datasource": {
               "description": "The id of the datasource on Datamesh",
               "title": "Datasource",
               "type": "string"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Datamesh API token, taken from the environment if not provided",
               "title": "Token"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to `oceanum.datamesh.Connector`",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "datasource",
            "token"
         ],
         "title": "SourceDatamesh",
         "type": "object"
      },
      "SourceFile": {
         "additionalProperties": false,
         "description": "Source dataset from file to open with xarray.open_dataset.",
         "properties": {
            "model_type": {
               "const": "file",
               "default": "file",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to xarray.open_dataset",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri"
         ],
         "title": "SourceFile",
         "type": "object"
      },
      "SourceIntake": {
         "additionalProperties": false,
         "description": "Source dataset from intake catalog.\n\nnote\n----\nThe intake catalog can be prescribed either by the URI of an existing catalog file\nor by a YAML string defining the catalog. The YAML string can be obtained from\ncalling the `yaml()` method on an intake dataset instance.",
         "properties": {
            "model_type": {
               "const": "intake",
               "default": "intake",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "dataset_id": {
               "description": "The id of the dataset to read in the catalog",
               "title": "Dataset Id",
               "type": "string"
            },
            "catalog_uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URI of the catalog to read from",
               "title": "Catalog Uri"
            },
            "catalog_yaml": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The YAML string of the catalog to read from",
               "title": "Catalog Yaml"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to define intake dataset parameters",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "dataset_id"
         ],
         "title": "SourceIntake",
         "type": "object"
      },
      "SourceTimeseriesCSV": {
         "additionalProperties": false,
         "description": "Timeseries source class from CSV file.\n\nThis class should return a timeseries from a CSV file. The dataset variables are\ndefined from the column headers, therefore the appropriate read_csv kwargs must be\npassed to allow defining the columns. The time index is defined from column name\nidentified by the tcol field.",
         "properties": {
            "model_type": {
               "const": "csv",
               "default": "csv",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the csv file",
               "title": "Filename"
            },
            "tcol": {
               "default": "time",
               "description": "Name of the column containing the time data",
               "title": "Tcol",
               "type": "string"
            },
            "read_csv_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to pandas.read_csv",
               "title": "Read Csv Kwargs",
               "type": "object"
            }
         },
         "required": [
            "filename"
         ],
         "title": "SourceTimeseriesCSV",
         "type": "object"
      },
      "SourceWavespectra": {
         "additionalProperties": false,
         "description": "Wavespectra dataset from wavespectra reader.",
         "properties": {
            "model_type": {
               "const": "wavespectra",
               "default": "wavespectra",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "reader": {
               "description": "Name of the wavespectra reader to use, e.g., read_swan",
               "title": "Reader",
               "type": "string"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to the wavespectra reader",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri",
            "reader"
         ],
         "title": "SourceWavespectra",
         "type": "object"
      },
      "TMA": {
         "additionalProperties": false,
         "description": "TMA spectral shape.\n\n.. code-block:: text\n\n    TMA [gamma] [d]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import TMA\n    shape = TMA(gamma=2.0, d=18)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "tma",
               "description": "Model type discriminator",
               "enum": [
                  "tma",
                  "TMA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            },
            "d": {
               "description": "The reference depth at the wave maker in meters.",
               "exclusiveMinimum": 0.0,
               "title": "D",
               "type": "number"
            }
         },
         "required": [
            "d"
         ],
         "title": "TMA",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "id",
      "source"
   ]
}

Fields:
  • buffer ()

  • coords ()

  • crop_data ()

  • file_type (Literal['tpar', 'spec2d'])

  • filter ()

  • grid_type ()

  • id ()

  • link ()

  • model_type (Literal['boundspecbase', 'BOUNDSPECBASE'])

  • sel_method ()

  • sel_method_kwargs ()

  • shapespec (rompy.swan.subcomponents.spectrum.SHAPESPEC)

  • source ()

  • spacing ()

  • time_buffer ()

  • variable (bool)

  • variables ()

Validators:
  • spacing_gt_zero » spacing

  • unique_not_supported » sel_method_kwargs

  • variable_not_implemented » variable

field buffer: float = 2.0

Space to buffer the grid bounding box if filter_grid is True

field coords: DatasetCoords | None = DatasetCoords(t='time', x='longitude', y='latitude', z='depth', s='site')

Names of the coordinates in the dataset

field crop_data: bool = True

Update crop filter from Time object if passed to get method

field file_type: Literal['tpar', 'spec2d'] = 'tpar'

The type of file to write

field filter: Filter | None [Optional]

Optional filter specification to apply to the dataset

field grid_type: Literal['boundary_wave_station'] = 'boundary_wave_station'

Model type discriminator

field id: str [Required]

Unique identifier for this data source

field link: bool = False

Whether to create a symbolic link instead of copying the file

field model_type: Literal['boundspecbase', 'BOUNDSPECBASE'] = 'boundspecbase'

Model type discriminator

field sel_method: Literal['idw', 'nearest'] = 'idw'

Wavespectra method to use for selecting boundary points from the dataset

field sel_method_kwargs: dict = {}

Keyword arguments for sel_method

Validated by:
  • unique_not_supported

field shapespec: SHAPESPEC = SHAPESPEC(model_type='shapespec', shape=JONSWAP(model_type='jonswap', gamma=3.3), per_type='peak', dspr_type='degrees')

Spectral shape specification

field source: SOURCE_TYPES [Required]

Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method

field spacing: float | Literal['parent'] | None = None

Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the get method. If ‘parent’, the resolution of the parent dataset is used to define the spacing.

Validated by:
  • spacing_gt_zero

field time_buffer: list[int] = [0, 0]

Number of source data timesteps to buffer the time range if filter_time is True

field variable: bool = False

Whether the spectra can vary along the side

Validated by:
  • variable_not_implemented

field variables: list[str] | None = []

Subset of variables to extract from the dataset

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

get(destdir: str | Path, grid: RegularGrid, time: TimeRange | None = None) str

Write the selected boundary data to a netcdf file.

Parameters:
  • destdir (str | Path) – Destination directory for the netcdf file.

  • grid (RegularGrid) – Grid instance to use for selecting the boundary points.

  • time (TimeRange, optional) – The times to filter the data to, only used if self.crop_data is True.

Returns:

outfile – Path to the netcdf file.

Return type:

Path

plot(model_grid=None, cmap='turbo', fscale=10, ax=None, **kwargs)

Plot the grid.

plot_boundary(grid=None, fscale=10, ax=None, **kwargs)

Plot the boundary points on a map.

validator spacing_gt_zero  »  spacing
validator unique_not_supported  »  sel_method_kwargs[source]
validator variable_not_implemented  »  variable[source]
property ds

Return the filtered xarray dataset instance.

property dspr: str
property outfile: str
property per: str
property tpar: DataFrame

TPAR dataframe for the _ds attr.

pydantic model rompy.swan.boundary.BoundspecSegmentXY[source]

SWAN BOUNDSPEC SEGMENT data class.

TODO: Handle side definition on a rotated grid. TODO: Should SIDE VARIABE be supported? TODO: Support option to choose between mid-point or averaging? TODO: Does PAR need to be supported? Guess not as nonstationary isn’t supported TODO: If SIDES, ensure continuous

Note

Segments are defined from adjacent point locations so the order in which the points are defined is important. When using SIDES, please ensure SIDES are adjacent to each other and have correct directions (ccw or clockwise) accordint to the order in which each side is prescribed.

Note

The ‘spec1d’ file type is not supported yet.

Show JSON schema
{
   "title": "BoundspecSegmentXY",
   "description": "SWAN BOUNDSPEC SEGMENT data class.\n\nTODO: Handle side definition on a rotated grid.\nTODO: Should SIDE VARIABE be supported?\nTODO: Support option to choose between mid-point or averaging?\nTODO: Does PAR need to be supported? Guess not as nonstationary isn't supported\nTODO: If SIDES, ensure continuous\n\nNote\n----\nSegments are defined from adjacent point locations so the order in which the points\nare defined is important. When using SIDES, please ensure SIDES are adjacent to\neach other and have correct directions (ccw or clockwise) accordint to the order in\nwhich each side is prescribed.\n\nNote\n----\nThe 'spec1d' file type is not supported yet.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundspecside",
         "description": "Model type discriminator",
         "enum": [
            "boundspecside",
            "BOUNDSPECSIDE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "id": {
         "description": "Unique identifier for this data source",
         "title": "Id",
         "type": "string"
      },
      "source": {
         "description": "Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method",
         "discriminator": {
            "mapping": {
               "csv": "#/$defs/SourceTimeseriesCSV",
               "datamesh": "#/$defs/SourceDatamesh",
               "file": "#/$defs/SourceFile",
               "intake": "#/$defs/SourceIntake",
               "wavespectra": "#/$defs/SourceWavespectra"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/SourceTimeseriesCSV"
            },
            {
               "$ref": "#/$defs/SourceDatamesh"
            },
            {
               "$ref": "#/$defs/SourceFile"
            },
            {
               "$ref": "#/$defs/SourceIntake"
            },
            {
               "$ref": "#/$defs/SourceWavespectra"
            }
         ],
         "title": "Source"
      },
      "link": {
         "default": false,
         "description": "Whether to create a symbolic link instead of copying the file",
         "title": "Link",
         "type": "boolean"
      },
      "filter": {
         "anyOf": [
            {
               "$ref": "#/$defs/Filter"
            },
            {
               "type": "null"
            }
         ],
         "description": "Optional filter specification to apply to the dataset"
      },
      "variables": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": [],
         "description": "Subset of variables to extract from the dataset",
         "title": "Variables"
      },
      "coords": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetCoords"
            },
            {
               "type": "null"
            }
         ],
         "default": {
            "t": "time",
            "x": "longitude",
            "y": "latitude",
            "z": "depth",
            "s": "site"
         },
         "description": "Names of the coordinates in the dataset"
      },
      "crop_data": {
         "default": true,
         "description": "Update crop filter from Time object if passed to get method",
         "title": "Crop Data",
         "type": "boolean"
      },
      "buffer": {
         "default": 2.0,
         "description": "Space to buffer the grid bounding box if `filter_grid` is True",
         "title": "Buffer",
         "type": "number"
      },
      "time_buffer": {
         "default": [
            0,
            0
         ],
         "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
         "items": {
            "type": "integer"
         },
         "title": "Time Buffer",
         "type": "array"
      },
      "spacing": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "const": "parent",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the `get` method. If 'parent', the resolution of the parent dataset is used to define the spacing.",
         "title": "Spacing"
      },
      "sel_method": {
         "default": "idw",
         "description": "Wavespectra method to use for selecting boundary points from the dataset",
         "enum": [
            "idw",
            "nearest"
         ],
         "title": "Sel Method",
         "type": "string"
      },
      "sel_method_kwargs": {
         "additionalProperties": true,
         "default": {},
         "description": "Keyword arguments for sel_method",
         "title": "Sel Method Kwargs",
         "type": "object"
      },
      "grid_type": {
         "const": "boundary_wave_station",
         "default": "boundary_wave_station",
         "description": "Model type discriminator",
         "title": "Grid Type",
         "type": "string"
      },
      "shapespec": {
         "$ref": "#/$defs/SHAPESPEC",
         "default": {
            "model_type": "shapespec",
            "shape": {
               "gamma": 3.3,
               "model_type": "jonswap"
            },
            "per_type": "peak",
            "dspr_type": "degrees"
         },
         "description": "Spectral shape specification"
      },
      "variable": {
         "default": false,
         "description": "Whether the spectra can vary along the side",
         "title": "Variable",
         "type": "boolean"
      },
      "file_type": {
         "default": "tpar",
         "description": "The type of file to write",
         "enum": [
            "tpar",
            "spec2d"
         ],
         "title": "File Type",
         "type": "string"
      },
      "location": {
         "description": "The side of the grid to apply the boundary to",
         "discriminator": {
            "mapping": {
               "SIDE": "#/$defs/SIDE",
               "SIDES": "#/$defs/SIDES",
               "XY": "#/$defs/XY",
               "side": "#/$defs/SIDE",
               "sides": "#/$defs/SIDES",
               "xy": "#/$defs/XY"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/SIDE"
            },
            {
               "$ref": "#/$defs/SIDES"
            },
            {
               "$ref": "#/$defs/XY"
            }
         ],
         "title": "Location"
      }
   },
   "$defs": {
      "BIN": {
         "additionalProperties": false,
         "description": "Single frequency bin spectral shape.\n\n.. code-block:: text\n\n    BIN\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import BIN\n    shape = BIN()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "bin",
               "description": "Model type discriminator",
               "enum": [
                  "bin",
                  "BIN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "BIN",
         "type": "object"
      },
      "DatasetCoords": {
         "additionalProperties": false,
         "description": "Coordinates representation.",
         "properties": {
            "t": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "time",
               "description": "Name of the time coordinate",
               "title": "T"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "longitude",
               "description": "Name of the x coordinate",
               "title": "X"
            },
            "y": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "latitude",
               "description": "Name of the y coordinate",
               "title": "Y"
            },
            "z": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "depth",
               "description": "Name of the z coordinate",
               "title": "Z"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "site",
               "description": "Name of the site coordinate",
               "title": "S"
            }
         },
         "title": "DatasetCoords",
         "type": "object"
      },
      "Filter": {
         "additionalProperties": false,
         "properties": {
            "sort": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Sort"
            },
            "subset": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Subset"
            },
            "crop": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Crop"
            },
            "timenorm": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Timenorm"
            },
            "rename": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Rename"
            },
            "derived": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Derived"
            }
         },
         "title": "Filter",
         "type": "object"
      },
      "GAUSS": {
         "additionalProperties": false,
         "description": "Gaussian spectral shape.\n\n.. code-block:: text\n\n    GAUSS [sigfr]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import GAUSS\n    shape = GAUSS(sigfr=0.02)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "gauss",
               "description": "Model type discriminator",
               "enum": [
                  "gauss",
                  "GAUSS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sigfr": {
               "description": "Width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.",
               "exclusiveMinimum": 0.0,
               "title": "Sigfr",
               "type": "number"
            }
         },
         "required": [
            "sigfr"
         ],
         "title": "GAUSS",
         "type": "object"
      },
      "JONSWAP": {
         "additionalProperties": false,
         "description": "Jonswap spectral shape.\n\n.. code-block:: text\n\n    JONSWAP [gamma]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import JONSWAP\n    shape = JONSWAP(gamma=3.3)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "jonswap",
               "description": "Model type discriminator",
               "enum": [
                  "jonswap",
                  "JONSWAP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            }
         },
         "title": "JONSWAP",
         "type": "object"
      },
      "PM": {
         "additionalProperties": false,
         "description": "Pearson-Moskowitz spectral shape.\n\n.. code-block:: text\n\n    PM\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import PM\n    shape = PM()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "pm",
               "description": "Model type discriminator",
               "enum": [
                  "pm",
                  "PM"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "PM",
         "type": "object"
      },
      "SHAPESPEC": {
         "additionalProperties": false,
         "description": "Spectral shape specification.\n\n.. code-block:: text\n\n    BOUND SHAPESPEC JONSWAP|PM|GAUSS|BIN|TMA PEAK|MEAN DSPR [POWER|DEGREES]\n\nThis command BOUND SHAPESPEC defines the shape of the spectra (both in frequency\nand direction) at the boundary of the computational grid in case of parametric\nspectral input.\n\nNotes\n-----\nWhile technically a component `BOUND SHAPESPEC`, this is only intended to be used\nas a subcomponent of the `BOUNDSPEC` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SHAPESPEC\n    shapespec = SHAPESPEC()\n    print(shapespec.render())\n    shapespec = SHAPESPEC(\n        shape=dict(model_type=\"tma\", gamma=3.1, d=12),\n        per_type=\"mean\",\n        dspr_type=\"degrees\",\n    )\n    print(shapespec.render())",
         "properties": {
            "model_type": {
               "default": "shapespec",
               "description": "Model type discriminator",
               "enum": [
                  "shapespec",
                  "SHAPESPEC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "shape": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JONSWAP"
                  },
                  {
                     "$ref": "#/$defs/PM"
                  },
                  {
                     "$ref": "#/$defs/GAUSS"
                  },
                  {
                     "$ref": "#/$defs/BIN"
                  },
                  {
                     "$ref": "#/$defs/TMA"
                  }
               ],
               "description": "The spectral shape",
               "title": "Shape"
            },
            "per_type": {
               "default": "peak",
               "description": "The type of characteristic wave period",
               "enum": [
                  "peak",
                  "mean"
               ],
               "title": "Per Type",
               "type": "string"
            },
            "dspr_type": {
               "default": "power",
               "description": "The type of directional spreading",
               "enum": [
                  "power",
                  "degrees"
               ],
               "title": "Dspr Type",
               "type": "string"
            }
         },
         "title": "SHAPESPEC",
         "type": "object"
      },
      "SIDE": {
         "additionalProperties": false,
         "description": "Boundary over one side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n\nThe boundary is one full side of the computational grid (in 1D cases either of the\ntwo ends of the 1D-grid).\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE\n    side = SIDE(side=\"west\", direction=\"ccw\")\n    print(side.render())",
         "properties": {
            "model_type": {
               "default": "side",
               "description": "Model type discriminator",
               "enum": [
                  "side",
                  "SIDE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "side": {
               "description": "The side of the grid to apply the boundary to",
               "enum": [
                  "north",
                  "nw",
                  "west",
                  "sw",
                  "south",
                  "se",
                  "east",
                  "ne"
               ],
               "title": "Side",
               "type": "string"
            },
            "direction": {
               "default": "ccw",
               "description": "The direction to apply the boundary in",
               "enum": [
                  "ccw",
                  "clockwise"
               ],
               "title": "Direction",
               "type": "string"
            }
         },
         "required": [
            "side"
         ],
         "title": "SIDE",
         "type": "object"
      },
      "SIDES": {
         "additionalProperties": false,
         "description": "Boundary over multiple side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n    ...\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE, SIDES\n    side1 = SIDE(side=\"west\", direction=\"ccw\")\n    side2 = SIDE(side=\"north\", direction=\"ccw\")\n    sides = SIDES(sides=[side1, side2])\n    print(sides.render())",
         "properties": {
            "model_type": {
               "default": "sides",
               "description": "Model type discriminator",
               "enum": [
                  "sides",
                  "SIDES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sides": {
               "description": "The sides of the grid to apply the boundary to",
               "items": {
                  "$ref": "#/$defs/SIDE"
               },
               "title": "Sides",
               "type": "array"
            }
         },
         "required": [
            "sides"
         ],
         "title": "SIDES",
         "type": "object"
      },
      "SourceDatamesh": {
         "additionalProperties": false,
         "description": "Source dataset from Datamesh.\n\nDatamesh documentation: https://docs.oceanum.io/datamesh/index.html",
         "properties": {
            "model_type": {
               "const": "datamesh",
               "default": "datamesh",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "datasource": {
               "description": "The id of the datasource on Datamesh",
               "title": "Datasource",
               "type": "string"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Datamesh API token, taken from the environment if not provided",
               "title": "Token"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to `oceanum.datamesh.Connector`",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "datasource",
            "token"
         ],
         "title": "SourceDatamesh",
         "type": "object"
      },
      "SourceFile": {
         "additionalProperties": false,
         "description": "Source dataset from file to open with xarray.open_dataset.",
         "properties": {
            "model_type": {
               "const": "file",
               "default": "file",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to xarray.open_dataset",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri"
         ],
         "title": "SourceFile",
         "type": "object"
      },
      "SourceIntake": {
         "additionalProperties": false,
         "description": "Source dataset from intake catalog.\n\nnote\n----\nThe intake catalog can be prescribed either by the URI of an existing catalog file\nor by a YAML string defining the catalog. The YAML string can be obtained from\ncalling the `yaml()` method on an intake dataset instance.",
         "properties": {
            "model_type": {
               "const": "intake",
               "default": "intake",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "dataset_id": {
               "description": "The id of the dataset to read in the catalog",
               "title": "Dataset Id",
               "type": "string"
            },
            "catalog_uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URI of the catalog to read from",
               "title": "Catalog Uri"
            },
            "catalog_yaml": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The YAML string of the catalog to read from",
               "title": "Catalog Yaml"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to define intake dataset parameters",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "dataset_id"
         ],
         "title": "SourceIntake",
         "type": "object"
      },
      "SourceTimeseriesCSV": {
         "additionalProperties": false,
         "description": "Timeseries source class from CSV file.\n\nThis class should return a timeseries from a CSV file. The dataset variables are\ndefined from the column headers, therefore the appropriate read_csv kwargs must be\npassed to allow defining the columns. The time index is defined from column name\nidentified by the tcol field.",
         "properties": {
            "model_type": {
               "const": "csv",
               "default": "csv",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the csv file",
               "title": "Filename"
            },
            "tcol": {
               "default": "time",
               "description": "Name of the column containing the time data",
               "title": "Tcol",
               "type": "string"
            },
            "read_csv_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to pandas.read_csv",
               "title": "Read Csv Kwargs",
               "type": "object"
            }
         },
         "required": [
            "filename"
         ],
         "title": "SourceTimeseriesCSV",
         "type": "object"
      },
      "SourceWavespectra": {
         "additionalProperties": false,
         "description": "Wavespectra dataset from wavespectra reader.",
         "properties": {
            "model_type": {
               "const": "wavespectra",
               "default": "wavespectra",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "reader": {
               "description": "Name of the wavespectra reader to use, e.g., read_swan",
               "title": "Reader",
               "type": "string"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to the wavespectra reader",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri",
            "reader"
         ],
         "title": "SourceWavespectra",
         "type": "object"
      },
      "TMA": {
         "additionalProperties": false,
         "description": "TMA spectral shape.\n\n.. code-block:: text\n\n    TMA [gamma] [d]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import TMA\n    shape = TMA(gamma=2.0, d=18)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "tma",
               "description": "Model type discriminator",
               "enum": [
                  "tma",
                  "TMA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            },
            "d": {
               "description": "The reference depth at the wave maker in meters.",
               "exclusiveMinimum": 0.0,
               "title": "D",
               "type": "number"
            }
         },
         "required": [
            "d"
         ],
         "title": "TMA",
         "type": "object"
      },
      "XY": {
         "additionalProperties": false,
         "description": "Points in problem coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import XY\n    points = XY(\n        x=[172, 172, 172, 172.5, 173],\n        y=[-41, -40.5, -40, -40, -40],\n        fmt=\"0.2f\",\n    )\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "xy",
               "description": "Model type discriminator",
               "enum": [
                  "xy",
                  "XY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "x": {
               "description": "Problem x-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "X",
               "type": "array"
            },
            "y": {
               "description": "Problem y-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "Y",
               "type": "array"
            },
            "fmt": {
               "default": "0.8f",
               "description": "The format to render floats values",
               "title": "Fmt",
               "type": "string"
            }
         },
         "required": [
            "x",
            "y"
         ],
         "title": "XY",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "id",
      "source",
      "location"
   ]
}

Fields:
  • buffer ()

  • coords ()

  • crop_data ()

  • file_type ()

  • filter ()

  • grid_type ()

  • id ()

  • link ()

  • location (rompy.swan.subcomponents.boundary.SIDE | rompy.swan.subcomponents.boundary.SIDES | rompy.swan.subcomponents.base.XY)

  • model_type (Literal['boundspecside', 'BOUNDSPECSIDE'])

  • sel_method ()

  • sel_method_kwargs ()

  • shapespec ()

  • source ()

  • spacing ()

  • time_buffer ()

  • variable ()

  • variables ()

Validators:
  • spacing_gt_zero » spacing

  • unique_not_supported » sel_method_kwargs

  • variable_not_implemented » variable

field buffer: float = 2.0

Space to buffer the grid bounding box if filter_grid is True

field coords: DatasetCoords | None = DatasetCoords(t='time', x='longitude', y='latitude', z='depth', s='site')

Names of the coordinates in the dataset

field crop_data: bool = True

Update crop filter from Time object if passed to get method

field file_type: Literal['tpar', 'spec2d'] = 'tpar'

The type of file to write

field filter: Filter | None [Optional]

Optional filter specification to apply to the dataset

field grid_type: Literal['boundary_wave_station'] = 'boundary_wave_station'

Model type discriminator

field id: str [Required]

Unique identifier for this data source

field link: bool = False

Whether to create a symbolic link instead of copying the file

field location: SIDE | SIDES | XY [Required]

The side of the grid to apply the boundary to

field model_type: Literal['boundspecside', 'BOUNDSPECSIDE'] = 'boundspecside'

Model type discriminator

field sel_method: Literal['idw', 'nearest'] = 'idw'

Wavespectra method to use for selecting boundary points from the dataset

field sel_method_kwargs: dict = {}

Keyword arguments for sel_method

Validated by:
  • unique_not_supported

field shapespec: SHAPESPEC = SHAPESPEC(model_type='shapespec', shape=JONSWAP(model_type='jonswap', gamma=3.3), per_type='peak', dspr_type='degrees')

Spectral shape specification

field source: SOURCE_TYPES [Required]

Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method

field spacing: float | Literal['parent'] | None = None

Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the get method. If ‘parent’, the resolution of the parent dataset is used to define the spacing.

Validated by:
  • spacing_gt_zero

field time_buffer: list[int] = [0, 0]

Number of source data timesteps to buffer the time range if filter_time is True

field variable: bool = False

Whether the spectra can vary along the side

Validated by:
  • variable_not_implemented

field variables: list[str] | None = []

Subset of variables to extract from the dataset

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

get(destdir: str, grid: SwanGrid, time: TimeRange | None = None) str[source]

Write the data source to a new location.

Parameters:
  • destdir (str | Path) – Destination directory for the SWAN ASCII file.

  • grid (RegularGrid) – Grid instance to use for selecting the boundary points.

  • time (TimeRange, optional) – The times to filter the data to, only used if self.crop_data is True.

Returns:

  • filenames (list) – The filenames of the written boundary files.

  • cmd (str) – Boundary command string to render in the SWAN INPUT file

plot(model_grid=None, cmap='turbo', fscale=10, ax=None, **kwargs)

Plot the grid.

plot_boundary(grid=None, fscale=10, ax=None, **kwargs)

Plot the boundary points on a map.

validator spacing_gt_zero  »  spacing
validator unique_not_supported  »  sel_method_kwargs
validator variable_not_implemented  »  variable
property ds

Return the filtered xarray dataset instance.

property dspr: str
property outfile: str
property per: str
property tpar: DataFrame

TPAR dataframe for the _ds attr.

pydantic model rompy.swan.boundary.BoundspecSide[source]

SWAN BOUNDSPEC SIDE data class.

TODO: Handle side definition on a rotated grid. TODO: Should SIDE VARIABE be supported? TODO: Support option to choose between mid-point or averaging? TODO: Does PAR need to be supported? Guess not as nonstationary isn’t supported

Note

The ‘spec1d’ file type is not supported yet.

Show JSON schema
{
   "title": "BoundspecSide",
   "description": "SWAN BOUNDSPEC SIDE data class.\n\nTODO: Handle side definition on a rotated grid.\nTODO: Should SIDE VARIABE be supported?\nTODO: Support option to choose between mid-point or averaging?\nTODO: Does PAR need to be supported? Guess not as nonstationary isn't supported\n\nNote\n----\nThe 'spec1d' file type is not supported yet.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundspecside",
         "description": "Model type discriminator",
         "enum": [
            "boundspecside",
            "BOUNDSPECSIDE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "id": {
         "description": "Unique identifier for this data source",
         "title": "Id",
         "type": "string"
      },
      "source": {
         "description": "Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method",
         "discriminator": {
            "mapping": {
               "csv": "#/$defs/SourceTimeseriesCSV",
               "datamesh": "#/$defs/SourceDatamesh",
               "file": "#/$defs/SourceFile",
               "intake": "#/$defs/SourceIntake",
               "wavespectra": "#/$defs/SourceWavespectra"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/SourceTimeseriesCSV"
            },
            {
               "$ref": "#/$defs/SourceDatamesh"
            },
            {
               "$ref": "#/$defs/SourceFile"
            },
            {
               "$ref": "#/$defs/SourceIntake"
            },
            {
               "$ref": "#/$defs/SourceWavespectra"
            }
         ],
         "title": "Source"
      },
      "link": {
         "default": false,
         "description": "Whether to create a symbolic link instead of copying the file",
         "title": "Link",
         "type": "boolean"
      },
      "filter": {
         "anyOf": [
            {
               "$ref": "#/$defs/Filter"
            },
            {
               "type": "null"
            }
         ],
         "description": "Optional filter specification to apply to the dataset"
      },
      "variables": {
         "anyOf": [
            {
               "items": {
                  "type": "string"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": [],
         "description": "Subset of variables to extract from the dataset",
         "title": "Variables"
      },
      "coords": {
         "anyOf": [
            {
               "$ref": "#/$defs/DatasetCoords"
            },
            {
               "type": "null"
            }
         ],
         "default": {
            "t": "time",
            "x": "longitude",
            "y": "latitude",
            "z": "depth",
            "s": "site"
         },
         "description": "Names of the coordinates in the dataset"
      },
      "crop_data": {
         "default": true,
         "description": "Update crop filter from Time object if passed to get method",
         "title": "Crop Data",
         "type": "boolean"
      },
      "buffer": {
         "default": 2.0,
         "description": "Space to buffer the grid bounding box if `filter_grid` is True",
         "title": "Buffer",
         "type": "number"
      },
      "time_buffer": {
         "default": [
            0,
            0
         ],
         "description": "Number of source data timesteps to buffer the time range if `filter_time` is True",
         "items": {
            "type": "integer"
         },
         "title": "Time Buffer",
         "type": "array"
      },
      "spacing": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "const": "parent",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the `get` method. If 'parent', the resolution of the parent dataset is used to define the spacing.",
         "title": "Spacing"
      },
      "sel_method": {
         "default": "idw",
         "description": "Wavespectra method to use for selecting boundary points from the dataset",
         "enum": [
            "idw",
            "nearest"
         ],
         "title": "Sel Method",
         "type": "string"
      },
      "sel_method_kwargs": {
         "additionalProperties": true,
         "default": {},
         "description": "Keyword arguments for sel_method",
         "title": "Sel Method Kwargs",
         "type": "object"
      },
      "grid_type": {
         "const": "boundary_wave_station",
         "default": "boundary_wave_station",
         "description": "Model type discriminator",
         "title": "Grid Type",
         "type": "string"
      },
      "shapespec": {
         "$ref": "#/$defs/SHAPESPEC",
         "default": {
            "model_type": "shapespec",
            "shape": {
               "gamma": 3.3,
               "model_type": "jonswap"
            },
            "per_type": "peak",
            "dspr_type": "degrees"
         },
         "description": "Spectral shape specification"
      },
      "variable": {
         "default": false,
         "description": "Whether the spectra can vary along the side",
         "title": "Variable",
         "type": "boolean"
      },
      "file_type": {
         "default": "tpar",
         "description": "The type of file to write",
         "enum": [
            "tpar",
            "spec2d"
         ],
         "title": "File Type",
         "type": "string"
      },
      "location": {
         "$ref": "#/$defs/SIDE",
         "description": "The side of the grid to apply the boundary to"
      }
   },
   "$defs": {
      "BIN": {
         "additionalProperties": false,
         "description": "Single frequency bin spectral shape.\n\n.. code-block:: text\n\n    BIN\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import BIN\n    shape = BIN()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "bin",
               "description": "Model type discriminator",
               "enum": [
                  "bin",
                  "BIN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "BIN",
         "type": "object"
      },
      "DatasetCoords": {
         "additionalProperties": false,
         "description": "Coordinates representation.",
         "properties": {
            "t": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "time",
               "description": "Name of the time coordinate",
               "title": "T"
            },
            "x": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "longitude",
               "description": "Name of the x coordinate",
               "title": "X"
            },
            "y": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "latitude",
               "description": "Name of the y coordinate",
               "title": "Y"
            },
            "z": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "depth",
               "description": "Name of the z coordinate",
               "title": "Z"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "site",
               "description": "Name of the site coordinate",
               "title": "S"
            }
         },
         "title": "DatasetCoords",
         "type": "object"
      },
      "Filter": {
         "additionalProperties": false,
         "properties": {
            "sort": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Sort"
            },
            "subset": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Subset"
            },
            "crop": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Crop"
            },
            "timenorm": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Timenorm"
            },
            "rename": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Rename"
            },
            "derived": {
               "anyOf": [
                  {
                     "additionalProperties": true,
                     "type": "object"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": {},
               "title": "Derived"
            }
         },
         "title": "Filter",
         "type": "object"
      },
      "GAUSS": {
         "additionalProperties": false,
         "description": "Gaussian spectral shape.\n\n.. code-block:: text\n\n    GAUSS [sigfr]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import GAUSS\n    shape = GAUSS(sigfr=0.02)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "gauss",
               "description": "Model type discriminator",
               "enum": [
                  "gauss",
                  "GAUSS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sigfr": {
               "description": "Width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.",
               "exclusiveMinimum": 0.0,
               "title": "Sigfr",
               "type": "number"
            }
         },
         "required": [
            "sigfr"
         ],
         "title": "GAUSS",
         "type": "object"
      },
      "JONSWAP": {
         "additionalProperties": false,
         "description": "Jonswap spectral shape.\n\n.. code-block:: text\n\n    JONSWAP [gamma]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import JONSWAP\n    shape = JONSWAP(gamma=3.3)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "jonswap",
               "description": "Model type discriminator",
               "enum": [
                  "jonswap",
                  "JONSWAP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            }
         },
         "title": "JONSWAP",
         "type": "object"
      },
      "PM": {
         "additionalProperties": false,
         "description": "Pearson-Moskowitz spectral shape.\n\n.. code-block:: text\n\n    PM\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import PM\n    shape = PM()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "pm",
               "description": "Model type discriminator",
               "enum": [
                  "pm",
                  "PM"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "PM",
         "type": "object"
      },
      "SHAPESPEC": {
         "additionalProperties": false,
         "description": "Spectral shape specification.\n\n.. code-block:: text\n\n    BOUND SHAPESPEC JONSWAP|PM|GAUSS|BIN|TMA PEAK|MEAN DSPR [POWER|DEGREES]\n\nThis command BOUND SHAPESPEC defines the shape of the spectra (both in frequency\nand direction) at the boundary of the computational grid in case of parametric\nspectral input.\n\nNotes\n-----\nWhile technically a component `BOUND SHAPESPEC`, this is only intended to be used\nas a subcomponent of the `BOUNDSPEC` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SHAPESPEC\n    shapespec = SHAPESPEC()\n    print(shapespec.render())\n    shapespec = SHAPESPEC(\n        shape=dict(model_type=\"tma\", gamma=3.1, d=12),\n        per_type=\"mean\",\n        dspr_type=\"degrees\",\n    )\n    print(shapespec.render())",
         "properties": {
            "model_type": {
               "default": "shapespec",
               "description": "Model type discriminator",
               "enum": [
                  "shapespec",
                  "SHAPESPEC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "shape": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JONSWAP"
                  },
                  {
                     "$ref": "#/$defs/PM"
                  },
                  {
                     "$ref": "#/$defs/GAUSS"
                  },
                  {
                     "$ref": "#/$defs/BIN"
                  },
                  {
                     "$ref": "#/$defs/TMA"
                  }
               ],
               "description": "The spectral shape",
               "title": "Shape"
            },
            "per_type": {
               "default": "peak",
               "description": "The type of characteristic wave period",
               "enum": [
                  "peak",
                  "mean"
               ],
               "title": "Per Type",
               "type": "string"
            },
            "dspr_type": {
               "default": "power",
               "description": "The type of directional spreading",
               "enum": [
                  "power",
                  "degrees"
               ],
               "title": "Dspr Type",
               "type": "string"
            }
         },
         "title": "SHAPESPEC",
         "type": "object"
      },
      "SIDE": {
         "additionalProperties": false,
         "description": "Boundary over one side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n\nThe boundary is one full side of the computational grid (in 1D cases either of the\ntwo ends of the 1D-grid).\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE\n    side = SIDE(side=\"west\", direction=\"ccw\")\n    print(side.render())",
         "properties": {
            "model_type": {
               "default": "side",
               "description": "Model type discriminator",
               "enum": [
                  "side",
                  "SIDE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "side": {
               "description": "The side of the grid to apply the boundary to",
               "enum": [
                  "north",
                  "nw",
                  "west",
                  "sw",
                  "south",
                  "se",
                  "east",
                  "ne"
               ],
               "title": "Side",
               "type": "string"
            },
            "direction": {
               "default": "ccw",
               "description": "The direction to apply the boundary in",
               "enum": [
                  "ccw",
                  "clockwise"
               ],
               "title": "Direction",
               "type": "string"
            }
         },
         "required": [
            "side"
         ],
         "title": "SIDE",
         "type": "object"
      },
      "SourceDatamesh": {
         "additionalProperties": false,
         "description": "Source dataset from Datamesh.\n\nDatamesh documentation: https://docs.oceanum.io/datamesh/index.html",
         "properties": {
            "model_type": {
               "const": "datamesh",
               "default": "datamesh",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "datasource": {
               "description": "The id of the datasource on Datamesh",
               "title": "Datasource",
               "type": "string"
            },
            "token": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "Datamesh API token, taken from the environment if not provided",
               "title": "Token"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to `oceanum.datamesh.Connector`",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "datasource",
            "token"
         ],
         "title": "SourceDatamesh",
         "type": "object"
      },
      "SourceFile": {
         "additionalProperties": false,
         "description": "Source dataset from file to open with xarray.open_dataset.",
         "properties": {
            "model_type": {
               "const": "file",
               "default": "file",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to xarray.open_dataset",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri"
         ],
         "title": "SourceFile",
         "type": "object"
      },
      "SourceIntake": {
         "additionalProperties": false,
         "description": "Source dataset from intake catalog.\n\nnote\n----\nThe intake catalog can be prescribed either by the URI of an existing catalog file\nor by a YAML string defining the catalog. The YAML string can be obtained from\ncalling the `yaml()` method on an intake dataset instance.",
         "properties": {
            "model_type": {
               "const": "intake",
               "default": "intake",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "dataset_id": {
               "description": "The id of the dataset to read in the catalog",
               "title": "Dataset Id",
               "type": "string"
            },
            "catalog_uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The URI of the catalog to read from",
               "title": "Catalog Uri"
            },
            "catalog_yaml": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The YAML string of the catalog to read from",
               "title": "Catalog Yaml"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to define intake dataset parameters",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "dataset_id"
         ],
         "title": "SourceIntake",
         "type": "object"
      },
      "SourceTimeseriesCSV": {
         "additionalProperties": false,
         "description": "Timeseries source class from CSV file.\n\nThis class should return a timeseries from a CSV file. The dataset variables are\ndefined from the column headers, therefore the appropriate read_csv kwargs must be\npassed to allow defining the columns. The time index is defined from column name\nidentified by the tcol field.",
         "properties": {
            "model_type": {
               "const": "csv",
               "default": "csv",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "filename": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the csv file",
               "title": "Filename"
            },
            "tcol": {
               "default": "time",
               "description": "Name of the column containing the time data",
               "title": "Tcol",
               "type": "string"
            },
            "read_csv_kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to pandas.read_csv",
               "title": "Read Csv Kwargs",
               "type": "object"
            }
         },
         "required": [
            "filename"
         ],
         "title": "SourceTimeseriesCSV",
         "type": "object"
      },
      "SourceWavespectra": {
         "additionalProperties": false,
         "description": "Wavespectra dataset from wavespectra reader.",
         "properties": {
            "model_type": {
               "const": "wavespectra",
               "default": "wavespectra",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "uri": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "format": "path",
                     "type": "string"
                  }
               ],
               "description": "Path to the dataset",
               "title": "Uri"
            },
            "reader": {
               "description": "Name of the wavespectra reader to use, e.g., read_swan",
               "title": "Reader",
               "type": "string"
            },
            "kwargs": {
               "additionalProperties": true,
               "default": {},
               "description": "Keyword arguments to pass to the wavespectra reader",
               "title": "Kwargs",
               "type": "object"
            }
         },
         "required": [
            "uri",
            "reader"
         ],
         "title": "SourceWavespectra",
         "type": "object"
      },
      "TMA": {
         "additionalProperties": false,
         "description": "TMA spectral shape.\n\n.. code-block:: text\n\n    TMA [gamma] [d]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import TMA\n    shape = TMA(gamma=2.0, d=18)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "tma",
               "description": "Model type discriminator",
               "enum": [
                  "tma",
                  "TMA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            },
            "d": {
               "description": "The reference depth at the wave maker in meters.",
               "exclusiveMinimum": 0.0,
               "title": "D",
               "type": "number"
            }
         },
         "required": [
            "d"
         ],
         "title": "TMA",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "id",
      "source",
      "location"
   ]
}

Fields:
  • buffer ()

  • coords ()

  • crop_data ()

  • file_type ()

  • filter ()

  • grid_type ()

  • id ()

  • link ()

  • location (rompy.swan.subcomponents.boundary.SIDE)

  • model_type (Literal['boundspecside', 'BOUNDSPECSIDE'])

  • sel_method ()

  • sel_method_kwargs ()

  • shapespec ()

  • source ()

  • spacing ()

  • time_buffer ()

  • variable ()

  • variables ()

Validators:
  • spacing_gt_zero » spacing

  • unique_not_supported » sel_method_kwargs

  • variable_not_implemented » variable

field buffer: float = 2.0

Space to buffer the grid bounding box if filter_grid is True

field coords: DatasetCoords | None = DatasetCoords(t='time', x='longitude', y='latitude', z='depth', s='site')

Names of the coordinates in the dataset

field crop_data: bool = True

Update crop filter from Time object if passed to get method

field file_type: Literal['tpar', 'spec2d'] = 'tpar'

The type of file to write

field filter: Filter | None [Optional]

Optional filter specification to apply to the dataset

field grid_type: Literal['boundary_wave_station'] = 'boundary_wave_station'

Model type discriminator

field id: str [Required]

Unique identifier for this data source

field link: bool = False

Whether to create a symbolic link instead of copying the file

field location: SIDE [Required]

The side of the grid to apply the boundary to

field model_type: Literal['boundspecside', 'BOUNDSPECSIDE'] = 'boundspecside'

Model type discriminator

field sel_method: Literal['idw', 'nearest'] = 'idw'

Wavespectra method to use for selecting boundary points from the dataset

field sel_method_kwargs: dict = {}

Keyword arguments for sel_method

Validated by:
  • unique_not_supported

field shapespec: SHAPESPEC = SHAPESPEC(model_type='shapespec', shape=JONSWAP(model_type='jonswap', gamma=3.3), per_type='peak', dspr_type='degrees')

Spectral shape specification

field source: SOURCE_TYPES [Required]

Dataset source reader, must return a wavespectra-enabled xarray dataset in the open method

field spacing: float | Literal['parent'] | None = None

Spacing between points along the grid boundary to retrieve data for. If None (default), points are defined from the the actual grid object passed to the get method. If ‘parent’, the resolution of the parent dataset is used to define the spacing.

Validated by:
  • spacing_gt_zero

field time_buffer: list[int] = [0, 0]

Number of source data timesteps to buffer the time range if filter_time is True

field variable: bool = False

Whether the spectra can vary along the side

Validated by:
  • variable_not_implemented

field variables: list[str] | None = []

Subset of variables to extract from the dataset

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

get(destdir: str, grid: SwanGrid, time: TimeRange | None = None) str[source]

Write the data source to a new location.

Parameters:
  • destdir (str | Path) – Destination directory for the SWAN ASCII file.

  • grid (RegularGrid) – Grid instance to use for selecting the boundary points.

  • time (TimeRange, optional) – The times to filter the data to, only used if self.crop_data is True.

Returns:

  • filename (Path) – The filename of the written boundary file.

  • cmd (str) – Boundary command string to render in the SWAN INPUT file

plot(model_grid=None, cmap='turbo', fscale=10, ax=None, **kwargs)

Plot the grid.

plot_boundary(grid=None, fscale=10, ax=None, **kwargs)

Plot the boundary points on a map.

validator spacing_gt_zero  »  spacing
validator unique_not_supported  »  sel_method_kwargs
validator variable_not_implemented  »  variable
property ds

Return the filtered xarray dataset instance.

property dspr: str
property outfile: str
property per: str
property tpar: DataFrame

TPAR dataframe for the _ds attr.

rompy.swan.boundary.write_tpar(df: DataFrame, filename: str | Path)[source]

Write TPAR file.

Parameters:
  • df (pandas.DataFrame) – TPAR dataframe.

  • filename (str | Path) – Filename to write to.

Types#

Types for the swan wrapper.

class rompy.swan.types.BlockOptions(value)[source]

Valid options for block output parameters.

HSIGN

Significant wave height (in m).

Type:

“hsign”

HSWELL

Swell wave height (in m).

Type:

“hswell”

DIR

Mean wave direction (in degrees).

Type:

“dir”

DPM

Mean wave direction at the peak frequency (in degrees).

Type:

“dpm”

PDIR

Peak wave direction (in degrees).

Type:

“pdir”

TDIR

Direction of energy transport (in degrees).

Type:

“tdir”

TM01

Mean absolute wave period (in s).

Type:

“tm01”

RTM01

Mean relative wave period (in s).

Type:

“rtm01”

RTP

Peak period of the (relative frequency) variance density spectrum (in s).

Type:

“rtp”

TPS

Smoothed peak period (in s).

Type:

“tps”

PER

Mean absolute wave period (in s).

Type:

“per”

RPER

Mean relative wave period (in s).

Type:

“rper”

TMM10

Mean absolute wave period (in s).

Type:

“tmm10”

RTMM10

Mean relative wave period (in s).

Type:

“rtmm10”

TM02

Mean absolute zero-crossing period (in s).

Type:

“tm02”

FSPR

The normalised width of the frequency spectrum.

Type:

“fspr”

DSPR

Directional spreading of the waves (in degrees).

Type:

“dspr”

QP

Peakedness of the wave spectrum (dimensionless).

Type:

“qp”

DEPTH

Water depth (in m).

Type:

“depth”

WATLEV

Water level (in m).

Type:

“watlev”

BOTLEV

Bottom level (in m).

Type:

“botlev”

VEL

Current velocity (vector; in m/s).

Type:

“vel”

FRCOEF

Friction coefficient (equal to cfw or kn in command FRICTION).

Type:

“frcoef”

WIND

Wind velocity (vector; in m/s).

Type:

“wind”

AICE

Ice concentration (as a fraction from 0 to 1).

Type:

“aice”

PROPAGAT

Sum of PROPXY, PROPTHETA and PROPSIGMA (in W/m2 or m2/s).

Type:

“propagat”

PROPXY

Energy propagation in geographic space; sum of x- and y-direction (in W/m2 or m2/s).

Type:

“propxy”

PROPTHETA

Energy propagation in theta space (in W/m2 or m2/s).

Type:

“proptheta”

PROPSIGMA

Energy propagation in sigma space (in W/m2 or m2/s).

Type:

“propsigma”

GENERAT

Total energy generation (in W/m2 or m2/s).

Type:

“generat”

GENWIND

Energy generation due to wind (in W/m2 or m2/s).

Type:

“genwind”

REDIST

Total energy redistribution (in W/m2 or m2/s).

Type:

“redist”

REDQUAD

Energy redistribution due to quadruplets (in W/m2 or m2/s).

Type:

“redquad”

REDTRIAD

Energy redistribution due to triads (in W/m2 or m2/s).

Type:

“redtriad”

DISSIP

Total energy dissipation (in W/m2 or m2/s).

Type:

“dissip”

DISBOT

Energy dissipation due to bottom friction (in W/m2 or m2/s).

Type:

“disbot”

DISSURF

Energy dissipation due to surf breaking (in W/m2 or m2/s).

Type:

“dissurf”

DISWCAP

Energy dissipation due to whitecapping (in W/m2 or m2/s).

Type:

“diswcap”

DISSWELL

Energy dissipation due to swell dissipation (in W/m2 or m2/s).

Type:

“disswell”

DISVEG

Energy dissipation due to vegetation (in W/m2 or m2/s).

Type:

“disveg”

DISMUD

Energy dissipation due to mud (in W/m2 or m2/s).

Type:

“dismud”

DISICE

Energy dissipation due to sea ice (in W/m2 or m2/s).

Type:

“disice”

RADSTR

Energy transfer between waves and currents due to radiation stress (in W/m2 or m2/s).

Type:

“radstr”

QB

Fraction of breaking waves due to depth-induced breaking.

Type:

“qb”

TRANSP

Transport of energy (vector; in W/m2 or m2/s).

Type:

“transp”

FORCE

Wave-induced force per unit surface area (vector; in N/m2).

Type:

“force”

UBOT

The rms-value of the maxima of the orbital velocity near the bottom (in m/s).

Type:

“ubot”

URMS

The rms-value of the orbital velocity near the bottom (in m/s).

Type:

“urms”

TMBOT

The bottom wave period (in s).

Type:

“tmbot”

WLENGTH

Average wave length (in m).

Type:

“wlength”

LWAVP

Peak wave length (in m).

Type:

“lwavp”

STEEPNESS

Average wave steepness (dimensionless).

Type:

“steepness”

BFI

Benjamin-Feir index (dimensionless).

Type:

“bfi”

NPLANTS

Number of plants per square meter.

Type:

“nplants”

DHSIGN

Difference in significant wave height from the last two iterations (in m).

Type:

“dhsign”

DRTM01

Difference in average wave period (RTM01) from the last two iterations (in s).

Type:

“drtm01”

LEAK

Numerical loss of energy equal to cthetaE(omega,theta) across boundaries.

Type:

“leak”

TIME

Full date-time string as part of line used in TABLE only.

Type:

“time”

TSEC

Time in seconds with respect to a reference time (see command QUANTITY).

Type:

“tsec”

XP

The x-coordinate in the problem coordinate system of the output location.

Type:

“xp”

YP

The y-coordinate in the problem coordinate system of the output location.

Type:

“yp”

DIST

If output has been requested along a curve then the distance along the curve can be obtained with the command TABLE. DIST is the distance along the curve measured from teh first point on the curve to the output location on the curve in meters (also in the case of spherical coordinates).

Type:

“dist”

SETUP

Set-up due to waves (in m).

Type:

“setup”

PTHSIGN

Watershed partitions of the significant wave height (in m).

Type:

“pthsign”

PTRTP

Watershed partitions of the relative peak period (in s).

Type:

“ptrtp”

PTWLEN

Watershed partitions of the average wave length (in m).

Type:

“ptwlen”

PTDIR

Watershed partitions of the peak wave direction (in degrees).

Type:

“ptdir”

PTDSPR

Watershed partitions of the directional spreading (in degrees).

Type:

“ptdspr”

PTWFRAC

Watershed partitions of the wind fraction (dimensionless).

Type:

“ptwfrac”

PTSTEEPNE

Watershed partition of the wave steepness (dimensionless).

Type:

“ptsteepne”

PARTITION

The raw spectral partition for wave system tracking post-processing.

Type:

“partition”

Note

Energy given in W/m2 or m2/s depending on command SET.

Note

UBOT and URMS required command FRICTION to be used. If friction is ignored in the computation, then one should use the command FRICTION with the value of the friction set to zero (e.g., FRICTION COLLINS 0).

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count(sub[, start[, end]]) int

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping) str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace(old, new, count=-1, /)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class rompy.swan.types.BoundShapeOptions(value)[source]

Valid options for the boundary shape type.

JONSWAP

JONSWAP spectrum.

Type:

“jonswap”

PM

Pierson-Moskowitz spectrum.

Type:

“pm”

GAUSS

Gaussian spectrum.

Type:

“gauss”

BIN

Energy at a single bin spectrum.

Type:

“bin”

TMA

TMA spectrum.

Type:

“tma”

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count(sub[, start[, end]]) int

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping) str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace(old, new, count=-1, /)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class rompy.swan.types.GridOptions(value)[source]

Valid options for the input grid type.

BOTTOM

Bottom level grid.

Type:

“bottom”

WLEVEL

Water level grid.

Type:

“wlevel”

CURRENT

Current field grid.

Type:

“current”

VX

Current field x-component grid.

Type:

“vx”

VY

Current field y-component grid.

Type:

“vy”

WIND

Wind velocity grid.

Type:

“wind”

WX

Wind velocity x-component grid.

Type:

“wx”

WY

Wind velocity y-component grid.

Type:

“wy”

FRICTION

Bottom friction grid.

Type:

“friction”

NPLANTS

Horizontally varying vegetation density grid.

Type:

“nplants”

TURBVISC

Horizontally varying turbulent viscosity grid.

Type:

“turbvisc”

MUDLAYER

Horizontally varying mud layer thickness grid.

Type:

“mudlayer”

AICE

Areal ice fraction grid, a number between 0 and 1.

Type:

“aice”

HICE

Ice thickness grid.

Type:

“hice”

HSS

Sea-swell significant wave height grid.

Type:

“hss”

TSS

Sea-swell mean wave period.

Type:

“tss”

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count(sub[, start[, end]]) int

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping) str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace(old, new, count=-1, /)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class rompy.swan.types.IDLA(value)[source]

Order of values in the input files.

ONE

SWAN reads the map from left to right starting in the upper-left-hand corner of the map. A new line in the map should start on a new line in the file.

Type:

1

TWO

As 1 but a new line in the map need not start on a new line in the file.

Type:

2

THREE

SWAN reads the map from left to right starting in the lower-left-hand corner of the map. A new line in the map should start on a new line in the file.

Type:

3

FOUR

As 3 but a new line in the map need not start on a new line in the file.

Type:

4

FIVE

SWAN reads the map from top to bottom starting in the lower-left-hand corner of the map. A new column in the map should start on a new line in the file.

Type:

5

SIX

As 5 but a new column in the map need not start on a new line in the file.

Type:

6

Notes

It is assumed that the x-axis of the grid is pointing to the right and the y-axis upwards.

as_integer_ratio()

Return integer ratio.

Return a pair of integers, whose ratio is exactly equal to the original int and with a positive denominator.

>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
bit_length()

Number of bits necessary to represent self in binary.

>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
conjugate()

Returns self, the complex conjugate of any int.

denominator

the denominator of a rational number in lowest terms

from_bytes(byteorder, *, signed=False)

Return the integer represented by the given array of bytes.

bytes

Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.

signed

Indicates whether two’s complement is used to represent the integer.

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

real

the real part of a complex number

to_bytes(length, byteorder, *, signed=False)

Return an array of bytes representing an integer.

length

Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.

signed

Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class rompy.swan.types.PhysicsOff(value)[source]

Physics commands to be switched off.

WINDGROWTH

Switches off wind growth (in commands GEN1, GEN2, GEN3).

Type:

str = “windgrowth”

QUADRUPL

Switches off quadruplet wave interactions (in command GEN3).

Type:

str = “quadrupl”

WCAPPING

Switches off whitecapping (in command GEN3).

Type:

str = “wcapping”

BREAKING

Switches off wave breaking dissipation.

Type:

str = “breaking”

REFRAC

Switches off wave refraction (action transport in theta space).

Type:

str = “refrac”

FSHIFT

Switches off frequency shifting (action transport in sigma space).

Type:

str = “fshift”

BNDCHK

Switches off the checking of the delta imposed and computed Hs at the boundary.

Type:

str = “bndchk”

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count(sub[, start[, end]]) int

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping) str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace(old, new, count=-1, /)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class rompy.swan.types.SideOptions(value)[source]

Valid options for the boundary shape type.

NORTH

North side.

Type:

“north”

NW

North-west side.

Type:

“nw”

WEST

West side.

Type:

“west”

SW

South-west side.

Type:

“sw”

SOUTH

South side.

Type:

“south”

SE

South-east side.

Type:

“se”

EAST

East side.

Type:

“east”

NE

North-east side.

Type:

“ne”

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count(sub[, start[, end]]) int

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith(suffix[, start[, end]]) bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format(*args, **kwargs) str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping) str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index(sub[, start[, end]]) int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace(old, new, count=-1, /)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex(sub[, start[, end]]) int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including \n \r \t \f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits (starting from the left). -1 (the default value) means no limit.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith(prefix[, start[, end]]) bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

Swan components#

Base#

Base class for SWAN components.

How to subclass#

  • Define a new model_type Literal for the subclass

  • Overwrite the cmd method to return the SWAN input file string

pydantic model rompy.swan.components.base.BaseComponent[source]

Base class for SWAN components.

This class is not intended to be used directly, but to be subclassed by other SWAN components to implement the following common behaviour:

  • Define a render() method to render a CMD string from the component

  • Split the rendered CMD if longer than 132 characters

  • Forbid extra arguments so only implemented fields must be specified

Show JSON schema
{
   "title": "BaseComponent",
   "description": "Base class for SWAN components.\n\nThis class is not intended to be used directly, but to be subclassed by other\nSWAN components to implement the following common behaviour:\n\n* Define a `render()` method to render a CMD string from the component\n* Split the rendered CMD if longer than 132 characters\n* Forbid extra arguments so only implemented fields must be specified",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "component",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "model_type"
   ]
}

Fields:
  • model_type (Literal['component'])

field model_type: Literal['component'] [Required]

Model type discriminator

abstract cmd() str | list[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str[source]

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.base.MultiComponents[source]

Mixin for components that can have multiple components.

Show JSON schema
{
   "title": "MultiComponents",
   "description": "Mixin for components that can have multiple components.",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "component",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "components": {
         "description": "The components to render",
         "items": {},
         "title": "Components",
         "type": "array"
      }
   },
   "additionalProperties": false,
   "required": [
      "model_type",
      "components"
   ]
}

Fields:
  • components (list)

  • model_type ()

field components: list [Required]

The components to render

field model_type: Literal['component'] [Required]

Model type discriminator

cmd() list[str][source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

rompy.swan.components.base.split_string(cmd: str, max_length: int = 180, spaces: int = 4) list[source]

Split command cmd if longer than max_length.

Parameters:
  • cmd (str) – SWAN CMD string to split.

  • max_length (int) – Maximum length of each split string.

  • spaces (int) – Number of spaces in each identation before each new line.

Returns:

split_cmd – List of split CMD strings.

Return type:

list

Group#

SWAN group components.

pydantic model rompy.swan.components.group.BaseGroupComponent[source]

Base group component.

Base class for SWAN group components. This base class modifies the render() method to allow rendering of a list of components. It is not intended to be used directly but to be subclassed by other group components.

Show JSON schema
{
   "title": "BaseGroupComponent",
   "description": "Base group component.\n\nBase class for SWAN group components. This base class modifies the `render()`\nmethod to allow rendering of a list of components. It is not intended to be used\ndirectly but to be subclassed by other group components.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "group",
         "description": "Model type discriminator",
         "enum": [
            "group",
            "GROUP"
         ],
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['group', 'GROUP'] = 'group'

Model type discriminator

abstract cmd() str | list

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(*args, **kwargs) str[source]

Override base class to allow rendering list of components.

pydantic model rompy.swan.components.group.INPGRIDS[source]

SWAN input grids group component.

INPGRID ...
READGRID ...

INPGRID ...
READGRID ...

...

This group component is a convenience to allow defining and rendering a list of input grid components.

Examples

In [1]: from rompy.swan.components.inpgrid import REGULAR, ICE

In [2]: from rompy.swan.components.group import INPGRIDS

In [3]: inpgrid_bottom = REGULAR(
   ...:     grid_type="bottom",
   ...:     excval=-99.0,
   ...:     xpinp=172.0,
   ...:     ypinp=-41.0,
   ...:     alpinp=0.0,
   ...:     mxinp=99,
   ...:     myinp=99,
   ...:     dxinp=0.005,
   ...:     dyinp=0.005,
   ...:     readinp=dict(fname1="bottom.txt"),
   ...: )
   ...: 

In [4]: inpgrid_wind = REGULAR(
   ...:     grid_type="wind",
   ...:     excval=-99.0,
   ...:     xpinp=172.0,
   ...:     ypinp=-41.0,
   ...:     alpinp=0.0,
   ...:     mxinp=99,
   ...:     myinp=99,
   ...:     dxinp=0.005,
   ...:     dyinp=0.005,
   ...:     readinp=dict(fname1="wind.txt"),
   ...:     nonstationary=dict(
   ...:         tbeg="2019-01-01T00:00:00",
   ...:         tend="2019-01-07 00:00:00",
   ...:         delt=3600,
   ...:         dfmt="hr",
   ...:     ),
   ...: )
   ...: 

In [5]: inpgrid_ice_cte = ICE(aice=0.8, hice=2.0)

In [6]: inpgrids = INPGRIDS(inpgrids=[inpgrid_bottom, inpgrid_wind, inpgrid_ice_cte])

In [7]: print(inpgrids.render())
INPGRID BOTTOM REGULAR xpinp=172.0 ypinp=-41.0 alpinp=0.0 mxinp=99 myinp=99 dxinp=0.005 dyinp=0.005 EXCEPTION excval=-99.0
READINP BOTTOM fac=1.0 fname1='bottom.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

INPGRID WIND REGULAR xpinp=172.0 ypinp=-41.0 alpinp=0.0 mxinp=99 myinp=99 dxinp=0.005 dyinp=0.005 EXCEPTION excval=-99.0 NONSTATIONARY tbeginp=20190101.000000 deltinp=1.0 HR &
    tendinp=20190107.000000
READINP WIND fac=1.0 fname1='wind.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

ICE aice=0.8 hice=2.0

Show JSON schema
{
   "title": "INPGRIDS",
   "description": "SWAN input grids group component.\n\n.. code-block:: text\n\n    INPGRID ...\n    READGRID ...\n\n    INPGRID ...\n    READGRID ...\n\n    ...\n\nThis group component is a convenience to allow defining and rendering\na list of input grid components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import REGULAR, ICE\n    from rompy.swan.components.group import INPGRIDS\n    inpgrid_bottom = REGULAR(\n        grid_type=\"bottom\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"bottom.txt\"),\n    )\n    inpgrid_wind = REGULAR(\n        grid_type=\"wind\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"wind.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    inpgrid_ice_cte = ICE(aice=0.8, hice=2.0)\n    inpgrids = INPGRIDS(inpgrids=[inpgrid_bottom, inpgrid_wind, inpgrid_ice_cte])\n    print(inpgrids.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "inpgrids",
         "default": "inpgrids",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "inpgrids": {
         "description": "List of input grid components",
         "items": {
            "discriminator": {
               "mapping": {
                  "CURVILINEAR": "#/$defs/CURVILINEAR",
                  "ICE": "#/$defs/ICE",
                  "REGULAR": "#/$defs/REGULAR",
                  "UNSTRUCTURED": "#/$defs/UNSTRUCTURED",
                  "WIND": "#/$defs/WIND",
                  "curvilinear": "#/$defs/CURVILINEAR",
                  "ice": "#/$defs/ICE",
                  "regular": "#/$defs/REGULAR",
                  "unstructured": "#/$defs/UNSTRUCTURED",
                  "wind": "#/$defs/WIND"
               },
               "propertyName": "model_type"
            },
            "oneOf": [
               {
                  "$ref": "#/$defs/REGULAR"
               },
               {
                  "$ref": "#/$defs/CURVILINEAR"
               },
               {
                  "$ref": "#/$defs/UNSTRUCTURED"
               },
               {
                  "$ref": "#/$defs/WIND"
               },
               {
                  "$ref": "#/$defs/ICE"
               }
            ]
         },
         "minItems": 1,
         "title": "Inpgrids",
         "type": "array"
      }
   },
   "$defs": {
      "CURVILINEAR": {
         "additionalProperties": false,
         "description": "SWAN curvilinear input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] CURVILINEAR [stagrx] [stagry] [mxinp] [myinp] &\n        (EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is a group component that includes an `INPGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import CURVILINEAR\n    inpgrid = CURVILINEAR(\n        grid_type=\"wind\",\n        stagrx=0.0,\n        stagry=0.0,\n        mxinp=199,\n        myinp=199,\n        excval=-99.0,\n        readinp=dict(fname1=\"wind.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    print(inpgrid.render())\n\nTODO: Handle (or not) setting default values for mxinp and myinp from cgrid.",
         "properties": {
            "model_type": {
               "default": "curvilinear",
               "description": "Model type discriminator",
               "enum": [
                  "curvilinear",
                  "CURVILINEAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "$ref": "#/$defs/GridOptions",
               "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
            },
            "excval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
               "title": "Excval"
            },
            "nonstationary": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/NONSTATIONARY"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Nonstationary time specification"
            },
            "readinp": {
               "$ref": "#/$defs/READINP",
               "description": "SWAN input grid file reader specification"
            },
            "stagrx": {
               "default": 0.0,
               "description": "Staggered x'-direction with respect to computational grid, e.g., `stagrx=0.5` means that the input grid points are shifted a half step in x'-direction; in many flow models x-velocities are defined in points shifted a half step in x'-direction",
               "title": "Stagrx",
               "type": "number"
            },
            "stagry": {
               "default": 0.0,
               "description": "Staggered y'-direction with respect to computational grid, e.g., `stagry=0.5` means that the input grid points are shifted a half step in y'-direction; in many flow models y-velocities are defined in points shifted a half step in y'-direction",
               "title": "Stagry",
               "type": "number"
            },
            "mxinp": {
               "description": "Number of meshes in \u03be-direction of the input grid (this number is one less than the number of grid points in this direction)",
               "title": "Mxinp",
               "type": "integer"
            },
            "myinp": {
               "description": "Number of meshes in \u03b7-direction of the input grid (this number is one less than the number of grid points in this direction)",
               "title": "Myinp",
               "type": "integer"
            }
         },
         "required": [
            "grid_type",
            "readinp",
            "mxinp",
            "myinp"
         ],
         "title": "CURVILINEAR",
         "type": "object"
      },
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "ICE": {
         "additionalProperties": false,
         "description": "Constant wind input field.\n\n.. code-block:: text\n\n    ICE [aice] [hice]\n\nWith this optional command, the user indicates that one or more ice fields are\nconstant.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import ICE\n    ice = ICE(aice=0.1, hice=0.1)\n    print(ice.render())",
         "properties": {
            "model_type": {
               "default": "ice",
               "description": "Model type discriminator",
               "enum": [
                  "ice",
                  "ICE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "description": "Areal ice fraction, a number from 0 to 1",
               "maximum": 1.0,
               "minimum": 0.0,
               "title": "Aice",
               "type": "number"
            },
            "hice": {
               "description": "Ice thickness (m)",
               "minimum": 0.0,
               "title": "Hice",
               "type": "number"
            }
         },
         "required": [
            "aice",
            "hice"
         ],
         "title": "ICE",
         "type": "object"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      },
      "NONSTATIONARY": {
         "additionalProperties": false,
         "description": "Nonstationary time specification.\n\n.. code-block:: text\n\n    NONSTATIONARY [tbeg] [delt] SEC|MIN|HR|DAY [tend]\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    nonstat = NONSTATIONARY(\n        tbeg=\"2012-01-01T00:00:00\",\n        tend=\"2012-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    print(nonstat.render())\n    from datetime import datetime, timedelta\n    nonstat = NONSTATIONARY(\n        tbeg=datetime(1990, 1, 1),\n        tend=datetime(1990, 1, 7),\n        delt=timedelta(minutes=30),\n        tfmt=1,\n        dfmt=\"min\",\n        suffix=\"tbl\",\n    )\n    print(nonstat.render())",
         "properties": {
            "model_type": {
               "default": "nonstationary",
               "description": "Model type discriminator",
               "enum": [
                  "nonstationary",
                  "NONSTATIONARY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "tbeg": {
               "default": "1970-01-01T00:00:00",
               "description": "Start time",
               "format": "date-time",
               "title": "Tbeg",
               "type": "string"
            },
            "delt": {
               "default": "PT1H",
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            },
            "suffix": {
               "default": "",
               "description": "Suffix to prepend to argument names when rendering",
               "title": "Suffix",
               "type": "string"
            },
            "tend": {
               "default": "1970-01-02T00:00:00",
               "description": "End time",
               "format": "date-time",
               "title": "Tend",
               "type": "string"
            }
         },
         "title": "NONSTATIONARY",
         "type": "object"
      },
      "READINP": {
         "additionalProperties": false,
         "description": "SWAN input grid reader.\n\n.. code-block:: text\n\n    READINP GRID_TYPE [fac] ('fname1' | SERIES 'fname2') [idla] [nhedf] &\n        ([nhedt]) [nhedvec] FREE|FORMAT ('form'|idfm)|UNFORMATTED`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READINP\n    readinp = READINP(\n        grid_type=\"wind\",\n        fname1=\"wind.txt\",\n        fac=1.0,\n        idla=3,\n        format=\"free\",\n    )\n    print(readinp.render())",
         "properties": {
            "model_type": {
               "default": "readinp",
               "description": "Model type discriminator",
               "enum": [
                  "readinp",
                  "READINP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GridOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of the SWAN grid file"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "exclusiveMinimum": 0.0,
               "title": "Fac",
               "type": "number"
            },
            "idla": {
               "$ref": "#/$defs/IDLA",
               "default": 1,
               "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
            },
            "nhedf": {
               "default": 0,
               "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
               "minimum": 0,
               "title": "Nhedf",
               "type": "integer"
            },
            "nhedvec": {
               "default": 0,
               "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
               "minimum": 0,
               "title": "Nhedvec",
               "type": "integer"
            },
            "format": {
               "default": "free",
               "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
               "enum": [
                  "free",
                  "fixed",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            },
            "form": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
               "title": "Form"
            },
            "idfm": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        5,
                        6,
                        8
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "File format identifier, only used if `format='fixed'`",
               "title": "Idfm"
            },
            "fname1": {
               "description": "Name of the file with the values of the variable.",
               "title": "Fname1",
               "type": "string"
            },
            "fname2": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of file that contains the names of the files where the variables are given when the SERIES option is used. These names are to be given in proper time sequence. SWAN reads the next file when the previous file end has been encountered. In these files the input should be given in the same format as in the above file 'fname1' (that implies that a file should start with the start of an input time step)",
               "title": "Fname2"
            },
            "nhedt": {
               "default": 0,
               "description": "Only if variable is time dependent: number of header lines in the file at the start of each time level. A time step may start with more header lines than `nhedt` because the variable may be a vector variable which has its own header lines (see `nhedvec`)",
               "minimum": 0,
               "title": "Nhedt",
               "type": "integer"
            }
         },
         "required": [
            "fname1"
         ],
         "title": "READINP",
         "type": "object"
      },
      "REGULAR": {
         "additionalProperties": false,
         "description": "SWAN regular input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] REGULAR [xpinp] [ypinp] [alpinp] [mxinp] [myinp] &\n        [dxinp] [dyinp] (EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is a group component that includes an `INPGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import REGULAR\n    inpgrid = REGULAR(\n        grid_type=\"bottom\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"bottom.txt\"),\n    )\n    print(inpgrid.render())\n    inpgrid = REGULAR(\n        grid_type=\"wind\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"wind.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    print(inpgrid.render())\n\nTODO: Use grid object, requires different grid parameters to be allowed.",
         "properties": {
            "model_type": {
               "default": "regular",
               "description": "Model type discriminator",
               "enum": [
                  "regular",
                  "REGULAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "$ref": "#/$defs/GridOptions",
               "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
            },
            "excval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
               "title": "Excval"
            },
            "nonstationary": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/NONSTATIONARY"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Nonstationary time specification"
            },
            "readinp": {
               "$ref": "#/$defs/READINP",
               "description": "SWAN input grid file reader specification"
            },
            "xpinp": {
               "description": "Geographic location (x-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default",
               "title": "Xpinp",
               "type": "number"
            },
            "ypinp": {
               "description": "Geographic location (y-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default",
               "title": "Ypinp",
               "type": "number"
            },
            "alpinp": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 0.0,
               "description": "Direction of the positive x-axis of the input grid (in degrees, Cartesian convention)",
               "title": "Alpinp"
            },
            "mxinp": {
               "description": "Number of meshes in x-direction of the input grid (this number is one less than the number of grid points in this direction)",
               "title": "Mxinp",
               "type": "integer"
            },
            "myinp": {
               "description": "Number of meshes in y-direction of the input grid (this number is one less than the number of grid points in this direction). In 1D-mode, `myinp` should be 0",
               "title": "Myinp",
               "type": "integer"
            },
            "dxinp": {
               "description": "Mesh size in x-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used",
               "title": "Dxinp",
               "type": "number"
            },
            "dyinp": {
               "description": "Mesh size in y-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used. In 1D-mode, `dyinp` may have any value",
               "title": "Dyinp",
               "type": "number"
            }
         },
         "required": [
            "grid_type",
            "readinp",
            "xpinp",
            "ypinp",
            "mxinp",
            "myinp",
            "dxinp",
            "dyinp"
         ],
         "title": "REGULAR",
         "type": "object"
      },
      "UNSTRUCTURED": {
         "additionalProperties": false,
         "description": "SWAN unstructured input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] UNSTRUCTURED EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is a group component that includes an `INPGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import UNSTRUCTURED\n    inpgrid = UNSTRUCTURED(\n        grid_type=\"bottom\",\n        excval=-99.0,\n        readinp=dict(fname1=\"bottom.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    print(inpgrid.render())",
         "properties": {
            "model_type": {
               "default": "unstructured",
               "description": "Model type discriminator",
               "enum": [
                  "unstructured",
                  "UNSTRUCTURED"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "$ref": "#/$defs/GridOptions",
               "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
            },
            "excval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
               "title": "Excval"
            },
            "nonstationary": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/NONSTATIONARY"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Nonstationary time specification"
            },
            "readinp": {
               "$ref": "#/$defs/READINP",
               "description": "SWAN input grid file reader specification"
            }
         },
         "required": [
            "grid_type",
            "readinp"
         ],
         "title": "UNSTRUCTURED",
         "type": "object"
      },
      "WIND": {
         "additionalProperties": false,
         "description": "Constant wind input field.\n\n.. code-block:: text\n\n    WIND [vel] [dir]\n\nWith this optional command, the user indicates that the wind field is constant.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import WIND\n    wind = WIND(vel=10.0, dir=270.0)\n    print(wind.render())",
         "properties": {
            "model_type": {
               "default": "wind",
               "description": "Model type discriminator",
               "enum": [
                  "wind",
                  "WIND"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "vel": {
               "description": "Wind velocity at 10 m elevation (m/s)",
               "minimum": 0.0,
               "title": "Vel",
               "type": "number"
            },
            "dir": {
               "description": "Wind direction at 10 m elevation (in degrees, Cartesian or Nautical convention, see command SET)",
               "maximum": 360.0,
               "minimum": -180.0,
               "title": "Dir",
               "type": "number"
            }
         },
         "required": [
            "vel",
            "dir"
         ],
         "title": "WIND",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "inpgrids"
   ]
}

Fields:
Validators:
field inpgrids: list[REGULAR | CURVILINEAR | UNSTRUCTURED | WIND | ICE] [Required]

List of input grid components

Constraints:
  • min_length = 1

Validated by:
field model_type: Literal['inpgrids'] = 'inpgrids'

Model type discriminator

cmd() str | list[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator ensure_unique_grid_type  »  inpgrids[source]

Ensure that each grid type is unique.

render(*args, **kwargs) str

Override base class to allow rendering list of components.

pydantic model rompy.swan.components.group.LOCKUP[source]

Lockup group component.

COMPUTE ...
HOTFILE ...
COMPUTE ...
HOTFILE ...
...
STOP

This is a group component to specify SWAN “Lockup” commands including multiple COMPUTE commands that may or may not be interleaved with HOTFILE commands, and a final STOP command.

Examples

In [1]: from rompy.swan.components.group import LOCKUP

In [2]: lockup = LOCKUP(
   ...:     compute=dict(
   ...:         model_type="stat",
   ...:         times=dict(
   ...:             model_type="nonstationary",
   ...:             tbeg="1990-01-01T00:00:00",
   ...:             tend="1990-01-01T03:00:00",
   ...:             delt="PT1H",
   ...:             dfmt="hr",
   ...:         ),
   ...:         hotfile=dict(fname="hotfile"),
   ...:         hottimes=[-1],
   ...:     ),
   ...: )
   ...: 

In [3]: print(lockup.render())
COMPUTE STATIONARY time=19900101.000000
COMPUTE STATIONARY time=19900101.010000
COMPUTE STATIONARY time=19900101.020000
COMPUTE STATIONARY time=19900101.030000
HOTFILE fname='hotfile_19900101T030000'
STOP

Show JSON schema
{
   "title": "LOCKUP",
   "description": "Lockup group component.\n\n.. code-block:: text\n\n    COMPUTE ...\n    HOTFILE ...\n    COMPUTE ...\n    HOTFILE ...\n    ...\n    STOP\n\nThis is a group component to specify SWAN \"Lockup\" commands including multiple\n`COMPUTE` commands that may or may not be interleaved with `HOTFILE` commands,\nand a final `STOP` command.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.group import LOCKUP\n    lockup = LOCKUP(\n        compute=dict(\n            model_type=\"stat\",\n            times=dict(\n                model_type=\"nonstationary\",\n                tbeg=\"1990-01-01T00:00:00\",\n                tend=\"1990-01-01T03:00:00\",\n                delt=\"PT1H\",\n                dfmt=\"hr\",\n            ),\n            hotfile=dict(fname=\"hotfile\"),\n            hottimes=[-1],\n        ),\n    )\n    print(lockup.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "lockup",
         "description": "Model type discriminator",
         "enum": [
            "lockup",
            "LOCKUP"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "compute": {
         "description": "Compute components",
         "discriminator": {
            "mapping": {
               "NONSTAT": "#/$defs/COMPUTE_NONSTAT",
               "STAT": "#/$defs/COMPUTE_STAT",
               "nonstat": "#/$defs/COMPUTE_NONSTAT",
               "stat": "#/$defs/COMPUTE_STAT"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/COMPUTE_STAT"
            },
            {
               "$ref": "#/$defs/COMPUTE_NONSTAT"
            }
         ],
         "title": "Compute"
      }
   },
   "$defs": {
      "COMPUTE_NONSTAT": {
         "additionalProperties": false,
         "description": "Multiple SWAN nonstationary computations.\n\n.. code-block:: text\n\n    COMPUTE NONSTATIONARY [tbegc] [deltc] SEC|MIN|HR|DAY [tendc]\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n    COMPUTE NONSTATIONARY [tbegc] [deltc] SEC|MIN|HR|DAY [tendc]\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n    .\n    .\n\nThis component can be used to define multiple nonstationary compute commands and\nwrite intermediate results as hotfiles between then.\n\nNote\n----\nThe field `times` is optional to allow for the case where the user wants to set\ntimes dynamically after instantiating this component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    from rompy.swan.components.lockup import COMPUTE_NONSTAT\n    times = NONSTATIONARY(\n        tbeg=\"1990-01-01T00:00:00\",\n        tend=\"1990-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    comp = COMPUTE_NONSTAT(times=times)\n    print(comp.render())\n    comp = COMPUTE_NONSTAT(\n        times=times,\n        hotfile=dict(fname=\"hotfile.swn\", format=\"free\"),\n        hottimes=[\"1990-02-01T00:00:00\"],\n    )\n    print(comp.render())\n    comp = COMPUTE_NONSTAT(\n        times=times,\n        initstat=True,\n        hotfile=dict(fname=\"hotfile\", format=\"free\"),\n        hottimes=[6, 12, 18, -1],\n    )\n    print(comp.render())",
         "properties": {
            "model_type": {
               "default": "nonstat",
               "description": "Model type discriminator",
               "enum": [
                  "nonstat",
                  "NONSTAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "times": {
               "$ref": "#/$defs/NONSTATIONARY",
               "description": "Compute times"
            },
            "hotfile": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HOTFILE"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Write results to restart files"
            },
            "hottimes": {
               "anyOf": [
                  {
                     "items": {
                        "format": "date-time",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  }
               ],
               "default": [],
               "description": "Times to write hotfiles, can be a list of datetimes or times indices",
               "title": "Hottimes"
            },
            "suffix": {
               "default": "_%Y%m%dT%H%M%S",
               "description": "Time-template suffix to add to hotfile fname",
               "title": "Suffix",
               "type": "string"
            },
            "initstat": {
               "default": false,
               "description": "Run a STATIONARY computation at the initial time prior to the NONSTATIONARY computation(s) to prescribe initial conditions",
               "title": "Initstat",
               "type": "boolean"
            }
         },
         "title": "COMPUTE_NONSTAT",
         "type": "object"
      },
      "COMPUTE_STAT": {
         "additionalProperties": false,
         "description": "Multiple SWAN stationary computations.\n\n.. code-block:: text\n\n    COMPUTE STATIONARY [time]\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n    COMPUTE STATIONARY [time]\n    COMPUTE STATIONARY [time]\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n    .\n    .\n\nThis component can be used to define multiple stationary compute commands and\nwrite intermediate results as hotfiles between then.\n\nNote\n----\nThe field `times` is optional to allow for the case where the user wants to set\ntimes dynamically after instantiating this component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import STATIONARY, NONSTATIONARY\n    from rompy.swan.components.lockup import COMPUTE_STAT\n    time = STATIONARY(time=\"1990-01-01T00:00:00\")\n    comp = COMPUTE_STAT(times=time)\n    print(comp.render())\n    times = NONSTATIONARY(\n        tbeg=\"1990-01-01T00:00:00\",\n        tend=\"1990-01-01T03:00:00\",\n        delt=\"PT1H\",\n    )\n    comp = COMPUTE_STAT(times=times)\n    print(comp.render())\n    hotfile = dict(fname=\"./hotfile.swn\")\n    hottimes=[\"1990-01-01T03:00:00\"]\n    comp = COMPUTE_STAT(times=times, hotfile=hotfile, hottimes=hottimes)\n    print(comp.render())\n    comp = COMPUTE_STAT(times=times, hotfile=hotfile, hottimes=[2, -1])\n    print(comp.render())",
         "properties": {
            "model_type": {
               "default": "stat",
               "description": "Model type discriminator",
               "enum": [
                  "stat",
                  "STAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "times": {
               "description": "Compute times",
               "discriminator": {
                  "mapping": {
                     "NONSTATIONARY": "#/$defs/NONSTATIONARY",
                     "STATIONARY": "#/$defs/STATIONARY",
                     "nonstationary": "#/$defs/NONSTATIONARY",
                     "stationary": "#/$defs/STATIONARY"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/STATIONARY"
                  },
                  {
                     "$ref": "#/$defs/NONSTATIONARY"
                  }
               ],
               "title": "Times"
            },
            "hotfile": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/HOTFILE"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Write results to restart files"
            },
            "hottimes": {
               "anyOf": [
                  {
                     "items": {
                        "format": "date-time",
                        "type": "string"
                     },
                     "type": "array"
                  },
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  }
               ],
               "default": [],
               "description": "Times to write hotfiles, can be a list of datetimes or times indices",
               "title": "Hottimes"
            },
            "suffix": {
               "default": "_%Y%m%dT%H%M%S",
               "description": "Time-template suffix to add to hotfile fname",
               "title": "Suffix",
               "type": "string"
            }
         },
         "title": "COMPUTE_STAT",
         "type": "object"
      },
      "HOTFILE": {
         "additionalProperties": false,
         "description": "Write intermediate results.\n\n.. code-block:: text\n\n    HOTFILE 'fname' ->FREE|UNFORMATTED\n\nThis command can be used to write the entire wave field at the end of a computation\nto a so-called hotfile, to be used as initial condition in a subsequent SWAN run\n(see command `INITIAL HOTSTART`). This command must be entered immediately after a\n`COMPUTE` command.\n\nThe user may choose the format of the hotfile to be written either as free or\nunformatted. If the free format is chosen, then this format is identical to the\nformat of the files written by the `SPECOUT` command (option `SPEC2D`). This\nhotfile is therefore an ASCII file which is human readable.\n\nAn unformatted (or binary) file usually requires less space on your computer than\nan ASCII file. Moreover, it can be readed by a subsequent SWAN run much faster than\nan ASCII file. Especially, when the hotfile might become a big file, the choice for\nunformatted is preferable. Note that your compiler and OS should follow the same\nABI (Application Binary Interface) conventions (e.g. word size, endianness), so\nthat unformatted hotfiles may transfer properly between different OS or platforms.\nThis implies that the present and subsequent SWAN runs do not have to be carried\nout on the same operating system (e.g. Windows, Linux) or on the same computer,\nprovided that distinct ABI conventions have been followed.\n\nNote\n----\nFor parallel MPI runs, more than one hotfile will be generated depending on the\nnumber of processors (`fname-001`, `fname-002`, etc).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.lockup import HOTFILE\n    hotfile = HOTFILE(fname=\"hotfile.swn\")\n    print(hotfile.render())\n    hotfile = HOTFILE(fname=\"hotfile.dat\", format=\"unformatted\")\n    print(hotfile.render())",
         "properties": {
            "model_type": {
               "default": "hotfile",
               "description": "Model type discriminator",
               "enum": [
                  "hotfile",
                  "HOTFILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file to which the wave field is written",
               "format": "path",
               "title": "Fname",
               "type": "string"
            },
            "format": {
               "anyOf": [
                  {
                     "enum": [
                        "free",
                        "unformatted"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Choose between free (SWAN ASCII) or unformatted (binary) format",
               "title": "Format"
            }
         },
         "required": [
            "fname"
         ],
         "title": "HOTFILE",
         "type": "object"
      },
      "NONSTATIONARY": {
         "additionalProperties": false,
         "description": "Nonstationary time specification.\n\n.. code-block:: text\n\n    NONSTATIONARY [tbeg] [delt] SEC|MIN|HR|DAY [tend]\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    nonstat = NONSTATIONARY(\n        tbeg=\"2012-01-01T00:00:00\",\n        tend=\"2012-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    print(nonstat.render())\n    from datetime import datetime, timedelta\n    nonstat = NONSTATIONARY(\n        tbeg=datetime(1990, 1, 1),\n        tend=datetime(1990, 1, 7),\n        delt=timedelta(minutes=30),\n        tfmt=1,\n        dfmt=\"min\",\n        suffix=\"tbl\",\n    )\n    print(nonstat.render())",
         "properties": {
            "model_type": {
               "default": "nonstationary",
               "description": "Model type discriminator",
               "enum": [
                  "nonstationary",
                  "NONSTATIONARY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "tbeg": {
               "default": "1970-01-01T00:00:00",
               "description": "Start time",
               "format": "date-time",
               "title": "Tbeg",
               "type": "string"
            },
            "delt": {
               "default": "PT1H",
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            },
            "suffix": {
               "default": "",
               "description": "Suffix to prepend to argument names when rendering",
               "title": "Suffix",
               "type": "string"
            },
            "tend": {
               "default": "1970-01-02T00:00:00",
               "description": "End time",
               "format": "date-time",
               "title": "Tend",
               "type": "string"
            }
         },
         "title": "NONSTATIONARY",
         "type": "object"
      },
      "STATIONARY": {
         "additionalProperties": false,
         "description": "Stationary time specification.\n\n.. code-block:: text\n\n    STATIONARY [time]\n\nNote\n----\nThe field `time` is optional to allow for the case where the user wants to set the\ntime dynamically after instantiating this component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import STATIONARY\n    stat = STATIONARY(time=\"2012-01-01T00:00:00\")\n    print(stat.render())",
         "properties": {
            "model_type": {
               "default": "stationary",
               "description": "Model type discriminator",
               "enum": [
                  "stationary",
                  "STATIONARY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "time": {
               "default": "1970-01-01T00:00:00",
               "description": "Stationary time",
               "format": "date-time",
               "title": "Time",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            }
         },
         "title": "STATIONARY",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "compute"
   ]
}

Fields:
field compute: COMPUTE_STAT | COMPUTE_NONSTAT [Required]

Compute components

field model_type: Literal['lockup', 'LOCKUP'] = 'lockup'

Model type discriminator

cmd() list[source]

Command file strings for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.group.OUTPUT[source]

Output group component.

FRAME 'sname' ...
GROUP 'sname' ...
CURVE 'sname' ...
RAY 'rname' ...
ISOLINE 'sname' 'rname' ...
POINTS 'sname ...
NGRID 'sname' ...
QUANTITY ...
OUTPUT OPTIONS ...
BLOCK 'sname' ...
TABLE 'sname' ...
SPECOUT 'sname' ...
NESTOUT 'sname ...

This group component is used to define multiple types of output locations and write components in a single model. Only fields that are explicitly prescribed are rendered by this group component.

Note

The components prescribed are validated according to some constraints as defined in the SWAN manual:

  • The name ‘sname’ of each Locations component must be unique.

  • The Locations ‘sname’ assigned to each write component must be defined.

  • The BLOCK component must be associated with either a FRAME or GROUP.

  • The ISOLINE write component must be associated with a RAY component.

  • The NGRID and NESTOUT components must be defined together.

Examples

In [1]: from rompy.swan.components.output import POINTS, BLOCK, QUANTITIES, TABLE

In [2]: from rompy.swan.components.group import OUTPUT

In [3]: points = POINTS(sname="outpts", xp=[172.3, 172.4], yp=[-39, -39])

In [4]: quantity = QUANTITIES(
   ...:     quantities=[
   ...:         dict(output=["depth", "hsign", "tps", "dir", "tm01"], excv=-9),
   ...:     ]
   ...: )
   ...: 

In [5]: times = dict(tbeg="2012-01-01T00:00:00", delt="PT30M", tfmt=1, dfmt="min")

In [6]: block = BLOCK(
   ...:     model_type="block",
   ...:     sname="COMPGRID",
   ...:     fname="./swangrid.nc",
   ...:     output=["depth", "hsign", "tps", "dir"],
   ...:     times=times,
   ...: )
   ...: 

In [7]: table = TABLE(
   ...:     sname="outpts",
   ...:     format="noheader",
   ...:     fname="./swantable.nc",
   ...:     output=["hsign", "hswell", "dir", "tps", "tm01", "watlev", "qp"],
   ...:     times=times,
   ...: )
   ...: 

In [8]: out = OUTPUT(
   ...:     points=points,
   ...:     quantity=quantity,
   ...:     block=block,
   ...:     table=table,
   ...: )
   ...: 

In [9]: print(out.render())
POINTS sname='outpts' &
    xp=172.3 yp=-39.0 &
    xp=172.4 yp=-39.0

QUANTITY DEPTH HSIGN TPS DIR TM01 excv=-9.0

BLOCK sname='COMPGRID' fname='./swangrid.nc' &
    DEPTH &
    HSIGN &
    TPS &
    DIR &
    OUTPUT tbegblk=20120101.000000 deltblk=30.0 MIN

TABLE sname='outpts' NOHEADER fname='./swantable.nc' &
    HSIGN &
    HSWELL &
    DIR &
    TPS &
    TM01 &
    WATLEV &
    QP &
    OUTPUT tbegtbl=20120101.000000 delttbl=30.0 MIN

Show JSON schema
{
   "title": "OUTPUT",
   "description": "Output group component.\n\n.. code-block:: text\n\n    FRAME 'sname' ...\n    GROUP 'sname' ...\n    CURVE 'sname' ...\n    RAY 'rname' ...\n    ISOLINE 'sname' 'rname' ...\n    POINTS 'sname ...\n    NGRID 'sname' ...\n    QUANTITY ...\n    OUTPUT OPTIONS ...\n    BLOCK 'sname' ...\n    TABLE 'sname' ...\n    SPECOUT 'sname' ...\n    NESTOUT 'sname ...\n\nThis group component is used to define multiple types of output locations and\nwrite components in a single model. Only fields that are explicitly prescribed are\nrendered by this group component.\n\nNote\n----\nThe components prescribed are validated according to some constraints as defined\nin the SWAN manual:\n\n- The name `'sname'` of each Locations component must be unique.\n- The Locations `'sname'` assigned to each write component must be defined.\n- The BLOCK component must be associated with either a `FRAME` or `GROUP`.\n- The ISOLINE write component must be associated with a `RAY` component.\n- The NGRID and NESTOUT components must be defined together.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import POINTS, BLOCK, QUANTITIES, TABLE\n    from rompy.swan.components.group import OUTPUT\n    points = POINTS(sname=\"outpts\", xp=[172.3, 172.4], yp=[-39, -39])\n    quantity = QUANTITIES(\n        quantities=[\n            dict(output=[\"depth\", \"hsign\", \"tps\", \"dir\", \"tm01\"], excv=-9),\n        ]\n    )\n    times = dict(tbeg=\"2012-01-01T00:00:00\", delt=\"PT30M\", tfmt=1, dfmt=\"min\")\n    block = BLOCK(\n        model_type=\"block\",\n        sname=\"COMPGRID\",\n        fname=\"./swangrid.nc\",\n        output=[\"depth\", \"hsign\", \"tps\", \"dir\"],\n        times=times,\n    )\n    table = TABLE(\n        sname=\"outpts\",\n        format=\"noheader\",\n        fname=\"./swantable.nc\",\n        output=[\"hsign\", \"hswell\", \"dir\", \"tps\", \"tm01\", \"watlev\", \"qp\"],\n        times=times,\n    )\n    out = OUTPUT(\n        points=points,\n        quantity=quantity,\n        block=block,\n        table=table,\n    )\n    print(out.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "output",
         "description": "Model type discriminator",
         "enum": [
            "output",
            "OUTPUT"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "frame": {
         "anyOf": [
            {
               "$ref": "#/$defs/FRAME",
               "description": "Frame locations component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "group": {
         "anyOf": [
            {
               "$ref": "#/$defs/GROUP",
               "description": "Group locations component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "curve": {
         "anyOf": [
            {
               "$ref": "#/$defs/CURVES",
               "description": "Curve locations component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "ray": {
         "anyOf": [
            {
               "$ref": "#/$defs/RAY",
               "description": "Ray locations component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "isoline": {
         "anyOf": [
            {
               "$ref": "#/$defs/ISOLINE",
               "description": "Isoline locations component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "points": {
         "anyOf": [
            {
               "description": "Points locations component",
               "discriminator": {
                  "mapping": {
                     "POINTS": "#/$defs/POINTS",
                     "POINTS_FILE": "#/$defs/POINTS_FILE",
                     "points": "#/$defs/POINTS",
                     "points_file": "#/$defs/POINTS_FILE"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/POINTS"
                  },
                  {
                     "$ref": "#/$defs/POINTS_FILE"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Points"
      },
      "ngrid": {
         "anyOf": [
            {
               "description": "Ngrid locations component",
               "discriminator": {
                  "mapping": {
                     "NGRID": "#/$defs/NGRID",
                     "NGRID_UNSTRUCTURED": "#/$defs/NGRID_UNSTRUCTURED",
                     "ngrid": "#/$defs/NGRID",
                     "ngrid_unstructured": "#/$defs/NGRID_UNSTRUCTURED"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/NGRID"
                  },
                  {
                     "$ref": "#/$defs/NGRID_UNSTRUCTURED"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Ngrid"
      },
      "quantity": {
         "anyOf": [
            {
               "$ref": "#/$defs/QUANTITIES",
               "description": "Quantity component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "output_options": {
         "anyOf": [
            {
               "$ref": "#/$defs/OUTPUT_OPTIONS",
               "description": "Output options component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "block": {
         "anyOf": [
            {
               "description": "Block write component",
               "discriminator": {
                  "mapping": {
                     "BLOCK": "#/$defs/BLOCK",
                     "block": "#/$defs/BLOCK",
                     "blocks": "#/$defs/BLOCKS"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/BLOCK"
                  },
                  {
                     "$ref": "#/$defs/BLOCKS"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Block"
      },
      "table": {
         "anyOf": [
            {
               "$ref": "#/$defs/TABLE",
               "description": "Table write component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "specout": {
         "anyOf": [
            {
               "$ref": "#/$defs/SPECOUT",
               "description": "Spectra write component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "nestout": {
         "anyOf": [
            {
               "$ref": "#/$defs/NESTOUT",
               "description": "Nest write component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "test": {
         "anyOf": [
            {
               "$ref": "#/$defs/TEST",
               "description": "Intermediate write component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "ABS": {
         "additionalProperties": false,
         "description": "Absolute frequency spectra.\n\n.. code-block:: text\n\n    ABS\n\nSpectra are computed as a function of absolute frequency, i.e., the frequency as\nmeasured in a fixed point.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.output import ABS\n    freq = ABS()\n    print(freq.render())",
         "properties": {
            "model_type": {
               "default": "abs",
               "description": "Model type discriminator",
               "enum": [
                  "abs",
                  "ABS"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "ABS",
         "type": "object"
      },
      "BLOCK": {
         "additionalProperties": false,
         "description": "Write spatial distributions.\n\n.. code-block:: text\n\n    BLOCK 'sname' ->HEADER|NOHEADER 'fname' (LAYOUT [idla]) < output > &\n        [unit] (OUTPUT [tbegblk] [deltblk]) SEC|MIN|HR|DAY\n\nWith this optional command the user indicates that one or more spatial\ndistributions should be written to a file.\n\nNote\n----\nThe SWAN special frames 'BOTTGRID' or 'COMPGRID' can be set with the `sname` field.\n\nNote\n----\nThe text of the header indicates run identification (see command `PROJECT`), time,\nframe or group name ('sname'), variable and unit. The number of header lines is 8.\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import BLOCK\n    block = BLOCK(sname=\"outgrid\", fname=\"./depth-frame.nc\", output=[\"depth\"])\n    print(block.render())\n    block = BLOCK(\n        sname=\"COMPGRID\",\n        header=False,\n        fname=\"./output-grid.nc\",\n        idla=3,\n        output=[\"hsign\", \"hswell\", \"dir\", \"tps\", \"tm01\", \"watlev\", \"qp\"],\n        times=dict(\n            tbeg=\"2012-01-01T00:00:00\",\n            delt=\"PT30M\",\n            tfmt=1,\n            dfmt=\"min\",\n            suffix=\"\",\n        )\n    )\n    print(block.render())",
         "properties": {
            "model_type": {
               "default": "block",
               "description": "Model type discriminator",
               "enum": [
                  "block",
                  "BLOCK"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations in which the output is to be written",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the data file where the output is written to The file format is defined by the file extension, use `.mat` for MATLAB binary (single precision) or `.nc` for netCDF format. If any other extension is used the ASCII format is assumed",
               "title": "Fname",
               "type": "string"
            },
            "times": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRangeOpen"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Time specification if the user requires output at various times. If this option is not specified data will be written for the last time step of the computation"
            },
            "header": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicate if the output should be written to a file with header lines (SWAN default: True)",
               "title": "Header"
            },
            "idla": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/IDLA"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Prescribe the lay-out of the output to file (supported options here are 1, 3, 4). Option 4 is recommended for postprocessing an ASCII file by MATLAB, however option 3 is recommended in case of binary MATLAB output (SWAN default: 1)"
            },
            "output": {
               "description": "The output variables to output to block file",
               "items": {
                  "$ref": "#/$defs/BlockOptions"
               },
               "minItems": 1,
               "title": "Output",
               "type": "array"
            },
            "unit": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the scaling of the output. The program divides computed values by `unit` before writing to file, so the user should multiply the written value by `unit` to obtain the proper value. By default, if HEADER is selected, value is written as a 5 position integer. SWAN takes `unit` such that the largest number occurring in the block can be printed. If NOHEADER is selected, values are printed in floating-point format by default (`unit=1`)",
               "title": "Unit"
            }
         },
         "required": [
            "sname",
            "fname",
            "output"
         ],
         "title": "BLOCK",
         "type": "object"
      },
      "BLOCKS": {
         "additionalProperties": false,
         "description": "Write multiple spatial distributions.\n\n.. code-block:: text\n\n    BLOCK 'sname' ->HEADER|NOHEADER 'fname1' (LAYOUT [idla]) < output > &\n        [unit] (OUTPUT [tbegblk] [deltblk]) SEC|MIN|HR|DAY\n    BLOCK 'sname' ->HEADER|NOHEADER 'fname2' (LAYOUT [idla]) < output > &\n        [unit] (OUTPUT [tbegblk] [deltblk]) SEC|MIN|HR|DAY\n    ..\n\nThis component can be used to prescribe and render multiple BLOCK components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import BLOCK, BLOCKS\n    block1 = BLOCK(sname=\"outgrid\", fname=\"./depth.txt\", output=[\"depth\"])\n    block2 = BLOCK(sname=\"outgrid\", fname=\"./output.nc\", output=[\"hsign\", \"hswell\"])\n    blocks = BLOCKS(components=[block1, block2])\n    print(blocks.render())",
         "properties": {
            "model_type": {
               "const": "blocks",
               "default": "blocks",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "components": {
               "description": "BLOCK components",
               "items": {
                  "$ref": "#/$defs/BLOCK"
               },
               "title": "Components",
               "type": "array"
            }
         },
         "required": [
            "components"
         ],
         "title": "BLOCKS",
         "type": "object"
      },
      "BlockOptions": {
         "description": "Valid options for block output parameters.\n\nAttributes\n----------\nHSIGN: \"hsign\"\n    Significant wave height (in m).\nHSWELL: \"hswell\"\n    Swell wave height (in m).\nDIR: \"dir\"\n    Mean wave direction (in degrees).\nDPM: \"dpm\"\n    Mean wave direction at the peak frequency (in degrees).\nPDIR: \"pdir\"\n    Peak wave direction (in degrees).\nTDIR: \"tdir\"\n    Direction of energy transport (in degrees).\nTM01: \"tm01\"\n    Mean absolute wave period (in s).\nRTM01: \"rtm01\"\n    Mean relative wave period (in s).\nRTP: \"rtp\"\n    Peak period of the (relative frequency) variance density spectrum (in s).\nTPS: \"tps\"\n    Smoothed peak period (in s).\nPER: \"per\"\n    Mean absolute wave period (in s).\nRPER: \"rper\"\n    Mean relative wave period (in s).\nTMM10: \"tmm10\"\n    Mean absolute wave period (in s).\nRTMM10: \"rtmm10\"\n    Mean relative wave period (in s).\nTM02: \"tm02\"\n    Mean absolute zero-crossing period (in s).\nFSPR: \"fspr\"\n    The normalised width of the frequency spectrum.\nDSPR: \"dspr\"\n    Directional spreading of the waves (in degrees).\nQP: \"qp\"\n    Peakedness of the wave spectrum (dimensionless).\nDEPTH: \"depth\"\n    Water depth (in m).\nWATLEV: \"watlev\"\n    Water level (in m).\nBOTLEV: \"botlev\"\n    Bottom level (in m).\nVEL: \"vel\"\n    Current velocity (vector; in m/s).\nFRCOEF: \"frcoef\"\n    Friction coefficient (equal to `cfw` or `kn` in command `FRICTION`).\nWIND: \"wind\"\n    Wind velocity (vector; in m/s).\nAICE: \"aice\"\n    Ice concentration (as a fraction from 0 to 1).\nPROPAGAT: \"propagat\"\n    Sum of PROPXY, PROPTHETA and PROPSIGMA (in W/m2 or m2/s).\nPROPXY: \"propxy\"\n    Energy propagation in geographic space; sum of x- and y-direction\n    (in W/m2 or m2/s).\nPROPTHETA: \"proptheta\"\n    Energy propagation in theta space (in W/m2 or m2/s).\nPROPSIGMA: \"propsigma\"\n    Energy propagation in sigma space (in W/m2 or m2/s).\nGENERAT: \"generat\"\n    Total energy generation (in W/m2 or m2/s).\nGENWIND: \"genwind\"\n    Energy generation due to wind (in W/m2 or m2/s).\nREDIST: \"redist\"\n    Total energy redistribution (in W/m2 or m2/s).\nREDQUAD: \"redquad\"\n    Energy redistribution due to quadruplets (in W/m2 or m2/s).\nREDTRIAD: \"redtriad\"\n    Energy redistribution due to triads (in W/m2 or m2/s).\nDISSIP: \"dissip\"\n    Total energy dissipation (in W/m2 or m2/s).\nDISBOT: \"disbot\"\n    Energy dissipation due to bottom friction (in W/m2 or m2/s).\nDISSURF: \"dissurf\"\n    Energy dissipation due to surf breaking (in W/m2 or m2/s).\nDISWCAP: \"diswcap\"\n    Energy dissipation due to whitecapping (in W/m2 or m2/s).\nDISSWELL: \"disswell\"\n    Energy dissipation due to swell dissipation (in W/m2 or m2/s).\nDISVEG: \"disveg\"\n    Energy dissipation due to vegetation (in W/m2 or m2/s).\nDISMUD: \"dismud\"\n    Energy dissipation due to mud (in W/m2 or m2/s).\nDISICE: \"disice\"\n    Energy dissipation due to sea ice (in W/m2 or m2/s).\nRADSTR: \"radstr\"\n    Energy transfer between waves and currents due to radiation stress\n    (in W/m2 or m2/s).\nQB: \"qb\"\n    Fraction of breaking waves due to depth-induced breaking.\nTRANSP: \"transp\"\n    Transport of energy (vector; in W/m2 or m2/s).\nFORCE: \"force\"\n    Wave-induced force per unit surface area (vector; in N/m2).\nUBOT: \"ubot\"\n    The rms-value of the maxima of the orbital velocity near the bottom (in m/s).\nURMS: \"urms\"\n    The rms-value of the orbital velocity near the bottom (in m/s).\nTMBOT: \"tmbot\"\n    The bottom wave period (in s).\nWLENGTH: \"wlength\"\n    Average wave length (in m).\nLWAVP: \"lwavp\"\n    Peak wave length (in m).\nSTEEPNESS: \"steepness\"\n    Average wave steepness (dimensionless).\nBFI: \"bfi\"\n    Benjamin-Feir index (dimensionless).\nNPLANTS: \"nplants\"\n    Number of plants per square meter.\nDHSIGN: \"dhsign\"\n    Difference in significant wave height from the last two iterations (in m).\nDRTM01: \"drtm01\"\n    Difference in average wave period (RTM01) from the last two iterations (in s).\nLEAK: \"leak\"\n    Numerical loss of energy equal to `cthetaE(omega,theta)` across boundaries.\nTIME: \"time\"\n    Full date-time string as part of line used in TABLE only.\nTSEC: \"tsec\"\n    Time in seconds with respect to a reference time (see command QUANTITY).\nXP: \"xp\"\n    The x-coordinate in the problem coordinate system of the output location.\nYP: \"yp\"\n    The y-coordinate in the problem coordinate system of the output location.\nDIST: \"dist\"\n    If output has been requested along a curve then the distance along the curve\n    can be obtained with the command TABLE. DIST is the distance along the curve\n    measured from teh first point on the curve to the output location on the curve\n    in meters (also in the case of spherical coordinates).\nSETUP: \"setup\"\n    Set-up due to waves (in m).\nPTHSIGN: \"pthsign\"\n    Watershed partitions of the significant wave height (in m).\nPTRTP: \"ptrtp\"\n    Watershed partitions of the relative peak period (in s).\nPTWLEN: \"ptwlen\"\n    Watershed partitions of the average wave length (in m).\nPTDIR: \"ptdir\"\n    Watershed partitions of the peak wave direction (in degrees).\nPTDSPR: \"ptdspr\"\n    Watershed partitions of the directional spreading (in degrees).\nPTWFRAC: \"ptwfrac\"\n    Watershed partitions of the wind fraction (dimensionless).\nPTSTEEPNE: \"ptsteepne\"\n    Watershed partition of the wave steepness (dimensionless).\nPARTITION: \"partition\"\n    The raw spectral partition for wave system tracking post-processing.\n\nNote\n----\nEnergy given in W/m2 or m2/s depending on command SET.\n\nNote\n----\nUBOT and URMS required command `FRICTION` to be used. If friction is ignored in the\ncomputation, then one should use the command `FRICTION` with the value of the\nfriction set to zero (e.g., `FRICTION COLLINS 0`).",
         "enum": [
            "hsign",
            "hswell",
            "dir",
            "dpm",
            "pdir",
            "tdir",
            "tm01",
            "rtm01",
            "rtp",
            "tps",
            "per",
            "rper",
            "tmm10",
            "rtmm10",
            "tm02",
            "fspr",
            "dspr",
            "qp",
            "depth",
            "watlev",
            "botlev",
            "vel",
            "frcoef",
            "wind",
            "aice",
            "propagat",
            "propxy",
            "proptheta",
            "propsigma",
            "generat",
            "genwind",
            "redist",
            "redquad",
            "redtriad",
            "dissip",
            "disbot",
            "dissurf",
            "diswcap",
            "disswell",
            "disveg",
            "dismud",
            "disice",
            "radstr",
            "qb",
            "transp",
            "force",
            "ubot",
            "urms",
            "tmbot",
            "wlength",
            "lwavp",
            "steepness",
            "bfi",
            "nplants",
            "dhsign",
            "drtm01",
            "leak",
            "time",
            "tsec",
            "xp",
            "yp",
            "dist",
            "setup",
            "pthsign",
            "ptrtp",
            "ptwlen",
            "ptdir",
            "ptdspr",
            "ptwfrac",
            "ptsteepne",
            "partition"
         ],
         "title": "BlockOptions",
         "type": "string"
      },
      "CURVE": {
         "additionalProperties": false,
         "description": "Output locations along a curve.\n\n.. code-block:: text\n\n    CURVE 'sname' [xp1] [yp1] < [int] [xp] [yp] >\n\nWith this optional command the user defines output along a curved line. Actually\nthis curve is a broken line, defined by the user with its corner points. The values\nof the output quantities along the curve are interpolated from the computational\ngrid. This command may be used more than once to define more curves.\n\nNote\n----\nThe following pre-defined curves are available and could be used instead of a CURVE\ncomponent: 'BOUNDARY' and `BOUND_0N` where `N` is boundary part number.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nNote\n----\nRepeat the group `< int xp yp` > in proper order if there are more corner points\non the curve.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import CURVE\n    loc = CURVE(\n        sname=\"outcurve\",\n        xp1=172,\n        yp1=-40,\n        npts=[3, 3],\n        xp=[172.0, 174.0],\n        yp=[-38.0, -38.0],\n    )\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "curve",
               "description": "Model type discriminator",
               "enum": [
                  "curve",
                  "CURVE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "xp1": {
               "description": "Problem coordinate of the first point of the curve in the x-direction",
               "title": "Xp1",
               "type": "number"
            },
            "yp1": {
               "description": "Problem coordinate of the first point of the curve in the y-direction",
               "title": "Yp1",
               "type": "number"
            },
            "npts": {
               "description": "The `int` CURVE parameter, SWAN will generate `npts-1` equidistant locations between two subsequent corner points of the curve including the two corner points",
               "items": {
                  "type": "integer"
               },
               "minItems": 1,
               "title": "Npts",
               "type": "array"
            },
            "xp": {
               "description": "problem coordinates of a corner point of the curve in the x-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "problem coordinates of a corner point of the curve in the y-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Yp",
               "type": "array"
            }
         },
         "required": [
            "sname",
            "xp1",
            "yp1",
            "npts",
            "xp",
            "yp"
         ],
         "title": "CURVE",
         "type": "object"
      },
      "CURVES": {
         "additionalProperties": false,
         "description": "Output locations along multiple curves.\n\n.. code-block:: text\n\n    CURVE 'sname1' [xp1] [yp1] < [int] [xp] [yp] >\n    CURVE 'sname2' [xp1] [yp1] < [int] [xp] [yp] >\n    ..\n\nThis component can be used to prescribe and render multiple CURVE components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import CURVE, CURVES\n    loc1 = CURVE(\n        sname=\"c1\", xp1=7, yp1=-40, npts=[3, 3], xp=[7, 9], yp=[-38, -38],\n    )\n    loc2 = CURVE(\n        sname=\"c2\", xp1=3, yp1=-37, npts=[5, 5], xp=[4, 5], yp=[-37, -36],\n    )\n    locs = CURVES(curves=[loc1, loc2])\n    print(locs.render())",
         "properties": {
            "model_type": {
               "default": "curves",
               "description": "Model type discriminator",
               "enum": [
                  "curves",
                  "CURVES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "curves": {
               "description": "CURVE components",
               "items": {
                  "$ref": "#/$defs/CURVE"
               },
               "title": "Curves",
               "type": "array"
            }
         },
         "required": [
            "curves"
         ],
         "title": "CURVES",
         "type": "object"
      },
      "FRAME": {
         "additionalProperties": false,
         "description": "Output locations on a regular grid.\n\n.. code-block:: text\n\n    FRAME 'sname' [xpfr] [ypfr] [alpfr] [xlenfr] [ylenfr] [mxfr] [myfr]\n\nWith this optional command the user defines output on a rectangular, uniform grid\nin a regular frame.\n\nIf the set of output locations is identical to a part of the computational grid,\nthen the user can use the alternative command GROUP.\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import FRAME\n    loc = FRAME(\n        sname=\"outgrid\",\n        grid=dict(xp=173, yp=-40, xlen=2, ylen=2, mx=19, my=19),\n    )\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "frame",
               "description": "Model type discriminator",
               "enum": [
                  "frame",
                  "FRAME"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "grid": {
               "$ref": "#/$defs/GRIDREGULAR",
               "description": "Frame grid definition"
            }
         },
         "required": [
            "sname",
            "grid"
         ],
         "title": "FRAME",
         "type": "object"
      },
      "GRIDREGULAR": {
         "additionalProperties": false,
         "description": "SWAN Regular Grid subcomponent.\n\n.. code-block:: text\n\n    xp yp alp xlen ylen mx my\n\nNote\n----\nThe direction of the x-axis `alp` must be 0 in case of spherical coordinates\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import GRIDREGULAR\n    kwargs = dict(xp=173, yp=-40, alp=0, xlen=2, ylen=2, mx=199, my=199)\n    grid = GRIDREGULAR(suffix=\"c\", **kwargs)\n    print(grid.render())\n    grid = GRIDREGULAR(suffix=\"inp\", **kwargs)\n    print(grid.render())",
         "properties": {
            "model_type": {
               "default": "gridregular",
               "description": "Model type discriminator",
               "enum": [
                  "gridregular",
                  "GRIDREGULAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "xp": {
               "description": "The x-coordinate of the origin in problem coordinates",
               "title": "Xp",
               "type": "number"
            },
            "yp": {
               "description": "The y-coordinate of the origin in problem coordinates",
               "title": "Yp",
               "type": "number"
            },
            "alp": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 0.0,
               "description": "Direction of the xaxis in degrees",
               "title": "Alp"
            },
            "xlen": {
               "description": "Length of the computational grid in the x-direction",
               "title": "Xlen",
               "type": "number"
            },
            "ylen": {
               "description": "Length of the computational grid in the y-direction",
               "title": "Ylen",
               "type": "number"
            },
            "mx": {
               "description": "Number of meshes in computational grid in x-direction (this number is one less than the number of grid points in this domain)",
               "title": "Mx",
               "type": "integer"
            },
            "my": {
               "description": "Number of meshes in computational grid in y-direction (this number is one less than the number of grid points in this domain)",
               "title": "My",
               "type": "integer"
            },
            "suffix": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "",
               "description": "Suffix for rendering with each output grid parameter.",
               "title": "Suffix"
            }
         },
         "required": [
            "xp",
            "yp",
            "xlen",
            "ylen",
            "mx",
            "my"
         ],
         "title": "GRIDREGULAR",
         "type": "object"
      },
      "GROUP": {
         "additionalProperties": false,
         "description": "Output locations on subset of a grid.\n\n.. code-block:: text\n\n    GROUP 'sname' SUBGRID [ix1] [ix2] [iy1] [iy2]\n\nWith this optional command the user defines a group of output locations on a\nrectangular or curvilinear grid that is identical with (part of) the computational\ngrid (rectilinear or curvilinear). Such a group may be convenient for the user to\nobtain output that is not affected by interpolation errors.\n\nThe subgrid contains those points (`ix`,`iy`) of the computational grid for which:\n`ix1` <= `ix` <= `ix2` and `iy1` <= `iy` <= `iy2` (The origin of the computational\ngrid is `ix=0`, `iy=0`)\n\nLimitations: `ix1>=0`, `ix2<=mxc`, `iy1>=0`, `iy2<=myc` (`mxc` and `myc` as\ndefined in the command `CGRID` which should always precede this command `GROUP`)\n\nNote\n----\nCannot be used in 1D-mode or in case of unstructured grids.\n\nNote\n----\nRegular and curvilinear grids are supported.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import GROUP\n    loc = GROUP(sname=\"subgrid\", ix1=20, iy1=0, ix2=50, iy2=100)\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "group",
               "description": "Model type discriminator",
               "enum": [
                  "group",
                  "GROUP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "ix1": {
               "description": "Lowest index of the computational grid in the ix-direction",
               "minimum": 0,
               "title": "Ix1",
               "type": "integer"
            },
            "iy1": {
               "description": "Lowest index of the computational grid in the iy-direction",
               "minimum": 0,
               "title": "Iy1",
               "type": "integer"
            },
            "ix2": {
               "description": "Highest index of the computational grid in the ix-direction",
               "title": "Ix2",
               "type": "integer"
            },
            "iy2": {
               "description": "Highest index of the computational grid in the ix-direction",
               "title": "Iy2",
               "type": "integer"
            }
         },
         "required": [
            "sname",
            "ix1",
            "iy1",
            "ix2",
            "iy2"
         ],
         "title": "GROUP",
         "type": "object"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      },
      "IJ": {
         "additionalProperties": false,
         "description": "Points in grid indices coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import IJ\n    points = IJ(i=[0, 0, 5], j=[0, 19, 19])\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "ij",
               "description": "Model type discriminator",
               "enum": [
                  "ij",
                  "IJ"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "i": {
               "description": "i-index values",
               "items": {
                  "type": "integer"
               },
               "title": "I",
               "type": "array"
            },
            "j": {
               "description": "j-index values",
               "items": {
                  "type": "integer"
               },
               "title": "J",
               "type": "array"
            }
         },
         "required": [
            "i",
            "j"
         ],
         "title": "IJ",
         "type": "object"
      },
      "ISOLINE": {
         "additionalProperties": false,
         "description": "Output locations along a depth contour.\n\n.. code-block:: text\n\n    ISOLINE 'sname' 'rname' DEPTH|BOTTOM [dep]\n\nWith this optional command the user defines a set of output locations along one\ndepth or bottom level contour line (in combination with command RAY).\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import ISOLINE\n    loc = ISOLINE(sname=\"outcurve\", rname=\"outray\", dep_type=\"depth\", dep=12.0)\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "isoline",
               "description": "Model type discriminator",
               "enum": [
                  "isoline",
                  "ISOLINE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "rname": {
               "description": "Name of the set of rays defined by this command",
               "maxLength": 8,
               "title": "Rname",
               "type": "string"
            },
            "dep": {
               "description": "The depth (in m) of the depth contour line along which output locations are generated by SWAN.",
               "title": "Dep",
               "type": "number"
            },
            "dep_type": {
               "anyOf": [
                  {
                     "enum": [
                        "depth",
                        "bottom"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Define if the depth contour is extracted from the DEPTH output (the stationary water depth) or from the BOTTOM output (the depth relative to the datum level with the water level ignored) (SWAN default: DEPTH)",
               "title": "Dep Type"
            }
         },
         "required": [
            "sname",
            "rname",
            "dep"
         ],
         "title": "ISOLINE",
         "type": "object"
      },
      "NESTOUT": {
         "additionalProperties": false,
         "description": "Write to 2D boundary spectra.\n\n.. code-block:: text\n\n    NESTOUT 'sname' 'fname' (OUTPUT [tbegnst] [deltnst] ->SEC|MIN|HR|DAY)\n\nWrite to data file two-dimensional action density spectra (relative frequency)\nalong the boundary of a nested grid (see command NGRID) to be used in a subsequent\nSWAN run.\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import NESTOUT\n    out = NESTOUT(\n        sname=\"outnest\",\n        fname=\"./nestout.swn\",\n        times=dict(tbeg=\"2012-01-01T00:00:00\", delt=\"PT30M\", dfmt=\"min\"),\n    )\n    print(out.render())",
         "properties": {
            "model_type": {
               "default": "nestout",
               "description": "Model type discriminator",
               "enum": [
                  "nestout",
                  "NESTOUT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations in which the output is to be written",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the data file where the output is written to The file format is defined by the file extension, use `.mat` for MATLAB binary (single precision) or `.nc` for netCDF format. If any other extension is used the ASCII format is assumed",
               "title": "Fname",
               "type": "string"
            },
            "times": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRangeOpen"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Time specification if the user requires output at various times. If this option is not specified data will be written for the last time step of the computation"
            }
         },
         "required": [
            "sname",
            "fname"
         ],
         "title": "NESTOUT",
         "type": "object"
      },
      "NGRID": {
         "additionalProperties": false,
         "description": "Output locations for a nested grid.\n\n.. code-block:: text\n\n    NGRID 'sname' [xpn] [ypn] [alpn] [xlenn] [ylenn] [mxn] [myn]\n\nIf the user wishes to carry out nested SWAN runs, a separate coarse-grid SWAN run\nis required. With this optional command `NGRID`, the user defines in the present\ncoarse-grid run, a set of output locations along the boundary of the subsequent\nnested computational grid. The set of output locations thus defined is of the type\nNGRID.\n\nNote\n----\nCommand `NESTOUT` is required after this command `NGRID` to generate some data for\nthe (subsequent) nested run.\n\nNote\n----\nCannot be used in 1D-mode.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import NGRID\n    loc = NGRID(\n        sname=\"outnest\",\n        grid=dict(xp=173, yp=-40, xlen=2, ylen=2, mx=19, my=19),\n    )\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "ngrid",
               "description": "Model type discriminator",
               "enum": [
                  "ngrid",
                  "NGRID"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "grid": {
               "$ref": "#/$defs/GRIDREGULAR",
               "description": "NGRID grid definition"
            }
         },
         "required": [
            "sname",
            "grid"
         ],
         "title": "NGRID",
         "type": "object"
      },
      "NGRID_UNSTRUCTURED": {
         "additionalProperties": false,
         "description": "Output locations for a nested grid.\n\n.. code-block:: text\n\n    NGRID 'sname' UNSTRUCTURED ->TRIANGLE|EASYMESH 'fname'\n\nIf the user wishes to carry out nested SWAN runs, a separate coarse-grid SWAN run\nis required. With this optional command `NGRID`, the user defines in the present\ncoarse-grid run, a set of output locations along the boundary of the subsequent\nnested computational grid. The set of output locations thus defined is of the type\nNGRID.\n\nWith this option the user indicates that the subsequent nested grid is unstructured\nOnly grids generated by Triangle and Easymesh are supported by SWAN.\n\nNote\n----\nCommand `NESTOUT` is required after this command `NGRID` to generate some data for\nthe (subsequent) nested run.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import NGRID_UNSTRUCTURED\n    loc = NGRID_UNSTRUCTURED(sname=\"outnest\", kind=\"triangle\", fname=\"ngrid.txt\")\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "ngrid_unstructured",
               "description": "Model type discriminator",
               "enum": [
                  "ngrid_unstructured",
                  "NGRID_UNSTRUCTURED"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "kind": {
               "anyOf": [
                  {
                     "enum": [
                        "triangle",
                        "easymesh"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "triangle",
               "description": "Indicate if nested grid is generated by Triangle or Easymesh. The base name of the grid specified in the `fname` parameter is used internally by SWAN to define the `.node` and `.ele` files in case of the former or the `.n` and `.e` files in case of the latter.",
               "title": "Kind"
            },
            "fname": {
               "description": "Basename of the required files, i.e. without extension",
               "maxLength": 32,
               "title": "Fname",
               "type": "string"
            }
         },
         "required": [
            "sname",
            "fname"
         ],
         "title": "NGRID_UNSTRUCTURED",
         "type": "object"
      },
      "OUTPUT_OPTIONS": {
         "additionalProperties": false,
         "description": "Set format of output.\n\n.. code-block:: text\n\n    OUTPUT OPTIons 'comment' (TABLE [field]) (BLOCK [ndec] [len]) (SPEC [ndec])\n\nThis command enables the user to influence the format of block, table and spectral\noutput.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import OUTPUT_OPTIONS\n    opts = OUTPUT_OPTIONS(\n        comment=\"!\", field=10, ndec_block=4, len=20, ndec_spec=6,\n    )\n    print(opts.render())",
         "properties": {
            "model_type": {
               "default": "block",
               "description": "Model type discriminator",
               "enum": [
                  "block",
                  "BLOCK"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "comment": {
               "anyOf": [
                  {
                     "maxLength": 1,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Comment character used in comment lines in the output (SWAN default: %)",
               "title": "Comment"
            },
            "field": {
               "anyOf": [
                  {
                     "maximum": 16,
                     "minimum": 8,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Length of one data field in a table (SWAN default: 12)",
               "title": "Field"
            },
            "ndec_block": {
               "anyOf": [
                  {
                     "maximum": 9,
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of decimals in block output (SWAN default: 4)",
               "title": "Ndec Block"
            },
            "len": {
               "anyOf": [
                  {
                     "maximum": 9999,
                     "minimum": 1,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of data on one line of block output (SWAN default: 6)",
               "title": "Len"
            },
            "ndec_spec": {
               "anyOf": [
                  {
                     "maximum": 9,
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of decimals in spectra output (SWAN default: 4)",
               "title": "Ndec Spec"
            }
         },
         "title": "OUTPUT_OPTIONS",
         "type": "object"
      },
      "POINTS": {
         "additionalProperties": false,
         "description": "Isolated output locations.\n\n.. code-block:: text\n\n    POINTS 'sname' < [xp] [yp] >\n\nWith this optional command the user defines a set of individual output point\nlocations.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import POINTS\n    loc = POINTS(sname=\"outpts\", xp=[172.3, 172.4], yp=[-39, -39])\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "points",
               "description": "Model type discriminator",
               "enum": [
                  "points",
                  "POINTS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "xp": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "minItems": 1,
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "problem coordinates of the points in the x-direction",
               "title": "Xp"
            },
            "yp": {
               "anyOf": [
                  {
                     "items": {
                        "type": "number"
                     },
                     "minItems": 1,
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "description": "problem coordinates of the points in the y-direction",
               "title": "Yp"
            }
         },
         "required": [
            "sname",
            "xp",
            "yp"
         ],
         "title": "POINTS",
         "type": "object"
      },
      "POINTS_FILE": {
         "additionalProperties": false,
         "description": "Isolated output locations.\n\n.. code-block:: text\n\n    POINTS 'sname' FILE 'fname'\n\nWith this optional command the user defines a set of individual output point\nlocations from text file. The file should have one point per row with x-coordinates\nand y-coordinates in the first and second columns respectively.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import POINTS_FILE\n    loc = POINTS_FILE(sname=\"outpts\", fname=\"./output_locations.txt\")\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "points_file",
               "description": "Model type discriminator",
               "enum": [
                  "points_file",
                  "POINTS_FILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the output locations",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            }
         },
         "required": [
            "sname",
            "fname"
         ],
         "title": "POINTS_FILE",
         "type": "object"
      },
      "QUANTITIES": {
         "additionalProperties": false,
         "description": "Define output settings for multiple output.\n\n.. code-block:: text\n\n    QUANTITY < output > ...\n    QUANTITY < output > ...\n    ..\n\nThis component can be used to prescribe and render multiple QUANTITY components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import QUANTITY, QUANTITIES\n    q1 = QUANTITY(output=[\"xp\"], hexp=100)\n    q2 = QUANTITY(output=[\"hsign\", \"tm01\", \"rtmm10\"], excv=-9)\n    q3 = QUANTITY(output=[\"hsign\", \"tm02\", \"fspr\"], fmin=0.03, fmax=0.5)\n    q4 = QUANTITY(output=[\"hsign\"], fswell=0.08)\n    q5 = QUANTITY(output=[\"per\"], short=\"Tm-1,0\", power=0)\n    q6 = QUANTITY(output=[\"transp\", \"force\"], coord=\"frame\")\n    quantities = QUANTITIES(quantities=[q1, q2, q3, q4, q5, q6])\n    print(quantities.render())",
         "properties": {
            "model_type": {
               "default": "quantities",
               "description": "Model type discriminator",
               "enum": [
                  "quantities",
                  "QUANTITIES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "quantities": {
               "description": "QUANTITY components",
               "items": {
                  "$ref": "#/$defs/QUANTITY"
               },
               "title": "Quantities",
               "type": "array"
            }
         },
         "required": [
            "quantities"
         ],
         "title": "QUANTITIES",
         "type": "object"
      },
      "QUANTITY": {
         "additionalProperties": false,
         "description": "Define output settings.\n\n.. code-block:: text\n\n    QUANTITY < output > 'short' 'long' [lexp] [hexp] [excv] [power] [ref] &\n        [fswell] [fmin] [fmax] ->PROBLEMCOORD|FRAME\n\n    Examples:\n    ---------\n    QUANTITY Xp hexp=100.\n    QUANTITY HS TM01 RTMM10 excv=-9.\n    QUANTITY HS TM02 FSPR fmin=0.03 fmax=0.5\n    QUANTITY Hswell fswell=0.08\n    QUANTITY Per short='Tm-1,0' power=0.\n    QUANTITY Transp Force Frame\n\nWith this command the user can influence:\n\n* The naming of output quantities\n* The accuracy of writing output quantities\n* The definition of some output quantities\n* Reference direction for vectors\n\nNote\n----\nThe following data are accepted only in combination with some specific quantities:\n\n* power\n* ref\n* fswell\n* fmin\n* fmax\n* PROBLEMCOORD\n* FRAME\n\nNote\n----\n**PROBLEMCOORD**: Vector components are relative to the x- and y-axes of the\nproblem coordinate system (see command `SET`):\n\n* Directions are counterclockwise relative to the positive x-axis of the problem\n  coordinate system if Cartesian direction convention is used.\n* Directions are relative to North (clockwise) if Nautical direction convention is\n  used.\n\nNote\n----\n**FRAME**: If output is requested on sets created by command FRAME or\nautomatically (see command `SET`) (`COMPGRID` or `BOTTGRID`):\n\n* Vector components are relative to the x- and y-axes of the frame coordinate\n  system.\n* Directions are counterclockwise relative to the positive x-axis of the frame\n  coordinate system if Cartesian direction convention is used.\n* Directions are relative to North (clockwise) if Nautical direction convention\n  is used.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import QUANTITY\n    quant = QUANTITY(output=[\"xp\"], hexp=100)\n    print(quant.render())\n    quant = QUANTITY(output=[\"hsign\", \"tm01\", \"rtmm10\"], excv=-9)\n    print(quant.render())\n    quant = QUANTITY(output=[\"hsign\", \"tm02\", \"fspr\"], fmin=0.03, fmax=0.5)\n    print(quant.render())\n    quant = QUANTITY(output=[\"hsign\"], fswell=0.08)\n    print(quant.render())\n    quant = QUANTITY(output=[\"per\"], short=\"Tm-1,0\", power=0)\n    print(quant.render())\n    quant = QUANTITY(output=[\"transp\", \"force\"], coord=\"frame\")\n    print(quant.render())",
         "properties": {
            "model_type": {
               "default": "quantity",
               "description": "Model type discriminator",
               "enum": [
                  "quantity",
                  "QUANTITY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "output": {
               "description": "The output variables to define settings for",
               "items": {
                  "$ref": "#/$defs/BlockOptions"
               },
               "minItems": 1,
               "title": "Output",
               "type": "array"
            },
            "short": {
               "anyOf": [
                  {
                     "maxLength": 16,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Short name of the output quantity (e.g. the name in the heading of a table written by SWAN). If this option is not used, SWAN will use a realistic name",
               "title": "Short"
            },
            "long": {
               "anyOf": [
                  {
                     "maxLength": 16,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Long name of the output quantity (e.g. the name in the heading of a block output written by SWAN). If this option is not used, SWAN will use a realistic name",
               "title": "Long"
            },
            "lexp": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lowest expected value of the output quantity",
               "title": "Lexp"
            },
            "hexp": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Highest expected value of the output quantity; the highest expected value is used by SWAN to determine the number of decimals in a table with heading. So the `QUANTITY` command can be used in case the default number of decimals in a table is unsatisfactory",
               "title": "Hexp"
            },
            "excv": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "In case there is no valid value (e.g. wave height in a dry point) this exception value is written in a table or block output",
               "title": "Excv"
            },
            "power": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "power `p` appearing in the definition of `PER`, `RPER` and `WLEN`. Note that the value for `power` given for `PER` affects also the value of `RPER`; the power for `WLEN` is independent of that of `PER` or `RPER` (SWAN default: 1)",
               "title": "Power"
            },
            "ref": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Reference time used for the quantity `TSEC`. Default value: starting time of the first computation, except in cases where this is later than the time of the earliest input. In these cases, the time of the earliest input is used",
               "title": "Ref"
            },
            "fswell": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Upper limit of frequency range used for computing the quantity HSWELL (SWAN default: 0.1 Hz)",
               "title": "Fswell"
            },
            "noswll": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of swells to output for watershed quantities ",
               "title": "Noswll"
            },
            "fmin": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lower limit of frequency range used for computing integral parameters (SWAN Default: 0.0 Hz)",
               "title": "Fmin"
            },
            "fmax": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Upper limit of frequency range used for computing integral parameters (SWAN default: 1000.0 Hz, acts as infinity)",
               "title": "Fmax"
            },
            "coord": {
               "anyOf": [
                  {
                     "enum": [
                        "problemcoord",
                        "frame"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Define if vectors and directions refer to the problem coordinate system ('problemcoord') or sets created by command FRAME ('frame') (SWAN default: problemcoord)",
               "title": "Coord"
            }
         },
         "required": [
            "output"
         ],
         "title": "QUANTITY",
         "type": "object"
      },
      "RAY": {
         "additionalProperties": false,
         "description": "Output locations along a depth contour.\n\n.. code-block:: text\n\n    RAY 'rname' [xp1] [yp1] [xq1] [yq1] < [int] [xp] [yp] [xq] [yq] >\n\nWith this optional command the user provides SWAN with information to determine\noutput locations along the depth contour line(s) defined subsequently in command\n`ISOLINE` (see below).\n\nThese locations are determined by SWAN as the intersections of the depth contour\nline(s) and the set of straight rays defined in this command RAY. These rays are\ncharacterized by a set of master rays defined by their start and end positions\n(`xp`,`yp`) and (`xq`,`yq`). Between each pair of sequential master rays thus\ndefined SWAN generates `int-1` intermediate rays by linear interpolation of the\nstart and end positions.\n\nRays defined by this component have nothing in common with wave rays (e.g. as\nobtained from conventional refraction computations).\n\nNote\n----\nCannot be used in 1D-mode.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command `COORD`).\n\nNote\n----\nWhen using rays the input grid for bottom and water level should not be curvilinear.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import RAY\n    loc = RAY(\n        rname=\"outray\",\n        xp1=171.9,\n        yp1=-40.1,\n        xq1=172.1,\n        yq1=-39.9,\n        npts=[3, 3],\n        xp=[171.9, 173.9],\n        yp=[-38.1, -38.1],\n        xq=[172.1, 174.1],\n        yq=[-37.9, -37.9],\n    )\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "ray",
               "description": "Model type discriminator",
               "enum": [
                  "ray",
                  "RAY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "rname": {
               "description": "Name of the set of rays defined by this command",
               "maxLength": 32,
               "title": "Rname",
               "type": "string"
            },
            "xp1": {
               "description": "Problem coordinate of the begin point of the first master ray in the x-direction",
               "title": "Xp1",
               "type": "number"
            },
            "yp1": {
               "description": "Problem coordinate of the begin point of the first master ray in the y-direction",
               "title": "Yp1",
               "type": "number"
            },
            "xq1": {
               "description": "Problem coordinate of the end point of the first master ray in the x-direction",
               "title": "Xq1",
               "type": "number"
            },
            "yq1": {
               "description": "Problem coordinate of the end point of the first master ray in the y-direction",
               "title": "Yq1",
               "type": "number"
            },
            "npts": {
               "description": "The `int` RAY parameter, number of subdivisions between the previous master ray and the following master ray defined by the following data (number of subdivisions is one morethan the number of interpolated rays)",
               "items": {
                  "type": "integer"
               },
               "minItems": 1,
               "title": "Npts",
               "type": "array"
            },
            "xp": {
               "description": "problem coordinates of the begin of each subsequent master ray in the x-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "problem coordinates of the begin of each subsequent master ray in the y-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Yp",
               "type": "array"
            },
            "xq": {
               "description": "problem coordinates of the end of each subsequent master ray in the x-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Xq",
               "type": "array"
            },
            "yq": {
               "description": "problem coordinates of the end of each subsequent master ray in the y-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Yq",
               "type": "array"
            }
         },
         "required": [
            "rname",
            "xp1",
            "yp1",
            "xq1",
            "yq1",
            "npts",
            "xp",
            "yp",
            "xq",
            "yq"
         ],
         "title": "RAY",
         "type": "object"
      },
      "REL": {
         "additionalProperties": false,
         "description": "Relative frequency spectra.\n\n.. code-block:: text\n\n    REL\n\nSpectra are computed as a function of relative frequency, i.e., the frequency as\nmeasured when moving with current.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.output import REL\n    freq = REL()\n    print(freq.render())",
         "properties": {
            "model_type": {
               "default": "rel",
               "description": "Model type discriminator",
               "enum": [
                  "rel",
                  "REL"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "REL",
         "type": "object"
      },
      "SPEC1D": {
         "additionalProperties": false,
         "description": "Frequency 1D spectra.\n\n.. code-block:: text\n\n    SPEC1D\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.output import SPEC1D\n    spec = SPEC1D()\n    print(spec.render())",
         "properties": {
            "model_type": {
               "default": "spec1d",
               "description": "Model type discriminator",
               "enum": [
                  "spec1d",
                  "SPEC1D"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "SPEC1D",
         "type": "object"
      },
      "SPEC2D": {
         "additionalProperties": false,
         "description": "Frequency-direction 2D spectra.\n\n.. code-block:: text\n\n    SPEC2D\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.output import SPEC2D\n    spec = SPEC2D()\n    print(spec.render())",
         "properties": {
            "model_type": {
               "default": "spec2d",
               "description": "Model type discriminator",
               "enum": [
                  "spec2d",
                  "SPEC2D"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "SPEC2D",
         "type": "object"
      },
      "SPECOUT": {
         "additionalProperties": false,
         "description": "Write to data file the wave spectra.\n\n.. code-block:: text\n\n    SPECOUT 'sname' SPEC1D|->SPEC2D ->ABS|REL 'fname' &\n        (OUTPUT [tbeg] [delt] SEC|MIN|HR|DAY)\n\nWith this optional command the user indicates that for each location of the output\nlocation set 'sname' (see commands `POINTS`, `CURVE`, `FRAME` or `GROUP`) the 1D\nor 2D variance / energy (see command `SET`) density spectrum (either the relative\nfrequency or the absolute frequency spectrum) is to be written to a data file.\n\nNote\n----\nThis write command supports the following location types: `POINTS`, `CURVE`,\n`FRAME` and `GROUP`.\n\nNote\n----\nThis output file can be used for defining boundary conditions for subsequent SWAN\nruns (command `BOUNDSPEC`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import SPECOUT\n    out = SPECOUT(sname=\"outpts\", fname=\"./specout.swn\")\n    print(out.render())\n    out = SPECOUT(\n        sname=\"outpts\",\n        dim=dict(model_type=\"spec2d\"),\n        freq=dict(model_type=\"rel\"),\n        fname=\"./specout.nc\",\n        times=dict(tbeg=\"2012-01-01T00:00:00\", delt=\"PT30M\", dfmt=\"min\"),\n    )\n    print(out.render())",
         "properties": {
            "model_type": {
               "default": "specout",
               "description": "Model type discriminator",
               "enum": [
                  "specout",
                  "SPECOUT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations in which the output is to be written",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the data file where the output is written to The file format is defined by the file extension, use `.mat` for MATLAB binary (single precision) or `.nc` for netCDF format. If any other extension is used the ASCII format is assumed",
               "title": "Fname",
               "type": "string"
            },
            "times": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRangeOpen"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Time specification if the user requires output at various times. If this option is not specified data will be written for the last time step of the computation"
            },
            "dim": {
               "anyOf": [
                  {
                     "description": "Choose between 1D or 2D spectra output",
                     "discriminator": {
                        "mapping": {
                           "SPEC1D": "#/$defs/SPEC1D",
                           "SPEC2D": "#/$defs/SPEC2D",
                           "spec1d": "#/$defs/SPEC1D",
                           "spec2d": "#/$defs/SPEC2D"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/SPEC1D"
                        },
                        {
                           "$ref": "#/$defs/SPEC2D"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Dim"
            },
            "freq": {
               "anyOf": [
                  {
                     "description": "Choose between absolute or relative frequency spectra",
                     "discriminator": {
                        "mapping": {
                           "ABS": "#/$defs/ABS",
                           "REL": "#/$defs/REL",
                           "abs": "#/$defs/ABS",
                           "rel": "#/$defs/REL"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/ABS"
                        },
                        {
                           "$ref": "#/$defs/REL"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Freq"
            }
         },
         "required": [
            "sname",
            "fname"
         ],
         "title": "SPECOUT",
         "type": "object"
      },
      "TABLE": {
         "additionalProperties": false,
         "description": "Write spatial distributions.\n\n.. code-block:: text\n\n    TABLE 'sname' ->HEADER|NOHEADER|INDEXED 'fname'  < output > &\n        (OUTPUT [tbegblk] [deltblk]) SEC|MIN|HR|DAY\n\nWith this optional command the user indicates that for each location of the output\nlocation set 'sname' (see commands `POINTS`, `CURVE`, `FRAME` or `GROUP`) one or\nmore variables should be written to a file. The keywords `HEADER` and `NOHEADER`\ndetermine the appearance of the table; the filename determines the destination of\nthe data.\n\nNote\n----\n**HEADER**:\noutput is written in fixed format to file with headers giving name of variable\nand unit per column (numbers too large to be written will be shown as `****`.\nThe number of header lines is 4.\n\n**NOHEADER**:\noutput is written in floating point format to file and has no headers.\n\n**INDEXED**:\noutput compatible with GIS tools such as ARCVIEW, ARCINFO, etc. The user should\ngive two TABLE commands, one to produce one file with `XP` and `YP` as output\nquantities, the other with `HS`, `RTM01` or other output quantities.\n\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import TABLE\n    table = TABLE(\n        sname=\"outpts\",\n        format=\"noheader\",\n        fname=\"./output_table.nc\",\n        output=[\"hsign\", \"hswell\", \"dir\", \"tps\", \"tm01\", \"watlev\", \"qp\"],\n        times=dict(tbeg=\"2012-01-01T00:00:00\", delt=\"PT30M\", dfmt=\"min\"),\n    )\n    print(table.render())",
         "properties": {
            "model_type": {
               "default": "table",
               "description": "Model type discriminator",
               "enum": [
                  "table",
                  "TABLE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations in which the output is to be written",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "fname": {
               "description": "Name of the data file where the output is written to The file format is defined by the file extension, use `.mat` for MATLAB binary (single precision) or `.nc` for netCDF format. If any other extension is used the ASCII format is assumed",
               "title": "Fname",
               "type": "string"
            },
            "times": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/TimeRangeOpen"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Time specification if the user requires output at various times. If this option is not specified data will be written for the last time step of the computation"
            },
            "format": {
               "anyOf": [
                  {
                     "enum": [
                        "header",
                        "noheader",
                        "indexed"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicate if the table should be written to a file as a HEADER, NOHEADER or INDEXED table format (SWAN default: HEADER)",
               "title": "Format"
            },
            "output": {
               "description": "The output variables to output to block file",
               "items": {
                  "$ref": "#/$defs/BlockOptions"
               },
               "minItems": 1,
               "title": "Output",
               "type": "array"
            }
         },
         "required": [
            "sname",
            "fname",
            "output"
         ],
         "title": "TABLE",
         "type": "object"
      },
      "TEST": {
         "additionalProperties": false,
         "description": "Write intermediate results.\n\n.. code-block:: text\n\n    TEST [itest] [itrace] POINTS XY|IJ (PAR 'fname') (S1D 'fname') (S2D 'fname')\n\nNote\n----\nThe 6 source terms written due to the presence of the keyword S1D or S2D are: wind\ninput, whitecapping, bottom friction, breaking, 3- and 4- wave interactions.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import TEST\n    test = TEST(\n        itest=10,\n        points=dict(model_type=\"ij\", i=[0, 0], j=[10, 20]),\n        fname_par=\"integral_parameters.test\",\n        fname_s1d=\"1d_variance_density.test\",\n        fname_s2d=\"2d_variance_density.test\",\n    )\n    print(test.render())\n    import numpy as np\n    test = TEST(\n        points=dict(\n            model_type=\"xy\",\n            x=np.linspace(172.5, 174.0, 25),\n            y=25*[-38],\n        ),\n        fname_s2d=\"2d_variance_density.test\",\n    )\n    print(test.render())\n\nTODO: Support `k` in POINTS IJ.",
         "properties": {
            "model_type": {
               "default": "test",
               "description": "Model type discriminator",
               "enum": [
                  "test",
                  "TEST"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "itest": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The level of test output, for values under 100 the amount is usually reasonable, for values above 200 it can be very large. Values of up to 50 can be interpreted by the user (SWAN default: 1)",
               "title": "Itest"
            },
            "itrace": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "SWAN writes a message (name of subroutine) to the PRINT file at the first `itrace` entries of each subroutine (SWAN default: 0)",
               "title": "Itrace"
            },
            "points": {
               "description": "Points where detailed print output is produced (max of 50 points)",
               "discriminator": {
                  "mapping": {
                     "IJ": "#/$defs/IJ",
                     "XY": "#/$defs/XY",
                     "ij": "#/$defs/IJ",
                     "xy": "#/$defs/XY"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/XY"
                  },
                  {
                     "$ref": "#/$defs/IJ"
                  }
               ],
               "title": "Points"
            },
            "fname_par": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the file where the integral parameters are written to",
               "title": "Fname Par"
            },
            "fname_s1d": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the file where the 1D variance density and 6 source terms are written to",
               "title": "Fname S1D"
            },
            "fname_s2d": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of the file where the 2D variance density and 6 source terms are written to",
               "title": "Fname S2D"
            }
         },
         "required": [
            "points"
         ],
         "title": "TEST",
         "type": "object"
      },
      "TimeRangeOpen": {
         "additionalProperties": false,
         "description": "Regular times with an open boundary.\n\n.. code-block:: text\n\n    [tbeg] [delt] SEC|MIN|HR|DAY\n\nTime is rendered in one of the following formats:\n\n* 1: ISO-notation 19870530.153000\n* 2: (as in HP compiler) '30-May-87 15:30:00'\n* 3: (as in Lahey compiler) 05/30/87.15:30:00\n* 4: 15:30:00\n* 5: 87/05/30 15:30:00'\n* 6: as in WAM 8705301530\n\nNote\n----\nThe `tbeg` field can be specified as:\n\n* existing datetime object\n* int or float, assumed as Unix time, i.e. seconds (if >= -2e10 or <= 2e10) or\n  milliseconds (if < -2e10 or > 2e10) since 1 January 1970.\n* ISO 8601 time string.\n\nNote\n----\nThe `tdelta` field can be specified as:\n\n* existing timedelta object\n* int or float, assumed as seconds\n* ISO 8601 duration string, following formats work:\n\n    * `[-][DD ][HH:MM]SS[.ffffff]`\n    * `[\u00b1]P[DD]DT[HH]H[MM]M[SS]S` (ISO 8601 format for timedelta)\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import TimeRangeOpen\n    from datetime import datetime, timedelta\n    times = TimeRangeOpen(\n        tbeg=datetime(1990, 1, 1), delt=timedelta(minutes=30), dfmt=\"min\"\n    )\n    print(times.render())\n    times = TimeRangeOpen(\n        tbeg=\"2012-01-01T00:00:00\", delt=\"PT1H\", tfmt=2, dfmt=\"hr\", suffix=\"blk\"\n    )\n    print(times.render())",
         "properties": {
            "model_type": {
               "default": "open",
               "description": "Model type discriminator",
               "enum": [
                  "open",
                  "OPEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "tbeg": {
               "default": "1970-01-01T00:00:00",
               "description": "Start time",
               "format": "date-time",
               "title": "Tbeg",
               "type": "string"
            },
            "delt": {
               "default": "PT1H",
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            },
            "suffix": {
               "default": "",
               "description": "Suffix to prepend to argument names when rendering",
               "title": "Suffix",
               "type": "string"
            }
         },
         "title": "TimeRangeOpen",
         "type": "object"
      },
      "XY": {
         "additionalProperties": false,
         "description": "Points in problem coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import XY\n    points = XY(\n        x=[172, 172, 172, 172.5, 173],\n        y=[-41, -40.5, -40, -40, -40],\n        fmt=\"0.2f\",\n    )\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "xy",
               "description": "Model type discriminator",
               "enum": [
                  "xy",
                  "XY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "x": {
               "description": "Problem x-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "X",
               "type": "array"
            },
            "y": {
               "description": "Problem y-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "Y",
               "type": "array"
            },
            "fmt": {
               "default": "0.8f",
               "description": "The format to render floats values",
               "title": "Fmt",
               "type": "string"
            }
         },
         "required": [
            "x",
            "y"
         ],
         "title": "XY",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
field block: BLOCK | BLOCKS | None = None
Validated by:
field curve: CURVES | None = None
Validated by:
field frame: FRAME | None = None
Validated by:
field group: GROUP | None = None
Validated by:
field isoline: ISOLINE | None = None
Validated by:
field model_type: Literal['output', 'OUTPUT'] = 'output'

Model type discriminator

Validated by:
field nestout: NESTOUT | None = None
Validated by:
field ngrid: NGRID | NGRID_UNSTRUCTURED | None = None
Validated by:
field output_options: OUTPUT_OPTIONS | None = None
Validated by:
field points: POINTS | POINTS_FILE | None = None
Validated by:
field quantity: QUANTITIES | None = None
Validated by:
field ray: RAY | None = None
Validated by:
field specout: SPECOUT | None = None
Validated by:
field table: TABLE | None = None
Validated by:
field test: TEST | None = None
Validated by:
validator block_with_frame_or_group  »  all fields[source]

Ensure Block is only defined for FRAME or GROUP locations.

cmd() list[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator isoline_ray_defined  »  all fields[source]

Ensure the isoline ray has been defined.

validator locations_sname_unique  »  all fields[source]

Ensure same sname isn’t used in more than one set of output locations.

validator ngrid_and_nestout  »  all fields[source]

Ensure NGRID and NESTOUT are specified together.

render(*args, **kwargs) str

Override base class to allow rendering list of components.

validator write_locations_exists  »  all fields[source]

Ensure the location component requested by a write component exists.

property locations_set

List of specified location fields.

property snames

List of snames from specified location components.

property write_set

List of specified write fields.

pydantic model rompy.swan.components.group.PHYSICS[source]

Physics group component.

The physics group component is a convenience to allow specifying several individual components in a single command and check for consistency between them.

Exemples#

In [1]: from rompy.swan.components.group import PHYSICS

In [2]: gen = {"model_type": "gen3", "source_terms": {"model_type": "komen"}}

In [3]: phys = PHYSICS(gen=gen)

In [4]: print(phys.render())
GEN3 KOMEN DRAG WU

In [5]: phys = PHYSICS(
   ...:     gen=dict(model_type="gen3", source_terms={"model_type": "st6c1"}),
   ...:     negatinp={"model_type": "negatinp", "rdcoef": 0.04},
   ...:     sswell={"model_type": "zieger"},
   ...:     breaking={"model_type": "constant", "alpha": 1.0, "gamma": 0.73},
   ...:     friction={"model_type": "jonswap", "cfjon": 0.038},
   ...: )
   ...: 

In [6]: print(phys.render())
GEN3 ST6 a1sds=4.7e-07 a2sds=6.6e-06 p1sds=4.0 p2sds=4.0 UP HWANG VECTAU U10PROXY windscaling=28.0 AGROW

SSWELL ZIEGER

NEGATINP rdcoef=0.04

BREAKING CONSTANT alpha=1.0 gamma=0.73

FRICTION JONSWAP CONSTANT cfjon=0.038

Show JSON schema
{
   "title": "PHYSICS",
   "description": "Physics group component.\n\nThe physics group component is a convenience to allow specifying several individual\ncomponents in a single command and check for consistency between them.\n\nExemples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.group import PHYSICS\n    gen = {\"model_type\": \"gen3\", \"source_terms\": {\"model_type\": \"komen\"}}\n    phys = PHYSICS(gen=gen)\n    print(phys.render())\n    phys = PHYSICS(\n        gen=dict(model_type=\"gen3\", source_terms={\"model_type\": \"st6c1\"}),\n        negatinp={\"model_type\": \"negatinp\", \"rdcoef\": 0.04},\n        sswell={\"model_type\": \"zieger\"},\n        breaking={\"model_type\": \"constant\", \"alpha\": 1.0, \"gamma\": 0.73},\n        friction={\"model_type\": \"jonswap\", \"cfjon\": 0.038},\n    )\n    print(phys.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "physics",
         "description": "Model type discriminator",
         "enum": [
            "physics",
            "PHYSICS"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "gen": {
         "anyOf": [
            {
               "description": "Wave generation component",
               "discriminator": {
                  "mapping": {
                     "GEN1": "#/$defs/GEN1",
                     "GEN2": "#/$defs/GEN2",
                     "GEN3": "#/$defs/GEN3",
                     "gen1": "#/$defs/GEN1",
                     "gen2": "#/$defs/GEN2",
                     "gen3": "#/$defs/GEN3"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/GEN1"
                  },
                  {
                     "$ref": "#/$defs/GEN2"
                  },
                  {
                     "$ref": "#/$defs/GEN3"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Gen"
      },
      "sswell": {
         "anyOf": [
            {
               "description": "Swell dissipation component",
               "discriminator": {
                  "mapping": {
                     "ARDHUIN": "#/$defs/SSWELL_ARDHUIN",
                     "ROGERS": "#/$defs/SSWELL_ROGERS",
                     "ZIEGER": "#/$defs/SSWELL_ZIEGER",
                     "ardhuin": "#/$defs/SSWELL_ARDHUIN",
                     "rogers": "#/$defs/SSWELL_ROGERS",
                     "zieger": "#/$defs/SSWELL_ZIEGER"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/SSWELL_ROGERS"
                  },
                  {
                     "$ref": "#/$defs/SSWELL_ARDHUIN"
                  },
                  {
                     "$ref": "#/$defs/SSWELL_ZIEGER"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Sswell"
      },
      "negatinp": {
         "anyOf": [
            {
               "$ref": "#/$defs/NEGATINP",
               "description": "Negative wind input component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "wcapping": {
         "anyOf": [
            {
               "description": "Whitecapping component",
               "discriminator": {
                  "mapping": {
                     "AB": "#/$defs/WCAPPING_AB",
                     "KOMEN": "#/$defs/WCAPPING_KOMEN",
                     "ab": "#/$defs/WCAPPING_AB",
                     "komen": "#/$defs/WCAPPING_KOMEN"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/WCAPPING_KOMEN"
                  },
                  {
                     "$ref": "#/$defs/WCAPPING_AB"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Wcapping"
      },
      "quadrupl": {
         "anyOf": [
            {
               "$ref": "#/$defs/QUADRUPL",
               "description": "Quadruplets component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "breaking": {
         "anyOf": [
            {
               "description": "Wave breaking component",
               "discriminator": {
                  "mapping": {
                     "BKD": "#/$defs/BREAKING_BKD",
                     "CONSTANT": "#/$defs/BREAKING_CONSTANT",
                     "bkd": "#/$defs/BREAKING_BKD",
                     "constant": "#/$defs/BREAKING_CONSTANT"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/BREAKING_CONSTANT"
                  },
                  {
                     "$ref": "#/$defs/BREAKING_BKD"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Breaking"
      },
      "friction": {
         "anyOf": [
            {
               "description": "Bottom friction component",
               "discriminator": {
                  "mapping": {
                     "COLLINS": "#/$defs/FRICTION_COLLINS",
                     "JONSWAP": "#/$defs/FRICTION_JONSWAP",
                     "MADSEN": "#/$defs/FRICTION_MADSEN",
                     "RIPPLES": "#/$defs/FRICTION_RIPPLES",
                     "collins": "#/$defs/FRICTION_COLLINS",
                     "jonswap": "#/$defs/FRICTION_JONSWAP",
                     "madsen": "#/$defs/FRICTION_MADSEN",
                     "ripples": "#/$defs/FRICTION_RIPPLES"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/FRICTION_JONSWAP"
                  },
                  {
                     "$ref": "#/$defs/FRICTION_COLLINS"
                  },
                  {
                     "$ref": "#/$defs/FRICTION_MADSEN"
                  },
                  {
                     "$ref": "#/$defs/FRICTION_RIPPLES"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Friction"
      },
      "triad": {
         "anyOf": [
            {
               "description": "Triad interactions component",
               "discriminator": {
                  "mapping": {
                     "DCTA": "#/$defs/TRIAD_DCTA",
                     "LTA": "#/$defs/TRIAD_LTA",
                     "SPB": "#/$defs/TRIAD_SPB",
                     "TRIAD": "#/$defs/TRIAD",
                     "dcta": "#/$defs/TRIAD_DCTA",
                     "lta": "#/$defs/TRIAD_LTA",
                     "spb": "#/$defs/TRIAD_SPB",
                     "triad": "#/$defs/TRIAD"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/TRIAD"
                  },
                  {
                     "$ref": "#/$defs/TRIAD_DCTA"
                  },
                  {
                     "$ref": "#/$defs/TRIAD_LTA"
                  },
                  {
                     "$ref": "#/$defs/TRIAD_SPB"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Triad"
      },
      "vegetation": {
         "anyOf": [
            {
               "$ref": "#/$defs/VEGETATION",
               "description": "Vegetation component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "mud": {
         "anyOf": [
            {
               "$ref": "#/$defs/MUD",
               "description": "Mud component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "sice": {
         "anyOf": [
            {
               "description": "Sea ice component",
               "discriminator": {
                  "mapping": {
                     "D15": "#/$defs/SICE_D15",
                     "M18": "#/$defs/SICE_M18",
                     "R19": "#/$defs/SICE_R19",
                     "R21B": "#/$defs/SICE_R21B",
                     "SICE": "#/$defs/SICE",
                     "d15": "#/$defs/SICE_D15",
                     "m18": "#/$defs/SICE_M18",
                     "r19": "#/$defs/SICE_R19",
                     "r21b": "#/$defs/SICE_R21B",
                     "sice": "#/$defs/SICE"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/SICE"
                  },
                  {
                     "$ref": "#/$defs/SICE_R19"
                  },
                  {
                     "$ref": "#/$defs/SICE_D15"
                  },
                  {
                     "$ref": "#/$defs/SICE_M18"
                  },
                  {
                     "$ref": "#/$defs/SICE_R21B"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Sice"
      },
      "turbulence": {
         "anyOf": [
            {
               "$ref": "#/$defs/TURBULENCE",
               "description": "Turbulence component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "bragg": {
         "anyOf": [
            {
               "description": "Bragg scattering component",
               "discriminator": {
                  "mapping": {
                     "BRAGG": "#/$defs/BRAGG",
                     "FILE": "#/$defs/BRAGG_FILE",
                     "FT": "#/$defs/BRAGG_FT",
                     "bragg": "#/$defs/BRAGG",
                     "file": "#/$defs/BRAGG_FILE",
                     "ft": "#/$defs/BRAGG_FT"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/BRAGG"
                  },
                  {
                     "$ref": "#/$defs/BRAGG_FT"
                  },
                  {
                     "$ref": "#/$defs/BRAGG_FILE"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Bragg"
      },
      "limiter": {
         "anyOf": [
            {
               "$ref": "#/$defs/LIMITER",
               "description": "Limiter component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "obstacle": {
         "anyOf": [
            {
               "$ref": "#/$defs/OBSTACLES",
               "description": "Obstacle group component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "setup": {
         "anyOf": [
            {
               "$ref": "#/$defs/SETUP",
               "description": "Setup component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "diffraction": {
         "anyOf": [
            {
               "$ref": "#/$defs/DIFFRACTION",
               "description": "Diffraction component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "surfbeat": {
         "anyOf": [
            {
               "$ref": "#/$defs/SURFBEAT",
               "description": "Surfbeat component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "scat": {
         "anyOf": [
            {
               "$ref": "#/$defs/SCAT",
               "description": "Scattering component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "deactivate": {
         "anyOf": [
            {
               "$ref": "#/$defs/OFFS",
               "description": "Deactivate components"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "BRAGG": {
         "additionalProperties": false,
         "description": "Bragg scattering.\n\n.. code-block:: text\n\n    BRAGG [ibrag] [nreg] [cutoff]\n\nUsing this optional command, the user activates a source term to represent the\nscattering of waves due to changes in the small-scale bathymetry based on the\ntheory of Ardhuin and Herbers (2002). If this command is not used, SWAN will not\naccount for Bragg scattering.\n\nThe underlying process is related to the bed elevation spectrum that describes the\nrandom variability of the bathymetry at the scale of the wave length on top of a\nslowly varying depth. To input this spectrum in the model, two options are\navailable. One option is to read a spectrum from a file. This single bottom\nspectrum will subsequently be applied in all active grid points. The assumption\nbeing made here is that the inputted bottom is gently sloping. Note that the bottom\nspectrum must be given as a function of the wave number `k`.\n\nAnother option is to compute the spectrum by a Fourier transform from `x` to `k` of\nthe bed modulations around a computational grid point. First, one must define a\nsquare region with a fixed size around the grid point in order to perform the\nFourier transform. The size should correspond to a multiple of the wave length at\nwhich refraction is resolved (i.e. consistent with the mild slope assumption).\nNext, the amplitude modulation of the small-scale bathymetry is obtained by\nsubstracting a slowly varying bed level from the inputted high-resolution\nbathymetric data within this square region. Here, the smooth bed level is achieved\nusing a bilinear fit. During the computation, however, SWAN employs the gently\nsloping bed as the mean of the original bathymetry within the given square around\neach computational grid point. Finally, the corresponding bottom spectrum is\ncomputed with an FFT.\n\nNotes\n-----\nThe Bragg scattering source term to the action balance equation gives rise to a\nfairly stiff equation. The best remedy is to run SWAN in the nonstationary mode\nwith a relatively small time step or in the stationary mode with some under\nrelaxation (see command `NUM STAT [alfa]`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BRAGG\n    bragg = BRAGG(nreg=200)\n    print(bragg.render())\n    bragg = BRAGG(ibrag=1, nreg=200, cutoff=5.0)\n    print(bragg.render())",
         "properties": {
            "model_type": {
               "default": "bragg",
               "description": "Model type discriminator",
               "enum": [
                  "bragg",
                  "BRAGG"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ibrag": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)",
               "title": "Ibrag"
            },
            "nreg": {
               "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid",
               "title": "Nreg",
               "type": "integer"
            },
            "cutoff": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)",
               "title": "Cutoff"
            }
         },
         "required": [
            "nreg"
         ],
         "title": "BRAGG",
         "type": "object"
      },
      "BRAGG_FILE": {
         "additionalProperties": false,
         "description": "Bragg scattering with bottom spectrum from file.\n\n.. code-block:: text\n\n    BRAGG [ibrag] [nreg] [cutoff] FILE 'fname' [idla] [mkx] [mky] [dkx] [dky]\n\nThe bed elevation spectrum `FB(kx, ky)` is read from a file.\n\nNotes\n-----\nThis spectrum is taken to be uniform over the entire computational domain.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BRAGG_FILE\n    bragg = BRAGG_FILE(fname=\"bottom_spectrum.txt\", nreg=500, mkx=99, dkx=0.1)\n    print(bragg.render())\n    kwargs = dict(\n        ibrag=3,\n        nreg=500,\n        cutoff=5.0,\n        fname=\"bottom_spectrum.txt\",\n        mkx=99,\n        mky=149,\n        dkx=0.1,\n        dky=0.1,\n    )\n    bragg = BRAGG_FILE(**kwargs)\n    print(bragg.render())",
         "properties": {
            "model_type": {
               "default": "file",
               "description": "Model type discriminator",
               "enum": [
                  "file",
                  "FILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ibrag": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)",
               "title": "Ibrag"
            },
            "nreg": {
               "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid",
               "title": "Nreg",
               "type": "integer"
            },
            "cutoff": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)",
               "title": "Cutoff"
            },
            "fname": {
               "description": "Name of file containing the bottom spectrum",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            },
            "idla": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/IDLA"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Order in which the values should be given in the input files"
            },
            "mkx": {
               "description": "Number of cells in x-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)",
               "title": "Mkx",
               "type": "integer"
            },
            "mky": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of cells in y-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)(SWAN default: `mky = mkx`)",
               "title": "Mky"
            },
            "dkx": {
               "description": "Mesh size in x-direction of the wave number grid related to bottom spectrum (1/m)",
               "title": "Dkx",
               "type": "number"
            },
            "dky": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Mesh size in y-direction of the wave number grid related to bottom spectrum (1/m) (SWAN default: `dky = dkx`)",
               "title": "Dky"
            }
         },
         "required": [
            "nreg",
            "fname",
            "mkx",
            "dkx"
         ],
         "title": "BRAGG_FILE",
         "type": "object"
      },
      "BRAGG_FT": {
         "additionalProperties": false,
         "description": "Bragg scattering with bottom spectrum computed from FFT.\n\n.. code-block:: text\n\n    BRAGG [ibrag] [nreg] [cutoff] FT\n\nIf this keyword is present the bottom spectrum will be computed in each active\ngrid point using a Fast Fourier Transform (FFT).\n\nNotes\n-----\nThe depth in each computational grid point is computed as the average of the\ninputted (high-resolution) bed levels within the square region.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BRAGG_FT\n    bragg = BRAGG_FT(nreg=350)\n    print(bragg.render())\n    bragg = BRAGG_FT(ibrag=2, nreg=350, cutoff=5.0)\n    print(bragg.render())",
         "properties": {
            "model_type": {
               "default": "ft",
               "description": "Model type discriminator",
               "enum": [
                  "ft",
                  "FT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ibrag": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)",
               "title": "Ibrag"
            },
            "nreg": {
               "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid",
               "title": "Nreg",
               "type": "integer"
            },
            "cutoff": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)",
               "title": "Cutoff"
            }
         },
         "required": [
            "nreg"
         ],
         "title": "BRAGG_FT",
         "type": "object"
      },
      "BREAKING_BKD": {
         "additionalProperties": false,
         "description": "Variable wave breaking index.\n\n.. code-block:: text\n\n    BREAKING BKD [alpha] [gamma0] [a1] [a2] [a3]\n\nIndicates that the breaker index scales with both the bottom slope (`beta`)\nand the dimensionless depth (kd).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BREAKING_BKD\n    breaking = BREAKING_BKD()\n    print(breaking.render())\n    breaking = BREAKING_BKD(alpha=1.0, gamma0=0.54, a1=7.59, a2=-8.06, a3=8.09)\n    print(breaking.render())",
         "properties": {
            "model_type": {
               "default": "bkd",
               "description": "Model type discriminator",
               "enum": [
                  "bkd",
                  "BKD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)",
               "title": "Alpha"
            },
            "gamma0": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The reference $gamma$ for horizontal slopes (SWAN default: 0.54)",
               "title": "Gamma0"
            },
            "a1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "First tunable coefficient for the breaker index (SWAN default: 7.59)",
               "title": "A1"
            },
            "a2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Second tunable coefficient for the breaker index (SWAN default: -8.06)",
               "title": "A2"
            },
            "a3": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Third tunable coefficient for the breaker index (SWAN default: 8.09)",
               "title": "A3"
            }
         },
         "title": "BREAKING_BKD",
         "type": "object"
      },
      "BREAKING_CONSTANT": {
         "additionalProperties": false,
         "description": "Constant wave breaking index.\n\n.. code-block:: text\n\n    BREAKING CONSTANT [alpha] [gamma]\n\nIndicates that a constant breaker index is to be used.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BREAKING_CONSTANT\n    breaking = BREAKING_CONSTANT()\n    print(breaking.render())\n    breaking = BREAKING_CONSTANT(alpha=1.0, gamma=0.73)\n    print(breaking.render())",
         "properties": {
            "model_type": {
               "default": "constant",
               "description": "Model type discriminator",
               "enum": [
                  "constant",
                  "CONSTANT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)",
               "title": "Alpha"
            },
            "gamma": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The breaker index, i.e. the ratio of maximum individual wave height over depth (SWAN default: 0.73)",
               "title": "Gamma"
            }
         },
         "title": "BREAKING_CONSTANT",
         "type": "object"
      },
      "DANGREMOND": {
         "additionalProperties": false,
         "description": "DAM transmission of d'Angremond et al. (1996).\n\n.. code-block:: text\n\n    DAM DANGREMOND [hgt] [slope] [Bk]\n\nThis option specifies transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nd'Angremond, K., Van Der Meer, J.W. and De Jong, R.J., 1996. Wave transmission at\nlow-crested structures. In Coastal Engineering 1996 (pp. 2418-2427).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DANGREMOND\n    transm = DANGREMOND(hgt=3.0, slope=60, Bk=10.0)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "dangremond",
               "description": "Model type discriminator",
               "enum": [
                  "dangremond",
                  "DANGREMOND"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
               "title": "Hgt",
               "type": "number"
            },
            "slope": {
               "description": "The slope of the obstacle (in degrees)",
               "maximum": 90.0,
               "minimum": 0.0,
               "title": "Slope",
               "type": "number"
            },
            "Bk": {
               "description": "The crest width of the obstacle",
               "title": "Bk",
               "type": "number"
            }
         },
         "required": [
            "hgt",
            "slope",
            "Bk"
         ],
         "title": "DANGREMOND",
         "type": "object"
      },
      "DEWIT": {
         "additionalProperties": false,
         "description": "Biphase of De Wit (2022).\n\n.. code-block:: text\n\n    BIPHASE DEWIT [lpar]\n\nBiphase parameterization based on bed slope and peak period of De Wit (2022).\n\nReferences\n----------\nDe Wit, F.P., 2022. Wave shape prediction in complex coastal systems (Doctoral\ndissertation, PhD. thesis. Delft University of Technology. https://repository.\ntudelft. nl/islandora/object/uuid% 3A0fb850a4-4294-4181-9d74-857de21265c2).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DEWIT\n    biphase = DEWIT()\n    print(biphase.render())\n    biphase = DEWIT(lpar=0.0)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "dewit",
               "default": "dewit",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "lpar": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scales spatial averaging of the De Wit's biphase in terms of a multiple of peak wave length of the incident wave field. Note: `lpar` = 0` means no averaging (SWAN default: 0)",
               "title": "Lpar"
            }
         },
         "title": "DEWIT",
         "type": "object"
      },
      "DIFFRACTION": {
         "additionalProperties": false,
         "description": "Wave diffraction.\n\n.. code-block:: text\n\n    DIFFRACTION [idiffr] [smpar] [smnum] [cgmod]\n\nIf this optional command is given, the diffraction is included in the wave\ncomputation. But the diffraction approximation in SWAN does not properly handle\ndiffraction in harbours or in front of reflecting obstacles (see\nScientific/Technical documentation). Behind breakwaters with a down-wave beach, the\nSWAN results seem reasonable. The spatial resolution near (the tip of) the\ndiffraction obstacle should be 1/5 to 1/10 of the dominant wave length.\n\nNotes\n-----\nWithout extra measures, the diffraction computations with SWAN often converge\npoorly or not at all. Two measures can be taken:\n\n1. (RECOMMENDED) The user can request under-relaxation. See command `NUMERIC`\nparameter `alpha` and Scientific/Technical documentation (Eq. (3.31)). Very limited\nexperience suggests `alpha = 0.01`.\n\n2. Alternatively, the user can request smoothing of the wave field for the\ncomputation of the diffraction parameter (the wave field remains intact for all\nother computations and output). This is done with a repeated convolution filtering.\n\nExamples\n--------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import DIFFRACTION\n    diffraction = DIFFRACTION()\n    print(diffraction.render())\n    diffraction = DIFFRACTION(idiffr=True, smpar=0.0, smnum=1.0)\n    print(diffraction.render())",
         "properties": {
            "model_type": {
               "default": "diffraction",
               "description": "Model type discriminator",
               "enum": [
                  "diffraction",
                  "DIFFRACTION"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "idiffr": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the use of diffraction. If `idiffr=0` then no diffraction is taken into account (SWAN default: 1)",
               "title": "Idiffr"
            },
            "smpar": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Smoothing parameter for the calculation of \u2207 \u00b7 \u221aEtot. During every smoothing step all grid points exchange `smpar` times the energy with their neighbours. Note that `smpar` is parameter a in the above text (SWAN default: 0.0)",
               "title": "Smpar"
            },
            "smnum": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Number of smoothing steps relative to `smpar` (SWAN default: 0)",
               "title": "Smnum"
            },
            "cgmod": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Adaption of propagation velocities in geographic space due to diffraction. If `cgmod=0` then no adaption (SWAN default: 1.0)",
               "title": "Cgmod"
            }
         },
         "title": "DIFFRACTION",
         "type": "object"
      },
      "ELDEBERKY": {
         "additionalProperties": false,
         "description": "Biphase of Eldeberky (1999).\n\n.. code-block:: text\n\n    BIPHASE ELDEBERKY [urcrit]\n\nBiphase parameterisation as a funtion of the Ursell number of Eldeberky (1999).\n\nReferences\n----------\nEldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for\nmodeling triad interactions in dispersive waves. In Coastal Engineering 1996\n(pp. 1088-1101).\n\nEldeberky, Y. and Madsen, P.A., 1999. Deterministic and stochastic evolution\nequations for fully dispersive and weakly nonlinear waves. Coastal Engineering,\n38(1), pp.1-24.\n\nDoering, J.C. and Bowen, A.J., 1995. Parametrization of orbital velocity\nasymmetries of shoaling and breaking waves using bispectral analysis. Coastal\nengineering, 26(1-2), pp.15-33.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ELDEBERKY\n    biphase = ELDEBERKY()\n    print(biphase.render())\n    biphase = ELDEBERKY(urcrit=0.63)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "eldeberky",
               "default": "eldeberky",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "urcrit": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The critical Ursell number appearing in the parametrization. Note: the value of `urcrit` is setted by Eldeberky (1996) at 0.2 based on a laboratory experiment, whereas Doering and Bowen (1995) employed the value of 0.63 based on the field experiment data (SWAN default: 0.63)",
               "title": "Urcrit"
            }
         },
         "title": "ELDEBERKY",
         "type": "object"
      },
      "FREEBOARD": {
         "additionalProperties": false,
         "description": "Freeboard dependent transmission and reflection.\n\n.. code-block:: text\n\n    FREEBOARD [hgt] [gammat] [gammar] [QUAY]\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nSee the Scientific/Technical documentation for background information on the\n`gammat` and `gammar` shape parameters.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import FREEBOARD\n    freeboard = FREEBOARD(hgt=2.0)\n    print(freeboard.render())\n    freeboard = FREEBOARD(hgt=2.0, gammat=1.0, gammar=1.0, quay=True)\n    print(freeboard.render())",
         "properties": {
            "model_type": {
               "default": "freeboard",
               "description": "Model type discriminator",
               "enum": [
                  "freeboard",
                  "FREEBOARD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle or height of the quay above the reference level (same reference level as for the bottom). Use a negative value if the top is below that reference level. In case `hgt` is also specified in the DAM option, both values of `hgt` should be equal for consistency",
               "title": "Hgt",
               "type": "number"
            },
            "gammat": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape parameter of relative freeboard dependency of transmission coefficient. This parameter should be higher than zero (SWAN default 1.0)",
               "title": "Gammat"
            },
            "gammar": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape parameter of relative freeboard dependency of reflection coefficient. This parameter should be higher than zero (SWAN default 1.0)",
               "title": "Gammar"
            },
            "quay": {
               "default": false,
               "description": "With this option the user indicates that the freeboard dependency of the transmission and reflection coefficients also depends on the relative position of an obstacle-linked grid point with respect to the position of the obstacle line representing the edge of a quay. In case the active grid point is on the deeper side of the obstacle, then the correction factors are applied using the parameters `hgt`, `gammat` and `gammar`.In case the active grid point is on the shallower side of the obstacle, the reflection coefficient is set to 0 and the transmission coefficient to 1.",
               "title": "Quay",
               "type": "boolean"
            }
         },
         "required": [
            "hgt"
         ],
         "title": "FREEBOARD",
         "type": "object"
      },
      "FRICTION_COLLINS": {
         "additionalProperties": false,
         "description": "Collins (1972) friction.\n\n.. code-block:: text\n\n    FRICTION COLLINS [cfw]\n\nNote that `cfw` is allowed to vary over the computational region; in that case use\nthe commands INPGRID FRICTION and READINP FRICTION to define and read the friction\ndata. This command FRICTION is still required to define the type of friction\nexpression. The value of `cfw` in this command is then not required (it will be\nignored).\n\nReferences\n----------\nCollins, J.I., 1972. Prediction of shallow-water spectra. Journal of Geophysical\nResearch, 77(15), pp.2693-2707.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_COLLINS\n    friction = FRICTION_COLLINS()\n    print(friction.render())\n    friction = FRICTION_COLLINS(cfw=0.038)\n    print(friction.render())",
         "properties": {
            "model_type": {
               "default": "collins",
               "description": "Model type discriminator",
               "enum": [
                  "collins",
                  "COLLINS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cfw": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Collins bottom friction coefficient (SWAN default: 0.015)",
               "title": "Cfw"
            }
         },
         "title": "FRICTION_COLLINS",
         "type": "object"
      },
      "FRICTION_JONSWAP": {
         "additionalProperties": false,
         "description": "Hasselmann et al. (1973) Jonswap friction.\n\n.. code-block:: text\n\n    FRICTION JONSWAP CONSTANT [cfjon]\n\nIndicates that the semi-empirical expression derived from the JONSWAP results for\nbottom friction dissipation (Hasselmann et al., 1973, JONSWAP) should be activated.\nThis option is default.\n\nReferences\n----------\nHasselmann, K., Barnett, T.P., Bouws, E., Carlson, H., Cartwright, D.E., Enke, K.,\nEwing, J.A., Gienapp, A., Hasselmann, D.E., Kruseman, P. and Meerburg, A., 1973.\nMeasurements of wind-wave growth and swell decay during the Joint North Sea Wave\nProject (JONSWAP). Deutches Hydrographisches Institut, Hamburg, Germany,\nRep. No. 12, 95 pp.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_JONSWAP\n    friction = FRICTION_JONSWAP()\n    print(friction.render())\n    friction = FRICTION_JONSWAP(cfjon=0.038)\n    print(friction.render())\n\nTODO: Implement VARIABLE option?",
         "properties": {
            "model_type": {
               "default": "jonswap",
               "description": "Model type discriminator",
               "enum": [
                  "jonswap",
                  "JONSWAP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cfjon": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient of the JONSWAP formulation (SWAN default: 0.038)",
               "title": "Cfjon"
            }
         },
         "title": "FRICTION_JONSWAP",
         "type": "object"
      },
      "FRICTION_MADSEN": {
         "additionalProperties": false,
         "description": "Madsen et al (1988) friction.\n\n.. code-block:: text\n\n    FRICTION MADSEN [kn]\n\nNote that `kn` is allowed to vary over the computational region; in that case use\nthe commands INPGRID FRICTION and READINP FRICTION to define and read the friction\ndata. This command FRICTION is still required to define the type of friction\nexpression. The value of `kn` in this command is then not required (it will be\nignored).\n\nReferences\n----------\nMadsen, O.S., Poon, Y.K. and Graber, H.C., 1988. Spectral wave attenuation by\nbottom friction: Theory. In Coastal engineering 1988 (pp. 492-504).\n\nMadsen, O.S. and Rosengaus, M.M., 1988. Spectral wave attenuation by bottom\nfriction: Experiments. In Coastal Engineering 1988 (pp. 849-857).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_MADSEN\n    friction = FRICTION_MADSEN()\n    print(friction.render())\n    friction = FRICTION_MADSEN(kn=0.038)\n    print(friction.render())",
         "properties": {
            "model_type": {
               "default": "madsen",
               "description": "Model type discriminator",
               "enum": [
                  "madsen",
                  "MADSEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "kn": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "equivalent roughness length scale of the bottom (in m) (SWAN default: 0.05)",
               "title": "Kn"
            }
         },
         "title": "FRICTION_MADSEN",
         "type": "object"
      },
      "FRICTION_RIPPLES": {
         "additionalProperties": false,
         "description": "Smith et al. (2011) Ripples friction.\n\n.. code-block:: text\n\n    FRICTION RIPPLES [S] [D]\n\nIndicates that the expression of Smith et al. (2011) should be activated. Here\nfriction depends on the formation of bottom ripples and sediment size.\n\nReferences\n----------\nSmith, G.A., Babanin, A.V., Riedel, P., Young, I.R., Oliver, S. and Hubbert, G.,\n2011. Introduction of a new friction routine into the SWAN model that evaluates\nroughness due to bedform and sediment size changes. Coastal Engineering, 58(4),\npp.317-326.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_RIPPLES\n    friction = FRICTION_RIPPLES()\n    print(friction.render())\n    friction = FRICTION_RIPPLES(s=2.65, d=0.0001)\n    print(friction.render())",
         "properties": {
            "model_type": {
               "default": "ripples",
               "description": "Model type discriminator",
               "enum": [
                  "ripples",
                  "RIPPLES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "s": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The specific gravity of the sediment (SWAN default: 2.65)",
               "title": "S"
            },
            "d": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The sediment diameter (in m) (SWAN default: 0.0001)",
               "title": "D"
            }
         },
         "title": "FRICTION_RIPPLES",
         "type": "object"
      },
      "GEN1": {
         "additionalProperties": false,
         "description": "First generation source terms GEN1.\n\n.. code-block:: text\n\n    GEN1 [cf10] [cf20] [cf30] [cf40] [edmlpm] [cdrag] [umin] [cfpm]\n\nWith this command the user indicates that SWAN should run in first-generation mode\n(see Scientific/Technical documentation).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import GEN1\n    gen = GEN1()\n    print(gen.render())\n    kwargs = dict(\n        cf10=188.0,\n        cf20=0.59,\n        cf30=0.12,\n        cf40=250.0,\n        edmlpm=0.0036,\n        cdrag=0.0012,\n        umin=1.0,\n        cfpm=0.13\n    )\n    gen = GEN1(**kwargs)\n    print(gen.render())",
         "properties": {
            "model_type": {
               "default": "gen1",
               "description": "Model type discriminator",
               "enum": [
                  "gen1",
                  "GEN1"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cf10": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the linear wave growth (SWAN default: 188.0)",
               "title": "Cf10"
            },
            "cf20": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the exponential wave growth (SWAN default: 0.59)",
               "title": "Cf20"
            },
            "cf30": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the exponential wave growth (SWAN default: 0.12)",
               "title": "Cf30"
            },
            "cf40": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the dissipation rate, i.e., the time decay scale (SWAN default: 250.0)",
               "title": "Cf40"
            },
            "edmlpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum non-dimensionless energy density of the wind sea part of the spectrum according to Pierson Moskowitz (SWAN default: 0.0036)",
               "title": "Edmlpm"
            },
            "cdrag": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Drag coefficient (SWAN default: 0.0012)",
               "title": "Cdrag"
            },
            "umin": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Minimum wind velocity (relative to current; all wind speeds are taken at 10 m above sea level) (SWAN default: 1)",
               "title": "Umin"
            },
            "cfpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient which determines the Pierson Moskowitz frequency: `delta_PM = 2pi g / U_10` (SWAN default: 0.13)",
               "title": "Cfpm"
            }
         },
         "title": "GEN1",
         "type": "object"
      },
      "GEN2": {
         "additionalProperties": false,
         "description": "Second generation source terms GEN2.\n\n.. code-block:: text\n\n    GEN2 [cf10] [cf20] [cf30] [cf40] [cf50] [cf60] [edmlpm] [cdrag] [umin] [cfpm]\n\nWith this command the user indicates that SWAN should run in second-generation mode\n(see Scientific/Technical documentation).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import GEN2\n    gen = GEN2()\n    print(gen.render())\n    kwargs = dict(\n        cf10=188.0,\n        cf20=0.59,\n        cf30=0.12,\n        cf40=250.0,\n        cf50=0.0023,\n        cf60=-0.223,\n        edmlpm=0.0036,\n        cdrag=0.0012,\n        umin=1.0,\n        cfpm=0.13\n    )\n    gen = GEN2(**kwargs)\n    print(gen.render())",
         "properties": {
            "model_type": {
               "default": "gen2",
               "description": "Model type discriminator",
               "enum": [
                  "gen2",
                  "GEN2"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cf10": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the linear wave growth (SWAN default: 188.0)",
               "title": "Cf10"
            },
            "cf20": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the exponential wave growth (SWAN default: 0.59)",
               "title": "Cf20"
            },
            "cf30": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the exponential wave growth (SWAN default: 0.12)",
               "title": "Cf30"
            },
            "cf40": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the dissipation rate, i.e., the time decay scale (SWAN default: 250.0)",
               "title": "Cf40"
            },
            "edmlpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum non-dimensionless energy density of the wind sea part of the spectrum according to Pierson Moskowitz (SWAN default: 0.0036)",
               "title": "Edmlpm"
            },
            "cdrag": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Drag coefficient (SWAN default: 0.0012)",
               "title": "Cdrag"
            },
            "umin": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Minimum wind velocity (relative to current; all wind speeds are taken at 10 m above sea level) (SWAN default: 1)",
               "title": "Umin"
            },
            "cfpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient which determines the Pierson Moskowitz frequency: `delta_PM = 2pi g / U_10` (SWAN default: 0.13)",
               "title": "Cfpm"
            },
            "cf50": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the spectral energy scale of the limit spectrum (SWAN default: 0.0023)",
               "title": "Cf50"
            },
            "cf60": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ccontrols the spectral energy scale of the limit spectrum (SWAN default: -0.223",
               "title": "Cf60"
            }
         },
         "title": "GEN2",
         "type": "object"
      },
      "GEN3": {
         "additionalProperties": false,
         "description": "Third generation source terms GEN3.\n\n.. code-block:: text\n\n    GEN3 JANSSEN|KOMEN|->WESTHUYSEN|ST6 AGROW [a]\n\nWith this command the user indicates that SWAN should run in third-generation mode\nfor wind input, quadruplet interactions and whitecapping.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import GEN3\n    gen = GEN3(\n        source_terms=dict(\n            model_type=\"westhuysen\",\n            wind_drag=\"wu\",\n            agrow=True,\n        ),\n    )\n    print(gen.render())\n    from rompy.swan.subcomponents.physics import ST6C1\n    gen = GEN3(source_terms=ST6C1())\n    print(gen.render())",
         "properties": {
            "model_type": {
               "default": "gen3",
               "description": "Model type discriminator",
               "enum": [
                  "gen3",
                  "GEN3"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "source_terms": {
               "description": "SWAN source terms to be used (SWAN default: WESTHUYSEN)",
               "discriminator": {
                  "mapping": {
                     "JANSSEN": "#/$defs/JANSSEN",
                     "KOMEN": "#/$defs/KOMEN",
                     "WESTHUYSEN": "#/$defs/WESTHUYSEN",
                     "janssen": "#/$defs/JANSSEN",
                     "komen": "#/$defs/KOMEN",
                     "st6": "#/$defs/ST6",
                     "st6c1": "#/$defs/ST6C1",
                     "st6c2": "#/$defs/ST6C2",
                     "st6c3": "#/$defs/ST6C3",
                     "st6c4": "#/$defs/ST6C4",
                     "st6c5": "#/$defs/ST6C5",
                     "westhuysen": "#/$defs/WESTHUYSEN"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/JANSSEN"
                  },
                  {
                     "$ref": "#/$defs/KOMEN"
                  },
                  {
                     "$ref": "#/$defs/WESTHUYSEN"
                  },
                  {
                     "$ref": "#/$defs/ST6"
                  },
                  {
                     "$ref": "#/$defs/ST6C1"
                  },
                  {
                     "$ref": "#/$defs/ST6C2"
                  },
                  {
                     "$ref": "#/$defs/ST6C3"
                  },
                  {
                     "$ref": "#/$defs/ST6C4"
                  },
                  {
                     "$ref": "#/$defs/ST6C5"
                  }
               ],
               "title": "Source Terms"
            }
         },
         "title": "GEN3",
         "type": "object"
      },
      "GODA": {
         "additionalProperties": false,
         "description": "DAM transmission of Goda/Seelig (1979).\n\n.. code-block:: text\n\n    DAM GODA [hgt] [alpha] [beta]\n\nThis option specified transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nGoda, Y. and Suzuki, Y., 1976. Estimation of incident and reflected waves in random\nwave experiments. In Coastal Engineering 1976 (pp. 828-845).\n\nSeelig, W.N., 1979. Effects of breakwaters on waves: Laboratory test of wave\ntransmission by overtopping. In Proc. Conf. Coastal Structures, 1979\n(Vol. 79, No. 2, pp. 941-961).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import GODA\n    transm = GODA(hgt=3.0)\n    print(transm.render())\n    transm = GODA(hgt=3.0, alpha=2.6, beta=0.15)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "goda",
               "description": "Model type discriminator",
               "enum": [
                  "goda",
                  "GODA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
               "title": "Hgt",
               "type": "number"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 2.6)",
               "title": "Alpha"
            },
            "beta": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Another coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 0.15)",
               "title": "Beta"
            }
         },
         "required": [
            "hgt"
         ],
         "title": "GODA",
         "type": "object"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      },
      "JANSSEN": {
         "additionalProperties": false,
         "description": "Janssen source terms subcomponent.\n\n.. code-block:: text\n\n    JANSSEN [cds1] [delta] (AGROW [a])\n\nReferences\n----------\nJanssen, P.A., 1989. Wave-induced stress and the drag of air flow over sea waves.\nJournal of Physical Oceanography, 19(6), pp.745-754.\n\nJanssen, P.A.E.M., Lionello, P. and Zambresky, L., 1989. On the interaction of wind\nand waves. Philosophical transactions of the royal society of London. Series A,\nMathematical and Physical Sciences, 329(1604), pp.289-301.\n\nJanssen, P.A., 1991. Quasi-linear theory of wind-wave generation applied to wave\nforecasting. Journal of physical oceanography, 21(11), pp.1631-1642.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import JANSSEN\n    janssen = JANSSEN()\n    print(janssen.render())\n    janssen = JANSSEN(cds1=4.5, delta=0.5, agrow=True)\n    print(janssen.render())",
         "properties": {
            "model_type": {
               "default": "janssen",
               "description": "Model type discriminator",
               "enum": [
                  "janssen",
                  "JANSSEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "wu",
               "description": "Indicates the wind drag formulation",
               "enum": [
                  "wu",
                  "fit"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "cds1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for determining the rate of whitecapping dissipation ($Cds / s^4_{PM}$) (SWAN default: 4.5)",
               "title": "Cds1"
            },
            "delta": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient which determines the dependency of the whitecapping on wave number (mix with Komen et al. formulation) (SWAN default: 0.5)",
               "title": "Delta"
            }
         },
         "title": "JANSSEN",
         "type": "object"
      },
      "KOMEN": {
         "additionalProperties": false,
         "description": "Komen source terms subcomponent.\n\n.. code-block:: text\n\n    KOMEN [cds2] [stpm] (AGROW [a])\n\nReferences\n----------\nKomen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully\ndeveloped wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import KOMEN\n    komen = KOMEN()\n    print(komen.render())\n    komen = KOMEN(cds2=2.36e-5, stpm=3.02e-3, agrow=True, a=0.0015)\n    print(komen.render())",
         "properties": {
            "model_type": {
               "default": "komen",
               "description": "Model type discriminator",
               "enum": [
                  "komen",
                  "KOMEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "wu",
               "description": "Indicates the wind drag formulation",
               "enum": [
                  "wu",
                  "fit"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for determining the rate of whitecapping dissipation (`Cds`) (SWAN default: 2.36e-5)",
               "title": "Cds2"
            },
            "stpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Value of the wave steepness for a Pierson-Moskowitz spectrum (`s^2_PM`) (SWAN default: 3.02e-3)",
               "title": "Stpm"
            }
         },
         "title": "KOMEN",
         "type": "object"
      },
      "LIMITER": {
         "additionalProperties": false,
         "description": "Physics limiter.\n\n.. code-block:: text\n\n    LIMITER [ursell] [qb]\n\nWith this command the user can de-activate permanently the quadruplets when\nthe actual Ursell number exceeds `ursell`. Moreover, as soon as the actual\nfraction of breaking waves exceeds `qb` then the action limiter will not be\nused in case of decreasing action density.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import LIMITER\n    limiter = LIMITER()\n    print(limiter.render())\n    limiter = LIMITER(ursell=10.0, qb=1.0)\n    print(limiter.render())",
         "properties": {
            "model_type": {
               "default": "limiter",
               "description": "Model type discriminator",
               "enum": [
                  "limiter",
                  "LIMITER"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ursell": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The upper threshold for Ursell number (SWAN default: 10.0)",
               "title": "Ursell"
            },
            "qb": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The threshold for fraction of breaking waves (SWAN default: 1.0)",
               "title": "Qb"
            }
         },
         "title": "LIMITER",
         "type": "object"
      },
      "LINE": {
         "additionalProperties": false,
         "description": "Line of points to define obstacle location.\n\n.. code-block:: text\n\n    LINE < [xp] [yp] >\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nPoints coordinates should be provided in m If Cartesian coordinates are used or in\ndegrees if spherical coordinates are used (see command `COORD`). At least two\ncorner points must be provided.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import LINE\n    line = LINE(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1])\n    print(line.render())",
         "properties": {
            "model_type": {
               "default": "line",
               "description": "Model type discriminator",
               "enum": [
                  "line",
                  "LINE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "xp": {
               "description": "The x-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "The y-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Yp",
               "type": "array"
            }
         },
         "required": [
            "xp",
            "yp"
         ],
         "title": "LINE",
         "type": "object"
      },
      "MUD": {
         "additionalProperties": false,
         "description": "Mud dumping.\n\n.. code-block:: text\n\n    MUD [layer] [rhom] [viscm]\n\nWith this command the user can activate wave damping due to mud based on Ng (2000).\nIf this command or the commands INPGRID MUDLAY and READINP MUDLAY are not used,\nSWAN will not account for muddy bottom effects.\n\nReferences\n----------\nNg, C., 2000, Water waves over a muddy bed: A two layer Stokes' boundary layer\nmodel, Coastal Eng., 40, 221-242.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import MUD\n    mud = MUD()\n    print(mud.render())\n    mud = MUD(\n        layer=2.0,\n        rhom=1300,\n        viscm=0.0076,\n    )\n    print(mud.render())\n\nTODO: Validate `layer` must be prescribed if `INPGRID MUDLAY` isn't used.",
         "properties": {
            "model_type": {
               "default": "mud",
               "description": "Model type discriminator",
               "enum": [
                  "mud",
                  "MUD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "layer": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The thickness of the mud layer (in m). Note that `layer` is allowed to vary over the computational region to account for the zonation of muddy bottom. In that case use the commands `INPGRID MUDLAY` and `READINP MUDLAY` to define and read the layer thickness of mud. The value of `layer` in this command is then not required (it will be ignored)",
               "title": "Layer"
            },
            "rhom": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The density of the mud layer (in kg/m3) (SWAN default: 1300)",
               "title": "Rhom"
            },
            "viscm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The kinematic viscosity of the mud layer (in m2/s) (SWAN default: 0.0076)",
               "title": "Viscm"
            }
         },
         "title": "MUD",
         "type": "object"
      },
      "NEGATINP": {
         "additionalProperties": false,
         "description": "Negative wind input.\n\n.. code-block:: text\n\n    NEGATINP [rdcoef]\n\nWith this optional command the user activates negative wind input. **This is\nintended only for use with non-breaking swell dissipation SSWELL ZIEGER**.\nParameter `rdcoef` is a fraction between 0 and 1, representing the strength of\nnegative wind input. As an example, with [rdcoef]=0.04, for a spectral bin that is\nopposed to the wind direction, the wind input factor W(k, \u03b8) is negative, and its\nmagnitude is 4% of the corresponding value of the spectral bin that is in the\nopposite direction (i.e. in the wind direction). See Zieger et al. (2015) eq. 11,\nwhere a0 is their notation for [rdcoef]. Default [rdcoef]=0.0 and `rdcoef=0.04` is\nrecommended, though as implied by Zieger et al. (2015), this value is not\nwell-established, so the user is encouraged to experiment with other values.\n\nReferences\n----------\nZieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based\nsource terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96,\npp.2-25.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import NEGATINP\n    negatinp = NEGATINP()\n    print(negatinp.render())\n    negatinp = NEGATINP(rdcoef=0.04)\n    print(negatinp.render())",
         "properties": {
            "model_type": {
               "default": "negatinp",
               "description": "Model type discriminator",
               "enum": [
                  "negatinp",
                  "NEGATINP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "rdcoef": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient representing the strength of negative wind input",
               "title": "Rdcoef"
            }
         },
         "title": "NEGATINP",
         "type": "object"
      },
      "OBSTACLE": {
         "additionalProperties": false,
         "description": "Subgrid obstacle.\n\n.. code-block:: text\n\n    OBSTACLE ->TRANSM|TRANS1D|TRANS2D|GODA|DANGREMOND REFL [reflc] ->RSPEC|RDIFF &\n        (FREEBOARD [hgt] [gammat] [gammar] QUAY) LINE < [xp] [yp] >\n\nWith this optional command the user provides the characteristics of a (line\nof) sub-grid obstacle(s) through which waves are transmitted or against which\nwaves are reflected (possibly both at the same time). The obstacle is sub-grid\nin the sense that it is narrow compared to the spatial meshes; its length should\nbe at least one mesh length.\n\nThe location of the obstacle is defined by a sequence of corner points of a line.\nThe obstacles interrupt the propagation of the waves from one grid point to the\nnext wherever this obstacle line is located between two neighbouring grid points\n(of the computational grid; the resolution of the obstacle is therefore equal to\nthe computational grid spacing). This implies that an obstacle to be effective must\nbe located such that it crosses at least one grid line. This is always the case\nwhen an obstacle is larger than one mesh length.\n\nNotes\n-----\n\n* The advise is to define obstacles with the least amount of points possible.\n* SWAN checks if the criterion `reflc^2 + trcoef^2 LE 1` is fulfilled.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLE\n    obs = OBSTACLE(\n        transmission=dict(model_type=\"transm\", trcoef=0.5),\n        reflection=dict(reflc=0.5),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())",
         "properties": {
            "model_type": {
               "default": "obstacle",
               "description": "Model type discriminator",
               "enum": [
                  "obstacle",
                  "OBSTACLE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "transmission": {
               "anyOf": [
                  {
                     "description": "Wave transmission",
                     "discriminator": {
                        "mapping": {
                           "DANGREMOND": "#/$defs/DANGREMOND",
                           "GODA": "#/$defs/GODA",
                           "TRANS1D": "#/$defs/TRANS1D",
                           "TRANS2D": "#/$defs/TRANS2D",
                           "TRANSM": "#/$defs/TRANSM",
                           "dangremond": "#/$defs/DANGREMOND",
                           "goda": "#/$defs/GODA",
                           "trans1d": "#/$defs/TRANS1D",
                           "trans2d": "#/$defs/TRANS2D",
                           "transm": "#/$defs/TRANSM"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/TRANSM"
                        },
                        {
                           "$ref": "#/$defs/TRANS1D"
                        },
                        {
                           "$ref": "#/$defs/TRANS2D"
                        },
                        {
                           "$ref": "#/$defs/GODA"
                        },
                        {
                           "$ref": "#/$defs/DANGREMOND"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Transmission"
            },
            "reflection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/REFL"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Wave reflection"
            },
            "reflection_type": {
               "anyOf": [
                  {
                     "description": "Wave reflection type",
                     "discriminator": {
                        "mapping": {
                           "RDIFF": "#/$defs/RDIFF",
                           "RSPEC": "#/$defs/RSPEC",
                           "rdiff": "#/$defs/RDIFF",
                           "rspec": "#/$defs/RSPEC"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/RSPEC"
                        },
                        {
                           "$ref": "#/$defs/RDIFF"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Reflection Type"
            },
            "freeboard": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FREEBOARD"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Freeboard"
            },
            "line": {
               "$ref": "#/$defs/LINE",
               "default": null,
               "description": "Line of obstacle"
            }
         },
         "title": "OBSTACLE",
         "type": "object"
      },
      "OBSTACLES": {
         "additionalProperties": false,
         "description": "List of swan obstacles.\n\n.. code-block:: text\n\n    OBSTACLE ... LINE < [xp] [yp] >\n    OBSTACLE ... LINE < [xp] [yp] >\n    .\n\nThis group component is a convenience to allow defining and rendering\na list of obstacle components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLES, OBSTACLE, OBSTACLE_FIG\n    obst1 = dict(\n        model_type=\"obstacle\",\n        reflection=dict(reflc=1.0),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    obst2 = OBSTACLE(\n        transmission=dict(model_type=\"transm\"),\n        line=dict(xp=[174.3, 174.3], yp=[-39.1, -39.2]),\n    )\n    obst3 = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    obstacles = OBSTACLES(obstacles=[obst1, obst2, obst3])\n    for obst in obstacles.render():\n        print(obst)",
         "properties": {
            "model_type": {
               "default": "obstacles",
               "description": "Model type discriminator",
               "enum": [
                  "obstacles",
                  "OBSTACLES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "obstacles": {
               "description": "List of obstacles",
               "items": {
                  "discriminator": {
                     "mapping": {
                        "FIG": "#/$defs/OBSTACLE_FIG",
                        "OBSTACLE": "#/$defs/OBSTACLE",
                        "fig": "#/$defs/OBSTACLE_FIG",
                        "obstacle": "#/$defs/OBSTACLE"
                     },
                     "propertyName": "model_type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/OBSTACLE"
                     },
                     {
                        "$ref": "#/$defs/OBSTACLE_FIG"
                     }
                  ]
               },
               "title": "Obstacles",
               "type": "array"
            }
         },
         "required": [
            "obstacles"
         ],
         "title": "OBSTACLES",
         "type": "object"
      },
      "OBSTACLE_FIG": {
         "additionalProperties": false,
         "description": "Obstacle for free infragravity radiation.\n\n.. code-block:: text\n\n    OBSTACLE FIG [alpha1] [hss] [tss] (REFL [reflc]) LINE <[xp] [yp]>\n\nWith this optional command the user specifies the obstacles along which the\nfree infra-gravity (FIG) energy is radiated. By placing the obstacles close to\nthe shorelines SWAN will include the FIG source term along the coastlines\naccording to the parametrization of Ardhuin et al. (2014).\n\nThe location of the obstacle is defined by a sequence of corner points of a line.\nFor an obstacle line to be effective its length is at least one mesh size large. It\nis recommended to place the obstacles at the inner area of the computational grid,\nnot at or through the boundaries. In particular, each obstacle line must be\nbordered by wet points on both sides.\n\nIn addition, the orientation of the obstacle line determines from which side of the\nobstacle the FIG wave energy is radiated away. If the begin point of the line is\nbelow or left of the end point, that is, pointing upwards/to the right, then FIG\nenergy is radiated from the west/north side of the line. If the begin point is\nabove or right of the end point (pointing downwards/to the left), then FIG energy\nis radiated away from the east/south side of the obstacle line.\n\nReferences\n----------\nArdhuin, F., Rawat, A. and Aucan, J., 2014. A numerical model for free\ninfragravity waves: Definition and validation at regional and global scales.\nOcean Modelling, 77, pp.20-32.\n\nNotes\n-----\nEither `hss` or `tss` or both are allowed to vary over the computational domain.\nIn that case use the commands `INPGRID HSS` and `READINP HSS` and/or the commands\n`INPGRID TSS` and `READINP TSS` to define and read the sea-swell wave height/period\nIt is permissible to have constant sea-swell height and non-constant sea-swell\nperiod, or vice versa. The command `OBST FIG` is still required to define the\nobstacles. The values of `hss` and/or `tss` in this command are then not required\n(they will be ignored).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLE_FIG\n    obs = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())\n    obs = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        reflection=dict(reflc=0.5),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())",
         "properties": {
            "model_type": {
               "default": "fig",
               "description": "Model type discriminator",
               "enum": [
                  "fig",
                  "FIG"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "alpha1": {
               "description": "Calibration parameter (in 1/s) for determining the rate of radiating FIG energy from the shorelines, values in Table 1 of Ardhuin et al. (2014) are between 4e-4 and 8.1e-4",
               "title": "Alpha1",
               "type": "number"
            },
            "hss": {
               "description": "The sea-swell significant wave height (in m)",
               "minimum": 0.0,
               "title": "Hss",
               "type": "number"
            },
            "tss": {
               "description": "The sea-swell mean wave period (in s)",
               "minimum": 0.0,
               "title": "Tss",
               "type": "number"
            },
            "reflection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/REFL"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Wave reflection"
            },
            "line": {
               "$ref": "#/$defs/LINE",
               "description": "Line of obstacle"
            }
         },
         "required": [
            "alpha1",
            "hss",
            "tss",
            "line"
         ],
         "title": "OBSTACLE_FIG",
         "type": "object"
      },
      "OFF": {
         "additionalProperties": false,
         "description": "Deactivate physics commands.\n\n.. code-block:: text\n\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n\nThis command deactivates physics commands. The command can be used to switch off\nthe computation of a certain physics component without having to remove the command\nfrom the input file. This is useful for testing purposes.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import OFF\n    off = OFF(physics=\"windgrowth\")\n    print(off.render())",
         "properties": {
            "model_type": {
               "default": "off",
               "description": "Model type discriminator",
               "enum": [
                  "off",
                  "OFF"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "physics": {
               "$ref": "#/$defs/PhysicsOff",
               "description": "Physics command to be switched off"
            }
         },
         "required": [
            "physics"
         ],
         "title": "OFF",
         "type": "object"
      },
      "OFFS": {
         "additionalProperties": false,
         "description": "Deactivate multiple physics commands.\n\n.. code-block:: text\n\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n    .\n\nThis group component is a convenience to allow defining and rendering\na list of `OFF` components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OFFS\n    off1 = dict(physics=\"windgrowth\")\n    off2 = dict(physics=\"wcapping\")\n    offs = OFFS(offs=[off1, off2])\n    for off in offs.render():\n        print(off)",
         "properties": {
            "model_type": {
               "default": "offs",
               "description": "Model type discriminator",
               "enum": [
                  "offs",
                  "OFFS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "offs": {
               "description": "Physics commands to deactivate",
               "items": {
                  "$ref": "#/$defs/OFF"
               },
               "title": "Offs",
               "type": "array"
            }
         },
         "required": [
            "offs"
         ],
         "title": "OFFS",
         "type": "object"
      },
      "PhysicsOff": {
         "description": "Physics commands to be switched off.\n\nAttributes\n----------\nWINDGROWTH : str = \"windgrowth\"\n    Switches off wind growth (in commands GEN1, GEN2, GEN3).\nQUADRUPL : str = \"quadrupl\"\n    Switches off quadruplet wave interactions (in command GEN3).\nWCAPPING : str = \"wcapping\"\n    Switches off whitecapping (in command GEN3).\nBREAKING : str = \"breaking\"\n    Switches off wave breaking dissipation.\nREFRAC : str = \"refrac\"\n    Switches off wave refraction (action transport in theta space).\nFSHIFT : str = \"fshift\"\n    Switches off frequency shifting (action transport in sigma space).\nBNDCHK : str = \"bndchk\"\n    Switches off the checking of the delta imposed and computed Hs at the boundary.",
         "enum": [
            "windgrowth",
            "quadrupl",
            "wcapping",
            "breaking",
            "refrac",
            "fshift",
            "bndchk"
         ],
         "title": "PhysicsOff",
         "type": "string"
      },
      "QUADRUPL": {
         "additionalProperties": false,
         "description": "Nonlinear quadruplet wave interactions.\n\n.. code-block:: text\n\n    QUADRUPL [iquad] [lambda] [cnl4] [Csh1] [Csh2] [Csh3]\n\nWith this option the user can influence the computation of nonlinear quadruplet\nwave interactions which are usually included in the computations. Can be\nde-activated with command OFF QUAD. Note that the DIA approximation of the\nquadruplet interactions is a poor approximation for long-crested waves and\nfrequency resolutions that are deviating much more than 10% (see command CGRID).\nNote that DIA is usually updated per sweep, either semi-implicit (`iquad = 1`) or\nexplicit (`iquad = 2`). However, when ambient current is included, the bounds of\nthe directional sector within a sweep may be different for each frequency bin\n(particularly the higher frequencies are modified by the current). So there may be\nsome overlap of frequency bins between the sweeps, implying non-conservation of\nwave energy. To prevent this the user is advised to choose the integration of DIA\nper iteration instead of per sweep, i.e. `iquad = 3`. If you want to speed up your\ncomputation a bit more, than the choice `iquad = 8` is a good choice.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import QUADRUPL\n    quadrupl = QUADRUPL()\n    print(quadrupl.render())\n    kwargs = dict(\n        iquad=3, lambd=0.25, cnl4=3.0e7, csh1=5.5, csh2=0.833333, csh3=-1.25\n    )\n    quadrupl = QUADRUPL(**kwargs)\n    print(quadrupl.render())",
         "properties": {
            "model_type": {
               "default": "quadrupl",
               "description": "Model type discriminator",
               "enum": [
                  "quadrupl",
                  "QUADRUPL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "iquad": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        8,
                        4,
                        51,
                        52,
                        53
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Numerical procedures for integrating the quadruplets: 1 = semi-implicit per sweep, 2 = explicit per sweep, 3 = explicit per iteration, 8 = explicit per iteration, but with a more efficient implementation, 4 = multiple DIA, 51 = XNL (deep water transfer), 52 = XNL (deep water transfer with WAM depth scaling), 53  XNL (finite depth transfer) (SWAN default: 2)",
               "title": "Iquad"
            },
            "lambd": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for quadruplet configuration in case of DIA (SWAN default: 0.25)",
               "title": "Lambd"
            },
            "cnl4": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient for quadruplet interactions in case of DIA (SWAN default: 3.0e7",
               "title": "Cnl4"
            },
            "csh1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for shallow water scaling in case of DIA (SWAN default: 5.5)",
               "title": "Csh1"
            },
            "csh2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for shallow water scaling in case of DIA (SWAN default: 0.833333)",
               "title": "Csh2"
            },
            "csh3": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for shallow water scaling in case of DIA (SWAN default: -1.25)",
               "title": "Csh3"
            }
         },
         "title": "QUADRUPL",
         "type": "object"
      },
      "RDIFF": {
         "additionalProperties": false,
         "description": "Diffuse reflection.\n\n.. code-block:: text\n\n    RDIFF [pown]\n\nSpecular reflection where incident waves are scattered over reflected direction.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RDIFF\n    refl = RDIFF()\n    print(refl.render())\n    refl = RDIFF(pown=1.0)\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "rdiff",
               "description": "Model type discriminator",
               "enum": [
                  "rdiff",
                  "RDIFF"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "pown": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Each incoming direction \u03b8 is scattered over reflected direction \u03b8_refl according to cos^pown(\u03b8-\u03b8_refl). The parameter `pown` indicates the widthof the redistribution function (SWAN default: 1.0)",
               "title": "Pown"
            }
         },
         "title": "RDIFF",
         "type": "object"
      },
      "REFL": {
         "additionalProperties": false,
         "description": "Obstacle reflections.\n\n.. code-block:: text\n\n    REFL [reflc]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import REFL\n    refl = REFL()\n    print(refl.render())\n    refl = REFL(reflc=0.5)\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "refl",
               "description": "Model type discriminator",
               "enum": [
                  "refl",
                  "REFL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "reflc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Constant reflection coefficient (ratio of reflected over incoming significant wave height) (SWAN default: 1.0)",
               "title": "Reflc"
            }
         },
         "title": "REFL",
         "type": "object"
      },
      "RSPEC": {
         "additionalProperties": false,
         "description": "Specular reflection.\n\n.. code-block:: text\n\n    RSPEC\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RSPEC\n    refl = RSPEC()\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "rspec",
               "description": "Model type discriminator",
               "enum": [
                  "rspec",
                  "RSPEC"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "RSPEC",
         "type": "object"
      },
      "SCAT": {
         "additionalProperties": false,
         "description": "Scattering.\n\n.. code-block:: text\n\n    SCAT [iqcm] (GRID [rfac]) (TRUNC [alpha] [qmax])\n\nUsing this optional command, the user activates a source term that allows for the\ngeneration and propagation of cross correlations between scattered waves due to\nvariations in the bathymetry and mean currents. Such variations are rapid compared\nto the distancebetween the crossing waves (at the scale of 100-1000 m) and is\nparticularly relevant for cases involving narrowband waves (swells) in coastal\nregions with shallow water and ambient currents. In turn, the immediate spatial\neffects of coherent scattering, interference, refraction and diffraction can cause\nlarge-scale changes in the wave parameters.\n\nReferences\n----------\nSmit, P.B. and Janssen, T.T., 2013. The evolution of inhomogeneous wave statistics\nthrough a variable medium. Journal of Physical Oceanography, 43(8), pp.1741-1758.\n\nSmit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of\ninhomogeneous ocean waves. Ocean Modelling, 96, pp.26-35.\n\nSmit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of\ncoherent wave fields over variable depth. Journal of Physical Oceanography, 45(4),\npp.1139-1154.\n\nAkrish, G., Smit, P., Zijlema, M. and Reniers, A., 2020. Modelling statistical wave\ninterferences over shear currents. Journal of Fluid Mechanics, 891, p.A2.\n\nNotes\n-----\nImplemented in SWAN 41.41.\n\nIf both `alpha` and `qmax` options are provided to truncate the infinite\nconvolution sum their mimimum is considered as the final limit on the sum.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import SCAT\n    scat = SCAT()\n    print(scat.render())\n    scat = SCAT(iqcm=2, rfac=1.0, alpha=1.0)\n    print(scat.render())",
         "properties": {
            "model_type": {
               "default": "scat",
               "description": "Model type discriminator",
               "enum": [
                  "scat",
                  "SCAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "iqcm": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1,
                        2
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Indicates the modelling and computation of QC scattering:\n\n* 0: no scattering\n* 1: scattering due to non-uniform bathymetry and currents (the latter only if applicable; see command `INPGRID CURRENT`)\n* 2: wave-current interaction under the assumption of a slowly varying bathymetry\n\n(SWAN default: 1)",
               "title": "Iqcm"
            },
            "rfac": {
               "anyOf": [
                  {
                     "minimum": 1.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The resolution factor through which the incident spectral width ismultiplied (SWAN default: 1.0)",
               "title": "Rfac"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The coefficient by which the mean wave number is multiplied to set thelimit on the convolution sum (SWAN default: 1.0)",
               "title": "Alpha"
            },
            "qmax": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum scattering wave number (in 1/m)",
               "title": "Qmax"
            }
         },
         "title": "SCAT",
         "type": "object"
      },
      "SETUP": {
         "additionalProperties": false,
         "description": "Wave setup.\n\n.. code-block:: text\n\n    SETUP [supcor]\n\nIf this command is given, the wave-induced set-up is computed and accounted for in\nthe wave computations (during the computation it is added to the depth that is\nobtained from the `READ BOTTOM` and `READ WLEVEL` commands). This approximation in\nSWAN can only be applied to open coast (unlimited supply of water from outside the\ndomain, e.g. nearshore coasts) in contrast to closed basin, e.g. lakes and\nestuaries, where this option should not be used. Note that set-up is not computed\ncorrectly with spherical coordinates.\n\nNotes\n-----\n\n* The SETUP command cannot be used in case of unstructured grids.\n* Set-up is not supported in case of parallel runs using either MPI or OpenMP.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SETUP\n    setup = SETUP()\n    print(setup.render())\n    setup = SETUP(supcor=0.5)\n    print(setup.render())",
         "properties": {
            "model_type": {
               "default": "setup",
               "description": "Model type discriminator",
               "enum": [
                  "setup",
                  "SETUP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "supcor": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "By default the wave-induced set-up is computed with a constant added such that the set-up is zero in the deepest point in the computational grid. The user can modify this constant by the value of `supcor`. The user can thus impose a set-up in any one point (and only one) in the computational grid by first running SWAN, then reading the set-up in that point and adding or subtracting the required value of `supcor` (in m; positive if the set-up has to rise) (SWAN default: 0.0)",
               "title": "Supcor"
            }
         },
         "title": "SETUP",
         "type": "object"
      },
      "SICE": {
         "additionalProperties": false,
         "description": "Sea ice dissipation.\n\n.. code-block:: text\n\n    SICE [aice]\n\nUsing this command, the user activates a sink term to represent the dissipation of\nwave energy by sea ice. The default method is R19 empirical/parametric: a\npolynomial based on wave frequency (Rogers, 2019). This polynomial (in 1/m) has\nseven dimensional coefficients; see Scientific/Technical documentation for details.\nIf this command is not used, SWAN will not account for sea ice effects.\n\nReferences\n----------\nDoble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015.\nRelating wave attenuation to pancake ice thickness, using field measurements and\nmodel results. Geophysical Research Letters, 42(11), pp.4473-4481.\n\nMeylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and\nanalysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research\nLetters, 41(14), pp.5046-5051.\n\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of\ndissipation of energy of ocean waves by sea ice using data from Wave Array 3 of\nthe ONR \u201cSea State\u201d field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.\n\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave\nattenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science\nand Technology, 182, p.103198.\n\nNotes\n-----\nIis also necessary to describe the ice, using the `ICE` command (for uniform and\nstationary ice) or `INPGRID`/`READINP` commands (for variable ice).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE\n    sice = SICE()\n    print(sice.render())\n    sice = SICE(aice=0.5)\n    print(sice.render())\n\nTODO: Verify if the `aice` parameter should be used with SICE command, it is not\nshown in the command tree but it is described as an option in the description.",
         "properties": {
            "model_type": {
               "default": "sice",
               "description": "Model type discriminator",
               "enum": [
                  "sice",
                  "SICE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            }
         },
         "title": "SICE",
         "type": "object"
      },
      "SICE_D15": {
         "additionalProperties": false,
         "description": "Sea ice dissipation based on the method of Doble et al. (2015).\n\n.. code-block:: text\n\n    SICE [aice] D15 [chf]\n\nReferences\n----------\nDoble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015.\nRelating wave attenuation to pancake ice thickness, using field measurements and\nmodel results. Geophysical Research Letters, 42(11), pp.4473-4481.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_D15\n    sice = SICE_D15()\n    print(sice.render())\n    sice = SICE_D15(aice=0.2, chf=0.1)\n    print(sice.render())",
         "properties": {
            "model_type": {
               "default": "d15",
               "description": "Model type discriminator",
               "enum": [
                  "d15",
                  "D15"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            },
            "chf": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A simple coefficient of proportionality (SWAN default: 0.1)",
               "title": "Chf"
            }
         },
         "title": "SICE_D15",
         "type": "object"
      },
      "SICE_M18": {
         "additionalProperties": false,
         "description": "Sea ice dissipation based on the method of Meylan et al. (2018).\n\n.. code-block:: text\n\n    SICE [aice] M18 [chf]\n\nReferences\n----------\nMeylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and\nanalysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research\nLetters, 41(14), pp.5046-5051.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_M18\n    sice = SICE_M18()\n    print(sice.render())\n    sice = SICE_M18(aice=0.8, chf=0.059)\n    print(sice.render())",
         "properties": {
            "model_type": {
               "default": "m18",
               "description": "Model type discriminator",
               "enum": [
                  "m18",
                  "M18"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            },
            "chf": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A simple coefficient of proportionality (SWAN default: 0.059)",
               "title": "Chf"
            }
         },
         "title": "SICE_M18",
         "type": "object"
      },
      "SICE_R19": {
         "additionalProperties": false,
         "description": "Sea ice dissipation based on the method of Rogers et al (2019).\n\n.. code-block:: text\n\n    SICE [aice] R19 [c0] [c1] [c2] [c3] [c4] [c5] [c6]\n\nThe default options recover the polynomial of Meylan et al. (2014), calibrated for\na case of ice floes, mostly 10 to 25 m in diameter, in the marginal ice zone near\nAntarctica. Examples for other calibrations can be found in the\nScientific/Technical documentation.\n\nReferences\n----------\nMeylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and\nanalysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research\nLetters, 41(14), pp.5046-5051.\n\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of\ndissipation of energy of ocean waves by sea ice using data from Wave Array 3 of\nthe ONR \u201cSea State\u201d field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_R19\n    sice = SICE_R19()\n    print(sice.render())\n    kwargs = dict(\n        aice=0.5,\n        c0=0.0,\n        c1=0.0,\n        c2=1.06e-3,\n        c3=0.0,\n        c4=0.0,\n        c5=0.0,\n        c6=0.0,\n    )\n    sice = SICE_R19(**kwargs)\n    print(sice.render())",
         "properties": {
            "model_type": {
               "default": "r19",
               "description": "Model type discriminator",
               "enum": [
                  "r19",
                  "R19"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            },
            "c0": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in 1/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C0"
            },
            "c1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C1"
            },
            "c2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s2/m) for determining the rate of sea ice dissipation (SWAN default: 1.06E-3)",
               "title": "C2"
            },
            "c3": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s3/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C3"
            },
            "c4": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s4/m) for determining the rate of sea ice dissipation (SWAN default: 2.3E-2)",
               "title": "C4"
            },
            "c5": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s5/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C5"
            },
            "c6": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Polynomial coefficient (in s6/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
               "title": "C6"
            }
         },
         "title": "SICE_R19",
         "type": "object"
      },
      "SICE_R21B": {
         "additionalProperties": false,
         "description": "Sea ice dissipation based on the method of Rogers et al. (2021).\n\n.. code-block:: text\n\n    SICE [aice] R21B [chf] [npf]\n\nReferences\n----------\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave\nattenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science\nand Technology, 182, p.103198.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_R21B\n    sice = SICE_R21B()\n    print(sice.render())\n    sice = SICE_R21B(aice=0.8, chf=2.9, npf=4.5)\n    print(sice.render())",
         "properties": {
            "model_type": {
               "default": "r21b",
               "description": "Model type discriminator",
               "enum": [
                  "r21b",
                  "R21B"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "aice": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
               "title": "Aice"
            },
            "chf": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A simple coefficient of proportionality (SWAN default: 2.9)",
               "title": "Chf"
            },
            "npf": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the degree of dependence on frequency and ice thickness (SWAN default: 4.5)",
               "title": "Npf"
            }
         },
         "title": "SICE_R21B",
         "type": "object"
      },
      "SSWELL_ARDHUIN": {
         "additionalProperties": false,
         "description": "Nonbreaking dissipation of Ardhuin et al. (2010).\n\n.. code-block:: text\n\n    SSWELL ARDHUIN [cdsv]\n\nReferences\n----------\nArdhuin, F., Rogers, E., Babanin, A.V., Filipot, J.F., Magne, R., Roland, A.,\nVan Der Westhuysen, A., Queffeulou, P., Lefevre, J.M., Aouf, L. and Collard, F.,\n2010. Semiempirical dissipation source functions for ocean waves. Part I:\nDefinition, calibration, and validation. Journal of Physical Oceanography, 40(9),\npp.1917-1941.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SSWELL_ARDHUIN\n    sswell = SSWELL_ARDHUIN()\n    print(sswell.render())\n    sswell = SSWELL_ARDHUIN(cdsv=1.2)\n    print(sswell.render())",
         "properties": {
            "model_type": {
               "default": "ardhuin",
               "description": "Model type discriminator",
               "enum": [
                  "ardhuin",
                  "ARDHUIN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cdsv": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)",
               "title": "Cdsv"
            }
         },
         "title": "SSWELL_ARDHUIN",
         "type": "object"
      },
      "SSWELL_ROGERS": {
         "additionalProperties": false,
         "description": "Nonbreaking dissipation of Rogers et al. (2012).\n\n.. code-block:: text\n\n    SSWELL ROGERS [cdsv] [feswell]\n\nReferences\n----------\nRogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and\nwhitecapping dissipation in a model for wind-generated surface waves: Description\nand simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9),\npp.1329-1346.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SSWELL_ROGERS\n    sswell = SSWELL_ROGERS()\n    print(sswell.render())\n    sswell = SSWELL_ROGERS(cdsv=1.2, feswell=0.5)\n    print(sswell.render())",
         "properties": {
            "model_type": {
               "default": "rogers",
               "description": "Model type discriminator",
               "enum": [
                  "rogers",
                  "ROGERS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cdsv": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)",
               "title": "Cdsv"
            },
            "feswell": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Swell dissipation factor",
               "title": "Feswell"
            }
         },
         "title": "SSWELL_ROGERS",
         "type": "object"
      },
      "SSWELL_ZIEGER": {
         "additionalProperties": false,
         "description": "Nonbreaking dissipation of Zieger et al. (2015).\n\n.. code-block:: text\n\n    SSWELL ZIEGER [b1]\n\nSwell dissipation of Young et al. (2013) updated by Zieger et al. (2015). The\nZieger option is intended for use with negative wind input via the NEGATINP\ncommand. Zieger non-breaking dissipation follows the method used in WAVEWATCH III\nversion 4 and does not include the steepness-dependent swell coefficient introduced\nin WAVEWATCH III version 5.\n\nReferences\n----------\nZieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based\nsource terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96,\npp.2-25.\n\nYoung, I.R., Babanin, A.V. and Zieger, S., 2013. The decay rate of ocean swell\nobserved by altimeter. Journal of physical oceanography, 43(11), pp.2322-2333.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SSWELL_ZIEGER\n    sswell = SSWELL_ZIEGER()\n    print(sswell.render())\n    sswell = SSWELL_ZIEGER(b1=0.00025)\n    print(sswell.render())",
         "properties": {
            "model_type": {
               "default": "zieger",
               "description": "Model type discriminator",
               "enum": [
                  "zieger",
                  "ZIEGER"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "b1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Non-dimensional proportionality coefficient (SWAN default: 0.00025)",
               "title": "B1"
            }
         },
         "title": "SSWELL_ZIEGER",
         "type": "object"
      },
      "ST6": {
         "additionalProperties": false,
         "description": "St6 source terms subcomponent.\n\n.. code-block:: text\n\n    ST6 [a1sds] [a2sds] [p1sds] [p2sds] UP|DOWN HWANG|FAN|ECMWF VECTAU|SCATAU &\n        TRUE10|U10PROXY [windscaling] DEBIAS [cdfac] (AGROW [a])\n\nwind input and whitecapping from Rogers et al. (2012) (RBW12).\n\nNotes\n-----\nThe two arguments are specified in the Appendix C of the User manual but not in the\ncommand description for WESTH in Section 4.5.4. They are also options in the\nWCAPPING command. It is not entirely clear if they should/could be specified here.\n\nReferences\n----------\nFan, Y., Lin, S.J., Held, I.M., Yu, Z. and Tolman, H.L., 2012. Global ocean surface\nwave simulation using a coupled atmosphere\u2013wave model. Journal of Climate, 25(18),\npp.6233-6252.\n\nRogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and\nwhitecapping dissipation in a model for wind-generated surface waves: Description\nand simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9),\npp.1329-1346.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6\n    st6 = ST6(a1sds=4.7e-7, a2sds=6.6e-6)\n    print(st6.render())\n    kwargs = dict(\n        a1sds=2.8e-6,\n        a2sds=3.5e-5,\n        normalization=\"up\",\n        wind_drag=\"hwang\",\n        tau=\"vectau\",\n        u10=\"u10proxy\",\n        windscaling=32.0,\n        cdfac=0.89,\n        agrow=True,\n        a=0.0015,\n    )\n    st6 = ST6(**kwargs)\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6",
               "default": "st6",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "description": "Coefficient related to local dissipation term T1 (a1 in RBW12)",
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "description": "Coefficient related to local dissipation term T2 (a2 in RBW12)",
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power coefficient controlling strength of dissipation term T1 (L in RBW12, SWAN default: 4)",
               "title": "P1Sds"
            },
            "p2sds": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power coefficient controlling strength of dissipation term T2 (M in RBW12, SWAN default: 4)",
               "title": "P2Sds"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 32.0,
               "description": "Factor to scale U10 with U* when using U10PROXY",
               "title": "Windscaling"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "required": [
            "a1sds",
            "a2sds"
         ],
         "title": "ST6",
         "type": "object"
      },
      "ST6C1": {
         "additionalProperties": false,
         "description": "First ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C1\n    st6 = ST6C1()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c1",
               "default": "st6c1",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 4.7e-07,
               "default": 4.7e-07,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 6.6e-06,
               "default": 6.6e-06,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 28.0,
               "default": 28.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "title": "ST6C1",
         "type": "object"
      },
      "ST6C2": {
         "additionalProperties": false,
         "description": "Second ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP FAN VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C2\n    st6 = ST6C2()\n    print(st6.render())\n\nTODO: Ensure validator is reused here so fan and debias are not used together.",
         "properties": {
            "model_type": {
               "const": "st6c2",
               "default": "st6c2",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "const": "fan",
               "default": "fan",
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 4.7e-07,
               "default": 4.7e-07,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 6.6e-06,
               "default": 6.6e-06,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 28.0,
               "default": 28.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "title": "ST6C2",
         "type": "object"
      },
      "ST6C3": {
         "additionalProperties": false,
         "description": "Third ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C3\n    st6 = ST6C3()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c3",
               "default": "st6c3",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 2.8e-06,
               "default": 2.8e-06,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 3.5e-05,
               "default": 3.5e-05,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 32.0,
               "default": 32.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "title": "ST6C3",
         "type": "object"
      },
      "ST6C4": {
         "additionalProperties": false,
         "description": "Fourth ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 DEBIAS 0.89 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C4\n    st6 = ST6C4()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c4",
               "default": "st6c4",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 2.8e-06,
               "default": 2.8e-06,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 3.5e-05,
               "default": 3.5e-05,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 32.0,
               "default": 32.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "const": 0.89,
               "default": 0.89,
               "title": "Cdfac",
               "type": "number"
            }
         },
         "title": "ST6C4",
         "type": "object"
      },
      "ST6C5": {
         "additionalProperties": false,
         "description": "Fifth ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C5\n    st6 = ST6C5()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c5",
               "default": "st6c5",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 6.5e-06,
               "default": 6.5e-06,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 8.5e-05,
               "default": 8.5e-05,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 35.0,
               "default": 35.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "const": 0.89,
               "default": 0.89,
               "title": "Cdfac",
               "type": "number"
            }
         },
         "title": "ST6C5",
         "type": "object"
      },
      "SURFBEAT": {
         "additionalProperties": false,
         "description": "Surfbeat.\n\n.. code-block:: text\n\n    SURFBEAT [df] [nmax] [emin] UNIFORM/LOGARITHMIC\n\nUsing this optional command, the user activates the Infragravity Energy Module\n(IEM) of Reniers and Zijlema (2022). Besides the energy balance equation for a\nsea-swell wave field, another energy balance is included to account for the\ntransfer of sea-swell energy to the bound infragravity (BIG) wave. This\ninfragravity energy balance also involves a nonlinear transfer, expressed by the\nbiphase, through the phase coupling between the radiation stress forcing and the\nBIG wave. For the prediction of the biphase for obliquely incident waves, an\nevolution equation is provided under the assumption that the bottom slopes are mild\nand alongshore uniform.\n\nReferences\n----------\nReniers, A. and Zijlema, M., 2022. Swan surfbeat-1d. Coastal Engineering, 172,\np.104068.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import SURFBEAT\n    surfbeat = SURFBEAT()\n    print(surfbeat.render())\n    surfbeat = SURFBEAT(df=0.01, nmax=50000, emin=0.05, spacing=\"logarithmic\")\n    print(surfbeat.render())",
         "properties": {
            "model_type": {
               "default": "surfbeat",
               "description": "Model type discriminator",
               "enum": [
                  "surfbeat",
                  "SURFBEAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "df": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The constant size of BIG frequency bin (in Hz) (SWAN default: 0.01)",
               "title": "Df"
            },
            "nmax": {
               "anyOf": [
                  {
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of short-wave pairs for creating bichromatic wave groups (SWAN default: 50000)",
               "title": "Nmax"
            },
            "emin": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The energy threshold in fraction of energy spectrum peak. With this threshold one takes into account those short wave components to create bichromatic wave groups while their energy levels are larger than `emin x E_max` with `E_max` the peak of the spectrum (SWAN default: 0.05)",
               "title": "Emin"
            },
            "spacing": {
               "anyOf": [
                  {
                     "enum": [
                        "uniform",
                        "logarithmic"
                     ],
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Define if frequencies for reflected ig waves are uniformly or logarithmically distributed",
               "title": "Spacing"
            }
         },
         "title": "SURFBEAT",
         "type": "object"
      },
      "TRANS1D": {
         "additionalProperties": false,
         "description": "Frequency dependent transmission.\n\n.. code-block:: text\n\n    TRANS1D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS1D\n    transm = TRANS1D(trcoef=[0.0, 0.0, 0.2, 0.5, 0.2, 0.0, 0.0])\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "trans1d",
               "description": "Model type discriminator",
               "enum": [
                  "trans1d",
                  "TRANS1D"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency. The number of these transmission values must be equal to the number of frequencies, i.e. `msc` + 1",
               "items": {
                  "maximum": 1.0,
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Trcoef",
               "type": "array"
            }
         },
         "required": [
            "trcoef"
         ],
         "title": "TRANS1D",
         "type": "object"
      },
      "TRANS2D": {
         "additionalProperties": false,
         "description": "Frequency-direction dependent transmission.\n\n.. code-block:: text\n\n    TRANS2D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS2D\n    trcoef = np.array([[0.0, 0.0], [0.1, 0.1], [0.2, 0.2]])\n    transm = TRANS2D(trcoef=trcoef)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "trans2d",
               "description": "Model type discriminator",
               "enum": [
                  "trans2d",
                  "TRANS2D"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency and direction, rows represent directions and columns represent frequencies",
               "properties": {
                  "data_type": {
                     "default": "Any",
                     "title": "dtype",
                     "type": "string"
                  },
                  "data": {
                     "items_schema": {
                        "items_schema": {
                           "type": "any"
                        },
                        "type": "list"
                     },
                     "max_length": 2,
                     "min_length": 2,
                     "type": "list"
                  }
               },
               "required": [
                  "data_type",
                  "data"
               ],
               "title": "Numpy Array",
               "type": "np.ndarray[tuple[int, int], np.dtype[Any]]"
            }
         },
         "required": [
            "trcoef"
         ],
         "title": "TRANS2D",
         "type": "object"
      },
      "TRANSM": {
         "additionalProperties": false,
         "description": "Constant transmission coefficient.\n\n.. code-block:: text\n\n    TRANSM [trcoef]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANSM\n    transm = TRANSM()\n    print(transm.render())\n    transm = TRANSM(trcoef=0.5)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "transm",
               "description": "Model type discriminator",
               "enum": [
                  "transm",
                  "TRANSM"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Constant transmission coefficient (ratio of transmitted over incoming significant wave height) (SWAN default: 0.0) (no transmission = complete blockage)",
               "title": "Trcoef"
            }
         },
         "title": "TRANSM",
         "type": "object"
      },
      "TRIAD": {
         "additionalProperties": false,
         "description": "Wave triad interactions.\n\n.. code-block:: text\n\n    TRIAD [itriad] [trfac] [cutfr] [a] [b] [urcrit] [urslim]\n\nWith this command the user can activate the triad wave-wave interactions. If this\ncommand is not used, SWAN will not account for triads.\n\nNote\n----\nThis is the TRIAD specification in SWAN < 41.45.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD\n    triad = TRIAD()\n    print(triad.render())\n    triad = TRIAD(\n        itriad=1,\n        trfac=0.8,\n        cutfr=2.5,\n        a=0.95,\n        b=-0.75,\n        ucrit=0.2,\n        urslim=0.01,\n    )\n    print(triad.render())",
         "properties": {
            "model_type": {
               "default": "triad",
               "description": "Model type discriminator",
               "enum": [
                  "triad",
                  "TRIAD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "itriad": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Approximation method for the triad computation: \n\n* 1: the LTA method of Eldeberky (1996) \n* 2: the SPB method of Becq-Girard et al. (1999) (SWAN default: 1)",
               "title": "Itriad"
            },
            "trfac": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient (SWAN default: 0.8 in case of LTA method, 0.9 in case of SPB method)",
               "title": "Trfac"
            },
            "cutfr": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the maximum frequency that is considered in the LTA computation. The value of `cutfr` is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)",
               "title": "Cutfr"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: 0.95)",
               "title": "A"
            },
            "b": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: -0.75 for 1D, 0.0 for 2D",
               "title": "B"
            },
            "ucrit": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The critical Ursell number appearing in the expression for the biphase (SWAN default: 0.2)",
               "title": "Ucrit"
            },
            "urslim": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The lower threshold for Ursell number, if the actual Ursell number is below this value triad interactions are be computed (SWAN default: 0.01)",
               "title": "Urslim"
            }
         },
         "title": "TRIAD",
         "type": "object"
      },
      "TRIAD_DCTA": {
         "additionalProperties": false,
         "description": "Triad interactions with the DCTA method of Booij et al. (2009).\n\n.. code-block:: text\n\n    TRIAD DCTA [trfac] [p] COLL|NONC BIPHHASE ELDEBERKY|DEWIT\n\nReferences\n----------\nBooij, N., Holthuijsen, L.H. and B\u00e9nit, M.P., 2009. A distributed collinear triad\napproximation in SWAN. In Proceedings Of Coastal Dynamics 2009: Impacts of Human\nActivities on Dynamic Coastal Processes (With CD-ROM) (pp. 1-10).\n\nNote\n----\nThis is the default method to compute the triad interactions in SWAN >= 41.45, it\nis not supported in earlier versions of the model.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD_DCTA\n    triad = TRIAD_DCTA()\n    print(triad.render())\n    triad = TRIAD_DCTA(\n        trfac=4.4,\n        p=1.3,\n        noncolinear=True,\n        biphase={\"model_type\": \"dewit\", \"lpar\": 0.0},\n    )\n    print(triad.render())",
         "properties": {
            "model_type": {
               "default": "dcta",
               "description": "Model type discriminator",
               "enum": [
                  "dcta",
                  "DCTA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trfac": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scaling factor that controls the intensity of the triad interaction due to DCTA (SWAN default: 4.4)",
               "title": "Trfac"
            },
            "p": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape coefficient to force the high-frequency tail(SWAN default: 4/3)",
               "title": "P"
            },
            "noncolinear": {
               "default": false,
               "description": "If True, the noncolinear triad interactions with the DCTA framework are accounted for",
               "title": "Noncolinear",
               "type": "boolean"
            },
            "biphase": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ELDEBERKY"
                  },
                  {
                     "$ref": "#/$defs/DEWIT"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)",
               "title": "Biphase"
            }
         },
         "title": "TRIAD_DCTA",
         "type": "object"
      },
      "TRIAD_LTA": {
         "additionalProperties": false,
         "description": "Triad interactions with the LTA method of Eldeberky (1996).\n\n.. code-block:: text\n\n    TRIAD LTA [trfac] [cutfr] BIPHHASE ELDEBERKY|DEWIT\n\nReferences\n----------\nEldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for\nmodeling triad interactions in dispersive waves. In Coastal Engineering 1996\n(pp. 1088-1101).\n\nNote\n----\nThis method to compute the triad interactions is only supported in SWAN >= 41.45.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD_LTA\n    triad = TRIAD_LTA()\n    print(triad.render())\n    triad = TRIAD_LTA(\n        trfac=0.8,\n        cutfr=2.5,\n        biphase={\"model_type\": \"eldeberky\", \"urcrit\": 0.63},\n    )\n    print(triad.render())",
         "properties": {
            "model_type": {
               "default": "lta",
               "description": "Model type discriminator",
               "enum": [
                  "lta",
                  "LTA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trfac": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scaling factor that controls the intensity of the triad interaction due to LTA (SWAN default: 0.8)",
               "title": "Trfac"
            },
            "cutfr": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the maximum frequency that is considered in the LTA computation. The value of `cutfr` is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)",
               "title": "Cutfr"
            },
            "biphase": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ELDEBERKY"
                  },
                  {
                     "$ref": "#/$defs/DEWIT"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)",
               "title": "Biphase"
            }
         },
         "title": "TRIAD_LTA",
         "type": "object"
      },
      "TRIAD_SPB": {
         "additionalProperties": false,
         "description": "Triad interactions with the SPB method of Becq-Girard et al. (1999).\n\n.. code-block:: text\n\n    TRIAD SPB [trfac] [a] [b] BIPHHASE ELDEBERKY|DEWIT\n\nReferences\n----------\nBecq-Girard, F., Forget, P. and Benoit, M., 1999. Non-linear propagation of\nunidirectional wave fields over varying topography. Coastal Engineering, 38(2),\npp.91-113.\n\nNote\n----\nThis method to compute the triad interactions is only supported in SWAN >= 41.45.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD_SPB\n    triad = TRIAD_SPB()\n    print(triad.render())\n    triad = TRIAD_SPB(\n        trfac=0.9,\n        a=0.95,\n        b=0.0,\n        biphase={\"model_type\": \"eldeberky\", \"urcrit\": 0.63},\n    )\n    print(triad.render())",
         "properties": {
            "model_type": {
               "default": "spb",
               "description": "Model type discriminator",
               "enum": [
                  "spb",
                  "SPB"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trfac": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scaling factor that controls the intensity of the triad interaction due to SPB (SWAN default: 0.9)",
               "title": "Trfac"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is 0.95 and is calibrated by means of laboratory experiments (SWAN default: 0.95)",
               "title": "A"
            },
            "b": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is -0.75 and is calibrated by means of laboratory experiments. However, it may not be appropriate for true 2D field cases as it does not scale with the wave field characteristics. Hence, this parameter is set to zero (SWAN default: 0.0)",
               "title": "B"
            },
            "biphase": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/ELDEBERKY"
                  },
                  {
                     "$ref": "#/$defs/DEWIT"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)",
               "title": "Biphase"
            }
         },
         "title": "TRIAD_SPB",
         "type": "object"
      },
      "TURBULENCE": {
         "additionalProperties": false,
         "description": "Turbulent viscosity.\n\n.. code-block:: text\n\n    TURBULENCE [ctb] (CURRENT [tbcur])\n\nWith this optional command the user can activate turbulent viscosity. This physical\neffect is also activated by reading values of the turbulent viscosity using the\n`READGRID TURB` command, but then with the default value of `ctb`. The command\n`READGRID TURB` is necessary if this command `TURB` is used since the value of the\nviscosity is assumed to vary over space.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TURBULENCE\n    turbulence = TURBULENCE(current=False)\n    print(turbulence.render())\n    turbulence = TURBULENCE(ctb=0.01, current=True, tbcur=0.004)\n    print(turbulence.render())",
         "properties": {
            "model_type": {
               "default": "turbulence",
               "description": "Model type discriminator",
               "enum": [
                  "turbulence",
                  "TURBULENCE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "ctb": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The value of the proportionality coefficient appearing in the energy dissipation term (SWAN default: 0.01)",
               "title": "Ctb"
            },
            "current": {
               "anyOf": [
                  {
                     "type": "boolean"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": true,
               "description": "If this keyword is present the turbulent viscosity will be derived from the product of the depth and the absolute value of the current velocity. If the command `READGRID TURB` is used, this option is ignored; the values read from file will prevail",
               "title": "Current"
            },
            "tbcur": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The factor by which depth x current velocity is multiplied in order to get the turbulent viscosity (SWAN default: 0.004)",
               "title": "Tbcur"
            }
         },
         "title": "TURBULENCE",
         "type": "object"
      },
      "VEGETATION": {
         "additionalProperties": false,
         "description": "Vegetation dumping.\n\n.. code-block:: text\n\n    VEGETATION [iveg] < [height] [diamtr] [nstems] [drag] >\n\nWith this command the user can activate wave damping due to vegetation based on the\nDalrymple's formula (1984) as implemented by Suzuki et al. (2011). This damping is\nuniform over the wave frequencies. An alternative is the frequency-dependent\n(canopy) dissipation model of Jacobsen et al. (2019). If this command is not used,\nSWAN will not account for vegetation effects.\n\nThe vegetation (rigid plants) can be divided over a number of vertical segments and\nso, the possibility to vary the vegetation vertically is included. Each vertical\nlayer represents some characteristics of the plants. These variables as indicated\nbelow can be repeated as many vertical layers to be chosen.\n\nReferences\n----------\nDalrymple, R.A., Kirby, J.T. and Hwang, P.A., 1984. Wave diffraction due to areas\nof energy dissipation. Journal of waterway, port, coastal, and ocean engineering,\n110(1), pp.67-79.\n\nJacobsen, N.G., Bakker, W., Uijttewaal, W.S. and Uittenbogaard, R., 2019.\nExperimental investigation of the wave-induced motion of and force distribution\nalong a flexible stem. Journal of Fluid Mechanics, 880, pp.1036-1069.\n\nSuzuki, T., Zijlema, M., Burger, B., Meijer, M.C. and Narayan, S., 2012. Wave\ndissipation by vegetation with layer schematization in SWAN. Coastal Engineering,\n59(1), pp.64-71.\n\nNotes\n-----\nVertical layering of the vegetation is not yet implemented for the\nJacobsen et al. (2019) method.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import VEGETATION\n    # Single layer\n    vegetation = VEGETATION(\n        height=1.2,\n        diamtr=0.1,\n        drag=0.5,\n        nstems=10,\n    )\n    print(vegetation.render())\n    # 2 vertical layers\n    vegetation = VEGETATION(\n        iveg=1,\n        height=[1.2, 0.8],\n        diamtr=[0.1, 0.1],\n        drag=[0.5, 0.5],\n        nstems=[10, 5],\n    )\n    print(vegetation.render())",
         "properties": {
            "model_type": {
               "default": "vegetation",
               "description": "Model type discriminator",
               "enum": [
                  "vegetation",
                  "VEGETATION"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "iveg": {
               "default": 1,
               "description": "Indicates the method for the vegetation computation (SWAN default: 1):\n\n* 1: Suzuki et al. (2011)\n* 2: Jacobsen et al. (2019)\n",
               "enum": [
                  1,
                  2
               ],
               "title": "Iveg",
               "type": "integer"
            },
            "height": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  }
               ],
               "description": "The plant height per layer (in m)",
               "title": "Height"
            },
            "diamtr": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  }
               ],
               "description": "The diameter of each plant stand per layer (in m)",
               "title": "Diamtr"
            },
            "drag": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "items": {
                        "type": "number"
                     },
                     "type": "array"
                  }
               ],
               "description": "The drag coefficient per layer",
               "title": "Drag"
            },
            "nstems": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "items": {
                        "type": "integer"
                     },
                     "type": "array"
                  }
               ],
               "default": 1,
               "description": "The number of plant stands per square meter for each layer. Note that `nstems` is allowed to vary over the computational region to account for the zonation of vegetation. In that case use the commands `IMPGRID NPLANTS` and `READINP NPLANTS` to define and read the vegetation density. The (vertically varying) value of `nstems` in this command will be multiplied by this horizontally varying plant density (SWAN default: 1)",
               "title": "Nstems"
            }
         },
         "required": [
            "height",
            "diamtr",
            "drag"
         ],
         "title": "VEGETATION",
         "type": "object"
      },
      "WCAPPING_AB": {
         "additionalProperties": false,
         "description": "Whitecapping according to Alves and Banner (2003).\n\n.. code-block:: text\n\n    WCAPPING AB [cds2] [br] CURRENT [cds3]\n\nReferences\n----------\nAlves, J.H.G. and Banner, M.L., 2003. Performance of a saturation-based\ndissipation-rate source term in modeling the fetch-limited evolution of wind waves.\nJournal of Physical Oceanography, 33(6), pp.1274-1298.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import WCAPPING_AB\n    wcapping = WCAPPING_AB()\n    print(wcapping.render())\n    wcapping = WCAPPING_AB(cds2=5.0e-5, br=1.75e-3, current=True, cds3=0.8)\n    print(wcapping.render())",
         "properties": {
            "model_type": {
               "default": "ab",
               "description": "Model type discriminator",
               "enum": [
                  "ab",
                  "AB"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5)",
               "title": "Cds2"
            },
            "br": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Threshold saturation level\t(SWAN default: 1.75e-3)",
               "title": "Br"
            },
            "current": {
               "default": false,
               "description": "Indicates that enhanced current-induced dissipation as proposed by Van der Westhuysen (2012) is to be added",
               "title": "Current",
               "type": "boolean"
            },
            "cds3": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient (SWAN default: 0.8)",
               "title": "Cds3"
            }
         },
         "title": "WCAPPING_AB",
         "type": "object"
      },
      "WCAPPING_KOMEN": {
         "additionalProperties": false,
         "description": "Whitecapping according to Komen (1984).\n\n.. code-block:: text\n\n    WCAPPING KOMEN [cds2] [stpm] [powst] [delta] [powk]\n\nNotes\n-----\nThe SWAN default for `delta` has been changed since version 40.91A. The setting\n`delta = 1` will improve the prediction of the wave energy at low frequencies, and\nhence the mean wave period. The original default was `delta = 0`, which corresponds\nto WAM Cycle 3. See the Scientific/Technical documentation for further details.\n\nReferences\n----------\nKomen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully\ndeveloped wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import WCAPPING_KOMEN\n    wcapping = WCAPPING_KOMEN()\n    print(wcapping.render())\n    wcapping = WCAPPING_KOMEN(cds2=2.36e-5, stpm=3.02e-3, powst=2, delta=1, powk=2)\n    print(wcapping.render())",
         "properties": {
            "model_type": {
               "default": "komen",
               "description": "Model type discriminator",
               "enum": [
                  "komen",
                  "KOMEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for determining the rate of whitecapping dissipation ($Cds$) (SWAN default: 2.36e-5)",
               "title": "Cds2"
            },
            "stpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Value of the wave steepness for a Pierson-Moskowitz spectrum ($s^2_{PM}$) (SWAN default: 3.02e-3)",
               "title": "Stpm"
            },
            "powst": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power of steepness normalized with the wave steepness of a Pierson-Moskowitz spectrum (SWAN default: 2)",
               "title": "Powst"
            },
            "delta": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient which determines the dependency of the whitecapping on wave number (SWAN default: 1)",
               "title": "Delta"
            },
            "powk": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "power of wave number normalized with the mean wave number (SWAN default: 1)",
               "title": "Powk"
            }
         },
         "title": "WCAPPING_KOMEN",
         "type": "object"
      },
      "WESTHUYSEN": {
         "additionalProperties": false,
         "description": "Westhuysen source terms subcomponent.\n\n.. code-block:: text\n\n    WESTHUYSEN [cds2] [br] (AGROW [a])\n\nNonlinear saturation-based whitecapping combined with wind input of Yan (1987).\n\nNotes\n-----\nThe two arguments are specified in the Appendix C of the User manual but not in the\ncommand description for WESTH in Section 4.5.4. They are also options in the\nWCAPPING command. It is not entirely clear if they should/could be specified here.\n\nReferences\n----------\nvan der Westhuysen, A.J., Zijlema, M. and Battjes, J.A., 2007. Nonlinear\nsaturation-based whitecapping dissipation in SWAN for deep and shallow water.\nCoastal Engineering, 54(2), pp.151-170.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import WESTHUYSEN\n    westhuysen = WESTHUYSEN()\n    print(westhuysen.render())\n    westhuysen = WESTHUYSEN(cds2=5.0e-5, br=1.75e-3)\n    print(westhuysen.render())",
         "properties": {
            "model_type": {
               "default": "westhuysen",
               "description": "Model type discriminator",
               "enum": [
                  "westhuysen",
                  "WESTHUYSEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "wu",
               "description": "Indicates the wind drag formulation",
               "enum": [
                  "wu",
                  "fit"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5).",
               "title": "Cds2"
            },
            "br": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Threshold saturation level\t(SWAN default: 1.75e-3)",
               "title": "Br"
            }
         },
         "title": "WESTHUYSEN",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
field bragg: BRAGG | BRAGG_FT | BRAGG_FILE | None = None
Validated by:
field breaking: BREAKING_CONSTANT | BREAKING_BKD | None = None
Validated by:
field deactivate: OFFS | None = None
Validated by:
field diffraction: DIFFRACTION | None = None
Validated by:
field friction: FRICTION_JONSWAP | FRICTION_COLLINS | FRICTION_MADSEN | FRICTION_RIPPLES | None = None
Validated by:
field gen: GEN1 | GEN2 | GEN3 | None = None
Validated by:
field limiter: LIMITER | None = None
Validated by:
field model_type: Literal['physics', 'PHYSICS'] = 'physics'

Model type discriminator

Validated by:
field mud: MUD | None = None
Validated by:
field negatinp: NEGATINP | None = None
Validated by:
field obstacle: OBSTACLES | None = None
Validated by:
field quadrupl: QUADRUPL | None = None
Validated by:
field scat: SCAT | None = None
Validated by:
field setup: SETUP | None = None
Validated by:
field sice: SICE | SICE_R19 | SICE_D15 | SICE_M18 | SICE_R21B | None = None
Validated by:
field sswell: SSWELL_ROGERS | SSWELL_ARDHUIN | SSWELL_ZIEGER | None = None
Validated by:
field surfbeat: SURFBEAT | None = None
Validated by:
field triad: TRIAD | TRIAD_DCTA | TRIAD_LTA | TRIAD_SPB | None = None
Validated by:
field turbulence: TURBULENCE | None = None
Validated by:
field vegetation: VEGETATION | None = None
Validated by:
field wcapping: WCAPPING_KOMEN | WCAPPING_AB | None = None
Validated by:
cmd()[source]

Return the string or list of strings to render the component to the CMD.

validator deactivate_physics  »  deactivate[source]

Convert OFF to OFFS so list is rendered.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator negatinp_only_with_zieger  »  all fields[source]

Log a warning if NEGATINP is used with a non-ZIEGER SSWELL.

render(*args, **kwargs) str

Override base class to allow rendering list of components.

pydantic model rompy.swan.components.group.STARTUP[source]

Startup group component.

PROJECT ...
SET ...
MODE ...
COORDINATES ...

This group component is used to group individual startup components. Only fields that are explicitly prescribed are rendered by this group component.

Examples

In [1]: from rompy.swan.components.startup import PROJECT, SET, MODE, COORDINATES

In [2]: from rompy.swan.components.group import STARTUP

In [3]: proj = PROJECT(nr="01")

In [4]: set = SET(level=0.5, direction_convention="nautical")

In [5]: mode = MODE(kind="nonstationary", dim="twodimensional")

In [6]: coords = COORDINATES(kind=dict(model_type="spherical", projection="ccm"))

In [7]: startup = STARTUP(
   ...:     project=proj,
   ...:     set=set,
   ...:     mode=mode,
   ...:     coordinates=coords,
   ...: )
   ...: 

In [8]: print(startup.render())
PROJECT nr='01'

SET level=0.5 NAUTICAL

MODE NONSTATIONARY TWODIMENSIONAL

COORDINATES SPHERICAL CCM

Show JSON schema
{
   "title": "STARTUP",
   "description": "Startup group component.\n\n.. code-block:: text\n\n    PROJECT ...\n    SET ...\n    MODE ...\n    COORDINATES ...\n\nThis group component is used to group individual startup components. Only fields\nthat are explicitly prescribed are rendered by this group component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import PROJECT, SET, MODE, COORDINATES\n    from rompy.swan.components.group import STARTUP\n    proj = PROJECT(nr=\"01\")\n    set = SET(level=0.5, direction_convention=\"nautical\")\n    mode = MODE(kind=\"nonstationary\", dim=\"twodimensional\")\n    coords = COORDINATES(kind=dict(model_type=\"spherical\", projection=\"ccm\"))\n    startup = STARTUP(\n        project=proj,\n        set=set,\n        mode=mode,\n        coordinates=coords,\n    )\n    print(startup.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "startup",
         "description": "Model type discriminator",
         "enum": [
            "startup",
            "STARTUP"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "project": {
         "anyOf": [
            {
               "$ref": "#/$defs/PROJECT",
               "description": "Project component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "set": {
         "anyOf": [
            {
               "$ref": "#/$defs/SET",
               "description": "Set component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "mode": {
         "anyOf": [
            {
               "$ref": "#/$defs/MODE",
               "description": "Mode component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "coordinates": {
         "anyOf": [
            {
               "$ref": "#/$defs/COORDINATES",
               "description": "Coordinates component"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      }
   },
   "$defs": {
      "CARTESIAN": {
         "additionalProperties": false,
         "description": "Cartesian coordinates.\n\n.. code-block:: text\n\n    CARTESIAN\n\nAll locations and distances are in m. Coordinates are given with respect\nto x- and y-axes chosen by the user in the various commands.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import CARTESIAN\n    coords = CARTESIAN()\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "cartesian",
               "description": "Model type discriminator",
               "enum": [
                  "cartesian",
                  "CARTESIAN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "CARTESIAN",
         "type": "object"
      },
      "COORDINATES": {
         "additionalProperties": false,
         "description": "SWAN Coordinates.\n\n.. code-block:: text\n\n    COORDINATES ->CARTESIAN|SPHERICAL REPEATING\n\nCommand to choose between Cartesian and spherical coordinates (see Section 2.5).\nA nested SWAN run must use the same coordinate system as the coarse grid SWAN run.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import COORDINATES\n    coords = COORDINATES()\n    print(coords.render())\n    coords = COORDINATES(\n        kind=dict(model_type=\"spherical\", projection=\"ccm\"),\n        reapeating=True,\n    )\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "coordinates",
               "description": "Model type discriminator",
               "enum": [
                  "coordinates",
                  "COORDINATES"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "kind": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/CARTESIAN"
                  },
                  {
                     "$ref": "#/$defs/SPHERICAL"
                  }
               ],
               "description": "Coordinates kind",
               "title": "Kind"
            },
            "reapeating": {
               "default": false,
               "description": "This option is only for academic cases. It means that wave energy leaving at one end of the domain (in computational x-direction) enter at the other side; it is as if the wave field repeats itself in x-direction with the length of the domain in x-direction. This option cannot be used in combination with computation of set-up (see command SETUP). This option is available only with regular grids",
               "title": "Reapeating",
               "type": "boolean"
            }
         },
         "title": "COORDINATES",
         "type": "object"
      },
      "MODE": {
         "additionalProperties": false,
         "description": "SWAN Mode.\n\n.. code-block:: text\n\n    MODE ->STATIONARY|NONSTATIONARY ->TWODIMENSIONAL|ONEDIMENSIONAL\n\nWith this optional command the user indicates that the run will be either\nstationary or nonstationary and one-dimensional (1D-mode) or two-dimensional\n(2D-mode). Nonstationary means either (see command COMPUTE):\n\n* (a) one nonstationary computations or\n* (b) a sequence of stationary computations or\n* (c) a mix of (a) and (b)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import MODE\n    mode = MODE()\n    print(mode.render())\n    mode = MODE(kind=\"nonstationary\", dim=\"twodimensional\")\n    print(mode.render())",
         "properties": {
            "model_type": {
               "default": "mode",
               "description": "Model type discriminator.",
               "enum": [
                  "mode",
                  "MODE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "kind": {
               "default": "stationary",
               "description": "Indicates if run will be stationary or nonstationary",
               "enum": [
                  "stationary",
                  "nonstationary"
               ],
               "title": "Kind",
               "type": "string"
            },
            "dim": {
               "default": "twodimensional",
               "description": "Indicates that the run will be either one-dimensional (1D-mode) or two-dimensional (2D-mode)",
               "enum": [
                  "onedimensional",
                  "twodimensional"
               ],
               "title": "Dim",
               "type": "string"
            }
         },
         "title": "MODE",
         "type": "object"
      },
      "PROJECT": {
         "additionalProperties": false,
         "description": "SWAN Project.\n\n.. code-block:: text\n\n    PROJECT 'name' 'nr' 'title' 'title2 'title3'\n\nWith this required command the user defines a number of strings to identify the\nSWAN run (project name e.g., an engineering project) in the print and plot file.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import PROJECT\n    proj = PROJECT(nr=\"01\")\n    print(proj.render())\n    proj = PROJECT(\n        name=\"waus\",\n        nr=\"001\",\n        title1=\"Western Australia\",\n        title2=\"Perth Nest\"\n    )\n    print(proj.render())",
         "properties": {
            "model_type": {
               "default": "project",
               "description": "Model type discriminator",
               "enum": [
                  "project",
                  "PROJECT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "name": {
               "anyOf": [
                  {
                     "maxLength": 16,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Is the name of the project, at most 16 characters long",
               "title": "Name"
            },
            "nr": {
               "description": "Is the run identification (to be provided as a character string; e.g. the run number) to distinguish this run among other runs for the same project; it is at most 4 characters long. It is the only required information in this command.",
               "maxLength": 4,
               "title": "Nr",
               "type": "string"
            },
            "title1": {
               "anyOf": [
                  {
                     "maxLength": 72,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A string of at most 72 characters provided by the user to appear in the output of the program for the user's convenience (SWAN default: blanks)",
               "title": "Title1"
            },
            "title2": {
               "anyOf": [
                  {
                     "maxLength": 72,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Same as 'title1'",
               "title": "Title2"
            },
            "title3": {
               "anyOf": [
                  {
                     "maxLength": 72,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Same as 'title1'",
               "title": "Title3"
            }
         },
         "required": [
            "nr"
         ],
         "title": "PROJECT",
         "type": "object"
      },
      "SET": {
         "additionalProperties": false,
         "description": "SWAN setting commands.\n\n.. code-block:: text\n\n    SET [level] [nor] [depmin] [maxmes] [maxerr] [grav] [rho] [cdcap] &\n        [inrhog] [hsrerr] NAUTICAL|->CARTESIAN [pwtail] [froudmax] [icewind]\n\nWith this optional command the user assigns values to various general parameters.\n\nNotes\n-----\nThe error level `maxerr` is coded as follows:\n\n* 1: warnings\n* 2: errors (possibly automatically repaired or repairable by SWAN)\n* 3: severe errors\n\nDefault values for `pwtail` depend on formulations of physics:\n\n* command GEN1: `pwtail = 5`\n* command GEN2: `pwtail = 5`\n* command GEN3 KOMEN: `pwtail = 4`\n* command GEN3 WESTH: `pwtail = 4`\n* command GEN3 JANSSEN: `pwtail = 5`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import SET\n    set = SET(level=0.5, direction_convention=\"nautical\")\n    print(set.render())\n    set = SET(\n        level=-1.0,\n        nor=90,\n        depmin=0.01,\n        maxerr=3,\n        grav=9.81,\n        rho=1025,\n        cdcap=2.5e-3,\n        inrhog=0,\n        hsrerr=0.1,\n        direction_convention=\"nautical\",\n    )\n    print(set.render())",
         "properties": {
            "model_type": {
               "default": "set",
               "description": "Model type discriminator",
               "enum": [
                  "set",
                  "SET"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "level": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Increase in water level that is constant in space and time can be given with this option, `level` is the value of this increase (in m). For a variable water level reference is made to the commands INPGRID and READINP (SWAN default: 0)",
               "examples": [
                  0
               ],
               "title": "Level"
            },
            "nor": {
               "anyOf": [
                  {
                     "maximum": 360.0,
                     "minimum": -360.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Direction of North with respect to the x-axis (measured counterclockwise); default `nor = 90`, i.e. x-axis of the problem coordinate system points East. When spherical coordinates are used (see command COORD) the value of `nor` may not be modified",
               "title": "Nor"
            },
            "depmin": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Threshold depth (in m). In the computation any positive depth smaller than `depmin` is made equal to `depmin` (SWAN default: 0.05)",
               "title": "Depmin"
            },
            "maxmes": {
               "anyOf": [
                  {
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of error messages during the computation at which the computation is terminated. During the computational process messages are written to the print file (SWAN default: 200)",
               "title": "Maxmes"
            },
            "maxerr": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "During pre-processing SWAN checks input data. Depending on the severity of the errors encountered during this pre-processing, SWAN does not start computations. The user can influence the error level above which SWAN will  not start computations (at the level indicated the computations will continue) (SWAN default: 1)",
               "title": "Maxerr"
            },
            "grav": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The gravitational acceleration (in m/s2) (SWAN default: 9.81)",
               "title": "Grav"
            },
            "rho": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The water density (in kg/m3) (SWAN default: 1025)",
               "title": "Rho"
            },
            "cdcap": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum value for the wind drag coefficient. A value of 99999 meansno cutting off the drag coefficient. A suggestion for this parameter is `cdcap = 2.5x 10-3` (SWAN default: 99999) ",
               "title": "Cdcap"
            },
            "inrhog": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "To indicate whether the user requires output based on variance or based on true energy (see Section 2.5). `inrhog` = 0: output based on variance, `inrhog` = 1: output based on true energy (SWAN default: 0)",
               "title": "Inrhog"
            },
            "hsrerr": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The relative difference between the user imposed significant wave height and the significant wave height computed by SWAN (anywhere along the computational grid boundary) above which a warning will be given. This relative difference is the difference normalized with the user provided significant wave height. This warning will be given for each boundary grid point where the problem occurs (with its x- and y-index number of the computational grid). The cause of the difference is explained in Section 2.6.3. To suppress these warnings (in particular for nonstationary computations), set `hsrerr` at a very high value or use command OFF BNDCHK (SWAN default: 0.10) (ONLY MEANT FOR STRUCTURED GRIDS)",
               "title": "Hsrerr"
            },
            "direction_convention": {
               "description": "Direction convention: `nautical` indicates that the Nautical convention for wind and wave direction (SWAN input and output) will be used, `cartesian` indicates that the Cartesian convention for wind and wave direction will be used. For definition, see Section 2.5 or Appendix A (SWAN default: `cartesian`)",
               "enum": [
                  "nautical",
                  "cartesian"
               ],
               "title": "Direction Convention",
               "type": "string"
            },
            "pwtail": {
               "anyOf": [
                  {
                     "minimum": 0,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power of high frequency tail; defines the shape of the spectral tail above the highest prognostic frequency `fhigh` (see command CGRID). The energy density is assumed to be proportional to frequency to the power `pwtail`. If the user wishes to use another value, then this SET command should be located in the command file after GEN1, GEN2 or GEN3 command (these will override the SET command with respect to `pwtail`)",
               "title": "Pwtail"
            },
            "froudmax": {
               "anyOf": [
                  {
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Is the maximum Froude number (`U/\u221agd` with `U` the current and `d` the water depth). The currents taken from a circulation model may mismatch with given water depth `d` in the sense that the Froude number becomes larger than 1. For this, the current velocities will be maximized by Froude number times `sqrt(gh)` (SWAN default: 0.8)",
               "title": "Froudmax"
            },
            "icewind": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Controls the scaling of wind input by open water fraction. Default value of zero corresponds to the case where wind input is scaled by the open water fraction. If `icewind = 1` then sea ice does not affect wind input directly. (Though there is still indirect effect via the sea ice sink term; see command SICE) (SWAN default: 0)",
               "title": "Icewind"
            }
         },
         "required": [
            "direction_convention"
         ],
         "title": "SET",
         "type": "object"
      },
      "SPHERICAL": {
         "additionalProperties": false,
         "description": "Spherical coordinates.\n\n.. code-block:: text\n\n    SPHERICAL [->CCM|QC]\n\nNotes\n-----\n\nprojection options:\n\n* CCM: central conformal Mercator. The horizontal and vertical scales are\n  uniform in terms of cm/degree over the area shown. In the centre of the scale\n  is identical to that of the conventional Mercator projection (but only at\n  that centre). The area in the projection centre is therefore exactly conformal.\n* QC: the projection method is quasi-cartesian, i.e. the horizontal and vertical\n  scales are equal to one another in terms of cm/degree.\n\nAll coordinates of locations and geographical grid sizes are given in degrees;`x`\nis longitude with `x = 0` being the Greenwich meridian and `x > 0` is East of this\nmeridian; `y` is latitude with `y > 0` being the Northern hemisphere. Input and\noutput grids have to be oriented with their x-axis to the East; mesh sizes are in\ndegrees. All other distances are in meters.\n\nNote that spherical coordinates can also be used for relatively small areas, say 10\nor 20 km horizontal dimension. This may be useful if one obtains the boundary\nconditions by nesting in an oceanic model which is naturally formulated in\nspherical coordinates. Note that in case of spherical coordinates regular grids\nmust always be oriented E-W, N-S, i.e. `alpc=0`, `alpinp=0`, `alpfr=0`\n(see commands CGRID, INPUT GRID and FRAME, respectively).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import SPHERICAL\n    coords = SPHERICAL()\n    print(coords.render())\n    coords = SPHERICAL(projection=\"qc\")\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "spherical",
               "description": "Model type discriminator",
               "enum": [
                  "spherical",
                  "SPHERICAL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "projection": {
               "default": "ccm",
               "description": "Defines the projection method in case of spherical coordinates, `ccm` Central Conformal Mercator, `qc` means Quasi-cartesian",
               "enum": [
                  "ccm",
                  "qc"
               ],
               "title": "Projection",
               "type": "string"
            }
         },
         "title": "SPHERICAL",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field coordinates: COORDINATES | None = None
field mode: MODE | None = None
field model_type: Literal['startup', 'STARTUP'] = 'startup'

Model type discriminator

field project: PROJECT | None = None
field set: SET | None = None
cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(*args, **kwargs) str

Override base class to allow rendering list of components.

Startup#

Model start up components.

pydantic model rompy.swan.components.startup.COORDINATES[source]

SWAN Coordinates.

COORDINATES ->CARTESIAN|SPHERICAL REPEATING

Command to choose between Cartesian and spherical coordinates (see Section 2.5). A nested SWAN run must use the same coordinate system as the coarse grid SWAN run.

Examples

In [1]: from rompy.swan.components.startup import COORDINATES

In [2]: coords = COORDINATES()

In [3]: print(coords.render())
COORDINATES CARTESIAN

In [4]: coords = COORDINATES(
   ...:     kind=dict(model_type="spherical", projection="ccm"),
   ...:     reapeating=True,
   ...: )
   ...: 

In [5]: print(coords.render())
COORDINATES SPHERICAL CCM REPEATING

Show JSON schema
{
   "title": "COORDINATES",
   "description": "SWAN Coordinates.\n\n.. code-block:: text\n\n    COORDINATES ->CARTESIAN|SPHERICAL REPEATING\n\nCommand to choose between Cartesian and spherical coordinates (see Section 2.5).\nA nested SWAN run must use the same coordinate system as the coarse grid SWAN run.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import COORDINATES\n    coords = COORDINATES()\n    print(coords.render())\n    coords = COORDINATES(\n        kind=dict(model_type=\"spherical\", projection=\"ccm\"),\n        reapeating=True,\n    )\n    print(coords.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "coordinates",
         "description": "Model type discriminator",
         "enum": [
            "coordinates",
            "COORDINATES"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "kind": {
         "anyOf": [
            {
               "$ref": "#/$defs/CARTESIAN"
            },
            {
               "$ref": "#/$defs/SPHERICAL"
            }
         ],
         "description": "Coordinates kind",
         "title": "Kind"
      },
      "reapeating": {
         "default": false,
         "description": "This option is only for academic cases. It means that wave energy leaving at one end of the domain (in computational x-direction) enter at the other side; it is as if the wave field repeats itself in x-direction with the length of the domain in x-direction. This option cannot be used in combination with computation of set-up (see command SETUP). This option is available only with regular grids",
         "title": "Reapeating",
         "type": "boolean"
      }
   },
   "$defs": {
      "CARTESIAN": {
         "additionalProperties": false,
         "description": "Cartesian coordinates.\n\n.. code-block:: text\n\n    CARTESIAN\n\nAll locations and distances are in m. Coordinates are given with respect\nto x- and y-axes chosen by the user in the various commands.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import CARTESIAN\n    coords = CARTESIAN()\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "cartesian",
               "description": "Model type discriminator",
               "enum": [
                  "cartesian",
                  "CARTESIAN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "CARTESIAN",
         "type": "object"
      },
      "SPHERICAL": {
         "additionalProperties": false,
         "description": "Spherical coordinates.\n\n.. code-block:: text\n\n    SPHERICAL [->CCM|QC]\n\nNotes\n-----\n\nprojection options:\n\n* CCM: central conformal Mercator. The horizontal and vertical scales are\n  uniform in terms of cm/degree over the area shown. In the centre of the scale\n  is identical to that of the conventional Mercator projection (but only at\n  that centre). The area in the projection centre is therefore exactly conformal.\n* QC: the projection method is quasi-cartesian, i.e. the horizontal and vertical\n  scales are equal to one another in terms of cm/degree.\n\nAll coordinates of locations and geographical grid sizes are given in degrees;`x`\nis longitude with `x = 0` being the Greenwich meridian and `x > 0` is East of this\nmeridian; `y` is latitude with `y > 0` being the Northern hemisphere. Input and\noutput grids have to be oriented with their x-axis to the East; mesh sizes are in\ndegrees. All other distances are in meters.\n\nNote that spherical coordinates can also be used for relatively small areas, say 10\nor 20 km horizontal dimension. This may be useful if one obtains the boundary\nconditions by nesting in an oceanic model which is naturally formulated in\nspherical coordinates. Note that in case of spherical coordinates regular grids\nmust always be oriented E-W, N-S, i.e. `alpc=0`, `alpinp=0`, `alpfr=0`\n(see commands CGRID, INPUT GRID and FRAME, respectively).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import SPHERICAL\n    coords = SPHERICAL()\n    print(coords.render())\n    coords = SPHERICAL(projection=\"qc\")\n    print(coords.render())",
         "properties": {
            "model_type": {
               "default": "spherical",
               "description": "Model type discriminator",
               "enum": [
                  "spherical",
                  "SPHERICAL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "projection": {
               "default": "ccm",
               "description": "Defines the projection method in case of spherical coordinates, `ccm` Central Conformal Mercator, `qc` means Quasi-cartesian",
               "enum": [
                  "ccm",
                  "qc"
               ],
               "title": "Projection",
               "type": "string"
            }
         },
         "title": "SPHERICAL",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field kind: CARTESIAN | SPHERICAL [Optional]

Coordinates kind

field model_type: Literal['coordinates', 'COORDINATES'] = 'coordinates'

Model type discriminator

field reapeating: bool = False

This option is only for academic cases. It means that wave energy leaving at one end of the domain (in computational x-direction) enter at the other side; it is as if the wave field repeats itself in x-direction with the length of the domain in x-direction. This option cannot be used in combination with computation of set-up (see command SETUP). This option is available only with regular grids

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.startup.MODE[source]

SWAN Mode.

MODE ->STATIONARY|NONSTATIONARY ->TWODIMENSIONAL|ONEDIMENSIONAL

With this optional command the user indicates that the run will be either stationary or nonstationary and one-dimensional (1D-mode) or two-dimensional (2D-mode). Nonstationary means either (see command COMPUTE):

    1. one nonstationary computations or

    1. a sequence of stationary computations or

    1. a mix of (a) and (b)

Examples

In [1]: from rompy.swan.components.startup import MODE

In [2]: mode = MODE()

In [3]: print(mode.render())
MODE STATIONARY TWODIMENSIONAL

In [4]: mode = MODE(kind="nonstationary", dim="twodimensional")

In [5]: print(mode.render())
MODE NONSTATIONARY TWODIMENSIONAL

Show JSON schema
{
   "title": "MODE",
   "description": "SWAN Mode.\n\n.. code-block:: text\n\n    MODE ->STATIONARY|NONSTATIONARY ->TWODIMENSIONAL|ONEDIMENSIONAL\n\nWith this optional command the user indicates that the run will be either\nstationary or nonstationary and one-dimensional (1D-mode) or two-dimensional\n(2D-mode). Nonstationary means either (see command COMPUTE):\n\n* (a) one nonstationary computations or\n* (b) a sequence of stationary computations or\n* (c) a mix of (a) and (b)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import MODE\n    mode = MODE()\n    print(mode.render())\n    mode = MODE(kind=\"nonstationary\", dim=\"twodimensional\")\n    print(mode.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "mode",
         "description": "Model type discriminator.",
         "enum": [
            "mode",
            "MODE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "kind": {
         "default": "stationary",
         "description": "Indicates if run will be stationary or nonstationary",
         "enum": [
            "stationary",
            "nonstationary"
         ],
         "title": "Kind",
         "type": "string"
      },
      "dim": {
         "default": "twodimensional",
         "description": "Indicates that the run will be either one-dimensional (1D-mode) or two-dimensional (2D-mode)",
         "enum": [
            "onedimensional",
            "twodimensional"
         ],
         "title": "Dim",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field dim: Literal['onedimensional', 'twodimensional'] = 'twodimensional'

Indicates that the run will be either one-dimensional (1D-mode) or two-dimensional (2D-mode)

field kind: Literal['stationary', 'nonstationary'] = 'stationary'

Indicates if run will be stationary or nonstationary

field model_type: Literal['mode', 'MODE'] = 'mode'

Model type discriminator.

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.startup.PROJECT[source]

SWAN Project.

PROJECT 'name' 'nr' 'title' 'title2 'title3'

With this required command the user defines a number of strings to identify the SWAN run (project name e.g., an engineering project) in the print and plot file.

Examples

In [1]: from rompy.swan.components.startup import PROJECT

In [2]: proj = PROJECT(nr="01")

In [3]: print(proj.render())
PROJECT nr='01'

In [4]: proj = PROJECT(
   ...:     name="waus",
   ...:     nr="001",
   ...:     title1="Western Australia",
   ...:     title2="Perth Nest"
   ...: )
   ...: 

In [5]: print(proj.render())
PROJECT name='waus' nr='001' title1='Western Australia' title2='Perth Nest'

Show JSON schema
{
   "title": "PROJECT",
   "description": "SWAN Project.\n\n.. code-block:: text\n\n    PROJECT 'name' 'nr' 'title' 'title2 'title3'\n\nWith this required command the user defines a number of strings to identify the\nSWAN run (project name e.g., an engineering project) in the print and plot file.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import PROJECT\n    proj = PROJECT(nr=\"01\")\n    print(proj.render())\n    proj = PROJECT(\n        name=\"waus\",\n        nr=\"001\",\n        title1=\"Western Australia\",\n        title2=\"Perth Nest\"\n    )\n    print(proj.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "project",
         "description": "Model type discriminator",
         "enum": [
            "project",
            "PROJECT"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "name": {
         "anyOf": [
            {
               "maxLength": 16,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Is the name of the project, at most 16 characters long",
         "title": "Name"
      },
      "nr": {
         "description": "Is the run identification (to be provided as a character string; e.g. the run number) to distinguish this run among other runs for the same project; it is at most 4 characters long. It is the only required information in this command.",
         "maxLength": 4,
         "title": "Nr",
         "type": "string"
      },
      "title1": {
         "anyOf": [
            {
               "maxLength": 72,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A string of at most 72 characters provided by the user to appear in the output of the program for the user's convenience (SWAN default: blanks)",
         "title": "Title1"
      },
      "title2": {
         "anyOf": [
            {
               "maxLength": 72,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Same as 'title1'",
         "title": "Title2"
      },
      "title3": {
         "anyOf": [
            {
               "maxLength": 72,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Same as 'title1'",
         "title": "Title3"
      }
   },
   "additionalProperties": false,
   "required": [
      "nr"
   ]
}

Fields:
field model_type: Literal['project', 'PROJECT'] = 'project'

Model type discriminator

field name: str | None = None

Is the name of the project, at most 16 characters long

Constraints:
  • max_length = 16

field nr: str [Required]

Is the run identification (to be provided as a character string; e.g. the run number) to distinguish this run among other runs for the same project; it is at most 4 characters long. It is the only required information in this command.

Constraints:
  • max_length = 4

field title1: str | None = None

A string of at most 72 characters provided by the user to appear in the output of the program for the user’s convenience (SWAN default: blanks)

Constraints:
  • max_length = 72

field title2: str | None = None

Same as ‘title1’

Constraints:
  • max_length = 72

field title3: str | None = None

Same as ‘title1’

Constraints:
  • max_length = 72

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.startup.SET[source]

SWAN setting commands.

SET [level] [nor] [depmin] [maxmes] [maxerr] [grav] [rho] [cdcap] &
    [inrhog] [hsrerr] NAUTICAL|->CARTESIAN [pwtail] [froudmax] [icewind]

With this optional command the user assigns values to various general parameters.

Notes

The error level maxerr is coded as follows:

  • 1: warnings

  • 2: errors (possibly automatically repaired or repairable by SWAN)

  • 3: severe errors

Default values for pwtail depend on formulations of physics:

  • command GEN1: pwtail = 5

  • command GEN2: pwtail = 5

  • command GEN3 KOMEN: pwtail = 4

  • command GEN3 WESTH: pwtail = 4

  • command GEN3 JANSSEN: pwtail = 5

Examples

In [1]: from rompy.swan.components.startup import SET

In [2]: set = SET(level=0.5, direction_convention="nautical")

In [3]: print(set.render())
SET level=0.5 NAUTICAL

In [4]: set = SET(
   ...:     level=-1.0,
   ...:     nor=90,
   ...:     depmin=0.01,
   ...:     maxerr=3,
   ...:     grav=9.81,
   ...:     rho=1025,
   ...:     cdcap=2.5e-3,
   ...:     inrhog=0,
   ...:     hsrerr=0.1,
   ...:     direction_convention="nautical",
   ...: )
   ...: 

In [5]: print(set.render())
SET level=-1.0 nor=90.0 depmin=0.01 maxerr=3 grav=9.81 rho=1025.0 cdcap=0.0025 inrhog=0 hsrerr=0.1 NAUTICAL

Show JSON schema
{
   "title": "SET",
   "description": "SWAN setting commands.\n\n.. code-block:: text\n\n    SET [level] [nor] [depmin] [maxmes] [maxerr] [grav] [rho] [cdcap] &\n        [inrhog] [hsrerr] NAUTICAL|->CARTESIAN [pwtail] [froudmax] [icewind]\n\nWith this optional command the user assigns values to various general parameters.\n\nNotes\n-----\nThe error level `maxerr` is coded as follows:\n\n* 1: warnings\n* 2: errors (possibly automatically repaired or repairable by SWAN)\n* 3: severe errors\n\nDefault values for `pwtail` depend on formulations of physics:\n\n* command GEN1: `pwtail = 5`\n* command GEN2: `pwtail = 5`\n* command GEN3 KOMEN: `pwtail = 4`\n* command GEN3 WESTH: `pwtail = 4`\n* command GEN3 JANSSEN: `pwtail = 5`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import SET\n    set = SET(level=0.5, direction_convention=\"nautical\")\n    print(set.render())\n    set = SET(\n        level=-1.0,\n        nor=90,\n        depmin=0.01,\n        maxerr=3,\n        grav=9.81,\n        rho=1025,\n        cdcap=2.5e-3,\n        inrhog=0,\n        hsrerr=0.1,\n        direction_convention=\"nautical\",\n    )\n    print(set.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "set",
         "description": "Model type discriminator",
         "enum": [
            "set",
            "SET"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "level": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Increase in water level that is constant in space and time can be given with this option, `level` is the value of this increase (in m). For a variable water level reference is made to the commands INPGRID and READINP (SWAN default: 0)",
         "examples": [
            0
         ],
         "title": "Level"
      },
      "nor": {
         "anyOf": [
            {
               "maximum": 360.0,
               "minimum": -360.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Direction of North with respect to the x-axis (measured counterclockwise); default `nor = 90`, i.e. x-axis of the problem coordinate system points East. When spherical coordinates are used (see command COORD) the value of `nor` may not be modified",
         "title": "Nor"
      },
      "depmin": {
         "anyOf": [
            {
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Threshold depth (in m). In the computation any positive depth smaller than `depmin` is made equal to `depmin` (SWAN default: 0.05)",
         "title": "Depmin"
      },
      "maxmes": {
         "anyOf": [
            {
               "minimum": 0,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum number of error messages during the computation at which the computation is terminated. During the computational process messages are written to the print file (SWAN default: 200)",
         "title": "Maxmes"
      },
      "maxerr": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "During pre-processing SWAN checks input data. Depending on the severity of the errors encountered during this pre-processing, SWAN does not start computations. The user can influence the error level above which SWAN will  not start computations (at the level indicated the computations will continue) (SWAN default: 1)",
         "title": "Maxerr"
      },
      "grav": {
         "anyOf": [
            {
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The gravitational acceleration (in m/s2) (SWAN default: 9.81)",
         "title": "Grav"
      },
      "rho": {
         "anyOf": [
            {
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The water density (in kg/m3) (SWAN default: 1025)",
         "title": "Rho"
      },
      "cdcap": {
         "anyOf": [
            {
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The maximum value for the wind drag coefficient. A value of 99999 meansno cutting off the drag coefficient. A suggestion for this parameter is `cdcap = 2.5x 10-3` (SWAN default: 99999) ",
         "title": "Cdcap"
      },
      "inrhog": {
         "anyOf": [
            {
               "enum": [
                  0,
                  1
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "To indicate whether the user requires output based on variance or based on true energy (see Section 2.5). `inrhog` = 0: output based on variance, `inrhog` = 1: output based on true energy (SWAN default: 0)",
         "title": "Inrhog"
      },
      "hsrerr": {
         "anyOf": [
            {
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The relative difference between the user imposed significant wave height and the significant wave height computed by SWAN (anywhere along the computational grid boundary) above which a warning will be given. This relative difference is the difference normalized with the user provided significant wave height. This warning will be given for each boundary grid point where the problem occurs (with its x- and y-index number of the computational grid). The cause of the difference is explained in Section 2.6.3. To suppress these warnings (in particular for nonstationary computations), set `hsrerr` at a very high value or use command OFF BNDCHK (SWAN default: 0.10) (ONLY MEANT FOR STRUCTURED GRIDS)",
         "title": "Hsrerr"
      },
      "direction_convention": {
         "description": "Direction convention: `nautical` indicates that the Nautical convention for wind and wave direction (SWAN input and output) will be used, `cartesian` indicates that the Cartesian convention for wind and wave direction will be used. For definition, see Section 2.5 or Appendix A (SWAN default: `cartesian`)",
         "enum": [
            "nautical",
            "cartesian"
         ],
         "title": "Direction Convention",
         "type": "string"
      },
      "pwtail": {
         "anyOf": [
            {
               "minimum": 0,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Power of high frequency tail; defines the shape of the spectral tail above the highest prognostic frequency `fhigh` (see command CGRID). The energy density is assumed to be proportional to frequency to the power `pwtail`. If the user wishes to use another value, then this SET command should be located in the command file after GEN1, GEN2 or GEN3 command (these will override the SET command with respect to `pwtail`)",
         "title": "Pwtail"
      },
      "froudmax": {
         "anyOf": [
            {
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Is the maximum Froude number (`U/\u221agd` with `U` the current and `d` the water depth). The currents taken from a circulation model may mismatch with given water depth `d` in the sense that the Froude number becomes larger than 1. For this, the current velocities will be maximized by Froude number times `sqrt(gh)` (SWAN default: 0.8)",
         "title": "Froudmax"
      },
      "icewind": {
         "anyOf": [
            {
               "enum": [
                  0,
                  1
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the scaling of wind input by open water fraction. Default value of zero corresponds to the case where wind input is scaled by the open water fraction. If `icewind = 1` then sea ice does not affect wind input directly. (Though there is still indirect effect via the sea ice sink term; see command SICE) (SWAN default: 0)",
         "title": "Icewind"
      }
   },
   "additionalProperties": false,
   "required": [
      "direction_convention"
   ]
}

Fields:
Validators:
field cdcap: float | None = None

The maximum value for the wind drag coefficient. A value of 99999 meansno cutting off the drag coefficient. A suggestion for this parameter is cdcap = 2.5x 10-3 (SWAN default: 99999)

Constraints:
  • ge = 0.0

field depmin: float | None = None

Threshold depth (in m). In the computation any positive depth smaller than depmin is made equal to depmin (SWAN default: 0.05)

Constraints:
  • ge = 0.0

field direction_convention: Literal['nautical', 'cartesian'] [Required]

Direction convention: nautical indicates that the Nautical convention for wind and wave direction (SWAN input and output) will be used, cartesian indicates that the Cartesian convention for wind and wave direction will be used. For definition, see Section 2.5 or Appendix A (SWAN default: cartesian)

field froudmax: float | None = None

Is the maximum Froude number (U/√gd with U the current and d the water depth). The currents taken from a circulation model may mismatch with given water depth d in the sense that the Froude number becomes larger than 1. For this, the current velocities will be maximized by Froude number times sqrt(gh) (SWAN default: 0.8)

Constraints:
  • ge = 0.0

field grav: float | None = None

The gravitational acceleration (in m/s2) (SWAN default: 9.81)

Constraints:
  • ge = 0.0

field hsrerr: float | None = None

The relative difference between the user imposed significant wave height and the significant wave height computed by SWAN (anywhere along the computational grid boundary) above which a warning will be given. This relative difference is the difference normalized with the user provided significant wave height. This warning will be given for each boundary grid point where the problem occurs (with its x- and y-index number of the computational grid). The cause of the difference is explained in Section 2.6.3. To suppress these warnings (in particular for nonstationary computations), set hsrerr at a very high value or use command OFF BNDCHK (SWAN default: 0.10) (ONLY MEANT FOR STRUCTURED GRIDS)

Constraints:
  • ge = 0.0

field icewind: Literal[0, 1] | None = None

Controls the scaling of wind input by open water fraction. Default value of zero corresponds to the case where wind input is scaled by the open water fraction. If icewind = 1 then sea ice does not affect wind input directly. (Though there is still indirect effect via the sea ice sink term; see command SICE) (SWAN default: 0)

field inrhog: Literal[0, 1] | None = None

To indicate whether the user requires output based on variance or based on true energy (see Section 2.5). inrhog = 0: output based on variance, inrhog = 1: output based on true energy (SWAN default: 0)

field level: float | None = None

Increase in water level that is constant in space and time can be given with this option, level is the value of this increase (in m). For a variable water level reference is made to the commands INPGRID and READINP (SWAN default: 0)

field maxerr: Literal[1, 2, 3] | None = None

During pre-processing SWAN checks input data. Depending on the severity of the errors encountered during this pre-processing, SWAN does not start computations. The user can influence the error level above which SWAN will not start computations (at the level indicated the computations will continue) (SWAN default: 1)

field maxmes: int | None = None

Maximum number of error messages during the computation at which the computation is terminated. During the computational process messages are written to the print file (SWAN default: 200)

Constraints:
  • ge = 0

field model_type: Literal['set', 'SET'] = 'set'

Model type discriminator

field nor: float | None = None

Direction of North with respect to the x-axis (measured counterclockwise); default nor = 90, i.e. x-axis of the problem coordinate system points East. When spherical coordinates are used (see command COORD) the value of nor may not be modified

Constraints:
  • ge = -360.0

  • le = 360.0

field pwtail: int | None = None

Power of high frequency tail; defines the shape of the spectral tail above the highest prognostic frequency fhigh (see command CGRID). The energy density is assumed to be proportional to frequency to the power pwtail. If the user wishes to use another value, then this SET command should be located in the command file after GEN1, GEN2 or GEN3 command (these will override the SET command with respect to pwtail)

Constraints:
  • ge = 0

Validated by:
field rho: float | None = None

The water density (in kg/m3) (SWAN default: 1025)

Constraints:
  • ge = 0.0

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator pwtail_after_gen  »  pwtail[source]
render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

Cgrid#

Computational grid for SWAN.

pydantic model rompy.swan.components.cgrid.CGRID[source]

SWAN computational grid abstract component.

CGRID ->REGULAR|CURVILINEAR|UNSTRUCTURED &
    CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]

This class should not be used directly.

Show JSON schema
{
   "title": "CGRID",
   "description": "SWAN computational grid abstract component.\n\n.. code-block:: text\n\n    CGRID ->REGULAR|CURVILINEAR|UNSTRUCTURED &\n        CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]\n\nThis class should not be used directly.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "cgrid",
         "description": "Model type discriminator",
         "enum": [
            "cgrid",
            "CGRID"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "spectrum": {
         "$ref": "#/$defs/SPECTRUM",
         "description": "Spectrum subcomponent"
      }
   },
   "$defs": {
      "SPECTRUM": {
         "additionalProperties": false,
         "description": "SWAN spectrum specification.\n\n.. code-block:: text\n\n    ->CIRCLE|SECTOR ([dir1] [dir2]) [mdc] [flow] [fhigh] [msc]\n\nNotes\n-----\n\nDirections in the spectra are defined either as a CIRCLE or as a SECTOR. In the\ncase of a SECTOR, both `dir1` and `dir2` must be specified. In the case of a\nCIRCLE, neither `dir1` nor `dir2` should be specified.\n\nAt least two of `flow`, `fhigh` and `msc` must be specified in which case the\nthird parameter will be calculated by SWAN such that the frequency resolution\n`df/f = 0.1` (10% increments).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SPECTRUM\n    spec = SPECTRUM(mdc=36, flow=0.04, fhigh=1.0)\n    print(spec.render())\n    spec = SPECTRUM(mdc=36, dir1=0, dir2=180, flow=0.04, msc=31)\n    print(spec.render())",
         "properties": {
            "model_type": {
               "default": "spectrum",
               "description": "Model type discriminator",
               "enum": [
                  "spectrum",
                  "SPECTRUM"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mdc": {
               "description": "Number of meshes in theta-space. In the case of CIRCLE, this is the number of subdivisions of the 360 degrees of a circle so `dtheta = [360]/[mdc]` is the spectral directional resolution. In the case of SECTOR, `dtheta = ([dir2] - [dir1])/[mdc]`. The minimum number of directional bins is 3 per directional quadrant.",
               "title": "Mdc",
               "type": "integer"
            },
            "flow": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lowest discrete frequency that is used in the calculation (in Hz).",
               "title": "Flow"
            },
            "fhigh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Highest discrete frequency that is used in the calculation (in Hz).",
               "title": "Fhigh"
            },
            "msc": {
               "anyOf": [
                  {
                     "minimum": 3,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "One less than the number of frequencies. This defines the grid resolution in frequency-space between the lowest discrete frequency `flow` and the highest discrete frequency `fhigh`. This resolution is not constant, since the frequencies are distributed logarithmical: `fi+1 = yfi` where `y` is a constant. The minimum number of frequencies is 4",
               "title": "Msc"
            },
            "dir1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the right-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir1"
            },
            "dir2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the left-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir2"
            }
         },
         "required": [
            "mdc"
         ],
         "title": "SPECTRUM",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "spectrum"
   ]
}

Fields:
  • model_type (Literal['cgrid', 'CGRID'])

  • spectrum (rompy.swan.subcomponents.spectrum.SPECTRUM)

field model_type: Literal['cgrid', 'CGRID'] = 'cgrid'

Model type discriminator

field spectrum: SPECTRUM [Required]

Spectrum subcomponent

abstract cmd()[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.cgrid.CURVILINEAR[source]

SWAN curvilinear computational grid.

CGRID CURVILINEAR [mxc] [myc] (EXCEPTION [xexc] [yexc])
    ->CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]
READGRID COORDINATES [fac] 'fname' [idla] [nhedf] [nhedvec] &
    FREE|FORMAT ('form'|[idfm])

This is a group component that includes a CGRID and a READGRID component.

Examples

In [1]: from rompy.swan.components.cgrid import CURVILINEAR

In [2]: cgrid = CURVILINEAR(
   ...:     mxc=199,
   ...:     myc=199,
   ...:     readcoord=dict(fname="./coords.txt"),
   ...:     spectrum=dict(mdc=36, flow=0.04, fhigh=1.0),
   ...: )
   ...: 

In [3]: print(cgrid.render())
CGRID CURVILINEAR mxc=199 myc=199 CIRCLE mdc=36 flow=0.04 fhigh=1.0
READGRID COORDINATES fac=1.0 fname='./coords.txt' idla=1 nhedf=0 nhedvec=0 FREE

Show JSON schema
{
   "title": "CURVILINEAR",
   "description": "SWAN curvilinear computational grid.\n\n.. code-block:: text\n\n    CGRID CURVILINEAR [mxc] [myc] (EXCEPTION [xexc] [yexc])\n        ->CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]\n    READGRID COORDINATES [fac] 'fname' [idla] [nhedf] [nhedvec] &\n        FREE|FORMAT ('form'|[idfm])\n\nThis is a group component that includes a `CGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.cgrid import CURVILINEAR\n    cgrid = CURVILINEAR(\n        mxc=199,\n        myc=199,\n        readcoord=dict(fname=\"./coords.txt\"),\n        spectrum=dict(mdc=36, flow=0.04, fhigh=1.0),\n    )\n    print(cgrid.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "curvilinear",
         "description": "Model type discriminator",
         "enum": [
            "curvilinear",
            "CURVILINEAR"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "spectrum": {
         "$ref": "#/$defs/SPECTRUM",
         "description": "Spectrum subcomponent"
      },
      "mxc": {
         "description": "Number of meshes in computational grid in \u03be-direction (this number is one less than the number of grid points in this domain).",
         "title": "Mxc",
         "type": "integer"
      },
      "myc": {
         "description": "Number of meshes in computational grid in \u03b7-direction (this number is one less than the number of grid points in this domain).",
         "title": "Myc",
         "type": "integer"
      },
      "xexc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "the value which the user uses to indicate that a grid point is to be ignored in the computations (this value is provided by the user at the location of the x-coordinate considered in the file of the x-coordinates, see command READGRID COOR).",
         "title": "Xexc"
      },
      "yexc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "the value which the user uses to indicate that a grid point is to be ignored in the computations (this value is provided by the user at the location of the y-coordinate considered in the file of the y-coordinates, see command READGRID COOR).",
         "title": "Yexc"
      },
      "readcoord": {
         "$ref": "#/$defs/READCOORD",
         "description": "Grid coordinates reader."
      }
   },
   "$defs": {
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      },
      "READCOORD": {
         "additionalProperties": false,
         "description": "SWAN coordinates reader.\n\n.. code-block:: text\n\n    READGRID COORDINATES [fac] 'fname' [idla] [nhedf] [nhedvec] &\n        FREE|FORMAT ('form'|idfm)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READCOORD\n    readcoord = READCOORD(\n        fac=1.0,\n        fname=\"coords.txt\",\n        idla=3,\n        format=\"free\",\n    )\n    print(readcoord.render())",
         "properties": {
            "model_type": {
               "default": "readcoord",
               "description": "Model type discriminator",
               "enum": [
                  "readcoord",
                  "READCOORD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "const": "coordinates",
               "default": "coordinates",
               "description": "Type of the SWAN grid file",
               "title": "Grid Type",
               "type": "string"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "exclusiveMinimum": 0.0,
               "title": "Fac",
               "type": "number"
            },
            "idla": {
               "$ref": "#/$defs/IDLA",
               "default": 1,
               "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
            },
            "nhedf": {
               "default": 0,
               "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
               "minimum": 0,
               "title": "Nhedf",
               "type": "integer"
            },
            "nhedvec": {
               "default": 0,
               "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
               "minimum": 0,
               "title": "Nhedvec",
               "type": "integer"
            },
            "format": {
               "default": "free",
               "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
               "enum": [
                  "free",
                  "fixed",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            },
            "form": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
               "title": "Form"
            },
            "idfm": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        5,
                        6,
                        8
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "File format identifier, only used if `format='fixed'`",
               "title": "Idfm"
            },
            "fname": {
               "description": "Name of the SWAN coordinates file",
               "title": "Fname",
               "type": "string"
            }
         },
         "required": [
            "fname"
         ],
         "title": "READCOORD",
         "type": "object"
      },
      "SPECTRUM": {
         "additionalProperties": false,
         "description": "SWAN spectrum specification.\n\n.. code-block:: text\n\n    ->CIRCLE|SECTOR ([dir1] [dir2]) [mdc] [flow] [fhigh] [msc]\n\nNotes\n-----\n\nDirections in the spectra are defined either as a CIRCLE or as a SECTOR. In the\ncase of a SECTOR, both `dir1` and `dir2` must be specified. In the case of a\nCIRCLE, neither `dir1` nor `dir2` should be specified.\n\nAt least two of `flow`, `fhigh` and `msc` must be specified in which case the\nthird parameter will be calculated by SWAN such that the frequency resolution\n`df/f = 0.1` (10% increments).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SPECTRUM\n    spec = SPECTRUM(mdc=36, flow=0.04, fhigh=1.0)\n    print(spec.render())\n    spec = SPECTRUM(mdc=36, dir1=0, dir2=180, flow=0.04, msc=31)\n    print(spec.render())",
         "properties": {
            "model_type": {
               "default": "spectrum",
               "description": "Model type discriminator",
               "enum": [
                  "spectrum",
                  "SPECTRUM"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mdc": {
               "description": "Number of meshes in theta-space. In the case of CIRCLE, this is the number of subdivisions of the 360 degrees of a circle so `dtheta = [360]/[mdc]` is the spectral directional resolution. In the case of SECTOR, `dtheta = ([dir2] - [dir1])/[mdc]`. The minimum number of directional bins is 3 per directional quadrant.",
               "title": "Mdc",
               "type": "integer"
            },
            "flow": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lowest discrete frequency that is used in the calculation (in Hz).",
               "title": "Flow"
            },
            "fhigh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Highest discrete frequency that is used in the calculation (in Hz).",
               "title": "Fhigh"
            },
            "msc": {
               "anyOf": [
                  {
                     "minimum": 3,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "One less than the number of frequencies. This defines the grid resolution in frequency-space between the lowest discrete frequency `flow` and the highest discrete frequency `fhigh`. This resolution is not constant, since the frequencies are distributed logarithmical: `fi+1 = yfi` where `y` is a constant. The minimum number of frequencies is 4",
               "title": "Msc"
            },
            "dir1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the right-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir1"
            },
            "dir2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the left-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir2"
            }
         },
         "required": [
            "mdc"
         ],
         "title": "SPECTRUM",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "spectrum",
      "mxc",
      "myc",
      "readcoord"
   ]
}

Fields:
Validators:
field model_type: Literal['curvilinear', 'CURVILINEAR'] = 'curvilinear'

Model type discriminator

Validated by:
field mxc: int [Required]

Number of meshes in computational grid in ξ-direction (this number is one less than the number of grid points in this domain).

Validated by:
field myc: int [Required]

Number of meshes in computational grid in η-direction (this number is one less than the number of grid points in this domain).

Validated by:
field readcoord: READCOORD [Required]

Grid coordinates reader.

Validated by:
field spectrum: SPECTRUM [Required]

Spectrum subcomponent

Validated by:
field xexc: float | None = None

the value which the user uses to indicate that a grid point is to be ignored in the computations (this value is provided by the user at the location of the x-coordinate considered in the file of the x-coordinates, see command READGRID COOR).

Validated by:
field yexc: float | None = None

the value which the user uses to indicate that a grid point is to be ignored in the computations (this value is provided by the user at the location of the y-coordinate considered in the file of the y-coordinates, see command READGRID COOR).

Validated by:
cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

validator xexc_and_yexc_or_neither  »  all fields[source]
property exception
property format_repr
pydantic model rompy.swan.components.cgrid.REGULAR[source]

SWAN regular computational grid.

CGRID REGULAR [xpc] [ypc] [alpc] [xlenc] [ylenc] [mxc] [myc] &
    ->CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]

This is a group component that includes a CGRID and a READGRID component.

Note

In 1D-mode, alpc should be equal to the direction alpinp.

Examples

In [1]: from rompy.swan.components.cgrid import REGULAR

In [2]: cgrid = REGULAR(
   ...:     grid=dict(xp=0, yp=0, alp=0, xlen=2000, ylen=1300, mx=100, my=100),
   ...:     spectrum=dict(mdc=36, flow=0.04, fhigh=1.0),
   ...: )
   ...: 

In [3]: print(cgrid.render())
CGRID REGULAR xpc=0.0 ypc=0.0 alpc=0.0 xlenc=2000.0 ylenc=1300.0 mxc=100 myc=100 CIRCLE mdc=36 flow=0.04 fhigh=1.0

Show JSON schema
{
   "title": "REGULAR",
   "description": "SWAN regular computational grid.\n\n.. code-block:: text\n\n    CGRID REGULAR [xpc] [ypc] [alpc] [xlenc] [ylenc] [mxc] [myc] &\n        ->CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]\n\nThis is a group component that includes a `CGRID` and a `READGRID` component.\n\nNote\n----\nIn 1D-mode, `alpc` should be equal to the direction `alpinp`.\n\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.cgrid import REGULAR\n    cgrid = REGULAR(\n        grid=dict(xp=0, yp=0, alp=0, xlen=2000, ylen=1300, mx=100, my=100),\n        spectrum=dict(mdc=36, flow=0.04, fhigh=1.0),\n    )\n    print(cgrid.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "regular",
         "description": "Model type discriminator",
         "enum": [
            "regular",
            "REGULAR"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "spectrum": {
         "$ref": "#/$defs/SPECTRUM",
         "description": "Spectrum subcomponent"
      },
      "grid": {
         "$ref": "#/$defs/GRIDREGULAR",
         "description": "Computational grid definition"
      }
   },
   "$defs": {
      "GRIDREGULAR": {
         "additionalProperties": false,
         "description": "SWAN Regular Grid subcomponent.\n\n.. code-block:: text\n\n    xp yp alp xlen ylen mx my\n\nNote\n----\nThe direction of the x-axis `alp` must be 0 in case of spherical coordinates\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import GRIDREGULAR\n    kwargs = dict(xp=173, yp=-40, alp=0, xlen=2, ylen=2, mx=199, my=199)\n    grid = GRIDREGULAR(suffix=\"c\", **kwargs)\n    print(grid.render())\n    grid = GRIDREGULAR(suffix=\"inp\", **kwargs)\n    print(grid.render())",
         "properties": {
            "model_type": {
               "default": "gridregular",
               "description": "Model type discriminator",
               "enum": [
                  "gridregular",
                  "GRIDREGULAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "xp": {
               "description": "The x-coordinate of the origin in problem coordinates",
               "title": "Xp",
               "type": "number"
            },
            "yp": {
               "description": "The y-coordinate of the origin in problem coordinates",
               "title": "Yp",
               "type": "number"
            },
            "alp": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 0.0,
               "description": "Direction of the xaxis in degrees",
               "title": "Alp"
            },
            "xlen": {
               "description": "Length of the computational grid in the x-direction",
               "title": "Xlen",
               "type": "number"
            },
            "ylen": {
               "description": "Length of the computational grid in the y-direction",
               "title": "Ylen",
               "type": "number"
            },
            "mx": {
               "description": "Number of meshes in computational grid in x-direction (this number is one less than the number of grid points in this domain)",
               "title": "Mx",
               "type": "integer"
            },
            "my": {
               "description": "Number of meshes in computational grid in y-direction (this number is one less than the number of grid points in this domain)",
               "title": "My",
               "type": "integer"
            },
            "suffix": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": "",
               "description": "Suffix for rendering with each output grid parameter.",
               "title": "Suffix"
            }
         },
         "required": [
            "xp",
            "yp",
            "xlen",
            "ylen",
            "mx",
            "my"
         ],
         "title": "GRIDREGULAR",
         "type": "object"
      },
      "SPECTRUM": {
         "additionalProperties": false,
         "description": "SWAN spectrum specification.\n\n.. code-block:: text\n\n    ->CIRCLE|SECTOR ([dir1] [dir2]) [mdc] [flow] [fhigh] [msc]\n\nNotes\n-----\n\nDirections in the spectra are defined either as a CIRCLE or as a SECTOR. In the\ncase of a SECTOR, both `dir1` and `dir2` must be specified. In the case of a\nCIRCLE, neither `dir1` nor `dir2` should be specified.\n\nAt least two of `flow`, `fhigh` and `msc` must be specified in which case the\nthird parameter will be calculated by SWAN such that the frequency resolution\n`df/f = 0.1` (10% increments).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SPECTRUM\n    spec = SPECTRUM(mdc=36, flow=0.04, fhigh=1.0)\n    print(spec.render())\n    spec = SPECTRUM(mdc=36, dir1=0, dir2=180, flow=0.04, msc=31)\n    print(spec.render())",
         "properties": {
            "model_type": {
               "default": "spectrum",
               "description": "Model type discriminator",
               "enum": [
                  "spectrum",
                  "SPECTRUM"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mdc": {
               "description": "Number of meshes in theta-space. In the case of CIRCLE, this is the number of subdivisions of the 360 degrees of a circle so `dtheta = [360]/[mdc]` is the spectral directional resolution. In the case of SECTOR, `dtheta = ([dir2] - [dir1])/[mdc]`. The minimum number of directional bins is 3 per directional quadrant.",
               "title": "Mdc",
               "type": "integer"
            },
            "flow": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lowest discrete frequency that is used in the calculation (in Hz).",
               "title": "Flow"
            },
            "fhigh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Highest discrete frequency that is used in the calculation (in Hz).",
               "title": "Fhigh"
            },
            "msc": {
               "anyOf": [
                  {
                     "minimum": 3,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "One less than the number of frequencies. This defines the grid resolution in frequency-space between the lowest discrete frequency `flow` and the highest discrete frequency `fhigh`. This resolution is not constant, since the frequencies are distributed logarithmical: `fi+1 = yfi` where `y` is a constant. The minimum number of frequencies is 4",
               "title": "Msc"
            },
            "dir1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the right-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir1"
            },
            "dir2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the left-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir2"
            }
         },
         "required": [
            "mdc"
         ],
         "title": "SPECTRUM",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "spectrum",
      "grid"
   ]
}

Fields:
Validators:
field grid: GRIDREGULAR [Required]

Computational grid definition

Validated by:
field model_type: Literal['regular', 'REGULAR'] = 'regular'

Model type discriminator

Validated by:
field spectrum: SPECTRUM [Required]

Spectrum subcomponent

Validated by:
cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator grid_suffix  »  all fields[source]

Set expected grid suffix.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.cgrid.UNSTRUCTURED[source]

SWAN unstructured computational grid.

CGRID UNSTRUCTURED CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]
READGRID UNSTRUCTURED [grid_type] ('fname')

This is a group component that includes a CGRID and a READGRID component.

Examples

In [1]: from rompy.swan.components.cgrid import UNSTRUCTURED

In [2]: cgrid = UNSTRUCTURED(
   ...:     grid_type="adcirc",
   ...:     spectrum=dict(mdc=36, flow=0.04, fhigh=1.0),
   ...: )
   ...: 

In [3]: print(cgrid.render())
CGRID UNSTRUCTURED CIRCLE mdc=36 flow=0.04 fhigh=1.0
READGRID UNSTRUCTURED ADCIRC

Show JSON schema
{
   "title": "UNSTRUCTURED",
   "description": "SWAN unstructured computational grid.\n\n.. code-block:: text\n\n    CGRID UNSTRUCTURED CIRCLE|SECTOR [mdc] [flow] [fhigh] [msc]\n    READGRID UNSTRUCTURED [grid_type] ('fname')\n\nThis is a group component that includes a `CGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.cgrid import UNSTRUCTURED\n    cgrid = UNSTRUCTURED(\n        grid_type=\"adcirc\",\n        spectrum=dict(mdc=36, flow=0.04, fhigh=1.0),\n    )\n    print(cgrid.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "unstructured",
         "default": "unstructured",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "spectrum": {
         "$ref": "#/$defs/SPECTRUM",
         "description": "Spectrum subcomponent"
      },
      "grid_type": {
         "default": "adcirc",
         "description": "Unstructured grid type",
         "enum": [
            "adcirc",
            "triangle",
            "easymesh"
         ],
         "title": "Grid Type",
         "type": "string"
      },
      "fname": {
         "anyOf": [
            {
               "maxLength": 36,
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Name of the file containing the unstructured grid",
         "title": "Fname"
      }
   },
   "$defs": {
      "SPECTRUM": {
         "additionalProperties": false,
         "description": "SWAN spectrum specification.\n\n.. code-block:: text\n\n    ->CIRCLE|SECTOR ([dir1] [dir2]) [mdc] [flow] [fhigh] [msc]\n\nNotes\n-----\n\nDirections in the spectra are defined either as a CIRCLE or as a SECTOR. In the\ncase of a SECTOR, both `dir1` and `dir2` must be specified. In the case of a\nCIRCLE, neither `dir1` nor `dir2` should be specified.\n\nAt least two of `flow`, `fhigh` and `msc` must be specified in which case the\nthird parameter will be calculated by SWAN such that the frequency resolution\n`df/f = 0.1` (10% increments).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SPECTRUM\n    spec = SPECTRUM(mdc=36, flow=0.04, fhigh=1.0)\n    print(spec.render())\n    spec = SPECTRUM(mdc=36, dir1=0, dir2=180, flow=0.04, msc=31)\n    print(spec.render())",
         "properties": {
            "model_type": {
               "default": "spectrum",
               "description": "Model type discriminator",
               "enum": [
                  "spectrum",
                  "SPECTRUM"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mdc": {
               "description": "Number of meshes in theta-space. In the case of CIRCLE, this is the number of subdivisions of the 360 degrees of a circle so `dtheta = [360]/[mdc]` is the spectral directional resolution. In the case of SECTOR, `dtheta = ([dir2] - [dir1])/[mdc]`. The minimum number of directional bins is 3 per directional quadrant.",
               "title": "Mdc",
               "type": "integer"
            },
            "flow": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Lowest discrete frequency that is used in the calculation (in Hz).",
               "title": "Flow"
            },
            "fhigh": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Highest discrete frequency that is used in the calculation (in Hz).",
               "title": "Fhigh"
            },
            "msc": {
               "anyOf": [
                  {
                     "minimum": 3,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "One less than the number of frequencies. This defines the grid resolution in frequency-space between the lowest discrete frequency `flow` and the highest discrete frequency `fhigh`. This resolution is not constant, since the frequencies are distributed logarithmical: `fi+1 = yfi` where `y` is a constant. The minimum number of frequencies is 4",
               "title": "Msc"
            },
            "dir1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the right-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir1"
            },
            "dir2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The direction of the left-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
               "title": "Dir2"
            }
         },
         "required": [
            "mdc"
         ],
         "title": "SPECTRUM",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "spectrum"
   ]
}

Fields:
Validators:
field fname: str | None = None

Name of the file containing the unstructured grid

Constraints:
  • max_length = 36

Validated by:
field grid_type: Literal['adcirc', 'triangle', 'easymesh'] = 'adcirc'

Unstructured grid type

Validated by:
field model_type: Literal['unstructured'] = 'unstructured'

Model type discriminator

Validated by:
field spectrum: SPECTRUM [Required]

Spectrum subcomponent

Validated by:
validator check_fname_required  »  all fields[source]

Check that fname needs to be provided.

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

Inpgrid#

Input grid for SWAN.

pydantic model rompy.swan.components.inpgrid.CURVILINEAR[source]

SWAN curvilinear input grid.

INPGRID [grid_type] CURVILINEAR [stagrx] [stagry] [mxinp] [myinp] &
    (EXCEPTION [excval]) &
    (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])
READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &
    ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])

This is a group component that includes an INPGRID and a READGRID component.

Examples

In [1]: from rompy.swan.components.inpgrid import CURVILINEAR

In [2]: inpgrid = CURVILINEAR(
   ...:     grid_type="wind",
   ...:     stagrx=0.0,
   ...:     stagry=0.0,
   ...:     mxinp=199,
   ...:     myinp=199,
   ...:     excval=-99.0,
   ...:     readinp=dict(fname1="wind.txt"),
   ...:     nonstationary=dict(
   ...:         tbeg="2019-01-01T00:00:00",
   ...:         tend="2019-01-07 00:00:00",
   ...:         delt=3600,
   ...:         dfmt="hr",
   ...:     ),
   ...: )
   ...: 

In [3]: print(inpgrid.render())
INPGRID WIND CURVILINEAR stagrx=0.0 stagry=0.0 mxinp=199 myinp=199  EXCEPTION excval=-99.0 NONSTATIONARY tbeginp=20190101.000000 deltinp=1.0 HR tendinp=20190107.000000
READINP WIND fac=1.0 fname1='wind.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

TODO: Handle (or not) setting default values for mxinp and myinp from cgrid.

Show JSON schema
{
   "title": "CURVILINEAR",
   "description": "SWAN curvilinear input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] CURVILINEAR [stagrx] [stagry] [mxinp] [myinp] &\n        (EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is a group component that includes an `INPGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import CURVILINEAR\n    inpgrid = CURVILINEAR(\n        grid_type=\"wind\",\n        stagrx=0.0,\n        stagry=0.0,\n        mxinp=199,\n        myinp=199,\n        excval=-99.0,\n        readinp=dict(fname1=\"wind.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    print(inpgrid.render())\n\nTODO: Handle (or not) setting default values for mxinp and myinp from cgrid.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "curvilinear",
         "description": "Model type discriminator",
         "enum": [
            "curvilinear",
            "CURVILINEAR"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "grid_type": {
         "$ref": "#/$defs/GridOptions",
         "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
      },
      "excval": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
         "title": "Excval"
      },
      "nonstationary": {
         "anyOf": [
            {
               "$ref": "#/$defs/NONSTATIONARY"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Nonstationary time specification"
      },
      "readinp": {
         "$ref": "#/$defs/READINP",
         "description": "SWAN input grid file reader specification"
      },
      "stagrx": {
         "default": 0.0,
         "description": "Staggered x'-direction with respect to computational grid, e.g., `stagrx=0.5` means that the input grid points are shifted a half step in x'-direction; in many flow models x-velocities are defined in points shifted a half step in x'-direction",
         "title": "Stagrx",
         "type": "number"
      },
      "stagry": {
         "default": 0.0,
         "description": "Staggered y'-direction with respect to computational grid, e.g., `stagry=0.5` means that the input grid points are shifted a half step in y'-direction; in many flow models y-velocities are defined in points shifted a half step in y'-direction",
         "title": "Stagry",
         "type": "number"
      },
      "mxinp": {
         "description": "Number of meshes in \u03be-direction of the input grid (this number is one less than the number of grid points in this direction)",
         "title": "Mxinp",
         "type": "integer"
      },
      "myinp": {
         "description": "Number of meshes in \u03b7-direction of the input grid (this number is one less than the number of grid points in this direction)",
         "title": "Myinp",
         "type": "integer"
      }
   },
   "$defs": {
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      },
      "NONSTATIONARY": {
         "additionalProperties": false,
         "description": "Nonstationary time specification.\n\n.. code-block:: text\n\n    NONSTATIONARY [tbeg] [delt] SEC|MIN|HR|DAY [tend]\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    nonstat = NONSTATIONARY(\n        tbeg=\"2012-01-01T00:00:00\",\n        tend=\"2012-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    print(nonstat.render())\n    from datetime import datetime, timedelta\n    nonstat = NONSTATIONARY(\n        tbeg=datetime(1990, 1, 1),\n        tend=datetime(1990, 1, 7),\n        delt=timedelta(minutes=30),\n        tfmt=1,\n        dfmt=\"min\",\n        suffix=\"tbl\",\n    )\n    print(nonstat.render())",
         "properties": {
            "model_type": {
               "default": "nonstationary",
               "description": "Model type discriminator",
               "enum": [
                  "nonstationary",
                  "NONSTATIONARY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "tbeg": {
               "default": "1970-01-01T00:00:00",
               "description": "Start time",
               "format": "date-time",
               "title": "Tbeg",
               "type": "string"
            },
            "delt": {
               "default": "PT1H",
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            },
            "suffix": {
               "default": "",
               "description": "Suffix to prepend to argument names when rendering",
               "title": "Suffix",
               "type": "string"
            },
            "tend": {
               "default": "1970-01-02T00:00:00",
               "description": "End time",
               "format": "date-time",
               "title": "Tend",
               "type": "string"
            }
         },
         "title": "NONSTATIONARY",
         "type": "object"
      },
      "READINP": {
         "additionalProperties": false,
         "description": "SWAN input grid reader.\n\n.. code-block:: text\n\n    READINP GRID_TYPE [fac] ('fname1' | SERIES 'fname2') [idla] [nhedf] &\n        ([nhedt]) [nhedvec] FREE|FORMAT ('form'|idfm)|UNFORMATTED`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READINP\n    readinp = READINP(\n        grid_type=\"wind\",\n        fname1=\"wind.txt\",\n        fac=1.0,\n        idla=3,\n        format=\"free\",\n    )\n    print(readinp.render())",
         "properties": {
            "model_type": {
               "default": "readinp",
               "description": "Model type discriminator",
               "enum": [
                  "readinp",
                  "READINP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GridOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of the SWAN grid file"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "exclusiveMinimum": 0.0,
               "title": "Fac",
               "type": "number"
            },
            "idla": {
               "$ref": "#/$defs/IDLA",
               "default": 1,
               "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
            },
            "nhedf": {
               "default": 0,
               "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
               "minimum": 0,
               "title": "Nhedf",
               "type": "integer"
            },
            "nhedvec": {
               "default": 0,
               "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
               "minimum": 0,
               "title": "Nhedvec",
               "type": "integer"
            },
            "format": {
               "default": "free",
               "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
               "enum": [
                  "free",
                  "fixed",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            },
            "form": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
               "title": "Form"
            },
            "idfm": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        5,
                        6,
                        8
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "File format identifier, only used if `format='fixed'`",
               "title": "Idfm"
            },
            "fname1": {
               "description": "Name of the file with the values of the variable.",
               "title": "Fname1",
               "type": "string"
            },
            "fname2": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of file that contains the names of the files where the variables are given when the SERIES option is used. These names are to be given in proper time sequence. SWAN reads the next file when the previous file end has been encountered. In these files the input should be given in the same format as in the above file 'fname1' (that implies that a file should start with the start of an input time step)",
               "title": "Fname2"
            },
            "nhedt": {
               "default": 0,
               "description": "Only if variable is time dependent: number of header lines in the file at the start of each time level. A time step may start with more header lines than `nhedt` because the variable may be a vector variable which has its own header lines (see `nhedvec`)",
               "minimum": 0,
               "title": "Nhedt",
               "type": "integer"
            }
         },
         "required": [
            "fname1"
         ],
         "title": "READINP",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "grid_type",
      "readinp",
      "mxinp",
      "myinp"
   ]
}

Fields:
Validators:
  • set_nonstat_suffix » all fields

field excval: float | None = None

Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If fac != 1, excval must be given as fac times the exception value

Validated by:
  • set_nonstat_suffix

field grid_type: GridOptions [Required]

Type of the swan input grid, e.g, ‘bottom’, ‘wind’, etc

Validated by:
  • set_nonstat_suffix

field model_type: Literal['curvilinear', 'CURVILINEAR'] = 'curvilinear'

Model type discriminator

Validated by:
  • set_nonstat_suffix

field mxinp: int [Required]

Number of meshes in ξ-direction of the input grid (this number is one less than the number of grid points in this direction)

Validated by:
  • set_nonstat_suffix

field myinp: int [Required]

Number of meshes in η-direction of the input grid (this number is one less than the number of grid points in this direction)

Validated by:
  • set_nonstat_suffix

field nonstationary: NONSTATIONARY | None = None

Nonstationary time specification

Validated by:
  • set_nonstat_suffix

field readinp: READINP [Required]

SWAN input grid file reader specification

Validated by:
  • set_nonstat_suffix

field stagrx: float = 0.0

Staggered x’-direction with respect to computational grid, e.g., stagrx=0.5 means that the input grid points are shifted a half step in x’-direction; in many flow models x-velocities are defined in points shifted a half step in x’-direction

Validated by:
  • set_nonstat_suffix

field stagry: float = 0.0

Staggered y’-direction with respect to computational grid, e.g., stagry=0.5 means that the input grid points are shifted a half step in y’-direction; in many flow models y-velocities are defined in points shifted a half step in y’-direction

Validated by:
  • set_nonstat_suffix

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

validator set_nonstat_suffix  »  all fields

Set the nonstationary suffix.

pydantic model rompy.swan.components.inpgrid.ICE[source]

Constant wind input field.

ICE [aice] [hice]

With this optional command, the user indicates that one or more ice fields are constant.

Examples

In [1]: from rompy.swan.components.inpgrid import ICE

In [2]: ice = ICE(aice=0.1, hice=0.1)

In [3]: print(ice.render())
ICE aice=0.1 hice=0.1

Show JSON schema
{
   "title": "ICE",
   "description": "Constant wind input field.\n\n.. code-block:: text\n\n    ICE [aice] [hice]\n\nWith this optional command, the user indicates that one or more ice fields are\nconstant.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import ICE\n    ice = ICE(aice=0.1, hice=0.1)\n    print(ice.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "ice",
         "description": "Model type discriminator",
         "enum": [
            "ice",
            "ICE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "aice": {
         "description": "Areal ice fraction, a number from 0 to 1",
         "maximum": 1.0,
         "minimum": 0.0,
         "title": "Aice",
         "type": "number"
      },
      "hice": {
         "description": "Ice thickness (m)",
         "minimum": 0.0,
         "title": "Hice",
         "type": "number"
      }
   },
   "additionalProperties": false,
   "required": [
      "aice",
      "hice"
   ]
}

Fields:
field aice: float [Required]

Areal ice fraction, a number from 0 to 1

Constraints:
  • ge = 0.0

  • le = 1.0

field hice: float [Required]

Ice thickness (m)

Constraints:
  • ge = 0.0

field model_type: Literal['ice', 'ICE'] = 'ice'

Model type discriminator

cmd()[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.inpgrid.INPGRID[source]

SWAN input grid.

INPGRID [grid_type] ->REGULAR|CURVILINEAR|UNSTRUCTURED (EXCEPTION [excval]) &
    (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])

This is the base class for all input grids. It is not meant to be used directly.

Show JSON schema
{
   "title": "INPGRID",
   "description": "SWAN input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] ->REGULAR|CURVILINEAR|UNSTRUCTURED (EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n\nThis is the base class for all input grids. It is not meant to be used directly.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "inpgrid",
         "description": "Model type discriminator",
         "enum": [
            "inpgrid",
            "INPGRID"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "grid_type": {
         "$ref": "#/$defs/GridOptions",
         "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
      },
      "excval": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
         "title": "Excval"
      },
      "nonstationary": {
         "anyOf": [
            {
               "$ref": "#/$defs/NONSTATIONARY"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Nonstationary time specification"
      },
      "readinp": {
         "$ref": "#/$defs/READINP",
         "description": "SWAN input grid file reader specification"
      }
   },
   "$defs": {
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      },
      "NONSTATIONARY": {
         "additionalProperties": false,
         "description": "Nonstationary time specification.\n\n.. code-block:: text\n\n    NONSTATIONARY [tbeg] [delt] SEC|MIN|HR|DAY [tend]\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    nonstat = NONSTATIONARY(\n        tbeg=\"2012-01-01T00:00:00\",\n        tend=\"2012-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    print(nonstat.render())\n    from datetime import datetime, timedelta\n    nonstat = NONSTATIONARY(\n        tbeg=datetime(1990, 1, 1),\n        tend=datetime(1990, 1, 7),\n        delt=timedelta(minutes=30),\n        tfmt=1,\n        dfmt=\"min\",\n        suffix=\"tbl\",\n    )\n    print(nonstat.render())",
         "properties": {
            "model_type": {
               "default": "nonstationary",
               "description": "Model type discriminator",
               "enum": [
                  "nonstationary",
                  "NONSTATIONARY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "tbeg": {
               "default": "1970-01-01T00:00:00",
               "description": "Start time",
               "format": "date-time",
               "title": "Tbeg",
               "type": "string"
            },
            "delt": {
               "default": "PT1H",
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            },
            "suffix": {
               "default": "",
               "description": "Suffix to prepend to argument names when rendering",
               "title": "Suffix",
               "type": "string"
            },
            "tend": {
               "default": "1970-01-02T00:00:00",
               "description": "End time",
               "format": "date-time",
               "title": "Tend",
               "type": "string"
            }
         },
         "title": "NONSTATIONARY",
         "type": "object"
      },
      "READINP": {
         "additionalProperties": false,
         "description": "SWAN input grid reader.\n\n.. code-block:: text\n\n    READINP GRID_TYPE [fac] ('fname1' | SERIES 'fname2') [idla] [nhedf] &\n        ([nhedt]) [nhedvec] FREE|FORMAT ('form'|idfm)|UNFORMATTED`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READINP\n    readinp = READINP(\n        grid_type=\"wind\",\n        fname1=\"wind.txt\",\n        fac=1.0,\n        idla=3,\n        format=\"free\",\n    )\n    print(readinp.render())",
         "properties": {
            "model_type": {
               "default": "readinp",
               "description": "Model type discriminator",
               "enum": [
                  "readinp",
                  "READINP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GridOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of the SWAN grid file"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "exclusiveMinimum": 0.0,
               "title": "Fac",
               "type": "number"
            },
            "idla": {
               "$ref": "#/$defs/IDLA",
               "default": 1,
               "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
            },
            "nhedf": {
               "default": 0,
               "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
               "minimum": 0,
               "title": "Nhedf",
               "type": "integer"
            },
            "nhedvec": {
               "default": 0,
               "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
               "minimum": 0,
               "title": "Nhedvec",
               "type": "integer"
            },
            "format": {
               "default": "free",
               "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
               "enum": [
                  "free",
                  "fixed",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            },
            "form": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
               "title": "Form"
            },
            "idfm": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        5,
                        6,
                        8
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "File format identifier, only used if `format='fixed'`",
               "title": "Idfm"
            },
            "fname1": {
               "description": "Name of the file with the values of the variable.",
               "title": "Fname1",
               "type": "string"
            },
            "fname2": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of file that contains the names of the files where the variables are given when the SERIES option is used. These names are to be given in proper time sequence. SWAN reads the next file when the previous file end has been encountered. In these files the input should be given in the same format as in the above file 'fname1' (that implies that a file should start with the start of an input time step)",
               "title": "Fname2"
            },
            "nhedt": {
               "default": 0,
               "description": "Only if variable is time dependent: number of header lines in the file at the start of each time level. A time step may start with more header lines than `nhedt` because the variable may be a vector variable which has its own header lines (see `nhedvec`)",
               "minimum": 0,
               "title": "Nhedt",
               "type": "integer"
            }
         },
         "required": [
            "fname1"
         ],
         "title": "READINP",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "grid_type",
      "readinp"
   ]
}

Fields:
  • excval (float | None)

  • grid_type (rompy.swan.types.GridOptions)

  • model_type (Literal['inpgrid', 'INPGRID'])

  • nonstationary (rompy.swan.subcomponents.time.NONSTATIONARY | None)

  • readinp (rompy.swan.subcomponents.readgrid.READINP)

Validators:
  • set_nonstat_suffix » all fields

field excval: float | None = None

Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If fac != 1, excval must be given as fac times the exception value

Validated by:
  • set_nonstat_suffix

field grid_type: GridOptions [Required]

Type of the swan input grid, e.g, ‘bottom’, ‘wind’, etc

Validated by:
  • set_nonstat_suffix

field model_type: Literal['inpgrid', 'INPGRID'] = 'inpgrid'

Model type discriminator

Validated by:
  • set_nonstat_suffix

field nonstationary: NONSTATIONARY | None = None

Nonstationary time specification

Validated by:
  • set_nonstat_suffix

field readinp: READINP [Required]

SWAN input grid file reader specification

Validated by:
  • set_nonstat_suffix

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

validator set_nonstat_suffix  »  all fields[source]

Set the nonstationary suffix.

pydantic model rompy.swan.components.inpgrid.REGULAR[source]

SWAN regular input grid.

INPGRID [grid_type] REGULAR [xpinp] [ypinp] [alpinp] [mxinp] [myinp] &
    [dxinp] [dyinp] (EXCEPTION [excval]) &
    (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])
READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &
    ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])

This is a group component that includes an INPGRID and a READGRID component.

Examples

In [1]: from rompy.swan.components.inpgrid import REGULAR

In [2]: inpgrid = REGULAR(
   ...:     grid_type="bottom",
   ...:     excval=-99.0,
   ...:     xpinp=172.0,
   ...:     ypinp=-41.0,
   ...:     alpinp=0.0,
   ...:     mxinp=99,
   ...:     myinp=99,
   ...:     dxinp=0.005,
   ...:     dyinp=0.005,
   ...:     readinp=dict(fname1="bottom.txt"),
   ...: )
   ...: 

In [3]: print(inpgrid.render())
INPGRID BOTTOM REGULAR xpinp=172.0 ypinp=-41.0 alpinp=0.0 mxinp=99 myinp=99 dxinp=0.005 dyinp=0.005 EXCEPTION excval=-99.0
READINP BOTTOM fac=1.0 fname1='bottom.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

In [4]: inpgrid = REGULAR(
   ...:     grid_type="wind",
   ...:     excval=-99.0,
   ...:     xpinp=172.0,
   ...:     ypinp=-41.0,
   ...:     alpinp=0.0,
   ...:     mxinp=99,
   ...:     myinp=99,
   ...:     dxinp=0.005,
   ...:     dyinp=0.005,
   ...:     readinp=dict(fname1="wind.txt"),
   ...:     nonstationary=dict(
   ...:         tbeg="2019-01-01T00:00:00",
   ...:         tend="2019-01-07 00:00:00",
   ...:         delt=3600,
   ...:         dfmt="hr",
   ...:     ),
   ...: )
   ...: 

In [5]: print(inpgrid.render())
INPGRID WIND REGULAR xpinp=172.0 ypinp=-41.0 alpinp=0.0 mxinp=99 myinp=99 dxinp=0.005 dyinp=0.005 EXCEPTION excval=-99.0 NONSTATIONARY tbeginp=20190101.000000 deltinp=1.0 HR &
    tendinp=20190107.000000
READINP WIND fac=1.0 fname1='wind.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

TODO: Use grid object, requires different grid parameters to be allowed.

Show JSON schema
{
   "title": "REGULAR",
   "description": "SWAN regular input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] REGULAR [xpinp] [ypinp] [alpinp] [mxinp] [myinp] &\n        [dxinp] [dyinp] (EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is a group component that includes an `INPGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import REGULAR\n    inpgrid = REGULAR(\n        grid_type=\"bottom\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"bottom.txt\"),\n    )\n    print(inpgrid.render())\n    inpgrid = REGULAR(\n        grid_type=\"wind\",\n        excval=-99.0,\n        xpinp=172.0,\n        ypinp=-41.0,\n        alpinp=0.0,\n        mxinp=99,\n        myinp=99,\n        dxinp=0.005,\n        dyinp=0.005,\n        readinp=dict(fname1=\"wind.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    print(inpgrid.render())\n\nTODO: Use grid object, requires different grid parameters to be allowed.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "regular",
         "description": "Model type discriminator",
         "enum": [
            "regular",
            "REGULAR"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "grid_type": {
         "$ref": "#/$defs/GridOptions",
         "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
      },
      "excval": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
         "title": "Excval"
      },
      "nonstationary": {
         "anyOf": [
            {
               "$ref": "#/$defs/NONSTATIONARY"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Nonstationary time specification"
      },
      "readinp": {
         "$ref": "#/$defs/READINP",
         "description": "SWAN input grid file reader specification"
      },
      "xpinp": {
         "description": "Geographic location (x-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default",
         "title": "Xpinp",
         "type": "number"
      },
      "ypinp": {
         "description": "Geographic location (y-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default",
         "title": "Ypinp",
         "type": "number"
      },
      "alpinp": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": 0.0,
         "description": "Direction of the positive x-axis of the input grid (in degrees, Cartesian convention)",
         "title": "Alpinp"
      },
      "mxinp": {
         "description": "Number of meshes in x-direction of the input grid (this number is one less than the number of grid points in this direction)",
         "title": "Mxinp",
         "type": "integer"
      },
      "myinp": {
         "description": "Number of meshes in y-direction of the input grid (this number is one less than the number of grid points in this direction). In 1D-mode, `myinp` should be 0",
         "title": "Myinp",
         "type": "integer"
      },
      "dxinp": {
         "description": "Mesh size in x-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used",
         "title": "Dxinp",
         "type": "number"
      },
      "dyinp": {
         "description": "Mesh size in y-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used. In 1D-mode, `dyinp` may have any value",
         "title": "Dyinp",
         "type": "number"
      }
   },
   "$defs": {
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      },
      "NONSTATIONARY": {
         "additionalProperties": false,
         "description": "Nonstationary time specification.\n\n.. code-block:: text\n\n    NONSTATIONARY [tbeg] [delt] SEC|MIN|HR|DAY [tend]\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    nonstat = NONSTATIONARY(\n        tbeg=\"2012-01-01T00:00:00\",\n        tend=\"2012-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    print(nonstat.render())\n    from datetime import datetime, timedelta\n    nonstat = NONSTATIONARY(\n        tbeg=datetime(1990, 1, 1),\n        tend=datetime(1990, 1, 7),\n        delt=timedelta(minutes=30),\n        tfmt=1,\n        dfmt=\"min\",\n        suffix=\"tbl\",\n    )\n    print(nonstat.render())",
         "properties": {
            "model_type": {
               "default": "nonstationary",
               "description": "Model type discriminator",
               "enum": [
                  "nonstationary",
                  "NONSTATIONARY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "tbeg": {
               "default": "1970-01-01T00:00:00",
               "description": "Start time",
               "format": "date-time",
               "title": "Tbeg",
               "type": "string"
            },
            "delt": {
               "default": "PT1H",
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            },
            "suffix": {
               "default": "",
               "description": "Suffix to prepend to argument names when rendering",
               "title": "Suffix",
               "type": "string"
            },
            "tend": {
               "default": "1970-01-02T00:00:00",
               "description": "End time",
               "format": "date-time",
               "title": "Tend",
               "type": "string"
            }
         },
         "title": "NONSTATIONARY",
         "type": "object"
      },
      "READINP": {
         "additionalProperties": false,
         "description": "SWAN input grid reader.\n\n.. code-block:: text\n\n    READINP GRID_TYPE [fac] ('fname1' | SERIES 'fname2') [idla] [nhedf] &\n        ([nhedt]) [nhedvec] FREE|FORMAT ('form'|idfm)|UNFORMATTED`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READINP\n    readinp = READINP(\n        grid_type=\"wind\",\n        fname1=\"wind.txt\",\n        fac=1.0,\n        idla=3,\n        format=\"free\",\n    )\n    print(readinp.render())",
         "properties": {
            "model_type": {
               "default": "readinp",
               "description": "Model type discriminator",
               "enum": [
                  "readinp",
                  "READINP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GridOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of the SWAN grid file"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "exclusiveMinimum": 0.0,
               "title": "Fac",
               "type": "number"
            },
            "idla": {
               "$ref": "#/$defs/IDLA",
               "default": 1,
               "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
            },
            "nhedf": {
               "default": 0,
               "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
               "minimum": 0,
               "title": "Nhedf",
               "type": "integer"
            },
            "nhedvec": {
               "default": 0,
               "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
               "minimum": 0,
               "title": "Nhedvec",
               "type": "integer"
            },
            "format": {
               "default": "free",
               "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
               "enum": [
                  "free",
                  "fixed",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            },
            "form": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
               "title": "Form"
            },
            "idfm": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        5,
                        6,
                        8
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "File format identifier, only used if `format='fixed'`",
               "title": "Idfm"
            },
            "fname1": {
               "description": "Name of the file with the values of the variable.",
               "title": "Fname1",
               "type": "string"
            },
            "fname2": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of file that contains the names of the files where the variables are given when the SERIES option is used. These names are to be given in proper time sequence. SWAN reads the next file when the previous file end has been encountered. In these files the input should be given in the same format as in the above file 'fname1' (that implies that a file should start with the start of an input time step)",
               "title": "Fname2"
            },
            "nhedt": {
               "default": 0,
               "description": "Only if variable is time dependent: number of header lines in the file at the start of each time level. A time step may start with more header lines than `nhedt` because the variable may be a vector variable which has its own header lines (see `nhedvec`)",
               "minimum": 0,
               "title": "Nhedt",
               "type": "integer"
            }
         },
         "required": [
            "fname1"
         ],
         "title": "READINP",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "grid_type",
      "readinp",
      "xpinp",
      "ypinp",
      "mxinp",
      "myinp",
      "dxinp",
      "dyinp"
   ]
}

Fields:
Validators:
  • set_nonstat_suffix » all fields

field alpinp: float | None = 0.0

Direction of the positive x-axis of the input grid (in degrees, Cartesian convention)

Validated by:
  • set_nonstat_suffix

field dxinp: float [Required]

Mesh size in x-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used

Validated by:
  • set_nonstat_suffix

field dyinp: float [Required]

Mesh size in y-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used. In 1D-mode, dyinp may have any value

Validated by:
  • set_nonstat_suffix

field excval: float | None = None

Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If fac != 1, excval must be given as fac times the exception value

Validated by:
  • set_nonstat_suffix

field grid_type: GridOptions [Required]

Type of the swan input grid, e.g, ‘bottom’, ‘wind’, etc

Validated by:
  • set_nonstat_suffix

field model_type: Literal['regular', 'REGULAR'] = 'regular'

Model type discriminator

Validated by:
  • set_nonstat_suffix

field mxinp: int [Required]

Number of meshes in x-direction of the input grid (this number is one less than the number of grid points in this direction)

Validated by:
  • set_nonstat_suffix

field myinp: int [Required]

Number of meshes in y-direction of the input grid (this number is one less than the number of grid points in this direction). In 1D-mode, myinp should be 0

Validated by:
  • set_nonstat_suffix

field nonstationary: NONSTATIONARY | None = None

Nonstationary time specification

Validated by:
  • set_nonstat_suffix

field readinp: READINP [Required]

SWAN input grid file reader specification

Validated by:
  • set_nonstat_suffix

field xpinp: float [Required]

Geographic location (x-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default

Validated by:
  • set_nonstat_suffix

field ypinp: float [Required]

Geographic location (y-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default

Validated by:
  • set_nonstat_suffix

cmd() list[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

validator set_nonstat_suffix  »  all fields

Set the nonstationary suffix.

pydantic model rompy.swan.components.inpgrid.UNSTRUCTURED[source]

SWAN unstructured input grid.

INPGRID [grid_type] UNSTRUCTURED EXCEPTION [excval]) &
    (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])
READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &
    ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])

This is a group component that includes an INPGRID and a READGRID component.

Examples

In [1]: from rompy.swan.components.inpgrid import UNSTRUCTURED

In [2]: inpgrid = UNSTRUCTURED(
   ...:     grid_type="bottom",
   ...:     excval=-99.0,
   ...:     readinp=dict(fname1="bottom.txt"),
   ...:     nonstationary=dict(
   ...:         tbeg="2019-01-01T00:00:00",
   ...:         tend="2019-01-07 00:00:00",
   ...:         delt=3600,
   ...:         dfmt="hr",
   ...:     ),
   ...: )
   ...: 

In [3]: print(inpgrid.render())
INPGRID BOTTOM UNSTRUCTURED EXCEPTION excval=-99.0 NONSTATIONARY tbeginp=20190101.000000 deltinp=1.0 HR tendinp=20190107.000000
READINP BOTTOM fac=1.0 fname1='bottom.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

Show JSON schema
{
   "title": "UNSTRUCTURED",
   "description": "SWAN unstructured input grid.\n\n.. code-block:: text\n\n    INPGRID [grid_type] UNSTRUCTURED EXCEPTION [excval]) &\n        (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp])\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is a group component that includes an `INPGRID` and a `READGRID` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import UNSTRUCTURED\n    inpgrid = UNSTRUCTURED(\n        grid_type=\"bottom\",\n        excval=-99.0,\n        readinp=dict(fname1=\"bottom.txt\"),\n        nonstationary=dict(\n            tbeg=\"2019-01-01T00:00:00\",\n            tend=\"2019-01-07 00:00:00\",\n            delt=3600,\n            dfmt=\"hr\",\n        ),\n    )\n    print(inpgrid.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "unstructured",
         "description": "Model type discriminator",
         "enum": [
            "unstructured",
            "UNSTRUCTURED"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "grid_type": {
         "$ref": "#/$defs/GridOptions",
         "description": "Type of the swan input grid, e.g, 'bottom', 'wind', etc"
      },
      "excval": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If `fac` != 1, `excval` must be given as `fac` times the exception value",
         "title": "Excval"
      },
      "nonstationary": {
         "anyOf": [
            {
               "$ref": "#/$defs/NONSTATIONARY"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Nonstationary time specification"
      },
      "readinp": {
         "$ref": "#/$defs/READINP",
         "description": "SWAN input grid file reader specification"
      }
   },
   "$defs": {
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      },
      "NONSTATIONARY": {
         "additionalProperties": false,
         "description": "Nonstationary time specification.\n\n.. code-block:: text\n\n    NONSTATIONARY [tbeg] [delt] SEC|MIN|HR|DAY [tend]\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    nonstat = NONSTATIONARY(\n        tbeg=\"2012-01-01T00:00:00\",\n        tend=\"2012-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    print(nonstat.render())\n    from datetime import datetime, timedelta\n    nonstat = NONSTATIONARY(\n        tbeg=datetime(1990, 1, 1),\n        tend=datetime(1990, 1, 7),\n        delt=timedelta(minutes=30),\n        tfmt=1,\n        dfmt=\"min\",\n        suffix=\"tbl\",\n    )\n    print(nonstat.render())",
         "properties": {
            "model_type": {
               "default": "nonstationary",
               "description": "Model type discriminator",
               "enum": [
                  "nonstationary",
                  "NONSTATIONARY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "tbeg": {
               "default": "1970-01-01T00:00:00",
               "description": "Start time",
               "format": "date-time",
               "title": "Tbeg",
               "type": "string"
            },
            "delt": {
               "default": "PT1H",
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "tfmt": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "string"
                  }
               ],
               "default": 1,
               "description": "Format to render time specification",
               "title": "Tfmt"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            },
            "suffix": {
               "default": "",
               "description": "Suffix to prepend to argument names when rendering",
               "title": "Suffix",
               "type": "string"
            },
            "tend": {
               "default": "1970-01-02T00:00:00",
               "description": "End time",
               "format": "date-time",
               "title": "Tend",
               "type": "string"
            }
         },
         "title": "NONSTATIONARY",
         "type": "object"
      },
      "READINP": {
         "additionalProperties": false,
         "description": "SWAN input grid reader.\n\n.. code-block:: text\n\n    READINP GRID_TYPE [fac] ('fname1' | SERIES 'fname2') [idla] [nhedf] &\n        ([nhedt]) [nhedvec] FREE|FORMAT ('form'|idfm)|UNFORMATTED`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READINP\n    readinp = READINP(\n        grid_type=\"wind\",\n        fname1=\"wind.txt\",\n        fac=1.0,\n        idla=3,\n        format=\"free\",\n    )\n    print(readinp.render())",
         "properties": {
            "model_type": {
               "default": "readinp",
               "description": "Model type discriminator",
               "enum": [
                  "readinp",
                  "READINP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "grid_type": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/GridOptions"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Type of the SWAN grid file"
            },
            "fac": {
               "default": 1.0,
               "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
               "exclusiveMinimum": 0.0,
               "title": "Fac",
               "type": "number"
            },
            "idla": {
               "$ref": "#/$defs/IDLA",
               "default": 1,
               "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
            },
            "nhedf": {
               "default": 0,
               "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
               "minimum": 0,
               "title": "Nhedf",
               "type": "integer"
            },
            "nhedvec": {
               "default": 0,
               "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
               "minimum": 0,
               "title": "Nhedvec",
               "type": "integer"
            },
            "format": {
               "default": "free",
               "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
               "enum": [
                  "free",
                  "fixed",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            },
            "form": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
               "title": "Form"
            },
            "idfm": {
               "anyOf": [
                  {
                     "enum": [
                        1,
                        5,
                        6,
                        8
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "File format identifier, only used if `format='fixed'`",
               "title": "Idfm"
            },
            "fname1": {
               "description": "Name of the file with the values of the variable.",
               "title": "Fname1",
               "type": "string"
            },
            "fname2": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Name of file that contains the names of the files where the variables are given when the SERIES option is used. These names are to be given in proper time sequence. SWAN reads the next file when the previous file end has been encountered. In these files the input should be given in the same format as in the above file 'fname1' (that implies that a file should start with the start of an input time step)",
               "title": "Fname2"
            },
            "nhedt": {
               "default": 0,
               "description": "Only if variable is time dependent: number of header lines in the file at the start of each time level. A time step may start with more header lines than `nhedt` because the variable may be a vector variable which has its own header lines (see `nhedvec`)",
               "minimum": 0,
               "title": "Nhedt",
               "type": "integer"
            }
         },
         "required": [
            "fname1"
         ],
         "title": "READINP",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "grid_type",
      "readinp"
   ]
}

Fields:
Validators:
  • set_nonstat_suffix » all fields

field excval: float | None = None

Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If fac != 1, excval must be given as fac times the exception value

Validated by:
  • set_nonstat_suffix

field grid_type: GridOptions [Required]

Type of the swan input grid, e.g, ‘bottom’, ‘wind’, etc

Validated by:
  • set_nonstat_suffix

field model_type: Literal['unstructured', 'UNSTRUCTURED'] = 'unstructured'

Model type discriminator

Validated by:
  • set_nonstat_suffix

field nonstationary: NONSTATIONARY | None = None

Nonstationary time specification

Validated by:
  • set_nonstat_suffix

field readinp: READINP [Required]

SWAN input grid file reader specification

Validated by:
  • set_nonstat_suffix

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

validator set_nonstat_suffix  »  all fields

Set the nonstationary suffix.

pydantic model rompy.swan.components.inpgrid.WIND[source]

Constant wind input field.

WIND [vel] [dir]

With this optional command, the user indicates that the wind field is constant.

Examples

In [1]: from rompy.swan.components.inpgrid import WIND

In [2]: wind = WIND(vel=10.0, dir=270.0)

In [3]: print(wind.render())
WIND vel=10.0 dir=270.0

Show JSON schema
{
   "title": "WIND",
   "description": "Constant wind input field.\n\n.. code-block:: text\n\n    WIND [vel] [dir]\n\nWith this optional command, the user indicates that the wind field is constant.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.inpgrid import WIND\n    wind = WIND(vel=10.0, dir=270.0)\n    print(wind.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "wind",
         "description": "Model type discriminator",
         "enum": [
            "wind",
            "WIND"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "vel": {
         "description": "Wind velocity at 10 m elevation (m/s)",
         "minimum": 0.0,
         "title": "Vel",
         "type": "number"
      },
      "dir": {
         "description": "Wind direction at 10 m elevation (in degrees, Cartesian or Nautical convention, see command SET)",
         "maximum": 360.0,
         "minimum": -180.0,
         "title": "Dir",
         "type": "number"
      }
   },
   "additionalProperties": false,
   "required": [
      "vel",
      "dir"
   ]
}

Fields:
field dir: float [Required]

Wind direction at 10 m elevation (in degrees, Cartesian or Nautical convention, see command SET)

Constraints:
  • ge = -180.0

  • le = 360.0

field model_type: Literal['wind', 'WIND'] = 'wind'

Model type discriminator

field vel: float [Required]

Wind velocity at 10 m elevation (m/s)

Constraints:
  • ge = 0.0

cmd()[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

Boundary#

Boundary for SWAN.

pydantic model rompy.swan.components.boundary.BOUNDNEST1[source]

Boundary spectra from a coarser SWAN nest.

BOUNDNEST1 NEST 'fname' ->CLOSED|OPEN

With this optional command a nested SWAN run can be carried out with the boundary conditions obtained from a coarse grid SWAN run (generated in that previous SWAN run with command NESTOUT). The spectral frequencies and directions of the coarse grid run do not have to coincide with the frequencies and directions used in the nested SWAN run; SWAN will interpolate to these frequencies and directions in the nested run (see Section 2.6.3). To generate the nest boundary in the coarse grid run, use command NGRID. For the nested run, use the command CGRID with identical geographical information except the number of meshes (which will be much higher for the nested run). This BOUNDNEST1 command is not available for 1D computations; in such cases the commands SPECOUT and BOUNDSPEC can be used for the same purpose. A nested SWAN run must use the same coordinate system as the coarse grid SWAN run. For a curvilinear grid, it is advised to use the commands POINTS or CURVE and SPECOUT instead of NGRID and NESTOUT.

Examples

In [1]: from rompy.swan.components.boundary import BOUNDNEST1

In [2]: boundary = BOUNDNEST1(fname="boundary.swn", rectangle="closed")

In [3]: print(boundary.render())
BOUNDNEST1 NEST fname='boundary.swn' CLOSED

Show JSON schema
{
   "title": "BOUNDNEST1",
   "description": "Boundary spectra from a coarser SWAN nest.\n\n.. code-block:: text\n\n    BOUNDNEST1 NEST 'fname' ->CLOSED|OPEN\n\nWith this optional command a nested SWAN run can be carried out with the boundary\nconditions obtained from a coarse grid SWAN run (generated in that previous SWAN\nrun with command NESTOUT). The spectral frequencies and directions of the coarse\ngrid run do not have to coincide with the frequencies and directions used in the\nnested SWAN run; SWAN will interpolate to these frequencies and directions in the\nnested run (see Section 2.6.3). To generate the nest boundary in the coarse grid\nrun, use command NGRID. For the nested run, use the command CGRID with identical\ngeographical information except the number of meshes (which will be much higher for\nthe nested run). This BOUNDNEST1 command is not available for 1D computations; in\nsuch cases the commands SPECOUT and BOUNDSPEC can be used for the same purpose. A\nnested SWAN run must use the same coordinate system as the coarse grid SWAN run.\nFor a curvilinear grid, it is advised to use the commands POINTS or CURVE and\nSPECOUT instead of NGRID and NESTOUT.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDNEST1\n    boundary = BOUNDNEST1(fname=\"boundary.swn\", rectangle=\"closed\")\n    print(boundary.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundnest1",
         "description": "Model type discriminator",
         "enum": [
            "boundnest1",
            "BOUNDNEST1"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "fname": {
         "description": "Name of the file containing the boundary conditions for the present run, created by the previous SWAN coarse grid run. This file is structured according to the rules given in Appendix D for 2D spectra",
         "maxLength": 36,
         "minLength": 1,
         "title": "Fname",
         "type": "string"
      },
      "rectangle": {
         "default": "closed",
         "description": "Boundary is defined over a closed (default) or an open rectangle. Boundary generated from the NESTOUT command is aways closed",
         "enum": [
            "closed",
            "open"
         ],
         "title": "Rectangle",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname"
   ]
}

Fields:
field fname: str [Required]

Name of the file containing the boundary conditions for the present run, created by the previous SWAN coarse grid run. This file is structured according to the rules given in Appendix D for 2D spectra

Constraints:
  • min_length = 1

  • max_length = 36

field model_type: Literal['boundnest1', 'BOUNDNEST1'] = 'boundnest1'

Model type discriminator

field rectangle: Literal['closed', 'open'] = 'closed'

Boundary is defined over a closed (default) or an open rectangle. Boundary generated from the NESTOUT command is aways closed

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.boundary.BOUNDNEST2[source]

Boundary spectra from WAM.

BOUNDNEST2 WAMNEST 'fname' FREE|UNFORMATTED ->CRAY|WKSTAT [xgc] [ygc] [lwdate]

With this optional command (not fully tested) a nested SWAN run can be carried out with the boundary conditions obtained from a coarse grid WAM run (WAM Cycle 4.5, source code as distributed by the Max Planck Institute in Hamburg). The spectral frequencies and directions of the coarse grid run do not have to coincide with the frequencies and directions used in the nested SWAN run; SWAN will interpolate to these frequencies and directions in the nested run (see Section 2.6.3). Note that SWAN will accept output of a WAM output location only if the SWAN grid point on the nest boundary lies within a rectangle between two consecutive WAM output locations with a width equal to 0.1 times the distance between these output locations on either side of the line between these WAM output locations. This BOUNDNEST2 command is not available for 1D computations. Only boundary conditions generated by WAM Cycle 4.5 can be read properly by SWAN. A nested SWAN run may use either Cartesian or spherical coordinates. A curvilinear grid may be used in the nested grid but the boundaries of this nest should conform to the rectangular course grid nest boundaries. WAM output files are unformatted (binary); this usually implies that WAM and SWAN have to run on the same computer. For those cases where WAM and SWAN run on different types of machines (binary files do not transfer properly), the option FREE is available in this command. The distributed version of WAM does not support the required free format nesting output; WAM users who modify WAM such that it can make formatted output, must modify WAM such that the files made by WAM can be read in free format, i.e. with at least a blank or comma between numbers.

Note

the contents of ‘fname’ file could look like:

CBO9212010000
CBO9212020000
CBO9212030000

Examples

In [1]: from rompy.swan.components.boundary import BOUNDNEST2

In [2]: boundary = BOUNDNEST2(fname="boundary.wam", format="cray", lwdate=12)

In [3]: print(boundary.render())
BOUNDNEST2 WAMNEST fname='boundary.wam' UNFORMATTED CRAY lwdate=12

Show JSON schema
{
   "title": "BOUNDNEST2",
   "description": "Boundary spectra from WAM.\n\n.. code-block:: text\n\n    BOUNDNEST2 WAMNEST 'fname' FREE|UNFORMATTED ->CRAY|WKSTAT [xgc] [ygc] [lwdate]\n\nWith this optional command (not fully tested) a nested SWAN run can be carried out\nwith the boundary conditions obtained from a coarse grid WAM run (WAM Cycle 4.5,\nsource code as distributed by the Max Planck Institute in Hamburg). The spectral\nfrequencies and directions of the coarse grid run do not have to coincide with the\nfrequencies and directions used in the nested SWAN run; SWAN will interpolate to\nthese frequencies and directions in the nested run (see Section 2.6.3). Note that\nSWAN will accept output of a WAM output location only if the SWAN grid point on the\nnest boundary lies within a rectangle between two consecutive WAM output locations\nwith a width equal to 0.1 times the distance between these output locations on\neither side of the line between these WAM output locations. This BOUNDNEST2 command\nis not available for 1D computations. Only boundary conditions generated by WAM\nCycle 4.5 can be read properly by SWAN. A nested SWAN run may use either Cartesian\nor spherical coordinates. A curvilinear grid may be used in the nested grid but the\nboundaries of this nest should conform to the rectangular course grid nest\nboundaries. WAM output files are unformatted (binary); this usually implies that\nWAM and SWAN have to run on the same computer. For those cases where WAM and SWAN\nrun on different types of machines (binary files do not transfer properly), the\noption FREE is available in this command. The distributed version of WAM does not\nsupport the required free format nesting output; WAM users who modify WAM such that\nit can make formatted output, must modify WAM such that the files made by WAM can\nbe read in free format, i.e. with at least a blank or comma between numbers.\n\nNote\n----\nthe contents of 'fname' file could look like:\n\n.. code-block:: text\n\n    CBO9212010000\n    CBO9212020000\n    CBO9212030000\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDNEST2\n    boundary = BOUNDNEST2(fname=\"boundary.wam\", format=\"cray\", lwdate=12)\n    print(boundary.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundnest2",
         "description": "Model type discriminator",
         "enum": [
            "boundnest2",
            "BOUNDNEST2"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "fname": {
         "description": "A file name that contains all the names of WAM files containing the nested boundary conditions in time-sequence (usually one file per day)",
         "maxLength": 36,
         "minLength": 1,
         "title": "Fname",
         "type": "string"
      },
      "format": {
         "description": "Format of the WAM file. `cray`: CRAY version of WAM, `wkstat`: WORKSTATION version of WAM, `free`: Free format (these files are not generated standard by WAM)",
         "enum": [
            "cray",
            "wkstat",
            "free"
         ],
         "title": "Format",
         "type": "string"
      },
      "xgc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If SWAN is used with Cartesian coordinates: longitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `xgc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file",
         "title": "Xgc"
      },
      "ygc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If SWAN is used with Cartesian coordinates: latitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `ygc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file",
         "title": "Ygc"
      },
      "lwdate": {
         "default": 12,
         "description": "Length of character string for date-time as used in the WAM files. Possible values are: 10 (i.e. YYMMDDHHMM), 12 (i.e. YYMMDDHHMMSS) or 14 (i.e. YYYYMMDDHHMMSS) (SWAN default: `lwdate` = 12)",
         "enum": [
            10,
            12,
            14
         ],
         "title": "Lwdate",
         "type": "integer"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname",
      "format"
   ]
}

Fields:
field fname: str [Required]

A file name that contains all the names of WAM files containing the nested boundary conditions in time-sequence (usually one file per day)

Constraints:
  • min_length = 1

  • max_length = 36

field format: Literal['cray', 'wkstat', 'free'] [Required]

Format of the WAM file. cray: CRAY version of WAM, wkstat: WORKSTATION version of WAM, free: Free format (these files are not generated standard by WAM)

field lwdate: Literal[10, 12, 14] = 12

Length of character string for date-time as used in the WAM files. Possible values are: 10 (i.e. YYMMDDHHMM), 12 (i.e. YYMMDDHHMMSS) or 14 (i.e. YYYYMMDDHHMMSS) (SWAN default: lwdate = 12)

field model_type: Literal['boundnest2', 'BOUNDNEST2'] = 'boundnest2'

Model type discriminator

field xgc: float | None = None

If SWAN is used with Cartesian coordinates: longitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then xgc is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file

field ygc: float | None = None

If SWAN is used with Cartesian coordinates: latitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then ygc is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

property format_str
pydantic model rompy.swan.components.boundary.BOUNDNEST3[source]

Boundary spectra from WAVEWATCHIII.

BOUNDNEST3 WW3 'fname' FREE|UNFORMATTED ->CLOSED|OPEN [xgc] [ygc]

With this optional command a nested SWAN run can be carried out with the boundary conditions obtained from a coarse grid WAVEWATCH III run. The spectral frequencies and directions of the coarse grid run do not have to coincide with the frequencies and directions used in the nested SWAN run; SWAN will interpolate to these frequencies and directions in the nested run (see Section 2.6.3). The output files of WAVEWATCH III have to be created with the post-processor of WAVEWATCH III as output transfer files (formatted or unformatted) with WW_3 OUTP (output type 1 sub type 3) at the locations along the nest boundary (i.e. computational grid points in WAVEWATCH III). These locations are equal to the corner points of the SWAN nested grid and optionally also distributed between the corner points of the SWAN nested grid (the boundary of the WAVEWATCH III nested grid need not be closed and may cover land). The locations should be output by WAVEWATCH III in sequence (going along the nest boundary, clockwise or counterclockwise). Note that SWAN will accept output of a WAVEWATCH III output location only if the SWAN grid point on the nest boundary lies within a rectangle between two consecutive WAVEWATCH III output locations with a width equal to 0.1 times the distance between these output locations on either side of the line between these WAVEWATCH III output locations. This BOUNDNEST3 command is not available for 1D computations. A nested SWAN run may use either Cartesian or spherical coordinates. A curvilinear grid may be used in the nested grid but the boundaries of this nest should conform to the rectangular course grid nest boundaries.

Examples

In [1]: from rompy.swan.components.boundary import BOUNDNEST3

In [2]: boundary = BOUNDNEST3(
   ...:     fname="boundary.ww3",
   ...:     format="free",
   ...:     rectangle="closed",
   ...: )
   ...: 

In [3]: print(boundary.render())
BOUNDNEST3 WW3 fname='boundary.ww3' FREE CLOSED

Show JSON schema
{
   "title": "BOUNDNEST3",
   "description": "Boundary spectra from WAVEWATCHIII.\n\n.. code-block:: text\n\n    BOUNDNEST3 WW3 'fname' FREE|UNFORMATTED ->CLOSED|OPEN [xgc] [ygc]\n\nWith this optional command a nested SWAN run can be carried out with the boundary\nconditions obtained from a coarse grid WAVEWATCH III run. The spectral frequencies\nand directions of the coarse grid run do not have to coincide with the frequencies\nand directions used in the nested SWAN run; SWAN will interpolate to these\nfrequencies and directions in the nested run (see Section 2.6.3). The output files\nof WAVEWATCH III have to be created with the post-processor of WAVEWATCH III as\noutput transfer files (formatted or unformatted) with WW_3 OUTP (output type 1 sub\ntype 3) at the locations along the nest boundary (i.e. computational grid points in\nWAVEWATCH III). These locations are equal to the corner points of the SWAN nested\ngrid and optionally also distributed between the corner points of the SWAN nested\ngrid (the boundary of the WAVEWATCH III nested grid need not be closed and may\ncover land). The locations should be output by WAVEWATCH III in sequence (going\nalong the nest boundary, clockwise or counterclockwise). Note that SWAN will accept\noutput of a WAVEWATCH III output location only if the SWAN grid point on the nest\nboundary lies within a rectangle between two consecutive WAVEWATCH III output\nlocations with a width equal to 0.1 times the distance between these output\nlocations on either side of the line between these WAVEWATCH III output locations.\nThis BOUNDNEST3 command is not available for 1D computations. A nested SWAN run may\nuse either Cartesian or spherical coordinates. A curvilinear grid may be used in\nthe nested grid but the boundaries of this nest should conform to the rectangular\ncourse grid nest boundaries.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDNEST3\n    boundary = BOUNDNEST3(\n        fname=\"boundary.ww3\",\n        format=\"free\",\n        rectangle=\"closed\",\n    )\n    print(boundary.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundnest3",
         "description": "Model type discriminator",
         "enum": [
            "boundnest3",
            "BOUNDNEST3"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "fname": {
         "description": "The name of the file that contains the spectra computed by WAVEWATCH III",
         "maxLength": 36,
         "minLength": 1,
         "title": "Fname",
         "type": "string"
      },
      "format": {
         "description": "Format of the WW3 file. `unformatted`: The input WW3 files are binary, `free`: The input WW3 files are formatted",
         "enum": [
            "unformatted",
            "free"
         ],
         "title": "Format",
         "type": "string"
      },
      "rectangle": {
         "default": "closed",
         "description": "Boundary is defined over a closed (default) or an open rectangle. Boundary generated from the NESTOUT command is aways closed",
         "enum": [
            "closed",
            "open"
         ],
         "title": "Rectangle",
         "type": "string"
      },
      "xgc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If SWAN is used with Cartesian coordinates: longitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `xgc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file. ",
         "title": "Xgc"
      },
      "ygc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If SWAN is used with Cartesian coordinates: latitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `ygc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file. ",
         "title": "Ygc"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname",
      "format"
   ]
}

Fields:
field fname: str [Required]

The name of the file that contains the spectra computed by WAVEWATCH III

Constraints:
  • min_length = 1

  • max_length = 36

field format: Literal['unformatted', 'free'] [Required]

Format of the WW3 file. unformatted: The input WW3 files are binary, free: The input WW3 files are formatted

field model_type: Literal['boundnest3', 'BOUNDNEST3'] = 'boundnest3'

Model type discriminator

field rectangle: Literal['closed', 'open'] = 'closed'

Boundary is defined over a closed (default) or an open rectangle. Boundary generated from the NESTOUT command is aways closed

field xgc: float | None = None

If SWAN is used with Cartesian coordinates: longitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then xgc is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file.

field ygc: float | None = None

If SWAN is used with Cartesian coordinates: latitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then ygc is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file.

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.boundary.BOUNDSPEC[source]

Boundary along sides or segment.

BOUNDSPEC ->SIDE|SEGMENT CONSTANT|VARIABLE PAR|FILE

This command BOUNDSPEC defines parametric spectra at the boundary. It consists of two parts, the first part defines the boundary side or segment where the spectra will be given, the second part defines the spectral parameters of these spectra. Note that in fact only the incoming wave components of these spectra are used by SWAN. The fact that complete spectra are calculated at the model boundaries from the spectral parameters should not be misinterpreted. Only the incoming components are effective in the computation.

TODO: Add support for unstructured grid (k).

Examples

In [1]: from rompy.swan.components.boundary import BOUNDSPEC

In [2]: boundary = BOUNDSPEC(
   ...:     shapespec=dict(model_type="shapespec", shape=dict(model_type="pm")),
   ...:     location=dict(model_type="side", side="west", direction="ccw"),
   ...:     data=dict(model_type="constantpar", hs=2, per=8, dir=270, dd=30),
   ...: )
   ...: 

In [3]: print(boundary.render())
BOUND SHAPESPEC PM PEAK DSPR POWER
BOUNDSPEC SIDE WEST CCW CONSTANT PAR hs=2.0 per=8.0 dir=270.0 dd=30.0

In [4]: boundary = BOUNDSPEC(
   ...:     shapespec=dict(model_type="shapespec", shape=dict(model_type="pm")),
   ...:     location=dict(
   ...:         model_type="segment",
   ...:         points=dict(model_type="ij", i=[0, 0], j=[0, 3])
   ...:     ),
   ...:     data=dict(model_type="constantpar", hs=2, per=8, dir=270, dd=30),
   ...: )
   ...: 

In [5]: print(boundary.render())
BOUND SHAPESPEC PM PEAK DSPR POWER
BOUNDSPEC SEGMENT IJ  &
    i=0 j=0 &
    i=0 j=3 &
    CONSTANT PAR hs=2.0 per=8.0 dir=270.0 dd=30.0

Show JSON schema
{
   "title": "BOUNDSPEC",
   "description": "Boundary along sides or segment.\n\n.. code-block:: text\n\n    BOUNDSPEC ->SIDE|SEGMENT CONSTANT|VARIABLE PAR|FILE\n\nThis command BOUNDSPEC defines parametric spectra at the boundary. It consists of\ntwo parts, the first part defines the boundary side or segment where the spectra\nwill be given, the second part defines the spectral parameters of these spectra.\nNote that in fact only the incoming wave components of these spectra are used by\nSWAN. The fact that complete spectra are calculated at the model boundaries from\nthe spectral parameters should not be misinterpreted. Only the incoming components\nare effective in the computation.\n\nTODO: Add support for unstructured grid (k).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDSPEC\n    boundary = BOUNDSPEC(\n        shapespec=dict(model_type=\"shapespec\", shape=dict(model_type=\"pm\")),\n        location=dict(model_type=\"side\", side=\"west\", direction=\"ccw\"),\n        data=dict(model_type=\"constantpar\", hs=2, per=8, dir=270, dd=30),\n    )\n    print(boundary.render())\n    boundary = BOUNDSPEC(\n        shapespec=dict(model_type=\"shapespec\", shape=dict(model_type=\"pm\")),\n        location=dict(\n            model_type=\"segment\",\n            points=dict(model_type=\"ij\", i=[0, 0], j=[0, 3])\n        ),\n        data=dict(model_type=\"constantpar\", hs=2, per=8, dir=270, dd=30),\n    )\n    print(boundary.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundspec",
         "description": "Model type discriminator",
         "enum": [
            "boundspec",
            "BOUNDSPEC"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "shapespec": {
         "$ref": "#/$defs/SHAPESPEC",
         "description": "Spectral shape specification"
      },
      "location": {
         "anyOf": [
            {
               "$ref": "#/$defs/SIDE"
            },
            {
               "$ref": "#/$defs/SEGMENT"
            }
         ],
         "description": "Location to apply the boundary",
         "title": "Location"
      },
      "data": {
         "anyOf": [
            {
               "$ref": "#/$defs/CONSTANTPAR"
            },
            {
               "$ref": "#/$defs/CONSTANTFILE"
            },
            {
               "$ref": "#/$defs/VARIABLEPAR"
            },
            {
               "$ref": "#/$defs/VARIABLEFILE"
            }
         ],
         "description": "Spectral data",
         "title": "Data"
      }
   },
   "$defs": {
      "BIN": {
         "additionalProperties": false,
         "description": "Single frequency bin spectral shape.\n\n.. code-block:: text\n\n    BIN\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import BIN\n    shape = BIN()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "bin",
               "description": "Model type discriminator",
               "enum": [
                  "bin",
                  "BIN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "BIN",
         "type": "object"
      },
      "CONSTANTFILE": {
         "additionalProperties": false,
         "description": "Constant file specification.\n\n.. code-block:: text\n\n    CONSTANT FILE 'fname' [seq]\n\nThere are three types of files:\n\n- TPAR files containing nonstationary wave parameters\n- files containing stationary or nonstationary 1D spectra\n  (usually from measurements)\n- files containing stationary or nonstationary 2D spectra\n  (from other computer programs or other SWAN runs)\n\nA TPAR file is for only one location; it has the string TPAR on the first\nline of the file and a number of lines which each contain 5 numbers, i.e.:\nTime (ISO-notation), Hs, Period (average or peak period depending on the\nchoice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian,\ndepending on command SET), Directional spread (in degrees or as power of cos\ndepending on the choice given in command BOUND SHAPE).\n\nNote\n----\nExample of a TPAR file:\n\n.. code-block:: text\n\n    TPAR\n    19920516.130000 4.2 12. -110. 22.\n    19920516.180000 4.2 12. -110. 22.\n    19920517.000000 1.2 8. -110. 22.\n    19920517.120000 1.4 8.5 -80. 26\n    19920517.200000 0.9 6.5 -95. 28\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import CONSTANTFILE\n    par = CONSTANTFILE(fname=\"tpar.txt\")\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "constantfile",
               "description": "Model type discriminator",
               "enum": [
                  "constantfile",
                  "CONSTANTFILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the boundary condition.",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            },
            "seq": {
               "anyOf": [
                  {
                     "minimum": 1,
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case `seq` must always be 1",
               "title": "Seq"
            }
         },
         "required": [
            "fname"
         ],
         "title": "CONSTANTFILE",
         "type": "object"
      },
      "CONSTANTPAR": {
         "additionalProperties": false,
         "description": "Constant spectral parameters.\n\n.. code-block:: text\n\n    CONSTANT PAR [hs] [per] [dir] ([dd])\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import CONSTANTPAR\n    par = CONSTANTPAR(hs=1.5, per=8.1, dir=225)\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "constantpar",
               "description": "Model type discriminator",
               "enum": [
                  "constantpar",
                  "CONSTANTPAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hs": {
               "description": "The significant wave height (m)",
               "exclusiveMinimum": 0.0,
               "title": "Hs",
               "type": "number"
            },
            "per": {
               "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE.",
               "exclusiveMinimum": 0.0,
               "title": "Per",
               "type": "number"
            },
            "dir": {
               "description": "The peak wave direction thetapeak (degree), constant over frequencies",
               "maximum": 360.0,
               "minimum": -360.0,
               "title": "Dir",
               "type": "number"
            },
            "dd": {
               "anyOf": [
                  {
                     "maximum": 360.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient of directional spreading; a `cos^m(\u03b8)` distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
               "title": "Dd"
            }
         },
         "required": [
            "hs",
            "per",
            "dir"
         ],
         "title": "CONSTANTPAR",
         "type": "object"
      },
      "GAUSS": {
         "additionalProperties": false,
         "description": "Gaussian spectral shape.\n\n.. code-block:: text\n\n    GAUSS [sigfr]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import GAUSS\n    shape = GAUSS(sigfr=0.02)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "gauss",
               "description": "Model type discriminator",
               "enum": [
                  "gauss",
                  "GAUSS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sigfr": {
               "description": "Width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.",
               "exclusiveMinimum": 0.0,
               "title": "Sigfr",
               "type": "number"
            }
         },
         "required": [
            "sigfr"
         ],
         "title": "GAUSS",
         "type": "object"
      },
      "IJ": {
         "additionalProperties": false,
         "description": "Points in grid indices coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import IJ\n    points = IJ(i=[0, 0, 5], j=[0, 19, 19])\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "ij",
               "description": "Model type discriminator",
               "enum": [
                  "ij",
                  "IJ"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "i": {
               "description": "i-index values",
               "items": {
                  "type": "integer"
               },
               "title": "I",
               "type": "array"
            },
            "j": {
               "description": "j-index values",
               "items": {
                  "type": "integer"
               },
               "title": "J",
               "type": "array"
            }
         },
         "required": [
            "i",
            "j"
         ],
         "title": "IJ",
         "type": "object"
      },
      "JONSWAP": {
         "additionalProperties": false,
         "description": "Jonswap spectral shape.\n\n.. code-block:: text\n\n    JONSWAP [gamma]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import JONSWAP\n    shape = JONSWAP(gamma=3.3)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "jonswap",
               "description": "Model type discriminator",
               "enum": [
                  "jonswap",
                  "JONSWAP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            }
         },
         "title": "JONSWAP",
         "type": "object"
      },
      "PM": {
         "additionalProperties": false,
         "description": "Pearson-Moskowitz spectral shape.\n\n.. code-block:: text\n\n    PM\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import PM\n    shape = PM()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "pm",
               "description": "Model type discriminator",
               "enum": [
                  "pm",
                  "PM"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "PM",
         "type": "object"
      },
      "SEGMENT": {
         "additionalProperties": false,
         "description": "Boundary over a segment defined from points.\n\n.. code-block:: text\n\n    SEGMENT XY < [x] [y] >\n    SEGMENT IJ < [i] [j] >\n\nThe segment is defined either by means of a series of points in terms of problem\ncoordinates (`XY`) or by means of a series of points in terms of grid indices\n(`IJ`). The points do not have to include all or coincide with actual grid points.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SEGMENT\n    seg = SEGMENT(\n        points=dict(\n            model_type=\"xy\",\n            x=[172, 172, 172, 172.5, 173],\n            y=[-41, -40.5, -40, -40, -40],\n            fmt=\"0.2f\",\n        ),\n    )\n    print(seg.render())\n    seg = SEGMENT(\n        points=dict(\n            model_type=\"ij\",\n            i=[0, 0, 5],\n            j=[0, 19, 19],\n        ),\n    )\n    print(seg.render())",
         "properties": {
            "model_type": {
               "default": "segment",
               "description": "Model type discriminator",
               "enum": [
                  "segment",
                  "SEGMENT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "points": {
               "description": "Points to define the segment",
               "discriminator": {
                  "mapping": {
                     "IJ": "#/$defs/IJ",
                     "XY": "#/$defs/XY",
                     "ij": "#/$defs/IJ",
                     "xy": "#/$defs/XY"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/XY"
                  },
                  {
                     "$ref": "#/$defs/IJ"
                  }
               ],
               "title": "Points"
            }
         },
         "required": [
            "points"
         ],
         "title": "SEGMENT",
         "type": "object"
      },
      "SHAPESPEC": {
         "additionalProperties": false,
         "description": "Spectral shape specification.\n\n.. code-block:: text\n\n    BOUND SHAPESPEC JONSWAP|PM|GAUSS|BIN|TMA PEAK|MEAN DSPR [POWER|DEGREES]\n\nThis command BOUND SHAPESPEC defines the shape of the spectra (both in frequency\nand direction) at the boundary of the computational grid in case of parametric\nspectral input.\n\nNotes\n-----\nWhile technically a component `BOUND SHAPESPEC`, this is only intended to be used\nas a subcomponent of the `BOUNDSPEC` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SHAPESPEC\n    shapespec = SHAPESPEC()\n    print(shapespec.render())\n    shapespec = SHAPESPEC(\n        shape=dict(model_type=\"tma\", gamma=3.1, d=12),\n        per_type=\"mean\",\n        dspr_type=\"degrees\",\n    )\n    print(shapespec.render())",
         "properties": {
            "model_type": {
               "default": "shapespec",
               "description": "Model type discriminator",
               "enum": [
                  "shapespec",
                  "SHAPESPEC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "shape": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/JONSWAP"
                  },
                  {
                     "$ref": "#/$defs/PM"
                  },
                  {
                     "$ref": "#/$defs/GAUSS"
                  },
                  {
                     "$ref": "#/$defs/BIN"
                  },
                  {
                     "$ref": "#/$defs/TMA"
                  }
               ],
               "description": "The spectral shape",
               "title": "Shape"
            },
            "per_type": {
               "default": "peak",
               "description": "The type of characteristic wave period",
               "enum": [
                  "peak",
                  "mean"
               ],
               "title": "Per Type",
               "type": "string"
            },
            "dspr_type": {
               "default": "power",
               "description": "The type of directional spreading",
               "enum": [
                  "power",
                  "degrees"
               ],
               "title": "Dspr Type",
               "type": "string"
            }
         },
         "title": "SHAPESPEC",
         "type": "object"
      },
      "SIDE": {
         "additionalProperties": false,
         "description": "Boundary over one side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n\nThe boundary is one full side of the computational grid (in 1D cases either of the\ntwo ends of the 1D-grid).\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE\n    side = SIDE(side=\"west\", direction=\"ccw\")\n    print(side.render())",
         "properties": {
            "model_type": {
               "default": "side",
               "description": "Model type discriminator",
               "enum": [
                  "side",
                  "SIDE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "side": {
               "description": "The side of the grid to apply the boundary to",
               "enum": [
                  "north",
                  "nw",
                  "west",
                  "sw",
                  "south",
                  "se",
                  "east",
                  "ne"
               ],
               "title": "Side",
               "type": "string"
            },
            "direction": {
               "default": "ccw",
               "description": "The direction to apply the boundary in",
               "enum": [
                  "ccw",
                  "clockwise"
               ],
               "title": "Direction",
               "type": "string"
            }
         },
         "required": [
            "side"
         ],
         "title": "SIDE",
         "type": "object"
      },
      "TMA": {
         "additionalProperties": false,
         "description": "TMA spectral shape.\n\n.. code-block:: text\n\n    TMA [gamma] [d]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import TMA\n    shape = TMA(gamma=2.0, d=18)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "tma",
               "description": "Model type discriminator",
               "enum": [
                  "tma",
                  "TMA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            },
            "d": {
               "description": "The reference depth at the wave maker in meters.",
               "exclusiveMinimum": 0.0,
               "title": "D",
               "type": "number"
            }
         },
         "required": [
            "d"
         ],
         "title": "TMA",
         "type": "object"
      },
      "VARIABLEFILE": {
         "additionalProperties": false,
         "description": "Variable file specification.\n\n.. code-block:: text\n\n    VARIABLE FILE < [len] 'fname' [seq] >\n\nThere are three types of files:\n\n- TPAR files containing nonstationary wave parameters\n- files containing stationary or nonstationary 1D spectra\n  (usually from measurements)\n- files containing stationary or nonstationary 2D spectra\n  (from other computer programs or other SWAN runs)\n\nA TPAR file is for only one location; it has the string TPAR on the first\nline of the file and a number of lines which each contain 5 numbers, i.e.:\nTime (ISO-notation), Hs, Period (average or peak period depending on the\nchoice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian,\ndepending on command SET), Directional spread (in degrees or as power of cos\ndepending on the choice given in command BOUND SHAPE).\n\nNote\n----\nExample of a TPAR file:\n\n.. code-block:: text\n\n    TPAR\n    19920516.130000 4.2 12. -110. 22.\n    19920516.180000 4.2 12. -110. 22.\n    19920517.000000 1.2 8. -110. 22.\n    19920517.120000 1.4 8.5 -80. 26\n    19920517.200000 0.9 6.5 -95. 28\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import VARIABLEFILE\n    par = VARIABLEFILE(\n        fname=[\"tpar1.txt\", \"tpar2.txt\", \"tpar3.txt\"],\n        len=[0.0, 0.5, 1.0],\n    )\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "variablefile",
               "description": "Model type discriminator",
               "enum": [
                  "variablefile",
                  "VARIABLEFILE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Names of the files containing the boundary condition",
               "items": {
                  "maxLength": 36,
                  "type": "string"
               },
               "title": "Fname",
               "type": "array"
            },
            "seq": {
               "anyOf": [
                  {
                     "items": {
                        "minimum": 1,
                        "type": "integer"
                     },
                     "type": "array"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case [seq] must always be 1.",
               "title": "Seq"
            },
            "len": {
               "description": "Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. [len] is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of `len` should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment.",
               "items": {
                  "minimum": 0,
                  "type": "number"
               },
               "title": "Len",
               "type": "array"
            }
         },
         "required": [
            "fname",
            "len"
         ],
         "title": "VARIABLEFILE",
         "type": "object"
      },
      "VARIABLEPAR": {
         "additionalProperties": false,
         "description": "Variable spectral parameter.\n\n.. code-block:: text\n\n    VARIABLE PAR < [len] [hs] [per] [dir] [dd] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import VARIABLEPAR\n    par = VARIABLEPAR(\n        hs=[1.5, 1.4, 1.1],\n        per=[8.1, 8.0, 8.1],\n        dir=[225, 226, 228],\n        dd=[25, 22, 23],\n        len=[0, 0.5, 1.0],\n    )\n    print(par.render())",
         "properties": {
            "model_type": {
               "default": "variablepar",
               "description": "Model type discriminator",
               "enum": [
                  "variablepar",
                  "VARIABLEPAR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hs": {
               "description": "The significant wave height (m)",
               "items": {
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Hs",
               "type": "array"
            },
            "per": {
               "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE",
               "items": {
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Per",
               "type": "array"
            },
            "dir": {
               "description": "The peak wave direction thetapeak (degrees), constant over frequencies",
               "items": {
                  "maximum": 360.0,
                  "minimum": -360.0,
                  "type": "number"
               },
               "title": "Dir",
               "type": "array"
            },
            "dd": {
               "description": "Coefficient of directional spreading; a $cos^m(\u03b8)$ distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
               "items": {
                  "maximum": 360.0,
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Dd",
               "type": "array"
            },
            "len": {
               "description": "Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. `len` is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of `len` should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment",
               "items": {
                  "minimum": 0,
                  "type": "number"
               },
               "title": "Len",
               "type": "array"
            }
         },
         "required": [
            "hs",
            "per",
            "dir",
            "dd",
            "len"
         ],
         "title": "VARIABLEPAR",
         "type": "object"
      },
      "XY": {
         "additionalProperties": false,
         "description": "Points in problem coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import XY\n    points = XY(\n        x=[172, 172, 172, 172.5, 173],\n        y=[-41, -40.5, -40, -40, -40],\n        fmt=\"0.2f\",\n    )\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "xy",
               "description": "Model type discriminator",
               "enum": [
                  "xy",
                  "XY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "x": {
               "description": "Problem x-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "X",
               "type": "array"
            },
            "y": {
               "description": "Problem y-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "Y",
               "type": "array"
            },
            "fmt": {
               "default": "0.8f",
               "description": "The format to render floats values",
               "title": "Fmt",
               "type": "string"
            }
         },
         "required": [
            "x",
            "y"
         ],
         "title": "XY",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "location",
      "data"
   ]
}

Fields:
field data: CONSTANTPAR | CONSTANTFILE | VARIABLEPAR | VARIABLEFILE [Required]

Spectral data

field location: SIDE | SEGMENT [Required]

Location to apply the boundary

field model_type: Literal['boundspec', 'BOUNDSPEC'] = 'boundspec'

Model type discriminator

field shapespec: SHAPESPEC [Optional]

Spectral shape specification

cmd() list[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.boundary.INITIAL[source]

Initial conditions.

INITIAL -> DEFAULT|ZERO|PAR|HOTSTART

This command can be used to specify the initial values for a stationary (INITIAL HOTSTART only) or nonstationary computation. The initial values thus specified override the default initialization (see Section 2.6.3). Note that it is possible to obtain an initial state by carrying out a previous stationary or nonstationary computation.

Examples

In [1]: from rompy.swan.components.boundary import INITIAL

In [2]: init = INITIAL()

In [3]: print(init.render())
INITIAL DEFAULT

In [4]: init = INITIAL(
   ...:     kind=dict(model_type="hotmultiple", fname="hotstart.swn", format="free")
   ...: )
   ...: 

In [5]: print(init.render())
INITIAL HOTSTART MULTIPLE fname='hotstart.swn' FREE

Show JSON schema
{
   "title": "INITIAL",
   "description": "Initial conditions.\n\n.. code-block:: text\n\n    INITIAL -> DEFAULT|ZERO|PAR|HOTSTART\n\nThis command can be used to specify the initial values for a stationary (INITIAL\nHOTSTART only) or nonstationary computation. The initial values thus specified\noverride the default initialization (see Section 2.6.3). Note that it is possible\nto obtain an initial state by carrying out a previous stationary or nonstationary\ncomputation.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import INITIAL\n    init = INITIAL()\n    print(init.render())\n    init = INITIAL(\n        kind=dict(model_type=\"hotmultiple\", fname=\"hotstart.swn\", format=\"free\")\n    )\n    print(init.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "initial",
         "description": "Model type discriminator",
         "enum": [
            "initial",
            "INITIAL"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "kind": {
         "anyOf": [
            {
               "$ref": "#/$defs/DEFAULT"
            },
            {
               "$ref": "#/$defs/ZERO"
            },
            {
               "$ref": "#/$defs/PAR"
            },
            {
               "$ref": "#/$defs/HOTSINGLE"
            },
            {
               "$ref": "#/$defs/HOTMULTIPLE"
            }
         ],
         "description": "Initial condition type",
         "title": "Kind"
      }
   },
   "$defs": {
      "DEFAULT": {
         "additionalProperties": false,
         "description": "Default initial conditions.\n\n.. code-block:: text\n\n    DEFAULT\n\nThe initial spectra are computed from the local wind velocities, using the\ndeep-water growth curve of Kahma and Calkoen (1992), cut off at values of\nsignificant wave height and peak frequency from Pierson and Moskowitz (1964).\nThe average (over the model area) spatial step size is used as fetch with local\nwind. The shape of the spectrum is default JONSWAP with a cos2-directional\ndistribution (options are available: see command BOUND SHAPE).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import DEFAULT\n    init = DEFAULT()\n    print(init.render())",
         "properties": {
            "model_type": {
               "default": "default",
               "description": "Model type discriminator",
               "enum": [
                  "default",
                  "DEFAULT"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "DEFAULT",
         "type": "object"
      },
      "HOTMULTIPLE": {
         "additionalProperties": false,
         "description": "Hotstart multiple initial conditions.\n\n.. code-block:: text\n\n    HOTSTART MULTIPLE fname='fname' FREE|UNFORMATTED\n\nInitial wave field is read from file; this file was generated in a previous SWAN\nrun by means of the HOTFILE command. If the previous run was nonstationary,\nthe time found on the file will be assumed to be the initial time of computation. It\ncan also be used for stationary computation as first guess. The computational grid\n(both in geographical space and in spectral space) must be identical to the one in\nthe run in which the initial wave field was computed\n\nInput will be read from multiple hotfiles obtained from a previous parallel MPI run.\nThe number of files equals the number of processors. Hence, for the present run the\nsame number of processors must be chosen.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import HOTMULTIPLE\n    init = HOTMULTIPLE(fname=\"hotstart.swn\", format=\"free\")\n    print(init.render())",
         "properties": {
            "model_type": {
               "default": "hotmultiple",
               "description": "Model type discriminator",
               "enum": [
                  "hotmultiple",
                  "HOTMULTIPLE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the initial wave field",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            },
            "format": {
               "default": "free",
               "description": "Format of the file containing the initial wave field. FREE: free format, UNFORMATTED: binary format",
               "enum": [
                  "free",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            }
         },
         "required": [
            "fname"
         ],
         "title": "HOTMULTIPLE",
         "type": "object"
      },
      "HOTSINGLE": {
         "additionalProperties": false,
         "description": "Hotstart single initial conditions.\n\n.. code-block:: text\n\n    HOTSTART SINGLE fname='fname' FREE|UNFORMATTED\n\nInitial wave field is read from file; this file was generated in a previous SWAN\nrun by means of the HOTFILE command. If the previous run was nonstationary,\nthe time found on the file will be assumed to be the initial time of computation. It\ncan also be used for stationary computation as first guess. The computational grid\n(both in geographical space and in spectral space) must be identical to the one in\nthe run in which the initial wave field was computed\n\nInput will be read from a single (concatenated) hotfile. In the case of a previous\nparallel MPI run, the concatenated hotfile can be created from a set of multiple\nhotfiles using the program hcat.exe, see Implementation Manual.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import HOTSINGLE\n    init = HOTSINGLE(fname=\"hotstart.swn\", format=\"free\")\n    print(init.render())",
         "properties": {
            "model_type": {
               "default": "hotsingle",
               "description": "Model type discriminator",
               "enum": [
                  "hotsingle",
                  "HOTSINGLE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "fname": {
               "description": "Name of the file containing the initial wave field",
               "maxLength": 36,
               "title": "Fname",
               "type": "string"
            },
            "format": {
               "default": "free",
               "description": "Format of the file containing the initial wave field. FREE: free format, UNFORMATTED: binary format",
               "enum": [
                  "free",
                  "unformatted"
               ],
               "title": "Format",
               "type": "string"
            }
         },
         "required": [
            "fname"
         ],
         "title": "HOTSINGLE",
         "type": "object"
      },
      "PAR": {
         "additionalProperties": false,
         "description": "Spectral parameters.\n\n.. code-block:: text\n\n    PAR [hs] [per] [dir] [dd]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import PAR\n    par = PAR(hs=1.5, per=8.1, dir=225)\n    print(par.render())",
         "properties": {
            "model_type": {
               "const": "par",
               "default": "par",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "hs": {
               "description": "The significant wave height (m)",
               "exclusiveMinimum": 0.0,
               "title": "Hs",
               "type": "number"
            },
            "per": {
               "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE.",
               "exclusiveMinimum": 0.0,
               "title": "Per",
               "type": "number"
            },
            "dir": {
               "description": "The peak wave direction thetapeak (degree), constant over frequencies",
               "maximum": 360.0,
               "minimum": -360.0,
               "title": "Dir",
               "type": "number"
            },
            "dd": {
               "anyOf": [
                  {
                     "maximum": 360.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient of directional spreading; a `cos^m(\u03b8)` distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
               "title": "Dd"
            }
         },
         "required": [
            "hs",
            "per",
            "dir"
         ],
         "title": "PAR",
         "type": "object"
      },
      "ZERO": {
         "additionalProperties": false,
         "description": "Zero initial conditions.\n\n.. code-block:: text\n\n    ZERO\n\nThe initial spectral densities are all 0; note that if waves are generated in the\nmodel only by wind, waves can become non-zero only by the presence of the\n\u201dA\u201d term in the growth model; see the keyword AGROW in command GEN3.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import ZERO\n    init = ZERO()\n    print(init.render())",
         "properties": {
            "model_type": {
               "default": "zero",
               "description": "Model type discriminator",
               "enum": [
                  "zero",
                  "ZERO"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "ZERO",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field kind: DEFAULT | ZERO | PAR | HOTSINGLE | HOTMULTIPLE [Optional]

Initial condition type

field model_type: Literal['initial', 'INITIAL'] = 'initial'

Model type discriminator

cmd() str[source]

Return the string or list of strings to render the component to the CMD.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

Physics#

Model physics components.

pydantic model rompy.swan.components.physics.BRAGG[source]

Bragg scattering.

BRAGG [ibrag] [nreg] [cutoff]

Using this optional command, the user activates a source term to represent the scattering of waves due to changes in the small-scale bathymetry based on the theory of Ardhuin and Herbers (2002). If this command is not used, SWAN will not account for Bragg scattering.

The underlying process is related to the bed elevation spectrum that describes the random variability of the bathymetry at the scale of the wave length on top of a slowly varying depth. To input this spectrum in the model, two options are available. One option is to read a spectrum from a file. This single bottom spectrum will subsequently be applied in all active grid points. The assumption being made here is that the inputted bottom is gently sloping. Note that the bottom spectrum must be given as a function of the wave number k.

Another option is to compute the spectrum by a Fourier transform from x to k of the bed modulations around a computational grid point. First, one must define a square region with a fixed size around the grid point in order to perform the Fourier transform. The size should correspond to a multiple of the wave length at which refraction is resolved (i.e. consistent with the mild slope assumption). Next, the amplitude modulation of the small-scale bathymetry is obtained by substracting a slowly varying bed level from the inputted high-resolution bathymetric data within this square region. Here, the smooth bed level is achieved using a bilinear fit. During the computation, however, SWAN employs the gently sloping bed as the mean of the original bathymetry within the given square around each computational grid point. Finally, the corresponding bottom spectrum is computed with an FFT.

Notes

The Bragg scattering source term to the action balance equation gives rise to a fairly stiff equation. The best remedy is to run SWAN in the nonstationary mode with a relatively small time step or in the stationary mode with some under relaxation (see command NUM STAT [alfa]).

Examples

In [1]: from rompy.swan.components.physics import BRAGG

In [2]: bragg = BRAGG(nreg=200)

In [3]: print(bragg.render())
BRAGG nreg=200

In [4]: bragg = BRAGG(ibrag=1, nreg=200, cutoff=5.0)

In [5]: print(bragg.render())
BRAGG ibrag=1 nreg=200 cutoff=5.0

Show JSON schema
{
   "title": "BRAGG",
   "description": "Bragg scattering.\n\n.. code-block:: text\n\n    BRAGG [ibrag] [nreg] [cutoff]\n\nUsing this optional command, the user activates a source term to represent the\nscattering of waves due to changes in the small-scale bathymetry based on the\ntheory of Ardhuin and Herbers (2002). If this command is not used, SWAN will not\naccount for Bragg scattering.\n\nThe underlying process is related to the bed elevation spectrum that describes the\nrandom variability of the bathymetry at the scale of the wave length on top of a\nslowly varying depth. To input this spectrum in the model, two options are\navailable. One option is to read a spectrum from a file. This single bottom\nspectrum will subsequently be applied in all active grid points. The assumption\nbeing made here is that the inputted bottom is gently sloping. Note that the bottom\nspectrum must be given as a function of the wave number `k`.\n\nAnother option is to compute the spectrum by a Fourier transform from `x` to `k` of\nthe bed modulations around a computational grid point. First, one must define a\nsquare region with a fixed size around the grid point in order to perform the\nFourier transform. The size should correspond to a multiple of the wave length at\nwhich refraction is resolved (i.e. consistent with the mild slope assumption).\nNext, the amplitude modulation of the small-scale bathymetry is obtained by\nsubstracting a slowly varying bed level from the inputted high-resolution\nbathymetric data within this square region. Here, the smooth bed level is achieved\nusing a bilinear fit. During the computation, however, SWAN employs the gently\nsloping bed as the mean of the original bathymetry within the given square around\neach computational grid point. Finally, the corresponding bottom spectrum is\ncomputed with an FFT.\n\nNotes\n-----\nThe Bragg scattering source term to the action balance equation gives rise to a\nfairly stiff equation. The best remedy is to run SWAN in the nonstationary mode\nwith a relatively small time step or in the stationary mode with some under\nrelaxation (see command `NUM STAT [alfa]`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BRAGG\n    bragg = BRAGG(nreg=200)\n    print(bragg.render())\n    bragg = BRAGG(ibrag=1, nreg=200, cutoff=5.0)\n    print(bragg.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "bragg",
         "description": "Model type discriminator",
         "enum": [
            "bragg",
            "BRAGG"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "ibrag": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)",
         "title": "Ibrag"
      },
      "nreg": {
         "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid",
         "title": "Nreg",
         "type": "integer"
      },
      "cutoff": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)",
         "title": "Cutoff"
      }
   },
   "additionalProperties": false,
   "required": [
      "nreg"
   ]
}

Fields:
field cutoff: float | None = None

Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)

field ibrag: Literal[1, 2, 3] | None = None

Indicates the computation of Bragg scattering term:

  • 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)

  • 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)

  • 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)

(SWAN default: 1)

field model_type: Literal['bragg', 'BRAGG'] = 'bragg'

Model type discriminator

field nreg: int [Required]

Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.BRAGG_FILE[source]

Bragg scattering with bottom spectrum from file.

BRAGG [ibrag] [nreg] [cutoff] FILE 'fname' [idla] [mkx] [mky] [dkx] [dky]

The bed elevation spectrum FB(kx, ky) is read from a file.

Notes

This spectrum is taken to be uniform over the entire computational domain.

Examples

In [1]: from rompy.swan.components.physics import BRAGG_FILE

In [2]: bragg = BRAGG_FILE(fname="bottom_spectrum.txt", nreg=500, mkx=99, dkx=0.1)

In [3]: print(bragg.render())
BRAGG nreg=500 FILE fname='bottom_spectrum.txt' mkx=99 dkx=0.1

In [4]: kwargs = dict(
   ...:     ibrag=3,
   ...:     nreg=500,
   ...:     cutoff=5.0,
   ...:     fname="bottom_spectrum.txt",
   ...:     mkx=99,
   ...:     mky=149,
   ...:     dkx=0.1,
   ...:     dky=0.1,
   ...: )
   ...: 

In [5]: bragg = BRAGG_FILE(**kwargs)

In [6]: print(bragg.render())
BRAGG ibrag=3 nreg=500 cutoff=5.0 FILE fname='bottom_spectrum.txt' mkx=99 mky=149 dkx=0.1 dky=0.1

Show JSON schema
{
   "title": "BRAGG_FILE",
   "description": "Bragg scattering with bottom spectrum from file.\n\n.. code-block:: text\n\n    BRAGG [ibrag] [nreg] [cutoff] FILE 'fname' [idla] [mkx] [mky] [dkx] [dky]\n\nThe bed elevation spectrum `FB(kx, ky)` is read from a file.\n\nNotes\n-----\nThis spectrum is taken to be uniform over the entire computational domain.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BRAGG_FILE\n    bragg = BRAGG_FILE(fname=\"bottom_spectrum.txt\", nreg=500, mkx=99, dkx=0.1)\n    print(bragg.render())\n    kwargs = dict(\n        ibrag=3,\n        nreg=500,\n        cutoff=5.0,\n        fname=\"bottom_spectrum.txt\",\n        mkx=99,\n        mky=149,\n        dkx=0.1,\n        dky=0.1,\n    )\n    bragg = BRAGG_FILE(**kwargs)\n    print(bragg.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "file",
         "description": "Model type discriminator",
         "enum": [
            "file",
            "FILE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "ibrag": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)",
         "title": "Ibrag"
      },
      "nreg": {
         "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid",
         "title": "Nreg",
         "type": "integer"
      },
      "cutoff": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)",
         "title": "Cutoff"
      },
      "fname": {
         "description": "Name of file containing the bottom spectrum",
         "maxLength": 36,
         "title": "Fname",
         "type": "string"
      },
      "idla": {
         "anyOf": [
            {
               "$ref": "#/$defs/IDLA"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Order in which the values should be given in the input files"
      },
      "mkx": {
         "description": "Number of cells in x-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)",
         "title": "Mkx",
         "type": "integer"
      },
      "mky": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of cells in y-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)(SWAN default: `mky = mkx`)",
         "title": "Mky"
      },
      "dkx": {
         "description": "Mesh size in x-direction of the wave number grid related to bottom spectrum (1/m)",
         "title": "Dkx",
         "type": "number"
      },
      "dky": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Mesh size in y-direction of the wave number grid related to bottom spectrum (1/m) (SWAN default: `dky = dkx`)",
         "title": "Dky"
      }
   },
   "$defs": {
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      }
   },
   "additionalProperties": false,
   "required": [
      "nreg",
      "fname",
      "mkx",
      "dkx"
   ]
}

Fields:
field cutoff: float | None = None

Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)

field dkx: float [Required]

Mesh size in x-direction of the wave number grid related to bottom spectrum (1/m)

field dky: float | None = None

Mesh size in y-direction of the wave number grid related to bottom spectrum (1/m) (SWAN default: dky = dkx)

field fname: str [Required]

Name of file containing the bottom spectrum

Constraints:
  • max_length = 36

field ibrag: Literal[1, 2, 3] | None = None

Indicates the computation of Bragg scattering term:

  • 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)

  • 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)

  • 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)

(SWAN default: 1)

field idla: IDLA | None = None

Order in which the values should be given in the input files

field mkx: int [Required]

Number of cells in x-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)

field mky: int | None = None

Number of cells in y-direction of the wave number grid related to bottom spectrum (this is one less than the number of points in this direction)(SWAN default: mky = mkx)

field model_type: Literal['file', 'FILE'] = 'file'

Model type discriminator

field nreg: int [Required]

Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.BRAGG_FT[source]

Bragg scattering with bottom spectrum computed from FFT.

BRAGG [ibrag] [nreg] [cutoff] FT

If this keyword is present the bottom spectrum will be computed in each active grid point using a Fast Fourier Transform (FFT).

Notes

The depth in each computational grid point is computed as the average of the inputted (high-resolution) bed levels within the square region.

Examples

In [1]: from rompy.swan.components.physics import BRAGG_FT

In [2]: bragg = BRAGG_FT(nreg=350)

In [3]: print(bragg.render())
BRAGG nreg=350 FT

In [4]: bragg = BRAGG_FT(ibrag=2, nreg=350, cutoff=5.0)

In [5]: print(bragg.render())
BRAGG ibrag=2 nreg=350 cutoff=5.0 FT

Show JSON schema
{
   "title": "BRAGG_FT",
   "description": "Bragg scattering with bottom spectrum computed from FFT.\n\n.. code-block:: text\n\n    BRAGG [ibrag] [nreg] [cutoff] FT\n\nIf this keyword is present the bottom spectrum will be computed in each active\ngrid point using a Fast Fourier Transform (FFT).\n\nNotes\n-----\nThe depth in each computational grid point is computed as the average of the\ninputted (high-resolution) bed levels within the square region.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BRAGG_FT\n    bragg = BRAGG_FT(nreg=350)\n    print(bragg.render())\n    bragg = BRAGG_FT(ibrag=2, nreg=350, cutoff=5.0)\n    print(bragg.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "ft",
         "description": "Model type discriminator",
         "enum": [
            "ft",
            "FT"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "ibrag": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Indicates the computation of Bragg scattering term:\n\n* 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)\n* 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)\n* 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)\n\n(SWAN default: 1)",
         "title": "Ibrag"
      },
      "nreg": {
         "description": "Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid",
         "title": "Nreg",
         "type": "integer"
      },
      "cutoff": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)",
         "title": "Cutoff"
      }
   },
   "additionalProperties": false,
   "required": [
      "nreg"
   ]
}

Fields:
field cutoff: float | None = None

Cutoff to the ratio between surface and bottom wave numbers. Note: seethe Scientific/Technical documentation for details (SWAN default: 5.0)

field ibrag: Literal[1, 2, 3] | None = None

Indicates the computation of Bragg scattering term:

  • 1: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number a priori (thus requiring storage)

  • 2: source term is calculated per sweep and bottom spectrum is interpolated at the difference wave number per sweep (no storage)

  • 3: source term is calculated per iteration and bottom spectrum is interpolated at the difference wave number per iteration (no storage)

(SWAN default: 1)

field model_type: Literal['ft', 'FT'] = 'ft'

Model type discriminator

field nreg: int [Required]

Size of square region around computational grid point (centered) for computing the mean depth and, if desired, the bed elevation spectrum. It is expressed in terms of the number of grid points (per direction) of the inputted bottom grid

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.BREAKING_BKD[source]

Variable wave breaking index.

BREAKING BKD [alpha] [gamma0] [a1] [a2] [a3]

Indicates that the breaker index scales with both the bottom slope (beta) and the dimensionless depth (kd).

Examples

In [1]: from rompy.swan.components.physics import BREAKING_BKD

In [2]: breaking = BREAKING_BKD()

In [3]: print(breaking.render())
BREAKING BKD

In [4]: breaking = BREAKING_BKD(alpha=1.0, gamma0=0.54, a1=7.59, a2=-8.06, a3=8.09)

In [5]: print(breaking.render())
BREAKING BKD alpha=1.0 gamma0=0.54 a1=7.59 a2=-8.06 a3=8.09

Show JSON schema
{
   "title": "BREAKING_BKD",
   "description": "Variable wave breaking index.\n\n.. code-block:: text\n\n    BREAKING BKD [alpha] [gamma0] [a1] [a2] [a3]\n\nIndicates that the breaker index scales with both the bottom slope (`beta`)\nand the dimensionless depth (kd).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BREAKING_BKD\n    breaking = BREAKING_BKD()\n    print(breaking.render())\n    breaking = BREAKING_BKD(alpha=1.0, gamma0=0.54, a1=7.59, a2=-8.06, a3=8.09)\n    print(breaking.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "bkd",
         "description": "Model type discriminator",
         "enum": [
            "bkd",
            "BKD"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "alpha": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)",
         "title": "Alpha"
      },
      "gamma0": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The reference $gamma$ for horizontal slopes (SWAN default: 0.54)",
         "title": "Gamma0"
      },
      "a1": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "First tunable coefficient for the breaker index (SWAN default: 7.59)",
         "title": "A1"
      },
      "a2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Second tunable coefficient for the breaker index (SWAN default: -8.06)",
         "title": "A2"
      },
      "a3": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Third tunable coefficient for the breaker index (SWAN default: 8.09)",
         "title": "A3"
      }
   },
   "additionalProperties": false
}

Fields:
field a1: float | None = None

First tunable coefficient for the breaker index (SWAN default: 7.59)

field a2: float | None = None

Second tunable coefficient for the breaker index (SWAN default: -8.06)

field a3: float | None = None

Third tunable coefficient for the breaker index (SWAN default: 8.09)

field alpha: float | None = None

Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)

field gamma0: float | None = None

The reference $gamma$ for horizontal slopes (SWAN default: 0.54)

field model_type: Literal['bkd', 'BKD'] = 'bkd'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.BREAKING_CONSTANT[source]

Constant wave breaking index.

BREAKING CONSTANT [alpha] [gamma]

Indicates that a constant breaker index is to be used.

Examples

In [1]: from rompy.swan.components.physics import BREAKING_CONSTANT

In [2]: breaking = BREAKING_CONSTANT()

In [3]: print(breaking.render())
BREAKING CONSTANT

In [4]: breaking = BREAKING_CONSTANT(alpha=1.0, gamma=0.73)

In [5]: print(breaking.render())
BREAKING CONSTANT alpha=1.0 gamma=0.73

Show JSON schema
{
   "title": "BREAKING_CONSTANT",
   "description": "Constant wave breaking index.\n\n.. code-block:: text\n\n    BREAKING CONSTANT [alpha] [gamma]\n\nIndicates that a constant breaker index is to be used.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import BREAKING_CONSTANT\n    breaking = BREAKING_CONSTANT()\n    print(breaking.render())\n    breaking = BREAKING_CONSTANT(alpha=1.0, gamma=0.73)\n    print(breaking.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "constant",
         "description": "Model type discriminator",
         "enum": [
            "constant",
            "CONSTANT"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "alpha": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)",
         "title": "Alpha"
      },
      "gamma": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The breaker index, i.e. the ratio of maximum individual wave height over depth (SWAN default: 0.73)",
         "title": "Gamma"
      }
   },
   "additionalProperties": false
}

Fields:
field alpha: float | None = None

Proportionality coefficient of the rate of dissipation (SWAN default: 1.0)

field gamma: float | None = None

The breaker index, i.e. the ratio of maximum individual wave height over depth (SWAN default: 0.73)

field model_type: Literal['constant', 'CONSTANT'] = 'constant'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.DIFFRACTION[source]

Wave diffraction.

DIFFRACTION [idiffr] [smpar] [smnum] [cgmod]

If this optional command is given, the diffraction is included in the wave computation. But the diffraction approximation in SWAN does not properly handle diffraction in harbours or in front of reflecting obstacles (see Scientific/Technical documentation). Behind breakwaters with a down-wave beach, the SWAN results seem reasonable. The spatial resolution near (the tip of) the diffraction obstacle should be 1/5 to 1/10 of the dominant wave length.

Notes

Without extra measures, the diffraction computations with SWAN often converge poorly or not at all. Two measures can be taken:

1. (RECOMMENDED) The user can request under-relaxation. See command NUMERIC parameter alpha and Scientific/Technical documentation (Eq. (3.31)). Very limited experience suggests alpha = 0.01.

2. Alternatively, the user can request smoothing of the wave field for the computation of the diffraction parameter (the wave field remains intact for all other computations and output). This is done with a repeated convolution filtering.

Examples

In [1]: from rompy.swan.components.physics import DIFFRACTION

In [2]: diffraction = DIFFRACTION()

In [3]: print(diffraction.render())
DIFFRACTION

In [4]: diffraction = DIFFRACTION(idiffr=True, smpar=0.0, smnum=1.0)

In [5]: print(diffraction.render())
DIFFRACTION idiffr=1 smpar=0.0 smnum=1

Show JSON schema
{
   "title": "DIFFRACTION",
   "description": "Wave diffraction.\n\n.. code-block:: text\n\n    DIFFRACTION [idiffr] [smpar] [smnum] [cgmod]\n\nIf this optional command is given, the diffraction is included in the wave\ncomputation. But the diffraction approximation in SWAN does not properly handle\ndiffraction in harbours or in front of reflecting obstacles (see\nScientific/Technical documentation). Behind breakwaters with a down-wave beach, the\nSWAN results seem reasonable. The spatial resolution near (the tip of) the\ndiffraction obstacle should be 1/5 to 1/10 of the dominant wave length.\n\nNotes\n-----\nWithout extra measures, the diffraction computations with SWAN often converge\npoorly or not at all. Two measures can be taken:\n\n1. (RECOMMENDED) The user can request under-relaxation. See command `NUMERIC`\nparameter `alpha` and Scientific/Technical documentation (Eq. (3.31)). Very limited\nexperience suggests `alpha = 0.01`.\n\n2. Alternatively, the user can request smoothing of the wave field for the\ncomputation of the diffraction parameter (the wave field remains intact for all\nother computations and output). This is done with a repeated convolution filtering.\n\nExamples\n--------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import DIFFRACTION\n    diffraction = DIFFRACTION()\n    print(diffraction.render())\n    diffraction = DIFFRACTION(idiffr=True, smpar=0.0, smnum=1.0)\n    print(diffraction.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "diffraction",
         "description": "Model type discriminator",
         "enum": [
            "diffraction",
            "DIFFRACTION"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "idiffr": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Indicates the use of diffraction. If `idiffr=0` then no diffraction is taken into account (SWAN default: 1)",
         "title": "Idiffr"
      },
      "smpar": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Smoothing parameter for the calculation of \u2207 \u00b7 \u221aEtot. During every smoothing step all grid points exchange `smpar` times the energy with their neighbours. Note that `smpar` is parameter a in the above text (SWAN default: 0.0)",
         "title": "Smpar"
      },
      "smnum": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Number of smoothing steps relative to `smpar` (SWAN default: 0)",
         "title": "Smnum"
      },
      "cgmod": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Adaption of propagation velocities in geographic space due to diffraction. If `cgmod=0` then no adaption (SWAN default: 1.0)",
         "title": "Cgmod"
      }
   },
   "additionalProperties": false
}

Fields:
field cgmod: float | None = None

Adaption of propagation velocities in geographic space due to diffraction. If cgmod=0 then no adaption (SWAN default: 1.0)

field idiffr: bool | None = None

Indicates the use of diffraction. If idiffr=0 then no diffraction is taken into account (SWAN default: 1)

field model_type: Literal['diffraction', 'DIFFRACTION'] = 'diffraction'

Model type discriminator

field smnum: int | None = None

Number of smoothing steps relative to smpar (SWAN default: 0)

field smpar: float | None = None

Smoothing parameter for the calculation of ∇ · √Etot. During every smoothing step all grid points exchange smpar times the energy with their neighbours. Note that smpar is parameter a in the above text (SWAN default: 0.0)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.FRICTION_COLLINS[source]

Collins (1972) friction.

FRICTION COLLINS [cfw]

Note that cfw is allowed to vary over the computational region; in that case use the commands INPGRID FRICTION and READINP FRICTION to define and read the friction data. This command FRICTION is still required to define the type of friction expression. The value of cfw in this command is then not required (it will be ignored).

References

Collins, J.I., 1972. Prediction of shallow-water spectra. Journal of Geophysical Research, 77(15), pp.2693-2707.

Examples

In [1]: from rompy.swan.components.physics import FRICTION_COLLINS

In [2]: friction = FRICTION_COLLINS()

In [3]: print(friction.render())
FRICTION COLLINS

In [4]: friction = FRICTION_COLLINS(cfw=0.038)

In [5]: print(friction.render())
FRICTION COLLINS cfw=0.038

Show JSON schema
{
   "title": "FRICTION_COLLINS",
   "description": "Collins (1972) friction.\n\n.. code-block:: text\n\n    FRICTION COLLINS [cfw]\n\nNote that `cfw` is allowed to vary over the computational region; in that case use\nthe commands INPGRID FRICTION and READINP FRICTION to define and read the friction\ndata. This command FRICTION is still required to define the type of friction\nexpression. The value of `cfw` in this command is then not required (it will be\nignored).\n\nReferences\n----------\nCollins, J.I., 1972. Prediction of shallow-water spectra. Journal of Geophysical\nResearch, 77(15), pp.2693-2707.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_COLLINS\n    friction = FRICTION_COLLINS()\n    print(friction.render())\n    friction = FRICTION_COLLINS(cfw=0.038)\n    print(friction.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "collins",
         "description": "Model type discriminator",
         "enum": [
            "collins",
            "COLLINS"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cfw": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Collins bottom friction coefficient (SWAN default: 0.015)",
         "title": "Cfw"
      }
   },
   "additionalProperties": false
}

Fields:
field cfw: float | None = None

Collins bottom friction coefficient (SWAN default: 0.015)

field model_type: Literal['collins', 'COLLINS'] = 'collins'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.FRICTION_JONSWAP[source]

Hasselmann et al. (1973) Jonswap friction.

FRICTION JONSWAP CONSTANT [cfjon]

Indicates that the semi-empirical expression derived from the JONSWAP results for bottom friction dissipation (Hasselmann et al., 1973, JONSWAP) should be activated. This option is default.

References

Hasselmann, K., Barnett, T.P., Bouws, E., Carlson, H., Cartwright, D.E., Enke, K., Ewing, J.A., Gienapp, A., Hasselmann, D.E., Kruseman, P. and Meerburg, A., 1973. Measurements of wind-wave growth and swell decay during the Joint North Sea Wave Project (JONSWAP). Deutches Hydrographisches Institut, Hamburg, Germany, Rep. No. 12, 95 pp.

Examples

In [1]: from rompy.swan.components.physics import FRICTION_JONSWAP

In [2]: friction = FRICTION_JONSWAP()

In [3]: print(friction.render())
FRICTION JONSWAP CONSTANT

In [4]: friction = FRICTION_JONSWAP(cfjon=0.038)

In [5]: print(friction.render())
FRICTION JONSWAP CONSTANT cfjon=0.038

TODO: Implement VARIABLE option?

Show JSON schema
{
   "title": "FRICTION_JONSWAP",
   "description": "Hasselmann et al. (1973) Jonswap friction.\n\n.. code-block:: text\n\n    FRICTION JONSWAP CONSTANT [cfjon]\n\nIndicates that the semi-empirical expression derived from the JONSWAP results for\nbottom friction dissipation (Hasselmann et al., 1973, JONSWAP) should be activated.\nThis option is default.\n\nReferences\n----------\nHasselmann, K., Barnett, T.P., Bouws, E., Carlson, H., Cartwright, D.E., Enke, K.,\nEwing, J.A., Gienapp, A., Hasselmann, D.E., Kruseman, P. and Meerburg, A., 1973.\nMeasurements of wind-wave growth and swell decay during the Joint North Sea Wave\nProject (JONSWAP). Deutches Hydrographisches Institut, Hamburg, Germany,\nRep. No. 12, 95 pp.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_JONSWAP\n    friction = FRICTION_JONSWAP()\n    print(friction.render())\n    friction = FRICTION_JONSWAP(cfjon=0.038)\n    print(friction.render())\n\nTODO: Implement VARIABLE option?",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "jonswap",
         "description": "Model type discriminator",
         "enum": [
            "jonswap",
            "JONSWAP"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cfjon": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient of the JONSWAP formulation (SWAN default: 0.038)",
         "title": "Cfjon"
      }
   },
   "additionalProperties": false
}

Fields:
field cfjon: float | None = None

Coefficient of the JONSWAP formulation (SWAN default: 0.038)

field model_type: Literal['jonswap', 'JONSWAP'] = 'jonswap'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.FRICTION_MADSEN[source]

Madsen et al (1988) friction.

FRICTION MADSEN [kn]

Note that kn is allowed to vary over the computational region; in that case use the commands INPGRID FRICTION and READINP FRICTION to define and read the friction data. This command FRICTION is still required to define the type of friction expression. The value of kn in this command is then not required (it will be ignored).

References

Madsen, O.S., Poon, Y.K. and Graber, H.C., 1988. Spectral wave attenuation by bottom friction: Theory. In Coastal engineering 1988 (pp. 492-504).

Madsen, O.S. and Rosengaus, M.M., 1988. Spectral wave attenuation by bottom friction: Experiments. In Coastal Engineering 1988 (pp. 849-857).

Examples

In [1]: from rompy.swan.components.physics import FRICTION_MADSEN

In [2]: friction = FRICTION_MADSEN()

In [3]: print(friction.render())
FRICTION MADSEN

In [4]: friction = FRICTION_MADSEN(kn=0.038)

In [5]: print(friction.render())
FRICTION MADSEN kn=0.038

Show JSON schema
{
   "title": "FRICTION_MADSEN",
   "description": "Madsen et al (1988) friction.\n\n.. code-block:: text\n\n    FRICTION MADSEN [kn]\n\nNote that `kn` is allowed to vary over the computational region; in that case use\nthe commands INPGRID FRICTION and READINP FRICTION to define and read the friction\ndata. This command FRICTION is still required to define the type of friction\nexpression. The value of `kn` in this command is then not required (it will be\nignored).\n\nReferences\n----------\nMadsen, O.S., Poon, Y.K. and Graber, H.C., 1988. Spectral wave attenuation by\nbottom friction: Theory. In Coastal engineering 1988 (pp. 492-504).\n\nMadsen, O.S. and Rosengaus, M.M., 1988. Spectral wave attenuation by bottom\nfriction: Experiments. In Coastal Engineering 1988 (pp. 849-857).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_MADSEN\n    friction = FRICTION_MADSEN()\n    print(friction.render())\n    friction = FRICTION_MADSEN(kn=0.038)\n    print(friction.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "madsen",
         "description": "Model type discriminator",
         "enum": [
            "madsen",
            "MADSEN"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "kn": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "equivalent roughness length scale of the bottom (in m) (SWAN default: 0.05)",
         "title": "Kn"
      }
   },
   "additionalProperties": false
}

Fields:
field kn: float | None = None

equivalent roughness length scale of the bottom (in m) (SWAN default: 0.05)

field model_type: Literal['madsen', 'MADSEN'] = 'madsen'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.FRICTION_RIPPLES[source]

Smith et al. (2011) Ripples friction.

FRICTION RIPPLES [S] [D]

Indicates that the expression of Smith et al. (2011) should be activated. Here friction depends on the formation of bottom ripples and sediment size.

References

Smith, G.A., Babanin, A.V., Riedel, P., Young, I.R., Oliver, S. and Hubbert, G., 2011. Introduction of a new friction routine into the SWAN model that evaluates roughness due to bedform and sediment size changes. Coastal Engineering, 58(4), pp.317-326.

Examples

In [1]: from rompy.swan.components.physics import FRICTION_RIPPLES

In [2]: friction = FRICTION_RIPPLES()

In [3]: print(friction.render())
FRICTION RIPPLES

In [4]: friction = FRICTION_RIPPLES(s=2.65, d=0.0001)

In [5]: print(friction.render())
FRICTION RIPPLES S=2.65 D=0.0001

Show JSON schema
{
   "title": "FRICTION_RIPPLES",
   "description": "Smith et al. (2011) Ripples friction.\n\n.. code-block:: text\n\n    FRICTION RIPPLES [S] [D]\n\nIndicates that the expression of Smith et al. (2011) should be activated. Here\nfriction depends on the formation of bottom ripples and sediment size.\n\nReferences\n----------\nSmith, G.A., Babanin, A.V., Riedel, P., Young, I.R., Oliver, S. and Hubbert, G.,\n2011. Introduction of a new friction routine into the SWAN model that evaluates\nroughness due to bedform and sediment size changes. Coastal Engineering, 58(4),\npp.317-326.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import FRICTION_RIPPLES\n    friction = FRICTION_RIPPLES()\n    print(friction.render())\n    friction = FRICTION_RIPPLES(s=2.65, d=0.0001)\n    print(friction.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "ripples",
         "description": "Model type discriminator",
         "enum": [
            "ripples",
            "RIPPLES"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "s": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The specific gravity of the sediment (SWAN default: 2.65)",
         "title": "S"
      },
      "d": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The sediment diameter (in m) (SWAN default: 0.0001)",
         "title": "D"
      }
   },
   "additionalProperties": false
}

Fields:
field d: float | None = None

The sediment diameter (in m) (SWAN default: 0.0001)

field model_type: Literal['ripples', 'RIPPLES'] = 'ripples'

Model type discriminator

field s: float | None = None

The specific gravity of the sediment (SWAN default: 2.65)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.GEN1[source]

First generation source terms GEN1.

GEN1 [cf10] [cf20] [cf30] [cf40] [edmlpm] [cdrag] [umin] [cfpm]

With this command the user indicates that SWAN should run in first-generation mode (see Scientific/Technical documentation).

Examples

In [1]: from rompy.swan.components.physics import GEN1

In [2]: gen = GEN1()

In [3]: print(gen.render())
GEN1

In [4]: kwargs = dict(
   ...:     cf10=188.0,
   ...:     cf20=0.59,
   ...:     cf30=0.12,
   ...:     cf40=250.0,
   ...:     edmlpm=0.0036,
   ...:     cdrag=0.0012,
   ...:     umin=1.0,
   ...:     cfpm=0.13
   ...: )
   ...: 

In [5]: gen = GEN1(**kwargs)

In [6]: print(gen.render())
GEN1 cf10=188.0 cf20=0.59 cf30=0.12 cf40=250.0 edmlpm=0.0036 cdrag=0.0012 umin=1.0 cfpm=0.13

Show JSON schema
{
   "title": "GEN1",
   "description": "First generation source terms GEN1.\n\n.. code-block:: text\n\n    GEN1 [cf10] [cf20] [cf30] [cf40] [edmlpm] [cdrag] [umin] [cfpm]\n\nWith this command the user indicates that SWAN should run in first-generation mode\n(see Scientific/Technical documentation).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import GEN1\n    gen = GEN1()\n    print(gen.render())\n    kwargs = dict(\n        cf10=188.0,\n        cf20=0.59,\n        cf30=0.12,\n        cf40=250.0,\n        edmlpm=0.0036,\n        cdrag=0.0012,\n        umin=1.0,\n        cfpm=0.13\n    )\n    gen = GEN1(**kwargs)\n    print(gen.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "gen1",
         "description": "Model type discriminator",
         "enum": [
            "gen1",
            "GEN1"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cf10": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the linear wave growth (SWAN default: 188.0)",
         "title": "Cf10"
      },
      "cf20": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the exponential wave growth (SWAN default: 0.59)",
         "title": "Cf20"
      },
      "cf30": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the exponential wave growth (SWAN default: 0.12)",
         "title": "Cf30"
      },
      "cf40": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the dissipation rate, i.e., the time decay scale (SWAN default: 250.0)",
         "title": "Cf40"
      },
      "edmlpm": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum non-dimensionless energy density of the wind sea part of the spectrum according to Pierson Moskowitz (SWAN default: 0.0036)",
         "title": "Edmlpm"
      },
      "cdrag": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Drag coefficient (SWAN default: 0.0012)",
         "title": "Cdrag"
      },
      "umin": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Minimum wind velocity (relative to current; all wind speeds are taken at 10 m above sea level) (SWAN default: 1)",
         "title": "Umin"
      },
      "cfpm": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient which determines the Pierson Moskowitz frequency: `delta_PM = 2pi g / U_10` (SWAN default: 0.13)",
         "title": "Cfpm"
      }
   },
   "additionalProperties": false
}

Fields:
field cdrag: float | None = None

Drag coefficient (SWAN default: 0.0012)

field cf10: float | None = None

Controls the linear wave growth (SWAN default: 188.0)

field cf20: float | None = None

Controls the exponential wave growth (SWAN default: 0.59)

field cf30: float | None = None

Controls the exponential wave growth (SWAN default: 0.12)

field cf40: float | None = None

Controls the dissipation rate, i.e., the time decay scale (SWAN default: 250.0)

field cfpm: float | None = None

Coefficient which determines the Pierson Moskowitz frequency: delta_PM = 2pi g / U_10 (SWAN default: 0.13)

field edmlpm: float | None = None

Maximum non-dimensionless energy density of the wind sea part of the spectrum according to Pierson Moskowitz (SWAN default: 0.0036)

field model_type: Literal['gen1', 'GEN1'] = 'gen1'

Model type discriminator

field umin: float | None = None

Minimum wind velocity (relative to current; all wind speeds are taken at 10 m above sea level) (SWAN default: 1)

cmd()[source]

Command line string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.GEN2[source]

Second generation source terms GEN2.

GEN2 [cf10] [cf20] [cf30] [cf40] [cf50] [cf60] [edmlpm] [cdrag] [umin] [cfpm]

With this command the user indicates that SWAN should run in second-generation mode (see Scientific/Technical documentation).

Examples

In [1]: from rompy.swan.components.physics import GEN2

In [2]: gen = GEN2()

In [3]: print(gen.render())
GEN2

In [4]: kwargs = dict(
   ...:     cf10=188.0,
   ...:     cf20=0.59,
   ...:     cf30=0.12,
   ...:     cf40=250.0,
   ...:     cf50=0.0023,
   ...:     cf60=-0.223,
   ...:     edmlpm=0.0036,
   ...:     cdrag=0.0012,
   ...:     umin=1.0,
   ...:     cfpm=0.13
   ...: )
   ...: 

In [5]: gen = GEN2(**kwargs)

In [6]: print(gen.render())
GEN2 cf10=188.0 cf20=0.59 cf30=0.12 cf40=250.0 cf50=0.0023 cf60=-0.223 edmlpm=0.0036 cdrag=0.0012 umin=1.0 cfpm=0.13

Show JSON schema
{
   "title": "GEN2",
   "description": "Second generation source terms GEN2.\n\n.. code-block:: text\n\n    GEN2 [cf10] [cf20] [cf30] [cf40] [cf50] [cf60] [edmlpm] [cdrag] [umin] [cfpm]\n\nWith this command the user indicates that SWAN should run in second-generation mode\n(see Scientific/Technical documentation).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import GEN2\n    gen = GEN2()\n    print(gen.render())\n    kwargs = dict(\n        cf10=188.0,\n        cf20=0.59,\n        cf30=0.12,\n        cf40=250.0,\n        cf50=0.0023,\n        cf60=-0.223,\n        edmlpm=0.0036,\n        cdrag=0.0012,\n        umin=1.0,\n        cfpm=0.13\n    )\n    gen = GEN2(**kwargs)\n    print(gen.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "gen2",
         "description": "Model type discriminator",
         "enum": [
            "gen2",
            "GEN2"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cf10": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the linear wave growth (SWAN default: 188.0)",
         "title": "Cf10"
      },
      "cf20": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the exponential wave growth (SWAN default: 0.59)",
         "title": "Cf20"
      },
      "cf30": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the exponential wave growth (SWAN default: 0.12)",
         "title": "Cf30"
      },
      "cf40": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the dissipation rate, i.e., the time decay scale (SWAN default: 250.0)",
         "title": "Cf40"
      },
      "edmlpm": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum non-dimensionless energy density of the wind sea part of the spectrum according to Pierson Moskowitz (SWAN default: 0.0036)",
         "title": "Edmlpm"
      },
      "cdrag": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Drag coefficient (SWAN default: 0.0012)",
         "title": "Cdrag"
      },
      "umin": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Minimum wind velocity (relative to current; all wind speeds are taken at 10 m above sea level) (SWAN default: 1)",
         "title": "Umin"
      },
      "cfpm": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient which determines the Pierson Moskowitz frequency: `delta_PM = 2pi g / U_10` (SWAN default: 0.13)",
         "title": "Cfpm"
      },
      "cf50": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the spectral energy scale of the limit spectrum (SWAN default: 0.0023)",
         "title": "Cf50"
      },
      "cf60": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Ccontrols the spectral energy scale of the limit spectrum (SWAN default: -0.223",
         "title": "Cf60"
      }
   },
   "additionalProperties": false
}

Fields:
field cdrag: float | None = None

Drag coefficient (SWAN default: 0.0012)

field cf10: float | None = None

Controls the linear wave growth (SWAN default: 188.0)

field cf20: float | None = None

Controls the exponential wave growth (SWAN default: 0.59)

field cf30: float | None = None

Controls the exponential wave growth (SWAN default: 0.12)

field cf40: float | None = None

Controls the dissipation rate, i.e., the time decay scale (SWAN default: 250.0)

field cf50: float | None = None

Controls the spectral energy scale of the limit spectrum (SWAN default: 0.0023)

field cf60: float | None = None

Ccontrols the spectral energy scale of the limit spectrum (SWAN default: -0.223

field cfpm: float | None = None

Coefficient which determines the Pierson Moskowitz frequency: delta_PM = 2pi g / U_10 (SWAN default: 0.13)

field edmlpm: float | None = None

Maximum non-dimensionless energy density of the wind sea part of the spectrum according to Pierson Moskowitz (SWAN default: 0.0036)

field model_type: Literal['gen2', 'GEN2'] = 'gen2'

Model type discriminator

field umin: float | None = None

Minimum wind velocity (relative to current; all wind speeds are taken at 10 m above sea level) (SWAN default: 1)

cmd()[source]

Command line string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.GEN3[source]

Third generation source terms GEN3.

GEN3 JANSSEN|KOMEN|->WESTHUYSEN|ST6 AGROW [a]

With this command the user indicates that SWAN should run in third-generation mode for wind input, quadruplet interactions and whitecapping.

Examples

In [1]: from rompy.swan.components.physics import GEN3

In [2]: gen = GEN3(
   ...:     source_terms=dict(
   ...:         model_type="westhuysen",
   ...:         wind_drag="wu",
   ...:         agrow=True,
   ...:     ),
   ...: )
   ...: 

In [3]: print(gen.render())
GEN3 WESTHUYSEN DRAG WU AGROW

In [4]: from rompy.swan.subcomponents.physics import ST6C1

In [5]: gen = GEN3(source_terms=ST6C1())

In [6]: print(gen.render())
GEN3 ST6 a1sds=4.7e-07 a2sds=6.6e-06 p1sds=4.0 p2sds=4.0 UP HWANG VECTAU U10PROXY windscaling=28.0 AGROW

Show JSON schema
{
   "title": "GEN3",
   "description": "Third generation source terms GEN3.\n\n.. code-block:: text\n\n    GEN3 JANSSEN|KOMEN|->WESTHUYSEN|ST6 AGROW [a]\n\nWith this command the user indicates that SWAN should run in third-generation mode\nfor wind input, quadruplet interactions and whitecapping.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import GEN3\n    gen = GEN3(\n        source_terms=dict(\n            model_type=\"westhuysen\",\n            wind_drag=\"wu\",\n            agrow=True,\n        ),\n    )\n    print(gen.render())\n    from rompy.swan.subcomponents.physics import ST6C1\n    gen = GEN3(source_terms=ST6C1())\n    print(gen.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "gen3",
         "description": "Model type discriminator",
         "enum": [
            "gen3",
            "GEN3"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "source_terms": {
         "description": "SWAN source terms to be used (SWAN default: WESTHUYSEN)",
         "discriminator": {
            "mapping": {
               "JANSSEN": "#/$defs/JANSSEN",
               "KOMEN": "#/$defs/KOMEN",
               "WESTHUYSEN": "#/$defs/WESTHUYSEN",
               "janssen": "#/$defs/JANSSEN",
               "komen": "#/$defs/KOMEN",
               "st6": "#/$defs/ST6",
               "st6c1": "#/$defs/ST6C1",
               "st6c2": "#/$defs/ST6C2",
               "st6c3": "#/$defs/ST6C3",
               "st6c4": "#/$defs/ST6C4",
               "st6c5": "#/$defs/ST6C5",
               "westhuysen": "#/$defs/WESTHUYSEN"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/JANSSEN"
            },
            {
               "$ref": "#/$defs/KOMEN"
            },
            {
               "$ref": "#/$defs/WESTHUYSEN"
            },
            {
               "$ref": "#/$defs/ST6"
            },
            {
               "$ref": "#/$defs/ST6C1"
            },
            {
               "$ref": "#/$defs/ST6C2"
            },
            {
               "$ref": "#/$defs/ST6C3"
            },
            {
               "$ref": "#/$defs/ST6C4"
            },
            {
               "$ref": "#/$defs/ST6C5"
            }
         ],
         "title": "Source Terms"
      }
   },
   "$defs": {
      "JANSSEN": {
         "additionalProperties": false,
         "description": "Janssen source terms subcomponent.\n\n.. code-block:: text\n\n    JANSSEN [cds1] [delta] (AGROW [a])\n\nReferences\n----------\nJanssen, P.A., 1989. Wave-induced stress and the drag of air flow over sea waves.\nJournal of Physical Oceanography, 19(6), pp.745-754.\n\nJanssen, P.A.E.M., Lionello, P. and Zambresky, L., 1989. On the interaction of wind\nand waves. Philosophical transactions of the royal society of London. Series A,\nMathematical and Physical Sciences, 329(1604), pp.289-301.\n\nJanssen, P.A., 1991. Quasi-linear theory of wind-wave generation applied to wave\nforecasting. Journal of physical oceanography, 21(11), pp.1631-1642.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import JANSSEN\n    janssen = JANSSEN()\n    print(janssen.render())\n    janssen = JANSSEN(cds1=4.5, delta=0.5, agrow=True)\n    print(janssen.render())",
         "properties": {
            "model_type": {
               "default": "janssen",
               "description": "Model type discriminator",
               "enum": [
                  "janssen",
                  "JANSSEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "wu",
               "description": "Indicates the wind drag formulation",
               "enum": [
                  "wu",
                  "fit"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "cds1": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for determining the rate of whitecapping dissipation ($Cds / s^4_{PM}$) (SWAN default: 4.5)",
               "title": "Cds1"
            },
            "delta": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient which determines the dependency of the whitecapping on wave number (mix with Komen et al. formulation) (SWAN default: 0.5)",
               "title": "Delta"
            }
         },
         "title": "JANSSEN",
         "type": "object"
      },
      "KOMEN": {
         "additionalProperties": false,
         "description": "Komen source terms subcomponent.\n\n.. code-block:: text\n\n    KOMEN [cds2] [stpm] (AGROW [a])\n\nReferences\n----------\nKomen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully\ndeveloped wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import KOMEN\n    komen = KOMEN()\n    print(komen.render())\n    komen = KOMEN(cds2=2.36e-5, stpm=3.02e-3, agrow=True, a=0.0015)\n    print(komen.render())",
         "properties": {
            "model_type": {
               "default": "komen",
               "description": "Model type discriminator",
               "enum": [
                  "komen",
                  "KOMEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "wu",
               "description": "Indicates the wind drag formulation",
               "enum": [
                  "wu",
                  "fit"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Coefficient for determining the rate of whitecapping dissipation (`Cds`) (SWAN default: 2.36e-5)",
               "title": "Cds2"
            },
            "stpm": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Value of the wave steepness for a Pierson-Moskowitz spectrum (`s^2_PM`) (SWAN default: 3.02e-3)",
               "title": "Stpm"
            }
         },
         "title": "KOMEN",
         "type": "object"
      },
      "ST6": {
         "additionalProperties": false,
         "description": "St6 source terms subcomponent.\n\n.. code-block:: text\n\n    ST6 [a1sds] [a2sds] [p1sds] [p2sds] UP|DOWN HWANG|FAN|ECMWF VECTAU|SCATAU &\n        TRUE10|U10PROXY [windscaling] DEBIAS [cdfac] (AGROW [a])\n\nwind input and whitecapping from Rogers et al. (2012) (RBW12).\n\nNotes\n-----\nThe two arguments are specified in the Appendix C of the User manual but not in the\ncommand description for WESTH in Section 4.5.4. They are also options in the\nWCAPPING command. It is not entirely clear if they should/could be specified here.\n\nReferences\n----------\nFan, Y., Lin, S.J., Held, I.M., Yu, Z. and Tolman, H.L., 2012. Global ocean surface\nwave simulation using a coupled atmosphere\u2013wave model. Journal of Climate, 25(18),\npp.6233-6252.\n\nRogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and\nwhitecapping dissipation in a model for wind-generated surface waves: Description\nand simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9),\npp.1329-1346.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6\n    st6 = ST6(a1sds=4.7e-7, a2sds=6.6e-6)\n    print(st6.render())\n    kwargs = dict(\n        a1sds=2.8e-6,\n        a2sds=3.5e-5,\n        normalization=\"up\",\n        wind_drag=\"hwang\",\n        tau=\"vectau\",\n        u10=\"u10proxy\",\n        windscaling=32.0,\n        cdfac=0.89,\n        agrow=True,\n        a=0.0015,\n    )\n    st6 = ST6(**kwargs)\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6",
               "default": "st6",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "description": "Coefficient related to local dissipation term T1 (a1 in RBW12)",
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "description": "Coefficient related to local dissipation term T2 (a2 in RBW12)",
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power coefficient controlling strength of dissipation term T1 (L in RBW12, SWAN default: 4)",
               "title": "P1Sds"
            },
            "p2sds": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Power coefficient controlling strength of dissipation term T2 (M in RBW12, SWAN default: 4)",
               "title": "P2Sds"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": 32.0,
               "description": "Factor to scale U10 with U* when using U10PROXY",
               "title": "Windscaling"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "required": [
            "a1sds",
            "a2sds"
         ],
         "title": "ST6",
         "type": "object"
      },
      "ST6C1": {
         "additionalProperties": false,
         "description": "First ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C1\n    st6 = ST6C1()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c1",
               "default": "st6c1",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 4.7e-07,
               "default": 4.7e-07,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 6.6e-06,
               "default": 6.6e-06,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 28.0,
               "default": 28.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "title": "ST6C1",
         "type": "object"
      },
      "ST6C2": {
         "additionalProperties": false,
         "description": "Second ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP FAN VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C2\n    st6 = ST6C2()\n    print(st6.render())\n\nTODO: Ensure validator is reused here so fan and debias are not used together.",
         "properties": {
            "model_type": {
               "const": "st6c2",
               "default": "st6c2",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "const": "fan",
               "default": "fan",
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 4.7e-07,
               "default": 4.7e-07,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 6.6e-06,
               "default": 6.6e-06,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 28.0,
               "default": 28.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "title": "ST6C2",
         "type": "object"
      },
      "ST6C3": {
         "additionalProperties": false,
         "description": "Third ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C3\n    st6 = ST6C3()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c3",
               "default": "st6c3",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 2.8e-06,
               "default": 2.8e-06,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 3.5e-05,
               "default": 3.5e-05,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 32.0,
               "default": 32.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
               "title": "Cdfac"
            }
         },
         "title": "ST6C3",
         "type": "object"
      },
      "ST6C4": {
         "additionalProperties": false,
         "description": "Fourth ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 DEBIAS 0.89 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C4\n    st6 = ST6C4()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c4",
               "default": "st6c4",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 2.8e-06,
               "default": 2.8e-06,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 3.5e-05,
               "default": 3.5e-05,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 32.0,
               "default": 32.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "const": 0.89,
               "default": 0.89,
               "title": "Cdfac",
               "type": "number"
            }
         },
         "title": "ST6C4",
         "type": "object"
      },
      "ST6C5": {
         "additionalProperties": false,
         "description": "Fifth ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C5\n    st6 = ST6C5()\n    print(st6.render())",
         "properties": {
            "model_type": {
               "const": "st6c5",
               "default": "st6c5",
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "hwang",
               "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
               "enum": [
                  "hwang",
                  "fan",
                  "ecmwf"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "const": true,
               "default": true,
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "a1sds": {
               "const": 6.5e-06,
               "default": 6.5e-06,
               "title": "A1Sds",
               "type": "number"
            },
            "a2sds": {
               "const": 8.5e-05,
               "default": 8.5e-05,
               "title": "A2Sds",
               "type": "number"
            },
            "p1sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P1Sds",
               "type": "number"
            },
            "p2sds": {
               "const": 4.0,
               "default": 4.0,
               "title": "P2Sds",
               "type": "number"
            },
            "normalization": {
               "default": "up",
               "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
               "enum": [
                  "up",
                  "down"
               ],
               "title": "Normalization",
               "type": "string"
            },
            "tau": {
               "default": "vectau",
               "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
               "enum": [
                  "vectau",
                  "scatau"
               ],
               "title": "Tau",
               "type": "string"
            },
            "u10": {
               "default": "u10proxy",
               "description": "Wind velocity definition",
               "enum": [
                  "u10proxy",
                  "true10"
               ],
               "title": "U10",
               "type": "string"
            },
            "windscaling": {
               "const": 35.0,
               "default": 35.0,
               "title": "Windscaling",
               "type": "number"
            },
            "cdfac": {
               "const": 0.89,
               "default": 0.89,
               "title": "Cdfac",
               "type": "number"
            }
         },
         "title": "ST6C5",
         "type": "object"
      },
      "WESTHUYSEN": {
         "additionalProperties": false,
         "description": "Westhuysen source terms subcomponent.\n\n.. code-block:: text\n\n    WESTHUYSEN [cds2] [br] (AGROW [a])\n\nNonlinear saturation-based whitecapping combined with wind input of Yan (1987).\n\nNotes\n-----\nThe two arguments are specified in the Appendix C of the User manual but not in the\ncommand description for WESTH in Section 4.5.4. They are also options in the\nWCAPPING command. It is not entirely clear if they should/could be specified here.\n\nReferences\n----------\nvan der Westhuysen, A.J., Zijlema, M. and Battjes, J.A., 2007. Nonlinear\nsaturation-based whitecapping dissipation in SWAN for deep and shallow water.\nCoastal Engineering, 54(2), pp.151-170.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import WESTHUYSEN\n    westhuysen = WESTHUYSEN()\n    print(westhuysen.render())\n    westhuysen = WESTHUYSEN(cds2=5.0e-5, br=1.75e-3)\n    print(westhuysen.render())",
         "properties": {
            "model_type": {
               "default": "westhuysen",
               "description": "Model type discriminator",
               "enum": [
                  "westhuysen",
                  "WESTHUYSEN"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "wind_drag": {
               "default": "wu",
               "description": "Indicates the wind drag formulation",
               "enum": [
                  "wu",
                  "fit"
               ],
               "title": "Wind Drag",
               "type": "string"
            },
            "agrow": {
               "default": false,
               "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
               "title": "Agrow",
               "type": "boolean"
            },
            "a": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
               "title": "A"
            },
            "cds2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5).",
               "title": "Cds2"
            },
            "br": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Threshold saturation level\t(SWAN default: 1.75e-3)",
               "title": "Br"
            }
         },
         "title": "WESTHUYSEN",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['gen3', 'GEN3'] = 'gen3'

Model type discriminator

field source_terms: JANSSEN | KOMEN | WESTHUYSEN | ST6 | ST6C1 | ST6C2 | ST6C3 | ST6C4 | ST6C5 [Optional]

SWAN source terms to be used (SWAN default: WESTHUYSEN)

cmd()[source]

Command line string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.LIMITER[source]

Physics limiter.

LIMITER [ursell] [qb]

With this command the user can de-activate permanently the quadruplets when the actual Ursell number exceeds ursell. Moreover, as soon as the actual fraction of breaking waves exceeds qb then the action limiter will not be used in case of decreasing action density.

Examples

In [1]: from rompy.swan.components.physics import LIMITER

In [2]: limiter = LIMITER()

In [3]: print(limiter.render())
LIMITER

In [4]: limiter = LIMITER(ursell=10.0, qb=1.0)

In [5]: print(limiter.render())
LIMITER ursell=10.0 qb=1.0

Show JSON schema
{
   "title": "LIMITER",
   "description": "Physics limiter.\n\n.. code-block:: text\n\n    LIMITER [ursell] [qb]\n\nWith this command the user can de-activate permanently the quadruplets when\nthe actual Ursell number exceeds `ursell`. Moreover, as soon as the actual\nfraction of breaking waves exceeds `qb` then the action limiter will not be\nused in case of decreasing action density.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import LIMITER\n    limiter = LIMITER()\n    print(limiter.render())\n    limiter = LIMITER(ursell=10.0, qb=1.0)\n    print(limiter.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "limiter",
         "description": "Model type discriminator",
         "enum": [
            "limiter",
            "LIMITER"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "ursell": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The upper threshold for Ursell number (SWAN default: 10.0)",
         "title": "Ursell"
      },
      "qb": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The threshold for fraction of breaking waves (SWAN default: 1.0)",
         "title": "Qb"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['limiter', 'LIMITER'] = 'limiter'

Model type discriminator

field qb: float | None = None

The threshold for fraction of breaking waves (SWAN default: 1.0)

field ursell: float | None = None

The upper threshold for Ursell number (SWAN default: 10.0)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.MUD[source]

Mud dumping.

MUD [layer] [rhom] [viscm]

With this command the user can activate wave damping due to mud based on Ng (2000). If this command or the commands INPGRID MUDLAY and READINP MUDLAY are not used, SWAN will not account for muddy bottom effects.

References

Ng, C., 2000, Water waves over a muddy bed: A two layer Stokes’ boundary layer model, Coastal Eng., 40, 221-242.

Examples

In [1]: from rompy.swan.components.physics import MUD

In [2]: mud = MUD()

In [3]: print(mud.render())
MUD

In [4]: mud = MUD(
   ...:     layer=2.0,
   ...:     rhom=1300,
   ...:     viscm=0.0076,
   ...: )
   ...: 

In [5]: print(mud.render())
MUD layer=2.0 rhom=1300.0 viscm=0.0076

TODO: Validate layer must be prescribed if INPGRID MUDLAY isn’t used.

Show JSON schema
{
   "title": "MUD",
   "description": "Mud dumping.\n\n.. code-block:: text\n\n    MUD [layer] [rhom] [viscm]\n\nWith this command the user can activate wave damping due to mud based on Ng (2000).\nIf this command or the commands INPGRID MUDLAY and READINP MUDLAY are not used,\nSWAN will not account for muddy bottom effects.\n\nReferences\n----------\nNg, C., 2000, Water waves over a muddy bed: A two layer Stokes' boundary layer\nmodel, Coastal Eng., 40, 221-242.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import MUD\n    mud = MUD()\n    print(mud.render())\n    mud = MUD(\n        layer=2.0,\n        rhom=1300,\n        viscm=0.0076,\n    )\n    print(mud.render())\n\nTODO: Validate `layer` must be prescribed if `INPGRID MUDLAY` isn't used.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "mud",
         "description": "Model type discriminator",
         "enum": [
            "mud",
            "MUD"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "layer": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The thickness of the mud layer (in m). Note that `layer` is allowed to vary over the computational region to account for the zonation of muddy bottom. In that case use the commands `INPGRID MUDLAY` and `READINP MUDLAY` to define and read the layer thickness of mud. The value of `layer` in this command is then not required (it will be ignored)",
         "title": "Layer"
      },
      "rhom": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The density of the mud layer (in kg/m3) (SWAN default: 1300)",
         "title": "Rhom"
      },
      "viscm": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The kinematic viscosity of the mud layer (in m2/s) (SWAN default: 0.0076)",
         "title": "Viscm"
      }
   },
   "additionalProperties": false
}

Fields:
field layer: float | None = None

The thickness of the mud layer (in m). Note that layer is allowed to vary over the computational region to account for the zonation of muddy bottom. In that case use the commands INPGRID MUDLAY and READINP MUDLAY to define and read the layer thickness of mud. The value of layer in this command is then not required (it will be ignored)

field model_type: Literal['mud', 'MUD'] = 'mud'

Model type discriminator

field rhom: float | None = None

The density of the mud layer (in kg/m3) (SWAN default: 1300)

field viscm: float | None = None

The kinematic viscosity of the mud layer (in m2/s) (SWAN default: 0.0076)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.NEGATINP[source]

Negative wind input.

NEGATINP [rdcoef]

With this optional command the user activates negative wind input. This is intended only for use with non-breaking swell dissipation SSWELL ZIEGER. Parameter rdcoef is a fraction between 0 and 1, representing the strength of negative wind input. As an example, with [rdcoef]=0.04, for a spectral bin that is opposed to the wind direction, the wind input factor W(k, θ) is negative, and its magnitude is 4% of the corresponding value of the spectral bin that is in the opposite direction (i.e. in the wind direction). See Zieger et al. (2015) eq. 11, where a0 is their notation for [rdcoef]. Default [rdcoef]=0.0 and rdcoef=0.04 is recommended, though as implied by Zieger et al. (2015), this value is not well-established, so the user is encouraged to experiment with other values.

References

Zieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based source terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96, pp.2-25.

Examples

In [1]: from rompy.swan.components.physics import NEGATINP

In [2]: negatinp = NEGATINP()

In [3]: print(negatinp.render())
NEGATINP

In [4]: negatinp = NEGATINP(rdcoef=0.04)

In [5]: print(negatinp.render())
NEGATINP rdcoef=0.04

Show JSON schema
{
   "title": "NEGATINP",
   "description": "Negative wind input.\n\n.. code-block:: text\n\n    NEGATINP [rdcoef]\n\nWith this optional command the user activates negative wind input. **This is\nintended only for use with non-breaking swell dissipation SSWELL ZIEGER**.\nParameter `rdcoef` is a fraction between 0 and 1, representing the strength of\nnegative wind input. As an example, with [rdcoef]=0.04, for a spectral bin that is\nopposed to the wind direction, the wind input factor W(k, \u03b8) is negative, and its\nmagnitude is 4% of the corresponding value of the spectral bin that is in the\nopposite direction (i.e. in the wind direction). See Zieger et al. (2015) eq. 11,\nwhere a0 is their notation for [rdcoef]. Default [rdcoef]=0.0 and `rdcoef=0.04` is\nrecommended, though as implied by Zieger et al. (2015), this value is not\nwell-established, so the user is encouraged to experiment with other values.\n\nReferences\n----------\nZieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based\nsource terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96,\npp.2-25.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import NEGATINP\n    negatinp = NEGATINP()\n    print(negatinp.render())\n    negatinp = NEGATINP(rdcoef=0.04)\n    print(negatinp.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "negatinp",
         "description": "Model type discriminator",
         "enum": [
            "negatinp",
            "NEGATINP"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "rdcoef": {
         "anyOf": [
            {
               "maximum": 1.0,
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient representing the strength of negative wind input",
         "title": "Rdcoef"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['negatinp', 'NEGATINP'] = 'negatinp'

Model type discriminator

field rdcoef: float | None = None

Coefficient representing the strength of negative wind input

Constraints:
  • ge = 0.0

  • le = 1.0

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.OBSTACLE[source]

Subgrid obstacle.

OBSTACLE ->TRANSM|TRANS1D|TRANS2D|GODA|DANGREMOND REFL [reflc] ->RSPEC|RDIFF &
    (FREEBOARD [hgt] [gammat] [gammar] QUAY) LINE < [xp] [yp] >

With this optional command the user provides the characteristics of a (line of) sub-grid obstacle(s) through which waves are transmitted or against which waves are reflected (possibly both at the same time). The obstacle is sub-grid in the sense that it is narrow compared to the spatial meshes; its length should be at least one mesh length.

The location of the obstacle is defined by a sequence of corner points of a line. The obstacles interrupt the propagation of the waves from one grid point to the next wherever this obstacle line is located between two neighbouring grid points (of the computational grid; the resolution of the obstacle is therefore equal to the computational grid spacing). This implies that an obstacle to be effective must be located such that it crosses at least one grid line. This is always the case when an obstacle is larger than one mesh length.

Notes

  • The advise is to define obstacles with the least amount of points possible.

  • SWAN checks if the criterion reflc^2 + trcoef^2 LE 1 is fulfilled.

Examples

In [1]: from rompy.swan.components.physics import OBSTACLE

In [2]: obs = OBSTACLE(
   ...:     transmission=dict(model_type="transm", trcoef=0.5),
   ...:     reflection=dict(reflc=0.5),
   ...:     line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
   ...: )
   ...: 

In [3]: print(obs.render())
OBSTACLE TRANSM trcoef=0.5 REFL reflc=0.5 LINE 174.1 -39.1 174.2 -39.1 174.3 -39.1

Show JSON schema
{
   "title": "OBSTACLE",
   "description": "Subgrid obstacle.\n\n.. code-block:: text\n\n    OBSTACLE ->TRANSM|TRANS1D|TRANS2D|GODA|DANGREMOND REFL [reflc] ->RSPEC|RDIFF &\n        (FREEBOARD [hgt] [gammat] [gammar] QUAY) LINE < [xp] [yp] >\n\nWith this optional command the user provides the characteristics of a (line\nof) sub-grid obstacle(s) through which waves are transmitted or against which\nwaves are reflected (possibly both at the same time). The obstacle is sub-grid\nin the sense that it is narrow compared to the spatial meshes; its length should\nbe at least one mesh length.\n\nThe location of the obstacle is defined by a sequence of corner points of a line.\nThe obstacles interrupt the propagation of the waves from one grid point to the\nnext wherever this obstacle line is located between two neighbouring grid points\n(of the computational grid; the resolution of the obstacle is therefore equal to\nthe computational grid spacing). This implies that an obstacle to be effective must\nbe located such that it crosses at least one grid line. This is always the case\nwhen an obstacle is larger than one mesh length.\n\nNotes\n-----\n\n* The advise is to define obstacles with the least amount of points possible.\n* SWAN checks if the criterion `reflc^2 + trcoef^2 LE 1` is fulfilled.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLE\n    obs = OBSTACLE(\n        transmission=dict(model_type=\"transm\", trcoef=0.5),\n        reflection=dict(reflc=0.5),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "obstacle",
         "description": "Model type discriminator",
         "enum": [
            "obstacle",
            "OBSTACLE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "transmission": {
         "anyOf": [
            {
               "description": "Wave transmission",
               "discriminator": {
                  "mapping": {
                     "DANGREMOND": "#/$defs/DANGREMOND",
                     "GODA": "#/$defs/GODA",
                     "TRANS1D": "#/$defs/TRANS1D",
                     "TRANS2D": "#/$defs/TRANS2D",
                     "TRANSM": "#/$defs/TRANSM",
                     "dangremond": "#/$defs/DANGREMOND",
                     "goda": "#/$defs/GODA",
                     "trans1d": "#/$defs/TRANS1D",
                     "trans2d": "#/$defs/TRANS2D",
                     "transm": "#/$defs/TRANSM"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/TRANSM"
                  },
                  {
                     "$ref": "#/$defs/TRANS1D"
                  },
                  {
                     "$ref": "#/$defs/TRANS2D"
                  },
                  {
                     "$ref": "#/$defs/GODA"
                  },
                  {
                     "$ref": "#/$defs/DANGREMOND"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Transmission"
      },
      "reflection": {
         "anyOf": [
            {
               "$ref": "#/$defs/REFL"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Wave reflection"
      },
      "reflection_type": {
         "anyOf": [
            {
               "description": "Wave reflection type",
               "discriminator": {
                  "mapping": {
                     "RDIFF": "#/$defs/RDIFF",
                     "RSPEC": "#/$defs/RSPEC",
                     "rdiff": "#/$defs/RDIFF",
                     "rspec": "#/$defs/RSPEC"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/RSPEC"
                  },
                  {
                     "$ref": "#/$defs/RDIFF"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Reflection Type"
      },
      "freeboard": {
         "anyOf": [
            {
               "$ref": "#/$defs/FREEBOARD"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Freeboard"
      },
      "line": {
         "$ref": "#/$defs/LINE",
         "default": null,
         "description": "Line of obstacle"
      }
   },
   "$defs": {
      "DANGREMOND": {
         "additionalProperties": false,
         "description": "DAM transmission of d'Angremond et al. (1996).\n\n.. code-block:: text\n\n    DAM DANGREMOND [hgt] [slope] [Bk]\n\nThis option specifies transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nd'Angremond, K., Van Der Meer, J.W. and De Jong, R.J., 1996. Wave transmission at\nlow-crested structures. In Coastal Engineering 1996 (pp. 2418-2427).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DANGREMOND\n    transm = DANGREMOND(hgt=3.0, slope=60, Bk=10.0)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "dangremond",
               "description": "Model type discriminator",
               "enum": [
                  "dangremond",
                  "DANGREMOND"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
               "title": "Hgt",
               "type": "number"
            },
            "slope": {
               "description": "The slope of the obstacle (in degrees)",
               "maximum": 90.0,
               "minimum": 0.0,
               "title": "Slope",
               "type": "number"
            },
            "Bk": {
               "description": "The crest width of the obstacle",
               "title": "Bk",
               "type": "number"
            }
         },
         "required": [
            "hgt",
            "slope",
            "Bk"
         ],
         "title": "DANGREMOND",
         "type": "object"
      },
      "FREEBOARD": {
         "additionalProperties": false,
         "description": "Freeboard dependent transmission and reflection.\n\n.. code-block:: text\n\n    FREEBOARD [hgt] [gammat] [gammar] [QUAY]\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nSee the Scientific/Technical documentation for background information on the\n`gammat` and `gammar` shape parameters.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import FREEBOARD\n    freeboard = FREEBOARD(hgt=2.0)\n    print(freeboard.render())\n    freeboard = FREEBOARD(hgt=2.0, gammat=1.0, gammar=1.0, quay=True)\n    print(freeboard.render())",
         "properties": {
            "model_type": {
               "default": "freeboard",
               "description": "Model type discriminator",
               "enum": [
                  "freeboard",
                  "FREEBOARD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle or height of the quay above the reference level (same reference level as for the bottom). Use a negative value if the top is below that reference level. In case `hgt` is also specified in the DAM option, both values of `hgt` should be equal for consistency",
               "title": "Hgt",
               "type": "number"
            },
            "gammat": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape parameter of relative freeboard dependency of transmission coefficient. This parameter should be higher than zero (SWAN default 1.0)",
               "title": "Gammat"
            },
            "gammar": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape parameter of relative freeboard dependency of reflection coefficient. This parameter should be higher than zero (SWAN default 1.0)",
               "title": "Gammar"
            },
            "quay": {
               "default": false,
               "description": "With this option the user indicates that the freeboard dependency of the transmission and reflection coefficients also depends on the relative position of an obstacle-linked grid point with respect to the position of the obstacle line representing the edge of a quay. In case the active grid point is on the deeper side of the obstacle, then the correction factors are applied using the parameters `hgt`, `gammat` and `gammar`.In case the active grid point is on the shallower side of the obstacle, the reflection coefficient is set to 0 and the transmission coefficient to 1.",
               "title": "Quay",
               "type": "boolean"
            }
         },
         "required": [
            "hgt"
         ],
         "title": "FREEBOARD",
         "type": "object"
      },
      "GODA": {
         "additionalProperties": false,
         "description": "DAM transmission of Goda/Seelig (1979).\n\n.. code-block:: text\n\n    DAM GODA [hgt] [alpha] [beta]\n\nThis option specified transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nGoda, Y. and Suzuki, Y., 1976. Estimation of incident and reflected waves in random\nwave experiments. In Coastal Engineering 1976 (pp. 828-845).\n\nSeelig, W.N., 1979. Effects of breakwaters on waves: Laboratory test of wave\ntransmission by overtopping. In Proc. Conf. Coastal Structures, 1979\n(Vol. 79, No. 2, pp. 941-961).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import GODA\n    transm = GODA(hgt=3.0)\n    print(transm.render())\n    transm = GODA(hgt=3.0, alpha=2.6, beta=0.15)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "goda",
               "description": "Model type discriminator",
               "enum": [
                  "goda",
                  "GODA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
               "title": "Hgt",
               "type": "number"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 2.6)",
               "title": "Alpha"
            },
            "beta": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Another coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 0.15)",
               "title": "Beta"
            }
         },
         "required": [
            "hgt"
         ],
         "title": "GODA",
         "type": "object"
      },
      "LINE": {
         "additionalProperties": false,
         "description": "Line of points to define obstacle location.\n\n.. code-block:: text\n\n    LINE < [xp] [yp] >\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nPoints coordinates should be provided in m If Cartesian coordinates are used or in\ndegrees if spherical coordinates are used (see command `COORD`). At least two\ncorner points must be provided.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import LINE\n    line = LINE(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1])\n    print(line.render())",
         "properties": {
            "model_type": {
               "default": "line",
               "description": "Model type discriminator",
               "enum": [
                  "line",
                  "LINE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "xp": {
               "description": "The x-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "The y-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Yp",
               "type": "array"
            }
         },
         "required": [
            "xp",
            "yp"
         ],
         "title": "LINE",
         "type": "object"
      },
      "RDIFF": {
         "additionalProperties": false,
         "description": "Diffuse reflection.\n\n.. code-block:: text\n\n    RDIFF [pown]\n\nSpecular reflection where incident waves are scattered over reflected direction.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RDIFF\n    refl = RDIFF()\n    print(refl.render())\n    refl = RDIFF(pown=1.0)\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "rdiff",
               "description": "Model type discriminator",
               "enum": [
                  "rdiff",
                  "RDIFF"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "pown": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Each incoming direction \u03b8 is scattered over reflected direction \u03b8_refl according to cos^pown(\u03b8-\u03b8_refl). The parameter `pown` indicates the widthof the redistribution function (SWAN default: 1.0)",
               "title": "Pown"
            }
         },
         "title": "RDIFF",
         "type": "object"
      },
      "REFL": {
         "additionalProperties": false,
         "description": "Obstacle reflections.\n\n.. code-block:: text\n\n    REFL [reflc]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import REFL\n    refl = REFL()\n    print(refl.render())\n    refl = REFL(reflc=0.5)\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "refl",
               "description": "Model type discriminator",
               "enum": [
                  "refl",
                  "REFL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "reflc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Constant reflection coefficient (ratio of reflected over incoming significant wave height) (SWAN default: 1.0)",
               "title": "Reflc"
            }
         },
         "title": "REFL",
         "type": "object"
      },
      "RSPEC": {
         "additionalProperties": false,
         "description": "Specular reflection.\n\n.. code-block:: text\n\n    RSPEC\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RSPEC\n    refl = RSPEC()\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "rspec",
               "description": "Model type discriminator",
               "enum": [
                  "rspec",
                  "RSPEC"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "RSPEC",
         "type": "object"
      },
      "TRANS1D": {
         "additionalProperties": false,
         "description": "Frequency dependent transmission.\n\n.. code-block:: text\n\n    TRANS1D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS1D\n    transm = TRANS1D(trcoef=[0.0, 0.0, 0.2, 0.5, 0.2, 0.0, 0.0])\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "trans1d",
               "description": "Model type discriminator",
               "enum": [
                  "trans1d",
                  "TRANS1D"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency. The number of these transmission values must be equal to the number of frequencies, i.e. `msc` + 1",
               "items": {
                  "maximum": 1.0,
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Trcoef",
               "type": "array"
            }
         },
         "required": [
            "trcoef"
         ],
         "title": "TRANS1D",
         "type": "object"
      },
      "TRANS2D": {
         "additionalProperties": false,
         "description": "Frequency-direction dependent transmission.\n\n.. code-block:: text\n\n    TRANS2D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS2D\n    trcoef = np.array([[0.0, 0.0], [0.1, 0.1], [0.2, 0.2]])\n    transm = TRANS2D(trcoef=trcoef)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "trans2d",
               "description": "Model type discriminator",
               "enum": [
                  "trans2d",
                  "TRANS2D"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency and direction, rows represent directions and columns represent frequencies",
               "properties": {
                  "data_type": {
                     "default": "Any",
                     "title": "dtype",
                     "type": "string"
                  },
                  "data": {
                     "items_schema": {
                        "items_schema": {
                           "type": "any"
                        },
                        "type": "list"
                     },
                     "max_length": 2,
                     "min_length": 2,
                     "type": "list"
                  }
               },
               "required": [
                  "data_type",
                  "data"
               ],
               "title": "Numpy Array",
               "type": "np.ndarray[tuple[int, int], np.dtype[Any]]"
            }
         },
         "required": [
            "trcoef"
         ],
         "title": "TRANS2D",
         "type": "object"
      },
      "TRANSM": {
         "additionalProperties": false,
         "description": "Constant transmission coefficient.\n\n.. code-block:: text\n\n    TRANSM [trcoef]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANSM\n    transm = TRANSM()\n    print(transm.render())\n    transm = TRANSM(trcoef=0.5)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "transm",
               "description": "Model type discriminator",
               "enum": [
                  "transm",
                  "TRANSM"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Constant transmission coefficient (ratio of transmitted over incoming significant wave height) (SWAN default: 0.0) (no transmission = complete blockage)",
               "title": "Trcoef"
            }
         },
         "title": "TRANSM",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
field freeboard: FREEBOARD | None = None

Freeboard

Validated by:
field line: LINE = None

Line of obstacle

Validated by:
field model_type: Literal['obstacle', 'OBSTACLE'] = 'obstacle'

Model type discriminator

Validated by:
field reflection: REFL | None = None

Wave reflection

Validated by:
field reflection_type: RSPEC | RDIFF | None = None
Validated by:
field transmission: TRANSM | TRANS1D | TRANS2D | GODA | DANGREMOND | None = None
Validated by:
cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator hgt_consistent  »  all fields[source]

Warns if hgt has different values in DAM and FREEBOARD specifications.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.OBSTACLES[source]

List of swan obstacles.

OBSTACLE ... LINE < [xp] [yp] >
OBSTACLE ... LINE < [xp] [yp] >
.

This group component is a convenience to allow defining and rendering a list of obstacle components.

Examples

In [1]: from rompy.swan.components.physics import OBSTACLES, OBSTACLE, OBSTACLE_FIG

In [2]: obst1 = dict(
   ...:     model_type="obstacle",
   ...:     reflection=dict(reflc=1.0),
   ...:     line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
   ...: )
   ...: 

In [3]: obst2 = OBSTACLE(
   ...:     transmission=dict(model_type="transm"),
   ...:     line=dict(xp=[174.3, 174.3], yp=[-39.1, -39.2]),
   ...: )
   ...: 

In [4]: obst3 = OBSTACLE_FIG(
   ...:     alpha1=5e-4,
   ...:     hss=2.5,
   ...:     tss=10.3,
   ...:     line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
   ...: )
   ...: 

In [5]: obstacles = OBSTACLES(obstacles=[obst1, obst2, obst3])

In [6]: for obst in obstacles.render():
   ...:     print(obst)
   ...: 
OBSTACLE REFL reflc=1.0 LINE 174.1 -39.1 174.2 -39.1 174.3 -39.1
OBSTACLE TRANSM LINE 174.3 -39.1 174.3 -39.2
OBSTACLE FIG alpha1=0.0005 hss=2.5 tss=10.3 LINE 174.1 -39.1 174.2 -39.1 174.3 -39.1

Show JSON schema
{
   "title": "OBSTACLES",
   "description": "List of swan obstacles.\n\n.. code-block:: text\n\n    OBSTACLE ... LINE < [xp] [yp] >\n    OBSTACLE ... LINE < [xp] [yp] >\n    .\n\nThis group component is a convenience to allow defining and rendering\na list of obstacle components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLES, OBSTACLE, OBSTACLE_FIG\n    obst1 = dict(\n        model_type=\"obstacle\",\n        reflection=dict(reflc=1.0),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    obst2 = OBSTACLE(\n        transmission=dict(model_type=\"transm\"),\n        line=dict(xp=[174.3, 174.3], yp=[-39.1, -39.2]),\n    )\n    obst3 = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    obstacles = OBSTACLES(obstacles=[obst1, obst2, obst3])\n    for obst in obstacles.render():\n        print(obst)",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "obstacles",
         "description": "Model type discriminator",
         "enum": [
            "obstacles",
            "OBSTACLES"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "obstacles": {
         "description": "List of obstacles",
         "items": {
            "discriminator": {
               "mapping": {
                  "FIG": "#/$defs/OBSTACLE_FIG",
                  "OBSTACLE": "#/$defs/OBSTACLE",
                  "fig": "#/$defs/OBSTACLE_FIG",
                  "obstacle": "#/$defs/OBSTACLE"
               },
               "propertyName": "model_type"
            },
            "oneOf": [
               {
                  "$ref": "#/$defs/OBSTACLE"
               },
               {
                  "$ref": "#/$defs/OBSTACLE_FIG"
               }
            ]
         },
         "title": "Obstacles",
         "type": "array"
      }
   },
   "$defs": {
      "DANGREMOND": {
         "additionalProperties": false,
         "description": "DAM transmission of d'Angremond et al. (1996).\n\n.. code-block:: text\n\n    DAM DANGREMOND [hgt] [slope] [Bk]\n\nThis option specifies transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nd'Angremond, K., Van Der Meer, J.W. and De Jong, R.J., 1996. Wave transmission at\nlow-crested structures. In Coastal Engineering 1996 (pp. 2418-2427).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DANGREMOND\n    transm = DANGREMOND(hgt=3.0, slope=60, Bk=10.0)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "dangremond",
               "description": "Model type discriminator",
               "enum": [
                  "dangremond",
                  "DANGREMOND"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
               "title": "Hgt",
               "type": "number"
            },
            "slope": {
               "description": "The slope of the obstacle (in degrees)",
               "maximum": 90.0,
               "minimum": 0.0,
               "title": "Slope",
               "type": "number"
            },
            "Bk": {
               "description": "The crest width of the obstacle",
               "title": "Bk",
               "type": "number"
            }
         },
         "required": [
            "hgt",
            "slope",
            "Bk"
         ],
         "title": "DANGREMOND",
         "type": "object"
      },
      "FREEBOARD": {
         "additionalProperties": false,
         "description": "Freeboard dependent transmission and reflection.\n\n.. code-block:: text\n\n    FREEBOARD [hgt] [gammat] [gammar] [QUAY]\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nSee the Scientific/Technical documentation for background information on the\n`gammat` and `gammar` shape parameters.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import FREEBOARD\n    freeboard = FREEBOARD(hgt=2.0)\n    print(freeboard.render())\n    freeboard = FREEBOARD(hgt=2.0, gammat=1.0, gammar=1.0, quay=True)\n    print(freeboard.render())",
         "properties": {
            "model_type": {
               "default": "freeboard",
               "description": "Model type discriminator",
               "enum": [
                  "freeboard",
                  "FREEBOARD"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle or height of the quay above the reference level (same reference level as for the bottom). Use a negative value if the top is below that reference level. In case `hgt` is also specified in the DAM option, both values of `hgt` should be equal for consistency",
               "title": "Hgt",
               "type": "number"
            },
            "gammat": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape parameter of relative freeboard dependency of transmission coefficient. This parameter should be higher than zero (SWAN default 1.0)",
               "title": "Gammat"
            },
            "gammar": {
               "anyOf": [
                  {
                     "exclusiveMinimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Shape parameter of relative freeboard dependency of reflection coefficient. This parameter should be higher than zero (SWAN default 1.0)",
               "title": "Gammar"
            },
            "quay": {
               "default": false,
               "description": "With this option the user indicates that the freeboard dependency of the transmission and reflection coefficients also depends on the relative position of an obstacle-linked grid point with respect to the position of the obstacle line representing the edge of a quay. In case the active grid point is on the deeper side of the obstacle, then the correction factors are applied using the parameters `hgt`, `gammat` and `gammar`.In case the active grid point is on the shallower side of the obstacle, the reflection coefficient is set to 0 and the transmission coefficient to 1.",
               "title": "Quay",
               "type": "boolean"
            }
         },
         "required": [
            "hgt"
         ],
         "title": "FREEBOARD",
         "type": "object"
      },
      "GODA": {
         "additionalProperties": false,
         "description": "DAM transmission of Goda/Seelig (1979).\n\n.. code-block:: text\n\n    DAM GODA [hgt] [alpha] [beta]\n\nThis option specified transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nGoda, Y. and Suzuki, Y., 1976. Estimation of incident and reflected waves in random\nwave experiments. In Coastal Engineering 1976 (pp. 828-845).\n\nSeelig, W.N., 1979. Effects of breakwaters on waves: Laboratory test of wave\ntransmission by overtopping. In Proc. Conf. Coastal Structures, 1979\n(Vol. 79, No. 2, pp. 941-961).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import GODA\n    transm = GODA(hgt=3.0)\n    print(transm.render())\n    transm = GODA(hgt=3.0, alpha=2.6, beta=0.15)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "goda",
               "description": "Model type discriminator",
               "enum": [
                  "goda",
                  "GODA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "hgt": {
               "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
               "title": "Hgt",
               "type": "number"
            },
            "alpha": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 2.6)",
               "title": "Alpha"
            },
            "beta": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Another coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 0.15)",
               "title": "Beta"
            }
         },
         "required": [
            "hgt"
         ],
         "title": "GODA",
         "type": "object"
      },
      "LINE": {
         "additionalProperties": false,
         "description": "Line of points to define obstacle location.\n\n.. code-block:: text\n\n    LINE < [xp] [yp] >\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nPoints coordinates should be provided in m If Cartesian coordinates are used or in\ndegrees if spherical coordinates are used (see command `COORD`). At least two\ncorner points must be provided.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import LINE\n    line = LINE(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1])\n    print(line.render())",
         "properties": {
            "model_type": {
               "default": "line",
               "description": "Model type discriminator",
               "enum": [
                  "line",
                  "LINE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "xp": {
               "description": "The x-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "The y-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Yp",
               "type": "array"
            }
         },
         "required": [
            "xp",
            "yp"
         ],
         "title": "LINE",
         "type": "object"
      },
      "OBSTACLE": {
         "additionalProperties": false,
         "description": "Subgrid obstacle.\n\n.. code-block:: text\n\n    OBSTACLE ->TRANSM|TRANS1D|TRANS2D|GODA|DANGREMOND REFL [reflc] ->RSPEC|RDIFF &\n        (FREEBOARD [hgt] [gammat] [gammar] QUAY) LINE < [xp] [yp] >\n\nWith this optional command the user provides the characteristics of a (line\nof) sub-grid obstacle(s) through which waves are transmitted or against which\nwaves are reflected (possibly both at the same time). The obstacle is sub-grid\nin the sense that it is narrow compared to the spatial meshes; its length should\nbe at least one mesh length.\n\nThe location of the obstacle is defined by a sequence of corner points of a line.\nThe obstacles interrupt the propagation of the waves from one grid point to the\nnext wherever this obstacle line is located between two neighbouring grid points\n(of the computational grid; the resolution of the obstacle is therefore equal to\nthe computational grid spacing). This implies that an obstacle to be effective must\nbe located such that it crosses at least one grid line. This is always the case\nwhen an obstacle is larger than one mesh length.\n\nNotes\n-----\n\n* The advise is to define obstacles with the least amount of points possible.\n* SWAN checks if the criterion `reflc^2 + trcoef^2 LE 1` is fulfilled.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLE\n    obs = OBSTACLE(\n        transmission=dict(model_type=\"transm\", trcoef=0.5),\n        reflection=dict(reflc=0.5),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())",
         "properties": {
            "model_type": {
               "default": "obstacle",
               "description": "Model type discriminator",
               "enum": [
                  "obstacle",
                  "OBSTACLE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "transmission": {
               "anyOf": [
                  {
                     "description": "Wave transmission",
                     "discriminator": {
                        "mapping": {
                           "DANGREMOND": "#/$defs/DANGREMOND",
                           "GODA": "#/$defs/GODA",
                           "TRANS1D": "#/$defs/TRANS1D",
                           "TRANS2D": "#/$defs/TRANS2D",
                           "TRANSM": "#/$defs/TRANSM",
                           "dangremond": "#/$defs/DANGREMOND",
                           "goda": "#/$defs/GODA",
                           "trans1d": "#/$defs/TRANS1D",
                           "trans2d": "#/$defs/TRANS2D",
                           "transm": "#/$defs/TRANSM"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/TRANSM"
                        },
                        {
                           "$ref": "#/$defs/TRANS1D"
                        },
                        {
                           "$ref": "#/$defs/TRANS2D"
                        },
                        {
                           "$ref": "#/$defs/GODA"
                        },
                        {
                           "$ref": "#/$defs/DANGREMOND"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Transmission"
            },
            "reflection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/REFL"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Wave reflection"
            },
            "reflection_type": {
               "anyOf": [
                  {
                     "description": "Wave reflection type",
                     "discriminator": {
                        "mapping": {
                           "RDIFF": "#/$defs/RDIFF",
                           "RSPEC": "#/$defs/RSPEC",
                           "rdiff": "#/$defs/RDIFF",
                           "rspec": "#/$defs/RSPEC"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/RSPEC"
                        },
                        {
                           "$ref": "#/$defs/RDIFF"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Reflection Type"
            },
            "freeboard": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/FREEBOARD"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Freeboard"
            },
            "line": {
               "$ref": "#/$defs/LINE",
               "default": null,
               "description": "Line of obstacle"
            }
         },
         "title": "OBSTACLE",
         "type": "object"
      },
      "OBSTACLE_FIG": {
         "additionalProperties": false,
         "description": "Obstacle for free infragravity radiation.\n\n.. code-block:: text\n\n    OBSTACLE FIG [alpha1] [hss] [tss] (REFL [reflc]) LINE <[xp] [yp]>\n\nWith this optional command the user specifies the obstacles along which the\nfree infra-gravity (FIG) energy is radiated. By placing the obstacles close to\nthe shorelines SWAN will include the FIG source term along the coastlines\naccording to the parametrization of Ardhuin et al. (2014).\n\nThe location of the obstacle is defined by a sequence of corner points of a line.\nFor an obstacle line to be effective its length is at least one mesh size large. It\nis recommended to place the obstacles at the inner area of the computational grid,\nnot at or through the boundaries. In particular, each obstacle line must be\nbordered by wet points on both sides.\n\nIn addition, the orientation of the obstacle line determines from which side of the\nobstacle the FIG wave energy is radiated away. If the begin point of the line is\nbelow or left of the end point, that is, pointing upwards/to the right, then FIG\nenergy is radiated from the west/north side of the line. If the begin point is\nabove or right of the end point (pointing downwards/to the left), then FIG energy\nis radiated away from the east/south side of the obstacle line.\n\nReferences\n----------\nArdhuin, F., Rawat, A. and Aucan, J., 2014. A numerical model for free\ninfragravity waves: Definition and validation at regional and global scales.\nOcean Modelling, 77, pp.20-32.\n\nNotes\n-----\nEither `hss` or `tss` or both are allowed to vary over the computational domain.\nIn that case use the commands `INPGRID HSS` and `READINP HSS` and/or the commands\n`INPGRID TSS` and `READINP TSS` to define and read the sea-swell wave height/period\nIt is permissible to have constant sea-swell height and non-constant sea-swell\nperiod, or vice versa. The command `OBST FIG` is still required to define the\nobstacles. The values of `hss` and/or `tss` in this command are then not required\n(they will be ignored).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLE_FIG\n    obs = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())\n    obs = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        reflection=dict(reflc=0.5),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())",
         "properties": {
            "model_type": {
               "default": "fig",
               "description": "Model type discriminator",
               "enum": [
                  "fig",
                  "FIG"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "alpha1": {
               "description": "Calibration parameter (in 1/s) for determining the rate of radiating FIG energy from the shorelines, values in Table 1 of Ardhuin et al. (2014) are between 4e-4 and 8.1e-4",
               "title": "Alpha1",
               "type": "number"
            },
            "hss": {
               "description": "The sea-swell significant wave height (in m)",
               "minimum": 0.0,
               "title": "Hss",
               "type": "number"
            },
            "tss": {
               "description": "The sea-swell mean wave period (in s)",
               "minimum": 0.0,
               "title": "Tss",
               "type": "number"
            },
            "reflection": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/REFL"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Wave reflection"
            },
            "line": {
               "$ref": "#/$defs/LINE",
               "description": "Line of obstacle"
            }
         },
         "required": [
            "alpha1",
            "hss",
            "tss",
            "line"
         ],
         "title": "OBSTACLE_FIG",
         "type": "object"
      },
      "RDIFF": {
         "additionalProperties": false,
         "description": "Diffuse reflection.\n\n.. code-block:: text\n\n    RDIFF [pown]\n\nSpecular reflection where incident waves are scattered over reflected direction.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RDIFF\n    refl = RDIFF()\n    print(refl.render())\n    refl = RDIFF(pown=1.0)\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "rdiff",
               "description": "Model type discriminator",
               "enum": [
                  "rdiff",
                  "RDIFF"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "pown": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Each incoming direction \u03b8 is scattered over reflected direction \u03b8_refl according to cos^pown(\u03b8-\u03b8_refl). The parameter `pown` indicates the widthof the redistribution function (SWAN default: 1.0)",
               "title": "Pown"
            }
         },
         "title": "RDIFF",
         "type": "object"
      },
      "REFL": {
         "additionalProperties": false,
         "description": "Obstacle reflections.\n\n.. code-block:: text\n\n    REFL [reflc]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import REFL\n    refl = REFL()\n    print(refl.render())\n    refl = REFL(reflc=0.5)\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "refl",
               "description": "Model type discriminator",
               "enum": [
                  "refl",
                  "REFL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "reflc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Constant reflection coefficient (ratio of reflected over incoming significant wave height) (SWAN default: 1.0)",
               "title": "Reflc"
            }
         },
         "title": "REFL",
         "type": "object"
      },
      "RSPEC": {
         "additionalProperties": false,
         "description": "Specular reflection.\n\n.. code-block:: text\n\n    RSPEC\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RSPEC\n    refl = RSPEC()\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "rspec",
               "description": "Model type discriminator",
               "enum": [
                  "rspec",
                  "RSPEC"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "RSPEC",
         "type": "object"
      },
      "TRANS1D": {
         "additionalProperties": false,
         "description": "Frequency dependent transmission.\n\n.. code-block:: text\n\n    TRANS1D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS1D\n    transm = TRANS1D(trcoef=[0.0, 0.0, 0.2, 0.5, 0.2, 0.0, 0.0])\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "trans1d",
               "description": "Model type discriminator",
               "enum": [
                  "trans1d",
                  "TRANS1D"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency. The number of these transmission values must be equal to the number of frequencies, i.e. `msc` + 1",
               "items": {
                  "maximum": 1.0,
                  "minimum": 0.0,
                  "type": "number"
               },
               "title": "Trcoef",
               "type": "array"
            }
         },
         "required": [
            "trcoef"
         ],
         "title": "TRANS1D",
         "type": "object"
      },
      "TRANS2D": {
         "additionalProperties": false,
         "description": "Frequency-direction dependent transmission.\n\n.. code-block:: text\n\n    TRANS2D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS2D\n    trcoef = np.array([[0.0, 0.0], [0.1, 0.1], [0.2, 0.2]])\n    transm = TRANS2D(trcoef=trcoef)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "trans2d",
               "description": "Model type discriminator",
               "enum": [
                  "trans2d",
                  "TRANS2D"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency and direction, rows represent directions and columns represent frequencies",
               "properties": {
                  "data_type": {
                     "default": "Any",
                     "title": "dtype",
                     "type": "string"
                  },
                  "data": {
                     "items_schema": {
                        "items_schema": {
                           "type": "any"
                        },
                        "type": "list"
                     },
                     "max_length": 2,
                     "min_length": 2,
                     "type": "list"
                  }
               },
               "required": [
                  "data_type",
                  "data"
               ],
               "title": "Numpy Array",
               "type": "np.ndarray[tuple[int, int], np.dtype[Any]]"
            }
         },
         "required": [
            "trcoef"
         ],
         "title": "TRANS2D",
         "type": "object"
      },
      "TRANSM": {
         "additionalProperties": false,
         "description": "Constant transmission coefficient.\n\n.. code-block:: text\n\n    TRANSM [trcoef]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANSM\n    transm = TRANSM()\n    print(transm.render())\n    transm = TRANSM(trcoef=0.5)\n    print(transm.render())",
         "properties": {
            "model_type": {
               "default": "transm",
               "description": "Model type discriminator",
               "enum": [
                  "transm",
                  "TRANSM"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "trcoef": {
               "anyOf": [
                  {
                     "maximum": 1.0,
                     "minimum": 0.0,
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Constant transmission coefficient (ratio of transmitted over incoming significant wave height) (SWAN default: 0.0) (no transmission = complete blockage)",
               "title": "Trcoef"
            }
         },
         "title": "TRANSM",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "obstacles"
   ]
}

Fields:
field model_type: Literal['obstacles', 'OBSTACLES'] = 'obstacles'

Model type discriminator

field obstacles: list[OBSTACLE | OBSTACLE_FIG] [Required]

List of obstacles

cmd() list[source]

Command file strings for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str[source]

Override base class to allow rendering list of components.

pydantic model rompy.swan.components.physics.OBSTACLE_FIG[source]

Obstacle for free infragravity radiation.

OBSTACLE FIG [alpha1] [hss] [tss] (REFL [reflc]) LINE <[xp] [yp]>

With this optional command the user specifies the obstacles along which the free infra-gravity (FIG) energy is radiated. By placing the obstacles close to the shorelines SWAN will include the FIG source term along the coastlines according to the parametrization of Ardhuin et al. (2014).

The location of the obstacle is defined by a sequence of corner points of a line. For an obstacle line to be effective its length is at least one mesh size large. It is recommended to place the obstacles at the inner area of the computational grid, not at or through the boundaries. In particular, each obstacle line must be bordered by wet points on both sides.

In addition, the orientation of the obstacle line determines from which side of the obstacle the FIG wave energy is radiated away. If the begin point of the line is below or left of the end point, that is, pointing upwards/to the right, then FIG energy is radiated from the west/north side of the line. If the begin point is above or right of the end point (pointing downwards/to the left), then FIG energy is radiated away from the east/south side of the obstacle line.

References

Ardhuin, F., Rawat, A. and Aucan, J., 2014. A numerical model for free infragravity waves: Definition and validation at regional and global scales. Ocean Modelling, 77, pp.20-32.

Notes

Either hss or tss or both are allowed to vary over the computational domain. In that case use the commands INPGRID HSS and READINP HSS and/or the commands INPGRID TSS and READINP TSS to define and read the sea-swell wave height/period It is permissible to have constant sea-swell height and non-constant sea-swell period, or vice versa. The command OBST FIG is still required to define the obstacles. The values of hss and/or tss in this command are then not required (they will be ignored).

Examples

In [1]: from rompy.swan.components.physics import OBSTACLE_FIG

In [2]: obs = OBSTACLE_FIG(
   ...:     alpha1=5e-4,
   ...:     hss=2.5,
   ...:     tss=10.3,
   ...:     line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
   ...: )
   ...: 

In [3]: print(obs.render())
OBSTACLE FIG alpha1=0.0005 hss=2.5 tss=10.3 LINE 174.1 -39.1 174.2 -39.1 174.3 -39.1

In [4]: obs = OBSTACLE_FIG(
   ...:     alpha1=5e-4,
   ...:     hss=2.5,
   ...:     tss=10.3,
   ...:     reflection=dict(reflc=0.5),
   ...:     line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),
   ...: )
   ...: 

In [5]: print(obs.render())
OBSTACLE FIG alpha1=0.0005 hss=2.5 tss=10.3 REFL reflc=0.5 LINE 174.1 -39.1 174.2 -39.1 174.3 -39.1

Show JSON schema
{
   "title": "OBSTACLE_FIG",
   "description": "Obstacle for free infragravity radiation.\n\n.. code-block:: text\n\n    OBSTACLE FIG [alpha1] [hss] [tss] (REFL [reflc]) LINE <[xp] [yp]>\n\nWith this optional command the user specifies the obstacles along which the\nfree infra-gravity (FIG) energy is radiated. By placing the obstacles close to\nthe shorelines SWAN will include the FIG source term along the coastlines\naccording to the parametrization of Ardhuin et al. (2014).\n\nThe location of the obstacle is defined by a sequence of corner points of a line.\nFor an obstacle line to be effective its length is at least one mesh size large. It\nis recommended to place the obstacles at the inner area of the computational grid,\nnot at or through the boundaries. In particular, each obstacle line must be\nbordered by wet points on both sides.\n\nIn addition, the orientation of the obstacle line determines from which side of the\nobstacle the FIG wave energy is radiated away. If the begin point of the line is\nbelow or left of the end point, that is, pointing upwards/to the right, then FIG\nenergy is radiated from the west/north side of the line. If the begin point is\nabove or right of the end point (pointing downwards/to the left), then FIG energy\nis radiated away from the east/south side of the obstacle line.\n\nReferences\n----------\nArdhuin, F., Rawat, A. and Aucan, J., 2014. A numerical model for free\ninfragravity waves: Definition and validation at regional and global scales.\nOcean Modelling, 77, pp.20-32.\n\nNotes\n-----\nEither `hss` or `tss` or both are allowed to vary over the computational domain.\nIn that case use the commands `INPGRID HSS` and `READINP HSS` and/or the commands\n`INPGRID TSS` and `READINP TSS` to define and read the sea-swell wave height/period\nIt is permissible to have constant sea-swell height and non-constant sea-swell\nperiod, or vice versa. The command `OBST FIG` is still required to define the\nobstacles. The values of `hss` and/or `tss` in this command are then not required\n(they will be ignored).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OBSTACLE_FIG\n    obs = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())\n    obs = OBSTACLE_FIG(\n        alpha1=5e-4,\n        hss=2.5,\n        tss=10.3,\n        reflection=dict(reflc=0.5),\n        line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]),\n    )\n    print(obs.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "fig",
         "description": "Model type discriminator",
         "enum": [
            "fig",
            "FIG"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "alpha1": {
         "description": "Calibration parameter (in 1/s) for determining the rate of radiating FIG energy from the shorelines, values in Table 1 of Ardhuin et al. (2014) are between 4e-4 and 8.1e-4",
         "title": "Alpha1",
         "type": "number"
      },
      "hss": {
         "description": "The sea-swell significant wave height (in m)",
         "minimum": 0.0,
         "title": "Hss",
         "type": "number"
      },
      "tss": {
         "description": "The sea-swell mean wave period (in s)",
         "minimum": 0.0,
         "title": "Tss",
         "type": "number"
      },
      "reflection": {
         "anyOf": [
            {
               "$ref": "#/$defs/REFL"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Wave reflection"
      },
      "line": {
         "$ref": "#/$defs/LINE",
         "description": "Line of obstacle"
      }
   },
   "$defs": {
      "LINE": {
         "additionalProperties": false,
         "description": "Line of points to define obstacle location.\n\n.. code-block:: text\n\n    LINE < [xp] [yp] >\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nPoints coordinates should be provided in m If Cartesian coordinates are used or in\ndegrees if spherical coordinates are used (see command `COORD`). At least two\ncorner points must be provided.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import LINE\n    line = LINE(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1])\n    print(line.render())",
         "properties": {
            "model_type": {
               "default": "line",
               "description": "Model type discriminator",
               "enum": [
                  "line",
                  "LINE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "xp": {
               "description": "The x-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "The y-coordinates of the points defining the line",
               "items": {
                  "type": "number"
               },
               "minItems": 2,
               "title": "Yp",
               "type": "array"
            }
         },
         "required": [
            "xp",
            "yp"
         ],
         "title": "LINE",
         "type": "object"
      },
      "REFL": {
         "additionalProperties": false,
         "description": "Obstacle reflections.\n\n.. code-block:: text\n\n    REFL [reflc]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import REFL\n    refl = REFL()\n    print(refl.render())\n    refl = REFL(reflc=0.5)\n    print(refl.render())",
         "properties": {
            "model_type": {
               "default": "refl",
               "description": "Model type discriminator",
               "enum": [
                  "refl",
                  "REFL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "reflc": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Constant reflection coefficient (ratio of reflected over incoming significant wave height) (SWAN default: 1.0)",
               "title": "Reflc"
            }
         },
         "title": "REFL",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "alpha1",
      "hss",
      "tss",
      "line"
   ]
}

Fields:
field alpha1: float [Required]

Calibration parameter (in 1/s) for determining the rate of radiating FIG energy from the shorelines, values in Table 1 of Ardhuin et al. (2014) are between 4e-4 and 8.1e-4

field hss: float [Required]

The sea-swell significant wave height (in m)

Constraints:
  • ge = 0.0

field line: LINE [Required]

Line of obstacle

field model_type: Literal['fig', 'FIG'] = 'fig'

Model type discriminator

field reflection: REFL | None = None

Wave reflection

field tss: float [Required]

The sea-swell mean wave period (in s)

Constraints:
  • ge = 0.0

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.OFF[source]

Deactivate physics commands.

OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK

This command deactivates physics commands. The command can be used to switch off the computation of a certain physics component without having to remove the command from the input file. This is useful for testing purposes.

Examples:#

In [1]: from rompy.swan.components.physics import OFF

In [2]: off = OFF(physics="windgrowth")

In [3]: print(off.render())
OFF WINDGROWTH

Show JSON schema
{
   "title": "OFF",
   "description": "Deactivate physics commands.\n\n.. code-block:: text\n\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n\nThis command deactivates physics commands. The command can be used to switch off\nthe computation of a certain physics component without having to remove the command\nfrom the input file. This is useful for testing purposes.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import OFF\n    off = OFF(physics=\"windgrowth\")\n    print(off.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "off",
         "description": "Model type discriminator",
         "enum": [
            "off",
            "OFF"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "physics": {
         "$ref": "#/$defs/PhysicsOff",
         "description": "Physics command to be switched off"
      }
   },
   "$defs": {
      "PhysicsOff": {
         "description": "Physics commands to be switched off.\n\nAttributes\n----------\nWINDGROWTH : str = \"windgrowth\"\n    Switches off wind growth (in commands GEN1, GEN2, GEN3).\nQUADRUPL : str = \"quadrupl\"\n    Switches off quadruplet wave interactions (in command GEN3).\nWCAPPING : str = \"wcapping\"\n    Switches off whitecapping (in command GEN3).\nBREAKING : str = \"breaking\"\n    Switches off wave breaking dissipation.\nREFRAC : str = \"refrac\"\n    Switches off wave refraction (action transport in theta space).\nFSHIFT : str = \"fshift\"\n    Switches off frequency shifting (action transport in sigma space).\nBNDCHK : str = \"bndchk\"\n    Switches off the checking of the delta imposed and computed Hs at the boundary.",
         "enum": [
            "windgrowth",
            "quadrupl",
            "wcapping",
            "breaking",
            "refrac",
            "fshift",
            "bndchk"
         ],
         "title": "PhysicsOff",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "physics"
   ]
}

Fields:
field model_type: Literal['off', 'OFF'] = 'off'

Model type discriminator

field physics: PhysicsOff [Required]

Physics command to be switched off

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.OFFS[source]

Deactivate multiple physics commands.

OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK
OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK
.

This group component is a convenience to allow defining and rendering a list of OFF components.

Examples

In [1]: from rompy.swan.components.physics import OFFS

In [2]: off1 = dict(physics="windgrowth")

In [3]: off2 = dict(physics="wcapping")

In [4]: offs = OFFS(offs=[off1, off2])

In [5]: for off in offs.render():
   ...:     print(off)
   ...: 
O
F
F
 
W
I
N
D
G
R
O
W
T
H


O
F
F
 
W
C
A
P
P
I
N
G

Show JSON schema
{
   "title": "OFFS",
   "description": "Deactivate multiple physics commands.\n\n.. code-block:: text\n\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n    .\n\nThis group component is a convenience to allow defining and rendering\na list of `OFF` components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import OFFS\n    off1 = dict(physics=\"windgrowth\")\n    off2 = dict(physics=\"wcapping\")\n    offs = OFFS(offs=[off1, off2])\n    for off in offs.render():\n        print(off)",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "offs",
         "description": "Model type discriminator",
         "enum": [
            "offs",
            "OFFS"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "offs": {
         "description": "Physics commands to deactivate",
         "items": {
            "$ref": "#/$defs/OFF"
         },
         "title": "Offs",
         "type": "array"
      }
   },
   "$defs": {
      "OFF": {
         "additionalProperties": false,
         "description": "Deactivate physics commands.\n\n.. code-block:: text\n\n    OFF WINDGROWTH|QUADRUPL|WCAPPING|BREAKING|REFRAC|FSHIFT|BNDCHK\n\nThis command deactivates physics commands. The command can be used to switch off\nthe computation of a certain physics component without having to remove the command\nfrom the input file. This is useful for testing purposes.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import OFF\n    off = OFF(physics=\"windgrowth\")\n    print(off.render())",
         "properties": {
            "model_type": {
               "default": "off",
               "description": "Model type discriminator",
               "enum": [
                  "off",
                  "OFF"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "physics": {
               "$ref": "#/$defs/PhysicsOff",
               "description": "Physics command to be switched off"
            }
         },
         "required": [
            "physics"
         ],
         "title": "OFF",
         "type": "object"
      },
      "PhysicsOff": {
         "description": "Physics commands to be switched off.\n\nAttributes\n----------\nWINDGROWTH : str = \"windgrowth\"\n    Switches off wind growth (in commands GEN1, GEN2, GEN3).\nQUADRUPL : str = \"quadrupl\"\n    Switches off quadruplet wave interactions (in command GEN3).\nWCAPPING : str = \"wcapping\"\n    Switches off whitecapping (in command GEN3).\nBREAKING : str = \"breaking\"\n    Switches off wave breaking dissipation.\nREFRAC : str = \"refrac\"\n    Switches off wave refraction (action transport in theta space).\nFSHIFT : str = \"fshift\"\n    Switches off frequency shifting (action transport in sigma space).\nBNDCHK : str = \"bndchk\"\n    Switches off the checking of the delta imposed and computed Hs at the boundary.",
         "enum": [
            "windgrowth",
            "quadrupl",
            "wcapping",
            "breaking",
            "refrac",
            "fshift",
            "bndchk"
         ],
         "title": "PhysicsOff",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "offs"
   ]
}

Fields:
field model_type: Literal['offs', 'OFFS'] = 'offs'

Model type discriminator

field offs: list[OFF] [Required]

Physics commands to deactivate

cmd() list[source]

Command file strings for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.QUADRUPL[source]

Nonlinear quadruplet wave interactions.

QUADRUPL [iquad] [lambda] [cnl4] [Csh1] [Csh2] [Csh3]

With this option the user can influence the computation of nonlinear quadruplet wave interactions which are usually included in the computations. Can be de-activated with command OFF QUAD. Note that the DIA approximation of the quadruplet interactions is a poor approximation for long-crested waves and frequency resolutions that are deviating much more than 10% (see command CGRID). Note that DIA is usually updated per sweep, either semi-implicit (iquad = 1) or explicit (iquad = 2). However, when ambient current is included, the bounds of the directional sector within a sweep may be different for each frequency bin (particularly the higher frequencies are modified by the current). So there may be some overlap of frequency bins between the sweeps, implying non-conservation of wave energy. To prevent this the user is advised to choose the integration of DIA per iteration instead of per sweep, i.e. iquad = 3. If you want to speed up your computation a bit more, than the choice iquad = 8 is a good choice.

Examples

In [1]: from rompy.swan.components.physics import QUADRUPL

In [2]: quadrupl = QUADRUPL()

In [3]: print(quadrupl.render())
QUADRUPL

In [4]: kwargs = dict(
   ...:     iquad=3, lambd=0.25, cnl4=3.0e7, csh1=5.5, csh2=0.833333, csh3=-1.25
   ...: )
   ...: 

In [5]: quadrupl = QUADRUPL(**kwargs)

In [6]: print(quadrupl.render())
QUADRUPL iquad=3 lambda=0.25 cnl4=30000000.0 csh1=5.5 csh2=0.833333 csh3=-1.25

Show JSON schema
{
   "title": "QUADRUPL",
   "description": "Nonlinear quadruplet wave interactions.\n\n.. code-block:: text\n\n    QUADRUPL [iquad] [lambda] [cnl4] [Csh1] [Csh2] [Csh3]\n\nWith this option the user can influence the computation of nonlinear quadruplet\nwave interactions which are usually included in the computations. Can be\nde-activated with command OFF QUAD. Note that the DIA approximation of the\nquadruplet interactions is a poor approximation for long-crested waves and\nfrequency resolutions that are deviating much more than 10% (see command CGRID).\nNote that DIA is usually updated per sweep, either semi-implicit (`iquad = 1`) or\nexplicit (`iquad = 2`). However, when ambient current is included, the bounds of\nthe directional sector within a sweep may be different for each frequency bin\n(particularly the higher frequencies are modified by the current). So there may be\nsome overlap of frequency bins between the sweeps, implying non-conservation of\nwave energy. To prevent this the user is advised to choose the integration of DIA\nper iteration instead of per sweep, i.e. `iquad = 3`. If you want to speed up your\ncomputation a bit more, than the choice `iquad = 8` is a good choice.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import QUADRUPL\n    quadrupl = QUADRUPL()\n    print(quadrupl.render())\n    kwargs = dict(\n        iquad=3, lambd=0.25, cnl4=3.0e7, csh1=5.5, csh2=0.833333, csh3=-1.25\n    )\n    quadrupl = QUADRUPL(**kwargs)\n    print(quadrupl.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "quadrupl",
         "description": "Model type discriminator",
         "enum": [
            "quadrupl",
            "QUADRUPL"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "iquad": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3,
                  8,
                  4,
                  51,
                  52,
                  53
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Numerical procedures for integrating the quadruplets: 1 = semi-implicit per sweep, 2 = explicit per sweep, 3 = explicit per iteration, 8 = explicit per iteration, but with a more efficient implementation, 4 = multiple DIA, 51 = XNL (deep water transfer), 52 = XNL (deep water transfer with WAM depth scaling), 53  XNL (finite depth transfer) (SWAN default: 2)",
         "title": "Iquad"
      },
      "lambd": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient for quadruplet configuration in case of DIA (SWAN default: 0.25)",
         "title": "Lambd"
      },
      "cnl4": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient for quadruplet interactions in case of DIA (SWAN default: 3.0e7",
         "title": "Cnl4"
      },
      "csh1": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient for shallow water scaling in case of DIA (SWAN default: 5.5)",
         "title": "Csh1"
      },
      "csh2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient for shallow water scaling in case of DIA (SWAN default: 0.833333)",
         "title": "Csh2"
      },
      "csh3": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient for shallow water scaling in case of DIA (SWAN default: -1.25)",
         "title": "Csh3"
      }
   },
   "additionalProperties": false
}

Fields:
field cnl4: float | None = None

Proportionality coefficient for quadruplet interactions in case of DIA (SWAN default: 3.0e7

field csh1: float | None = None

Coefficient for shallow water scaling in case of DIA (SWAN default: 5.5)

field csh2: float | None = None

Coefficient for shallow water scaling in case of DIA (SWAN default: 0.833333)

field csh3: float | None = None

Coefficient for shallow water scaling in case of DIA (SWAN default: -1.25)

field iquad: Literal[1, 2, 3, 8, 4, 51, 52, 53] | None = None

Numerical procedures for integrating the quadruplets: 1 = semi-implicit per sweep, 2 = explicit per sweep, 3 = explicit per iteration, 8 = explicit per iteration, but with a more efficient implementation, 4 = multiple DIA, 51 = XNL (deep water transfer), 52 = XNL (deep water transfer with WAM depth scaling), 53 XNL (finite depth transfer) (SWAN default: 2)

field lambd: float | None = None

Coefficient for quadruplet configuration in case of DIA (SWAN default: 0.25)

field model_type: Literal['quadrupl', 'QUADRUPL'] = 'quadrupl'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SCAT[source]

Scattering.

SCAT [iqcm] (GRID [rfac]) (TRUNC [alpha] [qmax])

Using this optional command, the user activates a source term that allows for the generation and propagation of cross correlations between scattered waves due to variations in the bathymetry and mean currents. Such variations are rapid compared to the distancebetween the crossing waves (at the scale of 100-1000 m) and is particularly relevant for cases involving narrowband waves (swells) in coastal regions with shallow water and ambient currents. In turn, the immediate spatial effects of coherent scattering, interference, refraction and diffraction can cause large-scale changes in the wave parameters.

References

Smit, P.B. and Janssen, T.T., 2013. The evolution of inhomogeneous wave statistics through a variable medium. Journal of Physical Oceanography, 43(8), pp.1741-1758.

Smit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of inhomogeneous ocean waves. Ocean Modelling, 96, pp.26-35.

Smit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of coherent wave fields over variable depth. Journal of Physical Oceanography, 45(4), pp.1139-1154.

Akrish, G., Smit, P., Zijlema, M. and Reniers, A., 2020. Modelling statistical wave interferences over shear currents. Journal of Fluid Mechanics, 891, p.A2.

Notes

Implemented in SWAN 41.41.

If both alpha and qmax options are provided to truncate the infinite convolution sum their mimimum is considered as the final limit on the sum.

Examples:#

In [1]: from rompy.swan.components.physics import SCAT

In [2]: scat = SCAT()

In [3]: print(scat.render())
SCAT

In [4]: scat = SCAT(iqcm=2, rfac=1.0, alpha=1.0)

In [5]: print(scat.render())
SCAT iqcm=2 GRID rfac=1.0 TRUNC alpha=1.0

Show JSON schema
{
   "title": "SCAT",
   "description": "Scattering.\n\n.. code-block:: text\n\n    SCAT [iqcm] (GRID [rfac]) (TRUNC [alpha] [qmax])\n\nUsing this optional command, the user activates a source term that allows for the\ngeneration and propagation of cross correlations between scattered waves due to\nvariations in the bathymetry and mean currents. Such variations are rapid compared\nto the distancebetween the crossing waves (at the scale of 100-1000 m) and is\nparticularly relevant for cases involving narrowband waves (swells) in coastal\nregions with shallow water and ambient currents. In turn, the immediate spatial\neffects of coherent scattering, interference, refraction and diffraction can cause\nlarge-scale changes in the wave parameters.\n\nReferences\n----------\nSmit, P.B. and Janssen, T.T., 2013. The evolution of inhomogeneous wave statistics\nthrough a variable medium. Journal of Physical Oceanography, 43(8), pp.1741-1758.\n\nSmit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of\ninhomogeneous ocean waves. Ocean Modelling, 96, pp.26-35.\n\nSmit, P.B., Janssen, T.T. and Herbers, T.H.C., 2015. Stochastic modeling of\ncoherent wave fields over variable depth. Journal of Physical Oceanography, 45(4),\npp.1139-1154.\n\nAkrish, G., Smit, P., Zijlema, M. and Reniers, A., 2020. Modelling statistical wave\ninterferences over shear currents. Journal of Fluid Mechanics, 891, p.A2.\n\nNotes\n-----\nImplemented in SWAN 41.41.\n\nIf both `alpha` and `qmax` options are provided to truncate the infinite\nconvolution sum their mimimum is considered as the final limit on the sum.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import SCAT\n    scat = SCAT()\n    print(scat.render())\n    scat = SCAT(iqcm=2, rfac=1.0, alpha=1.0)\n    print(scat.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "scat",
         "description": "Model type discriminator",
         "enum": [
            "scat",
            "SCAT"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "iqcm": {
         "anyOf": [
            {
               "enum": [
                  0,
                  1,
                  2
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Indicates the modelling and computation of QC scattering:\n\n* 0: no scattering\n* 1: scattering due to non-uniform bathymetry and currents (the latter only if applicable; see command `INPGRID CURRENT`)\n* 2: wave-current interaction under the assumption of a slowly varying bathymetry\n\n(SWAN default: 1)",
         "title": "Iqcm"
      },
      "rfac": {
         "anyOf": [
            {
               "minimum": 1.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The resolution factor through which the incident spectral width ismultiplied (SWAN default: 1.0)",
         "title": "Rfac"
      },
      "alpha": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The coefficient by which the mean wave number is multiplied to set thelimit on the convolution sum (SWAN default: 1.0)",
         "title": "Alpha"
      },
      "qmax": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The maximum scattering wave number (in 1/m)",
         "title": "Qmax"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
field alpha: float | None = None

The coefficient by which the mean wave number is multiplied to set thelimit on the convolution sum (SWAN default: 1.0)

Validated by:
field iqcm: Literal[0, 1, 2] | None = None

Indicates the modelling and computation of QC scattering:

  • 0: no scattering

  • 1: scattering due to non-uniform bathymetry and currents (the latter only if applicable; see command INPGRID CURRENT)

  • 2: wave-current interaction under the assumption of a slowly varying bathymetry

(SWAN default: 1)

Validated by:
field model_type: Literal['scat', 'SCAT'] = 'scat'

Model type discriminator

Validated by:
field qmax: float | None = None

The maximum scattering wave number (in 1/m)

Validated by:
field rfac: float | None = None

The resolution factor through which the incident spectral width ismultiplied (SWAN default: 1.0)

Constraints:
  • ge = 1.0

Validated by:
cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

validator warn_if_qmax_and_alpha  »  all fields[source]
pydantic model rompy.swan.components.physics.SETUP[source]

Wave setup.

SETUP [supcor]

If this command is given, the wave-induced set-up is computed and accounted for in the wave computations (during the computation it is added to the depth that is obtained from the READ BOTTOM and READ WLEVEL commands). This approximation in SWAN can only be applied to open coast (unlimited supply of water from outside the domain, e.g. nearshore coasts) in contrast to closed basin, e.g. lakes and estuaries, where this option should not be used. Note that set-up is not computed correctly with spherical coordinates.

Notes

  • The SETUP command cannot be used in case of unstructured grids.

  • Set-up is not supported in case of parallel runs using either MPI or OpenMP.

Examples

In [1]: from rompy.swan.components.physics import SETUP

In [2]: setup = SETUP()

In [3]: print(setup.render())
SETUP

In [4]: setup = SETUP(supcor=0.5)

In [5]: print(setup.render())
SETUP supcor=0.5

Show JSON schema
{
   "title": "SETUP",
   "description": "Wave setup.\n\n.. code-block:: text\n\n    SETUP [supcor]\n\nIf this command is given, the wave-induced set-up is computed and accounted for in\nthe wave computations (during the computation it is added to the depth that is\nobtained from the `READ BOTTOM` and `READ WLEVEL` commands). This approximation in\nSWAN can only be applied to open coast (unlimited supply of water from outside the\ndomain, e.g. nearshore coasts) in contrast to closed basin, e.g. lakes and\nestuaries, where this option should not be used. Note that set-up is not computed\ncorrectly with spherical coordinates.\n\nNotes\n-----\n\n* The SETUP command cannot be used in case of unstructured grids.\n* Set-up is not supported in case of parallel runs using either MPI or OpenMP.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SETUP\n    setup = SETUP()\n    print(setup.render())\n    setup = SETUP(supcor=0.5)\n    print(setup.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "setup",
         "description": "Model type discriminator",
         "enum": [
            "setup",
            "SETUP"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "supcor": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "By default the wave-induced set-up is computed with a constant added such that the set-up is zero in the deepest point in the computational grid. The user can modify this constant by the value of `supcor`. The user can thus impose a set-up in any one point (and only one) in the computational grid by first running SWAN, then reading the set-up in that point and adding or subtracting the required value of `supcor` (in m; positive if the set-up has to rise) (SWAN default: 0.0)",
         "title": "Supcor"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['setup', 'SETUP'] = 'setup'

Model type discriminator

field supcor: float | None = None

By default the wave-induced set-up is computed with a constant added such that the set-up is zero in the deepest point in the computational grid. The user can modify this constant by the value of supcor. The user can thus impose a set-up in any one point (and only one) in the computational grid by first running SWAN, then reading the set-up in that point and adding or subtracting the required value of supcor (in m; positive if the set-up has to rise) (SWAN default: 0.0)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SICE[source]

Sea ice dissipation.

SICE [aice]

Using this command, the user activates a sink term to represent the dissipation of wave energy by sea ice. The default method is R19 empirical/parametric: a polynomial based on wave frequency (Rogers, 2019). This polynomial (in 1/m) has seven dimensional coefficients; see Scientific/Technical documentation for details. If this command is not used, SWAN will not account for sea ice effects.

References

Doble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015. Relating wave attenuation to pancake ice thickness, using field measurements and model results. Geophysical Research Letters, 42(11), pp.4473-4481.

Meylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and analysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research Letters, 41(14), pp.5046-5051.

Rogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of dissipation of energy of ocean waves by sea ice using data from Wave Array 3 of the ONR “Sea State” field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.

Rogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave attenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science and Technology, 182, p.103198.

Notes

Iis also necessary to describe the ice, using the ICE command (for uniform and stationary ice) or INPGRID/READINP commands (for variable ice).

Examples

In [1]: from rompy.swan.components.physics import SICE

In [2]: sice = SICE()

In [3]: print(sice.render())
SICE

In [4]: sice = SICE(aice=0.5)

In [5]: print(sice.render())
SICE aice=0.5

TODO: Verify if the aice parameter should be used with SICE command, it is not shown in the command tree but it is described as an option in the description.

Show JSON schema
{
   "title": "SICE",
   "description": "Sea ice dissipation.\n\n.. code-block:: text\n\n    SICE [aice]\n\nUsing this command, the user activates a sink term to represent the dissipation of\nwave energy by sea ice. The default method is R19 empirical/parametric: a\npolynomial based on wave frequency (Rogers, 2019). This polynomial (in 1/m) has\nseven dimensional coefficients; see Scientific/Technical documentation for details.\nIf this command is not used, SWAN will not account for sea ice effects.\n\nReferences\n----------\nDoble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015.\nRelating wave attenuation to pancake ice thickness, using field measurements and\nmodel results. Geophysical Research Letters, 42(11), pp.4473-4481.\n\nMeylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and\nanalysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research\nLetters, 41(14), pp.5046-5051.\n\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of\ndissipation of energy of ocean waves by sea ice using data from Wave Array 3 of\nthe ONR \u201cSea State\u201d field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.\n\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave\nattenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science\nand Technology, 182, p.103198.\n\nNotes\n-----\nIis also necessary to describe the ice, using the `ICE` command (for uniform and\nstationary ice) or `INPGRID`/`READINP` commands (for variable ice).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE\n    sice = SICE()\n    print(sice.render())\n    sice = SICE(aice=0.5)\n    print(sice.render())\n\nTODO: Verify if the `aice` parameter should be used with SICE command, it is not\nshown in the command tree but it is described as an option in the description.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "sice",
         "description": "Model type discriminator",
         "enum": [
            "sice",
            "SICE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "aice": {
         "anyOf": [
            {
               "maximum": 1.0,
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
         "title": "Aice"
      }
   },
   "additionalProperties": false
}

Fields:
field aice: float | None = None

Ice concentration as a fraction from 0 to 1. Note that aice is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands INPGRID AICE and READINP AICE to define and read the sea concentration. The value of aice in this command is then not required (it will be ignored)

Constraints:
  • ge = 0.0

  • le = 1.0

field model_type: Literal['sice', 'SICE'] = 'sice'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SICE_D15[source]

Sea ice dissipation based on the method of Doble et al. (2015).

SICE [aice] D15 [chf]

References

Doble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015. Relating wave attenuation to pancake ice thickness, using field measurements and model results. Geophysical Research Letters, 42(11), pp.4473-4481.

Examples

In [1]: from rompy.swan.components.physics import SICE_D15

In [2]: sice = SICE_D15()

In [3]: print(sice.render())
SICE D15

In [4]: sice = SICE_D15(aice=0.2, chf=0.1)

In [5]: print(sice.render())
SICE aice=0.2 D15 chf=0.1

Show JSON schema
{
   "title": "SICE_D15",
   "description": "Sea ice dissipation based on the method of Doble et al. (2015).\n\n.. code-block:: text\n\n    SICE [aice] D15 [chf]\n\nReferences\n----------\nDoble, M.J., De Carolis, G., Meylan, M.H., Bidlot, J.R. and Wadhams, P., 2015.\nRelating wave attenuation to pancake ice thickness, using field measurements and\nmodel results. Geophysical Research Letters, 42(11), pp.4473-4481.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_D15\n    sice = SICE_D15()\n    print(sice.render())\n    sice = SICE_D15(aice=0.2, chf=0.1)\n    print(sice.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "d15",
         "description": "Model type discriminator",
         "enum": [
            "d15",
            "D15"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "aice": {
         "anyOf": [
            {
               "maximum": 1.0,
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
         "title": "Aice"
      },
      "chf": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A simple coefficient of proportionality (SWAN default: 0.1)",
         "title": "Chf"
      }
   },
   "additionalProperties": false
}

Fields:
field aice: float | None = None

Ice concentration as a fraction from 0 to 1. Note that aice is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands INPGRID AICE and READINP AICE to define and read the sea concentration. The value of aice in this command is then not required (it will be ignored)

Constraints:
  • ge = 0.0

  • le = 1.0

field chf: float | None = None

A simple coefficient of proportionality (SWAN default: 0.1)

field model_type: Literal['d15', 'D15'] = 'd15'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SICE_M18[source]

Sea ice dissipation based on the method of Meylan et al. (2018).

SICE [aice] M18 [chf]

References

Meylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and analysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research Letters, 41(14), pp.5046-5051.

Examples

In [1]: from rompy.swan.components.physics import SICE_M18

In [2]: sice = SICE_M18()

In [3]: print(sice.render())
SICE M18

In [4]: sice = SICE_M18(aice=0.8, chf=0.059)

In [5]: print(sice.render())
SICE aice=0.8 M18 chf=0.059

Show JSON schema
{
   "title": "SICE_M18",
   "description": "Sea ice dissipation based on the method of Meylan et al. (2018).\n\n.. code-block:: text\n\n    SICE [aice] M18 [chf]\n\nReferences\n----------\nMeylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and\nanalysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research\nLetters, 41(14), pp.5046-5051.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_M18\n    sice = SICE_M18()\n    print(sice.render())\n    sice = SICE_M18(aice=0.8, chf=0.059)\n    print(sice.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "m18",
         "description": "Model type discriminator",
         "enum": [
            "m18",
            "M18"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "aice": {
         "anyOf": [
            {
               "maximum": 1.0,
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
         "title": "Aice"
      },
      "chf": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A simple coefficient of proportionality (SWAN default: 0.059)",
         "title": "Chf"
      }
   },
   "additionalProperties": false
}

Fields:
field aice: float | None = None

Ice concentration as a fraction from 0 to 1. Note that aice is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands INPGRID AICE and READINP AICE to define and read the sea concentration. The value of aice in this command is then not required (it will be ignored)

Constraints:
  • ge = 0.0

  • le = 1.0

field chf: float | None = None

A simple coefficient of proportionality (SWAN default: 0.059)

field model_type: Literal['m18', 'M18'] = 'm18'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SICE_R19[source]

Sea ice dissipation based on the method of Rogers et al (2019).

SICE [aice] R19 [c0] [c1] [c2] [c3] [c4] [c5] [c6]

The default options recover the polynomial of Meylan et al. (2014), calibrated for a case of ice floes, mostly 10 to 25 m in diameter, in the marginal ice zone near Antarctica. Examples for other calibrations can be found in the Scientific/Technical documentation.

References

Meylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and analysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research Letters, 41(14), pp.5046-5051.

Rogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of dissipation of energy of ocean waves by sea ice using data from Wave Array 3 of the ONR “Sea State” field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.

Examples

In [1]: from rompy.swan.components.physics import SICE_R19

In [2]: sice = SICE_R19()

In [3]: print(sice.render())
SICE R19

In [4]: kwargs = dict(
   ...:     aice=0.5,
   ...:     c0=0.0,
   ...:     c1=0.0,
   ...:     c2=1.06e-3,
   ...:     c3=0.0,
   ...:     c4=0.0,
   ...:     c5=0.0,
   ...:     c6=0.0,
   ...: )
   ...: 

In [5]: sice = SICE_R19(**kwargs)

In [6]: print(sice.render())
SICE aice=0.5 R19 c0=0.0 c1=0.0 c2=0.00106 c3=0.0 c4=0.0 c5=0.0 c6=0.0

Show JSON schema
{
   "title": "SICE_R19",
   "description": "Sea ice dissipation based on the method of Rogers et al (2019).\n\n.. code-block:: text\n\n    SICE [aice] R19 [c0] [c1] [c2] [c3] [c4] [c5] [c6]\n\nThe default options recover the polynomial of Meylan et al. (2014), calibrated for\na case of ice floes, mostly 10 to 25 m in diameter, in the marginal ice zone near\nAntarctica. Examples for other calibrations can be found in the\nScientific/Technical documentation.\n\nReferences\n----------\nMeylan, M.H., Bennetts, L.G. and Kohout, A.L., 2014. In situ measurements and\nanalysis of ocean waves in the Antarctic marginal ice zone. Geophysical Research\nLetters, 41(14), pp.5046-5051.\n\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2018. Frequency distribution of\ndissipation of energy of ocean waves by sea ice using data from Wave Array 3 of\nthe ONR \u201cSea State\u201d field experiment. Nav. Res. Lab. Memo. Rep, pp.18-9801.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_R19\n    sice = SICE_R19()\n    print(sice.render())\n    kwargs = dict(\n        aice=0.5,\n        c0=0.0,\n        c1=0.0,\n        c2=1.06e-3,\n        c3=0.0,\n        c4=0.0,\n        c5=0.0,\n        c6=0.0,\n    )\n    sice = SICE_R19(**kwargs)\n    print(sice.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "r19",
         "description": "Model type discriminator",
         "enum": [
            "r19",
            "R19"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "aice": {
         "anyOf": [
            {
               "maximum": 1.0,
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
         "title": "Aice"
      },
      "c0": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Polynomial coefficient (in 1/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
         "title": "C0"
      },
      "c1": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Polynomial coefficient (in s/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
         "title": "C1"
      },
      "c2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Polynomial coefficient (in s2/m) for determining the rate of sea ice dissipation (SWAN default: 1.06E-3)",
         "title": "C2"
      },
      "c3": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Polynomial coefficient (in s3/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
         "title": "C3"
      },
      "c4": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Polynomial coefficient (in s4/m) for determining the rate of sea ice dissipation (SWAN default: 2.3E-2)",
         "title": "C4"
      },
      "c5": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Polynomial coefficient (in s5/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
         "title": "C5"
      },
      "c6": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Polynomial coefficient (in s6/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)",
         "title": "C6"
      }
   },
   "additionalProperties": false
}

Fields:
field aice: float | None = None

Ice concentration as a fraction from 0 to 1. Note that aice is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands INPGRID AICE and READINP AICE to define and read the sea concentration. The value of aice in this command is then not required (it will be ignored)

Constraints:
  • ge = 0.0

  • le = 1.0

field c0: float | None = None

Polynomial coefficient (in 1/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)

field c1: float | None = None

Polynomial coefficient (in s/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)

field c2: float | None = None

Polynomial coefficient (in s2/m) for determining the rate of sea ice dissipation (SWAN default: 1.06E-3)

field c3: float | None = None

Polynomial coefficient (in s3/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)

field c4: float | None = None

Polynomial coefficient (in s4/m) for determining the rate of sea ice dissipation (SWAN default: 2.3E-2)

field c5: float | None = None

Polynomial coefficient (in s5/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)

field c6: float | None = None

Polynomial coefficient (in s6/m) for determining the rate of sea ice dissipation (SWAN default: 0.0)

field model_type: Literal['r19', 'R19'] = 'r19'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SICE_R21B[source]

Sea ice dissipation based on the method of Rogers et al. (2021).

SICE [aice] R21B [chf] [npf]

References

Rogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave attenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science and Technology, 182, p.103198.

Examples

In [1]: from rompy.swan.components.physics import SICE_R21B

In [2]: sice = SICE_R21B()

In [3]: print(sice.render())
SICE R21B

In [4]: sice = SICE_R21B(aice=0.8, chf=2.9, npf=4.5)

In [5]: print(sice.render())
SICE aice=0.8 R21B chf=2.9 npf=4.5

Show JSON schema
{
   "title": "SICE_R21B",
   "description": "Sea ice dissipation based on the method of Rogers et al. (2021).\n\n.. code-block:: text\n\n    SICE [aice] R21B [chf] [npf]\n\nReferences\n----------\nRogers, W.E., Meylan, M.H. and Kohout, A.L., 2021. Estimates of spectral wave\nattenuation in Antarctic sea ice, using model/data inversion. Cold Regions Science\nand Technology, 182, p.103198.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SICE_R21B\n    sice = SICE_R21B()\n    print(sice.render())\n    sice = SICE_R21B(aice=0.8, chf=2.9, npf=4.5)\n    print(sice.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "r21b",
         "description": "Model type discriminator",
         "enum": [
            "r21b",
            "R21B"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "aice": {
         "anyOf": [
            {
               "maximum": 1.0,
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Ice concentration as a fraction from 0 to 1. Note that `aice` is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands `INPGRID AICE` and `READINP AICE` to define and read the sea concentration. The value of `aice` in this command is then not required (it will be ignored)",
         "title": "Aice"
      },
      "chf": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A simple coefficient of proportionality (SWAN default: 2.9)",
         "title": "Chf"
      },
      "npf": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the degree of dependence on frequency and ice thickness (SWAN default: 4.5)",
         "title": "Npf"
      }
   },
   "additionalProperties": false
}

Fields:
field aice: float | None = None

Ice concentration as a fraction from 0 to 1. Note that aice is allowed to vary over the computational region to account for the zonation of ice concentration. In that case use the commands INPGRID AICE and READINP AICE to define and read the sea concentration. The value of aice in this command is then not required (it will be ignored)

Constraints:
  • ge = 0.0

  • le = 1.0

field chf: float | None = None

A simple coefficient of proportionality (SWAN default: 2.9)

field model_type: Literal['r21b', 'R21B'] = 'r21b'

Model type discriminator

field npf: float | None = None

Controls the degree of dependence on frequency and ice thickness (SWAN default: 4.5)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SSWELL_ARDHUIN[source]

Nonbreaking dissipation of Ardhuin et al. (2010).

SSWELL ARDHUIN [cdsv]

References

Ardhuin, F., Rogers, E., Babanin, A.V., Filipot, J.F., Magne, R., Roland, A., Van Der Westhuysen, A., Queffeulou, P., Lefevre, J.M., Aouf, L. and Collard, F., 2010. Semiempirical dissipation source functions for ocean waves. Part I: Definition, calibration, and validation. Journal of Physical Oceanography, 40(9), pp.1917-1941.

Examples

In [1]: from rompy.swan.components.physics import SSWELL_ARDHUIN

In [2]: sswell = SSWELL_ARDHUIN()

In [3]: print(sswell.render())
SSWELL ARDHUIN

In [4]: sswell = SSWELL_ARDHUIN(cdsv=1.2)

In [5]: print(sswell.render())
SSWELL ARDHUIN cdsv=1.2

Show JSON schema
{
   "title": "SSWELL_ARDHUIN",
   "description": "Nonbreaking dissipation of Ardhuin et al. (2010).\n\n.. code-block:: text\n\n    SSWELL ARDHUIN [cdsv]\n\nReferences\n----------\nArdhuin, F., Rogers, E., Babanin, A.V., Filipot, J.F., Magne, R., Roland, A.,\nVan Der Westhuysen, A., Queffeulou, P., Lefevre, J.M., Aouf, L. and Collard, F.,\n2010. Semiempirical dissipation source functions for ocean waves. Part I:\nDefinition, calibration, and validation. Journal of Physical Oceanography, 40(9),\npp.1917-1941.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SSWELL_ARDHUIN\n    sswell = SSWELL_ARDHUIN()\n    print(sswell.render())\n    sswell = SSWELL_ARDHUIN(cdsv=1.2)\n    print(sswell.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "ardhuin",
         "description": "Model type discriminator",
         "enum": [
            "ardhuin",
            "ARDHUIN"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cdsv": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)",
         "title": "Cdsv"
      }
   },
   "additionalProperties": false
}

Fields:
field cdsv: float | None = None

Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)

field model_type: Literal['ardhuin', 'ARDHUIN'] = 'ardhuin'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SSWELL_ROGERS[source]

Nonbreaking dissipation of Rogers et al. (2012).

SSWELL ROGERS [cdsv] [feswell]

References

Rogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and whitecapping dissipation in a model for wind-generated surface waves: Description and simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9), pp.1329-1346.

Examples

In [1]: from rompy.swan.components.physics import SSWELL_ROGERS

In [2]: sswell = SSWELL_ROGERS()

In [3]: print(sswell.render())
SSWELL ROGERS

In [4]: sswell = SSWELL_ROGERS(cdsv=1.2, feswell=0.5)

In [5]: print(sswell.render())
SSWELL ROGERS cdsv=1.2 feswell=0.5

Show JSON schema
{
   "title": "SSWELL_ROGERS",
   "description": "Nonbreaking dissipation of Rogers et al. (2012).\n\n.. code-block:: text\n\n    SSWELL ROGERS [cdsv] [feswell]\n\nReferences\n----------\nRogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and\nwhitecapping dissipation in a model for wind-generated surface waves: Description\nand simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9),\npp.1329-1346.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SSWELL_ROGERS\n    sswell = SSWELL_ROGERS()\n    print(sswell.render())\n    sswell = SSWELL_ROGERS(cdsv=1.2, feswell=0.5)\n    print(sswell.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "rogers",
         "description": "Model type discriminator",
         "enum": [
            "rogers",
            "ROGERS"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cdsv": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)",
         "title": "Cdsv"
      },
      "feswell": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Swell dissipation factor",
         "title": "Feswell"
      }
   },
   "additionalProperties": false
}

Fields:
field cdsv: float | None = None

Coefficient related to laminar atmospheric boundary layer (SWAN default: 1.2)

field feswell: float | None = None

Swell dissipation factor

field model_type: Literal['rogers', 'ROGERS'] = 'rogers'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SSWELL_ZIEGER[source]

Nonbreaking dissipation of Zieger et al. (2015).

SSWELL ZIEGER [b1]

Swell dissipation of Young et al. (2013) updated by Zieger et al. (2015). The Zieger option is intended for use with negative wind input via the NEGATINP command. Zieger non-breaking dissipation follows the method used in WAVEWATCH III version 4 and does not include the steepness-dependent swell coefficient introduced in WAVEWATCH III version 5.

References

Zieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based source terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96, pp.2-25.

Young, I.R., Babanin, A.V. and Zieger, S., 2013. The decay rate of ocean swell observed by altimeter. Journal of physical oceanography, 43(11), pp.2322-2333.

Examples

In [1]: from rompy.swan.components.physics import SSWELL_ZIEGER

In [2]: sswell = SSWELL_ZIEGER()

In [3]: print(sswell.render())
SSWELL ZIEGER

In [4]: sswell = SSWELL_ZIEGER(b1=0.00025)

In [5]: print(sswell.render())
SSWELL ZIEGER b1=0.00025

Show JSON schema
{
   "title": "SSWELL_ZIEGER",
   "description": "Nonbreaking dissipation of Zieger et al. (2015).\n\n.. code-block:: text\n\n    SSWELL ZIEGER [b1]\n\nSwell dissipation of Young et al. (2013) updated by Zieger et al. (2015). The\nZieger option is intended for use with negative wind input via the NEGATINP\ncommand. Zieger non-breaking dissipation follows the method used in WAVEWATCH III\nversion 4 and does not include the steepness-dependent swell coefficient introduced\nin WAVEWATCH III version 5.\n\nReferences\n----------\nZieger, S., Babanin, A.V., Rogers, W.E. and Young, I.R., 2015. Observation-based\nsource terms in the third-generation wave model WAVEWATCH. Ocean Modelling, 96,\npp.2-25.\n\nYoung, I.R., Babanin, A.V. and Zieger, S., 2013. The decay rate of ocean swell\nobserved by altimeter. Journal of physical oceanography, 43(11), pp.2322-2333.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import SSWELL_ZIEGER\n    sswell = SSWELL_ZIEGER()\n    print(sswell.render())\n    sswell = SSWELL_ZIEGER(b1=0.00025)\n    print(sswell.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "zieger",
         "description": "Model type discriminator",
         "enum": [
            "zieger",
            "ZIEGER"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "b1": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Non-dimensional proportionality coefficient (SWAN default: 0.00025)",
         "title": "B1"
      }
   },
   "additionalProperties": false
}

Fields:
field b1: float | None = None

Non-dimensional proportionality coefficient (SWAN default: 0.00025)

field model_type: Literal['zieger', 'ZIEGER'] = 'zieger'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.SURFBEAT[source]

Surfbeat.

SURFBEAT [df] [nmax] [emin] UNIFORM/LOGARITHMIC

Using this optional command, the user activates the Infragravity Energy Module (IEM) of Reniers and Zijlema (2022). Besides the energy balance equation for a sea-swell wave field, another energy balance is included to account for the transfer of sea-swell energy to the bound infragravity (BIG) wave. This infragravity energy balance also involves a nonlinear transfer, expressed by the biphase, through the phase coupling between the radiation stress forcing and the BIG wave. For the prediction of the biphase for obliquely incident waves, an evolution equation is provided under the assumption that the bottom slopes are mild and alongshore uniform.

References

Reniers, A. and Zijlema, M., 2022. Swan surfbeat-1d. Coastal Engineering, 172, p.104068.

Examples:#

In [1]: from rompy.swan.components.physics import SURFBEAT

In [2]: surfbeat = SURFBEAT()

In [3]: print(surfbeat.render())
SURFBEAT

In [4]: surfbeat = SURFBEAT(df=0.01, nmax=50000, emin=0.05, spacing="logarithmic")

In [5]: print(surfbeat.render())
SURFBEAT df=0.01 nmax=50000 emin=0.05 LOGARITHMIC

Show JSON schema
{
   "title": "SURFBEAT",
   "description": "Surfbeat.\n\n.. code-block:: text\n\n    SURFBEAT [df] [nmax] [emin] UNIFORM/LOGARITHMIC\n\nUsing this optional command, the user activates the Infragravity Energy Module\n(IEM) of Reniers and Zijlema (2022). Besides the energy balance equation for a\nsea-swell wave field, another energy balance is included to account for the\ntransfer of sea-swell energy to the bound infragravity (BIG) wave. This\ninfragravity energy balance also involves a nonlinear transfer, expressed by the\nbiphase, through the phase coupling between the radiation stress forcing and the\nBIG wave. For the prediction of the biphase for obliquely incident waves, an\nevolution equation is provided under the assumption that the bottom slopes are mild\nand alongshore uniform.\n\nReferences\n----------\nReniers, A. and Zijlema, M., 2022. Swan surfbeat-1d. Coastal Engineering, 172,\np.104068.\n\nExamples:\n---------\n\n.. ipython:: python\n\n    from rompy.swan.components.physics import SURFBEAT\n    surfbeat = SURFBEAT()\n    print(surfbeat.render())\n    surfbeat = SURFBEAT(df=0.01, nmax=50000, emin=0.05, spacing=\"logarithmic\")\n    print(surfbeat.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "surfbeat",
         "description": "Model type discriminator",
         "enum": [
            "surfbeat",
            "SURFBEAT"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "df": {
         "anyOf": [
            {
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The constant size of BIG frequency bin (in Hz) (SWAN default: 0.01)",
         "title": "Df"
      },
      "nmax": {
         "anyOf": [
            {
               "minimum": 0,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The maximum number of short-wave pairs for creating bichromatic wave groups (SWAN default: 50000)",
         "title": "Nmax"
      },
      "emin": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The energy threshold in fraction of energy spectrum peak. With this threshold one takes into account those short wave components to create bichromatic wave groups while their energy levels are larger than `emin x E_max` with `E_max` the peak of the spectrum (SWAN default: 0.05)",
         "title": "Emin"
      },
      "spacing": {
         "anyOf": [
            {
               "enum": [
                  "uniform",
                  "logarithmic"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Define if frequencies for reflected ig waves are uniformly or logarithmically distributed",
         "title": "Spacing"
      }
   },
   "additionalProperties": false
}

Fields:
field df: float | None = None

The constant size of BIG frequency bin (in Hz) (SWAN default: 0.01)

Constraints:
  • ge = 0.0

field emin: float | None = None

The energy threshold in fraction of energy spectrum peak. With this threshold one takes into account those short wave components to create bichromatic wave groups while their energy levels are larger than emin x E_max with E_max the peak of the spectrum (SWAN default: 0.05)

field model_type: Literal['surfbeat', 'SURFBEAT'] = 'surfbeat'

Model type discriminator

field nmax: int | None = None

The maximum number of short-wave pairs for creating bichromatic wave groups (SWAN default: 50000)

Constraints:
  • ge = 0

field spacing: Literal['uniform', 'logarithmic'] | None = None

Define if frequencies for reflected ig waves are uniformly or logarithmically distributed

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.TRIAD[source]

Wave triad interactions.

TRIAD [itriad] [trfac] [cutfr] [a] [b] [urcrit] [urslim]

With this command the user can activate the triad wave-wave interactions. If this command is not used, SWAN will not account for triads.

Note

This is the TRIAD specification in SWAN < 41.45.

Examples

In [1]: from rompy.swan.components.physics import TRIAD

In [2]: triad = TRIAD()

In [3]: print(triad.render())
TRIAD

In [4]: triad = TRIAD(
   ...:     itriad=1,
   ...:     trfac=0.8,
   ...:     cutfr=2.5,
   ...:     a=0.95,
   ...:     b=-0.75,
   ...:     ucrit=0.2,
   ...:     urslim=0.01,
   ...: )
   ...: 

In [5]: print(triad.render())
TRIAD itriad=1 trfac=0.8 cutfr=2.5 a=0.95 b=-0.75 urcrit=0.2 urslim=0.01

Show JSON schema
{
   "title": "TRIAD",
   "description": "Wave triad interactions.\n\n.. code-block:: text\n\n    TRIAD [itriad] [trfac] [cutfr] [a] [b] [urcrit] [urslim]\n\nWith this command the user can activate the triad wave-wave interactions. If this\ncommand is not used, SWAN will not account for triads.\n\nNote\n----\nThis is the TRIAD specification in SWAN < 41.45.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD\n    triad = TRIAD()\n    print(triad.render())\n    triad = TRIAD(\n        itriad=1,\n        trfac=0.8,\n        cutfr=2.5,\n        a=0.95,\n        b=-0.75,\n        ucrit=0.2,\n        urslim=0.01,\n    )\n    print(triad.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "triad",
         "description": "Model type discriminator",
         "enum": [
            "triad",
            "TRIAD"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "itriad": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Approximation method for the triad computation: \n\n* 1: the LTA method of Eldeberky (1996) \n* 2: the SPB method of Becq-Girard et al. (1999) (SWAN default: 1)",
         "title": "Itriad"
      },
      "trfac": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient (SWAN default: 0.8 in case of LTA method, 0.9 in case of SPB method)",
         "title": "Trfac"
      },
      "cutfr": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the maximum frequency that is considered in the LTA computation. The value of `cutfr` is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)",
         "title": "Cutfr"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: 0.95)",
         "title": "A"
      },
      "b": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: -0.75 for 1D, 0.0 for 2D",
         "title": "B"
      },
      "ucrit": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The critical Ursell number appearing in the expression for the biphase (SWAN default: 0.2)",
         "title": "Ucrit"
      },
      "urslim": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The lower threshold for Ursell number, if the actual Ursell number is below this value triad interactions are be computed (SWAN default: 0.01)",
         "title": "Urslim"
      }
   },
   "additionalProperties": false
}

Fields:
field a: float | None = None

First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: 0.95)

field b: float | None = None

Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition (SWAN default: -0.75 for 1D, 0.0 for 2D

field cutfr: float | None = None

Controls the maximum frequency that is considered in the LTA computation. The value of cutfr is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)

field itriad: Literal[1, 2] | None = None

Approximation method for the triad computation:

  • 1: the LTA method of Eldeberky (1996)

  • 2: the SPB method of Becq-Girard et al. (1999) (SWAN default: 1)

field model_type: Literal['triad', 'TRIAD'] = 'triad'

Model type discriminator

field trfac: float | None = None

Proportionality coefficient (SWAN default: 0.8 in case of LTA method, 0.9 in case of SPB method)

field ucrit: float | None = None

The critical Ursell number appearing in the expression for the biphase (SWAN default: 0.2)

field urslim: float | None = None

The lower threshold for Ursell number, if the actual Ursell number is below this value triad interactions are be computed (SWAN default: 0.01)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.TRIAD_DCTA[source]

Triad interactions with the DCTA method of Booij et al. (2009).

TRIAD DCTA [trfac] [p] COLL|NONC BIPHHASE ELDEBERKY|DEWIT

References

Booij, N., Holthuijsen, L.H. and Bénit, M.P., 2009. A distributed collinear triad approximation in SWAN. In Proceedings Of Coastal Dynamics 2009: Impacts of Human Activities on Dynamic Coastal Processes (With CD-ROM) (pp. 1-10).

Note

This is the default method to compute the triad interactions in SWAN >= 41.45, it is not supported in earlier versions of the model.

Examples

In [1]: from rompy.swan.components.physics import TRIAD_DCTA

In [2]: triad = TRIAD_DCTA()

In [3]: print(triad.render())
TRIAD DCTA COLL

In [4]: triad = TRIAD_DCTA(
   ...:     trfac=4.4,
   ...:     p=1.3,
   ...:     noncolinear=True,
   ...:     biphase={"model_type": "dewit", "lpar": 0.0},
   ...: )
   ...: 

In [5]: print(triad.render())
TRIAD DCTA trfac=4.4 p=1.3 NONC BIPHASE DEWIT lpar=0.0

Show JSON schema
{
   "title": "TRIAD_DCTA",
   "description": "Triad interactions with the DCTA method of Booij et al. (2009).\n\n.. code-block:: text\n\n    TRIAD DCTA [trfac] [p] COLL|NONC BIPHHASE ELDEBERKY|DEWIT\n\nReferences\n----------\nBooij, N., Holthuijsen, L.H. and B\u00e9nit, M.P., 2009. A distributed collinear triad\napproximation in SWAN. In Proceedings Of Coastal Dynamics 2009: Impacts of Human\nActivities on Dynamic Coastal Processes (With CD-ROM) (pp. 1-10).\n\nNote\n----\nThis is the default method to compute the triad interactions in SWAN >= 41.45, it\nis not supported in earlier versions of the model.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD_DCTA\n    triad = TRIAD_DCTA()\n    print(triad.render())\n    triad = TRIAD_DCTA(\n        trfac=4.4,\n        p=1.3,\n        noncolinear=True,\n        biphase={\"model_type\": \"dewit\", \"lpar\": 0.0},\n    )\n    print(triad.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "dcta",
         "description": "Model type discriminator",
         "enum": [
            "dcta",
            "DCTA"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "trfac": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Scaling factor that controls the intensity of the triad interaction due to DCTA (SWAN default: 4.4)",
         "title": "Trfac"
      },
      "p": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Shape coefficient to force the high-frequency tail(SWAN default: 4/3)",
         "title": "P"
      },
      "noncolinear": {
         "default": false,
         "description": "If True, the noncolinear triad interactions with the DCTA framework are accounted for",
         "title": "Noncolinear",
         "type": "boolean"
      },
      "biphase": {
         "anyOf": [
            {
               "$ref": "#/$defs/ELDEBERKY"
            },
            {
               "$ref": "#/$defs/DEWIT"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)",
         "title": "Biphase"
      }
   },
   "$defs": {
      "DEWIT": {
         "additionalProperties": false,
         "description": "Biphase of De Wit (2022).\n\n.. code-block:: text\n\n    BIPHASE DEWIT [lpar]\n\nBiphase parameterization based on bed slope and peak period of De Wit (2022).\n\nReferences\n----------\nDe Wit, F.P., 2022. Wave shape prediction in complex coastal systems (Doctoral\ndissertation, PhD. thesis. Delft University of Technology. https://repository.\ntudelft. nl/islandora/object/uuid% 3A0fb850a4-4294-4181-9d74-857de21265c2).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DEWIT\n    biphase = DEWIT()\n    print(biphase.render())\n    biphase = DEWIT(lpar=0.0)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "dewit",
               "default": "dewit",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "lpar": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scales spatial averaging of the De Wit's biphase in terms of a multiple of peak wave length of the incident wave field. Note: `lpar` = 0` means no averaging (SWAN default: 0)",
               "title": "Lpar"
            }
         },
         "title": "DEWIT",
         "type": "object"
      },
      "ELDEBERKY": {
         "additionalProperties": false,
         "description": "Biphase of Eldeberky (1999).\n\n.. code-block:: text\n\n    BIPHASE ELDEBERKY [urcrit]\n\nBiphase parameterisation as a funtion of the Ursell number of Eldeberky (1999).\n\nReferences\n----------\nEldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for\nmodeling triad interactions in dispersive waves. In Coastal Engineering 1996\n(pp. 1088-1101).\n\nEldeberky, Y. and Madsen, P.A., 1999. Deterministic and stochastic evolution\nequations for fully dispersive and weakly nonlinear waves. Coastal Engineering,\n38(1), pp.1-24.\n\nDoering, J.C. and Bowen, A.J., 1995. Parametrization of orbital velocity\nasymmetries of shoaling and breaking waves using bispectral analysis. Coastal\nengineering, 26(1-2), pp.15-33.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ELDEBERKY\n    biphase = ELDEBERKY()\n    print(biphase.render())\n    biphase = ELDEBERKY(urcrit=0.63)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "eldeberky",
               "default": "eldeberky",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "urcrit": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The critical Ursell number appearing in the parametrization. Note: the value of `urcrit` is setted by Eldeberky (1996) at 0.2 based on a laboratory experiment, whereas Doering and Bowen (1995) employed the value of 0.63 based on the field experiment data (SWAN default: 0.63)",
               "title": "Urcrit"
            }
         },
         "title": "ELDEBERKY",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field biphase: ELDEBERKY | DEWIT | None = None

Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)

field model_type: Literal['dcta', 'DCTA'] = 'dcta'

Model type discriminator

field noncolinear: bool = False

If True, the noncolinear triad interactions with the DCTA framework are accounted for

field p: float | None = None

Shape coefficient to force the high-frequency tail(SWAN default: 4/3)

field trfac: float | None = None

Scaling factor that controls the intensity of the triad interaction due to DCTA (SWAN default: 4.4)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.TRIAD_LTA[source]

Triad interactions with the LTA method of Eldeberky (1996).

TRIAD LTA [trfac] [cutfr] BIPHHASE ELDEBERKY|DEWIT

References

Eldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for modeling triad interactions in dispersive waves. In Coastal Engineering 1996 (pp. 1088-1101).

Note

This method to compute the triad interactions is only supported in SWAN >= 41.45.

Examples

In [1]: from rompy.swan.components.physics import TRIAD_LTA

In [2]: triad = TRIAD_LTA()

In [3]: print(triad.render())
TRIAD LTA

In [4]: triad = TRIAD_LTA(
   ...:     trfac=0.8,
   ...:     cutfr=2.5,
   ...:     biphase={"model_type": "eldeberky", "urcrit": 0.63},
   ...: )
   ...: 

In [5]: print(triad.render())
TRIAD LTA trfac=0.8 cutfr=2.5 BIPHASE ELDEBERKY urcrit=0.63

Show JSON schema
{
   "title": "TRIAD_LTA",
   "description": "Triad interactions with the LTA method of Eldeberky (1996).\n\n.. code-block:: text\n\n    TRIAD LTA [trfac] [cutfr] BIPHHASE ELDEBERKY|DEWIT\n\nReferences\n----------\nEldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for\nmodeling triad interactions in dispersive waves. In Coastal Engineering 1996\n(pp. 1088-1101).\n\nNote\n----\nThis method to compute the triad interactions is only supported in SWAN >= 41.45.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD_LTA\n    triad = TRIAD_LTA()\n    print(triad.render())\n    triad = TRIAD_LTA(\n        trfac=0.8,\n        cutfr=2.5,\n        biphase={\"model_type\": \"eldeberky\", \"urcrit\": 0.63},\n    )\n    print(triad.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "lta",
         "description": "Model type discriminator",
         "enum": [
            "lta",
            "LTA"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "trfac": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Scaling factor that controls the intensity of the triad interaction due to LTA (SWAN default: 0.8)",
         "title": "Trfac"
      },
      "cutfr": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Controls the maximum frequency that is considered in the LTA computation. The value of `cutfr` is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)",
         "title": "Cutfr"
      },
      "biphase": {
         "anyOf": [
            {
               "$ref": "#/$defs/ELDEBERKY"
            },
            {
               "$ref": "#/$defs/DEWIT"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)",
         "title": "Biphase"
      }
   },
   "$defs": {
      "DEWIT": {
         "additionalProperties": false,
         "description": "Biphase of De Wit (2022).\n\n.. code-block:: text\n\n    BIPHASE DEWIT [lpar]\n\nBiphase parameterization based on bed slope and peak period of De Wit (2022).\n\nReferences\n----------\nDe Wit, F.P., 2022. Wave shape prediction in complex coastal systems (Doctoral\ndissertation, PhD. thesis. Delft University of Technology. https://repository.\ntudelft. nl/islandora/object/uuid% 3A0fb850a4-4294-4181-9d74-857de21265c2).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DEWIT\n    biphase = DEWIT()\n    print(biphase.render())\n    biphase = DEWIT(lpar=0.0)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "dewit",
               "default": "dewit",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "lpar": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scales spatial averaging of the De Wit's biphase in terms of a multiple of peak wave length of the incident wave field. Note: `lpar` = 0` means no averaging (SWAN default: 0)",
               "title": "Lpar"
            }
         },
         "title": "DEWIT",
         "type": "object"
      },
      "ELDEBERKY": {
         "additionalProperties": false,
         "description": "Biphase of Eldeberky (1999).\n\n.. code-block:: text\n\n    BIPHASE ELDEBERKY [urcrit]\n\nBiphase parameterisation as a funtion of the Ursell number of Eldeberky (1999).\n\nReferences\n----------\nEldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for\nmodeling triad interactions in dispersive waves. In Coastal Engineering 1996\n(pp. 1088-1101).\n\nEldeberky, Y. and Madsen, P.A., 1999. Deterministic and stochastic evolution\nequations for fully dispersive and weakly nonlinear waves. Coastal Engineering,\n38(1), pp.1-24.\n\nDoering, J.C. and Bowen, A.J., 1995. Parametrization of orbital velocity\nasymmetries of shoaling and breaking waves using bispectral analysis. Coastal\nengineering, 26(1-2), pp.15-33.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ELDEBERKY\n    biphase = ELDEBERKY()\n    print(biphase.render())\n    biphase = ELDEBERKY(urcrit=0.63)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "eldeberky",
               "default": "eldeberky",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "urcrit": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The critical Ursell number appearing in the parametrization. Note: the value of `urcrit` is setted by Eldeberky (1996) at 0.2 based on a laboratory experiment, whereas Doering and Bowen (1995) employed the value of 0.63 based on the field experiment data (SWAN default: 0.63)",
               "title": "Urcrit"
            }
         },
         "title": "ELDEBERKY",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field biphase: ELDEBERKY | DEWIT | None = None

Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)

field cutfr: float | None = None

Controls the maximum frequency that is considered in the LTA computation. The value of cutfr is the ratio of this maximum frequency over the mean frequency (SWAN default: 2.5)

field model_type: Literal['lta', 'LTA'] = 'lta'

Model type discriminator

field trfac: float | None = None

Scaling factor that controls the intensity of the triad interaction due to LTA (SWAN default: 0.8)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.TRIAD_SPB[source]

Triad interactions with the SPB method of Becq-Girard et al. (1999).

TRIAD SPB [trfac] [a] [b] BIPHHASE ELDEBERKY|DEWIT

References

Becq-Girard, F., Forget, P. and Benoit, M., 1999. Non-linear propagation of unidirectional wave fields over varying topography. Coastal Engineering, 38(2), pp.91-113.

Note

This method to compute the triad interactions is only supported in SWAN >= 41.45.

Examples

In [1]: from rompy.swan.components.physics import TRIAD_SPB

In [2]: triad = TRIAD_SPB()

In [3]: print(triad.render())
TRIAD SPB

In [4]: triad = TRIAD_SPB(
   ...:     trfac=0.9,
   ...:     a=0.95,
   ...:     b=0.0,
   ...:     biphase={"model_type": "eldeberky", "urcrit": 0.63},
   ...: )
   ...: 

In [5]: print(triad.render())
TRIAD SPB trfac=0.9 a=0.95 b=0.0 BIPHASE ELDEBERKY urcrit=0.63

Show JSON schema
{
   "title": "TRIAD_SPB",
   "description": "Triad interactions with the SPB method of Becq-Girard et al. (1999).\n\n.. code-block:: text\n\n    TRIAD SPB [trfac] [a] [b] BIPHHASE ELDEBERKY|DEWIT\n\nReferences\n----------\nBecq-Girard, F., Forget, P. and Benoit, M., 1999. Non-linear propagation of\nunidirectional wave fields over varying topography. Coastal Engineering, 38(2),\npp.91-113.\n\nNote\n----\nThis method to compute the triad interactions is only supported in SWAN >= 41.45.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TRIAD_SPB\n    triad = TRIAD_SPB()\n    print(triad.render())\n    triad = TRIAD_SPB(\n        trfac=0.9,\n        a=0.95,\n        b=0.0,\n        biphase={\"model_type\": \"eldeberky\", \"urcrit\": 0.63},\n    )\n    print(triad.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "spb",
         "description": "Model type discriminator",
         "enum": [
            "spb",
            "SPB"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "trfac": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Scaling factor that controls the intensity of the triad interaction due to SPB (SWAN default: 0.9)",
         "title": "Trfac"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is 0.95 and is calibrated by means of laboratory experiments (SWAN default: 0.95)",
         "title": "A"
      },
      "b": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is -0.75 and is calibrated by means of laboratory experiments. However, it may not be appropriate for true 2D field cases as it does not scale with the wave field characteristics. Hence, this parameter is set to zero (SWAN default: 0.0)",
         "title": "B"
      },
      "biphase": {
         "anyOf": [
            {
               "$ref": "#/$defs/ELDEBERKY"
            },
            {
               "$ref": "#/$defs/DEWIT"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)",
         "title": "Biphase"
      }
   },
   "$defs": {
      "DEWIT": {
         "additionalProperties": false,
         "description": "Biphase of De Wit (2022).\n\n.. code-block:: text\n\n    BIPHASE DEWIT [lpar]\n\nBiphase parameterization based on bed slope and peak period of De Wit (2022).\n\nReferences\n----------\nDe Wit, F.P., 2022. Wave shape prediction in complex coastal systems (Doctoral\ndissertation, PhD. thesis. Delft University of Technology. https://repository.\ntudelft. nl/islandora/object/uuid% 3A0fb850a4-4294-4181-9d74-857de21265c2).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DEWIT\n    biphase = DEWIT()\n    print(biphase.render())\n    biphase = DEWIT(lpar=0.0)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "dewit",
               "default": "dewit",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "lpar": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Scales spatial averaging of the De Wit's biphase in terms of a multiple of peak wave length of the incident wave field. Note: `lpar` = 0` means no averaging (SWAN default: 0)",
               "title": "Lpar"
            }
         },
         "title": "DEWIT",
         "type": "object"
      },
      "ELDEBERKY": {
         "additionalProperties": false,
         "description": "Biphase of Eldeberky (1999).\n\n.. code-block:: text\n\n    BIPHASE ELDEBERKY [urcrit]\n\nBiphase parameterisation as a funtion of the Ursell number of Eldeberky (1999).\n\nReferences\n----------\nEldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for\nmodeling triad interactions in dispersive waves. In Coastal Engineering 1996\n(pp. 1088-1101).\n\nEldeberky, Y. and Madsen, P.A., 1999. Deterministic and stochastic evolution\nequations for fully dispersive and weakly nonlinear waves. Coastal Engineering,\n38(1), pp.1-24.\n\nDoering, J.C. and Bowen, A.J., 1995. Parametrization of orbital velocity\nasymmetries of shoaling and breaking waves using bispectral analysis. Coastal\nengineering, 26(1-2), pp.15-33.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ELDEBERKY\n    biphase = ELDEBERKY()\n    print(biphase.render())\n    biphase = ELDEBERKY(urcrit=0.63)\n    print(biphase.render())",
         "properties": {
            "model_type": {
               "const": "eldeberky",
               "default": "eldeberky",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "urcrit": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The critical Ursell number appearing in the parametrization. Note: the value of `urcrit` is setted by Eldeberky (1996) at 0.2 based on a laboratory experiment, whereas Doering and Bowen (1995) employed the value of 0.63 based on the field experiment data (SWAN default: 0.63)",
               "title": "Urcrit"
            }
         },
         "title": "ELDEBERKY",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field a: float | None = None

First calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is 0.95 and is calibrated by means of laboratory experiments (SWAN default: 0.95)

field b: float | None = None

Second calibration parameter for tuning K in Eq. (5.1) of Becq-Girard et al. (1999). This parameter is associated with broadening of the resonance condition. The default value is -0.75 and is calibrated by means of laboratory experiments. However, it may not be appropriate for true 2D field cases as it does not scale with the wave field characteristics. Hence, this parameter is set to zero (SWAN default: 0.0)

field biphase: ELDEBERKY | DEWIT | None = None

Defines the parameterization of biphase (self-self interaction) (SWAN default: ELDEBERKY)

field model_type: Literal['spb', 'SPB'] = 'spb'

Model type discriminator

field trfac: float | None = None

Scaling factor that controls the intensity of the triad interaction due to SPB (SWAN default: 0.9)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.TURBULENCE[source]

Turbulent viscosity.

TURBULENCE [ctb] (CURRENT [tbcur])

With this optional command the user can activate turbulent viscosity. This physical effect is also activated by reading values of the turbulent viscosity using the READGRID TURB command, but then with the default value of ctb. The command READGRID TURB is necessary if this command TURB is used since the value of the viscosity is assumed to vary over space.

Examples

In [1]: from rompy.swan.components.physics import TURBULENCE

In [2]: turbulence = TURBULENCE(current=False)

In [3]: print(turbulence.render())
TURBULENCE

In [4]: turbulence = TURBULENCE(ctb=0.01, current=True, tbcur=0.004)

In [5]: print(turbulence.render())
TURBULENCE ctb=0.01 CURRENT tbcur=0.004

Show JSON schema
{
   "title": "TURBULENCE",
   "description": "Turbulent viscosity.\n\n.. code-block:: text\n\n    TURBULENCE [ctb] (CURRENT [tbcur])\n\nWith this optional command the user can activate turbulent viscosity. This physical\neffect is also activated by reading values of the turbulent viscosity using the\n`READGRID TURB` command, but then with the default value of `ctb`. The command\n`READGRID TURB` is necessary if this command `TURB` is used since the value of the\nviscosity is assumed to vary over space.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import TURBULENCE\n    turbulence = TURBULENCE(current=False)\n    print(turbulence.render())\n    turbulence = TURBULENCE(ctb=0.01, current=True, tbcur=0.004)\n    print(turbulence.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "turbulence",
         "description": "Model type discriminator",
         "enum": [
            "turbulence",
            "TURBULENCE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "ctb": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The value of the proportionality coefficient appearing in the energy dissipation term (SWAN default: 0.01)",
         "title": "Ctb"
      },
      "current": {
         "anyOf": [
            {
               "type": "boolean"
            },
            {
               "type": "null"
            }
         ],
         "default": true,
         "description": "If this keyword is present the turbulent viscosity will be derived from the product of the depth and the absolute value of the current velocity. If the command `READGRID TURB` is used, this option is ignored; the values read from file will prevail",
         "title": "Current"
      },
      "tbcur": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The factor by which depth x current velocity is multiplied in order to get the turbulent viscosity (SWAN default: 0.004)",
         "title": "Tbcur"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
field ctb: float | None = None

The value of the proportionality coefficient appearing in the energy dissipation term (SWAN default: 0.01)

Validated by:
field current: bool | None = True

If this keyword is present the turbulent viscosity will be derived from the product of the depth and the absolute value of the current velocity. If the command READGRID TURB is used, this option is ignored; the values read from file will prevail

Validated by:
field model_type: Literal['turbulence', 'TURBULENCE'] = 'turbulence'

Model type discriminator

Validated by:
field tbcur: float | None = None

The factor by which depth x current velocity is multiplied in order to get the turbulent viscosity (SWAN default: 0.004)

Validated by:
cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

validator tbcur_only_with_current  »  all fields[source]
pydantic model rompy.swan.components.physics.VEGETATION[source]

Vegetation dumping.

VEGETATION [iveg] < [height] [diamtr] [nstems] [drag] >

With this command the user can activate wave damping due to vegetation based on the Dalrymple’s formula (1984) as implemented by Suzuki et al. (2011). This damping is uniform over the wave frequencies. An alternative is the frequency-dependent (canopy) dissipation model of Jacobsen et al. (2019). If this command is not used, SWAN will not account for vegetation effects.

The vegetation (rigid plants) can be divided over a number of vertical segments and so, the possibility to vary the vegetation vertically is included. Each vertical layer represents some characteristics of the plants. These variables as indicated below can be repeated as many vertical layers to be chosen.

References

Dalrymple, R.A., Kirby, J.T. and Hwang, P.A., 1984. Wave diffraction due to areas of energy dissipation. Journal of waterway, port, coastal, and ocean engineering, 110(1), pp.67-79.

Jacobsen, N.G., Bakker, W., Uijttewaal, W.S. and Uittenbogaard, R., 2019. Experimental investigation of the wave-induced motion of and force distribution along a flexible stem. Journal of Fluid Mechanics, 880, pp.1036-1069.

Suzuki, T., Zijlema, M., Burger, B., Meijer, M.C. and Narayan, S., 2012. Wave dissipation by vegetation with layer schematization in SWAN. Coastal Engineering, 59(1), pp.64-71.

Notes

Vertical layering of the vegetation is not yet implemented for the Jacobsen et al. (2019) method.

Examples

In [1]: from rompy.swan.components.physics import VEGETATION

# Single layer
In [2]: vegetation = VEGETATION(
   ...:     height=1.2,
   ...:     diamtr=0.1,
   ...:     drag=0.5,
   ...:     nstems=10,
   ...: )
   ...: 

In [3]: print(vegetation.render())
VEGETATION iveg=1 height=1.2 diamtr=0.1 nstems=10 drag=0.5

# 2 vertical layers
In [4]: vegetation = VEGETATION(
   ...:     iveg=1,
   ...:     height=[1.2, 0.8],
   ...:     diamtr=[0.1, 0.1],
   ...:     drag=[0.5, 0.5],
   ...:     nstems=[10, 5],
   ...: )
   ...: 

In [5]: print(vegetation.render())
VEGETATION iveg=1 height=1.2 diamtr=0.1 nstems=10 drag=0.5 height=0.8 diamtr=0.1 nstems=5 drag=0.5

Show JSON schema
{
   "title": "VEGETATION",
   "description": "Vegetation dumping.\n\n.. code-block:: text\n\n    VEGETATION [iveg] < [height] [diamtr] [nstems] [drag] >\n\nWith this command the user can activate wave damping due to vegetation based on the\nDalrymple's formula (1984) as implemented by Suzuki et al. (2011). This damping is\nuniform over the wave frequencies. An alternative is the frequency-dependent\n(canopy) dissipation model of Jacobsen et al. (2019). If this command is not used,\nSWAN will not account for vegetation effects.\n\nThe vegetation (rigid plants) can be divided over a number of vertical segments and\nso, the possibility to vary the vegetation vertically is included. Each vertical\nlayer represents some characteristics of the plants. These variables as indicated\nbelow can be repeated as many vertical layers to be chosen.\n\nReferences\n----------\nDalrymple, R.A., Kirby, J.T. and Hwang, P.A., 1984. Wave diffraction due to areas\nof energy dissipation. Journal of waterway, port, coastal, and ocean engineering,\n110(1), pp.67-79.\n\nJacobsen, N.G., Bakker, W., Uijttewaal, W.S. and Uittenbogaard, R., 2019.\nExperimental investigation of the wave-induced motion of and force distribution\nalong a flexible stem. Journal of Fluid Mechanics, 880, pp.1036-1069.\n\nSuzuki, T., Zijlema, M., Burger, B., Meijer, M.C. and Narayan, S., 2012. Wave\ndissipation by vegetation with layer schematization in SWAN. Coastal Engineering,\n59(1), pp.64-71.\n\nNotes\n-----\nVertical layering of the vegetation is not yet implemented for the\nJacobsen et al. (2019) method.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import VEGETATION\n    # Single layer\n    vegetation = VEGETATION(\n        height=1.2,\n        diamtr=0.1,\n        drag=0.5,\n        nstems=10,\n    )\n    print(vegetation.render())\n    # 2 vertical layers\n    vegetation = VEGETATION(\n        iveg=1,\n        height=[1.2, 0.8],\n        diamtr=[0.1, 0.1],\n        drag=[0.5, 0.5],\n        nstems=[10, 5],\n    )\n    print(vegetation.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "vegetation",
         "description": "Model type discriminator",
         "enum": [
            "vegetation",
            "VEGETATION"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "iveg": {
         "default": 1,
         "description": "Indicates the method for the vegetation computation (SWAN default: 1):\n\n* 1: Suzuki et al. (2011)\n* 2: Jacobsen et al. (2019)\n",
         "enum": [
            1,
            2
         ],
         "title": "Iveg",
         "type": "integer"
      },
      "height": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "items": {
                  "type": "number"
               },
               "type": "array"
            }
         ],
         "description": "The plant height per layer (in m)",
         "title": "Height"
      },
      "diamtr": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "items": {
                  "type": "number"
               },
               "type": "array"
            }
         ],
         "description": "The diameter of each plant stand per layer (in m)",
         "title": "Diamtr"
      },
      "drag": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "items": {
                  "type": "number"
               },
               "type": "array"
            }
         ],
         "description": "The drag coefficient per layer",
         "title": "Drag"
      },
      "nstems": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "items": {
                  "type": "integer"
               },
               "type": "array"
            }
         ],
         "default": 1,
         "description": "The number of plant stands per square meter for each layer. Note that `nstems` is allowed to vary over the computational region to account for the zonation of vegetation. In that case use the commands `IMPGRID NPLANTS` and `READINP NPLANTS` to define and read the vegetation density. The (vertically varying) value of `nstems` in this command will be multiplied by this horizontally varying plant density (SWAN default: 1)",
         "title": "Nstems"
      }
   },
   "additionalProperties": false,
   "required": [
      "height",
      "diamtr",
      "drag"
   ]
}

Fields:
Validators:
field diamtr: float | list[float] [Required]

The diameter of each plant stand per layer (in m)

Validated by:
field drag: float | list[float] [Required]

The drag coefficient per layer

Validated by:
field height: float | list[float] [Required]

The plant height per layer (in m)

Validated by:
field iveg: Literal[1, 2] = 1

Indicates the method for the vegetation computation (SWAN default: 1):

  • 1: Suzuki et al. (2011)

  • 2: Jacobsen et al. (2019)

Validated by:
field model_type: Literal['vegetation', 'VEGETATION'] = 'vegetation'

Model type discriminator

Validated by:
field nstems: int | list[int] = 1

The number of plant stands per square meter for each layer. Note that nstems is allowed to vary over the computational region to account for the zonation of vegetation. In that case use the commands IMPGRID NPLANTS and READINP NPLANTS to define and read the vegetation density. The (vertically varying) value of nstems in this command will be multiplied by this horizontally varying plant density (SWAN default: 1)

Validated by:
cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator jacomsen_layering_not_implemented  »  all fields[source]
validator number_of_layers  »  drag, height, diamtr, nstems[source]
render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.WCAPPING_AB[source]

Whitecapping according to Alves and Banner (2003).

WCAPPING AB [cds2] [br] CURRENT [cds3]

References

Alves, J.H.G. and Banner, M.L., 2003. Performance of a saturation-based dissipation-rate source term in modeling the fetch-limited evolution of wind waves. Journal of Physical Oceanography, 33(6), pp.1274-1298.

Examples

In [1]: from rompy.swan.components.physics import WCAPPING_AB

In [2]: wcapping = WCAPPING_AB()

In [3]: print(wcapping.render())
WCAPPING AB

In [4]: wcapping = WCAPPING_AB(cds2=5.0e-5, br=1.75e-3, current=True, cds3=0.8)

In [5]: print(wcapping.render())
WCAPPING AB cds2=5e-05 br=0.00175 CURRENT cds3=0.8

Show JSON schema
{
   "title": "WCAPPING_AB",
   "description": "Whitecapping according to Alves and Banner (2003).\n\n.. code-block:: text\n\n    WCAPPING AB [cds2] [br] CURRENT [cds3]\n\nReferences\n----------\nAlves, J.H.G. and Banner, M.L., 2003. Performance of a saturation-based\ndissipation-rate source term in modeling the fetch-limited evolution of wind waves.\nJournal of Physical Oceanography, 33(6), pp.1274-1298.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import WCAPPING_AB\n    wcapping = WCAPPING_AB()\n    print(wcapping.render())\n    wcapping = WCAPPING_AB(cds2=5.0e-5, br=1.75e-3, current=True, cds3=0.8)\n    print(wcapping.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "ab",
         "description": "Model type discriminator",
         "enum": [
            "ab",
            "AB"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cds2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5)",
         "title": "Cds2"
      },
      "br": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Threshold saturation level\t(SWAN default: 1.75e-3)",
         "title": "Br"
      },
      "current": {
         "default": false,
         "description": "Indicates that enhanced current-induced dissipation as proposed by Van der Westhuysen (2012) is to be added",
         "title": "Current",
         "type": "boolean"
      },
      "cds3": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient (SWAN default: 0.8)",
         "title": "Cds3"
      }
   },
   "additionalProperties": false
}

Fields:
field br: float | None = None

Threshold saturation level (SWAN default: 1.75e-3)

field cds2: float | None = None

proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5)

field cds3: float | None = None

Proportionality coefficient (SWAN default: 0.8)

field current: bool = False

Indicates that enhanced current-induced dissipation as proposed by Van der Westhuysen (2012) is to be added

field model_type: Literal['ab', 'AB'] = 'ab'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.physics.WCAPPING_KOMEN[source]

Whitecapping according to Komen (1984).

WCAPPING KOMEN [cds2] [stpm] [powst] [delta] [powk]

Notes

The SWAN default for delta has been changed since version 40.91A. The setting delta = 1 will improve the prediction of the wave energy at low frequencies, and hence the mean wave period. The original default was delta = 0, which corresponds to WAM Cycle 3. See the Scientific/Technical documentation for further details.

References

Komen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully developed wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.

Examples

In [1]: from rompy.swan.components.physics import WCAPPING_KOMEN

In [2]: wcapping = WCAPPING_KOMEN()

In [3]: print(wcapping.render())
WCAPPING KOMEN

In [4]: wcapping = WCAPPING_KOMEN(cds2=2.36e-5, stpm=3.02e-3, powst=2, delta=1, powk=2)

In [5]: print(wcapping.render())
WCAPPING KOMEN cds2=2.36e-05 stpm=0.00302 powst=2.0 delta=1.0 powk=2.0

Show JSON schema
{
   "title": "WCAPPING_KOMEN",
   "description": "Whitecapping according to Komen (1984).\n\n.. code-block:: text\n\n    WCAPPING KOMEN [cds2] [stpm] [powst] [delta] [powk]\n\nNotes\n-----\nThe SWAN default for `delta` has been changed since version 40.91A. The setting\n`delta = 1` will improve the prediction of the wave energy at low frequencies, and\nhence the mean wave period. The original default was `delta = 0`, which corresponds\nto WAM Cycle 3. See the Scientific/Technical documentation for further details.\n\nReferences\n----------\nKomen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully\ndeveloped wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.physics import WCAPPING_KOMEN\n    wcapping = WCAPPING_KOMEN()\n    print(wcapping.render())\n    wcapping = WCAPPING_KOMEN(cds2=2.36e-5, stpm=3.02e-3, powst=2, delta=1, powk=2)\n    print(wcapping.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "komen",
         "description": "Model type discriminator",
         "enum": [
            "komen",
            "KOMEN"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cds2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient for determining the rate of whitecapping dissipation ($Cds$) (SWAN default: 2.36e-5)",
         "title": "Cds2"
      },
      "stpm": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value of the wave steepness for a Pierson-Moskowitz spectrum ($s^2_{PM}$) (SWAN default: 3.02e-3)",
         "title": "Stpm"
      },
      "powst": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Power of steepness normalized with the wave steepness of a Pierson-Moskowitz spectrum (SWAN default: 2)",
         "title": "Powst"
      },
      "delta": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient which determines the dependency of the whitecapping on wave number (SWAN default: 1)",
         "title": "Delta"
      },
      "powk": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "power of wave number normalized with the mean wave number (SWAN default: 1)",
         "title": "Powk"
      }
   },
   "additionalProperties": false
}

Fields:
field cds2: float | None = None

Coefficient for determining the rate of whitecapping dissipation ($Cds$) (SWAN default: 2.36e-5)

field delta: float | None = None

Coefficient which determines the dependency of the whitecapping on wave number (SWAN default: 1)

field model_type: Literal['komen', 'KOMEN'] = 'komen'

Model type discriminator

field powk: float | None = None

power of wave number normalized with the mean wave number (SWAN default: 1)

field powst: float | None = None

Power of steepness normalized with the wave steepness of a Pierson-Moskowitz spectrum (SWAN default: 2)

field stpm: float | None = None

Value of the wave steepness for a Pierson-Moskowitz spectrum ($s^2_{PM}$) (SWAN default: 3.02e-3)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

Numerics#

Model numerics components.

pydantic model rompy.swan.components.numerics.NUMERIC[source]

Numerical properties.

NUMeric ( STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter] ) &
    ( DIRimpl [cdd] ) ( SIGIMpl [css] [eps2] [outp] [niter] ) &
    ( CTheta [cfl] ) ( CSigma [cfl] ) ( SETUP [eps2] [outp] [niter] )

Examples

In [1]: from rompy.swan.components.numerics import NUMERIC

In [2]: numeric = NUMERIC()

In [3]: print(numeric.render())
NUMERIC

In [4]: numeric = NUMERIC(
   ...:     stop=dict(
   ...:         model_type="stopc",
   ...:         dabs=0.05,
   ...:         drel=0.01,
   ...:         curvat=0.05,
   ...:         npnts=99.5,
   ...:     ),
   ...:     dirimpl=dict(cdd=0.5),
   ...:     sigimpl=dict(css=0.5, eps2=1e-4, outp=0, niter=20),
   ...:     ctheta=dict(cfl=0.9),
   ...:     csigma=dict(cfl=0.9),
   ...:     setup=dict(eps2=1e-4, outp=0, niter=20),
   ...: )
   ...: 

In [5]: print(numeric.render())
NUMERIC STOPC dabs=0.05 drel=0.01 curvat=0.05 npnts=99.5 DIRIMPL cdd=0.5 SIGIMPL css=0.5 eps2=0.0001 outp=0 niter=20 CTHETA cfl=0.9

Show JSON schema
{
   "title": "NUMERIC",
   "description": "Numerical properties.\n\n.. code-block:: text\n\n    NUMeric ( STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter] ) &\n        ( DIRimpl [cdd] ) ( SIGIMpl [css] [eps2] [outp] [niter] ) &\n        ( CTheta [cfl] ) ( CSigma [cfl] ) ( SETUP [eps2] [outp] [niter] )\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.numerics import NUMERIC\n    numeric = NUMERIC()\n    print(numeric.render())\n    numeric = NUMERIC(\n        stop=dict(\n            model_type=\"stopc\",\n            dabs=0.05,\n            drel=0.01,\n            curvat=0.05,\n            npnts=99.5,\n        ),\n        dirimpl=dict(cdd=0.5),\n        sigimpl=dict(css=0.5, eps2=1e-4, outp=0, niter=20),\n        ctheta=dict(cfl=0.9),\n        csigma=dict(cfl=0.9),\n        setup=dict(eps2=1e-4, outp=0, niter=20),\n    )\n    print(numeric.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "numeric",
         "description": "Model type discriminator",
         "enum": [
            "numeric",
            "NUMERIC"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "stop": {
         "anyOf": [
            {
               "discriminator": {
                  "mapping": {
                     "ACCUR": "#/$defs/ACCUR",
                     "STOPC": "#/$defs/STOPC",
                     "accur": "#/$defs/ACCUR",
                     "stopc": "#/$defs/STOPC"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/STOPC"
                  },
                  {
                     "$ref": "#/$defs/ACCUR"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Iteration termination criteria",
         "title": "Stop"
      },
      "dirimpl": {
         "anyOf": [
            {
               "$ref": "#/$defs/DIRIMPL"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Numerical scheme for refraction"
      },
      "sigimpl": {
         "anyOf": [
            {
               "$ref": "#/$defs/SIGIMPL"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Frequency shifting accuracy"
      },
      "ctheta": {
         "anyOf": [
            {
               "$ref": "#/$defs/CTHETA"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Prevents excessive directional turning"
      },
      "csigma": {
         "anyOf": [
            {
               "$ref": "#/$defs/CSIGMA"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Prevents excessive frequency shifting"
      },
      "setup": {
         "anyOf": [
            {
               "$ref": "#/$defs/SETUP"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Stop criteria in the computation of wave setup"
      }
   },
   "$defs": {
      "ACCUR": {
         "additionalProperties": false,
         "description": "Stop the iterative procedure.\n\n.. code-block:: text\n\n    ACCUR [drel] [dhoval] [dtoval] [npnts] ->STAT|NONSTAT [limiter]\n\nWith this option the user can influence the criterion for terminating the iterative\nprocedure in the SWAN computations (both stationary and non-stationary modes).\nSWAN stops the iterations if (a), (b) and (c) are all satisfied:\n\na) The change in the local significant wave height Hs from one iteration to the\n   next is less than (1) fraction `drel` of that height or (2) fraction `dhoval`\n   of the average Hs over all grid points.\n\nb) The change in the local mean wave period Tm01 from one iteration to the next is\n   less than (1) fraction `drel` of that period or (2) fraction `dtoval` of the\n   average mean wave period over all wet grid points.\n\nc) Conditions (a) and (b) are fulfilled in more than fraction `npnts%` of all wet\n   grid points.\n\nNote\n----\nThis command has become obsolete in SWAN 41.01. The command STOPC should be used.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import ACCUR\n    accur = ACCUR()\n    print(accur.render())\n    accur = ACCUR(\n        drel=0.01,\n        dhoval=0.02,\n        dtoval=0.02,\n        npnts=98.0,\n        mode=dict(model_type=\"nonstat\", mxitns=1),\n        limiter=0.1,\n    )\n    print(accur.render())",
         "properties": {
            "model_type": {
               "default": "accur",
               "description": "Model type discriminator",
               "enum": [
                  "accur",
                  "ACCUR"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "drel": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum relative change in Hs or Tm01 from one iteration to the next (SWAN default: 0.02)",
               "title": "Drel"
            },
            "dhoval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Fraction of the average Hs over all wet grid points below which the the stopping criteria needs to be satisfied (SWAN default: 0.02)",
               "title": "Dhoval"
            },
            "dtoval": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Fraction of the average Tm01 over all wet grid points below which the the stopping criteria needs to be satisfied (SWAN default: 0.02)",
               "title": "Dtoval"
            },
            "npnts": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 98)",
               "title": "Npnts"
            },
            "mode": {
               "anyOf": [
                  {
                     "discriminator": {
                        "mapping": {
                           "NONSTAT": "#/$defs/NONSTAT",
                           "STAT": "#/$defs/STAT",
                           "nonstat": "#/$defs/NONSTAT",
                           "stat": "#/$defs/STAT"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/STAT"
                        },
                        {
                           "$ref": "#/$defs/NONSTAT"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Termination criteria for stationary or nonstationary runs",
               "title": "Mode"
            },
            "limiter": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)",
               "title": "Limiter"
            }
         },
         "title": "ACCUR",
         "type": "object"
      },
      "CSIGMA": {
         "additionalProperties": false,
         "description": "Prevents excessive directional turning.\n\n.. code-block:: text\n\n    CSigma [cfl]\n\nThis option prevents an excessive frequency shifting at a single grid point or\nvertex due to a very coarse bathymetry or current locally. This option limits the\nfrequency shifting rate csigma based on the CFL restriction. See also the final\nremark in Section 2.6.3. Note that if this command is not specified, then the\nlimiter is not activated.\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import CSIGMA\n    csigma = CSIGMA()\n    print(csigma.render())\n    csigma = CSIGMA(cfl=0.9)\n    print(csigma.render())",
         "properties": {
            "model_type": {
               "default": "ctheta",
               "description": "Model type discriminator",
               "enum": [
                  "ctheta",
                  "CTHETA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cfl": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Upper limit for the CFL restriction for csigma. A suggestion for this parameter is `cfl = 0.9` (SWAN default: 0.9 when CSIGMA is activated)",
               "title": "Cfl"
            }
         },
         "title": "CSIGMA",
         "type": "object"
      },
      "CTHETA": {
         "additionalProperties": false,
         "description": "Prevents excessive directional turning.\n\n.. code-block:: text\n\n    CTheta [cfl]\n\nThis option prevents an excessive directional turning at a single grid point or\nvertex due to a very coarse bathymetry or current locally. This option limits the\ndirectional turning rate c\u03b8 based on the CFL restriction. (See Eq. 3.41 of\nScientific/Technical documentation). See also the final remark in Section 2.6.3.\nNote that if this command is not specified, then the limiter is not activated.\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import CTHETA\n    ctheta = CTHETA()\n    print(ctheta.render())\n    ctheta = CTHETA(cfl=0.9)\n    print(ctheta.render())",
         "properties": {
            "model_type": {
               "default": "ctheta",
               "description": "Model type discriminator",
               "enum": [
                  "ctheta",
                  "CTHETA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cfl": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Upper limit for the CFL restriction for ctheta. A suggestion for this parameter is `cfl = 0.9` (SWAN default: 0.9 when CTHETA is activated)",
               "title": "Cfl"
            }
         },
         "title": "CTHETA",
         "type": "object"
      },
      "DIRIMPL": {
         "additionalProperties": false,
         "description": "Numerical scheme for refraction.\n\n.. code-block:: text\n\n    DIRIMPL [cdd]\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import DIRIMPL\n    dirimpl = DIRIMPL()\n    print(dirimpl.render())\n    dirimpl = DIRIMPL(cdd=0.5)\n    print(dirimpl.render())",
         "properties": {
            "model_type": {
               "default": "dirimpl",
               "description": "Model type discriminator",
               "enum": [
                  "dirimpl",
                  "DIRIMPL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "cdd": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A value of `cdd=0` corresponds to a central scheme and has the largest accuracy (diffusion \u2248 0) but the computation may more easily generatespurious fluctuations. A value of `cdd=1` corresponds to a first orderupwind scheme and it is more diffusive and therefore preferable if (strong) gradients in depth or current are present (SWAN default: 0.5)",
               "title": "Cdd"
            }
         },
         "title": "DIRIMPL",
         "type": "object"
      },
      "NONSTAT": {
         "additionalProperties": false,
         "description": "Computation parameters in nonstationary computation.",
         "properties": {
            "model_type": {
               "default": "nonstat",
               "description": "Model type discriminator",
               "enum": [
                  "nonstat",
                  "NONSTAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mxitns": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of iterations per time step for nonstationary computations. The computation moves to the next time step when this number is exceeded (SWAN default: `mxitns = 1`",
               "title": "Mxitns"
            }
         },
         "title": "NONSTAT",
         "type": "object"
      },
      "SETUP": {
         "additionalProperties": false,
         "description": "Stop criteria in the computation of wave setup.\n\n.. code-block:: text\n\n    SETUP [eps2] [outp] [niter]\n\nControls the stopping criterion and amount of output for the SOR solver in the\ncomputation of the wave-induced set-up.\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import SETUP\n    setup = SETUP()\n    print(setup.render())\n    setup = SETUP(eps2=1e-4, outp=0, niter=20)\n    print(setup.render())",
         "properties": {
            "model_type": {
               "default": "setup",
               "description": "Model type discriminator",
               "enum": [
                  "setup",
                  "SETUP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "eps2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Relative stopping criterion to terminate the linear solver (SIP or SOR). (SWAN default: 1.e-4 in case of SIP and 1.e-6 in case of SOR)",
               "title": "Eps2"
            },
            "outp": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output for the iterative solver:\n\n* 0 = no output\n* 1 = additional information about the iteration process is written to the PRINT file \n* 2 = gives a maximal amount of output concerning the iteration process \n* 3 = summary of the iteration process\n\n(SWAN default: 0)",
               "title": "Outp"
            },
            "niter": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of iterations for the linear solver (SWAN default: 20 in case of SIP and 1000 in case of SOR)",
               "title": "Niter"
            }
         },
         "title": "SETUP",
         "type": "object"
      },
      "SIGIMPL": {
         "additionalProperties": false,
         "description": "Frequency shifting accuracy.\n\n.. code-block:: text\n\n    SIGIMpl [cfl] [eps2] [outp] [niter]\n\nControls the accuracy of computing the frequency shifting and the stopping\ncriterion and amount of output for the SIP solver (used in the computations in the\npresence of currents or time varying depth)\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import SIGIMPL\n    sigimpl = SIGIMPL()\n    print(sigimpl.render())\n    sigimpl = SIGIMPL(css=0.5, eps2=1e-4, outp=0, niter=20)\n    print(sigimpl.render())",
         "properties": {
            "model_type": {
               "default": "sigimpl",
               "description": "Model type discriminator",
               "enum": [
                  "sigimpl",
                  "SIGIMPL"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "css": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "A value of `css=0` corresponds to a central scheme and has the largest accuracy (diffusion \u2248 0) but the computation may more easily generate spurious fluctuations. A value of `css=1` corresponds to a first order upwind scheme and it is more diffusive and therefore preferable if (strong) gradients in depth or current are present (SWAN default: 0.5)",
               "title": "Css"
            },
            "eps2": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Relative stopping criterion to terminate the linear solver (SIP or SOR). (SWAN default: 1.e-4 in case of SIP and 1.e-6 in case of SOR)",
               "title": "Eps2"
            },
            "outp": {
               "anyOf": [
                  {
                     "enum": [
                        0,
                        1,
                        2,
                        3
                     ],
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Output for the iterative solver:\n\n* 0 = no output\n* 1 = additional information about the iteration process is written to the PRINT file \n* 2 = gives a maximal amount of output concerning the iteration process\n* 3 = summary of the iteration process\n\n(SWAN default: 0)",
               "title": "Outp"
            },
            "niter": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum number of iterations for the linear solver (SWAN default: 20 in case of SIP and 1000 in case of SOR)",
               "title": "Niter"
            }
         },
         "title": "SIGIMPL",
         "type": "object"
      },
      "STAT": {
         "additionalProperties": false,
         "description": "Computation parameters in stationary computation.",
         "properties": {
            "model_type": {
               "default": "stat",
               "description": "Model type discriminator",
               "enum": [
                  "stat",
                  "STAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mxitst": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of iterations for stationary computations. The computation stops when this number is exceeded (SWAN default:  50)",
               "title": "Mxitst"
            },
            "alfa": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality constant used in the frequency-dependent under-relaxation technique. Based on experiences, a suggestion for this parameter is `alfa = 0.01`. In case of diffraction computations, the use of this parameter is recommended (SWAN default: 0.00)",
               "title": "Alfa"
            }
         },
         "title": "STAT",
         "type": "object"
      },
      "STOPC": {
         "additionalProperties": false,
         "description": "Stopping criteria of  Zijlema and Van der Westhuysen (2005).\n\n.. code-block:: text\n\n    STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter]\n\nWith this option the user can influence the criterion for terminating the iterative\nprocedure in the SWAN computations (both stationary and nonstationary). The\ncriterion makes use of the second derivative, or curvature, of the iteration curve\nof the significant wave height. As the solution of a simulation approaches full\nconvergence, the curvature of the iteration curve will tend to zero. SWAN stops the\nprocess if the relative change in Hs from one iteration to the next is less than\n`drel` and the curvature of the iteration curve of Hs normalized with Hs is less\nthan `curvat` or the absolute change in Hs from one iteration to the next is less\nthan `dabs`. Both conditions need to be fulfilled in more than fraction `npnts`\npercent of all wet grid points.\n\nWith respect to the QC modelling, another stopping criteria will be employed.\nNamely, SWAN stops the iteration process if the absolute change in Hs from one\niterate to another is less than `dabs` * Hinc, where Hinc is the representative\nincident wave height, or the relative change in Hs from one to the next iteration\nis less than `drel`. These criteria must be fulfilled in more than `npnts`\npercent of all active, well-defined points.\n\nReferences\n----------\n- Zijlema, M. and Van der Westhuysen, A. (2005). On convergence behaviour and\n  numerical accuracy in stationary SWAN simulations of nearshore wind wave spectra,\n  Coastal Engineering, 52(3), p. 337-256.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import STOPC\n    stop = STOPC()\n    print(stop.render())\n    stop = STOPC(\n        dabs=0.005,\n        drel=0.01,\n        curvat=0.005,\n        npnts=99.5,\n        mode=dict(model_type=\"nonstat\", mxitns=1),\n        limiter=0.1,\n    )\n    print(stop.render())",
         "properties": {
            "model_type": {
               "default": "stopc",
               "description": "Model type discriminator",
               "enum": [
                  "stopc",
                  "STOPC"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "dabs": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum absolute change in Hs from one iteration to the next (SWAN default: 0.005 [m] or 0.05 [-] in case of QC model)",
               "title": "Dabs"
            },
            "drel": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum relative change in Hs from one iteration to the next (SWAN default: 0.01 [-])",
               "title": "Drel"
            },
            "curvat": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Maximum curvature of the iteration curve of Hs normalised with Hs (SWAN default: 0.005 [-] (not used in the QC model))",
               "title": "Curvat"
            },
            "npnts": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 99.5 [-])",
               "title": "Npnts"
            },
            "mode": {
               "anyOf": [
                  {
                     "discriminator": {
                        "mapping": {
                           "NONSTAT": "#/$defs/NONSTAT",
                           "STAT": "#/$defs/STAT",
                           "nonstat": "#/$defs/NONSTAT",
                           "stat": "#/$defs/STAT"
                        },
                        "propertyName": "model_type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/STAT"
                        },
                        {
                           "$ref": "#/$defs/NONSTAT"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Termination criteria for stationary or nonstationary runs",
               "title": "Mode"
            },
            "limiter": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)",
               "title": "Limiter"
            }
         },
         "title": "STOPC",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field csigma: CSIGMA | None = None

Prevents excessive frequency shifting

field ctheta: CTHETA | None = None

Prevents excessive directional turning

field dirimpl: DIRIMPL | None = None

Numerical scheme for refraction

field model_type: Literal['numeric', 'NUMERIC'] = 'numeric'

Model type discriminator

field setup: SETUP | None = None

Stop criteria in the computation of wave setup

field sigimpl: SIGIMPL | None = None

Frequency shifting accuracy

field stop: STOPC | ACCUR | None = None

Iteration termination criteria

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

pydantic model rompy.swan.components.numerics.PROP[source]

Propagation scheme.

PROP BSTB|GSE

Notes

  • The scheme defaults to S&L and SORDUP for nonstationary and stationary simulations if not specified.

  • All schemes (BSBT, SORDUP and S&L) can be used in combination with curvilinear grids. With the higher order schemes (S&L and SORDUP) it is important to use a gradually varying grid otherwise there may be a severe loss of accuracy. If sharp transitions in the grid cannot be avoided it is safer to use the BSBT scheme.

  • In the computation with unstructured meshes, a lowest order upwind scheme will be employed. This scheme is very robust but rather diffusive. This may only be significant for the case when swell waves propagate over relative large distances (in the order of thousands of kilometers) within the model domain. However and most fortunately, in such a case this will alleviate the garden-sprinkler effect.

  • Alleviating the garden-sprinkler effect by adding some diffusion makes the SWAN computation conditionally stable. You can either use (i) a smaller time step, (ii) a lower value of waveage, (iii) better resolution in the directional space, or (iv) worse resolution in the geographic space, in order of preference, to make the model stable when necessary.

Examples

In [1]: from rompy.swan.components.numerics import PROP

In [2]: prop = PROP()

In [3]: print(prop.render())
PROP

In [4]: prop = PROP(scheme=dict(model_type="bsbt"))

In [5]: print(prop.render())
PROP BSBT

In [6]: prop = PROP(
   ...:     scheme=dict(
   ...:         model_type="gse",
   ...:         waveage=dict(delt="PT5H", dfmt="hr"),
   ...:     ),
   ...: )
   ...: 

In [7]: print(prop.render())
PROP GSE waveage=5.0 HR

Show JSON schema
{
   "title": "PROP",
   "description": "Propagation scheme.\n\n.. code-block:: text\n\n    PROP BSTB|GSE\n\nNotes\n-----\n* The scheme defaults to `S&L` and `SORDUP` for nonstationary and stationary\n  simulations if not specified.\n* All schemes (BSBT, SORDUP and S&L) can be used in combination with curvilinear\n  grids. With the higher order schemes (S&L and SORDUP) it is important to use a\n  gradually varying grid otherwise there may be a severe loss of accuracy. If sharp\n  transitions in the grid cannot be avoided it is safer to use the BSBT scheme.\n* In the computation with unstructured meshes, a lowest order upwind scheme will be\n  employed. This scheme is very robust but rather diffusive. This may only be\n  significant for the case when swell waves propagate over relative large distances\n  (in the order of thousands of kilometers) within the model domain. However and\n  most fortunately, in such a case this will alleviate the garden-sprinkler effect.\n* Alleviating the garden-sprinkler effect by adding some diffusion makes the SWAN\n  computation conditionally stable. You can either use (i) a smaller time step,\n  (ii) a lower value of `waveage`, (iii) better resolution in the directional\n  space, or (iv) worse resolution in the geographic space, in order of preference,\n  to make the model stable when necessary.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.numerics import PROP\n    prop = PROP()\n    print(prop.render())\n    prop = PROP(scheme=dict(model_type=\"bsbt\"))\n    print(prop.render())\n    prop = PROP(\n        scheme=dict(\n            model_type=\"gse\",\n            waveage=dict(delt=\"PT5H\", dfmt=\"hr\"),\n        ),\n    )\n    print(prop.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "prop",
         "description": "Model type discriminator",
         "enum": [
            "prop",
            "PROP"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "scheme": {
         "anyOf": [
            {
               "description": "Propagation scheme",
               "discriminator": {
                  "mapping": {
                     "BSBT": "#/$defs/BSBT",
                     "GSE": "#/$defs/GSE",
                     "bsbt": "#/$defs/BSBT",
                     "gse": "#/$defs/GSE"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/BSBT"
                  },
                  {
                     "$ref": "#/$defs/GSE"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Propagation scheme, by default S&L for nonstationary and SORDUP for stationary computation.",
         "title": "Scheme"
      }
   },
   "$defs": {
      "BSBT": {
         "additionalProperties": false,
         "description": "BSBT first order propagation scheme.\n\n.. code-block:: text\n\n    BSTB\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import BSBT\n    scheme = BSBT()\n    print(scheme.render())",
         "properties": {
            "model_type": {
               "default": "bsbt",
               "description": "Model type discriminator",
               "enum": [
                  "bsbt",
                  "BSBT"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "BSBT",
         "type": "object"
      },
      "Delt": {
         "additionalProperties": false,
         "description": "Time interval specification in SWAN.\n\n.. code-block:: text\n\n    [delt] SEC|MIN|HR|DAY\n\nNote\n----\nThe `tdelta` field can be specified as:\n\n* existing timedelta object\n* int or float, assumed as seconds\n* ISO 8601 duration string, following formats work:\n\n  * `[-][DD ][HH:MM]SS[.ffffff]`\n  * `[\u00b1]P[DD]DT[HH]H[MM]M[SS]S` (ISO 8601 format for timedelta)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import Delt\n    from datetime import timedelta\n    delt = Delt(delt=timedelta(minutes=30))\n    print(delt.render())\n    delt = Delt(delt=\"PT1H\", dfmt=\"hr\")\n    print(delt.render())",
         "properties": {
            "model_type": {
               "const": "delt",
               "default": "delt",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "delt": {
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            }
         },
         "required": [
            "delt"
         ],
         "title": "Delt",
         "type": "object"
      },
      "GSE": {
         "additionalProperties": false,
         "description": "Garden-sprinkler effect.\n\n.. code-block:: text\n\n    GSE [waveage] Sec|MIn|HR|DAy\n\nGarden-sprinkler effect is to be counteracted in the S&L propagation scheme\n(default for nonstationary regular grid computations) or in the propagation\nscheme for unstructured grids by adding a diffusion term to the basic equation.\nThis may affect the numerical stability of SWAN.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import GSE\n    scheme = GSE(waveage=dict(delt=86400, dfmt=\"day\"))\n    print(scheme.render())",
         "properties": {
            "model_type": {
               "default": "gse",
               "description": "Model type discriminator",
               "enum": [
                  "gse",
                  "GSE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "waveage": {
               "anyOf": [
                  {
                     "$ref": "#/$defs/Delt"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The time interval used to determine the diffusion which counteracts the so-called garden-sprinkler effect. The default value of `waveage` is zero, i.e. no added diffusion. The value of `waveage` should correspond to the travel time of the waves over the computational region."
            }
         },
         "title": "GSE",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['prop', 'PROP'] = 'prop'

Model type discriminator

field scheme: BSBT | GSE | None = None

Propagation scheme, by default S&L for nonstationary and SORDUP for stationary computation.

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render(cmd: str | list | None = None) str

Render the component to a string.

Parameters:

cmd (Optional[str | list]) – Command string or list of command strings to render, by default self.cmd().

Returns:

cdmstr – The rendered command file component.

Return type:

str

Swan subcomponents#

Base#

Base class for SWAN sub-components.

pydantic model rompy.swan.subcomponents.base.BaseSubComponent[source]

Base class for SWAN sub-components.

This class is not intended to be used directly, but to be subclassed by other SWAN sub-components to implement the following common behaviour:

  • Define a render() method to render a CMD string from the subcomponent

  • Forbid extra arguments so only implemented fields must be specified

Show JSON schema
{
   "title": "BaseSubComponent",
   "description": "Base class for SWAN sub-components.\n\nThis class is not intended to be used directly, but to be subclassed by other\nSWAN sub-components to implement the following common behaviour:\n\n* Define a `render()` method to render a CMD string from the subcomponent\n* Forbid extra arguments so only implemented fields must be specified",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "subcomponent",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "model_type"
   ]
}

Fields:
  • model_type (Literal['subcomponent'])

field model_type: Literal['subcomponent'] [Required]

Model type discriminator

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str[source]

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.base.IJ[source]

Points in grid indices coordinates.

< [x] [y] >

Note

Coordinates should be given in m when Cartesian coordinates are used or degrees when Spherical coordinates are used (see command COORD).

Examples

In [1]: from rompy.swan.subcomponents.base import IJ

In [2]: points = IJ(i=[0, 0, 5], j=[0, 19, 19])

In [3]: print(points.render())

i=0 j=0
i=0 j=19
i=5 j=19

Show JSON schema
{
   "title": "IJ",
   "description": "Points in grid indices coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import IJ\n    points = IJ(i=[0, 0, 5], j=[0, 19, 19])\n    print(points.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "ij",
         "description": "Model type discriminator",
         "enum": [
            "ij",
            "IJ"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "i": {
         "description": "i-index values",
         "items": {
            "type": "integer"
         },
         "title": "I",
         "type": "array"
      },
      "j": {
         "description": "j-index values",
         "items": {
            "type": "integer"
         },
         "title": "J",
         "type": "array"
      }
   },
   "additionalProperties": false,
   "required": [
      "i",
      "j"
   ]
}

Fields:
Validators:
field i: list[int] [Required]

i-index values

Validated by:
field j: list[int] [Required]

j-index values

Validated by:
field model_type: Literal['ij', 'IJ'] = 'ij'

Model type discriminator

Validated by:
cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

validator validate_size  »  all fields[source]
property size
pydantic model rompy.swan.subcomponents.base.XY[source]

Points in problem coordinates.

< [x] [y] >

Note

Coordinates should be given in m when Cartesian coordinates are used or degrees when Spherical coordinates are used (see command COORD).

Examples

In [1]: from rompy.swan.subcomponents.base import XY

In [2]: points = XY(
   ...:     x=[172, 172, 172, 172.5, 173],
   ...:     y=[-41, -40.5, -40, -40, -40],
   ...:     fmt="0.2f",
   ...: )
   ...: 

In [3]: print(points.render())

172.00 -41.00
172.00 -40.50
172.00 -40.00
172.50 -40.00
173.00 -40.00

Show JSON schema
{
   "title": "XY",
   "description": "Points in problem coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import XY\n    points = XY(\n        x=[172, 172, 172, 172.5, 173],\n        y=[-41, -40.5, -40, -40, -40],\n        fmt=\"0.2f\",\n    )\n    print(points.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "xy",
         "description": "Model type discriminator",
         "enum": [
            "xy",
            "XY"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "x": {
         "description": "Problem x-coordinate values",
         "items": {
            "type": "number"
         },
         "title": "X",
         "type": "array"
      },
      "y": {
         "description": "Problem y-coordinate values",
         "items": {
            "type": "number"
         },
         "title": "Y",
         "type": "array"
      },
      "fmt": {
         "default": "0.8f",
         "description": "The format to render floats values",
         "title": "Fmt",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "x",
      "y"
   ]
}

Fields:
Validators:
field fmt: str = '0.8f'

The format to render floats values

Validated by:
field model_type: Literal['xy', 'XY'] = 'xy'

Model type discriminator

Validated by:
field x: list[float] [Required]

Problem x-coordinate values

Validated by:
field y: list[float] [Required]

Problem y-coordinate values

Validated by:
cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

validator validate_size  »  all fields[source]
property size

Startup#

SWAN startup subcomponents.

pydantic model rompy.swan.subcomponents.startup.CARTESIAN[source]

Cartesian coordinates.

CARTESIAN

All locations and distances are in m. Coordinates are given with respect to x- and y-axes chosen by the user in the various commands.

Examples

In [1]: from rompy.swan.components.startup import CARTESIAN

In [2]: coords = CARTESIAN()

In [3]: print(coords.render())
CARTESIAN

Show JSON schema
{
   "title": "CARTESIAN",
   "description": "Cartesian coordinates.\n\n.. code-block:: text\n\n    CARTESIAN\n\nAll locations and distances are in m. Coordinates are given with respect\nto x- and y-axes chosen by the user in the various commands.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import CARTESIAN\n    coords = CARTESIAN()\n    print(coords.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "cartesian",
         "description": "Model type discriminator",
         "enum": [
            "cartesian",
            "CARTESIAN"
         ],
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['cartesian', 'CARTESIAN'] = 'cartesian'

Model type discriminator

cmd() str
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.startup.SPHERICAL[source]

Spherical coordinates.

SPHERICAL [->CCM|QC]

Notes

projection options:

  • CCM: central conformal Mercator. The horizontal and vertical scales are uniform in terms of cm/degree over the area shown. In the centre of the scale is identical to that of the conventional Mercator projection (but only at that centre). The area in the projection centre is therefore exactly conformal.

  • QC: the projection method is quasi-cartesian, i.e. the horizontal and vertical scales are equal to one another in terms of cm/degree.

All coordinates of locations and geographical grid sizes are given in degrees;`x` is longitude with x = 0 being the Greenwich meridian and x > 0 is East of this meridian; y is latitude with y > 0 being the Northern hemisphere. Input and output grids have to be oriented with their x-axis to the East; mesh sizes are in degrees. All other distances are in meters.

Note that spherical coordinates can also be used for relatively small areas, say 10 or 20 km horizontal dimension. This may be useful if one obtains the boundary conditions by nesting in an oceanic model which is naturally formulated in spherical coordinates. Note that in case of spherical coordinates regular grids must always be oriented E-W, N-S, i.e. alpc=0, alpinp=0, alpfr=0 (see commands CGRID, INPUT GRID and FRAME, respectively).

Examples

In [1]: from rompy.swan.components.startup import SPHERICAL

In [2]: coords = SPHERICAL()

In [3]: print(coords.render())
SPHERICAL CCM

In [4]: coords = SPHERICAL(projection="qc")

In [5]: print(coords.render())
SPHERICAL QC

Show JSON schema
{
   "title": "SPHERICAL",
   "description": "Spherical coordinates.\n\n.. code-block:: text\n\n    SPHERICAL [->CCM|QC]\n\nNotes\n-----\n\nprojection options:\n\n* CCM: central conformal Mercator. The horizontal and vertical scales are\n  uniform in terms of cm/degree over the area shown. In the centre of the scale\n  is identical to that of the conventional Mercator projection (but only at\n  that centre). The area in the projection centre is therefore exactly conformal.\n* QC: the projection method is quasi-cartesian, i.e. the horizontal and vertical\n  scales are equal to one another in terms of cm/degree.\n\nAll coordinates of locations and geographical grid sizes are given in degrees;`x`\nis longitude with `x = 0` being the Greenwich meridian and `x > 0` is East of this\nmeridian; `y` is latitude with `y > 0` being the Northern hemisphere. Input and\noutput grids have to be oriented with their x-axis to the East; mesh sizes are in\ndegrees. All other distances are in meters.\n\nNote that spherical coordinates can also be used for relatively small areas, say 10\nor 20 km horizontal dimension. This may be useful if one obtains the boundary\nconditions by nesting in an oceanic model which is naturally formulated in\nspherical coordinates. Note that in case of spherical coordinates regular grids\nmust always be oriented E-W, N-S, i.e. `alpc=0`, `alpinp=0`, `alpfr=0`\n(see commands CGRID, INPUT GRID and FRAME, respectively).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.startup import SPHERICAL\n    coords = SPHERICAL()\n    print(coords.render())\n    coords = SPHERICAL(projection=\"qc\")\n    print(coords.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "spherical",
         "description": "Model type discriminator",
         "enum": [
            "spherical",
            "SPHERICAL"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "projection": {
         "default": "ccm",
         "description": "Defines the projection method in case of spherical coordinates, `ccm` Central Conformal Mercator, `qc` means Quasi-cartesian",
         "enum": [
            "ccm",
            "qc"
         ],
         "title": "Projection",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['spherical', 'SPHERICAL'] = 'spherical'

Model type discriminator

field projection: Literal['ccm', 'qc'] = 'ccm'

Defines the projection method in case of spherical coordinates, ccm Central Conformal Mercator, qc means Quasi-cartesian

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

Spectrum#

Spectrum subcomponents.

pydantic model rompy.swan.subcomponents.spectrum.BIN[source]

Single frequency bin spectral shape.

BIN

Examples

In [1]: from rompy.swan.subcomponents.spectrum import BIN

In [2]: shape = BIN()

In [3]: print(shape.render())
BIN

Show JSON schema
{
   "title": "BIN",
   "description": "Single frequency bin spectral shape.\n\n.. code-block:: text\n\n    BIN\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import BIN\n    shape = BIN()\n    print(shape.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "bin",
         "description": "Model type discriminator",
         "enum": [
            "bin",
            "BIN"
         ],
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['bin', 'BIN'] = 'bin'

Model type discriminator

cmd() str
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.spectrum.GAUSS[source]

Gaussian spectral shape.

GAUSS [sigfr]

Examples

In [1]: from rompy.swan.subcomponents.spectrum import GAUSS

In [2]: shape = GAUSS(sigfr=0.02)

In [3]: print(shape.render())
GAUSS sigfr=0.02

Show JSON schema
{
   "title": "GAUSS",
   "description": "Gaussian spectral shape.\n\n.. code-block:: text\n\n    GAUSS [sigfr]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import GAUSS\n    shape = GAUSS(sigfr=0.02)\n    print(shape.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "gauss",
         "description": "Model type discriminator",
         "enum": [
            "gauss",
            "GAUSS"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "sigfr": {
         "description": "Width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.",
         "exclusiveMinimum": 0.0,
         "title": "Sigfr",
         "type": "number"
      }
   },
   "additionalProperties": false,
   "required": [
      "sigfr"
   ]
}

Fields:
field model_type: Literal['gauss', 'GAUSS'] = 'gauss'

Model type discriminator

field sigfr: float [Required]

Width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.

Constraints:
  • gt = 0.0

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.spectrum.JONSWAP[source]

Jonswap spectral shape.

JONSWAP [gamma]

Examples

In [1]: from rompy.swan.subcomponents.spectrum import JONSWAP

In [2]: shape = JONSWAP(gamma=3.3)

In [3]: print(shape.render())
JONSWAP gamma=3.3

Show JSON schema
{
   "title": "JONSWAP",
   "description": "Jonswap spectral shape.\n\n.. code-block:: text\n\n    JONSWAP [gamma]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import JONSWAP\n    shape = JONSWAP(gamma=3.3)\n    print(shape.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "jonswap",
         "description": "Model type discriminator",
         "enum": [
            "jonswap",
            "JONSWAP"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "gamma": {
         "default": 3.3,
         "description": "Peak enhancement parameter of the JONSWAP spectrum.",
         "exclusiveMinimum": 0.0,
         "title": "Gamma",
         "type": "number"
      }
   },
   "additionalProperties": false
}

Fields:
field gamma: float = 3.3

Peak enhancement parameter of the JONSWAP spectrum.

Constraints:
  • gt = 0.0

field model_type: Literal['jonswap', 'JONSWAP'] = 'jonswap'

Model type discriminator

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.spectrum.PM[source]

Pearson-Moskowitz spectral shape.

PM

Examples

In [1]: from rompy.swan.subcomponents.spectrum import PM

In [2]: shape = PM()

In [3]: print(shape.render())
PM

Show JSON schema
{
   "title": "PM",
   "description": "Pearson-Moskowitz spectral shape.\n\n.. code-block:: text\n\n    PM\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import PM\n    shape = PM()\n    print(shape.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "pm",
         "description": "Model type discriminator",
         "enum": [
            "pm",
            "PM"
         ],
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['pm', 'PM'] = 'pm'

Model type discriminator

cmd() str
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.spectrum.SHAPESPEC[source]

Spectral shape specification.

BOUND SHAPESPEC JONSWAP|PM|GAUSS|BIN|TMA PEAK|MEAN DSPR [POWER|DEGREES]

This command BOUND SHAPESPEC defines the shape of the spectra (both in frequency and direction) at the boundary of the computational grid in case of parametric spectral input.

Notes

While technically a component BOUND SHAPESPEC, this is only intended to be used as a subcomponent of the BOUNDSPEC component.

Examples

In [1]: from rompy.swan.subcomponents.spectrum import SHAPESPEC

In [2]: shapespec = SHAPESPEC()

In [3]: print(shapespec.render())
BOUND SHAPESPEC JONSWAP gamma=3.3 PEAK DSPR POWER

In [4]: shapespec = SHAPESPEC(
   ...:     shape=dict(model_type="tma", gamma=3.1, d=12),
   ...:     per_type="mean",
   ...:     dspr_type="degrees",
   ...: )
   ...: 

In [5]: print(shapespec.render())
BOUND SHAPESPEC TMA gamma=3.1 d=12.0 MEAN DSPR DEGREES

Show JSON schema
{
   "title": "SHAPESPEC",
   "description": "Spectral shape specification.\n\n.. code-block:: text\n\n    BOUND SHAPESPEC JONSWAP|PM|GAUSS|BIN|TMA PEAK|MEAN DSPR [POWER|DEGREES]\n\nThis command BOUND SHAPESPEC defines the shape of the spectra (both in frequency\nand direction) at the boundary of the computational grid in case of parametric\nspectral input.\n\nNotes\n-----\nWhile technically a component `BOUND SHAPESPEC`, this is only intended to be used\nas a subcomponent of the `BOUNDSPEC` component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SHAPESPEC\n    shapespec = SHAPESPEC()\n    print(shapespec.render())\n    shapespec = SHAPESPEC(\n        shape=dict(model_type=\"tma\", gamma=3.1, d=12),\n        per_type=\"mean\",\n        dspr_type=\"degrees\",\n    )\n    print(shapespec.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "shapespec",
         "description": "Model type discriminator",
         "enum": [
            "shapespec",
            "SHAPESPEC"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "shape": {
         "anyOf": [
            {
               "$ref": "#/$defs/JONSWAP"
            },
            {
               "$ref": "#/$defs/PM"
            },
            {
               "$ref": "#/$defs/GAUSS"
            },
            {
               "$ref": "#/$defs/BIN"
            },
            {
               "$ref": "#/$defs/TMA"
            }
         ],
         "description": "The spectral shape",
         "title": "Shape"
      },
      "per_type": {
         "default": "peak",
         "description": "The type of characteristic wave period",
         "enum": [
            "peak",
            "mean"
         ],
         "title": "Per Type",
         "type": "string"
      },
      "dspr_type": {
         "default": "power",
         "description": "The type of directional spreading",
         "enum": [
            "power",
            "degrees"
         ],
         "title": "Dspr Type",
         "type": "string"
      }
   },
   "$defs": {
      "BIN": {
         "additionalProperties": false,
         "description": "Single frequency bin spectral shape.\n\n.. code-block:: text\n\n    BIN\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import BIN\n    shape = BIN()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "bin",
               "description": "Model type discriminator",
               "enum": [
                  "bin",
                  "BIN"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "BIN",
         "type": "object"
      },
      "GAUSS": {
         "additionalProperties": false,
         "description": "Gaussian spectral shape.\n\n.. code-block:: text\n\n    GAUSS [sigfr]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import GAUSS\n    shape = GAUSS(sigfr=0.02)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "gauss",
               "description": "Model type discriminator",
               "enum": [
                  "gauss",
                  "GAUSS"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sigfr": {
               "description": "Width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.",
               "exclusiveMinimum": 0.0,
               "title": "Sigfr",
               "type": "number"
            }
         },
         "required": [
            "sigfr"
         ],
         "title": "GAUSS",
         "type": "object"
      },
      "JONSWAP": {
         "additionalProperties": false,
         "description": "Jonswap spectral shape.\n\n.. code-block:: text\n\n    JONSWAP [gamma]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import JONSWAP\n    shape = JONSWAP(gamma=3.3)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "jonswap",
               "description": "Model type discriminator",
               "enum": [
                  "jonswap",
                  "JONSWAP"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            }
         },
         "title": "JONSWAP",
         "type": "object"
      },
      "PM": {
         "additionalProperties": false,
         "description": "Pearson-Moskowitz spectral shape.\n\n.. code-block:: text\n\n    PM\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import PM\n    shape = PM()\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "pm",
               "description": "Model type discriminator",
               "enum": [
                  "pm",
                  "PM"
               ],
               "title": "Model Type",
               "type": "string"
            }
         },
         "title": "PM",
         "type": "object"
      },
      "TMA": {
         "additionalProperties": false,
         "description": "TMA spectral shape.\n\n.. code-block:: text\n\n    TMA [gamma] [d]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import TMA\n    shape = TMA(gamma=2.0, d=18)\n    print(shape.render())",
         "properties": {
            "model_type": {
               "default": "tma",
               "description": "Model type discriminator",
               "enum": [
                  "tma",
                  "TMA"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "gamma": {
               "default": 3.3,
               "description": "Peak enhancement parameter of the JONSWAP spectrum.",
               "exclusiveMinimum": 0.0,
               "title": "Gamma",
               "type": "number"
            },
            "d": {
               "description": "The reference depth at the wave maker in meters.",
               "exclusiveMinimum": 0.0,
               "title": "D",
               "type": "number"
            }
         },
         "required": [
            "d"
         ],
         "title": "TMA",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field dspr_type: Literal['power', 'degrees'] = 'power'

The type of directional spreading

field model_type: Literal['shapespec', 'SHAPESPEC'] = 'shapespec'

Model type discriminator

field per_type: Literal['peak', 'mean'] = 'peak'

The type of characteristic wave period

field shape: JONSWAP | PM | GAUSS | BIN | TMA [Optional]

The spectral shape

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.spectrum.SPECTRUM[source]

SWAN spectrum specification.

->CIRCLE|SECTOR ([dir1] [dir2]) [mdc] [flow] [fhigh] [msc]

Notes

Directions in the spectra are defined either as a CIRCLE or as a SECTOR. In the case of a SECTOR, both dir1 and dir2 must be specified. In the case of a CIRCLE, neither dir1 nor dir2 should be specified.

At least two of flow, fhigh and msc must be specified in which case the third parameter will be calculated by SWAN such that the frequency resolution df/f = 0.1 (10% increments).

Examples

In [1]: from rompy.swan.subcomponents.spectrum import SPECTRUM

In [2]: spec = SPECTRUM(mdc=36, flow=0.04, fhigh=1.0)

In [3]: print(spec.render())
CIRCLE mdc=36 flow=0.04 fhigh=1.0

In [4]: spec = SPECTRUM(mdc=36, dir1=0, dir2=180, flow=0.04, msc=31)

In [5]: print(spec.render())
SECTOR 0.0 180.0 mdc=36 flow=0.04 msc=31

Show JSON schema
{
   "title": "SPECTRUM",
   "description": "SWAN spectrum specification.\n\n.. code-block:: text\n\n    ->CIRCLE|SECTOR ([dir1] [dir2]) [mdc] [flow] [fhigh] [msc]\n\nNotes\n-----\n\nDirections in the spectra are defined either as a CIRCLE or as a SECTOR. In the\ncase of a SECTOR, both `dir1` and `dir2` must be specified. In the case of a\nCIRCLE, neither `dir1` nor `dir2` should be specified.\n\nAt least two of `flow`, `fhigh` and `msc` must be specified in which case the\nthird parameter will be calculated by SWAN such that the frequency resolution\n`df/f = 0.1` (10% increments).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import SPECTRUM\n    spec = SPECTRUM(mdc=36, flow=0.04, fhigh=1.0)\n    print(spec.render())\n    spec = SPECTRUM(mdc=36, dir1=0, dir2=180, flow=0.04, msc=31)\n    print(spec.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "spectrum",
         "description": "Model type discriminator",
         "enum": [
            "spectrum",
            "SPECTRUM"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "mdc": {
         "description": "Number of meshes in theta-space. In the case of CIRCLE, this is the number of subdivisions of the 360 degrees of a circle so `dtheta = [360]/[mdc]` is the spectral directional resolution. In the case of SECTOR, `dtheta = ([dir2] - [dir1])/[mdc]`. The minimum number of directional bins is 3 per directional quadrant.",
         "title": "Mdc",
         "type": "integer"
      },
      "flow": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Lowest discrete frequency that is used in the calculation (in Hz).",
         "title": "Flow"
      },
      "fhigh": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Highest discrete frequency that is used in the calculation (in Hz).",
         "title": "Fhigh"
      },
      "msc": {
         "anyOf": [
            {
               "minimum": 3,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "One less than the number of frequencies. This defines the grid resolution in frequency-space between the lowest discrete frequency `flow` and the highest discrete frequency `fhigh`. This resolution is not constant, since the frequencies are distributed logarithmical: `fi+1 = yfi` where `y` is a constant. The minimum number of frequencies is 4",
         "title": "Msc"
      },
      "dir1": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The direction of the right-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
         "title": "Dir1"
      },
      "dir2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The direction of the left-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.",
         "title": "Dir2"
      }
   },
   "additionalProperties": false,
   "required": [
      "mdc"
   ]
}

Fields:
Validators:
field dir1: float | None = None

The direction of the right-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.

Validated by:
field dir2: float | None = None

The direction of the left-hand boundary of the sector when looking outward from the sector (required for option SECTOR) in degrees.

Validated by:
field fhigh: float | None = None

Highest discrete frequency that is used in the calculation (in Hz).

Validated by:
field flow: float | None = None

Lowest discrete frequency that is used in the calculation (in Hz).

Validated by:
field mdc: int [Required]

Number of meshes in theta-space. In the case of CIRCLE, this is the number of subdivisions of the 360 degrees of a circle so dtheta = [360]/[mdc] is the spectral directional resolution. In the case of SECTOR, dtheta = ([dir2] - [dir1])/[mdc]. The minimum number of directional bins is 3 per directional quadrant.

Validated by:
field model_type: Literal['spectrum', 'SPECTRUM'] = 'spectrum'

Model type discriminator

Validated by:
field msc: int | None = None

One less than the number of frequencies. This defines the grid resolution in frequency-space between the lowest discrete frequency flow and the highest discrete frequency fhigh. This resolution is not constant, since the frequencies are distributed logarithmical: fi+1 = yfi where y is a constant. The minimum number of frequencies is 4

Constraints:
  • ge = 3

Validated by:
validator check_direction_definition  »  all fields[source]

Check that dir1 and dir2 are specified together.

validator check_frequency_definition  »  all fields[source]

Check spectral frequencies are prescribed correctly.

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property dir_sector
pydantic model rompy.swan.subcomponents.spectrum.TMA[source]

TMA spectral shape.

TMA [gamma] [d]

Examples

In [1]: from rompy.swan.subcomponents.spectrum import TMA

In [2]: shape = TMA(gamma=2.0, d=18)

In [3]: print(shape.render())
TMA gamma=2.0 d=18.0

Show JSON schema
{
   "title": "TMA",
   "description": "TMA spectral shape.\n\n.. code-block:: text\n\n    TMA [gamma] [d]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.spectrum import TMA\n    shape = TMA(gamma=2.0, d=18)\n    print(shape.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "tma",
         "description": "Model type discriminator",
         "enum": [
            "tma",
            "TMA"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "gamma": {
         "default": 3.3,
         "description": "Peak enhancement parameter of the JONSWAP spectrum.",
         "exclusiveMinimum": 0.0,
         "title": "Gamma",
         "type": "number"
      },
      "d": {
         "description": "The reference depth at the wave maker in meters.",
         "exclusiveMinimum": 0.0,
         "title": "D",
         "type": "number"
      }
   },
   "additionalProperties": false,
   "required": [
      "d"
   ]
}

Fields:
field d: float [Required]

The reference depth at the wave maker in meters.

Constraints:
  • gt = 0.0

field gamma: float = 3.3

Peak enhancement parameter of the JONSWAP spectrum.

Constraints:
  • gt = 0.0

field model_type: Literal['tma', 'TMA'] = 'tma'

Model type discriminator

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

Time#

Time subcomponents.

pydantic model rompy.swan.subcomponents.time.Delt[source]

Time interval specification in SWAN.

[delt] SEC|MIN|HR|DAY

Note

The tdelta field can be specified as:

  • existing timedelta object

  • int or float, assumed as seconds

  • ISO 8601 duration string, following formats work:

    • [-][DD ][HH:MM]SS[.ffffff]

    • [±]P[DD]DT[HH]H[MM]M[SS]S (ISO 8601 format for timedelta)

Examples

In [1]: from rompy.swan.subcomponents.time import Delt

In [2]: from datetime import timedelta

In [3]: delt = Delt(delt=timedelta(minutes=30))

In [4]: print(delt.render())
1800.0 SEC

In [5]: delt = Delt(delt="PT1H", dfmt="hr")

In [6]: print(delt.render())
1.0 HR

Show JSON schema
{
   "title": "Delt",
   "description": "Time interval specification in SWAN.\n\n.. code-block:: text\n\n    [delt] SEC|MIN|HR|DAY\n\nNote\n----\nThe `tdelta` field can be specified as:\n\n* existing timedelta object\n* int or float, assumed as seconds\n* ISO 8601 duration string, following formats work:\n\n  * `[-][DD ][HH:MM]SS[.ffffff]`\n  * `[\u00b1]P[DD]DT[HH]H[MM]M[SS]S` (ISO 8601 format for timedelta)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import Delt\n    from datetime import timedelta\n    delt = Delt(delt=timedelta(minutes=30))\n    print(delt.render())\n    delt = Delt(delt=\"PT1H\", dfmt=\"hr\")\n    print(delt.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "delt",
         "default": "delt",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "delt": {
         "description": "Time interval",
         "format": "duration",
         "title": "Delt",
         "type": "string"
      },
      "dfmt": {
         "default": "sec",
         "description": "Format to render time interval specification",
         "enum": [
            "sec",
            "min",
            "hr",
            "day"
         ],
         "title": "Dfmt",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "delt"
   ]
}

Fields:
field delt: timedelta [Required]

Time interval

field dfmt: Literal['sec', 'min', 'hr', 'day'] = 'sec'

Format to render time interval specification

field model_type: Literal['delt'] = 'delt'

Model type discriminator

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property delt_float
pydantic model rompy.swan.subcomponents.time.NONSTATIONARY[source]

Nonstationary time specification.

NONSTATIONARY [tbeg] [delt] SEC|MIN|HR|DAY [tend]

Note

Default values for the time specification fields are provided for the case where the user wants to set times dynamically after instantiating this subcomponent.

Examples

In [1]: from rompy.swan.subcomponents.time import NONSTATIONARY

In [2]: nonstat = NONSTATIONARY(
   ...:     tbeg="2012-01-01T00:00:00",
   ...:     tend="2012-02-01T00:00:00",
   ...:     delt="PT1H",
   ...:     dfmt="hr",
   ...: )
   ...: 

In [3]: print(nonstat.render())
NONSTATIONARY tbeg=20120101.000000 delt=1.0 HR tend=20120201.000000

In [4]: from datetime import datetime, timedelta

In [5]: nonstat = NONSTATIONARY(
   ...:     tbeg=datetime(1990, 1, 1),
   ...:     tend=datetime(1990, 1, 7),
   ...:     delt=timedelta(minutes=30),
   ...:     tfmt=1,
   ...:     dfmt="min",
   ...:     suffix="tbl",
   ...: )
   ...: 

In [6]: print(nonstat.render())
NONSTATIONARY tbegtbl=19900101.000000 delttbl=30.0 MIN tendtbl=19900107.000000

Show JSON schema
{
   "title": "NONSTATIONARY",
   "description": "Nonstationary time specification.\n\n.. code-block:: text\n\n    NONSTATIONARY [tbeg] [delt] SEC|MIN|HR|DAY [tend]\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import NONSTATIONARY\n    nonstat = NONSTATIONARY(\n        tbeg=\"2012-01-01T00:00:00\",\n        tend=\"2012-02-01T00:00:00\",\n        delt=\"PT1H\",\n        dfmt=\"hr\",\n    )\n    print(nonstat.render())\n    from datetime import datetime, timedelta\n    nonstat = NONSTATIONARY(\n        tbeg=datetime(1990, 1, 1),\n        tend=datetime(1990, 1, 7),\n        delt=timedelta(minutes=30),\n        tfmt=1,\n        dfmt=\"min\",\n        suffix=\"tbl\",\n    )\n    print(nonstat.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "nonstationary",
         "description": "Model type discriminator",
         "enum": [
            "nonstationary",
            "NONSTATIONARY"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "tbeg": {
         "default": "1970-01-01T00:00:00",
         "description": "Start time",
         "format": "date-time",
         "title": "Tbeg",
         "type": "string"
      },
      "delt": {
         "default": "PT1H",
         "description": "Time interval",
         "format": "duration",
         "title": "Delt",
         "type": "string"
      },
      "tfmt": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6
               ],
               "type": "integer"
            },
            {
               "type": "string"
            }
         ],
         "default": 1,
         "description": "Format to render time specification",
         "title": "Tfmt"
      },
      "dfmt": {
         "default": "sec",
         "description": "Format to render time interval specification",
         "enum": [
            "sec",
            "min",
            "hr",
            "day"
         ],
         "title": "Dfmt",
         "type": "string"
      },
      "suffix": {
         "default": "",
         "description": "Suffix to prepend to argument names when rendering",
         "title": "Suffix",
         "type": "string"
      },
      "tend": {
         "default": "1970-01-02T00:00:00",
         "description": "End time",
         "format": "date-time",
         "title": "Tend",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field delt: timedelta = datetime.timedelta(seconds=3600)

Time interval

field dfmt: Literal['sec', 'min', 'hr', 'day'] = 'sec'

Format to render time interval specification

field model_type: Literal['nonstationary', 'NONSTATIONARY'] = 'nonstationary'

Model type discriminator

field suffix: str = ''

Suffix to prepend to argument names when rendering

field tbeg: datetime = datetime.datetime(1970, 1, 1, 0, 0)

Start time

field tend: datetime = datetime.datetime(1970, 1, 2, 0, 0)

End time

field tfmt: Literal[1, 2, 3, 4, 5, 6] | str = 1

Format to render time specification

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.time.STATIONARY[source]

Stationary time specification.

STATIONARY [time]

Note

The field time is optional to allow for the case where the user wants to set the time dynamically after instantiating this component.

Examples

In [1]: from rompy.swan.subcomponents.time import STATIONARY

In [2]: stat = STATIONARY(time="2012-01-01T00:00:00")

In [3]: print(stat.render())
STATIONARY time=20120101.000000

Show JSON schema
{
   "title": "STATIONARY",
   "description": "Stationary time specification.\n\n.. code-block:: text\n\n    STATIONARY [time]\n\nNote\n----\nThe field `time` is optional to allow for the case where the user wants to set the\ntime dynamically after instantiating this component.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import STATIONARY\n    stat = STATIONARY(time=\"2012-01-01T00:00:00\")\n    print(stat.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "stationary",
         "description": "Model type discriminator",
         "enum": [
            "stationary",
            "STATIONARY"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "time": {
         "default": "1970-01-01T00:00:00",
         "description": "Stationary time",
         "format": "date-time",
         "title": "Time",
         "type": "string"
      },
      "tfmt": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6
               ],
               "type": "integer"
            },
            {
               "type": "string"
            }
         ],
         "default": 1,
         "description": "Format to render time specification",
         "title": "Tfmt"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['stationary', 'STATIONARY'] = 'stationary'

Model type discriminator

field tfmt: Literal[1, 2, 3, 4, 5, 6] | str = 1

Format to render time specification

field time: datetime = datetime.datetime(1970, 1, 1, 0, 0)

Stationary time

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.time.Time[source]

Time specification in SWAN.

[time]

Time is rendered in one of the following formats:

  • 1: ISO-notation 19870530.153000

  • 2: (as in HP compiler) ‘30-May-87 15:30:00’

  • 3: (as in Lahey compiler) 05/30/87.15:30:00

  • 4: 15:30:00

  • 5: 87/05/30 15:30:00’

  • 6: as in WAM 8705301530

Note

The time field can be specified as:

  • existing datetime object

  • int or float, assumed as Unix time, i.e. seconds (if >= -2e10 or <= 2e10) or milliseconds (if < -2e10 or > 2e10) since 1 January 1970.

  • ISO 8601 time string.

Examples

In [1]: from rompy.swan.subcomponents.time import Time

In [2]: from datetime import datetime

In [3]: time = Time(time=datetime(1990, 1, 1))

In [4]: print(time.render())
19900101.000000

In [5]: time = Time(time="2012-01-01T00:00:00", tfmt=2)

In [6]: print(time.render())
'01-Jan-12 00:00:00'

Show JSON schema
{
   "title": "Time",
   "description": "Time specification in SWAN.\n\n.. code-block:: text\n\n    [time]\n\nTime is rendered in one of the following formats:\n\n* 1: ISO-notation 19870530.153000\n* 2: (as in HP compiler) '30-May-87 15:30:00'\n* 3: (as in Lahey compiler) 05/30/87.15:30:00\n* 4: 15:30:00\n* 5: 87/05/30 15:30:00'\n* 6: as in WAM 8705301530\n\nNote\n----\nThe `time` field can be specified as:\n\n* existing datetime object\n* int or float, assumed as Unix time, i.e. seconds (if >= -2e10 or <= 2e10) or\n  milliseconds (if < -2e10 or > 2e10) since 1 January 1970.\n* ISO 8601 time string.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import Time\n    from datetime import datetime\n    time = Time(time=datetime(1990, 1, 1))\n    print(time.render())\n    time = Time(time=\"2012-01-01T00:00:00\", tfmt=2)\n    print(time.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "time",
         "description": "Model type discriminator",
         "enum": [
            "time",
            "Time",
            "TIME"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "time": {
         "description": "Datetime specification",
         "format": "date-time",
         "title": "Time",
         "type": "string"
      },
      "tfmt": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6
               ],
               "type": "integer"
            },
            {
               "type": "string"
            }
         ],
         "default": 1,
         "description": "Format to render time specification",
         "title": "Tfmt"
      }
   },
   "additionalProperties": false,
   "required": [
      "time"
   ]
}

Fields:
Validators:
field model_type: Literal['time', 'Time', 'TIME'] = 'time'

Model type discriminator

field tfmt: Literal[1, 2, 3, 4, 5, 6] | str = 1

Format to render time specification

Validated by:
field time: datetime [Required]

Datetime specification

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

validator set_time_format  »  tfmt[source]

Set the time format to render.

pydantic model rompy.swan.subcomponents.time.TimeRangeClosed[source]

Regular times with a closed boundary.

[tbeg] [delt] SEC|MIN|HR|DAY [tend]

Note

Default values for the time specification fields are provided for the case where the user wants to set times dynamically after instantiating this subcomponent.

Examples

In [1]: from rompy.swan.subcomponents.time import TimeRangeClosed

In [2]: from datetime import datetime, timedelta

In [3]: times = TimeRangeClosed(
   ...:     tbeg=datetime(1990, 1, 1),
   ...:     tend=datetime(1990, 1, 7),
   ...:     delt=timedelta(minutes=30),
   ...:     dfmt="min",
   ...: )
   ...: 

In [4]: print(times.render())
tbeg=19900101.000000 delt=30.0 MIN tend=19900107.000000

In [5]: times = TimeRangeClosed(
   ...:     tbeg="2012-01-01T00:00:00",
   ...:     tend="2012-02-01T00:00:00",
   ...:     delt="PT1H",
   ...:     tfmt=2,
   ...:     dfmt="hr",
   ...:     suffix="blk",
   ...: )
   ...: 

In [6]: print(times.render())
tbegblk='01-Jan-12 00:00:00' deltblk=1.0 HR tendblk='01-Feb-12 00:00:00'

Show JSON schema
{
   "title": "TimeRangeClosed",
   "description": "Regular times with a closed boundary.\n\n.. code-block:: text\n\n    [tbeg] [delt] SEC|MIN|HR|DAY [tend]\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import TimeRangeClosed\n    from datetime import datetime, timedelta\n    times = TimeRangeClosed(\n        tbeg=datetime(1990, 1, 1),\n        tend=datetime(1990, 1, 7),\n        delt=timedelta(minutes=30),\n        dfmt=\"min\",\n    )\n    print(times.render())\n    times = TimeRangeClosed(\n        tbeg=\"2012-01-01T00:00:00\",\n        tend=\"2012-02-01T00:00:00\",\n        delt=\"PT1H\",\n        tfmt=2,\n        dfmt=\"hr\",\n        suffix=\"blk\",\n    )\n    print(times.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "closed",
         "description": "Model type discriminator",
         "enum": [
            "closed",
            "CLOSED"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "tbeg": {
         "default": "1970-01-01T00:00:00",
         "description": "Start time",
         "format": "date-time",
         "title": "Tbeg",
         "type": "string"
      },
      "delt": {
         "default": "PT1H",
         "description": "Time interval",
         "format": "duration",
         "title": "Delt",
         "type": "string"
      },
      "tfmt": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6
               ],
               "type": "integer"
            },
            {
               "type": "string"
            }
         ],
         "default": 1,
         "description": "Format to render time specification",
         "title": "Tfmt"
      },
      "dfmt": {
         "default": "sec",
         "description": "Format to render time interval specification",
         "enum": [
            "sec",
            "min",
            "hr",
            "day"
         ],
         "title": "Dfmt",
         "type": "string"
      },
      "suffix": {
         "default": "",
         "description": "Suffix to prepend to argument names when rendering",
         "title": "Suffix",
         "type": "string"
      },
      "tend": {
         "default": "1970-01-02T00:00:00",
         "description": "End time",
         "format": "date-time",
         "title": "Tend",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field delt: timedelta = datetime.timedelta(seconds=3600)

Time interval

field dfmt: Literal['sec', 'min', 'hr', 'day'] = 'sec'

Format to render time interval specification

field model_type: Literal['closed', 'CLOSED'] = 'closed'

Model type discriminator

field suffix: str = ''

Suffix to prepend to argument names when rendering

field tbeg: datetime = datetime.datetime(1970, 1, 1, 0, 0)

Start time

field tend: datetime = datetime.datetime(1970, 1, 2, 0, 0)

End time

field tfmt: Literal[1, 2, 3, 4, 5, 6] | str = 1

Format to render time specification

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.time.TimeRangeOpen[source]

Regular times with an open boundary.

[tbeg] [delt] SEC|MIN|HR|DAY

Time is rendered in one of the following formats:

  • 1: ISO-notation 19870530.153000

  • 2: (as in HP compiler) ‘30-May-87 15:30:00’

  • 3: (as in Lahey compiler) 05/30/87.15:30:00

  • 4: 15:30:00

  • 5: 87/05/30 15:30:00’

  • 6: as in WAM 8705301530

Note

The tbeg field can be specified as:

  • existing datetime object

  • int or float, assumed as Unix time, i.e. seconds (if >= -2e10 or <= 2e10) or milliseconds (if < -2e10 or > 2e10) since 1 January 1970.

  • ISO 8601 time string.

Note

The tdelta field can be specified as:

  • existing timedelta object

  • int or float, assumed as seconds

  • ISO 8601 duration string, following formats work:

    • [-][DD ][HH:MM]SS[.ffffff]

    • [±]P[DD]DT[HH]H[MM]M[SS]S (ISO 8601 format for timedelta)

Note

Default values for the time specification fields are provided for the case where the user wants to set times dynamically after instantiating this subcomponent.

Examples

In [1]: from rompy.swan.subcomponents.time import TimeRangeOpen

In [2]: from datetime import datetime, timedelta

In [3]: times = TimeRangeOpen(
   ...:     tbeg=datetime(1990, 1, 1), delt=timedelta(minutes=30), dfmt="min"
   ...: )
   ...: 

In [4]: print(times.render())
tbeg=19900101.000000 delt=30.0 MIN

In [5]: times = TimeRangeOpen(
   ...:     tbeg="2012-01-01T00:00:00", delt="PT1H", tfmt=2, dfmt="hr", suffix="blk"
   ...: )
   ...: 

In [6]: print(times.render())
tbegblk='01-Jan-12 00:00:00' deltblk=1.0 HR

Show JSON schema
{
   "title": "TimeRangeOpen",
   "description": "Regular times with an open boundary.\n\n.. code-block:: text\n\n    [tbeg] [delt] SEC|MIN|HR|DAY\n\nTime is rendered in one of the following formats:\n\n* 1: ISO-notation 19870530.153000\n* 2: (as in HP compiler) '30-May-87 15:30:00'\n* 3: (as in Lahey compiler) 05/30/87.15:30:00\n* 4: 15:30:00\n* 5: 87/05/30 15:30:00'\n* 6: as in WAM 8705301530\n\nNote\n----\nThe `tbeg` field can be specified as:\n\n* existing datetime object\n* int or float, assumed as Unix time, i.e. seconds (if >= -2e10 or <= 2e10) or\n  milliseconds (if < -2e10 or > 2e10) since 1 January 1970.\n* ISO 8601 time string.\n\nNote\n----\nThe `tdelta` field can be specified as:\n\n* existing timedelta object\n* int or float, assumed as seconds\n* ISO 8601 duration string, following formats work:\n\n    * `[-][DD ][HH:MM]SS[.ffffff]`\n    * `[\u00b1]P[DD]DT[HH]H[MM]M[SS]S` (ISO 8601 format for timedelta)\n\nNote\n----\nDefault values for the time specification fields are provided for the case where\nthe user wants to set times dynamically after instantiating this subcomponent.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import TimeRangeOpen\n    from datetime import datetime, timedelta\n    times = TimeRangeOpen(\n        tbeg=datetime(1990, 1, 1), delt=timedelta(minutes=30), dfmt=\"min\"\n    )\n    print(times.render())\n    times = TimeRangeOpen(\n        tbeg=\"2012-01-01T00:00:00\", delt=\"PT1H\", tfmt=2, dfmt=\"hr\", suffix=\"blk\"\n    )\n    print(times.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "open",
         "description": "Model type discriminator",
         "enum": [
            "open",
            "OPEN"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "tbeg": {
         "default": "1970-01-01T00:00:00",
         "description": "Start time",
         "format": "date-time",
         "title": "Tbeg",
         "type": "string"
      },
      "delt": {
         "default": "PT1H",
         "description": "Time interval",
         "format": "duration",
         "title": "Delt",
         "type": "string"
      },
      "tfmt": {
         "anyOf": [
            {
               "enum": [
                  1,
                  2,
                  3,
                  4,
                  5,
                  6
               ],
               "type": "integer"
            },
            {
               "type": "string"
            }
         ],
         "default": 1,
         "description": "Format to render time specification",
         "title": "Tfmt"
      },
      "dfmt": {
         "default": "sec",
         "description": "Format to render time interval specification",
         "enum": [
            "sec",
            "min",
            "hr",
            "day"
         ],
         "title": "Dfmt",
         "type": "string"
      },
      "suffix": {
         "default": "",
         "description": "Suffix to prepend to argument names when rendering",
         "title": "Suffix",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field delt: timedelta = datetime.timedelta(seconds=3600)

Time interval

field dfmt: Literal['sec', 'min', 'hr', 'day'] = 'sec'

Format to render time interval specification

field model_type: Literal['open', 'OPEN'] = 'open'

Model type discriminator

field suffix: str = ''

Suffix to prepend to argument names when rendering

field tbeg: datetime = datetime.datetime(1970, 1, 1, 0, 0)

Start time

field tfmt: Literal[1, 2, 3, 4, 5, 6] | str = 1

Format to render time specification

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

Readgrid#

Readgrid subcomponents.

pydantic model rompy.swan.subcomponents.readgrid.GRIDREGULAR[source]

SWAN Regular Grid subcomponent.

xp yp alp xlen ylen mx my

Note

The direction of the x-axis alp must be 0 in case of spherical coordinates

Note

All coordinates and distances should be given in m when Cartesian coordinates are used or degrees when Spherical coordinates are used (see command COORD).

Examples

In [1]: from rompy.swan.subcomponents.readgrid import GRIDREGULAR

In [2]: kwargs = dict(xp=173, yp=-40, alp=0, xlen=2, ylen=2, mx=199, my=199)

In [3]: grid = GRIDREGULAR(suffix="c", **kwargs)

In [4]: print(grid.render())
xpc=173.0 ypc=-40.0 alpc=0.0 xlenc=2.0 ylenc=2.0 mxc=199 myc=199

In [5]: grid = GRIDREGULAR(suffix="inp", **kwargs)

In [6]: print(grid.render())
xpinp=173.0 ypinp=-40.0 alpinp=0.0 xleninp=2.0 yleninp=2.0 mxinp=199 myinp=199

Show JSON schema
{
   "title": "GRIDREGULAR",
   "description": "SWAN Regular Grid subcomponent.\n\n.. code-block:: text\n\n    xp yp alp xlen ylen mx my\n\nNote\n----\nThe direction of the x-axis `alp` must be 0 in case of spherical coordinates\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import GRIDREGULAR\n    kwargs = dict(xp=173, yp=-40, alp=0, xlen=2, ylen=2, mx=199, my=199)\n    grid = GRIDREGULAR(suffix=\"c\", **kwargs)\n    print(grid.render())\n    grid = GRIDREGULAR(suffix=\"inp\", **kwargs)\n    print(grid.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "gridregular",
         "description": "Model type discriminator",
         "enum": [
            "gridregular",
            "GRIDREGULAR"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "xp": {
         "description": "The x-coordinate of the origin in problem coordinates",
         "title": "Xp",
         "type": "number"
      },
      "yp": {
         "description": "The y-coordinate of the origin in problem coordinates",
         "title": "Yp",
         "type": "number"
      },
      "alp": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": 0.0,
         "description": "Direction of the xaxis in degrees",
         "title": "Alp"
      },
      "xlen": {
         "description": "Length of the computational grid in the x-direction",
         "title": "Xlen",
         "type": "number"
      },
      "ylen": {
         "description": "Length of the computational grid in the y-direction",
         "title": "Ylen",
         "type": "number"
      },
      "mx": {
         "description": "Number of meshes in computational grid in x-direction (this number is one less than the number of grid points in this domain)",
         "title": "Mx",
         "type": "integer"
      },
      "my": {
         "description": "Number of meshes in computational grid in y-direction (this number is one less than the number of grid points in this domain)",
         "title": "My",
         "type": "integer"
      },
      "suffix": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "",
         "description": "Suffix for rendering with each output grid parameter.",
         "title": "Suffix"
      }
   },
   "additionalProperties": false,
   "required": [
      "xp",
      "yp",
      "xlen",
      "ylen",
      "mx",
      "my"
   ]
}

Fields:
field alp: float | None = 0.0

Direction of the xaxis in degrees

field model_type: Literal['gridregular', 'GRIDREGULAR'] = 'gridregular'

Model type discriminator

field mx: int [Required]

Number of meshes in computational grid in x-direction (this number is one less than the number of grid points in this domain)

field my: int [Required]

Number of meshes in computational grid in y-direction (this number is one less than the number of grid points in this domain)

field suffix: str | None = ''

Suffix for rendering with each output grid parameter.

field xlen: float [Required]

Length of the computational grid in the x-direction

field xp: float [Required]

The x-coordinate of the origin in problem coordinates

field ylen: float [Required]

Length of the computational grid in the y-direction

field yp: float [Required]

The y-coordinate of the origin in problem coordinates

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property dx

Grid spacing in x-direction.

property dy

Grid spacing in y-direction.

pydantic model rompy.swan.subcomponents.readgrid.READCOORD[source]

SWAN coordinates reader.

READGRID COORDINATES [fac] 'fname' [idla] [nhedf] [nhedvec] &
    FREE|FORMAT ('form'|idfm)

Examples

In [1]: from rompy.swan.subcomponents.readgrid import READCOORD

In [2]: readcoord = READCOORD(
   ...:     fac=1.0,
   ...:     fname="coords.txt",
   ...:     idla=3,
   ...:     format="free",
   ...: )
   ...: 

In [3]: print(readcoord.render())
READGRID COORDINATES fac=1.0 fname='coords.txt' idla=3 nhedf=0 nhedvec=0 FREE

Show JSON schema
{
   "title": "READCOORD",
   "description": "SWAN coordinates reader.\n\n.. code-block:: text\n\n    READGRID COORDINATES [fac] 'fname' [idla] [nhedf] [nhedvec] &\n        FREE|FORMAT ('form'|idfm)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READCOORD\n    readcoord = READCOORD(\n        fac=1.0,\n        fname=\"coords.txt\",\n        idla=3,\n        format=\"free\",\n    )\n    print(readcoord.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "readcoord",
         "description": "Model type discriminator",
         "enum": [
            "readcoord",
            "READCOORD"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "grid_type": {
         "const": "coordinates",
         "default": "coordinates",
         "description": "Type of the SWAN grid file",
         "title": "Grid Type",
         "type": "string"
      },
      "fac": {
         "default": 1.0,
         "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
         "exclusiveMinimum": 0.0,
         "title": "Fac",
         "type": "number"
      },
      "idla": {
         "$ref": "#/$defs/IDLA",
         "default": 1,
         "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
      },
      "nhedf": {
         "default": 0,
         "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
         "minimum": 0,
         "title": "Nhedf",
         "type": "integer"
      },
      "nhedvec": {
         "default": 0,
         "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
         "minimum": 0,
         "title": "Nhedvec",
         "type": "integer"
      },
      "format": {
         "default": "free",
         "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
         "enum": [
            "free",
            "fixed",
            "unformatted"
         ],
         "title": "Format",
         "type": "string"
      },
      "form": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
         "title": "Form"
      },
      "idfm": {
         "anyOf": [
            {
               "enum": [
                  1,
                  5,
                  6,
                  8
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "File format identifier, only used if `format='fixed'`",
         "title": "Idfm"
      },
      "fname": {
         "description": "Name of the SWAN coordinates file",
         "title": "Fname",
         "type": "string"
      }
   },
   "$defs": {
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname"
   ]
}

Fields:
Validators:
  • check_format_definition » all fields

field fac: float = 1.0

SWAN multiplies all values that are read from file by fac. For instance if the values are given in unit decimeter, one should make fac=0.1 to obtain values in m. To change sign use a negative fac

Constraints:
  • gt = 0.0

Validated by:
  • check_format_definition

field fname: str [Required]

Name of the SWAN coordinates file

Validated by:
  • check_format_definition

field form: str | None = None

A user-specified format string in Fortran convention, e.g., ‘(10X,12F5.0)’.Only used if format=’fixed’, do not use it if idfm is specified

Validated by:
  • check_format_definition

field format: Literal['free', 'fixed', 'unformatted'] = 'free'

File format, one of ‘free’, ‘fixed’ or ‘unformatted’. If ‘free’, the file is assumed to use the FREE FORTRAN format. If ‘fixed’, the file is assumed to use a fixed format that must be specified by (only) one of ‘form’ or ‘idfm’ arguments. Use ‘unformatted’ to read unformatted (binary) files (not recommended for ordinary use)

Validated by:
  • check_format_definition

field grid_type: Literal['coordinates'] = 'coordinates'

Type of the SWAN grid file

Validated by:
  • check_format_definition

field idfm: Literal[1, 5, 6, 8] | None = None

File format identifier, only used if format=’fixed’

Validated by:
  • check_format_definition

field idla: IDLA = 1

Prescribes the order in which the values of bottom levels and other fields should be given in the file

Validated by:
  • check_format_definition

field model_type: Literal['readcoord', 'READCOORD'] = 'readcoord'

Model type discriminator

Validated by:
  • check_format_definition

field nhedf: int = 0

The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than nhedf because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see nhedt and nhedvec)

Constraints:
  • ge = 0

Validated by:
  • check_format_definition

field nhedvec: int = 0

For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)

Constraints:
  • ge = 0

Validated by:
  • check_format_definition

validator check_format_definition  »  all fields

Check the arguments specifying the file format are specified correctly.

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property format_repr
pydantic model rompy.swan.subcomponents.readgrid.READGRID[source]

SWAN grid reader abstract class.

READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &
    ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])

This is the base class for all input grids. It is not meant to be used directly.

Note

File format identifier:

  • 1: Format according to BODKAR convention (a standard of the Ministry of Transport and Public Works in the Netherlands). Format string: (10X,12F5.0)

  • 5: Format (16F5.0), an input line consists of 16 fields of 5 places each

  • 6: Format (12F6.0), an input line consists of 12 fields of 6 places each

  • 8: Format (10F8.0), an input line consists of 10 fields of 8 places each

Show JSON schema
{
   "title": "READGRID",
   "description": "SWAN grid reader abstract class.\n\n.. code-block:: text\n\n    READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) &\n        ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])\n\nThis is the base class for all input grids. It is not meant to be used directly.\n\nNote\n----\n\nFile format identifier:\n\n* 1: Format according to BODKAR convention (a standard of the Ministry of\n  Transport and Public Works in the Netherlands). Format string: (10X,12F5.0)\n* 5: Format (16F5.0), an input line consists of 16 fields of 5 places each\n* 6: Format (12F6.0), an input line consists of 12 fields of 6 places each\n* 8: Format (10F8.0), an input line consists of 10 fields of 8 places each",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "readgrid",
         "description": "Model type discriminator",
         "enum": [
            "readgrid",
            "READGRID"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "grid_type": {
         "anyOf": [
            {
               "$ref": "#/$defs/GridOptions"
            },
            {
               "const": "coordinates",
               "type": "string"
            }
         ],
         "description": "Type of the SWAN grid file",
         "title": "Grid Type"
      },
      "fac": {
         "default": 1.0,
         "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
         "exclusiveMinimum": 0.0,
         "title": "Fac",
         "type": "number"
      },
      "idla": {
         "$ref": "#/$defs/IDLA",
         "default": 1,
         "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
      },
      "nhedf": {
         "default": 0,
         "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
         "minimum": 0,
         "title": "Nhedf",
         "type": "integer"
      },
      "nhedvec": {
         "default": 0,
         "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
         "minimum": 0,
         "title": "Nhedvec",
         "type": "integer"
      },
      "format": {
         "default": "free",
         "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
         "enum": [
            "free",
            "fixed",
            "unformatted"
         ],
         "title": "Format",
         "type": "string"
      },
      "form": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
         "title": "Form"
      },
      "idfm": {
         "anyOf": [
            {
               "enum": [
                  1,
                  5,
                  6,
                  8
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "File format identifier, only used if `format='fixed'`",
         "title": "Idfm"
      }
   },
   "$defs": {
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      }
   },
   "additionalProperties": false,
   "required": [
      "grid_type"
   ]
}

Fields:
  • fac (float)

  • form (str | None)

  • format (Literal['free', 'fixed', 'unformatted'])

  • grid_type (rompy.swan.types.GridOptions | Literal['coordinates'])

  • idfm (Literal[1, 5, 6, 8] | None)

  • idla (rompy.swan.types.IDLA)

  • model_type (Literal['readgrid', 'READGRID'])

  • nhedf (int)

  • nhedvec (int)

Validators:
  • check_format_definition » all fields

field fac: float = 1.0

SWAN multiplies all values that are read from file by fac. For instance if the values are given in unit decimeter, one should make fac=0.1 to obtain values in m. To change sign use a negative fac

Constraints:
  • gt = 0.0

Validated by:
  • check_format_definition

field form: str | None = None

A user-specified format string in Fortran convention, e.g., ‘(10X,12F5.0)’.Only used if format=’fixed’, do not use it if idfm is specified

Validated by:
  • check_format_definition

field format: Literal['free', 'fixed', 'unformatted'] = 'free'

File format, one of ‘free’, ‘fixed’ or ‘unformatted’. If ‘free’, the file is assumed to use the FREE FORTRAN format. If ‘fixed’, the file is assumed to use a fixed format that must be specified by (only) one of ‘form’ or ‘idfm’ arguments. Use ‘unformatted’ to read unformatted (binary) files (not recommended for ordinary use)

Validated by:
  • check_format_definition

field grid_type: GridOptions | Literal['coordinates'] [Required]

Type of the SWAN grid file

Validated by:
  • check_format_definition

field idfm: Literal[1, 5, 6, 8] | None = None

File format identifier, only used if format=’fixed’

Validated by:
  • check_format_definition

field idla: IDLA = 1

Prescribes the order in which the values of bottom levels and other fields should be given in the file

Validated by:
  • check_format_definition

field model_type: Literal['readgrid', 'READGRID'] = 'readgrid'

Model type discriminator

Validated by:
  • check_format_definition

field nhedf: int = 0

The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than nhedf because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see nhedt and nhedvec)

Constraints:
  • ge = 0

Validated by:
  • check_format_definition

field nhedvec: int = 0

For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)

Constraints:
  • ge = 0

Validated by:
  • check_format_definition

validator check_format_definition  »  all fields[source]

Check the arguments specifying the file format are specified correctly.

cmd() str
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property format_repr
pydantic model rompy.swan.subcomponents.readgrid.READINP[source]

SWAN input grid reader.

READINP GRID_TYPE [fac] ('fname1' | SERIES 'fname2') [idla] [nhedf] &
    ([nhedt]) [nhedvec] FREE|FORMAT ('form'|idfm)|UNFORMATTED`

Examples

In [1]: from rompy.swan.subcomponents.readgrid import READINP

In [2]: readinp = READINP(
   ...:     grid_type="wind",
   ...:     fname1="wind.txt",
   ...:     fac=1.0,
   ...:     idla=3,
   ...:     format="free",
   ...: )
   ...: 

In [3]: print(readinp.render())
READINP WIND fac=1.0 fname1='wind.txt' idla=3 nhedf=0 nhedt=0 nhedvec=0 FREE

Show JSON schema
{
   "title": "READINP",
   "description": "SWAN input grid reader.\n\n.. code-block:: text\n\n    READINP GRID_TYPE [fac] ('fname1' | SERIES 'fname2') [idla] [nhedf] &\n        ([nhedt]) [nhedvec] FREE|FORMAT ('form'|idfm)|UNFORMATTED`\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.readgrid import READINP\n    readinp = READINP(\n        grid_type=\"wind\",\n        fname1=\"wind.txt\",\n        fac=1.0,\n        idla=3,\n        format=\"free\",\n    )\n    print(readinp.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "readinp",
         "description": "Model type discriminator",
         "enum": [
            "readinp",
            "READINP"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "grid_type": {
         "anyOf": [
            {
               "$ref": "#/$defs/GridOptions"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Type of the SWAN grid file"
      },
      "fac": {
         "default": 1.0,
         "description": "SWAN multiplies all values that are read from file by `fac`. For instance if the values are given in unit decimeter, one should make `fac=0.1` to obtain values in m. To change sign use a negative `fac`",
         "exclusiveMinimum": 0.0,
         "title": "Fac",
         "type": "number"
      },
      "idla": {
         "$ref": "#/$defs/IDLA",
         "default": 1,
         "description": "Prescribes the order in which the values of bottom levels and other fields should be given in the file"
      },
      "nhedf": {
         "default": 0,
         "description": "The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than `nhedf` because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see `nhedt` and `nhedvec`)",
         "minimum": 0,
         "title": "Nhedf",
         "type": "integer"
      },
      "nhedvec": {
         "default": 0,
         "description": "For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)",
         "minimum": 0,
         "title": "Nhedvec",
         "type": "integer"
      },
      "format": {
         "default": "free",
         "description": "File format, one of 'free', 'fixed' or 'unformatted'. If 'free', the file is assumed to use the FREE FORTRAN format. If 'fixed', the file is assumed to use a fixed format that must be specified by (only) one of 'form' or 'idfm' arguments. Use 'unformatted' to read unformatted (binary) files (not recommended for ordinary use)",
         "enum": [
            "free",
            "fixed",
            "unformatted"
         ],
         "title": "Format",
         "type": "string"
      },
      "form": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A user-specified format string in Fortran convention, e.g., '(10X,12F5.0)'.Only used if `format='fixed'`, do not use it if `idfm` is specified",
         "title": "Form"
      },
      "idfm": {
         "anyOf": [
            {
               "enum": [
                  1,
                  5,
                  6,
                  8
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "File format identifier, only used if `format='fixed'`",
         "title": "Idfm"
      },
      "fname1": {
         "description": "Name of the file with the values of the variable.",
         "title": "Fname1",
         "type": "string"
      },
      "fname2": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Name of file that contains the names of the files where the variables are given when the SERIES option is used. These names are to be given in proper time sequence. SWAN reads the next file when the previous file end has been encountered. In these files the input should be given in the same format as in the above file 'fname1' (that implies that a file should start with the start of an input time step)",
         "title": "Fname2"
      },
      "nhedt": {
         "default": 0,
         "description": "Only if variable is time dependent: number of header lines in the file at the start of each time level. A time step may start with more header lines than `nhedt` because the variable may be a vector variable which has its own header lines (see `nhedvec`)",
         "minimum": 0,
         "title": "Nhedt",
         "type": "integer"
      }
   },
   "$defs": {
      "GridOptions": {
         "description": "Valid options for the input grid type.\n\nAttributes\n----------\nBOTTOM: \"bottom\"\n    Bottom level grid.\nWLEVEL: \"wlevel\"\n    Water level grid.\nCURRENT: \"current\"\n    Current field grid.\nVX: \"vx\"\n    Current field x-component grid.\nVY: \"vy\"\n    Current field y-component grid.\nWIND: \"wind\"\n    Wind velocity grid.\nWX: \"wx\"\n    Wind velocity x-component grid.\nWY: \"wy\"\n    Wind velocity y-component grid.\nFRICTION: \"friction\"\n    Bottom friction grid.\nNPLANTS: \"nplants\"\n    Horizontally varying vegetation density grid.\nTURBVISC: \"turbvisc\"\n    Horizontally varying turbulent viscosity grid.\nMUDLAYER: \"mudlayer\"\n    Horizontally varying mud layer thickness grid.\nAICE: \"aice\"\n    Areal ice fraction grid, a number between 0 and 1.\nHICE: \"hice\"\n    Ice thickness grid.\nHSS: \"hss\"\n    Sea-swell significant wave height grid.\nTSS: \"tss\"\n    Sea-swell mean wave period.",
         "enum": [
            "bottom",
            "wlevel",
            "current",
            "vx",
            "vy",
            "wind",
            "wx",
            "wy",
            "friction",
            "nplants",
            "turbvisc",
            "mudlayer",
            "aice",
            "hice",
            "hss",
            "tss"
         ],
         "title": "GridOptions",
         "type": "string"
      },
      "IDLA": {
         "description": "Order of values in the input files.\n\nAttributes\n----------\nONE: 1\n    SWAN reads the map from left to right starting in the upper-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nTWO: 2\n    As `1` but a new line in the map need not start on a new line in the file.\nTHREE: 3\n    SWAN reads the map from left to right starting in the lower-left-hand corner of\n    the map. A new line in the map should start on a new line in the file.\nFOUR: 4\n    As `3` but a new line in the map need not start on a new line in the file.\nFIVE: 5\n    SWAN reads the map from top to bottom starting in the lower-left-hand corner of\n    the map. A new column in the map should start on a new line in the file.\nSIX: 6\n    As `5` but a new column in the map need not start on a new line in the file.\n\nNotes\n-----\nIt is assumed that the x-axis of the grid is pointing to the right and the y-axis\nupwards.",
         "enum": [
            1,
            2,
            3,
            4,
            5,
            6
         ],
         "title": "IDLA",
         "type": "integer"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname1"
   ]
}

Fields:
Validators:
field fac: float = 1.0

SWAN multiplies all values that are read from file by fac. For instance if the values are given in unit decimeter, one should make fac=0.1 to obtain values in m. To change sign use a negative fac

Constraints:
  • gt = 0.0

Validated by:
  • check_format_definition

field fname1: str [Required]

Name of the file with the values of the variable.

Validated by:
  • check_format_definition

field fname2: str | None = None

Name of file that contains the names of the files where the variables are given when the SERIES option is used. These names are to be given in proper time sequence. SWAN reads the next file when the previous file end has been encountered. In these files the input should be given in the same format as in the above file ‘fname1’ (that implies that a file should start with the start of an input time step)

Validated by:
  • check_format_definition

field form: str | None = None

A user-specified format string in Fortran convention, e.g., ‘(10X,12F5.0)’.Only used if format=’fixed’, do not use it if idfm is specified

Validated by:
  • check_format_definition

field format: Literal['free', 'fixed', 'unformatted'] = 'free'

File format, one of ‘free’, ‘fixed’ or ‘unformatted’. If ‘free’, the file is assumed to use the FREE FORTRAN format. If ‘fixed’, the file is assumed to use a fixed format that must be specified by (only) one of ‘form’ or ‘idfm’ arguments. Use ‘unformatted’ to read unformatted (binary) files (not recommended for ordinary use)

Validated by:
  • check_format_definition

field grid_type: GridOptions | None = None

Type of the SWAN grid file

Validated by:
field idfm: Literal[1, 5, 6, 8] | None = None

File format identifier, only used if format=’fixed’

Validated by:
  • check_format_definition

field idla: IDLA = 1

Prescribes the order in which the values of bottom levels and other fields should be given in the file

Validated by:
  • check_format_definition

field model_type: Literal['readinp', 'READINP'] = 'readinp'

Model type discriminator

Validated by:
  • check_format_definition

field nhedf: int = 0

The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than nhedf because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see nhedt and nhedvec)

Constraints:
  • ge = 0

Validated by:
  • check_format_definition

field nhedt: int = 0

Only if variable is time dependent: number of header lines in the file at the start of each time level. A time step may start with more header lines than nhedt because the variable may be a vector variable which has its own header lines (see nhedvec)

Constraints:
  • ge = 0

Validated by:
  • check_format_definition

field nhedvec: int = 0

For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)

Constraints:
  • ge = 0

Validated by:
  • check_format_definition

validator check_format_definition  »  all fields

Check the arguments specifying the file format are specified correctly.

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

validator set_undefined  »  grid_type[source]

Allow for undefined value so it can be redefined in INPGRID components.

property format_repr

Boundary#

SWAN boundary subcomponents.

pydantic model rompy.swan.subcomponents.boundary.CONSTANTFILE[source]

Constant file specification.

CONSTANT FILE 'fname' [seq]

There are three types of files:

  • TPAR files containing nonstationary wave parameters

  • files containing stationary or nonstationary 1D spectra (usually from measurements)

  • files containing stationary or nonstationary 2D spectra (from other computer programs or other SWAN runs)

A TPAR file is for only one location; it has the string TPAR on the first line of the file and a number of lines which each contain 5 numbers, i.e.: Time (ISO-notation), Hs, Period (average or peak period depending on the choice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian, depending on command SET), Directional spread (in degrees or as power of cos depending on the choice given in command BOUND SHAPE).

Note

Example of a TPAR file:

TPAR
19920516.130000 4.2 12. -110. 22.
19920516.180000 4.2 12. -110. 22.
19920517.000000 1.2 8. -110. 22.
19920517.120000 1.4 8.5 -80. 26
19920517.200000 0.9 6.5 -95. 28

Examples

In [1]: from rompy.swan.subcomponents.boundary import CONSTANTFILE

In [2]: par = CONSTANTFILE(fname="tpar.txt")

In [3]: print(par.render())
CONSTANT FILE fname='tpar.txt'

Show JSON schema
{
   "title": "CONSTANTFILE",
   "description": "Constant file specification.\n\n.. code-block:: text\n\n    CONSTANT FILE 'fname' [seq]\n\nThere are three types of files:\n\n- TPAR files containing nonstationary wave parameters\n- files containing stationary or nonstationary 1D spectra\n  (usually from measurements)\n- files containing stationary or nonstationary 2D spectra\n  (from other computer programs or other SWAN runs)\n\nA TPAR file is for only one location; it has the string TPAR on the first\nline of the file and a number of lines which each contain 5 numbers, i.e.:\nTime (ISO-notation), Hs, Period (average or peak period depending on the\nchoice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian,\ndepending on command SET), Directional spread (in degrees or as power of cos\ndepending on the choice given in command BOUND SHAPE).\n\nNote\n----\nExample of a TPAR file:\n\n.. code-block:: text\n\n    TPAR\n    19920516.130000 4.2 12. -110. 22.\n    19920516.180000 4.2 12. -110. 22.\n    19920517.000000 1.2 8. -110. 22.\n    19920517.120000 1.4 8.5 -80. 26\n    19920517.200000 0.9 6.5 -95. 28\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import CONSTANTFILE\n    par = CONSTANTFILE(fname=\"tpar.txt\")\n    print(par.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "constantfile",
         "description": "Model type discriminator",
         "enum": [
            "constantfile",
            "CONSTANTFILE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "fname": {
         "description": "Name of the file containing the boundary condition.",
         "maxLength": 36,
         "title": "Fname",
         "type": "string"
      },
      "seq": {
         "anyOf": [
            {
               "minimum": 1,
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case `seq` must always be 1",
         "title": "Seq"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname"
   ]
}

Fields:
field fname: str [Required]

Name of the file containing the boundary condition.

Constraints:
  • max_length = 36

field model_type: Literal['constantfile', 'CONSTANTFILE'] = 'constantfile'

Model type discriminator

field seq: int | None = None

sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case seq must always be 1

Constraints:
  • ge = 1

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.CONSTANTPAR[source]

Constant spectral parameters.

CONSTANT PAR [hs] [per] [dir] ([dd])

Examples

In [1]: from rompy.swan.subcomponents.boundary import CONSTANTPAR

In [2]: par = CONSTANTPAR(hs=1.5, per=8.1, dir=225)

In [3]: print(par.render())
CONSTANT PAR hs=1.5 per=8.1 dir=225.0

Show JSON schema
{
   "title": "CONSTANTPAR",
   "description": "Constant spectral parameters.\n\n.. code-block:: text\n\n    CONSTANT PAR [hs] [per] [dir] ([dd])\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import CONSTANTPAR\n    par = CONSTANTPAR(hs=1.5, per=8.1, dir=225)\n    print(par.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "constantpar",
         "description": "Model type discriminator",
         "enum": [
            "constantpar",
            "CONSTANTPAR"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "hs": {
         "description": "The significant wave height (m)",
         "exclusiveMinimum": 0.0,
         "title": "Hs",
         "type": "number"
      },
      "per": {
         "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE.",
         "exclusiveMinimum": 0.0,
         "title": "Per",
         "type": "number"
      },
      "dir": {
         "description": "The peak wave direction thetapeak (degree), constant over frequencies",
         "maximum": 360.0,
         "minimum": -360.0,
         "title": "Dir",
         "type": "number"
      },
      "dd": {
         "anyOf": [
            {
               "maximum": 360.0,
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient of directional spreading; a `cos^m(\u03b8)` distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
         "title": "Dd"
      }
   },
   "additionalProperties": false,
   "required": [
      "hs",
      "per",
      "dir"
   ]
}

Fields:
field dd: float | None = None

Coefficient of directional spreading; a cos^m(θ) distribution is assumed. dd is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). dd is interpreted as the power m, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)

Constraints:
  • ge = 0.0

  • le = 360.0

field dir: float [Required]

The peak wave direction thetapeak (degree), constant over frequencies

Constraints:
  • ge = -360.0

  • le = 360.0

field hs: float [Required]

The significant wave height (m)

Constraints:
  • gt = 0.0

field model_type: Literal['constantpar', 'CONSTANTPAR'] = 'constantpar'

Model type discriminator

field per: float [Required]

The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); per is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or per is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE.

Constraints:
  • gt = 0.0

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.DEFAULT[source]

Default initial conditions.

DEFAULT

The initial spectra are computed from the local wind velocities, using the deep-water growth curve of Kahma and Calkoen (1992), cut off at values of significant wave height and peak frequency from Pierson and Moskowitz (1964). The average (over the model area) spatial step size is used as fetch with local wind. The shape of the spectrum is default JONSWAP with a cos2-directional distribution (options are available: see command BOUND SHAPE).

Examples

In [1]: from rompy.swan.subcomponents.boundary import DEFAULT

In [2]: init = DEFAULT()

In [3]: print(init.render())
DEFAULT

Show JSON schema
{
   "title": "DEFAULT",
   "description": "Default initial conditions.\n\n.. code-block:: text\n\n    DEFAULT\n\nThe initial spectra are computed from the local wind velocities, using the\ndeep-water growth curve of Kahma and Calkoen (1992), cut off at values of\nsignificant wave height and peak frequency from Pierson and Moskowitz (1964).\nThe average (over the model area) spatial step size is used as fetch with local\nwind. The shape of the spectrum is default JONSWAP with a cos2-directional\ndistribution (options are available: see command BOUND SHAPE).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import DEFAULT\n    init = DEFAULT()\n    print(init.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "default",
         "description": "Model type discriminator",
         "enum": [
            "default",
            "DEFAULT"
         ],
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['default', 'DEFAULT'] = 'default'

Model type discriminator

cmd() str
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.HOTMULTIPLE[source]

Hotstart multiple initial conditions.

HOTSTART MULTIPLE fname='fname' FREE|UNFORMATTED

Initial wave field is read from file; this file was generated in a previous SWAN run by means of the HOTFILE command. If the previous run was nonstationary, the time found on the file will be assumed to be the initial time of computation. It can also be used for stationary computation as first guess. The computational grid (both in geographical space and in spectral space) must be identical to the one in the run in which the initial wave field was computed

Input will be read from multiple hotfiles obtained from a previous parallel MPI run. The number of files equals the number of processors. Hence, for the present run the same number of processors must be chosen.

Examples

In [1]: from rompy.swan.subcomponents.boundary import HOTMULTIPLE

In [2]: init = HOTMULTIPLE(fname="hotstart.swn", format="free")

In [3]: print(init.render())
HOTSTART MULTIPLE fname='hotstart.swn' FREE

Show JSON schema
{
   "title": "HOTMULTIPLE",
   "description": "Hotstart multiple initial conditions.\n\n.. code-block:: text\n\n    HOTSTART MULTIPLE fname='fname' FREE|UNFORMATTED\n\nInitial wave field is read from file; this file was generated in a previous SWAN\nrun by means of the HOTFILE command. If the previous run was nonstationary,\nthe time found on the file will be assumed to be the initial time of computation. It\ncan also be used for stationary computation as first guess. The computational grid\n(both in geographical space and in spectral space) must be identical to the one in\nthe run in which the initial wave field was computed\n\nInput will be read from multiple hotfiles obtained from a previous parallel MPI run.\nThe number of files equals the number of processors. Hence, for the present run the\nsame number of processors must be chosen.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import HOTMULTIPLE\n    init = HOTMULTIPLE(fname=\"hotstart.swn\", format=\"free\")\n    print(init.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "hotmultiple",
         "description": "Model type discriminator",
         "enum": [
            "hotmultiple",
            "HOTMULTIPLE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "fname": {
         "description": "Name of the file containing the initial wave field",
         "maxLength": 36,
         "title": "Fname",
         "type": "string"
      },
      "format": {
         "default": "free",
         "description": "Format of the file containing the initial wave field. FREE: free format, UNFORMATTED: binary format",
         "enum": [
            "free",
            "unformatted"
         ],
         "title": "Format",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname"
   ]
}

Fields:
field fname: str [Required]

Name of the file containing the initial wave field

Constraints:
  • max_length = 36

field format: Literal['free', 'unformatted'] = 'free'

Format of the file containing the initial wave field. FREE: free format, UNFORMATTED: binary format

field model_type: Literal['hotmultiple', 'HOTMULTIPLE'] = 'hotmultiple'

Model type discriminator

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.HOTSINGLE[source]

Hotstart single initial conditions.

HOTSTART SINGLE fname='fname' FREE|UNFORMATTED

Initial wave field is read from file; this file was generated in a previous SWAN run by means of the HOTFILE command. If the previous run was nonstationary, the time found on the file will be assumed to be the initial time of computation. It can also be used for stationary computation as first guess. The computational grid (both in geographical space and in spectral space) must be identical to the one in the run in which the initial wave field was computed

Input will be read from a single (concatenated) hotfile. In the case of a previous parallel MPI run, the concatenated hotfile can be created from a set of multiple hotfiles using the program hcat.exe, see Implementation Manual.

Examples

In [1]: from rompy.swan.subcomponents.boundary import HOTSINGLE

In [2]: init = HOTSINGLE(fname="hotstart.swn", format="free")

In [3]: print(init.render())
HOTSTART SINGLE fname='hotstart.swn' FREE

Show JSON schema
{
   "title": "HOTSINGLE",
   "description": "Hotstart single initial conditions.\n\n.. code-block:: text\n\n    HOTSTART SINGLE fname='fname' FREE|UNFORMATTED\n\nInitial wave field is read from file; this file was generated in a previous SWAN\nrun by means of the HOTFILE command. If the previous run was nonstationary,\nthe time found on the file will be assumed to be the initial time of computation. It\ncan also be used for stationary computation as first guess. The computational grid\n(both in geographical space and in spectral space) must be identical to the one in\nthe run in which the initial wave field was computed\n\nInput will be read from a single (concatenated) hotfile. In the case of a previous\nparallel MPI run, the concatenated hotfile can be created from a set of multiple\nhotfiles using the program hcat.exe, see Implementation Manual.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import HOTSINGLE\n    init = HOTSINGLE(fname=\"hotstart.swn\", format=\"free\")\n    print(init.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "hotsingle",
         "description": "Model type discriminator",
         "enum": [
            "hotsingle",
            "HOTSINGLE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "fname": {
         "description": "Name of the file containing the initial wave field",
         "maxLength": 36,
         "title": "Fname",
         "type": "string"
      },
      "format": {
         "default": "free",
         "description": "Format of the file containing the initial wave field. FREE: free format, UNFORMATTED: binary format",
         "enum": [
            "free",
            "unformatted"
         ],
         "title": "Format",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname"
   ]
}

Fields:
field fname: str [Required]

Name of the file containing the initial wave field

Constraints:
  • max_length = 36

field format: Literal['free', 'unformatted'] = 'free'

Format of the file containing the initial wave field. FREE: free format, UNFORMATTED: binary format

field model_type: Literal['hotsingle', 'HOTSINGLE'] = 'hotsingle'

Model type discriminator

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.PAR[source]

Spectral parameters.

PAR [hs] [per] [dir] [dd]

Examples

In [1]: from rompy.swan.subcomponents.boundary import PAR

In [2]: par = PAR(hs=1.5, per=8.1, dir=225)

In [3]: print(par.render())
PAR hs=1.5 per=8.1 dir=225.0

Show JSON schema
{
   "title": "PAR",
   "description": "Spectral parameters.\n\n.. code-block:: text\n\n    PAR [hs] [per] [dir] [dd]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import PAR\n    par = PAR(hs=1.5, per=8.1, dir=225)\n    print(par.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "par",
         "default": "par",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "hs": {
         "description": "The significant wave height (m)",
         "exclusiveMinimum": 0.0,
         "title": "Hs",
         "type": "number"
      },
      "per": {
         "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE.",
         "exclusiveMinimum": 0.0,
         "title": "Per",
         "type": "number"
      },
      "dir": {
         "description": "The peak wave direction thetapeak (degree), constant over frequencies",
         "maximum": 360.0,
         "minimum": -360.0,
         "title": "Dir",
         "type": "number"
      },
      "dd": {
         "anyOf": [
            {
               "maximum": 360.0,
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient of directional spreading; a `cos^m(\u03b8)` distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
         "title": "Dd"
      }
   },
   "additionalProperties": false,
   "required": [
      "hs",
      "per",
      "dir"
   ]
}

Fields:
field dd: float | None = None

Coefficient of directional spreading; a cos^m(θ) distribution is assumed. dd is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). dd is interpreted as the power m, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)

Constraints:
  • ge = 0.0

  • le = 360.0

field dir: float [Required]

The peak wave direction thetapeak (degree), constant over frequencies

Constraints:
  • ge = -360.0

  • le = 360.0

field hs: float [Required]

The significant wave height (m)

Constraints:
  • gt = 0.0

field model_type: Literal['par'] = 'par'

Model type discriminator

field per: float [Required]

The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); per is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or per is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE.

Constraints:
  • gt = 0.0

cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.SEGMENT[source]

Boundary over a segment defined from points.

SEGMENT XY < [x] [y] >
SEGMENT IJ < [i] [j] >

The segment is defined either by means of a series of points in terms of problem coordinates (XY) or by means of a series of points in terms of grid indices (IJ). The points do not have to include all or coincide with actual grid points.

Examples

In [1]: from rompy.swan.subcomponents.boundary import SEGMENT

In [2]: seg = SEGMENT(
   ...:     points=dict(
   ...:         model_type="xy",
   ...:         x=[172, 172, 172, 172.5, 173],
   ...:         y=[-41, -40.5, -40, -40, -40],
   ...:         fmt="0.2f",
   ...:     ),
   ...: )
   ...: 

In [3]: print(seg.render())
SEGMENT XY 
172.00 -41.00
172.00 -40.50
172.00 -40.00
172.50 -40.00
173.00 -40.00


In [4]: seg = SEGMENT(
   ...:     points=dict(
   ...:         model_type="ij",
   ...:         i=[0, 0, 5],
   ...:         j=[0, 19, 19],
   ...:     ),
   ...: )
   ...: 

In [5]: print(seg.render())
SEGMENT IJ 
i=0 j=0
i=0 j=19
i=5 j=19

Show JSON schema
{
   "title": "SEGMENT",
   "description": "Boundary over a segment defined from points.\n\n.. code-block:: text\n\n    SEGMENT XY < [x] [y] >\n    SEGMENT IJ < [i] [j] >\n\nThe segment is defined either by means of a series of points in terms of problem\ncoordinates (`XY`) or by means of a series of points in terms of grid indices\n(`IJ`). The points do not have to include all or coincide with actual grid points.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SEGMENT\n    seg = SEGMENT(\n        points=dict(\n            model_type=\"xy\",\n            x=[172, 172, 172, 172.5, 173],\n            y=[-41, -40.5, -40, -40, -40],\n            fmt=\"0.2f\",\n        ),\n    )\n    print(seg.render())\n    seg = SEGMENT(\n        points=dict(\n            model_type=\"ij\",\n            i=[0, 0, 5],\n            j=[0, 19, 19],\n        ),\n    )\n    print(seg.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "segment",
         "description": "Model type discriminator",
         "enum": [
            "segment",
            "SEGMENT"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "points": {
         "description": "Points to define the segment",
         "discriminator": {
            "mapping": {
               "IJ": "#/$defs/IJ",
               "XY": "#/$defs/XY",
               "ij": "#/$defs/IJ",
               "xy": "#/$defs/XY"
            },
            "propertyName": "model_type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/XY"
            },
            {
               "$ref": "#/$defs/IJ"
            }
         ],
         "title": "Points"
      }
   },
   "$defs": {
      "IJ": {
         "additionalProperties": false,
         "description": "Points in grid indices coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import IJ\n    points = IJ(i=[0, 0, 5], j=[0, 19, 19])\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "ij",
               "description": "Model type discriminator",
               "enum": [
                  "ij",
                  "IJ"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "i": {
               "description": "i-index values",
               "items": {
                  "type": "integer"
               },
               "title": "I",
               "type": "array"
            },
            "j": {
               "description": "j-index values",
               "items": {
                  "type": "integer"
               },
               "title": "J",
               "type": "array"
            }
         },
         "required": [
            "i",
            "j"
         ],
         "title": "IJ",
         "type": "object"
      },
      "XY": {
         "additionalProperties": false,
         "description": "Points in problem coordinates.\n\n.. code-block:: text\n\n    < [x] [y] >\n\nNote\n----\nCoordinates should be given in m when Cartesian coordinates are used or degrees\nwhen Spherical coordinates are used (see command `COORD`).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.base import XY\n    points = XY(\n        x=[172, 172, 172, 172.5, 173],\n        y=[-41, -40.5, -40, -40, -40],\n        fmt=\"0.2f\",\n    )\n    print(points.render())",
         "properties": {
            "model_type": {
               "default": "xy",
               "description": "Model type discriminator",
               "enum": [
                  "xy",
                  "XY"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "x": {
               "description": "Problem x-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "X",
               "type": "array"
            },
            "y": {
               "description": "Problem y-coordinate values",
               "items": {
                  "type": "number"
               },
               "title": "Y",
               "type": "array"
            },
            "fmt": {
               "default": "0.8f",
               "description": "The format to render floats values",
               "title": "Fmt",
               "type": "string"
            }
         },
         "required": [
            "x",
            "y"
         ],
         "title": "XY",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "points"
   ]
}

Fields:
field model_type: Literal['segment', 'SEGMENT'] = 'segment'

Model type discriminator

field points: XY | IJ [Required]

Points to define the segment

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.SIDE[source]

Boundary over one side of computational domain.

SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE

The boundary is one full side of the computational grid (in 1D cases either of the two ends of the 1D-grid).

Note

Should not be used in case of CURVILINEAR grids.

Examples

In [1]: from rompy.swan.subcomponents.boundary import SIDE

In [2]: side = SIDE(side="west", direction="ccw")

In [3]: print(side.render())
SIDE WEST CCW 

Show JSON schema
{
   "title": "SIDE",
   "description": "Boundary over one side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n\nThe boundary is one full side of the computational grid (in 1D cases either of the\ntwo ends of the 1D-grid).\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE\n    side = SIDE(side=\"west\", direction=\"ccw\")\n    print(side.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "side",
         "description": "Model type discriminator",
         "enum": [
            "side",
            "SIDE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "side": {
         "description": "The side of the grid to apply the boundary to",
         "enum": [
            "north",
            "nw",
            "west",
            "sw",
            "south",
            "se",
            "east",
            "ne"
         ],
         "title": "Side",
         "type": "string"
      },
      "direction": {
         "default": "ccw",
         "description": "The direction to apply the boundary in",
         "enum": [
            "ccw",
            "clockwise"
         ],
         "title": "Direction",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "side"
   ]
}

Fields:
field direction: Literal['ccw', 'clockwise'] = 'ccw'

The direction to apply the boundary in

field model_type: Literal['side', 'SIDE'] = 'side'

Model type discriminator

field side: Literal['north', 'nw', 'west', 'sw', 'south', 'se', 'east', 'ne'] [Required]

The side of the grid to apply the boundary to

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.SIDES[source]

Boundary over multiple side of computational domain.

SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE
SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE
...

Note

Should not be used in case of CURVILINEAR grids.

Examples

In [1]: from rompy.swan.subcomponents.boundary import SIDE, SIDES

In [2]: side1 = SIDE(side="west", direction="ccw")

In [3]: side2 = SIDE(side="north", direction="ccw")

In [4]: sides = SIDES(sides=[side1, side2])

In [5]: print(sides.render())
['S', 'I', 'D', 'E', ' ', 'W', 'E', 'S', 'T', ' ', 'C', 'C', 'W', ' ', 'S', 'I', 'D', 'E', ' ', 'N', 'O', 'R', 'T', 'H', ' ', 'C', 'C', 'W', ' ']

Show JSON schema
{
   "title": "SIDES",
   "description": "Boundary over multiple side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n    ...\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE, SIDES\n    side1 = SIDE(side=\"west\", direction=\"ccw\")\n    side2 = SIDE(side=\"north\", direction=\"ccw\")\n    sides = SIDES(sides=[side1, side2])\n    print(sides.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "sides",
         "description": "Model type discriminator",
         "enum": [
            "sides",
            "SIDES"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "sides": {
         "description": "The sides of the grid to apply the boundary to",
         "items": {
            "$ref": "#/$defs/SIDE"
         },
         "title": "Sides",
         "type": "array"
      }
   },
   "$defs": {
      "SIDE": {
         "additionalProperties": false,
         "description": "Boundary over one side of computational domain.\n\n.. code-block:: text\n\n    SIDE NORTH|NW|WEST|SW|SOUTH|SE|E|NE CCW|CLOCKWISE\n\nThe boundary is one full side of the computational grid (in 1D cases either of the\ntwo ends of the 1D-grid).\n\nNote\n----\nShould not be used in case of CURVILINEAR grids.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import SIDE\n    side = SIDE(side=\"west\", direction=\"ccw\")\n    print(side.render())",
         "properties": {
            "model_type": {
               "default": "side",
               "description": "Model type discriminator",
               "enum": [
                  "side",
                  "SIDE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "side": {
               "description": "The side of the grid to apply the boundary to",
               "enum": [
                  "north",
                  "nw",
                  "west",
                  "sw",
                  "south",
                  "se",
                  "east",
                  "ne"
               ],
               "title": "Side",
               "type": "string"
            },
            "direction": {
               "default": "ccw",
               "description": "The direction to apply the boundary in",
               "enum": [
                  "ccw",
                  "clockwise"
               ],
               "title": "Direction",
               "type": "string"
            }
         },
         "required": [
            "side"
         ],
         "title": "SIDE",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "sides"
   ]
}

Fields:
  • model_type (Literal['sides', 'SIDES'])

  • sides (list[rompy.swan.subcomponents.boundary.SIDE])

field model_type: Literal['sides', 'SIDES'] = 'sides'

Model type discriminator

field sides: list[SIDE] [Required]

The sides of the grid to apply the boundary to

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.VARIABLEFILE[source]

Variable file specification.

VARIABLE FILE < [len] 'fname' [seq] >

There are three types of files:

  • TPAR files containing nonstationary wave parameters

  • files containing stationary or nonstationary 1D spectra (usually from measurements)

  • files containing stationary or nonstationary 2D spectra (from other computer programs or other SWAN runs)

A TPAR file is for only one location; it has the string TPAR on the first line of the file and a number of lines which each contain 5 numbers, i.e.: Time (ISO-notation), Hs, Period (average or peak period depending on the choice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian, depending on command SET), Directional spread (in degrees or as power of cos depending on the choice given in command BOUND SHAPE).

Note

Example of a TPAR file:

TPAR
19920516.130000 4.2 12. -110. 22.
19920516.180000 4.2 12. -110. 22.
19920517.000000 1.2 8. -110. 22.
19920517.120000 1.4 8.5 -80. 26
19920517.200000 0.9 6.5 -95. 28

Examples

In [1]: from rompy.swan.subcomponents.boundary import VARIABLEFILE

In [2]: par = VARIABLEFILE(
   ...:     fname=["tpar1.txt", "tpar2.txt", "tpar3.txt"],
   ...:     len=[0.0, 0.5, 1.0],
   ...: )
   ...: 

In [3]: print(par.render())
VARIABLE FILE &
	len=0.0 fname='tpar1.txt' seq=1 &
	len=0.5 fname='tpar2.txt' seq=1 &
	len=1.0 fname='tpar3.txt' seq=1

Show JSON schema
{
   "title": "VARIABLEFILE",
   "description": "Variable file specification.\n\n.. code-block:: text\n\n    VARIABLE FILE < [len] 'fname' [seq] >\n\nThere are three types of files:\n\n- TPAR files containing nonstationary wave parameters\n- files containing stationary or nonstationary 1D spectra\n  (usually from measurements)\n- files containing stationary or nonstationary 2D spectra\n  (from other computer programs or other SWAN runs)\n\nA TPAR file is for only one location; it has the string TPAR on the first\nline of the file and a number of lines which each contain 5 numbers, i.e.:\nTime (ISO-notation), Hs, Period (average or peak period depending on the\nchoice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian,\ndepending on command SET), Directional spread (in degrees or as power of cos\ndepending on the choice given in command BOUND SHAPE).\n\nNote\n----\nExample of a TPAR file:\n\n.. code-block:: text\n\n    TPAR\n    19920516.130000 4.2 12. -110. 22.\n    19920516.180000 4.2 12. -110. 22.\n    19920517.000000 1.2 8. -110. 22.\n    19920517.120000 1.4 8.5 -80. 26\n    19920517.200000 0.9 6.5 -95. 28\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import VARIABLEFILE\n    par = VARIABLEFILE(\n        fname=[\"tpar1.txt\", \"tpar2.txt\", \"tpar3.txt\"],\n        len=[0.0, 0.5, 1.0],\n    )\n    print(par.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "variablefile",
         "description": "Model type discriminator",
         "enum": [
            "variablefile",
            "VARIABLEFILE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "fname": {
         "description": "Names of the files containing the boundary condition",
         "items": {
            "maxLength": 36,
            "type": "string"
         },
         "title": "Fname",
         "type": "array"
      },
      "seq": {
         "anyOf": [
            {
               "items": {
                  "minimum": 1,
                  "type": "integer"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case [seq] must always be 1.",
         "title": "Seq"
      },
      "len": {
         "description": "Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. [len] is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of `len` should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment.",
         "items": {
            "minimum": 0,
            "type": "number"
         },
         "title": "Len",
         "type": "array"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname",
      "len"
   ]
}

Fields:
Validators:
field dist: list[float] [Required] (alias 'len')

Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. [len] is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of len should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment.

Validated by:
field fname: list[str] [Required]

Names of the files containing the boundary condition

Validated by:
field model_type: Literal['variablefile', 'VARIABLEFILE'] = 'variablefile'

Model type discriminator

Validated by:
field seq: list[int] | None = None

sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case [seq] must always be 1.

Validated by:
cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator ensure_equal_size  »  all fields[source]
render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.VARIABLEPAR[source]

Variable spectral parameter.

VARIABLE PAR < [len] [hs] [per] [dir] [dd] >

Examples

In [1]: from rompy.swan.subcomponents.boundary import VARIABLEPAR

In [2]: par = VARIABLEPAR(
   ...:     hs=[1.5, 1.4, 1.1],
   ...:     per=[8.1, 8.0, 8.1],
   ...:     dir=[225, 226, 228],
   ...:     dd=[25, 22, 23],
   ...:     len=[0, 0.5, 1.0],
   ...: )
   ...: 

In [3]: print(par.render())
VARIABLE PAR &
	len=0.0 hs=1.5 per=8.1 dir=225.0 dd=25.0 &
	len=0.5 hs=1.4 per=8.0 dir=226.0 dd=22.0 &
	len=1.0 hs=1.1 per=8.1 dir=228.0 dd=23.0

Show JSON schema
{
   "title": "VARIABLEPAR",
   "description": "Variable spectral parameter.\n\n.. code-block:: text\n\n    VARIABLE PAR < [len] [hs] [per] [dir] [dd] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import VARIABLEPAR\n    par = VARIABLEPAR(\n        hs=[1.5, 1.4, 1.1],\n        per=[8.1, 8.0, 8.1],\n        dir=[225, 226, 228],\n        dd=[25, 22, 23],\n        len=[0, 0.5, 1.0],\n    )\n    print(par.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "variablepar",
         "description": "Model type discriminator",
         "enum": [
            "variablepar",
            "VARIABLEPAR"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "hs": {
         "description": "The significant wave height (m)",
         "items": {
            "minimum": 0.0,
            "type": "number"
         },
         "title": "Hs",
         "type": "array"
      },
      "per": {
         "description": "The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); `per` is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or `per` is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE",
         "items": {
            "minimum": 0.0,
            "type": "number"
         },
         "title": "Per",
         "type": "array"
      },
      "dir": {
         "description": "The peak wave direction thetapeak (degrees), constant over frequencies",
         "items": {
            "maximum": 360.0,
            "minimum": -360.0,
            "type": "number"
         },
         "title": "Dir",
         "type": "array"
      },
      "dd": {
         "description": "Coefficient of directional spreading; a $cos^m(\u03b8)$ distribution is assumed. `dd` is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). `dd` is interpreted as the power `m`, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)",
         "items": {
            "maximum": 360.0,
            "minimum": 0.0,
            "type": "number"
         },
         "title": "Dd",
         "type": "array"
      },
      "len": {
         "description": "Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. `len` is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of `len` should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment",
         "items": {
            "minimum": 0,
            "type": "number"
         },
         "title": "Len",
         "type": "array"
      }
   },
   "additionalProperties": false,
   "required": [
      "hs",
      "per",
      "dir",
      "dd",
      "len"
   ]
}

Fields:
Validators:
field dd: list[float] [Required]

Coefficient of directional spreading; a $cos^m(θ)$ distribution is assumed. dd is interpreted as the directional standard deviation in degrees, if the option DEGREES is chosen in the command BOUND SHAPE (SWAN default: 30). dd is interpreted as the power m, if the option POWER is chosen in the command BOUND SHAPE (SWAN default: 2)

Validated by:
field dir: list[float] [Required]

The peak wave direction thetapeak (degrees), constant over frequencies

Validated by:
field dist: list[float] [Required] (alias 'len')

Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. len is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of len should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment

Validated by:
field hs: list[float] [Required]

The significant wave height (m)

Validated by:
field model_type: Literal['variablepar', 'VARIABLEPAR'] = 'variablepar'

Model type discriminator

Validated by:
field per: list[float] [Required]

The characteristic period (s) of the energy spectrum (relative frequency; which is equal to absolute frequency in the absence of currents); per is the value of the peak period if option PEAK is chosen in command BOUND SHAPE or per is the value of the mean period, if option MEAN was chosen in command BOUND SHAPE

Validated by:
cmd() str[source]

Render subcomponent cmd.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

validator ensure_equal_size  »  all fields[source]
render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.boundary.ZERO[source]

Zero initial conditions.

ZERO

The initial spectral densities are all 0; note that if waves are generated in the model only by wind, waves can become non-zero only by the presence of the ”A” term in the growth model; see the keyword AGROW in command GEN3.

Examples

In [1]: from rompy.swan.subcomponents.boundary import ZERO

In [2]: init = ZERO()

In [3]: print(init.render())
ZERO

Show JSON schema
{
   "title": "ZERO",
   "description": "Zero initial conditions.\n\n.. code-block:: text\n\n    ZERO\n\nThe initial spectral densities are all 0; note that if waves are generated in the\nmodel only by wind, waves can become non-zero only by the presence of the\n\u201dA\u201d term in the growth model; see the keyword AGROW in command GEN3.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.boundary import ZERO\n    init = ZERO()\n    print(init.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "zero",
         "description": "Model type discriminator",
         "enum": [
            "zero",
            "ZERO"
         ],
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['zero', 'ZERO'] = 'zero'

Model type discriminator

cmd() str
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

Physics#

SWAN physics subcomponents.

pydantic model rompy.swan.subcomponents.physics.DANGREMOND[source]

DAM transmission of d’Angremond et al. (1996).

DAM DANGREMOND [hgt] [slope] [Bk]

This option specifies transmission coefficients dependent on the incident wave conditions at the obstacle and on the obstacle height (which may be submerged).

References

d’Angremond, K., Van Der Meer, J.W. and De Jong, R.J., 1996. Wave transmission at low-crested structures. In Coastal Engineering 1996 (pp. 2418-2427).

Examples

In [1]: from rompy.swan.subcomponents.physics import DANGREMOND

In [2]: transm = DANGREMOND(hgt=3.0, slope=60, Bk=10.0)

In [3]: print(transm.render())
DAM DANGREMOND hgt=3.0 slope=60.0 Bk=10.0

Show JSON schema
{
   "title": "DANGREMOND",
   "description": "DAM transmission of d'Angremond et al. (1996).\n\n.. code-block:: text\n\n    DAM DANGREMOND [hgt] [slope] [Bk]\n\nThis option specifies transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nd'Angremond, K., Van Der Meer, J.W. and De Jong, R.J., 1996. Wave transmission at\nlow-crested structures. In Coastal Engineering 1996 (pp. 2418-2427).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DANGREMOND\n    transm = DANGREMOND(hgt=3.0, slope=60, Bk=10.0)\n    print(transm.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "dangremond",
         "description": "Model type discriminator",
         "enum": [
            "dangremond",
            "DANGREMOND"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "hgt": {
         "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
         "title": "Hgt",
         "type": "number"
      },
      "slope": {
         "description": "The slope of the obstacle (in degrees)",
         "maximum": 90.0,
         "minimum": 0.0,
         "title": "Slope",
         "type": "number"
      },
      "Bk": {
         "description": "The crest width of the obstacle",
         "title": "Bk",
         "type": "number"
      }
   },
   "additionalProperties": false,
   "required": [
      "hgt",
      "slope",
      "Bk"
   ]
}

Fields:
field Bk: float [Required]

The crest width of the obstacle

field hgt: float [Required]

The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level

field model_type: Literal['dangremond', 'DANGREMOND'] = 'dangremond'

Model type discriminator

field slope: float [Required]

The slope of the obstacle (in degrees)

Constraints:
  • ge = 0.0

  • le = 90.0

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.DEWIT[source]

Biphase of De Wit (2022).

BIPHASE DEWIT [lpar]

Biphase parameterization based on bed slope and peak period of De Wit (2022).

References

De Wit, F.P., 2022. Wave shape prediction in complex coastal systems (Doctoral dissertation, PhD. thesis. Delft University of Technology. https://repository. tudelft. nl/islandora/object/uuid% 3A0fb850a4-4294-4181-9d74-857de21265c2).

Examples

In [1]: from rompy.swan.subcomponents.physics import DEWIT

In [2]: biphase = DEWIT()

In [3]: print(biphase.render())
BIPHASE DEWIT

In [4]: biphase = DEWIT(lpar=0.0)

In [5]: print(biphase.render())
BIPHASE DEWIT lpar=0.0

Show JSON schema
{
   "title": "DEWIT",
   "description": "Biphase of De Wit (2022).\n\n.. code-block:: text\n\n    BIPHASE DEWIT [lpar]\n\nBiphase parameterization based on bed slope and peak period of De Wit (2022).\n\nReferences\n----------\nDe Wit, F.P., 2022. Wave shape prediction in complex coastal systems (Doctoral\ndissertation, PhD. thesis. Delft University of Technology. https://repository.\ntudelft. nl/islandora/object/uuid% 3A0fb850a4-4294-4181-9d74-857de21265c2).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import DEWIT\n    biphase = DEWIT()\n    print(biphase.render())\n    biphase = DEWIT(lpar=0.0)\n    print(biphase.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "dewit",
         "default": "dewit",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "lpar": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Scales spatial averaging of the De Wit's biphase in terms of a multiple of peak wave length of the incident wave field. Note: `lpar` = 0` means no averaging (SWAN default: 0)",
         "title": "Lpar"
      }
   },
   "additionalProperties": false
}

Fields:
field lpar: float | None = None

Scales spatial averaging of the De Wit’s biphase in terms of a multiple of peak wave length of the incident wave field. Note: lpar = 0` means no averaging (SWAN default: 0)

field model_type: Literal['dewit'] = 'dewit'

Model type discriminator

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.ELDEBERKY[source]

Biphase of Eldeberky (1999).

BIPHASE ELDEBERKY [urcrit]

Biphase parameterisation as a funtion of the Ursell number of Eldeberky (1999).

References

Eldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for modeling triad interactions in dispersive waves. In Coastal Engineering 1996 (pp. 1088-1101).

Eldeberky, Y. and Madsen, P.A., 1999. Deterministic and stochastic evolution equations for fully dispersive and weakly nonlinear waves. Coastal Engineering, 38(1), pp.1-24.

Doering, J.C. and Bowen, A.J., 1995. Parametrization of orbital velocity asymmetries of shoaling and breaking waves using bispectral analysis. Coastal engineering, 26(1-2), pp.15-33.

Examples

In [1]: from rompy.swan.subcomponents.physics import ELDEBERKY

In [2]: biphase = ELDEBERKY()

In [3]: print(biphase.render())
BIPHASE ELDEBERKY

In [4]: biphase = ELDEBERKY(urcrit=0.63)

In [5]: print(biphase.render())
BIPHASE ELDEBERKY urcrit=0.63

Show JSON schema
{
   "title": "ELDEBERKY",
   "description": "Biphase of Eldeberky (1999).\n\n.. code-block:: text\n\n    BIPHASE ELDEBERKY [urcrit]\n\nBiphase parameterisation as a funtion of the Ursell number of Eldeberky (1999).\n\nReferences\n----------\nEldeberky, Y., Polnikov, V. and Battjes, J.A., 1996. A statistical approach for\nmodeling triad interactions in dispersive waves. In Coastal Engineering 1996\n(pp. 1088-1101).\n\nEldeberky, Y. and Madsen, P.A., 1999. Deterministic and stochastic evolution\nequations for fully dispersive and weakly nonlinear waves. Coastal Engineering,\n38(1), pp.1-24.\n\nDoering, J.C. and Bowen, A.J., 1995. Parametrization of orbital velocity\nasymmetries of shoaling and breaking waves using bispectral analysis. Coastal\nengineering, 26(1-2), pp.15-33.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ELDEBERKY\n    biphase = ELDEBERKY()\n    print(biphase.render())\n    biphase = ELDEBERKY(urcrit=0.63)\n    print(biphase.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "eldeberky",
         "default": "eldeberky",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "urcrit": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The critical Ursell number appearing in the parametrization. Note: the value of `urcrit` is setted by Eldeberky (1996) at 0.2 based on a laboratory experiment, whereas Doering and Bowen (1995) employed the value of 0.63 based on the field experiment data (SWAN default: 0.63)",
         "title": "Urcrit"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['eldeberky'] = 'eldeberky'

Model type discriminator

field urcrit: float | None = None

The critical Ursell number appearing in the parametrization. Note: the value of urcrit is setted by Eldeberky (1996) at 0.2 based on a laboratory experiment, whereas Doering and Bowen (1995) employed the value of 0.63 based on the field experiment data (SWAN default: 0.63)

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.FREEBOARD[source]

Freeboard dependent transmission and reflection.

FREEBOARD [hgt] [gammat] [gammar] [QUAY]

With this option the user indicates that the fixed transmission trcoef and reflection reflc coefficients are freeboard dependent. The freeboard dependency has no effect on the transmission coefficient as computed using the DAM option.

Notes

See the Scientific/Technical documentation for background information on the gammat and gammar shape parameters.

Examples

In [1]: from rompy.swan.subcomponents.physics import FREEBOARD

In [2]: freeboard = FREEBOARD(hgt=2.0)

In [3]: print(freeboard.render())
FREEBOARD hgt=2.0

In [4]: freeboard = FREEBOARD(hgt=2.0, gammat=1.0, gammar=1.0, quay=True)

In [5]: print(freeboard.render())
FREEBOARD hgt=2.0 gammat=1.0 gammar=1.0 QUAY

Show JSON schema
{
   "title": "FREEBOARD",
   "description": "Freeboard dependent transmission and reflection.\n\n.. code-block:: text\n\n    FREEBOARD [hgt] [gammat] [gammar] [QUAY]\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nSee the Scientific/Technical documentation for background information on the\n`gammat` and `gammar` shape parameters.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import FREEBOARD\n    freeboard = FREEBOARD(hgt=2.0)\n    print(freeboard.render())\n    freeboard = FREEBOARD(hgt=2.0, gammat=1.0, gammar=1.0, quay=True)\n    print(freeboard.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "freeboard",
         "description": "Model type discriminator",
         "enum": [
            "freeboard",
            "FREEBOARD"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "hgt": {
         "description": "The elevation of the top of the obstacle or height of the quay above the reference level (same reference level as for the bottom). Use a negative value if the top is below that reference level. In case `hgt` is also specified in the DAM option, both values of `hgt` should be equal for consistency",
         "title": "Hgt",
         "type": "number"
      },
      "gammat": {
         "anyOf": [
            {
               "exclusiveMinimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Shape parameter of relative freeboard dependency of transmission coefficient. This parameter should be higher than zero (SWAN default 1.0)",
         "title": "Gammat"
      },
      "gammar": {
         "anyOf": [
            {
               "exclusiveMinimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Shape parameter of relative freeboard dependency of reflection coefficient. This parameter should be higher than zero (SWAN default 1.0)",
         "title": "Gammar"
      },
      "quay": {
         "default": false,
         "description": "With this option the user indicates that the freeboard dependency of the transmission and reflection coefficients also depends on the relative position of an obstacle-linked grid point with respect to the position of the obstacle line representing the edge of a quay. In case the active grid point is on the deeper side of the obstacle, then the correction factors are applied using the parameters `hgt`, `gammat` and `gammar`.In case the active grid point is on the shallower side of the obstacle, the reflection coefficient is set to 0 and the transmission coefficient to 1.",
         "title": "Quay",
         "type": "boolean"
      }
   },
   "additionalProperties": false,
   "required": [
      "hgt"
   ]
}

Fields:
field gammar: float | None = None

Shape parameter of relative freeboard dependency of reflection coefficient. This parameter should be higher than zero (SWAN default 1.0)

Constraints:
  • gt = 0.0

field gammat: float | None = None

Shape parameter of relative freeboard dependency of transmission coefficient. This parameter should be higher than zero (SWAN default 1.0)

Constraints:
  • gt = 0.0

field hgt: float [Required]

The elevation of the top of the obstacle or height of the quay above the reference level (same reference level as for the bottom). Use a negative value if the top is below that reference level. In case hgt is also specified in the DAM option, both values of hgt should be equal for consistency

field model_type: Literal['freeboard', 'FREEBOARD'] = 'freeboard'

Model type discriminator

field quay: bool = False

With this option the user indicates that the freeboard dependency of the transmission and reflection coefficients also depends on the relative position of an obstacle-linked grid point with respect to the position of the obstacle line representing the edge of a quay. In case the active grid point is on the deeper side of the obstacle, then the correction factors are applied using the parameters hgt, gammat and gammar.In case the active grid point is on the shallower side of the obstacle, the reflection coefficient is set to 0 and the transmission coefficient to 1.

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.GODA[source]

DAM transmission of Goda/Seelig (1979).

DAM GODA [hgt] [alpha] [beta]

This option specified transmission coefficients dependent on the incident wave conditions at the obstacle and on the obstacle height (which may be submerged).

References

Goda, Y. and Suzuki, Y., 1976. Estimation of incident and reflected waves in random wave experiments. In Coastal Engineering 1976 (pp. 828-845).

Seelig, W.N., 1979. Effects of breakwaters on waves: Laboratory test of wave transmission by overtopping. In Proc. Conf. Coastal Structures, 1979 (Vol. 79, No. 2, pp. 941-961).

Examples

In [1]: from rompy.swan.subcomponents.physics import GODA

In [2]: transm = GODA(hgt=3.0)

In [3]: print(transm.render())
DAM GODA hgt=3.0

In [4]: transm = GODA(hgt=3.0, alpha=2.6, beta=0.15)

In [5]: print(transm.render())
DAM GODA hgt=3.0 alpha=2.6 beta=0.15

Show JSON schema
{
   "title": "GODA",
   "description": "DAM transmission of Goda/Seelig (1979).\n\n.. code-block:: text\n\n    DAM GODA [hgt] [alpha] [beta]\n\nThis option specified transmission coefficients dependent on the incident wave\nconditions at the obstacle and on the obstacle height (which may be submerged).\n\nReferences\n----------\nGoda, Y. and Suzuki, Y., 1976. Estimation of incident and reflected waves in random\nwave experiments. In Coastal Engineering 1976 (pp. 828-845).\n\nSeelig, W.N., 1979. Effects of breakwaters on waves: Laboratory test of wave\ntransmission by overtopping. In Proc. Conf. Coastal Structures, 1979\n(Vol. 79, No. 2, pp. 941-961).\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import GODA\n    transm = GODA(hgt=3.0)\n    print(transm.render())\n    transm = GODA(hgt=3.0, alpha=2.6, beta=0.15)\n    print(transm.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "goda",
         "description": "Model type discriminator",
         "enum": [
            "goda",
            "GODA"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "hgt": {
         "description": "The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level",
         "title": "Hgt",
         "type": "number"
      },
      "alpha": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 2.6)",
         "title": "Alpha"
      },
      "beta": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Another coefficient determining the transmission coefficient for Goda's transmission formula (SWAN default: 0.15)",
         "title": "Beta"
      }
   },
   "additionalProperties": false,
   "required": [
      "hgt"
   ]
}

Fields:
field alpha: float | None = None

coefficient determining the transmission coefficient for Goda’s transmission formula (SWAN default: 2.6)

field beta: float | None = None

Another coefficient determining the transmission coefficient for Goda’s transmission formula (SWAN default: 0.15)

field hgt: float [Required]

The elevation of the top of the obstacle above reference level (same reference level as for bottom etc.); use a negative value if the top is below that reference level

field model_type: Literal['goda', 'GODA'] = 'goda'

Model type discriminator

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.JANSSEN[source]

Janssen source terms subcomponent.

JANSSEN [cds1] [delta] (AGROW [a])

References

Janssen, P.A., 1989. Wave-induced stress and the drag of air flow over sea waves. Journal of Physical Oceanography, 19(6), pp.745-754.

Janssen, P.A.E.M., Lionello, P. and Zambresky, L., 1989. On the interaction of wind and waves. Philosophical transactions of the royal society of London. Series A, Mathematical and Physical Sciences, 329(1604), pp.289-301.

Janssen, P.A., 1991. Quasi-linear theory of wind-wave generation applied to wave forecasting. Journal of physical oceanography, 21(11), pp.1631-1642.

Examples

In [1]: from rompy.swan.subcomponents.physics import JANSSEN

In [2]: janssen = JANSSEN()

In [3]: print(janssen.render())
JANSSEN DRAG WU

In [4]: janssen = JANSSEN(cds1=4.5, delta=0.5, agrow=True)

In [5]: print(janssen.render())
JANSSEN cds1=4.5 delta=0.5 DRAG WU AGROW

Show JSON schema
{
   "title": "JANSSEN",
   "description": "Janssen source terms subcomponent.\n\n.. code-block:: text\n\n    JANSSEN [cds1] [delta] (AGROW [a])\n\nReferences\n----------\nJanssen, P.A., 1989. Wave-induced stress and the drag of air flow over sea waves.\nJournal of Physical Oceanography, 19(6), pp.745-754.\n\nJanssen, P.A.E.M., Lionello, P. and Zambresky, L., 1989. On the interaction of wind\nand waves. Philosophical transactions of the royal society of London. Series A,\nMathematical and Physical Sciences, 329(1604), pp.289-301.\n\nJanssen, P.A., 1991. Quasi-linear theory of wind-wave generation applied to wave\nforecasting. Journal of physical oceanography, 21(11), pp.1631-1642.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import JANSSEN\n    janssen = JANSSEN()\n    print(janssen.render())\n    janssen = JANSSEN(cds1=4.5, delta=0.5, agrow=True)\n    print(janssen.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "janssen",
         "description": "Model type discriminator",
         "enum": [
            "janssen",
            "JANSSEN"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "default": "wu",
         "description": "Indicates the wind drag formulation",
         "enum": [
            "wu",
            "fit"
         ],
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "default": false,
         "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      },
      "cds1": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient for determining the rate of whitecapping dissipation ($Cds / s^4_{PM}$) (SWAN default: 4.5)",
         "title": "Cds1"
      },
      "delta": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient which determines the dependency of the whitecapping on wave number (mix with Komen et al. formulation) (SWAN default: 0.5)",
         "title": "Delta"
      }
   },
   "additionalProperties": false
}

Fields:
field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

field agrow: bool = False

Activate the Cavaleri and Malanotte (1981) wave growth term

field cds1: float | None = None

Coefficient for determining the rate of whitecapping dissipation ($Cds / s^4_{PM}$) (SWAN default: 4.5)

field delta: float | None = None

Coefficient which determines the dependency of the whitecapping on wave number (mix with Komen et al. formulation) (SWAN default: 0.5)

field model_type: Literal['janssen', 'JANSSEN'] = 'janssen'

Model type discriminator

field wind_drag: Literal['wu', 'fit'] = 'wu'

Indicates the wind drag formulation

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.KOMEN[source]

Komen source terms subcomponent.

KOMEN [cds2] [stpm] (AGROW [a])

References

Komen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully developed wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.

Examples

In [1]: from rompy.swan.subcomponents.physics import KOMEN

In [2]: komen = KOMEN()

In [3]: print(komen.render())
KOMEN DRAG WU

In [4]: komen = KOMEN(cds2=2.36e-5, stpm=3.02e-3, agrow=True, a=0.0015)

In [5]: print(komen.render())
KOMEN cds2=2.36e-05 stpm=0.00302 DRAG WU AGROW a=0.0015

Show JSON schema
{
   "title": "KOMEN",
   "description": "Komen source terms subcomponent.\n\n.. code-block:: text\n\n    KOMEN [cds2] [stpm] (AGROW [a])\n\nReferences\n----------\nKomen, G.J., Hasselmann, S. and Hasselmann, K., 1984. On the existence of a fully\ndeveloped wind-sea spectrum. Journal of physical oceanography, 14(8), pp.1271-1285.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import KOMEN\n    komen = KOMEN()\n    print(komen.render())\n    komen = KOMEN(cds2=2.36e-5, stpm=3.02e-3, agrow=True, a=0.0015)\n    print(komen.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "komen",
         "description": "Model type discriminator",
         "enum": [
            "komen",
            "KOMEN"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "default": "wu",
         "description": "Indicates the wind drag formulation",
         "enum": [
            "wu",
            "fit"
         ],
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "default": false,
         "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      },
      "cds2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Coefficient for determining the rate of whitecapping dissipation (`Cds`) (SWAN default: 2.36e-5)",
         "title": "Cds2"
      },
      "stpm": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Value of the wave steepness for a Pierson-Moskowitz spectrum (`s^2_PM`) (SWAN default: 3.02e-3)",
         "title": "Stpm"
      }
   },
   "additionalProperties": false
}

Fields:
field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

field agrow: bool = False

Activate the Cavaleri and Malanotte (1981) wave growth term

field cds2: float | None = None

Coefficient for determining the rate of whitecapping dissipation (Cds) (SWAN default: 2.36e-5)

field model_type: Literal['komen', 'KOMEN'] = 'komen'

Model type discriminator

field stpm: float | None = None

Value of the wave steepness for a Pierson-Moskowitz spectrum (s^2_PM) (SWAN default: 3.02e-3)

field wind_drag: Literal['wu', 'fit'] = 'wu'

Indicates the wind drag formulation

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.LINE[source]

Line of points to define obstacle location.

LINE < [xp] [yp] >

With this option the user indicates that the fixed transmission trcoef and reflection reflc coefficients are freeboard dependent. The freeboard dependency has no effect on the transmission coefficient as computed using the DAM option.

Notes

Points coordinates should be provided in m If Cartesian coordinates are used or in degrees if spherical coordinates are used (see command COORD). At least two corner points must be provided.

Examples

In [1]: from rompy.swan.subcomponents.physics import LINE

In [2]: line = LINE(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1])

In [3]: print(line.render())
LINE 174.1 -39.1 174.2 -39.1 174.3 -39.1

Show JSON schema
{
   "title": "LINE",
   "description": "Line of points to define obstacle location.\n\n.. code-block:: text\n\n    LINE < [xp] [yp] >\n\nWith this option the user indicates that the fixed transmission `trcoef` and\nreflection `reflc` coefficients are freeboard dependent. The freeboard dependency\nhas no effect on the transmission coefficient as computed using the DAM option.\n\nNotes\n-----\nPoints coordinates should be provided in m If Cartesian coordinates are used or in\ndegrees if spherical coordinates are used (see command `COORD`). At least two\ncorner points must be provided.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import LINE\n    line = LINE(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1])\n    print(line.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "line",
         "description": "Model type discriminator",
         "enum": [
            "line",
            "LINE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "xp": {
         "description": "The x-coordinates of the points defining the line",
         "items": {
            "type": "number"
         },
         "minItems": 2,
         "title": "Xp",
         "type": "array"
      },
      "yp": {
         "description": "The y-coordinates of the points defining the line",
         "items": {
            "type": "number"
         },
         "minItems": 2,
         "title": "Yp",
         "type": "array"
      }
   },
   "additionalProperties": false,
   "required": [
      "xp",
      "yp"
   ]
}

Fields:
Validators:
field model_type: Literal['line', 'LINE'] = 'line'

Model type discriminator

Validated by:
field xp: list[float] [Required]

The x-coordinates of the points defining the line

Constraints:
  • min_length = 2

Validated by:
field yp: list[float] [Required]

The y-coordinates of the points defining the line

Constraints:
  • min_length = 2

Validated by:
validator check_length  »  all fields[source]

Check that the length of xp and yp are the same.

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.RDIFF[source]

Diffuse reflection.

RDIFF [pown]

Specular reflection where incident waves are scattered over reflected direction.

Examples

In [1]: from rompy.swan.subcomponents.physics import RDIFF

In [2]: refl = RDIFF()

In [3]: print(refl.render())
RDIFF

In [4]: refl = RDIFF(pown=1.0)

In [5]: print(refl.render())
RDIFF pown=1.0

Show JSON schema
{
   "title": "RDIFF",
   "description": "Diffuse reflection.\n\n.. code-block:: text\n\n    RDIFF [pown]\n\nSpecular reflection where incident waves are scattered over reflected direction.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RDIFF\n    refl = RDIFF()\n    print(refl.render())\n    refl = RDIFF(pown=1.0)\n    print(refl.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "rdiff",
         "description": "Model type discriminator",
         "enum": [
            "rdiff",
            "RDIFF"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "pown": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Each incoming direction \u03b8 is scattered over reflected direction \u03b8_refl according to cos^pown(\u03b8-\u03b8_refl). The parameter `pown` indicates the widthof the redistribution function (SWAN default: 1.0)",
         "title": "Pown"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['rdiff', 'RDIFF'] = 'rdiff'

Model type discriminator

field pown: float | None = None

Each incoming direction θ is scattered over reflected direction θ_refl according to cos^pown(θ-θ_refl). The parameter pown indicates the widthof the redistribution function (SWAN default: 1.0)

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.REFL[source]

Obstacle reflections.

REFL [reflc]

Examples

In [1]: from rompy.swan.subcomponents.physics import REFL

In [2]: refl = REFL()

In [3]: print(refl.render())
REFL

In [4]: refl = REFL(reflc=0.5)

In [5]: print(refl.render())
REFL reflc=0.5

Show JSON schema
{
   "title": "REFL",
   "description": "Obstacle reflections.\n\n.. code-block:: text\n\n    REFL [reflc]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import REFL\n    refl = REFL()\n    print(refl.render())\n    refl = REFL(reflc=0.5)\n    print(refl.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "refl",
         "description": "Model type discriminator",
         "enum": [
            "refl",
            "REFL"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "reflc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Constant reflection coefficient (ratio of reflected over incoming significant wave height) (SWAN default: 1.0)",
         "title": "Reflc"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['refl', 'REFL'] = 'refl'

Model type discriminator

field reflc: float | None = None

Constant reflection coefficient (ratio of reflected over incoming significant wave height) (SWAN default: 1.0)

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.RSPEC[source]

Specular reflection.

RSPEC

Examples

In [1]: from rompy.swan.subcomponents.physics import RSPEC

In [2]: refl = RSPEC()

In [3]: print(refl.render())
RSPEC

Show JSON schema
{
   "title": "RSPEC",
   "description": "Specular reflection.\n\n.. code-block:: text\n\n    RSPEC\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import RSPEC\n    refl = RSPEC()\n    print(refl.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "rspec",
         "description": "Model type discriminator",
         "enum": [
            "rspec",
            "RSPEC"
         ],
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['rspec', 'RSPEC'] = 'rspec'

Model type discriminator

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.ST6[source]

St6 source terms subcomponent.

ST6 [a1sds] [a2sds] [p1sds] [p2sds] UP|DOWN HWANG|FAN|ECMWF VECTAU|SCATAU &
    TRUE10|U10PROXY [windscaling] DEBIAS [cdfac] (AGROW [a])

wind input and whitecapping from Rogers et al. (2012) (RBW12).

Notes

The two arguments are specified in the Appendix C of the User manual but not in the command description for WESTH in Section 4.5.4. They are also options in the WCAPPING command. It is not entirely clear if they should/could be specified here.

References

Fan, Y., Lin, S.J., Held, I.M., Yu, Z. and Tolman, H.L., 2012. Global ocean surface wave simulation using a coupled atmosphere–wave model. Journal of Climate, 25(18), pp.6233-6252.

Rogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and whitecapping dissipation in a model for wind-generated surface waves: Description and simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9), pp.1329-1346.

Examples

In [1]: from rompy.swan.subcomponents.physics import ST6

In [2]: st6 = ST6(a1sds=4.7e-7, a2sds=6.6e-6)

In [3]: print(st6.render())
ST6 a1sds=4.7e-07 a2sds=6.6e-06 UP HWANG VECTAU U10PROXY windscaling=32.0

In [4]: kwargs = dict(
   ...:     a1sds=2.8e-6,
   ...:     a2sds=3.5e-5,
   ...:     normalization="up",
   ...:     wind_drag="hwang",
   ...:     tau="vectau",
   ...:     u10="u10proxy",
   ...:     windscaling=32.0,
   ...:     cdfac=0.89,
   ...:     agrow=True,
   ...:     a=0.0015,
   ...: )
   ...: 

In [5]: st6 = ST6(**kwargs)

In [6]: print(st6.render())
ST6 a1sds=2.8e-06 a2sds=3.5e-05 UP HWANG VECTAU U10PROXY windscaling=32.0 DEBIAS cdfac=0.89 AGROW a=0.0015

Show JSON schema
{
   "title": "ST6",
   "description": "St6 source terms subcomponent.\n\n.. code-block:: text\n\n    ST6 [a1sds] [a2sds] [p1sds] [p2sds] UP|DOWN HWANG|FAN|ECMWF VECTAU|SCATAU &\n        TRUE10|U10PROXY [windscaling] DEBIAS [cdfac] (AGROW [a])\n\nwind input and whitecapping from Rogers et al. (2012) (RBW12).\n\nNotes\n-----\nThe two arguments are specified in the Appendix C of the User manual but not in the\ncommand description for WESTH in Section 4.5.4. They are also options in the\nWCAPPING command. It is not entirely clear if they should/could be specified here.\n\nReferences\n----------\nFan, Y., Lin, S.J., Held, I.M., Yu, Z. and Tolman, H.L., 2012. Global ocean surface\nwave simulation using a coupled atmosphere\u2013wave model. Journal of Climate, 25(18),\npp.6233-6252.\n\nRogers, W.E., Babanin, A.V. and Wang, D.W., 2012. Observation-consistent input and\nwhitecapping dissipation in a model for wind-generated surface waves: Description\nand simple calculations. Journal of Atmospheric and Oceanic Technology, 29(9),\npp.1329-1346.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6\n    st6 = ST6(a1sds=4.7e-7, a2sds=6.6e-6)\n    print(st6.render())\n    kwargs = dict(\n        a1sds=2.8e-6,\n        a2sds=3.5e-5,\n        normalization=\"up\",\n        wind_drag=\"hwang\",\n        tau=\"vectau\",\n        u10=\"u10proxy\",\n        windscaling=32.0,\n        cdfac=0.89,\n        agrow=True,\n        a=0.0015,\n    )\n    st6 = ST6(**kwargs)\n    print(st6.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "st6",
         "default": "st6",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "default": "hwang",
         "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
         "enum": [
            "hwang",
            "fan",
            "ecmwf"
         ],
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "default": false,
         "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      },
      "a1sds": {
         "description": "Coefficient related to local dissipation term T1 (a1 in RBW12)",
         "title": "A1Sds",
         "type": "number"
      },
      "a2sds": {
         "description": "Coefficient related to local dissipation term T2 (a2 in RBW12)",
         "title": "A2Sds",
         "type": "number"
      },
      "p1sds": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Power coefficient controlling strength of dissipation term T1 (L in RBW12, SWAN default: 4)",
         "title": "P1Sds"
      },
      "p2sds": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Power coefficient controlling strength of dissipation term T2 (M in RBW12, SWAN default: 4)",
         "title": "P2Sds"
      },
      "normalization": {
         "default": "up",
         "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
         "enum": [
            "up",
            "down"
         ],
         "title": "Normalization",
         "type": "string"
      },
      "tau": {
         "default": "vectau",
         "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
         "enum": [
            "vectau",
            "scatau"
         ],
         "title": "Tau",
         "type": "string"
      },
      "u10": {
         "default": "u10proxy",
         "description": "Wind velocity definition",
         "enum": [
            "u10proxy",
            "true10"
         ],
         "title": "U10",
         "type": "string"
      },
      "windscaling": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": 32.0,
         "description": "Factor to scale U10 with U* when using U10PROXY",
         "title": "Windscaling"
      },
      "cdfac": {
         "anyOf": [
            {
               "exclusiveMinimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
         "title": "Cdfac"
      }
   },
   "additionalProperties": false,
   "required": [
      "a1sds",
      "a2sds"
   ]
}

Fields:
Validators:
field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

Validated by:
field a1sds: float [Required]

Coefficient related to local dissipation term T1 (a1 in RBW12)

Validated by:
field a2sds: float [Required]

Coefficient related to local dissipation term T2 (a2 in RBW12)

Validated by:
field agrow: bool = False

Activate the Cavaleri and Malanotte (1981) wave growth term

Validated by:
field cdfac: float | None = None

Counter bias in the input wind fields by providing a multiplier on the drag coefficient

Constraints:
  • gt = 0.0

Validated by:
field model_type: Literal['st6'] = 'st6'

Model type discriminator

Validated by:
field normalization: Literal['up', 'down'] = 'up'

Selection of normalization of exceedance level by ET(f) (up) or E(f) (down) as in RBW12 (right column, page 1333), up is default and strongly recommended

Validated by:
field p1sds: float | None = None

Power coefficient controlling strength of dissipation term T1 (L in RBW12, SWAN default: 4)

Validated by:
field p2sds: float | None = None

Power coefficient controlling strength of dissipation term T2 (M in RBW12, SWAN default: 4)

Validated by:
field tau: Literal['vectau', 'scatau'] = 'vectau'

Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), vectau is the default and strongly recommended

Validated by:
field u10: Literal['u10proxy', 'true10'] = 'u10proxy'

Wind velocity definition

Validated by:
field wind_drag: Literal['hwang', 'fan', 'ecmwf'] = 'hwang'

Wind drag formula, hwang is the default and is unchanged from RBW12, fan is from Fan et al. (2012), ecmwf follows WAM Cycle 4 methodology

Validated by:
field windscaling: float | None = 32.0

Factor to scale U10 with U* when using U10PROXY

Validated by:
cmd() str[source]
validator debias_only_with_hwang  »  all fields[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property u10_cmd: str
pydantic model rompy.swan.subcomponents.physics.ST6C1[source]

First ST6 calibration in the SWAN user manual.

ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW

Examples

In [1]: from rompy.swan.subcomponents.physics import ST6C1

In [2]: st6 = ST6C1()

In [3]: print(st6.render())
ST6 a1sds=4.7e-07 a2sds=6.6e-06 p1sds=4.0 p2sds=4.0 UP HWANG VECTAU U10PROXY windscaling=28.0 AGROW

Show JSON schema
{
   "title": "ST6C1",
   "description": "First ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C1\n    st6 = ST6C1()\n    print(st6.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "st6c1",
         "default": "st6c1",
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "default": "hwang",
         "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
         "enum": [
            "hwang",
            "fan",
            "ecmwf"
         ],
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "const": true,
         "default": true,
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      },
      "a1sds": {
         "const": 4.7e-07,
         "default": 4.7e-07,
         "title": "A1Sds",
         "type": "number"
      },
      "a2sds": {
         "const": 6.6e-06,
         "default": 6.6e-06,
         "title": "A2Sds",
         "type": "number"
      },
      "p1sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P1Sds",
         "type": "number"
      },
      "p2sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P2Sds",
         "type": "number"
      },
      "normalization": {
         "default": "up",
         "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
         "enum": [
            "up",
            "down"
         ],
         "title": "Normalization",
         "type": "string"
      },
      "tau": {
         "default": "vectau",
         "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
         "enum": [
            "vectau",
            "scatau"
         ],
         "title": "Tau",
         "type": "string"
      },
      "u10": {
         "default": "u10proxy",
         "description": "Wind velocity definition",
         "enum": [
            "u10proxy",
            "true10"
         ],
         "title": "U10",
         "type": "string"
      },
      "windscaling": {
         "const": 28.0,
         "default": 28.0,
         "title": "Windscaling",
         "type": "number"
      },
      "cdfac": {
         "anyOf": [
            {
               "exclusiveMinimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
         "title": "Cdfac"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • debias_only_with_hwang » all fields

field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

Validated by:
  • debias_only_with_hwang

field a1sds: Literal[4.7e-07] = 4.7e-07
Validated by:
  • debias_only_with_hwang

field a2sds: Literal[6.6e-06] = 6.6e-06
Validated by:
  • debias_only_with_hwang

field agrow: Literal[True] = True
Validated by:
  • debias_only_with_hwang

field cdfac: float | None = None

Counter bias in the input wind fields by providing a multiplier on the drag coefficient

Constraints:
  • gt = 0.0

Validated by:
  • debias_only_with_hwang

field model_type: Literal['st6c1'] = 'st6c1'
Validated by:
  • debias_only_with_hwang

field normalization: Literal['up', 'down'] = 'up'

Selection of normalization of exceedance level by ET(f) (up) or E(f) (down) as in RBW12 (right column, page 1333), up is default and strongly recommended

Validated by:
  • debias_only_with_hwang

field p1sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field p2sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field tau: Literal['vectau', 'scatau'] = 'vectau'

Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), vectau is the default and strongly recommended

Validated by:
  • debias_only_with_hwang

field u10: Literal['u10proxy', 'true10'] = 'u10proxy'

Wind velocity definition

Validated by:
  • debias_only_with_hwang

field wind_drag: Literal['hwang', 'fan', 'ecmwf'] = 'hwang'

Wind drag formula, hwang is the default and is unchanged from RBW12, fan is from Fan et al. (2012), ecmwf follows WAM Cycle 4 methodology

Validated by:
  • debias_only_with_hwang

field windscaling: Literal[28.0] = 28.0
Validated by:
  • debias_only_with_hwang

cmd() str
validator debias_only_with_hwang  »  all fields
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property u10_cmd: str
pydantic model rompy.swan.subcomponents.physics.ST6C2[source]

Second ST6 calibration in the SWAN user manual.

ST6 4.7e-7 6.6e-6 4.0 4.0 UP FAN VECTAU U10PROXY 28.0 AGROW

Examples

In [1]: from rompy.swan.subcomponents.physics import ST6C2

In [2]: st6 = ST6C2()

In [3]: print(st6.render())
ST6 a1sds=4.7e-07 a2sds=6.6e-06 p1sds=4.0 p2sds=4.0 UP FAN VECTAU U10PROXY windscaling=28.0 AGROW

TODO: Ensure validator is reused here so fan and debias are not used together.

Show JSON schema
{
   "title": "ST6C2",
   "description": "Second ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP FAN VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C2\n    st6 = ST6C2()\n    print(st6.render())\n\nTODO: Ensure validator is reused here so fan and debias are not used together.",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "st6c2",
         "default": "st6c2",
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "const": "fan",
         "default": "fan",
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "const": true,
         "default": true,
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      },
      "a1sds": {
         "const": 4.7e-07,
         "default": 4.7e-07,
         "title": "A1Sds",
         "type": "number"
      },
      "a2sds": {
         "const": 6.6e-06,
         "default": 6.6e-06,
         "title": "A2Sds",
         "type": "number"
      },
      "p1sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P1Sds",
         "type": "number"
      },
      "p2sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P2Sds",
         "type": "number"
      },
      "normalization": {
         "default": "up",
         "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
         "enum": [
            "up",
            "down"
         ],
         "title": "Normalization",
         "type": "string"
      },
      "tau": {
         "default": "vectau",
         "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
         "enum": [
            "vectau",
            "scatau"
         ],
         "title": "Tau",
         "type": "string"
      },
      "u10": {
         "default": "u10proxy",
         "description": "Wind velocity definition",
         "enum": [
            "u10proxy",
            "true10"
         ],
         "title": "U10",
         "type": "string"
      },
      "windscaling": {
         "const": 28.0,
         "default": 28.0,
         "title": "Windscaling",
         "type": "number"
      },
      "cdfac": {
         "anyOf": [
            {
               "exclusiveMinimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
         "title": "Cdfac"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • debias_only_with_hwang » all fields

field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

Validated by:
  • debias_only_with_hwang

field a1sds: Literal[4.7e-07] = 4.7e-07
Validated by:
  • debias_only_with_hwang

field a2sds: Literal[6.6e-06] = 6.6e-06
Validated by:
  • debias_only_with_hwang

field agrow: Literal[True] = True
Validated by:
  • debias_only_with_hwang

field cdfac: float | None = None

Counter bias in the input wind fields by providing a multiplier on the drag coefficient

Constraints:
  • gt = 0.0

Validated by:
  • debias_only_with_hwang

field model_type: Literal['st6c2'] = 'st6c2'
Validated by:
  • debias_only_with_hwang

field normalization: Literal['up', 'down'] = 'up'

Selection of normalization of exceedance level by ET(f) (up) or E(f) (down) as in RBW12 (right column, page 1333), up is default and strongly recommended

Validated by:
  • debias_only_with_hwang

field p1sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field p2sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field tau: Literal['vectau', 'scatau'] = 'vectau'

Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), vectau is the default and strongly recommended

Validated by:
  • debias_only_with_hwang

field u10: Literal['u10proxy', 'true10'] = 'u10proxy'

Wind velocity definition

Validated by:
  • debias_only_with_hwang

field wind_drag: Literal['fan'] = 'fan'
Validated by:
  • debias_only_with_hwang

field windscaling: Literal[28.0] = 28.0
Validated by:
  • debias_only_with_hwang

cmd() str
validator debias_only_with_hwang  »  all fields
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property u10_cmd: str
pydantic model rompy.swan.subcomponents.physics.ST6C3[source]

Third ST6 calibration in the SWAN user manual.

ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 AGROW

Examples

In [1]: from rompy.swan.subcomponents.physics import ST6C3

In [2]: st6 = ST6C3()

In [3]: print(st6.render())
ST6 a1sds=2.8e-06 a2sds=3.5e-05 p1sds=4.0 p2sds=4.0 UP HWANG VECTAU U10PROXY windscaling=32.0 AGROW

Show JSON schema
{
   "title": "ST6C3",
   "description": "Third ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C3\n    st6 = ST6C3()\n    print(st6.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "st6c3",
         "default": "st6c3",
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "default": "hwang",
         "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
         "enum": [
            "hwang",
            "fan",
            "ecmwf"
         ],
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "const": true,
         "default": true,
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      },
      "a1sds": {
         "const": 2.8e-06,
         "default": 2.8e-06,
         "title": "A1Sds",
         "type": "number"
      },
      "a2sds": {
         "const": 3.5e-05,
         "default": 3.5e-05,
         "title": "A2Sds",
         "type": "number"
      },
      "p1sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P1Sds",
         "type": "number"
      },
      "p2sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P2Sds",
         "type": "number"
      },
      "normalization": {
         "default": "up",
         "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
         "enum": [
            "up",
            "down"
         ],
         "title": "Normalization",
         "type": "string"
      },
      "tau": {
         "default": "vectau",
         "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
         "enum": [
            "vectau",
            "scatau"
         ],
         "title": "Tau",
         "type": "string"
      },
      "u10": {
         "default": "u10proxy",
         "description": "Wind velocity definition",
         "enum": [
            "u10proxy",
            "true10"
         ],
         "title": "U10",
         "type": "string"
      },
      "windscaling": {
         "const": 32.0,
         "default": 32.0,
         "title": "Windscaling",
         "type": "number"
      },
      "cdfac": {
         "anyOf": [
            {
               "exclusiveMinimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Counter bias in the input wind fields by providing a multiplier on the drag coefficient",
         "title": "Cdfac"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • debias_only_with_hwang » all fields

field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

Validated by:
  • debias_only_with_hwang

field a1sds: Literal[2.8e-06] = 2.8e-06
Validated by:
  • debias_only_with_hwang

field a2sds: Literal[3.5e-05] = 3.5e-05
Validated by:
  • debias_only_with_hwang

field agrow: Literal[True] = True
Validated by:
  • debias_only_with_hwang

field cdfac: float | None = None

Counter bias in the input wind fields by providing a multiplier on the drag coefficient

Constraints:
  • gt = 0.0

Validated by:
  • debias_only_with_hwang

field model_type: Literal['st6c3'] = 'st6c3'
Validated by:
  • debias_only_with_hwang

field normalization: Literal['up', 'down'] = 'up'

Selection of normalization of exceedance level by ET(f) (up) or E(f) (down) as in RBW12 (right column, page 1333), up is default and strongly recommended

Validated by:
  • debias_only_with_hwang

field p1sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field p2sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field tau: Literal['vectau', 'scatau'] = 'vectau'

Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), vectau is the default and strongly recommended

Validated by:
  • debias_only_with_hwang

field u10: Literal['u10proxy', 'true10'] = 'u10proxy'

Wind velocity definition

Validated by:
  • debias_only_with_hwang

field wind_drag: Literal['hwang', 'fan', 'ecmwf'] = 'hwang'

Wind drag formula, hwang is the default and is unchanged from RBW12, fan is from Fan et al. (2012), ecmwf follows WAM Cycle 4 methodology

Validated by:
  • debias_only_with_hwang

field windscaling: Literal[32.0] = 32.0
Validated by:
  • debias_only_with_hwang

cmd() str
validator debias_only_with_hwang  »  all fields
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property u10_cmd: str
pydantic model rompy.swan.subcomponents.physics.ST6C4[source]

Fourth ST6 calibration in the SWAN user manual.

ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 DEBIAS 0.89 AGROW

Examples

In [1]: from rompy.swan.subcomponents.physics import ST6C4

In [2]: st6 = ST6C4()

In [3]: print(st6.render())
ST6 a1sds=2.8e-06 a2sds=3.5e-05 p1sds=4.0 p2sds=4.0 UP HWANG VECTAU U10PROXY windscaling=32.0 DEBIAS cdfac=0.89 AGROW

Show JSON schema
{
   "title": "ST6C4",
   "description": "Fourth ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 2.8e-6 3.5e-5 4.0 4.0 UP HWANG VECTAU U10PROXY 32.0 DEBIAS 0.89 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C4\n    st6 = ST6C4()\n    print(st6.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "st6c4",
         "default": "st6c4",
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "default": "hwang",
         "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
         "enum": [
            "hwang",
            "fan",
            "ecmwf"
         ],
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "const": true,
         "default": true,
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      },
      "a1sds": {
         "const": 2.8e-06,
         "default": 2.8e-06,
         "title": "A1Sds",
         "type": "number"
      },
      "a2sds": {
         "const": 3.5e-05,
         "default": 3.5e-05,
         "title": "A2Sds",
         "type": "number"
      },
      "p1sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P1Sds",
         "type": "number"
      },
      "p2sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P2Sds",
         "type": "number"
      },
      "normalization": {
         "default": "up",
         "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
         "enum": [
            "up",
            "down"
         ],
         "title": "Normalization",
         "type": "string"
      },
      "tau": {
         "default": "vectau",
         "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
         "enum": [
            "vectau",
            "scatau"
         ],
         "title": "Tau",
         "type": "string"
      },
      "u10": {
         "default": "u10proxy",
         "description": "Wind velocity definition",
         "enum": [
            "u10proxy",
            "true10"
         ],
         "title": "U10",
         "type": "string"
      },
      "windscaling": {
         "const": 32.0,
         "default": 32.0,
         "title": "Windscaling",
         "type": "number"
      },
      "cdfac": {
         "const": 0.89,
         "default": 0.89,
         "title": "Cdfac",
         "type": "number"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • debias_only_with_hwang » all fields

field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

Validated by:
  • debias_only_with_hwang

field a1sds: Literal[2.8e-06] = 2.8e-06
Validated by:
  • debias_only_with_hwang

field a2sds: Literal[3.5e-05] = 3.5e-05
Validated by:
  • debias_only_with_hwang

field agrow: Literal[True] = True
Validated by:
  • debias_only_with_hwang

field cdfac: Literal[0.89] = 0.89
Validated by:
  • debias_only_with_hwang

field model_type: Literal['st6c4'] = 'st6c4'
Validated by:
  • debias_only_with_hwang

field normalization: Literal['up', 'down'] = 'up'

Selection of normalization of exceedance level by ET(f) (up) or E(f) (down) as in RBW12 (right column, page 1333), up is default and strongly recommended

Validated by:
  • debias_only_with_hwang

field p1sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field p2sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field tau: Literal['vectau', 'scatau'] = 'vectau'

Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), vectau is the default and strongly recommended

Validated by:
  • debias_only_with_hwang

field u10: Literal['u10proxy', 'true10'] = 'u10proxy'

Wind velocity definition

Validated by:
  • debias_only_with_hwang

field wind_drag: Literal['hwang', 'fan', 'ecmwf'] = 'hwang'

Wind drag formula, hwang is the default and is unchanged from RBW12, fan is from Fan et al. (2012), ecmwf follows WAM Cycle 4 methodology

Validated by:
  • debias_only_with_hwang

field windscaling: Literal[32.0] = 32.0
Validated by:
  • debias_only_with_hwang

cmd() str
validator debias_only_with_hwang  »  all fields
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property u10_cmd: str
pydantic model rompy.swan.subcomponents.physics.ST6C5[source]

Fifth ST6 calibration in the SWAN user manual.

ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW

Examples

In [1]: from rompy.swan.subcomponents.physics import ST6C5

In [2]: st6 = ST6C5()

In [3]: print(st6.render())
ST6 a1sds=6.5e-06 a2sds=8.5e-05 p1sds=4.0 p2sds=4.0 UP HWANG VECTAU U10PROXY windscaling=35.0 DEBIAS cdfac=0.89 AGROW

Show JSON schema
{
   "title": "ST6C5",
   "description": "Fifth ST6 calibration in the SWAN user manual.\n\n.. code-block:: text\n\n    ST6 4.7e-7 6.6e-6 4.0 4.0 UP HWANG VECTAU U10PROXY 28.0 AGROW\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import ST6C5\n    st6 = ST6C5()\n    print(st6.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "st6c5",
         "default": "st6c5",
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "default": "hwang",
         "description": "Wind drag formula, `hwang` is the default and is unchanged from RBW12, `fan` is from Fan et al. (2012), `ecmwf` follows WAM Cycle 4 methodology",
         "enum": [
            "hwang",
            "fan",
            "ecmwf"
         ],
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "const": true,
         "default": true,
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      },
      "a1sds": {
         "const": 6.5e-06,
         "default": 6.5e-06,
         "title": "A1Sds",
         "type": "number"
      },
      "a2sds": {
         "const": 8.5e-05,
         "default": 8.5e-05,
         "title": "A2Sds",
         "type": "number"
      },
      "p1sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P1Sds",
         "type": "number"
      },
      "p2sds": {
         "const": 4.0,
         "default": 4.0,
         "title": "P2Sds",
         "type": "number"
      },
      "normalization": {
         "default": "up",
         "description": "Selection of normalization of exceedance level by ET(f) (`up`) or E(f) (`down`) as in RBW12 (right column, page 1333), `up` is default and strongly recommended",
         "enum": [
            "up",
            "down"
         ],
         "title": "Normalization",
         "type": "string"
      },
      "tau": {
         "default": "vectau",
         "description": "Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), `vectau` is the default and strongly recommended",
         "enum": [
            "vectau",
            "scatau"
         ],
         "title": "Tau",
         "type": "string"
      },
      "u10": {
         "default": "u10proxy",
         "description": "Wind velocity definition",
         "enum": [
            "u10proxy",
            "true10"
         ],
         "title": "U10",
         "type": "string"
      },
      "windscaling": {
         "const": 35.0,
         "default": 35.0,
         "title": "Windscaling",
         "type": "number"
      },
      "cdfac": {
         "const": 0.89,
         "default": 0.89,
         "title": "Cdfac",
         "type": "number"
      }
   },
   "additionalProperties": false
}

Fields:
Validators:
  • debias_only_with_hwang » all fields

field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

Validated by:
  • debias_only_with_hwang

field a1sds: Literal[6.5e-06] = 6.5e-06
Validated by:
  • debias_only_with_hwang

field a2sds: Literal[8.5e-05] = 8.5e-05
Validated by:
  • debias_only_with_hwang

field agrow: Literal[True] = True
Validated by:
  • debias_only_with_hwang

field cdfac: Literal[0.89] = 0.89
Validated by:
  • debias_only_with_hwang

field model_type: Literal['st6c5'] = 'st6c5'
Validated by:
  • debias_only_with_hwang

field normalization: Literal['up', 'down'] = 'up'

Selection of normalization of exceedance level by ET(f) (up) or E(f) (down) as in RBW12 (right column, page 1333), up is default and strongly recommended

Validated by:
  • debias_only_with_hwang

field p1sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field p2sds: Literal[4.0] = 4.0
Validated by:
  • debias_only_with_hwang

field tau: Literal['vectau', 'scatau'] = 'vectau'

Use vector (vectau) or scalar (scatau) calculation for the wind strerss (Eq. 12 in RBW12), vectau is the default and strongly recommended

Validated by:
  • debias_only_with_hwang

field u10: Literal['u10proxy', 'true10'] = 'u10proxy'

Wind velocity definition

Validated by:
  • debias_only_with_hwang

field wind_drag: Literal['hwang', 'fan', 'ecmwf'] = 'hwang'

Wind drag formula, hwang is the default and is unchanged from RBW12, fan is from Fan et al. (2012), ecmwf follows WAM Cycle 4 methodology

Validated by:
  • debias_only_with_hwang

field windscaling: Literal[35.0] = 35.0
Validated by:
  • debias_only_with_hwang

cmd() str
validator debias_only_with_hwang  »  all fields
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

property u10_cmd: str
pydantic model rompy.swan.subcomponents.physics.SourceTerms[source]

Source term subcomponent base class.

Show JSON schema
{
   "title": "SourceTerms",
   "description": "Source term subcomponent base class.",
   "type": "object",
   "properties": {
      "model_type": {
         "const": "subcomponent",
         "description": "Model type discriminator",
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "default": "wu",
         "description": "Indicates the wind drag formulation",
         "enum": [
            "wu",
            "fit"
         ],
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "default": false,
         "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      }
   },
   "additionalProperties": false,
   "required": [
      "model_type"
   ]
}

Fields:
  • a (float | None)

  • agrow (bool)

  • model_type ()

  • wind_drag (Literal['wu', 'fit'])

field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

field agrow: bool = False

Activate the Cavaleri and Malanotte (1981) wave growth term

field model_type: Literal['subcomponent'] [Required]

Model type discriminator

field wind_drag: Literal['wu', 'fit'] = 'wu'

Indicates the wind drag formulation

cmd() str
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.TRANS1D[source]

Frequency dependent transmission.

TRANS1D < [trcoef] >

Examples

In [1]: from rompy.swan.subcomponents.physics import TRANS1D

In [2]: transm = TRANS1D(trcoef=[0.0, 0.0, 0.2, 0.5, 0.2, 0.0, 0.0])

In [3]: print(transm.render())
TRANS1D 0.0 0.0 0.2 0.5 0.2 0.0 0.0

Show JSON schema
{
   "title": "TRANS1D",
   "description": "Frequency dependent transmission.\n\n.. code-block:: text\n\n    TRANS1D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS1D\n    transm = TRANS1D(trcoef=[0.0, 0.0, 0.2, 0.5, 0.2, 0.0, 0.0])\n    print(transm.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "trans1d",
         "description": "Model type discriminator",
         "enum": [
            "trans1d",
            "TRANS1D"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "trcoef": {
         "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency. The number of these transmission values must be equal to the number of frequencies, i.e. `msc` + 1",
         "items": {
            "maximum": 1.0,
            "minimum": 0.0,
            "type": "number"
         },
         "title": "Trcoef",
         "type": "array"
      }
   },
   "additionalProperties": false,
   "required": [
      "trcoef"
   ]
}

Fields:
field model_type: Literal['trans1d', 'TRANS1D'] = 'trans1d'

Model type discriminator

field trcoef: list[float] [Required]

Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency. The number of these transmission values must be equal to the number of frequencies, i.e. msc + 1

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.TRANS2D[source]

Frequency-direction dependent transmission.

TRANS2D < [trcoef] >

Examples

In [1]: from rompy.swan.subcomponents.physics import TRANS2D

In [2]: trcoef = np.array([[0.0, 0.0], [0.1, 0.1], [0.2, 0.2]])

In [3]: transm = TRANS2D(trcoef=trcoef)

In [4]: print(transm.render())
TRANS2D &
	0.0 0.0 &
	0.1 0.1 &
	0.2 0.2 &

Show JSON schema
{
   "title": "TRANS2D",
   "description": "Frequency-direction dependent transmission.\n\n.. code-block:: text\n\n    TRANS2D < [trcoef] >\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANS2D\n    trcoef = np.array([[0.0, 0.0], [0.1, 0.1], [0.2, 0.2]])\n    transm = TRANS2D(trcoef=trcoef)\n    print(transm.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "trans2d",
         "description": "Model type discriminator",
         "enum": [
            "trans2d",
            "TRANS2D"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "trcoef": {
         "description": "Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency and direction, rows represent directions and columns represent frequencies",
         "properties": {
            "data_type": {
               "default": "Any",
               "title": "dtype",
               "type": "string"
            },
            "data": {
               "items_schema": {
                  "items_schema": {
                     "type": "any"
                  },
                  "type": "list"
               },
               "max_length": 2,
               "min_length": 2,
               "type": "list"
            }
         },
         "required": [
            "data_type",
            "data"
         ],
         "title": "Numpy Array",
         "type": "np.ndarray[tuple[int, int], np.dtype[Any]]"
      }
   },
   "additionalProperties": false,
   "required": [
      "trcoef"
   ]
}

Fields:
Validators:
field model_type: Literal['trans2d', 'TRANS2D'] = 'trans2d'

Model type discriminator

field trcoef: ndarray[tuple[int, ...], dtype[Any]] [Required]

Transmission coefficient (ratio of transmitted over incoming significant wave height) per frequency and direction, rows represent directions and columns represent frequencies

Constraints:
  • dimensions = 2

  • strict_data_typing = False

  • serialize_numpy_array_to_json = <function pd_np_native_numpy_array_to_data_dict_serializer at 0x7efeb6c5f760>

  • json_schema_from_type_data = <function pd_np_native_numpy_array_json_schema_from_type_data at 0x7efeb6a513f0>

  • __module__ = pydantic_numpy.helper.annotation

Validated by:
cmd() str[source]

Command file string for this subcomponent.

validator constrained_0_1  »  trcoef[source]

Ensure all directions have the same number of frequencies.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.TRANSM[source]

Constant transmission coefficient.

TRANSM [trcoef]

Examples

In [1]: from rompy.swan.subcomponents.physics import TRANSM

In [2]: transm = TRANSM()

In [3]: print(transm.render())
TRANSM

In [4]: transm = TRANSM(trcoef=0.5)

In [5]: print(transm.render())
TRANSM trcoef=0.5

Show JSON schema
{
   "title": "TRANSM",
   "description": "Constant transmission coefficient.\n\n.. code-block:: text\n\n    TRANSM [trcoef]\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import TRANSM\n    transm = TRANSM()\n    print(transm.render())\n    transm = TRANSM(trcoef=0.5)\n    print(transm.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "transm",
         "description": "Model type discriminator",
         "enum": [
            "transm",
            "TRANSM"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "trcoef": {
         "anyOf": [
            {
               "maximum": 1.0,
               "minimum": 0.0,
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Constant transmission coefficient (ratio of transmitted over incoming significant wave height) (SWAN default: 0.0) (no transmission = complete blockage)",
         "title": "Trcoef"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['transm', 'TRANSM'] = 'transm'

Model type discriminator

field trcoef: float | None = None

Constant transmission coefficient (ratio of transmitted over incoming significant wave height) (SWAN default: 0.0) (no transmission = complete blockage)

Constraints:
  • ge = 0.0

  • le = 1.0

cmd() str[source]

Command file string for this subcomponent.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.physics.WESTHUYSEN[source]

Westhuysen source terms subcomponent.

WESTHUYSEN [cds2] [br] (AGROW [a])

Nonlinear saturation-based whitecapping combined with wind input of Yan (1987).

Notes

The two arguments are specified in the Appendix C of the User manual but not in the command description for WESTH in Section 4.5.4. They are also options in the WCAPPING command. It is not entirely clear if they should/could be specified here.

References

van der Westhuysen, A.J., Zijlema, M. and Battjes, J.A., 2007. Nonlinear saturation-based whitecapping dissipation in SWAN for deep and shallow water. Coastal Engineering, 54(2), pp.151-170.

Examples

In [1]: from rompy.swan.subcomponents.physics import WESTHUYSEN

In [2]: westhuysen = WESTHUYSEN()

In [3]: print(westhuysen.render())
WESTHUYSEN DRAG WU

In [4]: westhuysen = WESTHUYSEN(cds2=5.0e-5, br=1.75e-3)

In [5]: print(westhuysen.render())
WESTHUYSEN cds2=5e-05 br=0.00175 DRAG WU

Show JSON schema
{
   "title": "WESTHUYSEN",
   "description": "Westhuysen source terms subcomponent.\n\n.. code-block:: text\n\n    WESTHUYSEN [cds2] [br] (AGROW [a])\n\nNonlinear saturation-based whitecapping combined with wind input of Yan (1987).\n\nNotes\n-----\nThe two arguments are specified in the Appendix C of the User manual but not in the\ncommand description for WESTH in Section 4.5.4. They are also options in the\nWCAPPING command. It is not entirely clear if they should/could be specified here.\n\nReferences\n----------\nvan der Westhuysen, A.J., Zijlema, M. and Battjes, J.A., 2007. Nonlinear\nsaturation-based whitecapping dissipation in SWAN for deep and shallow water.\nCoastal Engineering, 54(2), pp.151-170.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.physics import WESTHUYSEN\n    westhuysen = WESTHUYSEN()\n    print(westhuysen.render())\n    westhuysen = WESTHUYSEN(cds2=5.0e-5, br=1.75e-3)\n    print(westhuysen.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "westhuysen",
         "description": "Model type discriminator",
         "enum": [
            "westhuysen",
            "WESTHUYSEN"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "wind_drag": {
         "default": "wu",
         "description": "Indicates the wind drag formulation",
         "enum": [
            "wu",
            "fit"
         ],
         "title": "Wind Drag",
         "type": "string"
      },
      "agrow": {
         "default": false,
         "description": "Activate the Cavaleri and Malanotte (1981) wave growth term",
         "title": "Agrow",
         "type": "boolean"
      },
      "a": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)",
         "title": "A"
      },
      "cds2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5).",
         "title": "Cds2"
      },
      "br": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Threshold saturation level\t(SWAN default: 1.75e-3)",
         "title": "Br"
      }
   },
   "additionalProperties": false
}

Fields:
field a: float | None = None

Proportionality coefficient when activating the Cavaleri and Malanotte (1981) wave growth term (SWAN default: 0.0015)

field agrow: bool = False

Activate the Cavaleri and Malanotte (1981) wave growth term

field br: float | None = None

Threshold saturation level (SWAN default: 1.75e-3)

field cds2: float | None = None

proportionality coefficient due to Alves and Banner (2003) (SWAN default: 5.0e-5).

field model_type: Literal['westhuysen', 'WESTHUYSEN'] = 'westhuysen'

Model type discriminator

field wind_drag: Literal['wu', 'fit'] = 'wu'

Indicates the wind drag formulation

cmd() str[source]
dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

Numerics#

SWAN numerics subcomponents.

pydantic model rompy.swan.subcomponents.numerics.ACCUR[source]

Stop the iterative procedure.

ACCUR [drel] [dhoval] [dtoval] [npnts] ->STAT|NONSTAT [limiter]

With this option the user can influence the criterion for terminating the iterative procedure in the SWAN computations (both stationary and non-stationary modes). SWAN stops the iterations if (a), (b) and (c) are all satisfied:

  1. The change in the local significant wave height Hs from one iteration to the next is less than (1) fraction drel of that height or (2) fraction dhoval of the average Hs over all grid points.

  2. The change in the local mean wave period Tm01 from one iteration to the next is less than (1) fraction drel of that period or (2) fraction dtoval of the average mean wave period over all wet grid points.

  3. Conditions (a) and (b) are fulfilled in more than fraction npnts% of all wet grid points.

Note

This command has become obsolete in SWAN 41.01. The command STOPC should be used.

Examples

In [1]: from rompy.swan.subcomponents.numerics import ACCUR

In [2]: accur = ACCUR()

In [3]: print(accur.render())
ACCUR

In [4]: accur = ACCUR(
   ...:     drel=0.01,
   ...:     dhoval=0.02,
   ...:     dtoval=0.02,
   ...:     npnts=98.0,
   ...:     mode=dict(model_type="nonstat", mxitns=1),
   ...:     limiter=0.1,
   ...: )
   ...: 

In [5]: print(accur.render())
ACCUR drel=0.01 dhoval=0.02 dtoval=0.02 npnts=98.0 NONSTATIONARY mxitns=1 limiter=0.1

Show JSON schema
{
   "title": "ACCUR",
   "description": "Stop the iterative procedure.\n\n.. code-block:: text\n\n    ACCUR [drel] [dhoval] [dtoval] [npnts] ->STAT|NONSTAT [limiter]\n\nWith this option the user can influence the criterion for terminating the iterative\nprocedure in the SWAN computations (both stationary and non-stationary modes).\nSWAN stops the iterations if (a), (b) and (c) are all satisfied:\n\na) The change in the local significant wave height Hs from one iteration to the\n   next is less than (1) fraction `drel` of that height or (2) fraction `dhoval`\n   of the average Hs over all grid points.\n\nb) The change in the local mean wave period Tm01 from one iteration to the next is\n   less than (1) fraction `drel` of that period or (2) fraction `dtoval` of the\n   average mean wave period over all wet grid points.\n\nc) Conditions (a) and (b) are fulfilled in more than fraction `npnts%` of all wet\n   grid points.\n\nNote\n----\nThis command has become obsolete in SWAN 41.01. The command STOPC should be used.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import ACCUR\n    accur = ACCUR()\n    print(accur.render())\n    accur = ACCUR(\n        drel=0.01,\n        dhoval=0.02,\n        dtoval=0.02,\n        npnts=98.0,\n        mode=dict(model_type=\"nonstat\", mxitns=1),\n        limiter=0.1,\n    )\n    print(accur.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "accur",
         "description": "Model type discriminator",
         "enum": [
            "accur",
            "ACCUR"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "drel": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum relative change in Hs or Tm01 from one iteration to the next (SWAN default: 0.02)",
         "title": "Drel"
      },
      "dhoval": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Fraction of the average Hs over all wet grid points below which the the stopping criteria needs to be satisfied (SWAN default: 0.02)",
         "title": "Dhoval"
      },
      "dtoval": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Fraction of the average Tm01 over all wet grid points below which the the stopping criteria needs to be satisfied (SWAN default: 0.02)",
         "title": "Dtoval"
      },
      "npnts": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 98)",
         "title": "Npnts"
      },
      "mode": {
         "anyOf": [
            {
               "discriminator": {
                  "mapping": {
                     "NONSTAT": "#/$defs/NONSTAT",
                     "STAT": "#/$defs/STAT",
                     "nonstat": "#/$defs/NONSTAT",
                     "stat": "#/$defs/STAT"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/STAT"
                  },
                  {
                     "$ref": "#/$defs/NONSTAT"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Termination criteria for stationary or nonstationary runs",
         "title": "Mode"
      },
      "limiter": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)",
         "title": "Limiter"
      }
   },
   "$defs": {
      "NONSTAT": {
         "additionalProperties": false,
         "description": "Computation parameters in nonstationary computation.",
         "properties": {
            "model_type": {
               "default": "nonstat",
               "description": "Model type discriminator",
               "enum": [
                  "nonstat",
                  "NONSTAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mxitns": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of iterations per time step for nonstationary computations. The computation moves to the next time step when this number is exceeded (SWAN default: `mxitns = 1`",
               "title": "Mxitns"
            }
         },
         "title": "NONSTAT",
         "type": "object"
      },
      "STAT": {
         "additionalProperties": false,
         "description": "Computation parameters in stationary computation.",
         "properties": {
            "model_type": {
               "default": "stat",
               "description": "Model type discriminator",
               "enum": [
                  "stat",
                  "STAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mxitst": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of iterations for stationary computations. The computation stops when this number is exceeded (SWAN default:  50)",
               "title": "Mxitst"
            },
            "alfa": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality constant used in the frequency-dependent under-relaxation technique. Based on experiences, a suggestion for this parameter is `alfa = 0.01`. In case of diffraction computations, the use of this parameter is recommended (SWAN default: 0.00)",
               "title": "Alfa"
            }
         },
         "title": "STAT",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field dhoval: float | None = None

Fraction of the average Hs over all wet grid points below which the the stopping criteria needs to be satisfied (SWAN default: 0.02)

field drel: float | None = None

Maximum relative change in Hs or Tm01 from one iteration to the next (SWAN default: 0.02)

field dtoval: float | None = None

Fraction of the average Tm01 over all wet grid points below which the the stopping criteria needs to be satisfied (SWAN default: 0.02)

field limiter: float | None = None

Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)

field mode: STAT | NONSTAT | None = None

Termination criteria for stationary or nonstationary runs

field model_type: Literal['accur', 'ACCUR'] = 'accur'

Model type discriminator

field npnts: float | None = None

Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 98)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.BSBT[source]

BSBT first order propagation scheme.

BSTB

Examples

In [1]: from rompy.swan.subcomponents.numerics import BSBT

In [2]: scheme = BSBT()

In [3]: print(scheme.render())
BSBT

Show JSON schema
{
   "title": "BSBT",
   "description": "BSBT first order propagation scheme.\n\n.. code-block:: text\n\n    BSTB\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import BSBT\n    scheme = BSBT()\n    print(scheme.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "bsbt",
         "description": "Model type discriminator",
         "enum": [
            "bsbt",
            "BSBT"
         ],
         "title": "Model Type",
         "type": "string"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['bsbt', 'BSBT'] = 'bsbt'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.CSIGMA[source]

Prevents excessive directional turning.

CSigma [cfl]

This option prevents an excessive frequency shifting at a single grid point or vertex due to a very coarse bathymetry or current locally. This option limits the frequency shifting rate csigma based on the CFL restriction. See also the final remark in Section 2.6.3. Note that if this command is not specified, then the limiter is not activated.

Examples

In [1]: from rompy.swan.subcomponents.numerics import CSIGMA

In [2]: csigma = CSIGMA()

In [3]: print(csigma.render())
CSIGMA

In [4]: csigma = CSIGMA(cfl=0.9)

In [5]: print(csigma.render())
CSIGMA cfl=0.9

Show JSON schema
{
   "title": "CSIGMA",
   "description": "Prevents excessive directional turning.\n\n.. code-block:: text\n\n    CSigma [cfl]\n\nThis option prevents an excessive frequency shifting at a single grid point or\nvertex due to a very coarse bathymetry or current locally. This option limits the\nfrequency shifting rate csigma based on the CFL restriction. See also the final\nremark in Section 2.6.3. Note that if this command is not specified, then the\nlimiter is not activated.\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import CSIGMA\n    csigma = CSIGMA()\n    print(csigma.render())\n    csigma = CSIGMA(cfl=0.9)\n    print(csigma.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "ctheta",
         "description": "Model type discriminator",
         "enum": [
            "ctheta",
            "CTHETA"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cfl": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Upper limit for the CFL restriction for csigma. A suggestion for this parameter is `cfl = 0.9` (SWAN default: 0.9 when CSIGMA is activated)",
         "title": "Cfl"
      }
   },
   "additionalProperties": false
}

Fields:
field cfl: float | None = None

Upper limit for the CFL restriction for csigma. A suggestion for this parameter is cfl = 0.9 (SWAN default: 0.9 when CSIGMA is activated)

field model_type: Literal['ctheta', 'CTHETA'] = 'ctheta'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.CTHETA[source]

Prevents excessive directional turning.

CTheta [cfl]

This option prevents an excessive directional turning at a single grid point or vertex due to a very coarse bathymetry or current locally. This option limits the directional turning rate cθ based on the CFL restriction. (See Eq. 3.41 of Scientific/Technical documentation). See also the final remark in Section 2.6.3. Note that if this command is not specified, then the limiter is not activated.

Examples

In [1]: from rompy.swan.subcomponents.numerics import CTHETA

In [2]: ctheta = CTHETA()

In [3]: print(ctheta.render())
CTHETA

In [4]: ctheta = CTHETA(cfl=0.9)

In [5]: print(ctheta.render())
CTHETA cfl=0.9

Show JSON schema
{
   "title": "CTHETA",
   "description": "Prevents excessive directional turning.\n\n.. code-block:: text\n\n    CTheta [cfl]\n\nThis option prevents an excessive directional turning at a single grid point or\nvertex due to a very coarse bathymetry or current locally. This option limits the\ndirectional turning rate c\u03b8 based on the CFL restriction. (See Eq. 3.41 of\nScientific/Technical documentation). See also the final remark in Section 2.6.3.\nNote that if this command is not specified, then the limiter is not activated.\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import CTHETA\n    ctheta = CTHETA()\n    print(ctheta.render())\n    ctheta = CTHETA(cfl=0.9)\n    print(ctheta.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "ctheta",
         "description": "Model type discriminator",
         "enum": [
            "ctheta",
            "CTHETA"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cfl": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Upper limit for the CFL restriction for ctheta. A suggestion for this parameter is `cfl = 0.9` (SWAN default: 0.9 when CTHETA is activated)",
         "title": "Cfl"
      }
   },
   "additionalProperties": false
}

Fields:
field cfl: float | None = None

Upper limit for the CFL restriction for ctheta. A suggestion for this parameter is cfl = 0.9 (SWAN default: 0.9 when CTHETA is activated)

field model_type: Literal['ctheta', 'CTHETA'] = 'ctheta'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.DIRIMPL[source]

Numerical scheme for refraction.

DIRIMPL [cdd]

Examples

In [1]: from rompy.swan.subcomponents.numerics import DIRIMPL

In [2]: dirimpl = DIRIMPL()

In [3]: print(dirimpl.render())
DIRIMPL

In [4]: dirimpl = DIRIMPL(cdd=0.5)

In [5]: print(dirimpl.render())
DIRIMPL cdd=0.5

Show JSON schema
{
   "title": "DIRIMPL",
   "description": "Numerical scheme for refraction.\n\n.. code-block:: text\n\n    DIRIMPL [cdd]\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import DIRIMPL\n    dirimpl = DIRIMPL()\n    print(dirimpl.render())\n    dirimpl = DIRIMPL(cdd=0.5)\n    print(dirimpl.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "dirimpl",
         "description": "Model type discriminator",
         "enum": [
            "dirimpl",
            "DIRIMPL"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "cdd": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A value of `cdd=0` corresponds to a central scheme and has the largest accuracy (diffusion \u2248 0) but the computation may more easily generatespurious fluctuations. A value of `cdd=1` corresponds to a first orderupwind scheme and it is more diffusive and therefore preferable if (strong) gradients in depth or current are present (SWAN default: 0.5)",
         "title": "Cdd"
      }
   },
   "additionalProperties": false
}

Fields:
field cdd: float | None = None

A value of cdd=0 corresponds to a central scheme and has the largest accuracy (diffusion ≈ 0) but the computation may more easily generatespurious fluctuations. A value of cdd=1 corresponds to a first orderupwind scheme and it is more diffusive and therefore preferable if (strong) gradients in depth or current are present (SWAN default: 0.5)

field model_type: Literal['dirimpl', 'DIRIMPL'] = 'dirimpl'

Model type discriminator

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.GSE[source]

Garden-sprinkler effect.

GSE [waveage] Sec|MIn|HR|DAy

Garden-sprinkler effect is to be counteracted in the S&L propagation scheme (default for nonstationary regular grid computations) or in the propagation scheme for unstructured grids by adding a diffusion term to the basic equation. This may affect the numerical stability of SWAN.

Examples

In [1]: from rompy.swan.subcomponents.numerics import GSE

In [2]: scheme = GSE(waveage=dict(delt=86400, dfmt="day"))

In [3]: print(scheme.render())
GSE waveage=1.0 DAY

Show JSON schema
{
   "title": "GSE",
   "description": "Garden-sprinkler effect.\n\n.. code-block:: text\n\n    GSE [waveage] Sec|MIn|HR|DAy\n\nGarden-sprinkler effect is to be counteracted in the S&L propagation scheme\n(default for nonstationary regular grid computations) or in the propagation\nscheme for unstructured grids by adding a diffusion term to the basic equation.\nThis may affect the numerical stability of SWAN.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import GSE\n    scheme = GSE(waveage=dict(delt=86400, dfmt=\"day\"))\n    print(scheme.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "gse",
         "description": "Model type discriminator",
         "enum": [
            "gse",
            "GSE"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "waveage": {
         "anyOf": [
            {
               "$ref": "#/$defs/Delt"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The time interval used to determine the diffusion which counteracts the so-called garden-sprinkler effect. The default value of `waveage` is zero, i.e. no added diffusion. The value of `waveage` should correspond to the travel time of the waves over the computational region."
      }
   },
   "$defs": {
      "Delt": {
         "additionalProperties": false,
         "description": "Time interval specification in SWAN.\n\n.. code-block:: text\n\n    [delt] SEC|MIN|HR|DAY\n\nNote\n----\nThe `tdelta` field can be specified as:\n\n* existing timedelta object\n* int or float, assumed as seconds\n* ISO 8601 duration string, following formats work:\n\n  * `[-][DD ][HH:MM]SS[.ffffff]`\n  * `[\u00b1]P[DD]DT[HH]H[MM]M[SS]S` (ISO 8601 format for timedelta)\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.time import Delt\n    from datetime import timedelta\n    delt = Delt(delt=timedelta(minutes=30))\n    print(delt.render())\n    delt = Delt(delt=\"PT1H\", dfmt=\"hr\")\n    print(delt.render())",
         "properties": {
            "model_type": {
               "const": "delt",
               "default": "delt",
               "description": "Model type discriminator",
               "title": "Model Type",
               "type": "string"
            },
            "delt": {
               "description": "Time interval",
               "format": "duration",
               "title": "Delt",
               "type": "string"
            },
            "dfmt": {
               "default": "sec",
               "description": "Format to render time interval specification",
               "enum": [
                  "sec",
                  "min",
                  "hr",
                  "day"
               ],
               "title": "Dfmt",
               "type": "string"
            }
         },
         "required": [
            "delt"
         ],
         "title": "Delt",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['gse', 'GSE'] = 'gse'

Model type discriminator

field waveage: Delt | None = None

The time interval used to determine the diffusion which counteracts the so-called garden-sprinkler effect. The default value of waveage is zero, i.e. no added diffusion. The value of waveage should correspond to the travel time of the waves over the computational region.

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.NONSTAT[source]

Computation parameters in nonstationary computation.

Show JSON schema
{
   "title": "NONSTAT",
   "description": "Computation parameters in nonstationary computation.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "nonstat",
         "description": "Model type discriminator",
         "enum": [
            "nonstat",
            "NONSTAT"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "mxitns": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The maximum number of iterations per time step for nonstationary computations. The computation moves to the next time step when this number is exceeded (SWAN default: `mxitns = 1`",
         "title": "Mxitns"
      }
   },
   "additionalProperties": false
}

Fields:
field model_type: Literal['nonstat', 'NONSTAT'] = 'nonstat'

Model type discriminator

field mxitns: int | None = None

The maximum number of iterations per time step for nonstationary computations. The computation moves to the next time step when this number is exceeded (SWAN default: mxitns = 1

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.SETUP[source]

Stop criteria in the computation of wave setup.

SETUP [eps2] [outp] [niter]

Controls the stopping criterion and amount of output for the SOR solver in the computation of the wave-induced set-up.

Examples

In [1]: from rompy.swan.subcomponents.numerics import SETUP

In [2]: setup = SETUP()

In [3]: print(setup.render())
SETUP

In [4]: setup = SETUP(eps2=1e-4, outp=0, niter=20)

In [5]: print(setup.render())
SETUP eps2=0.0001 outp=0 niter=20

Show JSON schema
{
   "title": "SETUP",
   "description": "Stop criteria in the computation of wave setup.\n\n.. code-block:: text\n\n    SETUP [eps2] [outp] [niter]\n\nControls the stopping criterion and amount of output for the SOR solver in the\ncomputation of the wave-induced set-up.\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import SETUP\n    setup = SETUP()\n    print(setup.render())\n    setup = SETUP(eps2=1e-4, outp=0, niter=20)\n    print(setup.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "setup",
         "description": "Model type discriminator",
         "enum": [
            "setup",
            "SETUP"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "eps2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Relative stopping criterion to terminate the linear solver (SIP or SOR). (SWAN default: 1.e-4 in case of SIP and 1.e-6 in case of SOR)",
         "title": "Eps2"
      },
      "outp": {
         "anyOf": [
            {
               "enum": [
                  0,
                  1,
                  2,
                  3
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output for the iterative solver:\n\n* 0 = no output\n* 1 = additional information about the iteration process is written to the PRINT file \n* 2 = gives a maximal amount of output concerning the iteration process \n* 3 = summary of the iteration process\n\n(SWAN default: 0)",
         "title": "Outp"
      },
      "niter": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum number of iterations for the linear solver (SWAN default: 20 in case of SIP and 1000 in case of SOR)",
         "title": "Niter"
      }
   },
   "additionalProperties": false
}

Fields:
field eps2: float | None = None

Relative stopping criterion to terminate the linear solver (SIP or SOR). (SWAN default: 1.e-4 in case of SIP and 1.e-6 in case of SOR)

field model_type: Literal['setup', 'SETUP'] = 'setup'

Model type discriminator

field niter: int | None = None

Maximum number of iterations for the linear solver (SWAN default: 20 in case of SIP and 1000 in case of SOR)

field outp: Literal[0, 1, 2, 3] | None = None

Output for the iterative solver:

  • 0 = no output

  • 1 = additional information about the iteration process is written to the PRINT file

  • 2 = gives a maximal amount of output concerning the iteration process

  • 3 = summary of the iteration process

(SWAN default: 0)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.SIGIMPL[source]

Frequency shifting accuracy.

SIGIMpl [cfl] [eps2] [outp] [niter]

Controls the accuracy of computing the frequency shifting and the stopping criterion and amount of output for the SIP solver (used in the computations in the presence of currents or time varying depth)

Examples

In [1]: from rompy.swan.subcomponents.numerics import SIGIMPL

In [2]: sigimpl = SIGIMPL()

In [3]: print(sigimpl.render())
SIGIMPL

In [4]: sigimpl = SIGIMPL(css=0.5, eps2=1e-4, outp=0, niter=20)

In [5]: print(sigimpl.render())
SIGIMPL css=0.5 eps2=0.0001 outp=0 niter=20

Show JSON schema
{
   "title": "SIGIMPL",
   "description": "Frequency shifting accuracy.\n\n.. code-block:: text\n\n    SIGIMpl [cfl] [eps2] [outp] [niter]\n\nControls the accuracy of computing the frequency shifting and the stopping\ncriterion and amount of output for the SIP solver (used in the computations in the\npresence of currents or time varying depth)\n\nExamples\n--------\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import SIGIMPL\n    sigimpl = SIGIMPL()\n    print(sigimpl.render())\n    sigimpl = SIGIMPL(css=0.5, eps2=1e-4, outp=0, niter=20)\n    print(sigimpl.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "sigimpl",
         "description": "Model type discriminator",
         "enum": [
            "sigimpl",
            "SIGIMPL"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "css": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "A value of `css=0` corresponds to a central scheme and has the largest accuracy (diffusion \u2248 0) but the computation may more easily generate spurious fluctuations. A value of `css=1` corresponds to a first order upwind scheme and it is more diffusive and therefore preferable if (strong) gradients in depth or current are present (SWAN default: 0.5)",
         "title": "Css"
      },
      "eps2": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Relative stopping criterion to terminate the linear solver (SIP or SOR). (SWAN default: 1.e-4 in case of SIP and 1.e-6 in case of SOR)",
         "title": "Eps2"
      },
      "outp": {
         "anyOf": [
            {
               "enum": [
                  0,
                  1,
                  2,
                  3
               ],
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Output for the iterative solver:\n\n* 0 = no output\n* 1 = additional information about the iteration process is written to the PRINT file \n* 2 = gives a maximal amount of output concerning the iteration process\n* 3 = summary of the iteration process\n\n(SWAN default: 0)",
         "title": "Outp"
      },
      "niter": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum number of iterations for the linear solver (SWAN default: 20 in case of SIP and 1000 in case of SOR)",
         "title": "Niter"
      }
   },
   "additionalProperties": false
}

Fields:
field css: float | None = None

A value of css=0 corresponds to a central scheme and has the largest accuracy (diffusion ≈ 0) but the computation may more easily generate spurious fluctuations. A value of css=1 corresponds to a first order upwind scheme and it is more diffusive and therefore preferable if (strong) gradients in depth or current are present (SWAN default: 0.5)

field eps2: float | None = None

Relative stopping criterion to terminate the linear solver (SIP or SOR). (SWAN default: 1.e-4 in case of SIP and 1.e-6 in case of SOR)

field model_type: Literal['sigimpl', 'SIGIMPL'] = 'sigimpl'

Model type discriminator

field niter: int | None = None

Maximum number of iterations for the linear solver (SWAN default: 20 in case of SIP and 1000 in case of SOR)

field outp: Literal[0, 1, 2, 3] | None = None

Output for the iterative solver:

  • 0 = no output

  • 1 = additional information about the iteration process is written to the PRINT file

  • 2 = gives a maximal amount of output concerning the iteration process

  • 3 = summary of the iteration process

(SWAN default: 0)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.STAT[source]

Computation parameters in stationary computation.

Show JSON schema
{
   "title": "STAT",
   "description": "Computation parameters in stationary computation.",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "stat",
         "description": "Model type discriminator",
         "enum": [
            "stat",
            "STAT"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "mxitst": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "The maximum number of iterations for stationary computations. The computation stops when this number is exceeded (SWAN default:  50)",
         "title": "Mxitst"
      },
      "alfa": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Proportionality constant used in the frequency-dependent under-relaxation technique. Based on experiences, a suggestion for this parameter is `alfa = 0.01`. In case of diffraction computations, the use of this parameter is recommended (SWAN default: 0.00)",
         "title": "Alfa"
      }
   },
   "additionalProperties": false
}

Fields:
field alfa: float | None = None

Proportionality constant used in the frequency-dependent under-relaxation technique. Based on experiences, a suggestion for this parameter is alfa = 0.01. In case of diffraction computations, the use of this parameter is recommended (SWAN default: 0.00)

field model_type: Literal['stat', 'STAT'] = 'stat'

Model type discriminator

field mxitst: int | None = None

The maximum number of iterations for stationary computations. The computation stops when this number is exceeded (SWAN default: 50)

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.

pydantic model rompy.swan.subcomponents.numerics.STOPC[source]

Stopping criteria of Zijlema and Van der Westhuysen (2005).

STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter]

With this option the user can influence the criterion for terminating the iterative procedure in the SWAN computations (both stationary and nonstationary). The criterion makes use of the second derivative, or curvature, of the iteration curve of the significant wave height. As the solution of a simulation approaches full convergence, the curvature of the iteration curve will tend to zero. SWAN stops the process if the relative change in Hs from one iteration to the next is less than drel and the curvature of the iteration curve of Hs normalized with Hs is less than curvat or the absolute change in Hs from one iteration to the next is less than dabs. Both conditions need to be fulfilled in more than fraction npnts percent of all wet grid points.

With respect to the QC modelling, another stopping criteria will be employed. Namely, SWAN stops the iteration process if the absolute change in Hs from one iterate to another is less than dabs * Hinc, where Hinc is the representative incident wave height, or the relative change in Hs from one to the next iteration is less than drel. These criteria must be fulfilled in more than npnts percent of all active, well-defined points.

References

  • Zijlema, M. and Van der Westhuysen, A. (2005). On convergence behaviour and numerical accuracy in stationary SWAN simulations of nearshore wind wave spectra, Coastal Engineering, 52(3), p. 337-256.

Examples

In [1]: from rompy.swan.subcomponents.numerics import STOPC

In [2]: stop = STOPC()

In [3]: print(stop.render())
STOPC

In [4]: stop = STOPC(
   ...:     dabs=0.005,
   ...:     drel=0.01,
   ...:     curvat=0.005,
   ...:     npnts=99.5,
   ...:     mode=dict(model_type="nonstat", mxitns=1),
   ...:     limiter=0.1,
   ...: )
   ...: 

In [5]: print(stop.render())
STOPC dabs=0.005 drel=0.01 curvat=0.005 npnts=99.5 NONSTATIONARY mxitns=1 limiter=0.1

Show JSON schema
{
   "title": "STOPC",
   "description": "Stopping criteria of  Zijlema and Van der Westhuysen (2005).\n\n.. code-block:: text\n\n    STOPC [dabs] [drel] [curvat] [npnts] ->STAT|NONSTAT [limiter]\n\nWith this option the user can influence the criterion for terminating the iterative\nprocedure in the SWAN computations (both stationary and nonstationary). The\ncriterion makes use of the second derivative, or curvature, of the iteration curve\nof the significant wave height. As the solution of a simulation approaches full\nconvergence, the curvature of the iteration curve will tend to zero. SWAN stops the\nprocess if the relative change in Hs from one iteration to the next is less than\n`drel` and the curvature of the iteration curve of Hs normalized with Hs is less\nthan `curvat` or the absolute change in Hs from one iteration to the next is less\nthan `dabs`. Both conditions need to be fulfilled in more than fraction `npnts`\npercent of all wet grid points.\n\nWith respect to the QC modelling, another stopping criteria will be employed.\nNamely, SWAN stops the iteration process if the absolute change in Hs from one\niterate to another is less than `dabs` * Hinc, where Hinc is the representative\nincident wave height, or the relative change in Hs from one to the next iteration\nis less than `drel`. These criteria must be fulfilled in more than `npnts`\npercent of all active, well-defined points.\n\nReferences\n----------\n- Zijlema, M. and Van der Westhuysen, A. (2005). On convergence behaviour and\n  numerical accuracy in stationary SWAN simulations of nearshore wind wave spectra,\n  Coastal Engineering, 52(3), p. 337-256.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.subcomponents.numerics import STOPC\n    stop = STOPC()\n    print(stop.render())\n    stop = STOPC(\n        dabs=0.005,\n        drel=0.01,\n        curvat=0.005,\n        npnts=99.5,\n        mode=dict(model_type=\"nonstat\", mxitns=1),\n        limiter=0.1,\n    )\n    print(stop.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "stopc",
         "description": "Model type discriminator",
         "enum": [
            "stopc",
            "STOPC"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "dabs": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum absolute change in Hs from one iteration to the next (SWAN default: 0.005 [m] or 0.05 [-] in case of QC model)",
         "title": "Dabs"
      },
      "drel": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum relative change in Hs from one iteration to the next (SWAN default: 0.01 [-])",
         "title": "Drel"
      },
      "curvat": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Maximum curvature of the iteration curve of Hs normalised with Hs (SWAN default: 0.005 [-] (not used in the QC model))",
         "title": "Curvat"
      },
      "npnts": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 99.5 [-])",
         "title": "Npnts"
      },
      "mode": {
         "anyOf": [
            {
               "discriminator": {
                  "mapping": {
                     "NONSTAT": "#/$defs/NONSTAT",
                     "STAT": "#/$defs/STAT",
                     "nonstat": "#/$defs/NONSTAT",
                     "stat": "#/$defs/STAT"
                  },
                  "propertyName": "model_type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/STAT"
                  },
                  {
                     "$ref": "#/$defs/NONSTAT"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Termination criteria for stationary or nonstationary runs",
         "title": "Mode"
      },
      "limiter": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)",
         "title": "Limiter"
      }
   },
   "$defs": {
      "NONSTAT": {
         "additionalProperties": false,
         "description": "Computation parameters in nonstationary computation.",
         "properties": {
            "model_type": {
               "default": "nonstat",
               "description": "Model type discriminator",
               "enum": [
                  "nonstat",
                  "NONSTAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mxitns": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of iterations per time step for nonstationary computations. The computation moves to the next time step when this number is exceeded (SWAN default: `mxitns = 1`",
               "title": "Mxitns"
            }
         },
         "title": "NONSTAT",
         "type": "object"
      },
      "STAT": {
         "additionalProperties": false,
         "description": "Computation parameters in stationary computation.",
         "properties": {
            "model_type": {
               "default": "stat",
               "description": "Model type discriminator",
               "enum": [
                  "stat",
                  "STAT"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "mxitst": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "The maximum number of iterations for stationary computations. The computation stops when this number is exceeded (SWAN default:  50)",
               "title": "Mxitst"
            },
            "alfa": {
               "anyOf": [
                  {
                     "type": "number"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Proportionality constant used in the frequency-dependent under-relaxation technique. Based on experiences, a suggestion for this parameter is `alfa = 0.01`. In case of diffraction computations, the use of this parameter is recommended (SWAN default: 0.00)",
               "title": "Alfa"
            }
         },
         "title": "STAT",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field curvat: float | None = None

Maximum curvature of the iteration curve of Hs normalised with Hs (SWAN default: 0.005 [-] (not used in the QC model))

field dabs: float | None = None

Maximum absolute change in Hs from one iteration to the next (SWAN default: 0.005 [m] or 0.05 [-] in case of QC model)

field drel: float | None = None

Maximum relative change in Hs from one iteration to the next (SWAN default: 0.01 [-])

field limiter: float | None = None

Determines the maximum change per iteration of the energy density per spectral-bin given in terms of a fraction of the omni-directional Phillips level (SWAN default: 0.1)

field mode: STAT | NONSTAT | None = None

Termination criteria for stationary or nonstationary runs

field model_type: Literal['stopc', 'STOPC'] = 'stopc'

Model type discriminator

field npnts: float | None = None

Percentage of points in the computational grid above which the stopping criteria needs to be satisfied (SWAN default: 99.5 [-])

cmd() str[source]

Command file string for this component.

dump_inputs_dict() dict

Return the original inputs as a dictionary.

dump_inputs_json() str

Return the original inputs as a JSON string.

render() str

Render the sub-component to a string.