rompy.swan.components.group.OUTPUT#

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 [40]: from rompy.swan.components.output import POINTS, BLOCK, QUANTITIES, TABLE

In [41]: from rompy.swan.components.group import OUTPUT

In [42]: points = POINTS(sname="outpts", xp=[172.3, 172.4], yp=[-39, -39])

In [43]: quantity = QUANTITIES(
   ....:     quantities=[
   ....:         dict(output=["depth", "hsign", "tps", "dir", "tm01"], excv=-9),
   ....:     ]
   ....: )
   ....: 

In [44]: times = dict(tbeg="2012-01-01T00:00:00", delt="PT30M", tfmt=1, dfmt="min")

In [45]: block = BLOCK(
   ....:     model_type="block",
   ....:     sname="COMPGRID",
   ....:     fname="./swangrid.nc",
   ....:     output=["depth", "hsign", "tps", "dir"],
   ....:     times=times,
   ....: )
   ....: 

In [46]: table = TABLE(
   ....:     sname="outpts",
   ....:     format="noheader",
   ....:     fname="./swantable.nc",
   ....:     output=["hsign", "hswell", "dir", "tps", "tm01", "watlev", "qp"],
   ....:     times=times,
   ....: )
   ....: 

In [47]: out = OUTPUT(
   ....:     points=points,
   ....:     quantity=quantity,
   ....:     block=block,
   ....:     table=table,
   ....: )
   ....: 

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

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.

model_post_init(context: Any, /) None#

This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

validator ngrid_and_nestout  »  all fields[source]#

Ensure NGRID and NESTOUT are specified together.

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.