rompy.swan.components.group.STARTUP#
- 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 [55]: from rompy.swan.components.startup import PROJECT, SET, MODE, COORDINATES In [56]: from rompy.swan.components.group import STARTUP In [57]: proj = PROJECT(nr="01") In [58]: set = SET(level=0.5, direction_convention="nautical") In [59]: mode = MODE(kind="nonstationary", dim="twodimensional") In [60]: coords = COORDINATES(kind=dict(model_type="spherical", projection="ccm")) In [61]: startup = STARTUP( ....: project=proj, ....: set=set, ....: mode=mode, ....: coordinates=coords, ....: ) ....: In [62]: 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 model_type: Literal['startup', 'STARTUP'] = 'startup'#
Model type discriminator