Boundary and initial conditions


\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

                   | -> JONswap  [gamma]  |
                   |                      |
                   |    PM                |
                   |                      |    | -> PEAK  |
BOUnd SHAPespec   <     GAUSs  [sigfr]     >  <            >   &
                   |                      |    |    MEAN  |
                   |    BIN               |
                   |                      |
                   |    TMA [gamma] [d]   |


                        | -> POWer      |
                DSPR   <                 >
                        |    DEGRees    |

\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

This command BOUND SHAPESPEC defines the shape of the spectra (both in frequency and direction) at the boundary of the computational grid in case of parametric spectral input (see command BOUNDSPEC).


JONSWAP JONSWAP spectrum will be used. This is default.  
[gamma] peak enhancement parameter of the JONSWAP spectrum.  
  Default: [gamma]=3.3.  
PM Pierson-Moskowitz spectrum will be used.  
GAUSS a Gaussian-shaped frequency spectrum will be used.  
BIN energy is located in one frequency bin (the frequency bin closest to the [per]  
  value of command BOUNDSPEC).  
[sigfr] width of the Gaussian frequency spectrum expressed as a standard deviation in Hz.  
TMA the shape is JONSWAP though adapted to shallow water.  
[d] the reference depth at the wave maker in meters.  
PEAK the peak period (for definition, see Appendix A) is used as characteristic  
  wave period. This is default.  
MEAN $T_{m01}$ (for definition, see Appendix A) is used as the characteristic wave period.  
DSPR option for expressing the width of the directional distribution; the distribution  
  function itself is $\cos^m(\theta-\theta_{\rm peak})$.  
POWER the directional width is expressed with the power $m$ itself, this option is default  
  (note that the directional resolution should accommodate the directional width,  
  see command CGRID).  
DEGREES the directional width is expressed in terms of the directional standard deviation  
  of the $\cos^m(\theta-\theta_{\rm peak})$ distribution (for definition, see Appendix A).  
  (Note that the directional resolution should accommodate the directional width,  
  see command CGRID).  

If this command is not used, the JONSWAP option will be used by SWAN with [gamma]=3.3 and POWER for the directional width.


\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

                       | North |
                       | NW    |
                       | West  |
                       | SW    |   | -> CCW     |
           | -> SIDE  <  South  > <              >          |
           |           | SE    |   | CLOCKWise  |           |
           |           | East  |                            |
           |           | NE    |                            |
           |           |       |                            |
BOUndspec <            | [k]   |                             >    &
           |                                                |
           |                                                |
           |              | -> XY  <  [x]  [y]  >       |   |
           |              |                             |   |
           |    SEGMent  <         | <  [i]  [j]  > |    >  |
                          |    IJ <                  >  |
                          |        | <  [k]  >      |   |


           |           | PAR    [hs] [per] [dir] [dd]         |
           | CONstant <                                       |
           |           | FILE 'fname' [seq]                   |
          <                                                    >
           |                                                  |
           |           | PAR  < [len] [hs] [per] [dir] [dd] > |
           | VARiable <                                       |
           |           | FILE < [len] 'fname' [seq] >         |

\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

This command BOUNDSPEC defines parametric spectra at the boundary. It consists of two parts, the first part defines the boundary side or segment where the spectra will be given, the second part defines the spectral parameters of these spectra. Note that in fact only the incoming wave components of these spectra are used by SWAN. The fact that complete spectra are calculated at the model boundaries from the spectral parameters should not be misinterpreted. Only the incoming components are effective in the computation.


There are two ways to define the part of the boundary at which the spectra are imposed. The first (SIDE) is easiest if the boundary is one full side of the computational grid, although it should not be used for curved boundaries. The second (SEGMENT) can be used if the boundary segment goes around the corner of the grid, or if the segment is only part of one side of the grid.


