|
FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module with subroutines for sea wave evaluation. More...
Data Types | |
| interface | initfunc4 |
| Initializes parameters of a sea wave function. More... | |
Functions/Subroutines | |
| subroutine | initfunc4fromfile (FNAME, G, D, RFUNC, IERR, RSEED) |
| Initializes wave function parameters from the given file. More... | |
| subroutine | initspectrumof (IOP, H3, T1, Gamma, Omega0, dOmega, g, D, RFUNC, IERR, RSEED) |
| Initializes a wave function based on statistical parameters. More... | |
| subroutine | initspectrumdnv (Hs, Tp, Gamma, Omega0, dOmega, g, D, RFUNC, IERR, RSEED, NWdir, SprExp) |
| Initializes a wave function based on statistical parameters. More... | |
| real(dp) function, public | wavenumber (omega, g, d) |
| Calculates the wave number for finite depth waves. More... | |
| logical function, public | checkdepth (d, k) |
| Checks that the finite water depth does not cause cause overflow. More... | |
| subroutine, public | deepwave (RFUNC, g, x, z, t, atSurface, noWheelerStretching, h, u, w, du, dw, p) |
| Evaluates the deep water wave profile. More... | |
| subroutine, public | deepwaves (RFUNC, g, x, y, z, t, atSurface, noWheelerStretching, h, u, v, w, du, dv, dw, p) |
| Evaluates the deep water wave profile. More... | |
| subroutine, public | finitedepthwave (RFUNC, g, d, x, z, t, atSurface, noWheelerStretching, h, u, w, du, dw, p) |
| Evaluates the finite depth wave profile. More... | |
| subroutine, public | finitedepthwaves (RFUNC, g, d, x, y, z, t, atSurface, noWheelerStretching, h, u, v, w, du, dv, dw, p) |
| Evaluates the finite depth wave profile. More... | |
| subroutine, public | stokes2wave (RFUNC, g, d, x, z, t, atSurface, noWheelerStretching, h, u, w, du, dw) |
| Evaluates the wave profile according to 2nd order Stokes theory. More... | |
| subroutine, public | initfunc7 (H, T, eps, g, D, RFUNC, ierr) |
| Computes coefficients for 5th order Stokes waves. More... | |
| subroutine, public | stokes5wave (RFUNC, d, x, z, t, atSurface, h, u, w, du, dw) |
| Evaluates the wave profile according to 5th order Stokes theory. More... | |
| subroutine, public | initfunc8 (H, T, eps, g, D, RFUNC, iOrder) |
| Solves the streamline wave equation. More... | |
| subroutine, public | streamwave (RFUNC, d, x, z, t, atSurface, h, u, w, du, dw) |
| Evaluates the nonlinear wave profile according to streamline theory. More... | |
| subroutine, public | initfunc9 (IOP, NR, NC, H3, T1, Gamma, Omega0, dOmega, g, D, ramp, embSLW, IFUNC, RFUNC, IERR, RSEED) |
| Initializes an irregular wave function with embedded streamlines. More... | |
| subroutine, public | embeddedwave (IFUNC, RFUNC, g, d, x, z, t, atSurf, noWS, h, u, w, du, dw) |
| Evaluates a wave function with embedded nonlinear components. More... | |
| subroutine, public | userdefinedwave (ikf, IFUNC, RFUNC, g, d, Xt, atSurf, h, u, du, ierr) |
| Evaluates the user-defined wave profile. More... | |
Variables | |
| integer, parameter, public | dp = kind(1.0D0) |
| 8-byte real (double) More... | |
| real(dp), parameter | pi = 3.141592653589793238_dp |
| The value of π. More... | |
| real(dp), parameter, public | twopi = pi+pi |
| The value of 2π. More... | |
Module with subroutines for sea wave evaluation.
This module contains subroutines for initialization of real parameters for the explicit wave function (explicitfunctionsmodule::func4). It also has subroutines for evaluating the wave function at a given point in time and space. The FUNC4 interface of the explicitfunctionsmodule only yields the free surface level at a given time and x = 0, and infinite water depth, whereas the subroutines herein can be used for any value of x and finite depth. Subroutines returning the corresponding velocity and acceleration for any depth z ≤ 0 are provided as well.
| logical function, public wavefunctionsmodule::checkdepth | ( | real(dp), intent(in) | d, |
| real(dp), intent(in) | k | ||
| ) |
Checks that the finite water depth does not cause cause overflow.
| [in] | d | Water depth |
| [in] | k | The wave number |

