rompy.swan.subcomponents.readgrid.READCOORD#

pydantic model rompy.swan.subcomponents.readgrid.READCOORD[source]#

SWAN coordinates reader.

READGRID COORDINATES [fac] 'fname' [idla] [nhedf] [nhedvec] &
    FREE|FORMAT ('form'|idfm)

Examples

In [97]: from rompy.swan.subcomponents.readgrid import READCOORD

In [98]: readcoord = READCOORD(
   ....:     fac=1.0,
   ....:     fname="coords.txt",
   ....:     idla=3,
   ....:     format="free",
   ....: )
   ....: 

In [99]: print(readcoord.render())
READGRID COORDINATES fac=1.0 fname='coords.txt' idla=3 nhedf=0 nhedvec=0 FREE
Fields:
Validators:

field fac: float = 1.0#

SWAN multiplies all values that are read from file by fac. For instance if the values are given in unit decimeter, one should make fac=0.1 to obtain values in m. To change sign use a negative fac

Constraints:
  • gt = 0.0

Validated by:
  • check_format_definition

field fname: str [Required]#

Name of the SWAN coordinates file

Validated by:
  • check_format_definition

field form: str | None = None#

A user-specified format string in Fortran convention, e.g., ‘(10X,12F5.0)’.Only used if format=’fixed’, do not use it if idfm is specified

Validated by:
  • check_format_definition

field format: Literal['free', 'fixed', 'unformatted'] = 'free'#

File format, one of ‘free’, ‘fixed’ or ‘unformatted’. If ‘free’, the file is assumed to use the FREE FORTRAN format. If ‘fixed’, the file is assumed to use a fixed format that must be specified by (only) one of ‘form’ or ‘idfm’ arguments. Use ‘unformatted’ to read unformatted (binary) files (not recommended for ordinary use)

Validated by:
  • check_format_definition

field grid_type: Literal['coordinates'] = 'coordinates'#

Type of the SWAN grid file

Validated by:
  • check_format_definition

field idfm: Literal[1, 5, 6, 8] | None = None#

File format identifier, only used if format=’fixed’

Validated by:
  • check_format_definition

field idla: IDLA = 1#

Prescribes the order in which the values of bottom levels and other fields should be given in the file

Validated by:
  • check_format_definition

field model_type: Literal['readcoord', 'READCOORD'] = 'readcoord'#

Model type discriminator

Validated by:
  • check_format_definition

field nhedf: int = 0#

The number of header lines at the start of the file. The text in the header lines is reproduced in the print file created by SWAN . The file may start with more header lines than nhedf because the start of the file is often also the start of a time step and possibly also of a vector variable (each having header lines, see nhedt and nhedvec)

Constraints:
  • ge = 0

Validated by:
  • check_format_definition

field nhedvec: int = 0#

For each vector variable: number of header lines in the file at the start of each component (e.g., x- or y-component)

Constraints:
  • ge = 0

Validated by:
  • check_format_definition

cmd() str[source]#