OpenEarthtools contains a dedicated toolbox for SWAN input and output. You can access this toolbox at https://svn.oss.deltares.nl/repos/openearthtools/trunk/matlab/applications/swan/ after downloading a copy with svn with your free OpenEarth account. This toolbox allows you to automate all results: open the SWAN input file with swan_io_input into a struct, and then loop all external output files listed in the struct with for instance  swan_io_spectrum and swan_io_table. You can automatically annotate any plots with your input settings. (Note that this toolbox does not use the new, preferred netCDF output yet that is available in recent SWAN releases.)

  Contents of OpenEarth swan toolbox.
  swan is the TU Delft Civil Engineering Department spectral wave model
  Simulating Waves Near Shore, available at http://swan.tudelft.nl
  
 swan semantics
  swan_defaults                  - returns swan default SET settings
  swan_keyword                   - read swan keywords from text line 
  swan_keyword2longname          - get swan long  name (OVLNAM) from associated swan code (OVKEYW)
  swan_keyword2shortname         - get swan short name (OVSNAM) from associated swan code (OVKEYW)
  swan_keyword2texname           - get swan LaTeX name (TEXNAM) from associated swan code (OVKEYW)
  swan_quantity                  - returns default properties of swan output parameters
  swan_quantitytex               - returns LaTaX names of swan output parameters
  swan_shortname2keyword         - get swan swan code (OVKEYW) from associated short name (OVSNAM)
 
 swan mesh file IO (note latest release also has netCDF files)
  swan_io_bot                    - read/write swan ASCII bottom file
  swan_io_grd                    - read/write swan ASCII grid file  
  swan_io_ele                    - read/write swan/triangular unstructured element file
  swan_io_node                   - read/write swan/triangular unstructured node file  
 
 swan data file IO (note latest release also has netCDF files)
  swan_io_table                  - read swan ASCII output table
  swan_io_mergesp2               - Merge multiple sp2 files into 1 sp2 file
  swan_io_spectrum               - read swan 1D or 2D spectrum file
  swan_io_spectrum_write         - Writes a 1D swan spectrum file
  swan_io_spectrum2nc            - Writes a swan 1D or 2D spectrum file to netCDF file

 swan input files
  swan_io_input                  - read swan input file into struct (to automate postprocessing)
 
 swan parameters calculation incl. high-freq. tail (energy not present in spectral matrix)
  swan_hs                        - calculates significant wave height from wave spectrum as in swan
  swan_tm01                      - calculates average absolute period Tm01 from wave spectrum as in swan
  swan_tm02                      - calculates average absolute period Tm01 from wave spectrum as in swan
 
 See also: xbeach, delft3d, waves
  • No labels