| subroutine, public wavefunctionsmodule::deepwave | ( | real(dp), dimension(:,:), intent(in) | RFUNC, |
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | x, | ||
| real(dp), intent(in) | z, | ||
| real(dp), intent(in) | t, | ||
| logical, intent(in) | atSurface, | ||
| logical, intent(in) | noWheelerStretching, | ||
| real(dp), intent(out) | h, | ||
| real(dp), intent(out) | u, | ||
| real(dp), intent(out) | w, | ||
| real(dp), intent(out) | du, | ||
| real(dp), intent(out) | dw, | ||
| real(dp), intent(out), optional | p | ||
| ) |
Evaluates the deep water wave profile.
| [in] | RFUNC | Real wave data, output from wavefunctionsmodule::initfunc4 |
| [in] | g | Gravity constant |
| [in] | x | Current horizontal position |
| [in] | z | Current vertical position |
| [in] | t | Current time |
| [in] | atSurface | If .true., evaluate at water surface instead of z |
| [in] | noWheelerStretching | If .true., switch off Wheeler stretching |
| [out] | h | Current wave height (depends on x and t only) |
| [out] | u | Current particle velocity in local x direction |
| [out] | w | Current particle velocity in local z direction |
| [out] | du | Current particle acceleration in local x direction |
| [out] | dw | Current particle acceleration in local z direction |
| [out] | p | Current dynamic pressure |
This subroutine evaluates the wave profile height and associated particle velocity and acceleration at a given spatial point and time. Assuming deep water waves, i.e., 2*depth > largest wave length. z=0 represents the mean free surface level and z is positive upwards.
Reference:

| subroutine, public wavefunctionsmodule::deepwaves | ( | real(dp), dimension(:,:,:), intent(in) | RFUNC, |
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | x, | ||
| real(dp), intent(in) | y, | ||
| real(dp), intent(in) | z, | ||
| real(dp), intent(in) | t, | ||
| logical, intent(in) | atSurface, | ||
| logical, intent(in) | noWheelerStretching, | ||
| real(dp), intent(out) | h, | ||
| real(dp), intent(out) | u, | ||
| real(dp), intent(out) | v, | ||
| real(dp), intent(out) | w, | ||
| real(dp), intent(out) | du, | ||
| real(dp), intent(out) | dv, | ||
| real(dp), intent(out) | dw, | ||
| real(dp), intent(out), optional | p | ||
| ) |
Evaluates the deep water wave profile.
| [in] | RFUNC | Real wave data, output from wavefunctionsmodule::initfunc4 |
| [in] | g | Gravity constant |
| [in] | x | Current horizontal position |
| [in] | y | Current horizontal position normal to the x direction |
| [in] | z | Current vertical position |
| [in] | t | Current time |
| [in] | atSurface | If .true., evaluate at water surface instead of z |
| [in] | noWheelerStretching | If .true., switch off Wheeler stretching |
| [out] | h | Current wave height (depends on x, y and t only) |
| [out] | u | Current particle velocity in local x direction |
| [out] | v | Current particle velocity in local y direction |
| [out] | w | Current particle velocity in local z direction |
| [out] | du | Current particle acceleration in local x direction |
| [out] | dv | Current particle acceleration in local y direction |
| [out] | dw | Current particle acceleration in local z direction |
| [out] | p | Current dynamic pressure |
This subroutine evaluates the wave profile height and associated particle velocity and acceleration at a given spatial point and time. Assuming deep water waves, i.e., 2*depth > largest wave length. z=0 represents the mean free surface level and z is positive upwards. This subroutine also accounts for wave spreading through an outer loop.
Reference:

