rompy.swan.components.lockup.COMPUTE#

pydantic model rompy.swan.components.lockup.COMPUTE[source]#

Start SWAN computation.

COMPUTE STATIONARY|NONSTATIONARY

If the SWAN mode is stationary (see command MODE), then only the command COMPUTE should be given here.

If the SWAN mode is nonstationary (see command MODE), then the computation can be:

  • stationary (at the specified time: option STATIONARY here).

  • nonstationary (over the specified period of time.

To verify input to SWAN (e.g., all input fields such as water depth, wind fields, etc), SWAN can be run without computations (that is: zero iterations by using command NUM ACCUR MXITST=0).

In the case MODE NONSTATIONARY several commands COMPUTE can appear, where the wave state at the end of one computation is used as initial state for the next one, unless a command INIT appears in between the two COMPUTE commands. This enables the user to make a stationary computation to obtain the initial state for a nonstationary computation and/or to change the computational time step during a computation, to change a boundary condition etc. This also has the advantage of not using a hotfile since, it can be very large in size.

For small domains, i.e. less than 100 km or 1 deg, a stationary computation is recommended. Otherwise, a nonstationary computation is advised.

For a nonstationary computation, a time step of at most 10 minutes is advised (when you are choosing a time step larger than 10 minutes, the action density limiter (see command NUM) becomes probably a part of the physics).

Also, the time step should be chosen such that the Courant number is smaller than 10 for the fastest (or dominant) wave. Otherwise, a first order upwind scheme is recommended in that case; see command PROP BSBT. If you want to run a high resolution model with a very large time step, e.g. 1 hour, you may apply multiple COMPUT STAT commands. For a small time step (<= 10 minutes), no more than 1 iteration per time step is recommended (see command NUM … NONSTAT mxitns).

Examples

In [1]: from rompy.swan.components.lockup import COMPUTE

In [2]: comp = COMPUTE()

In [3]: print(comp.render())
COMPUTE

In [4]: comp = COMPUTE(
   ...:     times=dict(model_type="stationary", time="1990-01-01T00:00:00", tfmt=2)
   ...: )
   ...: 

In [5]: print(comp.render())
COMPUTE STATIONARY time='01-Jan-90 00:00:00'

In [6]: comp = COMPUTE(
   ...:     times=dict(
   ...:         model_type="nonstationary",
   ...:         tbeg="1990-01-01T00:00:00",
   ...:         tend="1990-02-01T00:00:00",
   ...:         delt="PT1H",
   ...:         tfmt=1,
   ...:         dfmt="hr",
   ...:     ),
   ...: )
   ...: 

In [7]: print(comp.render())
COMPUTE NONSTATIONARY tbegc=19900101.000000 deltc=1.0 HR tendc=19900201.000000
Fields:
Validators:
field i0: int | None = None#

Time index of the initial time step

field i1: int | None = None#

Time index of the final time step

field model_type: Literal['compute', 'COMPUTE'] = 'compute'#

Model type discriminator

field times: STATIONARY | NONSTATIONARY | None = None#

Times for the stationary or nonstationary computation

Validated by:
cmd() str[source]#

Command file string for this component.

validator times_suffix  »  times[source]#