Previous: ZFFT3DY, Up: 3D FFT


CFFT3DY Routine Documentation
— SUBROUTINE: CFFT3DY (MODE,SCALE,INPL,L,M,N,X,
INCX1,INCX2,INCX3,Y,INCY1,INCY2,INCY3,COMM,LCOMM,INFO
)
— Input: INTEGER MODE

The value of MODE on input determines the operation performed by CFFT3DY.
On input:

  • MODE=0 : only initializations (specific to the values of L, M and N) are performed using a default plan; this is usually followed by calls to the same routine with MODE=-1 or 1.
  • MODE=-1 : a forward 3D transform is performed. Initializations are assumed to have been performed by a prior call to CFFT3DY.
  • MODE=1 : a backward (reverse) 3D transform is performed. Initializations are assumed to have been performed by a prior call to CFFT3DY.
  • MODE=-2 : (default) initializations and a forward 3D transform are performed.
  • MODE=2 : (default) initializations and a backward 3D transform are performed.
  • MODE=100 : similar to MODE=0; only initializations (specific to the values of L, M and M) are performed, but these are based on a plan that is first generated by timing a subset of all possible plans and choosing the quickest (i.e. the FFT computation was timed as fastest based on the chosen plan). The plan generation phase may take a significant amount of time depending on the values of L, M and N.

— Input: REAL SCALE

On input: SCALE is the scaling factor to apply to the output sequences

— Input: LOGICAL INPL

On input: if INPL is .TRUE. then X is overwritten by the output sequences; otherwise the output sequences are returned in Y.

— Input: INTEGER L

On input: L is the first dimension of the 3D transform.

— Input: INTEGER M

On input: M is the second dimension of the 3D transform.

— Input: INTEGER N

On input: N is the third dimension of the 3D transform.

— Input/Output: COMPLEX X(*)

On input: X contains the L by M by N complex 3D data array to be transformed; the (ijk)th element is stored in X(1+(i-1)*INCX1+(j-1)*INCX2+(k-1)*INCX3).
On output: if INPL is .TRUE. then X contains the transformed data in the same locations as on input. If INPL is .FALSE. X remains unchanged.

— Input: INTEGER INCX1

On input: INCX1 is the step in index of X between successive data elements in the first dimension of the 3D data. Usually INCX1=1 so that succesive elements in the first dimension are stored contiguously.
Constraint: INCX1 > 0.

— Input: INTEGER INCX2

On input: INCX2 is the step in index of X between successive data elements in the second dimension of the 3D data. For completely contiguous data (no gaps in X) INCX2 should be set to L.
Constraint: INCX2 > 0;
INCX2 > (L-1)*INCX1 if max(M,N) > 1.

— Input: INTEGER INCX3

On input: INCX3 is the step in index of X between successive data elements in the third dimension of the 3D data. For completely contiguous data (no gaps in X) INCX3 should be set to L*M.
Constraint: INCX3 > 0;
INCX3 > (L-1)*INCX1+(M-1)*INCX2 if N > 1.

— Output: COMPLEX Y(*)

On output: if INPL is .FALSE. then Y contains the three-dimensional transformed data. If LTRANS=.TRUE. then the the (ijk)th element is stored in Y(1+(i-1)*INCY1+(j-1)*INCY2+(k-1)*INCY3).
If INPL is .TRUE. then Y is not referenced.

— Input: INTEGER INCY1

On input: if INPL is .FALSE. then INCY1 is the step in index of Y between successive data elements in the first dimension of the 3D transformed data. Usually INCY1=1 so that succesive elements in the first dimension are stored contiguously.
If INPL is .TRUE. then INCY1 is not referenced. Constraint: If INPL is .FALSE. then INCY1 > 0.

— Input: INTEGER INCY2

On input: if INPL is .FALSE. then INCY2 is the step in index of Y between successive data elements in the second dimension of the 3D transformed data. For completely contiguous data (no gaps in Y) INCY2 should be set to L.
Constraint: INCY2 > 0 if INPL is .FALSE.;
INCY2 > (L-1)*INCY1, if INPL is .FALSE. and max(M,N) > 1.

— Input: INTEGER INCY3

On input: if INPL is .FALSE. then INCY3 is the step in index of Y between successive data elements in the third dimension of the 3D transformed data. For completely contiguous data (no gaps in Y) INCY3 should be set to L*M.
Constraint: INCY3 > 0 if INPL is .FALSE.;
INCY3 > (L-1)*INCY1+(M-1)*INCY2, if INPL is .FALSE. and N > 1.

— Input/Output: COMPLEX COMM(LCOMM)

COMM is a communication array. Some portions of the array are used to store initializations for subsequent calls with the same sequence dimensions. The remainder is used as temporary store; if this is not sufficient for the requirements of the routine then temporary storage space will be dynamically allocated internally.

— Input: INTEGER LCOMM

On input: LCOMM is the length of the communication array COMM. The amount of internal dynamic allocation of temporary storage can be reduced significantly by declaring COMM to be of length at least L*M*N + 4*(L+M+N) + 300..
Constraint: LCOMM > L*M*N + 2*(L+M+N) + 300.

— Output: INTEGER INFO

On output: INFO is an error indicator. On successful exit, INFO contains 0. If INFO = -i on exit, the i-th argument had an illegal value.

Example:

     C     Forward 3D FFT is performed unscaled and in-place, on the leading
     C     10x10x10 submatrix of a larger 100x100x100 array of data.
     C     The result is transformed back with scaling.
     C
             SCALE = 1.0
             INPL = .TRUE.
             L = 10
             M = 10
             N = 10
             LCOMM = 2000000
             CALL CFFT3DY(0,SCALE,INPL,L,M,N,X,1,100,10000,Y,1,1,1,
          *               COMM,LCOMM,INFO)
             CALL CFFT3DY(-1,SCALE,INPL,L,M,N,X,1,100,10000,Y,1,1,1,
          *               COMM,LCOMM,INFO)
             IY = 1
             DO 20 I = 1, L
                DO 40 J = 1, M
                   DO 10 K = 1, N
                      X(I,J,K) = X(I,J,K)*EXP(-0.001*REAL(I+J+K-3))
        10      CONTINUE
        20   CONTINUE
             SCALE = 1.0/REAL(L*M*N)
             CALL CFFT3DY(1,SCALE,INPL,L,M,N,X,1,100,10000,Y,1,1,1,
          *               COMM,LCOMM,INFO)