Personal tools

Difference between revisions of "Mohid Swan"

From MohidWiki

Jump to: navigation, search
(Tide)
(Tide)
Line 88: Line 88:
 
Alternatively, the user domain model could be pre-run with tide only and outputs be given with the same time-period and same frequency as the wind's. Thus the user would only need to use the ''water level'' results from the hydrodynamic_x.hdf5 file.
 
Alternatively, the user domain model could be pre-run with tide only and outputs be given with the same time-period and same frequency as the wind's. Thus the user would only need to use the ''water level'' results from the hydrodynamic_x.hdf5 file.
  
Then, the tide should be converted into SWAN input file for tide, using the ''CONVERT FROM HDF5 TO SWAN OR MOHID'' action method of the [[ConvertToHF5]] tool. Here's the input configuration to copy/paste/edit in the ''ConvertToHdf5Action.dat'' file:
+
Then, the tide should be converted into SWAN input file for tide, using the ''CONVERT FROM HDF5 TO SWAN OR MOHID'' action method of the [[ConvertToHDF5]] tool. Here's the input configuration to copy/paste/edit in the ''ConvertToHdf5Action.dat'' file:
  
 
  <begin_file>
 
  <begin_file>

Revision as of 17:30, 17 June 2011

In this wiki it would be commented how to implement the Swan model into the Mohid modelling software.

Software Needed

In addition to the Mohid model it will be needed the following software to achive the goal.

For Maretequers, the software (with configuration examples) and user manuals can be found internally here

\\neptuno\Software\Swan

To get an example of the whole data pre-processing, look internally, here

\\neptuno\Software\MOHID\Mohid Swan

Bathymetry

To create a SWAN bathymetry, one may convert a MOHID bathymetry (grid data file) using the matlab script found in the \\neptuno\Software\MOHID\Mohid Swan\MohidGriddataToSWAN folder. In Matlab, select the script folder as the working directory then type at the matlab prompt:

> MohidBatim2SWAN.m

Then follow the GUI instructions. It should create a SWAN bathymetry file (.sty).

The bathymetry should be visualised using notepad or a software called sigma that needs to be localed in the root directory c:\

Sigma -> Task File -> Show so far -> Linha CGWID

Boundary Conditions

The Swan model would need of wind, tide and deep-Ocean swell as boundary conditions.

Wind

Wind vectors should also be provided from other model results (i.e. MOHID, MM5 or WRF) and then converted to the SWAN format using ConvertToHDF5 using the option "ConvertHDF5ToSWANorMOHID" that will provide a hourly file with values for x and y directions, be aware of the file size.

One way to extract winds to force the SWAN, is to use the wind velocity present in the Atmosphere_x.hdf5 file, coming from a 2D MOHID simulation pre-made for the study region.

An alternative way is to use MM5 HDF5 Mohid results and then glue and interpolate them to the MOHID model(s) grid(s) (which is(are) the same as SWAN's). To perform standard glue and interpolate operations with ConvertToHDF5, please refer to the ConvertToHDF5 wiki ...

ConvertToHDF5 configuration

Here's the ConvertToHdf5 configuration file ConvertToHDF5Action.dat for the action CONVERT FROM HDF5 TO SWAN OR MOHID to use (notice that there are two beginfile/endfile blocks, one for X direction, and another for the Y direction):

<begin_file>

ACTION                         : CONVERT FROM HDF5 TO SWAN OR MOHID

INPUTFILENAME                  : Atmosphere_1.hdf5
INPUT_GRID_FILENAME            : ../../Batim/MOHID/BatimSO.dat

<<beginproperty>>
wind velocity X
<<endproperty>>

START                          : 2011 04 04  0 0 0
END                            : 2011 04 07  0 0 0
OUTPUT_TIME                    : 0  3600
OUTPUT_OPTION                  : 1
<end_file>

<begin_file>

ACTION                         : CONVERT FROM HDF5 TO SWAN OR MOHID

INPUTFILENAME                  : Atmosphere_1.hdf5
INPUT_GRID_FILENAME            : ../../Batim/MOHID/BatimSO.dat

<<beginproperty>>
wind velocity Y
<<endproperty>>

START                          : 2011 04 04  0 0 0
END                            : 2011 04 07  0 0 0
OUTPUT_TIME                    : 0  3600
OUTPUT_OPTION                  : 1
<end_file>

Note that this configuration will produce hourly outputs.

Troubleshoot

Q: The conversion won't work or the SWAN model won't run because of the winds.

A: The Atmosphere_x.hdf5 of the MOHID results needs to be edited and changed (using HDFView). 1 - The MappingPoints2D data needs to be renamed to WaterPoints in the GRID/ group. 2 - The first instant of Time is could be wrong; it could display an offset of one dt. The time instant data should be edited and the offset should be removed. Example: Once, the first time instant in the HDF5 atmosphere_x file would read 2006 10 15 17 00 20 when it should read instead 2006 10 15 17 00 00.

Tide

The tide sould be obtained from other models (i.e. PCOMS), or calculated (i.e. Tideprev) and interpolated to the user domain grid.

For the interpolation method between the source grid and the user domain grid, the user is recommended to use the ConvertToHdf5 tool with the INTERPOLATE action. Please refer to this wiki.

Alternatively, the user domain model could be pre-run with tide only and outputs be given with the same time-period and same frequency as the wind's. Thus the user would only need to use the water level results from the hydrodynamic_x.hdf5 file.

Then, the tide should be converted into SWAN input file for tide, using the CONVERT FROM HDF5 TO SWAN OR MOHID action method of the ConvertToHDF5 tool. Here's the input configuration to copy/paste/edit in the ConvertToHdf5Action.dat file:

<begin_file>

ACTION                         : CONVERT FROM HDF5 TO SWAN OR MOHID

INPUTFILENAME                  : Hydrodynamic_x.hdf5
INPUT_GRID_FILENAME            : Batim/MOHID/BatimSO.dat

<<beginproperty>>
water level
<<endproperty>>

START                          : 2011 04 04  0 0 0
END                            : 2011 04 05  0 0 0
OUTPUT_TIME                    : 0  3600
OUTPUT_OPTION                  : 1
<end_file>

Swell

SWAN Model Input

Sect 3
CGRID is the origin, starting from the lower left corner
0   -> Rotation (0 no inclination)
1.3 -> Grid step x in degrees
2   -> Grid step y in degrees
130 -> cells -1 in X direction
200 -> cells -1 in Y direction
CIR -> Whole circle of directions
36  -> Number of directions
0.04 -> Minimum frequency
0.5 -> Maximum frequency
50 -> Number of frequencies -1 (in total then 51)
Sect 4
Equal to Sect 3 but dx = 0.01 = dy
wlevel.in
wind.in
Sect 5
WavewatchIII
BOUN (boundary) SIDE W CONST PAS 5 10 210 30
                                 H  T Dir Dispersion 
Sect 6 Physics
Do not change
Sect 8 Time series
To obtain a window it should be edited 
NGRID Indicating the lower left cell for the new grid, the size of the grid in x and y and the number of cells
SUBG Indicates the subgrid and in should be provided the lower left corner of the father grid
Sect 10 
It makes the domain 4 times and when reach the 98% probability then stops.
Defines the initial and final date
It should be defined a day as the initial date

Running Swan

Input and the exe file should be located in the same folder.

SWAN Model Output

To be viewed in Matlab .tbl X Y DEP HS DIR PER FOR WIND

Also can be used the ConvertToHDF5 with the option ConvertToAndFromSWAN