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
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#