rompy.swan.components.boundary.BOUNDNEST2#

pydantic model rompy.swan.components.boundary.BOUNDNEST2[source]#

Boundary spectra from WAM.

BOUNDNEST2 WAMNEST 'fname' FREE|UNFORMATTED ->CRAY|WKSTAT [xgc] [ygc] [lwdate]

With this optional command (not fully tested) a nested SWAN run can be carried out with the boundary conditions obtained from a coarse grid WAM run (WAM Cycle 4.5, source code as distributed by the Max Planck Institute in Hamburg). The spectral frequencies and directions of the coarse grid run do not have to coincide with the frequencies and directions used in the nested SWAN run; SWAN will interpolate to these frequencies and directions in the nested run (see Section 2.6.3). Note that SWAN will accept output of a WAM output location only if the SWAN grid point on the nest boundary lies within a rectangle between two consecutive WAM output locations with a width equal to 0.1 times the distance between these output locations on either side of the line between these WAM output locations. This BOUNDNEST2 command is not available for 1D computations. Only boundary conditions generated by WAM Cycle 4.5 can be read properly by SWAN. A nested SWAN run may use either Cartesian or spherical coordinates. A curvilinear grid may be used in the nested grid but the boundaries of this nest should conform to the rectangular course grid nest boundaries. WAM output files are unformatted (binary); this usually implies that WAM and SWAN have to run on the same computer. For those cases where WAM and SWAN run on different types of machines (binary files do not transfer properly), the option FREE is available in this command. The distributed version of WAM does not support the required free format nesting output; WAM users who modify WAM such that it can make formatted output, must modify WAM such that the files made by WAM can be read in free format, i.e. with at least a blank or comma between numbers.

Note

the contents of ‘fname’ file could look like:

CBO9212010000
CBO9212020000
CBO9212030000

Examples

In [5]: from rompy.swan.components.boundary import BOUNDNEST2

In [6]: boundary = BOUNDNEST2(fname="boundary.wam", format="cray", lwdate=12)

In [7]: print(boundary.render())
BOUNDNEST2 WAMNEST fname='boundary.wam' UNFORMATTED CRAY lwdate=12

Show JSON schema
{
   "title": "BOUNDNEST2",
   "description": "Boundary spectra from WAM.\n\n.. code-block:: text\n\n    BOUNDNEST2 WAMNEST 'fname' FREE|UNFORMATTED ->CRAY|WKSTAT [xgc] [ygc] [lwdate]\n\nWith this optional command (not fully tested) a nested SWAN run can be carried out\nwith the boundary conditions obtained from a coarse grid WAM run (WAM Cycle 4.5,\nsource code as distributed by the Max Planck Institute in Hamburg). The spectral\nfrequencies and directions of the coarse grid run do not have to coincide with the\nfrequencies and directions used in the nested SWAN run; SWAN will interpolate to\nthese frequencies and directions in the nested run (see Section 2.6.3). Note that\nSWAN will accept output of a WAM output location only if the SWAN grid point on the\nnest boundary lies within a rectangle between two consecutive WAM output locations\nwith a width equal to 0.1 times the distance between these output locations on\neither side of the line between these WAM output locations. This BOUNDNEST2 command\nis not available for 1D computations. Only boundary conditions generated by WAM\nCycle 4.5 can be read properly by SWAN. A nested SWAN run may use either Cartesian\nor spherical coordinates. A curvilinear grid may be used in the nested grid but the\nboundaries of this nest should conform to the rectangular course grid nest\nboundaries. WAM output files are unformatted (binary); this usually implies that\nWAM and SWAN have to run on the same computer. For those cases where WAM and SWAN\nrun on different types of machines (binary files do not transfer properly), the\noption FREE is available in this command. The distributed version of WAM does not\nsupport the required free format nesting output; WAM users who modify WAM such that\nit can make formatted output, must modify WAM such that the files made by WAM can\nbe read in free format, i.e. with at least a blank or comma between numbers.\n\nNote\n----\nthe contents of 'fname' file could look like:\n\n.. code-block:: text\n\n    CBO9212010000\n    CBO9212020000\n    CBO9212030000\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.boundary import BOUNDNEST2\n    boundary = BOUNDNEST2(fname=\"boundary.wam\", format=\"cray\", lwdate=12)\n    print(boundary.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "boundnest2",
         "description": "Model type discriminator",
         "enum": [
            "boundnest2",
            "BOUNDNEST2"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "fname": {
         "description": "A file name that contains all the names of WAM files containing the nested boundary conditions in time-sequence (usually one file per day)",
         "maxLength": 36,
         "minLength": 1,
         "title": "Fname",
         "type": "string"
      },
      "format": {
         "description": "Format of the WAM file. `cray`: CRAY version of WAM, `wkstat`: WORKSTATION version of WAM, `free`: Free format (these files are not generated standard by WAM)",
         "enum": [
            "cray",
            "wkstat",
            "free"
         ],
         "title": "Format",
         "type": "string"
      },
      "xgc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If SWAN is used with Cartesian coordinates: longitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `xgc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file",
         "title": "Xgc"
      },
      "ygc": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "If SWAN is used with Cartesian coordinates: latitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then `ygc` is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file",
         "title": "Ygc"
      },
      "lwdate": {
         "default": 12,
         "description": "Length of character string for date-time as used in the WAM files. Possible values are: 10 (i.e. YYMMDDHHMM), 12 (i.e. YYMMDDHHMMSS) or 14 (i.e. YYYYMMDDHHMMSS) (SWAN default: `lwdate` = 12)",
         "enum": [
            10,
            12,
            14
         ],
         "title": "Lwdate",
         "type": "integer"
      }
   },
   "additionalProperties": false,
   "required": [
      "fname",
      "format"
   ]
}

Fields:
field fname: str [Required]#

A file name that contains all the names of WAM files containing the nested boundary conditions in time-sequence (usually one file per day)

Constraints:
  • min_length = 1

  • max_length = 36

field format: Literal['cray', 'wkstat', 'free'] [Required]#

Format of the WAM file. cray: CRAY version of WAM, wkstat: WORKSTATION version of WAM, free: Free format (these files are not generated standard by WAM)

field lwdate: Literal[10, 12, 14] = 12#

Length of character string for date-time as used in the WAM files. Possible values are: 10 (i.e. YYMMDDHHMM), 12 (i.e. YYMMDDHHMMSS) or 14 (i.e. YYYYMMDDHHMMSS) (SWAN default: lwdate = 12)

field model_type: Literal['boundnest2', 'BOUNDNEST2'] = 'boundnest2'#

Model type discriminator

field xgc: float | None = None#

If SWAN is used with Cartesian coordinates: longitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then xgc is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file

field ygc: float | None = None#

If SWAN is used with Cartesian coordinates: latitude of south-west corner of SWAN computational grid (in degrees); if the south-west corner of the nest in the WAM computation is on land this value is required. If SWAN is used with spherical coordinates then ygc is ignored by SWAN (SWAN default: the location of the first spectrum encountered in the nest file

cmd() str[source]#

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

property format_str#