rompy.swan.components.output.QUANTITIES#

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

Define output settings for multiple output.

QUANTITY < output > ...
QUANTITY < output > ...
..

This component can be used to prescribe and render multiple QUANTITY components.

Examples

In [1]: from rompy.swan.components.output import QUANTITY, QUANTITIES

In [2]: q1 = QUANTITY(output=["xp"], hexp=100)

In [3]: q2 = QUANTITY(output=["hsign", "tm01", "rtmm10"], excv=-9)

In [4]: q3 = QUANTITY(output=["hsign", "tm02", "fspr"], fmin=0.03, fmax=0.5)

In [5]: q4 = QUANTITY(output=["hsign"], fswell=0.08)

In [6]: q5 = QUANTITY(output=["per"], short="Tm-1,0", power=0)

In [7]: q6 = QUANTITY(output=["transp", "force"], coord="frame")

In [8]: quantities = QUANTITIES(quantities=[q1, q2, q3, q4, q5, q6])

In [9]: print(quantities.render())
QUANTITY XP hexp=100.0
QUANTITY HSIGN TM01 RTMM10 excv=-9.0
QUANTITY HSIGN TM02 FSPR fmin=0.03 fmax=0.5
QUANTITY HSIGN fswell=0.08
QUANTITY PER short='Tm-1,0' power=0.0
QUANTITY TRANSP FORCE FRAME

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

Fields:
field model_type: Literal['quantities', 'QUANTITIES'] = 'quantities'#

Model type discriminator

field quantities: list[QUANTITY] [Required]#

QUANTITY components

cmd() list[source]#

Return the string or list of strings to render the component to the CMD.