Next: , Previous: CFFT2D, Up: 2D FFT


ZFFT2DX Routine Documentation
— SUBROUTINE: ZFFT2DX (MODE,SCALE,LTRANS,INPL,M,N,X,INCX1,
INCX2,Y,INCY1,INCY2,COMM,INFO
)
— Input: INTEGER MODE

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

  • MODE=0 : only initializations (specific to the value of 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 2D transform is performed. Initializations are assumed to have been performed by a prior call to ZFFT2DX.
  • MODE=1 : a backward (reverse) 2D transform is performed. Initializations are assumed to have been performed by a prior call to ZFFT2DX.
  • MODE=-2 : (default) initializations and a forward 2D transform are performed.
  • MODE=2 : (default) initializations and a backward 2D transform are performed.
  • MODE=100 : similar to MODE=0; only initializations (specific to the values of N 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 N and M.

— Input: DOUBLE PRECISION SCALE

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

— Input: LOGICAL LTRANS

On input: if LTRANS is .TRUE. then a normal final transposition is performed internally to return transformed data consistent with the values for arguments INPL, INCX1, INCX2, INCY1 and INCY2. If LTRANS is .FALSE. then the final transposition is not performed explicitly; the storage format on output is determined by whether the output data is stored contiguously or not – please see the output specifications for X and Y for details.

— 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 M

On input: M is the first dimension of the 2D transform.

— Input: INTEGER N

On input: N is the second dimension of the 2D transform.

— Input/Output: COMPLEX*16 X(1+(M-1)*INCX1+(N-1)*INCX2)

On input: X contains the M by N complex 2D data array to be transformed; the (ij)th element is stored in X(1+(i-1)*INCX1+(j-1)*INCX2).
On output: if INPL is .TRUE. then X contains the transformed data, either in the same locations as on input when LTRANS=.TRUE.; in locations X((i-1)*N+j) when LTRANS=.FALSE., INCX1=1 and INCX2=M; and otherwise in the same locations as on input. If INPL is .FALSE. X remains unchanged.

— Input: INTEGER INCX1

On input: INCX1 is the increment used to store, in X, successive elements in the first dimension (INCX1=1 for contiguous data).
Constraint: INCX1 > 0.

— Input: INTEGER INCX2

On input: INCX2 is the increment used to store, in X, successive elements in the second dimension (INCX2=M for contiguous data).
Constraint: INCX2 > 0;
INCX2 > (M-1)*INCX1 if N > 1.

— Output: COMPLEX*16 Y(1+(M-1)*INCY1+(N-1)*INCY2)

On output: if INPL is .FALSE. then Y contains the transformed data. If LTRANS=.TRUE. then the (ij)th data element is stored in Y(1+(i-1)*INCY1+(j-1)*INCY2); if LTRANS=.FALSE., INCY1=1 and INCY2=N then the (ij)th data element is stored in Y((i-1)*N+j); and otherwise the (ij)th element is stored in Y(1+(i-1)*INCY1+(j-1)*INCY2). If INPL is .TRUE. then Y is not referenced.

— Input: INTEGER INCY1

On input: INCY1 is the increment used to store successive elements in the first dimension in Y (INCY1=1 for contiguous data). If INPL is .TRUE. then INCY1 is not referenced.
Constraint: INCY1 > 0.

— Input: INTEGER INCY2

On input: INCY2 is the increment used to store successive elements in the second dimension in Y (for contiguous data, INCY2=M when LTRANS is .TRUE. or INCY2=N when LTRANS is .FALSE.). If INPL is .TRUE. then INCY2 is not referenced.
Constraints: INCY2 > 0;
INCY2 > (M-1)*INCY1 if N > 1 and LTRANS is .TRUE.;
INCY2 = N if M > 1 and LTRANS is .FALSE..

— Input/Output: COMPLEX*16 COMM(M*N+3*M+3*N+200)

COMM is a communication array. Some portions of the array are used to store initializations for subsequent calls with the same dimensions M and N. The remainder is used as temporary store.

— 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 2D FFT is performed unscaled, without final transpose
     C     and out-of-place on data stored in array X and output to Y.
     C     Manipulations are stored in vector Y which is then transformed
     C     back, with scaling, into the first M rows of X.
     C
             COMPLEX *16 X(M,N), Y(N,M)
             SCALE = 1.0D0
             INPL = .FALSE.
             LTRANS = .FALSE.
             CALL ZFFT2DX(0,SCALE,LTRANS,INPL,M,N,X,1,M,Y,1,N,COMM,INFO)
             CALL ZFFT2DX(-1,SCALE,LTRANS,INPL,M,N,X,1,M,Y,1,N,COMM,INFO)
             DO 20 I = M
                DO 10 J = 1, N
                   Y(J,I) = 0.5D0*Y(J,I)*EXP(0.001D0*(I+J-2))
        10      CONTINUE
        20   CONTINUE
             SCALE = 1.0D0/DBLE(M*N)
             CALL ZFFT2DX(1,SCALE,LTRANS,INPL,N,M,Y,1,N,X,1,M,COMM,INFO)