rompy.swan.subcomponents.boundary.VARIABLEFILE#

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

Variable file specification.

VARIABLE FILE < [len] '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 [267]: from rompy.swan.subcomponents.boundary import VARIABLEFILE

In [268]: par = VARIABLEFILE(
   .....:     fname=["tpar1.txt", "tpar2.txt", "tpar3.txt"],
   .....:     len=[0.0, 0.5, 1.0],
   .....: )
   .....: 

In [269]: print(par.render())
VARIABLE FILE &
	len=0.0 fname='tpar1.txt' seq=1 &
	len=0.5 fname='tpar2.txt' seq=1 &
	len=1.0 fname='tpar3.txt' seq=1
Fields:
Validators:
field dist: list[float] [Required] (alias 'len')#

Is the distance from the first point of the side or segment to the point along the side or segment for which the incident wave spectrum is prescribed. Note: these points do no have to coincide with grid points of the computational grid. [len] is the distance in m or degrees in the case of spherical coordinates, not in grid steps. The values of len should be given in ascending order. The length along a SIDE is measured in clockwise or counterclockwise direction, depending on the options CCW or CLOCKWISE (see above). The option CCW is default. In case of a SEGMENT the length is measured from the indicated begin point of the segment.

Validated by:
field fname: list[str] [Required]#

Names of the files containing the boundary condition

Validated by:
field model_type: Literal['variablefile', 'VARIABLEFILE'] = 'variablefile'#

Model type discriminator

Validated by:
field seq: list[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.

Validated by:
cmd() str[source]#

Render subcomponent cmd.

validator ensure_equal_size  »  all fields[source]#