rompy.swan.components.boundary.INITIAL#

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 [16]: from rompy.swan.components.boundary import INITIAL

In [17]: init = INITIAL()

In [18]: print(init.render())
INITIAL DEFAULT

In [19]: init = INITIAL(
   ....:     kind=dict(model_type="hotmultiple", fname="hotstart.swn", format="free")
   ....: )
   ....: 

In [20]: 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.