rompy.swan.components.output.NESTOUT#

pydantic model rompy.swan.components.output.NESTOUT[source]#

Write to 2D boundary spectra.

NESTOUT 'sname' 'fname' (OUTPUT [tbegnst] [deltnst] ->SEC|MIN|HR|DAY)

Write to data file two-dimensional action density spectra (relative frequency) along the boundary of a nested grid (see command NGRID) to be used in a subsequent SWAN run.

Note

Cannot be used in 1D-mode.

Examples

In [1]: from rompy.swan.components.output import NESTOUT

In [2]: out = NESTOUT(
   ...:     sname="outnest",
   ...:     fname="./nestout.swn",
   ...:     times=dict(tbeg="2012-01-01T00:00:00", delt="PT30M", dfmt="min"),
   ...: )
   ...: 

In [3]: print(out.render())
NESTOUT sname='outnest' fname='./nestout.swn' OUTPUT tbegnst=20120101.000000 deltnst=30.0 MIN

Show JSON schema
{
   "title": "NESTOUT",
   "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())",
   "type": "object",
   "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"
      }
   },
   "$defs": {
      "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"
      }
   },
   "additionalProperties": false,
   "required": [
      "sname",
      "fname"
   ]
}

Fields:
Validators:

field model_type: Literal['nestout', 'NESTOUT'] = 'nestout'#

Model type discriminator

Validated by:
cmd() str[source]#

Command file string for this component.

property suffix: str#