| subroutine, public wavefunctionsmodule::embeddedwave | ( | integer, dimension(:), intent(in) | IFUNC, |
| real(dp), dimension(:), intent(in) | RFUNC, | ||
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | d, | ||
| real(dp), intent(in) | x, | ||
| real(dp), intent(in) | z, | ||
| real(dp), intent(in) | t, | ||
| logical, intent(in) | atSurf, | ||
| logical, intent(in) | noWS, | ||
| real(dp), intent(out) | h, | ||
| real(dp), intent(out) | u, | ||
| real(dp), intent(out) | w, | ||
| real(dp), intent(out) | du, | ||
| real(dp), intent(out) | dw | ||
| ) |
Evaluates a wave function with embedded nonlinear components.
| [in] | IFUNC | Integer wave data from wavefunctionsmodule::initfunc9 |
| [in] | RFUNC | Real wave data, output from wavefunctionsmodule::initfunc9 |
| [in] | g | Gravity constant |
| [in] | d | Water depth |
| [in] | x | Current horizontal position |
| [in] | z | Current vertical position |
| [in] | t | Current time |
| [in] | atSurf | If .true., evaluate at water surface instead of z |
| [in] | noWS | If .true., switch off Wheeler stretching |
| [out] | h | Current wave height (depends on x and t only) |
| [out] | u | Current particle velocity in local x direction |
| [out] | w | Current particle velocity in local z direction |
| [out] | du | Current particle acceleration in local x direction |
| [out] | dw | Current particle acceleration in local z direction |
This subroutine evaluates the wave profile and the associated particle velocity and acceleration at a given spatial point and time. Assuming finite depth water waves, linear wave theory, with embedded nonlinear streamline waves at user-defined times.


| subroutine, public wavefunctionsmodule::finitedepthwave | ( | real(dp), dimension(:,:), intent(in) | RFUNC, |
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | d, | ||
| real(dp), intent(in) | x, | ||
| real(dp), intent(in) | z, | ||
| real(dp), intent(in) | t, | ||
| logical, intent(in) | atSurface, | ||
| logical, intent(in) | noWheelerStretching, | ||
| real(dp), intent(out) | h, | ||
| real(dp), intent(out) | u, | ||
| real(dp), intent(out) | w, | ||
| real(dp), intent(out) | du, | ||
| real(dp), intent(out) | dw, | ||
| real(dp), intent(out), optional | p | ||
| ) |
Evaluates the finite depth wave profile.
| [in] | RFUNC | Real wave data, output from wavefunctionsmodule::initfunc4 |
| [in] | g | Gravity constant |
| [in] | d | Water depth |
| [in] | x | Current horizontal position |
| [in] | z | Current vertical position, positive upwards (z= 0 means free surface level) |
| [in] | t | Current time |
| [in] | atSurface | If .true., evaluate at water surface instead of z |
| [in] | noWheelerStretching | If .true., switch off Wheeler stretching |
| [out] | h | Current wave height (depends on x and t only) |
| [out] | u | Current particle velocity in local x direction |
| [out] | w | Current particle velocity in local z direction |
| [out] | du | Current particle acceleration in local x direction |
| [out] | dw | Current particle acceleration in local z direction |
| [out] | p | Current dynamic pressure |
This subroutine evaluates the wave profile and the associated particle velocity and acceleration at a given spatial point and time. Assuming finite depth water waves and linear wave theory.
References:

