Returns the wavenumber [rad/m] array of the spectrum instance, reshaped to match the spectrum array shape. This method is most useful for conforming shape array in 2-d spectrum computations.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(spectrum_type), | intent(in) | :: | self | Spectrum instance |
Wavenumber [rad/m]
pure function getWavenumber2d(self) result(k)
!! Returns the wavenumber [rad/m] array of the spectrum instance, reshaped to
!! match the spectrum array shape. This method is most useful for conforming
!! shape array in 2-d spectrum computations.
class(spectrum_type),intent(in) :: self !! Spectrum instance
real(kind=rk),dimension(:,:),allocatable :: k !! Wavenumber [rad/m]
integer :: ndirs,nfreqs
integer :: ndir
nfreqs = size(self % f)
ndirs = size(self % th)
allocate(k(nfreqs,ndirs))
do concurrent(ndir = 1:ndirs)
k(:,ndir) = self % k
enddo
endfunction getWavenumber2d