Nesting with SWAN

The simple procedure

With SWAN the most frequently used procedure is to generate the boundary condition for the nested region using the combination NGRID and NESTOUT in the large area computation. This option can be used only if the nested computation is on a regular grid; the large area computation can be on a regular grid, but also on a curvilinear grid or an unstructured grid.
The boundary condition that is generated has the same format as other spectral output files written by SWAN using the SPECOUT command. Such a file contains the spectral energy densities and also the time (in nonstationary computations), locations and values of frequency and direction for which the energy densities are valid.
The boundary condition file can be used in the nested computation with command BOUNDNEST1. With this command SWAN looks into the file to find out the locations where the boundary condition has to be applied. Therefore this procedure can be used only if the large and the small area computation use the same coordinate system, i.e. both on spherical coordinates, or both on Cartesian coordinates with the same origin.

Other cases

Nesting is possible in other circumstances as well, e.g. when the nested computation is on a curvilinear grid, or if the large area is on spherical coordinates and the nested area on Cartesian coordinates. We make use of the fact that the format of the nesting boundary condition is the same as the format of spectral files in general.
The procedure is then as follows: select the points of the nested grid for which we need boundary conditions. We translate the coordinates of these points into the coordinate system of the large area (if the two coordinate systems are different). In the large area computation we add a command POINTS giving these coordinates and we add a command SPECOUT to generate the spectral output file.
If the two computations are done on the same coordinate system, the nested computation can read the b.c. using BOUNDNEST1.
If the two computations are done on different coordinate systems BOUNDNEST1 can be used if we modify the spectral file, i.e. we replace the coordinates of the large area by coordinates of the small area. The coordinates can be found by looking for the keyword LOCATIONS (Cartesian coordinates) or LONLAT (spherical coordinates); the number of points and the coordinates of these points follow after this keyword. If the large area is on spherical coordinates and the small area on Cartesian cooridnates the keyword LONLAT has to be replaced by LOCATIONS.
It is also possible to use the spectral file without modification. Then one should use command BOUNDARY SPEC with the proper SIDE or SEGMENT definition. The first point of the SIDE or SEGMENT must correspond to the first point in the spectral file and the last point with the last point in the spectral file. Intermediate points are characterized by the parameter [len] in the command. If necessary this length can be determined by using a TABLE command for the same point set showing the output quantity DISTANCE.

Nesting 1-D in 2-D

On a long-stretched coast it is possible to make a 1-dimensional computation along a line perpendicular to the coast. The seaward boundary condition can be obtained from a 2-dimensional computation covering a larger area. The seaward boundary point of the line has to be entered in a POINT command in the 2-D computation. In addition there should be a SPECOUT command in this computation.
In the nested computation the boundary condition is entered by means of a BOUNDARY SPEC SIDE .. command. Here the proper side should be mentioned.

Nesting stationary in nonstationary

The large area is often so large that a nonstationary computation has to be made. In the same way as before the nesting can be done to a nonstationary computation in the nested area. In the control file for the large are the part OUTPUT ... has to be added to the command NESTOUT, determining the times at which the nesting output has to be written. The time interval between outputs can be chosen equal to the computational time step, or larger. This interval should be small enough to represent relevant features.
Since the nested area is smaller, often the computational time step is also smaller than in the large area. SWAN will take care of the necessary interpolations.
Often the nested area is so much smaller that here a stationary computation is effective. Nesting is possible also in this case. In the control file the command MODE NONSTAT must be present; this is necessary because with MODE STATIONARY Swan cannot handle the time information in the nesting file. Then use the command COMPUTE STAT [time] to make a stationary computation for a certain point in time. The command COMPUTE STAT can be used a number of times in one Swan run.

go to top

© 2012: Nico Booij