| subroutine, public wavefunctionsmodule::finitedepthwaves | ( | real(dp), dimension(:,:,:), intent(in) | RFUNC, |
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | d, | ||
| real(dp), intent(in) | x, | ||
| real(dp), intent(in) | y, | ||
| real(dp), intent(in) | z, | ||
| real(dp), intent(in) | t, | ||
| logical, intent(in) | atSurface, | ||
| logical, intent(in) | noWheelerStretching, | ||
| real(dp), intent(out) | h, | ||
| real(dp), intent(out) | u, | ||
| real(dp), intent(out) | v, | ||
| real(dp), intent(out) | w, | ||
| real(dp), intent(out) | du, | ||
| real(dp), intent(out) | dv, | ||
| real(dp), intent(out) | dw, | ||
| real(dp), intent(out), optional | p | ||
| ) |
Evaluates the finite depth wave profile.
| [in] | RFUNC | Real wave data, output from wavefunctionsmodule::initfunc4 |
| [in] | g | Gravity constant |
| [in] | d | Water depth |
| [in] | x | Current horizontal position |
| [in] | y | Current horizontal position normal to the x direction |
| [in] | z | Current vertical position, positive upwards (z= 0 means free surface level) |
| [in] | t | Current time |
| [in] | atSurface | If .true., evaluate at water surface instead of z |
| [in] | noWheelerStretching | If .true., switch off Wheeler stretching |
| [out] | h | Current wave height (depends on x, y and t only) |
| [out] | u | Current particle velocity in local x direction |
| [out] | v | Current particle velocity in local y direction |
| [out] | w | Current particle velocity in local z direction |
| [out] | du | Current particle acceleration in local x direction |
| [out] | dv | Current particle acceleration in local y direction |
| [out] | dw | Current particle acceleration in local z direction |
| [out] | p | Current dynamic pressure |
This subroutine evaluates the wave profile and the associated particle velocity and acceleration at a given spatial point and time. Assuming finite depth water waves and linear wave theory. This subroutine also accounts for wave spreading through an outer loop.
References:

|
private |
Initializes wave function parameters from the given file.
| [in] | FNAME | Name of file to read wave parameters from. |
| [in] | G | Gravity constant |
| [in] | D | Sea depth for finite depth waves |
| [out] | RFUNC | Real function parameters |
| [out] | IERR | Error flag |
| [in] | RSEED | Seed for random value generator |
The file may consist of either two, three or four columns of data. The number of columns may be specified on the first line as #ncol <ncol>. If the first line does not contain the keyword #ncol, a two-column file is assumed. The phase shift is then generated randomly. The wave number is calculated internally unless specified in the fourth column.
| subroutine, public wavefunctionsmodule::initfunc7 | ( | real(dp), intent(in) | H, |
| real(dp), intent(in) | T, | ||
| real(dp), intent(in) | eps, | ||
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | D, | ||
| real(dp), dimension(*), intent(out) | RFUNC, | ||
| integer, intent(out) | ierr | ||
| ) |
Computes coefficients for 5th order Stokes waves.
| [in] | H | Wave height |
| [in] | T | Wave period |
| [in] | eps | Phase shift |
| [in] | g | Gravity constant |
| [in] | D | Water depth |
| [out] | RFUNC | Real function parameters |
| [out] | ierr | Error flag |
The subroutine stokes5 is from the code that was downloaded from the following web-page: http://www.civil.soton.ac.uk/hydraulics/download/downloadtable.htm This web-page no longer exists (January 2015).

| subroutine, public wavefunctionsmodule::initfunc8 | ( | real(dp), intent(in) | H, |
| real(dp), intent(in) | T, | ||
| real(dp), intent(in) | eps, | ||
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | D, | ||
| real(dp), dimension(*), intent(out) | RFUNC, | ||
| integer, intent(out) | iOrder | ||
| ) |
Solves the streamline wave equation.
| [in] | H | Wave height |
| [in] | T | Wave period |
| [in] | eps | Phase shift |
| [in] | g | Gravity constant |
| [in] | D | Water depth |
| [out] | RFUNC | Real function parameters |
| [out] | iOrder | Wave theory order (negative on error) |
The subroutine cw260 is (a slightly modified version of) the code that was downloaded from this web-page: http://www.civil.soton.ac.uk/hydraulics/download/downloadtable.htm Note: This web-page no longer exists (January 2015).

