Node:CFFT2DX, Previous:ZFFT2DX, Up:2D FFT



CFFT2DX Routine Documentation

CFFT2DX (MODE,SCALE,LTRANS,INPL,M,N,X,INCX1,
INCX2,Y,INCY1,INCY2,COMM,INFO)
SUBROUTINE
INTEGER MODE Input
The value of MODE on input determines the operation performed by CFFT2DX.
On input:
  • MODE=0 : only initializations (specific to the value of N) are performed; this is usually followed by calls to the same routine with MODE=-1 or 1.
  • MODE=-1 : a forward transform is performed. Initializations are assumed to have been performed by a prior call to CFFT2DX.
  • MODE=1 : a backward (reverse) transform is performed. Initializations are assumed to have been performed by a prior call to CFFT2DX.
  • MODE=-2 : initializations and a forward transform are performed.
  • MODE=2 : initializations and a backward transform are performed.

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

LOGICAL LTRANS Input
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.

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

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

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

COMPLEX X(1+(M-1)*INCX1+(N-1)*INCX2) Input/Output
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.

INTEGER INCX1 Input
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.

INTEGER INCX2 Input
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.

COMPLEX Y(1+(M-1)*INCY1+(N-1)*INCY2) Output
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=M 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.

INTEGER INCY1 Input
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.

INTEGER INCY2 Input
On input: INCY2 is the increment used to store successive elements in the second dimension in Y (INCY2=M for contiguous data). If INPL is .TRUE. then INCY2 is not referenced.
Constraint: INCY2 > 0.

COMPLEX COMM(M*N+5*M+5*N+200) Input/Output
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.

INTEGER INFO Output
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 X(LDX,N), Y(M*N)
             SCALE = 1.0
             INPL = .FALSE.
             LTRANS = .FALSE.
             CALL CFFT2DX(0,SCALE,LTRANS,INPL,M,N,X,1,LDX,Y,1,M,COMM,INFO)
             CALL CFFT2DX(-1,SCALE,LTRANS,INPL,M,N,X,1,LDX,Y,1,M,COMM,INFO)
             IY = 1
             DO 20 I = M
                DO 10 J = 1, N
                   Y(IY) = 0.5*Y(IY)*EXP(-0.001*REAL(I+J-2))
                   IY = IY + 1
        10      CONTINUE
        20   CONTINUE
             SCALE = 1.0/REAL(M*N)
             CALL CFFT2DX(1,SCALE,LTRANS,INPL,N,M,Y,1,N,X,1,LDX,COMM,INFO)