rompy.swan.components.lockup.COMPUTE_NONSTAT#

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

Multiple SWAN nonstationary computations.

COMPUTE NONSTATIONARY [tbegc] [deltc] SEC|MIN|HR|DAY [tendc]
HOTFILE 'fname' ->FREE|UNFORMATTED
COMPUTE NONSTATIONARY [tbegc] [deltc] SEC|MIN|HR|DAY [tendc]
HOTFILE 'fname' ->FREE|UNFORMATTED
.
.

This component can be used to define multiple nonstationary compute commands and write intermediate results as hotfiles between then.

Note

The field times is optional to allow for the case where the user wants to set times dynamically after instantiating this component.

Examples

In [1]: from rompy.swan.subcomponents.time import NONSTATIONARY

In [2]: from rompy.swan.components.lockup import COMPUTE_NONSTAT

In [3]: times = NONSTATIONARY(
   ...:     tbeg="1990-01-01T00:00:00",
   ...:     tend="1990-02-01T00:00:00",
   ...:     delt="PT1H",
   ...:     dfmt="hr",
   ...: )
   ...: 

In [4]: comp = COMPUTE_NONSTAT(times=times)

In [5]: print(comp.render())
COMPUTE NONSTATIONARY tbegc=19900101.000000 deltc=1.0 HR tendc=19900201.000000

In [6]: comp = COMPUTE_NONSTAT(
   ...:     times=times,
   ...:     hotfile=dict(fname="hotfile.swn", format="free"),
   ...:     hottimes=["1990-02-01T00:00:00"],
   ...: )
   ...: 

In [7]: print(comp.render())
COMPUTE NONSTATIONARY tbegc=19900101.000000 deltc=1.0 HR tendc=19900201.000000
HOTFILE fname='hotfile_19900201T000000.swn' FREE

In [8]: comp = COMPUTE_NONSTAT(
   ...:     times=times,
   ...:     initstat=True,
   ...:     hotfile=dict(fname="hotfile", format="free"),
   ...:     hottimes=[6, 12, 18, -1],
   ...: )
   ...: 

In [9]: print(comp.render())
COMPUTE STATIONARY time=19900101.000000
COMPUTE NONSTATIONARY tbegc=19900101.000000 deltc=1.0 HR tendc=19900101.060000
HOTFILE fname='hotfile_19900101T060000' FREE
COMPUTE NONSTATIONARY tbegc=19900101.060000 deltc=1.0 HR tendc=19900101.120000
HOTFILE fname='hotfile_19900101T120000' FREE
COMPUTE NONSTATIONARY tbegc=19900101.120000 deltc=1.0 HR tendc=19900101.180000
HOTFILE fname='hotfile_19900101T180000' FREE
COMPUTE NONSTATIONARY tbegc=19900101.180000 deltc=1.0 HR tendc=19900201.000000
HOTFILE fname='hotfile_19900201T000000' FREE
Fields:
Validators:
field initstat: bool = False#

Run a STATIONARY computation at the initial time prior to the NONSTATIONARY computation(s) to prescribe initial conditions

Validated by:
field model_type: Literal['nonstat', 'NONSTAT'] = 'nonstat'#

Model type discriminator

Validated by:
field times: NONSTATIONARY [Optional]#

Compute times

Validated by:
cmd() list[source]#

Command file string for this component.

validator times_suffix  »  times[source]#