| subroutine, public wavefunctionsmodule::initfunc9 | ( | integer, intent(in) | IOP, |
| integer, intent(in) | NR, | ||
| integer, intent(in) | NC, | ||
| real(dp), intent(in) | H3, | ||
| real(dp), intent(in) | T1, | ||
| real(dp), intent(in) | Gamma, | ||
| real(dp), intent(in) | Omega0, | ||
| real(dp), intent(in) | dOmega, | ||
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | D, | ||
| real(dp), dimension(2), intent(in) | ramp, | ||
| real(dp), dimension(:,:), intent(in) | embSLW, | ||
| integer, dimension(:), intent(out) | IFUNC, | ||
| real(dp), dimension(:), intent(out) | RFUNC, | ||
| integer, intent(out) | IERR, | ||
| integer, intent(in), optional | RSEED | ||
| ) |
Initializes an irregular wave function with embedded streamlines.
| [in] | IOP | Wave spectrum model:
|
| [in] | NR | Number of data per irregular wave component |
| [in] | NC | Number of irregular wave components |
| [in] | H3 | Significant wave height (mean of the one third highest waves) |
| [in] | T1 | Mean wave period |
| [in] | Gamma | Spectral peakedness |
| [in] | Omega0 | Lowest frequency in wave spectrum |
| [in] | dOmega | Frequency increment between successive wave components |
| [in] | g | Gravity constant |
| [in] | D | Sea depth for finite depth waves |
| [in] | ramp | Ramping parameters |
| [in] | embSLW | Streanline data |
| [out] | IFUNC | Integer function parameters |
| [out] | RFUNC | Real function parameters |
| [out] | IERR | Error flag |
| [in] | RSEED | Seed for random value generator |
This subroutine generates and irregular wave function based on statistical parameters (by using wavefunctionsmodule::initfunc4), with embedded streamline wave components at specified time locations.


