Test FFT to verify operation
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.
subroutine testFFT
!! Test FFT to verify operation
logical,dimension(1)::results
integer,parameter::N = 10000
real(wp),parameter::D = 5.0_wp
real(wp),dimension(N)::t,s,f,A
integer::k,kP
forall(k=1:N) t(k) = D*(real(k-1,wp)/real(N-1,wp))
s = cos( (2.0_wp*PI)*t )
f = FFT_freq(t)
A = FFT(s)
kP = maxloc(A(:N/2),1)
results(1) = abs(f(kP)-1.0_wp)<1.0E-3_wp
if( .not.all(results) ) error stop "Failed FFT check"
end subroutine testFFT