rompy.swan.subcomponents.boundary.CONSTANTFILE#

pydantic model rompy.swan.subcomponents.boundary.CONSTANTFILE[source]#

Constant file specification.

CONSTANT FILE 'fname' [seq]

There are three types of files:

  • TPAR files containing nonstationary wave parameters

  • files containing stationary or nonstationary 1D spectra (usually from measurements)

  • files containing stationary or nonstationary 2D spectra (from other computer programs or other SWAN runs)

A TPAR file is for only one location; it has the string TPAR on the first line of the file and a number of lines which each contain 5 numbers, i.e.: Time (ISO-notation), Hs, Period (average or peak period depending on the choice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian, depending on command SET), Directional spread (in degrees or as power of cos depending on the choice given in command BOUND SHAPE).

Note

Example of a TPAR file:

TPAR
19920516.130000 4.2 12. -110. 22.
19920516.180000 4.2 12. -110. 22.
19920517.000000 1.2 8. -110. 22.
19920517.120000 1.4 8.5 -80. 26
19920517.200000 0.9 6.5 -95. 28

Examples

In [241]: from rompy.swan.subcomponents.boundary import CONSTANTFILE

In [242]: par = CONSTANTFILE(fname="tpar.txt")

In [243]: print(par.render())
CONSTANT FILE fname='tpar.txt'
Fields:
field fname: str [Required]#

Name of the file containing the boundary condition.

Constraints:
  • max_length = 36

field model_type: Literal['constantfile', 'CONSTANTFILE'] = 'constantfile'#

Model type discriminator

field seq: int | None = None#

sequence number of geographic location in the file (see Appendix D); useful for files which contain spectra for more than one location. Note: a TPAR file always contains only one location so in this case seq must always be 1

Constraints:
  • ge = 1

cmd() str[source]#

Render subcomponent cmd.