Returns the amplitude array.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(spectrum_type), | intent(in) | :: | self | Spectrum instance |
Amplitude [m]
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 getAmplitude(self) result(a)
!! Returns the amplitude array.
class(spectrum_type),intent(in) :: self !! Spectrum instance
real(kind=rk),dimension(:,:),allocatable :: a !! Amplitude [m]
integer :: ndir,ndirs
if(self % isMonochromatic())then
a = sqrt(2*self % spec)
else
ndirs = size(self % getDirections())
do concurrent(ndir = 1:ndirs)
a(:,ndir) = sqrt(2*self % spec(:,ndir)*self % df)
enddo
endif
endfunction getAmplitude