Returns the omnidirectional spectrum that corresponds to the input directional spectrum, integrated over all directions.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(spectrum_type), | intent(in) | :: | self | Spectrum instance |
Spectrum array
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.
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 omnidirectionalSpectrum(self) result(spec)
!! Returns the omnidirectional spectrum that corresponds to the input
!! directional spectrum, integrated over all directions.
class(spectrum_type),intent(in) :: self !! Spectrum instance
real(kind=rk),dimension(:),allocatable :: spec !! Spectrum array
integer(kind=ik) :: ndir,ndirs,nfreqs
nfreqs = size(self % spec,dim=1)
ndirs = size(self % spec,dim=2)
allocate(spec(nfreqs))
spec = 0
do ndir = 1,ndirs
spec(:) = spec(:)+self % spec(:,ndir)*self % dth(ndir)
enddo
endfunction omnidirectionalSpectrum