integer function fft_rcfft3d(scale, n1, n2, n3, ld1, ld2, data, iopt)
The parameter, "scale", specifies the scale factor to be applied to the data.
The size parameters, "n1", "n2" and "n3", specify the FFT sizes. These must be setup as mixed radix values (must be even) in order to allow the FFT's to be more efficient. It is recommended to use fft_nrfft5 to calculate these values.
The leading dimension parameters, "ld1" and "ld2", specify the leading dimensions of the complex array in number of real values. They must be at least "n1" + 2 and "n2", respectively.
The real array, "data", is the I/O array for the FFT's. This is performed "in place". The output complex data is packed into "n1"+2 real array locations in a typical half-complex format.
The parameter, "iopt", is used to specify any other information that is unique to a specific FFT implementation. Currently, the use is for specifying whether to measure or estimate the FFT's when using FFTW routines. The "fft.h" header defines FFT_MEASURE and FFT_ESTIMATE, besides defining the FFT functions, as integer.
integer :: fft_size1, complex_vals, fft_size2, fft_size3, fft_flag integer :: ier real :: fft_scale real, allocatable :: data(:,:,:) complex :: cdata pointer(ptr_cdata, cdata) fft_size1 = fft_nrfft5(100) complex_vals = fft_size/2+1 fft_size2 = fft_nrfft5(50) fft_size3 = fft_nrfft5(200) ! allocate real data, but have complex data point to same location allocate(data(2*complex_vals, fft_size2, fft_size3)) ptr_cdata = loc(data(1,1)) ... fft_flag = FFT_ESTIMATE ! forward FFT fft_scale = 1.0D+00/(dble(fft_size1)*dble(fft_size2)*dble(fft_size3)) ier = fft_rcfft3d(fft_scale, fft_size1, fft_size2, fft_size3, 2*complex_vals, fft_size2, data, fft_flag) ! can now access complex data as cdata(complex_vals, fft_size2, fft_size3) ! inverse FFT fft_scale = 1.0 ier = fft_crfft3d(fft_scale, fft_size1, fft_size2, fft_size3, 2*complex_vals, fft_size2, data, fft_flag)