rompy.swan.components.output.TEST#

pydantic model rompy.swan.components.output.TEST[source]#

Write intermediate results.

TEST [itest] [itrace] POINTS XY|IJ (PAR 'fname') (S1D 'fname') (S2D 'fname')

Note

The 6 source terms written due to the presence of the keyword S1D or S2D are: wind input, whitecapping, bottom friction, breaking, 3- and 4- wave interactions.

Examples

In [1]: from rompy.swan.components.output import TEST

In [2]: test = TEST(
   ...:     itest=10,
   ...:     points=dict(model_type="ij", i=[0, 0], j=[10, 20]),
   ...:     fname_par="integral_parameters.test",
   ...:     fname_s1d="1d_variance_density.test",
   ...:     fname_s2d="2d_variance_density.test",
   ...: )
   ...: 

In [3]: print(test.render())
TEST itest=10 POINTS IJ &
    i=0 j=10 &
    i=0 j=20 &
    PAR fname='integral_parameters.test' S1D fname='1d_variance_density.test' S2D fname='2d_variance_density.test'

In [4]: import numpy as np

In [5]: test = TEST(
   ...:     points=dict(
   ...:         model_type="xy",
   ...:         x=np.linspace(172.5, 174.0, 25),
   ...:         y=25*[-38],
   ...:     ),
   ...:     fname_s2d="2d_variance_density.test",
   ...: )
   ...: 

In [6]: print(test.render())
TEST POINTS XY &
    172.50000000 -38.00000000 &
    172.56250000 -38.00000000 &
    172.62500000 -38.00000000 &
    172.68750000 -38.00000000 &
    172.75000000 -38.00000000 &
    172.81250000 -38.00000000 &
    172.87500000 -38.00000000 &
    172.93750000 -38.00000000 &
    173.00000000 -38.00000000 &
    173.06250000 -38.00000000 &
    173.12500000 -38.00000000 &
    173.18750000 -38.00000000 &
    173.25000000 -38.00000000 &
    173.31250000 -38.00000000 &
    173.37500000 -38.00000000 &
    173.43750000 -38.00000000 &
    173.50000000 -38.00000000 &
    173.56250000 -38.00000000 &
    173.62500000 -38.00000000 &
    173.68750000 -38.00000000 &
    173.75000000 -38.00000000 &
    173.81250000 -38.00000000 &
    173.87500000 -38.00000000 &
    173.93750000 -38.00000000 &
    174.00000000 -38.00000000 &
    S2D fname='2d_variance_density.test'

TODO: Support k in POINTS IJ.

Fields:
Validators:
field fname_par: str | None = None#

Name of the file where the integral parameters are written to

Validated by:
field fname_s1d: str | None = None#

Name of the file where the 1D variance density and 6 source terms are written to

Validated by:
field fname_s2d: str | None = None#

Name of the file where the 2D variance density and 6 source terms are written to

Validated by:
field itest: int | None = None#

The level of test output, for values under 100 the amount is usually reasonable, for values above 200 it can be very large. Values of up to 50 can be interpreted by the user (SWAN default: 1)

Validated by:
field itrace: int | None = None#

SWAN writes a message (name of subroutine) to the PRINT file at the first itrace entries of each subroutine (SWAN default: 0)

Validated by:
field model_type: Literal['test', 'TEST'] = 'test'#

Model type discriminator

Validated by:
field points: XY | IJ [Required]#

Points where detailed print output is produced (max of 50 points)

Validated by:
validator at_least_one  »  all fields[source]#

Warns if no test file is being specified.

cmd() str[source]#

Command file string for this component.

validator validate_points  »  points[source]#