SWAN GIS Post Processing

USEFUL LINKS
Wiki Links Help Downloads
TUFLOW FV Wiki Main Page Products Support/Contact TUFLOW FV Downloads
TUFLOW FV Tutorials Requesting a Licence Tutorial Module Data
TUFLOW Classic/HPC Wiki TUFLOW FV Glossary Manuals

Introduction

This page describes how to use the post processing tools in the SWAN GIS plugin. The plugin offers an interface for basic post processing of SWAN model results. With the standard SWAN distribution, grid files can be output as either MAT or text files. The interface offers a tool for processing the MAT file output format to a more user friendly netCDF4 output format. It also offers a tool for extracting point time series files from a netCDF4 output file.

Converting SWAN MAT Outputs to NetCDF4

Start QGIS (version 3.16.3 or later). Under the plugins menu, navigate to the plugins/TUFLOW/SWAN GIS Tools/Post Processing tab:

 
Select your SWAN MAT result file path (if using the suggested paths it should be Moreton_Bay_Waves\SWAN\04_results) and simply press the 'Convert' button:

 

Note: The tutorial module uses non-rotated model domains in a spherical coordinate system and therefore the 'MAT is Rotated?' and 'MAT is Non-Spherical?' toggle buttons are left unticked. If processing your own non-tutorial model results please select the 'MAT is Rotated?' and/or 'MAT is Non-Spherical?' toggle boxes if your model domain is rotated or uses cartesian coordinates.

By default the output NetCDF will be saved where the original MAT result file was output by SWAN. The SWAN GIS plugin automatically post processes the NetCDF4 file to the same location and uses the same name, just replacing the file extension. For example:

 

Following conversion to NetCDF we can review our SWAN results by opening them in the TUFLOW Viewer for QGIS.

To open the TUFLOW Viewer click the icon in the plugin toolbar.

 


To load the SWAN simulation results select File >> Load Results - Map Outputs from the TUFLOW Viewer drop down menu.

 


Navigate to the ../SWAN/04_results/ folder and select the REGIONAL_20180901_20181001.nc file.


 


Your QGIS window will now appear similar to that shown below:


 


Within the TUFLOW Viewer window click on the small down arrow on the Plot Time Series From Map Output icon  .

Select the significant wave height checkbox.


 


Click again on the Plot Time Series From Map Output icon but this time to the left of the down arrow  , and use the cursor to select on the map output the desired location for plotting.


 


The TUFLOW Viewer window should now display a time series of significant wave height at the chosen location, similar to that shown in the example below:


 

Extracting a Time Series from a SWAN NetCDF File

Please note this section is optional if completing Tutorial Module 08.

As an optional extension item, to investigate wave conditions at different locations in our model we can extract a timeseries from our SWAN output results.

  1. input the SWAN NetCDF4 result file noting that if you have MAT files you will need to use the converter first.
     

  2. Input the output file path for the CSV file time series.
     

  3. Create a new CSV file in C:\Tutorial_Module_SWAN_GIS_Tools\Moreton_Bay_Waves\QGIS called POINTS_XTR_000.csv.
     

  4. Open the CSV file in a text editor and add the below entries as shown. These are the points where time series will be extracted.
    Name X Y
    POINT_01 153.637 -27.477
    POINT_02 153.283 -26.877

     

  5. Set the points file input to the newly created CSV file.
     

  6. Press the 'Extract' button to execute the time series extraction. Once complete, navigate to the output path. Separate files would have been output for each input point.
     


Extracting a Time Series from Gridded ERA5 Wind Data

Please note this section is optional if completing Tutorial Module 08.

Wind time series can be extracted from ERA5 using the ERA5 Time Series Extractor Tool. Extracting time series from ERA5 is analogous to extracting time series data using the SWAN Time Series Extractor.

Resultant wind time series are saved in the following format:
153.250000,-27.000000
TIME,U10,V10
01/09/2018 00:00:00,3.64,0.27
01/09/2018 01:00:00,3.06,0.04
01/09/2018 02:00:00,2.12,-0.39
...
...

Where the date and time format is dd/mm/yyyy HH:MM:SS and U10 and V10 vector components are output in cartesian convention. i.e. the direction to where the vector points, measured counter-clockwise from due East. For example <-1U, 0V> will be wind coming from the east and heading west.

If a spatially constant wind field is preferred over a gridded ERA5 dataset the csv output by the ERA5 Time Series Extractor Tool can be used as wind input to the SWAN GIS Model Builder.

Conclusion

You have now worked through the post-processing options available in the SWAN GIS Tools. You can now return back to the main tutorial page.