This BOUNDSPEC command can be given a number of times, i.e. to define incident wave fields on various sides or segments of the boundary. One BOUNDSPEC command can be used for only one side or one contiguous segment.


Note that commands SEGMENT and VARIABLE are not supported in case of unstructured mesh version of SWAN in parallel mode.

SIDE the boundary is one full side of the computational grid (in 1D cases either  
  of the two ends of the 1D grid).  
NORTH, ... indicates on which side the boundary condition is applied. N means the  
  boundary is the north edge (if present) of the computational domain, likewise  
  for W is west, S is south, E is east, NW is northwest, NE is northeast,  
  SW is southwest and SE is southeast. Note that the boundary is assumed to
  be a straight line. (Use the SEGMENT command as an alternative.)  
  Another note: in case of Cartesian coordinates, the direction of the problem  
  coordinate system must be defined by the user (see the SET ...[north]  
  command), by default the positive $x-$axis points East.  
  ONLY MEANT FOR STRUCTURED GRIDS.  
[k] indicates on which side of the unstructured grid the boundary condition is  
  applied. The value of [k] corresponds to the boundary marker as indicated in  
  file(s) produced by a grid generator (such as in the last column of the Triangle  
  .node file and the Easymesh .n file or the last part of file fort.14). Boundary  
  markers are tags to identify which vertices occur on a boundary of the mesh.  
  It is assumed that the full side in question is represented by a single  
  boundary marker.  
  ONLY MEANT FOR UNSTRUCTURED MESHES.  
CCW, see description of [len] below; these option are only effective if the  
CLOCKWISE option VARIABLE is used (see below).  
SEGMENT is used if SIDE is not used, i.e. either the boundary segment goes  
  around a corner of the grid, or the segment is only part of one side of the  
  grid. The distance along the segment (see [len] below) is measured  
  from the first point of the segment (see XY or IJ below).  
XY the segment is defined by means of a series of points in terms of problem  
  coordinates; these points do not have to coincide with grid points. The  
  (straight) line connecting two points must be close to grid lines of the  
  computational grid (the maximum distance is one hundredth of the length of  
  the straight line).  
  This option is default.  
[x], [y] problem coordinates of a point of the boundary segment (see command COORD).  
IJ the segment is defined by means of a series of computational grid points  
  given in terms of grid indices (origin at 0,0); not all grid points on the  
  segment have to be mentioned. If two points are on the same grid line,  
  intermediate points are assumed to be on the segment as well.  
[i], [j] grid indices of a point of the segment. Values of [i] range between 0  
  and [mxc] (see command CGRID), values of [j] between 0 and [myc]  
  (inclusive).  
  ONLY MEANT FOR STRUCTURED GRIDS.  
[k] index of boundary vertex of the segment. This can be obtained in a grid  
  generator file (fort.14, .node and .n files of ADCIRC, Triangle and  
  Easymesh, respectively). The order must be counterclockwise!  
  ONLY MEANT FOR UNSTRUCTURED MESHES.  
CONSTANT with this option the wave spectra are constant along the side or segment.  
VARIABLE with this option the wave spectra can vary along the side or segment. The  
  incident wave field is prescribed at a number of points of the side or  
  segment, these points are characterized by their distance from the begin  
  point of the side or segment. The wave spectra for grid points on the  
  boundary of the computational grid are calculated by SWAN by the spectral  
  interpolation technique described in Section 2.6.3.  
PAR the wave spectra are defined by means of the following spectral parameters  
  (see command BOUND SHAPE for spectral shape).  
[hs] the significant wave height (in m).  
[per] the characteristic period of the energy spectrum (relative frequency; which  
  is equal to absolute frequency in the absence of currents);  
  [per] is the value of the peak period (in s), if option PEAK is chosen  
  in command BOUND SHAPE or  
  [per] is the value of the mean period, if option MEAN was chosen  
  in command BOUND SHAPE.  
