Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Using FFTW in Fortran

sglidden
Beginner
509 Views
Hi,
I am currently working on changing the FFT routines in a Fortran code from an older set of routines (VecFFT) to FFTW. However, the code that I am using does not use the built-in complex storage format for the Fourier coefficients, but rather uses separate real arrays for the real and imaginary components. Is there a way to have FFTW handle this sort of input and if so, could someone show me a sample line of code for how to accomplish this?
Thanks!
Sam Glidden
0 Kudos
1 Reply
Intel_C_Intel
Employee
509 Views
Hello,
If I correctly understood can you have a look:
Code:
Subroutine RealsToComplex( N, ReArray, ImArray )
	integer, intent(in) :: N
	real, intent(in) :: ReArray(N), ImArray(N)

	complex ComplexArray(N)
		
	ComplexArray = Cmplx( ReArray, ImArray )
end subroutine RealsToComplex
	
Subroutine ComplexToReals( N, ComplexArray )
	integer, intent(in) :: N
	complex, intent(in) :: ComplexArray(N)

	real ReArray(N), ImArray(N)

	ReArray = Real( ComplexArray )
	ImArray = AImag( ComplexArray )
	! Or just Imag -- Intel's specific.
end subroutine ComplexToReals
I'm interesting what mean pretfix Vect and postfix W in subroutines names?
I hope it'll help.
0 Kudos
Reply