| subroutine wavefunctionsmodule::initspectrumdnv | ( | real(dp), intent(in) | Hs, |
| real(dp), intent(in) | Tp, | ||
| real(dp), intent(in) | Gamma, | ||
| real(dp), intent(in) | Omega0, | ||
| real(dp), intent(in) | dOmega, | ||
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | D, | ||
| real(dp), dimension(:,:), intent(out) | RFUNC, | ||
| integer, intent(out) | IERR, | ||
| integer, intent(in), optional | RSEED, | ||
| integer, intent(in), optional | NWdir, | ||
| integer, intent(in), optional | SprExp | ||
| ) |
Initializes a wave function based on statistical parameters.
| [in] | Hs | Significant wave height (mean of the one third highest waves) |
| [in] | Tp | The wave period corresponding to the peak frequency |
| [in] | Gamma | Spectral peakedness (see below). |
| [in] | Omega0 | Lowest frequency in wave spectrum (if ≤ 0 use constant frequency intervals) |
| [in] | dOmega | Frequency increment between successive wave components |
| [in] | g | Gravity constant |
| [in] | D | Sea depth for finite depth waves |
| [out] | RFUNC | Real function parameters |
| [out] | IERR | Error flag |
| [in] | RSEED | Seed for random value generator |
| [in] | NWdir | Number of wave directions |
| [in] | SprExp | Wave spreading exponent (for Ndir > 1) |
This subroutine generates the wave function parameters from a wave spectrum. If Gamma ≤ 1, a Pierson-Moskowitz spectrum is used, otherwise a JONSWAP spectrum depending on Gamma is used.
References:
| subroutine wavefunctionsmodule::initspectrumof | ( | integer, intent(in) | IOP, |
| real(dp), intent(in) | H3, | ||
| real(dp), intent(in) | T1, | ||
| real(dp), intent(in) | Gamma, | ||
| real(dp), intent(in) | Omega0, | ||
| real(dp), intent(in) | dOmega, | ||
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | D, | ||
| real(dp), dimension(:,:), intent(out) | RFUNC, | ||
| integer, intent(out) | IERR, | ||
| integer, intent(in), optional | RSEED | ||
| ) |
Initializes a wave function based on statistical parameters.
| [in] | IOP | Wave spectrum model:
|
| [in] | H3 | Significant wave height (mean of the one third highest waves) |
| [in] | T1 | Mean wave period |
| [in] | Gamma | Spectral peakedness |
| [in] | Omega0 | Lowest frequency in wave spectrum |
| [in] | dOmega | Frequency increment between successive wave components |
| [in] | g | Gravity constant |
| [in] | D | Sea depth for finite depth waves |
| [out] | RFUNC | Real function parameters |
| [out] | IERR | Error flag |
| [in] | RSEED | Seed for random value generator |
This subroutine generates the wave function parameters from a wave spectrum depending on the input argument IOP (see above).
References:
| subroutine, public wavefunctionsmodule::stokes2wave | ( | real(dp), dimension(:,:), intent(in) | RFUNC, |
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | d, | ||
| real(dp), intent(in) | x, | ||
| real(dp), intent(in) | z, | ||
| real(dp), intent(in) | t, | ||
| logical, intent(in) | atSurface, | ||
| logical, intent(in) | noWheelerStretching, | ||
| real(dp), intent(out) | h, | ||
| real(dp), intent(out) | u, | ||
| real(dp), intent(out) | w, | ||
| real(dp), intent(out) | du, | ||
| real(dp), intent(out) | dw | ||
| ) |
Evaluates the wave profile according to 2nd order Stokes theory.
| [in] | RFUNC | Real wave data, output from wavefunctionsmodule::initfunc4 |
| [in] | g | Gravity constant |
| [in] | d | Water depth |
| [in] | x | Current horizontal position |
| [in] | z | Current vertical position, positive upwards (z= 0 means free surface level) |
| [in] | t | Current time |
| [in] | atSurface | If .true., evaluate at water surface instead of z |
| [in] | noWheelerStretching | If .true., switch off Wheeler stretching |
| [out] | h | Current wave height (depends on x, y and t only) |
| [out] | u | Current particle velocity in local x direction |
| [out] | w | Current particle velocity in local z direction |
| [out] | du | Current particle acceleration in local x direction |
| [out] | dw | Current particle acceleration in local z direction |
References:

| subroutine, public wavefunctionsmodule::stokes5wave | ( | real(dp), dimension(:), intent(in) | RFUNC, |
| real(dp), intent(in) | d, | ||
| real(dp), intent(in) | x, | ||
| real(dp), intent(in) | z, | ||
| real(dp), intent(in) | t, | ||
| logical, intent(in) | atSurface, | ||
| real(dp), intent(out) | h, | ||
| real(dp), intent(out) | u, | ||
| real(dp), intent(out) | w, | ||
| real(dp), intent(out) | du, | ||
| real(dp), intent(out) | dw | ||
| ) |
Evaluates the wave profile according to 5th order Stokes theory.
| [in] | RFUNC | Real wave data, output from wavefunctionsmodule::initfunc7 |
| [in] | d | Water depth |
| [in] | x | Current horizontal position |
| [in] | z | Current vertical position, positive upwards (z= 0 means free surface level) |
| [in] | t | Current time |
| [in] | atSurface | If .true., evaluate at water surface instead of z |
| [out] | h | Current wave height (depends on x and t only) |
| [out] | u | Current particle velocity in local x direction |
| [out] | w | Current particle velocity in local z direction |
| [out] | du | Current particle acceleration in local x direction |
| [out] | dw | Current particle acceleration in local z direction |
Based on code from j.r.chaplin@soton.ac.uk See http://www.civil.soton.ac.uk/hydraulics/download/downloadtable.htm Note: This web-page no longer exists (January 2015).

