Returns the wavenumber spectrum array of the spectrum instance.
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 wavenumberSpectrum(self) result(spec)
!! Returns the wavenumber spectrum array of the spectrum instance.
class(spectrum_type),intent(in) :: self !! Spectrum instance
real(kind=rk),dimension(:,:),allocatable :: spec !! Spectrum array
integer :: nfreq,nfreqs
integer :: ndirs
nfreqs = size(self % f)
ndirs = size(self % th)
allocate(spec(nfreqs,ndirs))
do concurrent(nfreq = 1:nfreqs)
spec(nfreq,:) = self % spec(nfreq,:) * self % cg(nfreq) / twopi
enddo
endfunction wavenumberSpectrum