[dir] the peak wave direction ( $\theta_{\rm peak}$, direction in degrees, constant  
  over frequencies).  
[dd] coefficient of directional spreading; a $cos^m(\theta)$ distribution is assumed.  
  [dd] is interpreted as the directional standard deviation in degrees,  
  if the option DEGREES is chosen in the command BOUND SHAPE.  
  Default: [dd]=30.  
  [dd] is interpreted as the power $m$, if the option POWER is chosen  
  in the command BOUND SHAPE.  
  Default: [dd]=2.  
[len] is the distance from the first point of the side or segment to the point along  
  the side or segment for which the incident wave spectrum is prescribed.  
  Note: these points do no have to coincide with grid points of the computational  
  grid. [len] is the distance in m or degrees in the case of spherical  
  coordinates, not in grid steps. The values of [len] should be given  
  in ascending order. The length along a SIDE is measured in clockwise or  
  counterclockwise direction, depending on the options CCW or CLOCKWISE (see  
  above). The option CCW is default. In case of a SEGMENT the length is  
  measured from the indicated begin point of the segment.  
FILE means that the incoming wave data are read from a file. There are three types  
  of files:  
  $\bullet$ TPAR files containing nonstationary wave parameters,  
  $\bullet$ files containing stationary or nonstationary 1D spectra  
  (usually from measurements),  
  $\bullet$ files containing stationary or nonstationary 2D spectra  
  (from other computer programs or other SWAN runs).  
  A TPAR file is for only one location; it has the string TPAR on the first  
  line of the file and a number of lines which each contain 5 numbers, i.e.:  
  Time (ISO-notation), Hs, Period (average or peak period depending on the  
  choice given in command BOUND SHAPE), Peak Direction (Nautical or Cartesian,  
  depending on command SET), Directional spread (in degrees or as power of cos  
  depending on the choice given in command BOUND SHAPE).  
     
  Example of a TPAR file:  
  TPAR  
  19920516.130000 4.2 12. -110. 22.  
  19920516.180000 4.2 12. -110. 22.  
  19920517.000000 1.2 8. -110. 22.  
  19920517.120000 1.4 8.5 -80. 26  
  19920517.200000 0.9 6.5 -95. 28  
     
  The structure of the files containing 1D or 2D spectra is described in  
  Appendix D (there is no relation with the definition of the boundary file  
  generated by WAM or WAVEWATCH III). 1D and 2D files can be used for  
  stationary and nonstationary boundary conditions, and for one or more than  
  one location. The spectral frequencies (and directions in the case of a  
  2D spectrum) do not have to coincide with the frequencies and directions  
  used in the present SWAN run (in a nested run SWAN will interpolate to these  
  frequencies and directions). The coordinates of locations in the 1D and 2D  
  files are ignored when SWAN reads this file (SWAN uses the geographical  
  information in this BOUNDSPEC command instead).  
'fname' name of the file containing the boundary condition.  
[seq] sequence number of geographic location in the file (see Appendix D);  
  useful for files which contain spectra for more than one location.  
  Default: [seq] = 1 (i.e. first location).  
  Note: a TPAR file always contains only one location so in this case  
  [seq] must always be 1.  


\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

                          | -> CLOSed |
BOUndnest1  NEst 'fname' <             >
                          |    OPEN   |

\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

With this optional command a nested SWAN run can be carried out with the boundary conditions obtained from a coarse grid SWAN run (generated in that previous SWAN run with command NESTOUT not to be confused with option NEST in this command BOUNDNEST1). For this nested SWAN run the user has to give the CGRID command to define the computational grid before this BOUNDNEST1 command. The computational grid for SWAN in geographic space is the area bounded by the SWAN coarse run nest (SWAN boundary points of the nest). This implies that the boundaries of the SWAN coarse run nest and the boundaries of the SWAN nested computational area should be (nearly) identical (see below). The spectral frequencies and directions of the coarse grid run do not have to coincide with the frequencies and directions used in the nested SWAN run (as defined in the CGRID command); SWAN will interpolate to these frequencies and directions in the nested run (see Section 2.6.3).


