Returns the directions [rad] 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 |
Directions [rad]
pure function getDirections2d(self) result(th)
!! Returns the directions [rad] 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 :: th !! Directions [rad]
integer :: ndirs,nfreqs
integer :: nfreq
nfreqs = size(self % f)
ndirs = size(self % th)
allocate(th(nfreqs,ndirs))
do concurrent(nfreq = 1:nfreqs)
th(nfreq,:) = self % th
enddo
endfunction getDirections2d