rompy.swan.components.group.INPGRIDS#

pydantic model rompy.swan.components.group.INPGRIDS[source]#

SWAN input grids group component.

INPGRID ...
READGRID ...

INPGRID ...
READGRID ...

...

This group component is a convenience to allow defining and rendering a list of input grid components.

Examples

In [30]: from rompy.swan.components.inpgrid import REGULAR, ICE

In [31]: from rompy.swan.components.group import INPGRIDS

In [32]: inpgrid_bottom = REGULAR(
   ....:     grid_type="bottom",
   ....:     excval=-99.0,
   ....:     xpinp=172.0,
   ....:     ypinp=-41.0,
   ....:     alpinp=0.0,
   ....:     mxinp=99,
   ....:     myinp=99,
   ....:     dxinp=0.005,
   ....:     dyinp=0.005,
   ....:     readinp=dict(fname1="bottom.txt"),
   ....: )
   ....: 

In [33]: inpgrid_wind = REGULAR(
   ....:     grid_type="wind",
   ....:     excval=-99.0,
   ....:     xpinp=172.0,
   ....:     ypinp=-41.0,
   ....:     alpinp=0.0,
   ....:     mxinp=99,
   ....:     myinp=99,
   ....:     dxinp=0.005,
   ....:     dyinp=0.005,
   ....:     readinp=dict(fname1="wind.txt"),
   ....:     nonstationary=dict(
   ....:         tbeg="2019-01-01T00:00:00",
   ....:         tend="2019-01-07 00:00:00",
   ....:         delt=3600,
   ....:         dfmt="hr",
   ....:     ),
   ....: )
   ....: 

In [34]: inpgrid_ice_cte = ICE(aice=0.8, hice=2.0)

In [35]: inpgrids = INPGRIDS(inpgrids=[inpgrid_bottom, inpgrid_wind, inpgrid_ice_cte])

In [36]: print(inpgrids.render())
INPGRID BOTTOM REGULAR xpinp=172.0 ypinp=-41.0 alpinp=0.0 mxinp=99 myinp=99 dxinp=0.005 dyinp=0.005 EXCEPTION excval=-99.0
READINP BOTTOM fac=1.0 fname1='bottom.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

INPGRID WIND REGULAR xpinp=172.0 ypinp=-41.0 alpinp=0.0 mxinp=99 myinp=99 dxinp=0.005 dyinp=0.005 EXCEPTION excval=-99.0 NONSTATIONARY tbeginp=20190101.000000 deltinp=1.0 HR &
    tendinp=20190107.000000
READINP WIND fac=1.0 fname1='wind.txt' idla=1 nhedf=0 nhedt=0 nhedvec=0 FREE

ICE aice=0.8 hice=2.0
Fields:
Validators:
field inpgrids: list[REGULAR | CURVILINEAR | UNSTRUCTURED | WIND | ICE] [Required]#

List of input grid components

Constraints:
  • min_length = 1

Validated by:
field model_type: Literal['inpgrids'] = 'inpgrids'#

Model type discriminator

cmd() str | list[source]#

Return the string or list of strings to render the component to the CMD.

validator ensure_unique_grid_type  »  inpgrids[source]#

Ensure that each grid type is unique.