To generate the nest boundary in the coarse grid run, use command NGRID. For the nested run, use the command CGRID with identical geographical information except the number of meshes (which will be much higher for the nested run).


This BOUNDNEST1 command is not available for 1D computations; in such cases the commands SPECOUT and BOUNDSPEC can be used for the same purpose.


A nested SWAN run must use the same coordinate system as the coarse grid SWAN run. For a curvilinear grid, it is advised to use the commands POINTS or CURVE and SPECOUT instead of NGRID and NESTOUT.

NEST with this option the user indicates that the boundary conditions (all four sides  
  of the computational grid) are to be retrieved from a file created by a previous  
  SWAN run (the present SWAN run is a nested run). The spectral frequencies (and  
  directions in the case of a 2D spectrum) of the previous run do not have to  
  coincide with the frequencies and directions used in the present SWAN run (see  
  command CGRID); SWAN will interpolate the energy densities to these frequencies  
  and directions (see Section 2.6.3).  
'fname' name of the file containing the boundary conditions for the present run, created  
  by the previous SWAN coarse grid run. This file is structured according to the  
  rules given in Appendix D for 2D spectra.  
CLOSED the boundary represented in the file is a closed rectangle; this is always the  
  case if the NESTOUT command was used to generate the boundary condition file.  
OPEN the boundary represented in the file is not a closed rectangle.  


\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

                                            |-> CRAY |
                             | UNFormatted <          > |
                             |              | WKstat |  |
                             |                          |
BOUndnest2  WAMNest 'fname' <                            > [xgc] [ygc] [lwdate]
                             |                          |
                             | FREE                     |

\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

CANNOT BE USED IN CASE OF UNSTRUCTURED GRIDS.


With this optional command (not fully tested) a nested SWAN run can be carried out with the boundary conditions obtained from a coarse grid WAM run (WAM Cycle 4.5, source code as distributed by the Max Planck Institute in Hamburg). For this nested SWAN run the user has to give the CGRID command to define the computational grid before this BOUNDNEST2 command. The computational grid for SWAN in geographic space is the area bounded by the WAM coarse run nest (WAM boundary points of the nest). This implies that the boundaries of the WAM nest and the boundaries of the SWAN computational area should be (nearly) identical (see below). The spectral frequencies and directions of the coarse grid run do not have to coincide with the frequencies and directions used in the nested SWAN run (as defined in the CGRID command); SWAN will interpolate to these frequencies and directions in the nested run (see Section 2.6.3).


Note that SWAN will accept output of a WAM output location only if the SWAN grid point on the nest boundary lies within a rectangle between two consecutive WAM output locations with a width equal to 0.1 times the distance between these output locations on either side of the line between these WAM output locations.


This BOUNDNEST2 command is not available for 1D computations.


Only boundary conditions generated by WAM Cycle 4.5 can be read properly by SWAN.


A nested SWAN run may use either Cartesian or spherical coordinates. A curvilinear grid may be used in the nested grid but the boundaries of this nest should conform to the rectangular course grid nest boundaries.


WAM output files are unformatted (binary); this usually implies that WAM and SWAN have to run on the same computer. For those cases where WAM and SWAN run on different types of machines (binary files do not transfer properly), the option FREE is available in this command. The distributed version of WAM does not support the required free format nesting output; WAM users who modify WAM such that it can make formatted output, must modify WAM such that the files made by WAM can be read in free format, i.e. with at least a blank or comma between numbers.

'fname' a file name that contains all the names of WAM files containing the nested  
  boundary conditions in time-sequence (usually one file per day). For example,  
  the contents of 'fname' can look like:  
  CBO9212010000  
  CBO9212020000  
  CBO9212030000  
  ....  
  SWAN will read the boundary data from these WAM files one after the other.  
UNFORMATTED the user indicates that the WAM files are binary.  
CRAY input will be read from file created by the CRAY version of WAM.  
WKSTAT input will be read from file created by the WORKSTATION version of WAM.  
FREE the user indicates that the WAM files can be read with free format (these files  
  are not generated standard by WAM!).  
[xgc] if SWAN is used with Cartesian coordinates:  
  longitude of south-west corner of SWAN computational grid (in degrees); if the  
  south-west corner of the nest in the WAM computation is on land this value is  
  required.  
  If SWAN is used with spherical coordinates then [xgc] is ignored by SWAN.  
  Default: the location of the first spectrum encountered in the nest file.  
[ygc] if SWAN is used with Cartesian coordinates:  
  longitude of south-west corner of SWAN computational grid (in degrees); if the  
  south-west corner of the nest in the WAM computation is on land this value is  
  required.  
  If SWAN is used with spherical coordinates then [ygc] is ignored by SWAN.  
  Default: the location of the first spectrum encountered in the nest file.  
[lwdate] length of character string for date-time as used in the WAM files. Possible values  
  are: 10 (i.e. YYMMDDHHMM), 12 (i.e. YYMMDDHHMMSS) or 14 (i.e. YYYYMMDDHHMMSS).  
  Default: [lwdate] = 12  


\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

                         | UNFormatted |   | -> CLOS |
BOUndnest3  WW3 'fname' <               > <           > [xgc] [ygc]
                         | FREe        |   |    OPEN |

\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

CANNOT BE USED IN CASE OF UNSTRUCTURED GRIDS.


With this optional command a nested SWAN run can be carried out with the boundary conditions obtained from a coarse grid WAVEWATCH III run. For this nested SWAN run the user has to give the CGRID command to define the computational grid before this BOUNDNEST3 command. The computational grid for SWAN in geographic space is the area bounded by the WAVEWATCH III nest (WAVEWATCH III boundary points of the nest). This implies that the boundaries of the WAVEWATCH III nest and the boundaries of the SWAN computational area should be (nearly) identical (see below). The spectral frequencies and directions of the coarse grid run do not have to coincide with the frequencies and directions used in the nested SWAN run (as defined in the CGRID command); SWAN will interpolate to these frequencies and directions in the nested run (see Section 2.6.3).


The output files of WAVEWATCH III have to be created with the post-processor of WAVEWATCH III as output transfer files (formatted or unformatted) with

  WW_3 OUTP (output type 1 sub type 3)
at the locations along the nest boundary (i.e. computational grid points in WAVEWATCH III). These locations are equal to the corner points of the SWAN nested grid and optionally also distributed between the corner points of the SWAN nested grid (the boundary of the WAVEWATCH III nested grid need not be closed and may cover land). The locations should be output by WAVEWATCH III in sequence (going along the nest boundary, clockwise or counterclockwise). Note that SWAN will accept output of a WAVEWATCH III output location only if the SWAN grid point on the nest boundary lies within a rectangle between two consecutive WAVEWATCH III output locations with a width equal to 0.1 times the distance between these output locations on either side of the line between these WAVEWATCH III output locations.


This BOUNDNEST3 command is not available for 1D computations.


A nested SWAN run may use either Cartesian or spherical coordinates. A curvilinear grid may be used in the nested grid but the boundaries of this nest should conform to the rectangular course grid nest boundaries.

'fname' the name of the file that contains the spectra computed by WAVEWATCH III.  
UNFORMATTED the input WW3 files are binary.  
FREE the input WW3 files are formatted.  
CLOSED the boundary condition represented in the file is defined on a closed rectangle.  
OPEN the curve on which the boundary condition is given, is not closed.  
[xgc] if SWAN is used with Cartesian coordinates:  
  longitude of south-west corner of SWAN computational grid (in degrees); if the  
  south-west corner of the nest in the WW3 computation is on land this value is  
  required.  
  If SWAN is used with spherical coordinates then [xgc] is ignored by SWAN.  
  Default: the location of the first spectrum encountered in the nest file.  
