Computes the Discrete Fourier Transform (2DFT) of a rank-3 complex array.
No required arguments; pairs of optional arguments are required. These pairs are forward_in and forward_out or inverse_in and inverse_out.
forward_in =
x (Input)
Stores the input complex array of rank-3 to be
transformed.
forward_out =
y (Output)
Stores the output complex array of rank-3
resulting from the transform.
inverse_in =
y (Input)
Stores the input complex array of rank-3 to be
inverted.
inverse_out =
x (Output)
Stores the output complex array of rank-3
resulting from the inverse transform.
mdata = m
(Input)
Uses the sub-array in first dimension of size m for the numbers.
Default value: m
= size(x,1).
ndata = n
(Input)
Uses the sub-array in the second dimension of size n for the
numbers.
Default value: n = size(x,2).
kdata = k
(Input)
Uses the sub-array in the third dimension of size k for the
numbers.
Default value: k = size(x,3).
ido = ido
(Input/Output)
Integer flag that directs user action. Normally, this argument
is used only when the working variables required for the transform and its
inverse are saved in the calling program unit. Computing the working variables
and saving them in internal arrays within fast_3dft is the default. This
initialization step is expensive.
There is a two-step process to compute the working
variables just once. The general algorithm for this usage is to enter fast_3dft with
ido = 0. A return occurs
thereafter with
ido < 0. The optional rank-1
complex array w(:) with size(w) >= -ido
must be re-allocated. Then, re-enter
fast_3dft. The next return from fast_3dft has the output value ido = 1.
The variables required for the transform and its inverse are saved in w(:).
Thereafter, when the routine is entered with ido = 1 and for the same values of
m and n, the contents of w(:) will be used for the working variables. The
expensive initialization step is avoided. The optional arguments “ido=” and “work_array=” must be used together.
work_array =
w(:) (Output/Input)
Complex array of rank-1 used to store
working variables and values between calls to fast_3dft. The value for size(w) must be at least as
large as the value
- ido for the value of ido < 0.
iopt =
iopt(:) (Input/Output)
Derived type array with the same
precision as the input array; used for passing optional data to fast_3dft. The options are as
follows:
iopt(IO) =
?_options(?_fast_3dft_scan_for_NaN, ?_dummy)
Examines each input array
entry to find the first value such that
isNaN(x(i,j,k)) ==.true.
See the isNaN() function,
Chapter 10.
Default: Does not scan for NaNs.
iopt(IO) =
?_options(?_fast_3dft_near_power_of_2, ?_dummy)
Nearest powers of 2 ≥
m, ≥ n, and ≥ k are returned as an outputs in iopt(IO+1)%idummy , iopt(IO+2)%idummy and
iopt(IO+3)%idummy
iopt(IO) = ?_options(?_fast_3dft_scale_forward, real_part_of_scale)
iopt(IO+1) =
?_options(?_dummy, imaginary_part_of_scale)
Complex number defined by
the factor
cmplx(real_part_of_scale,
imaginary_part_of_scale) is
multiplied by the forward transformed
array.
Default value is 1.
iopt(IO) = ?_options(?_fast_3dft_scale_inverse, real_part_of_scale)
iopt(IO+1) =
?_options(?_dummy, imaginary_part_of_scale)
Complex number defined by
the factor
cmplx(real_part_of_scale,
imaginary_part_of_scale) is
multiplied by the inverse transformed
array.
Default value is 1.
Specific: The specific interface names are S_FAST_3DFT, D_FAST_3DFT, C_FAST_3DFT, and Z_FAST_3DFT.
The fast_3dft routine is a Fortran 90 version of the FFT suite of IMSL (1994, pp. 772-776).
See the messages.gls file for error messages for FAST_3DFT. These error messages are numbered 685-695; 740-750.
An array of random complex numbers is obtained. The transform of the numbers is inverted and the final results are compared with the input array.
! This is Example 1 for FAST_3DFT.
real(kind(1e0)), parameter :: one=1e0, zero=0e0
complex(kind(1e0)) a(n,n,n), b(n,n,n), c(n,n,n)
! Fill in value one for points inside the sphere
r(i,j,k) = (i-n/2)**2+(j-n/2)**2+(k-n/2)**2
! Transform the image and then invert it back.
call c_fast_3dft(forward_in=a, &
call c_fast_3dft(inverse_in=b, &
! Check that inverse(transform(image)) = image.
err = maxval(abs(c-a))/maxval(abs(c))
if (err <= sqrt(epsilon(one))) then
write (*,*) 'Example 1 for FAST_3DFT is correct.'
Example 1 for FAST_3DFT is correct.
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |