Exact solution of Stokes drift based on linear wave theory, given input
omnidirectional spectrum and distance from surface z
[m], negative
downward.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(spectrum_type), | intent(in) | :: | self | Spectrum instance |
||
real(kind=rk), | intent(in), | dimension(:) | :: | z | Distance from surface [m], negative downward |
Stokes drift array [m/s]
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module.
pure function stokesDrift(self,z)
!! Exact solution of Stokes drift based on linear wave theory, given input
!! omnidirectional spectrum and distance from surface `z` [m], negative
!! downward.
class(spectrum_type),intent(in) :: self
!! Spectrum instance
real(kind=rk),dimension(:),intent(in) :: z
!! Distance from surface [m], negative downward
real(kind=rk),dimension(:),allocatable :: stokesDrift
!! Stokes drift array [m/s]
integer(kind=ik) :: n
allocate(stokesDrift(size(z)))
do concurrent(n = 1:size(z))
stokesDrift(n) = sum(self % omnidirectionalSpectrum()*self % k&
*exp(2*self % k*z(n))*self % df)
enddo
endfunction stokesDrift