[ygc] if SWAN is used with Cartesian coordinates:  
  longitude of south-west corner of SWAN computational grid (in degrees); if the  
  south-west corner of the nest in the WW3 computation is on land this value is  
  required.  
  If SWAN is used with spherical coordinates then [ygc] is ignored by SWAN.  
  Default: the location of the first spectrum encountered in the nest file.  

Note that [xgc] and [ygc] are ignored if SWAN is used with spherical coordinates; if SWAN is used with Cartesian coordinates the values must be provided by the user.


\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

          | -> DEFault
          |
          |  ZERO
          |
INITial  <   PAR  [hs] [per] [dir] [dd]
          |
          |            | -> MULTiple |             | -> FREE
          |  HOTStart <               >  'fname'  <
          |            |    SINGle   |             | UNFormatted

\begin{picture}(18,0.12)
\thicklines
\put(0,0){\line(1,0){17}}
\put(0,0.1){\line(1,0){17}}
\end{picture}

This command can be used to specify the initial values for a stationary (INITIAL HOTSTART only) or nonstationary computation. The initial values thus specified override the default initialization (see Section 2.6.3). Note that it is possible to obtain an initial state by carrying out a previous stationary or nonstationary computation.

DEFAULT the initial spectra are computed from the local wind velocities, using the  
  deep-water growth curve of Kahma and Calkoen (1992), cut off at values of  
  significant wave height and peak frequency from Pierson and Moskowitz (1964).  
  The average (over the model area) spatial step size is used as fetch with local  
  wind. The shape of the spectrum is default JONSWAP with a $\cos^2$-directional  
  distribution (options are available: see command BOUND SHAPE).  
ZERO the initial spectral densities are all 0; note that if waves are generated in the  
  model only by wind, waves can become non-zero only by the presence of the  
  "A" term in the growth model; see the keyword AGROW in command GEN3.  
PAR the spectra in the entire computational area are generated from integral  
  parameters [hs] etc. in the same way as done for the boundary using the  
  command BOUNDSPEC.  
[hs] the significant wave height.  
[per] characteristic wave period of the energy spectrum (either peak or mean period,  
  as determined by the options PEAK and MEAN in the command BOUND SHAPE).  
[dir] the peak wave direction (direction in degrees, Nautical or Cartesian convention,  
  see command SET).  
[dd] the coefficient of directional spreading; a $cos^m(\theta)$ distribution is assumed.  
  See the options DEGREES and POWER in the command BOUND SHAPE.  
HOTSTART initial wave field is read from file; this file was generated in a previous SWAN  
  run by means of the HOTFILE command. If the previous run was nonstationary,  
  the time found on the file will be assumed to be the initial time of computation. It  
  can also be used for stationary computation as first guess. The computational grid  
  (both in geographical space and in spectral space) must be identical to the one in  
  the run in which the initial wave field was computed.  
MULTIPLE input will be read from multiple hotfiles obtained from a previous parallel MPI run.  
  The number of files equals the number of processors. Hence, for the present run the  
  same number of processors must be chosen.  
SINGLE input will be read from a single (concatenated) hotfile.  
  In the case of a previous parallel MPI run, the concatenated hotfile can be created  
  from a set of multiple hotfiles using the program hcat.exe, see Implementation  
  Manual.  
  Note: with this option you may change the number of processors when restart a  
  parallel MPI run.  
  ONLY MEANT FOR STRUCTURED GRIDS.  
'fname' name of the file containing the initial wave field.  
FREE the user indicates that the hotfile can be read with free format.  
  This option is default.  
UNFORMATTED the user indicates that the hotfile is binary.  

The SWAN team 2024-03-19