rompy.swan.components.inpgrid.REGULAR#
- pydantic model rompy.swan.components.inpgrid.REGULAR[source]#
SWAN regular input grid.
INPGRID [grid_type] REGULAR [xpinp] [ypinp] [alpinp] [mxinp] [myinp] & [dxinp] [dyinp] (EXCEPTION [excval]) & (NONSTATIONARY [tbeginp] [deltinp] ->SEC|MIN|HR|DAY [tendinp]) READGRID [grid_type] [fac] 'fname1' [idla] [nhedf] ([nhedt]) ([nhedvec]) & ->FREE|FORMAT|UNFORMATTED ('form'|[idfm])
This is a group component that includes an INPGRID and a READGRID component.
Examples
In [69]: from rompy.swan.components.inpgrid import REGULAR In [70]: inpgrid = 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 [71]: print(inpgrid.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 In [72]: inpgrid = 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 [73]: print(inpgrid.render()) 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
TODO: Use grid object, requires different grid parameters to be allowed.
- Fields:
- Validators:
- field alpinp: float | None = 0.0#
Direction of the positive x-axis of the input grid (in degrees, Cartesian convention)
- Validated by:
set_nonstat_suffix
- field dxinp: float [Required]#
Mesh size in x-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used
- Validated by:
set_nonstat_suffix
- field dyinp: float [Required]#
Mesh size in y-direction of the input grid, in m in case of Cartesian coordinates or in degrees if spherical coordinates are used. In 1D-mode, dyinp may have any value
- Validated by:
set_nonstat_suffix
- field excval: float | None = None#
Exception value to allow identifying and ignoring certain point inside the given grid during the computation. If fac != 1, excval must be given as fac times the exception value
- Validated by:
set_nonstat_suffix
- field grid_type: GridOptions [Required]#
Type of the swan input grid, e.g, ‘bottom’, ‘wind’, etc
- Validated by:
set_nonstat_suffix
- field model_type: Literal['regular', 'REGULAR'] = 'regular'#
Model type discriminator
- Validated by:
set_nonstat_suffix
- field mxinp: int [Required]#
Number of meshes in x-direction of the input grid (this number is one less than the number of grid points in this direction)
- Validated by:
set_nonstat_suffix
- field myinp: int [Required]#
Number of meshes in y-direction of the input grid (this number is one less than the number of grid points in this direction). In 1D-mode, myinp should be 0
- Validated by:
set_nonstat_suffix
- field nonstationary: NONSTATIONARY | None = None#
Nonstationary time specification
- Validated by:
set_nonstat_suffix
- field readinp: READINP [Required]#
SWAN input grid file reader specification
- Validated by:
set_nonstat_suffix
- field xpinp: float [Required]#
Geographic location (x-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default
- Validated by:
set_nonstat_suffix
- field ypinp: float [Required]#
Geographic location (y-coordinate) of the origin of the input grid in problem coordinates (in m) if Cartesian coordinates are used or in degrees if spherical coordinates are used. In case of spherical coordinates there is no default
- Validated by:
set_nonstat_suffix