| subroutine, public wavefunctionsmodule::streamwave | ( | real(dp), dimension(:), intent(in) | RFUNC, |
| real(dp), intent(in) | d, | ||
| real(dp), intent(in) | x, | ||
| real(dp), intent(in) | z, | ||
| real(dp), intent(in) | t, | ||
| logical, intent(in) | atSurface, | ||
| real(dp), intent(out) | h, | ||
| real(dp), intent(out) | u, | ||
| real(dp), intent(out) | w, | ||
| real(dp), intent(out) | du, | ||
| real(dp), intent(out) | dw | ||
| ) |
Evaluates the nonlinear wave profile according to streamline theory.
| [in] | RFUNC | Real wave data, output from wavefunctionsmodule::initfunc8 |
| [in] | d | Water depth |
| [in] | x | Current horizontal position |
| [in] | z | Current vertical position, positive upwards (z= 0 means free surface level) |
| [in] | t | Current time |
| [in] | atSurface | If .true., evaluate at water surface instead of z |
| [out] | h | Current wave height (depends on x, y and t only) |
| [out] | u | Current particle velocity in local x direction |
| [out] | w | Current particle velocity in local z direction |
| [out] | du | Current particle acceleration in local x direction |
| [out] | dw | Current particle acceleration in local z direction |
This subroutine evaluates the wave profile and the associated particle velocity and acceleration at a given spatial point and time. Assuming nonlinear streamline wave theory.
Based on code from j.r.chaplin@soton.ac.uk See http://www.civil.soton.ac.uk/hydraulics/download/downloadtable.htm Note: This web-page no longer exists (January 2015).

| subroutine, public wavefunctionsmodule::userdefinedwave | ( | integer, intent(in) | ikf, |
| integer, dimension(3), intent(in) | IFUNC, | ||
| real(dp), dimension(:), intent(in) | RFUNC, | ||
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | d, | ||
| real(dp), dimension(4), intent(in) | Xt, | ||
| logical, intent(in) | atSurf, | ||
| real(dp), intent(out) | h, | ||
| real(dp), dimension(3), intent(out) | u, | ||
| real(dp), dimension(3), intent(out) | du, | ||
| integer, intent(out) | ierr | ||
| ) |
Evaluates the user-defined wave profile.
| [in] | IKF | Function identifier |
| [in] | IFUNC | Integer wave data |
| [in] | RFUNC | Real wave data |
| [in] | g | Gravity constant |
| [in] | d | Water depth |
| [in] | Xt | Current position and time |
| [in] | atSurf | If .true., evaluate at water surface instead of z |
| [out] | h | Current wave height (depends on x and t only) |
| [out] | u | Current particle velocity |
| [out] | du | Current particle acceleration |
| [out] | ierr | Error flag |
This subroutine evaluates the wave height and associated particle velocity and acceleration at a given spatial point and time, by invoking a user-defined function from a separate plugin.

| real(dp) function, public wavefunctionsmodule::wavenumber | ( | real(dp), intent(in) | omega, |
| real(dp), intent(in) | g, | ||
| real(dp), intent(in) | d | ||
| ) |
Calculates the wave number for finite depth waves.
| [in] | omega | Angular frequency |
| [in] | g | Gravity constant |
| [in] | d | Water depth |
The wave number is calculated by solving a nonlinear equation by Newton-Raphson iterations. If the water depth is zero, infinite depth is assumed and the wave number is calculated explcitly.

| integer, parameter, public wavefunctionsmodule::dp = kind(1.0D0) |
8-byte real (double)
|
private |
The value of π.