Difference between revisions of "Mohid Swan"
From MohidWiki
(→Sample input file) |
(→Sample input file) |
||
Line 151: | Line 151: | ||
==Sample input file== | ==Sample input file== | ||
− | This sample input file configures the SWAN to run forced with tide, wind and a constant swell of 5m and 210º in direction (with a 30º of dispersion) coming in from the South and West boundaries of the domain. | + | This sample input file configures the SWAN to run forced with tide, wind and a constant swell of 5m and 210º in direction (with a 30º of dispersion) coming in from the South and West boundaries of the domain. It runs for 5 hours and demands hourly results in table format. |
$-------- Section 1. Start | $-------- Section 1. Start |
Revision as of 17:41, 17 June 2011
In this wiki it would be commented how to implement the Swan model into the Mohid modelling software.
Contents
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
The swell can be read from a global wave model, such as WW3 (Wave Watch 3).
Alternatively, a constant swell can be imposed at each of the lateral open boundaries of the user domain (North, South, East or West sides). This is defined and examplified in the SWAN configuration file sample below in this wiki article.
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
Sample input file
This sample input file configures the SWAN to run forced with tide, wind and a constant swell of 5m and 210º in direction (with a 30º of dispersion) coming in from the South and West boundaries of the domain. It runs for 5 hours and demands hourly results in table format.
$-------- Section 1. Start PROJECT 'SAndre' '1' SET 0.0 90 0.05 200 1 9.81 1025 0 5 NAUTICAL MODE NONSTAT TWOD COORD SPHE CCM $ $-------- Section 2. General $ $-------- Section 3. Model Description CGRID REG -9.22 37.637 0 0.445 0.615 89 123 CIR 36 0.04 0.5 50 $ $-------- Section 4. Input INPGRID BOTTOM REG -9.22 37.637 0 89 123 0.005 0.005 EXCEPTION -99. READ BOT 1 'batim/Swan/BatimSO.bty' 1 0 FREE $ INPGRID WLEVEL REG -9.22 37.637 0 89 123 0.005 0.005 EXCEPTION -999 & NONSTAT 20110404.000000 1 HR 20110404.050000 READ WLEV 1 SERIES 'WLevel/WLevel.Ini' 1 0 FREE $ INPGRID WX REG -9.22 37.637 0 89 123 0.005 0.005 EXCEPTION -999 & NONSTAT 20110404.000000 1 HR 20110404.050000 $ INPGRID WY REG -9.22 37.637 0 89 123 0.005 0.005 EXCEPTION -999 & NONSTAT 20110404.000000 1 HR 20110404.050000 READ WIND 1 SERIES 'Wind/Wind.ini' 1 0 FREE $ $ $-------- Section 5. Boundary/Initial Conditions $BOUNDNEST3 WWIII 'WW3_Conditions/NBCWW3.nbc' OPEN $ BOUN SHAPE JON 3.3 PEAK DSPR DEGREES BOUN SIDE W CONST PAR 5 10 210 30 BOUN SIDE S CONST PAR 5 10 210 30 $ $-------- Section 6. Physics GEN3 JANSSEN 4.5 0.5 AGROW 0.003 BREAKING CONSTANT FRICTION JONSWAP TRIAD DIFFRACtion $ $-------- Section 7. Numerics $ $-------- Section 8. Output Sets $ TABLE 'COMPGRID' NOHEAD 'Results/20110404.000000.tbl' DEP HS HSWELL PER RTP DIR PDIR FOR WIND & WATLEV OUTPUT 20110404.000000 1 HR $ TABLE 'COMPGRID' NOHEAD 'Results/Time.dat' TIME & OUTPUT 20110404.000000 1 HR $ $-------- Section 10. Run NUM ACCUR 0.02 0.02 0.02 98 30 COMPUTE NONSTAT 20110404.000000 20 MI 20110404.050000 STOP
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