1 subroutine cfftmf ( lot, jump, n, inc, c, lenc, wsave, lensav, work, &
4 !*****************************************************************************80
6 !! CFFTMF: complex single precision forward FFT, 1D, multiple vectors.
10 ! CFFTMF computes the one-dimensional Fourier transform of multiple
11 ! periodic sequences within a complex array. This transform is referred
12 ! to as the forward transform or Fourier analysis, transforming the
13 ! sequences from physical to spectral space. This transform is
14 ! normalized since a call to CFFTMF followed by a call to CFFTMB
15 ! (or vice-versa) reproduces the original array within roundoff error.
17 ! The parameters integers INC, JUMP, N and LOT are consistent if equality
18 ! I1*INC + J1*JUMP = I2*INC + J2*JUMP for I1,I2 < N and J1,J2 < LOT
19 ! implies I1=I2 and J1=J2. For multiple FFTs to execute correctly,
20 ! input variables INC, JUMP, N and LOT must be consistent, otherwise
21 ! at least one array element mistakenly is transformed more than once.
24 ! Copyright (C) 1995-2004, Scientific Computing Division,
25 ! University Corporation for Atmospheric Research
39 ! Vectorizing the Fast Fourier Transforms,
40 ! in Parallel Computations,
41 ! edited by G. Rodrigue,
42 ! Academic Press, 1982.
45 ! Fast Fourier Transform Algorithms for Vector Computers,
46 ! Parallel Computing, pages 45-63, 1984.
50 ! Input, integer ( kind = 4 ) LOT, the number of sequences to be
51 ! transformed within array C.
53 ! Input, integer ( kind = 4 ) JUMP, the increment between the locations,
54 ! in array C, of the first elements of two consecutive sequences to be
57 ! Input, integer ( kind = 4 ) N, the length of each sequence to be
58 ! transformed. The transform is most efficient when N is a product of
61 ! Input, integer ( kind = 4 ) INC, the increment between the locations, in
62 ! array C, of two consecutive elements within the same sequence to be
65 ! Input/output, complex ( kind = 4 ) C(LENC), array containing LOT sequences,
66 ! each having length N, to be transformed. C can have any number of
67 ! dimensions, but the total number of locations must be at least LENC.
69 ! Input, integer ( kind = 4 ) LENC, the dimension of the C array.
70 ! LENC must be at least (LOT-1)*JUMP + INC*(N-1) + 1.
72 ! Input, real ( kind = 4 ) WSAVE(LENSAV). WSAVE's contents must be
73 ! initialized with a call to CFFTMI before the first call to routine CFFTMF
74 ! or CFFTMB for a given transform length N.
76 ! Input, integer ( kind = 4 ) LENSAV, the dimension of the WSAVE array.
77 ! LENSAV must be at least 2*N + INT(LOG(REAL(N))) + 4.
79 ! Workspace, real ( kind = 4 ) WORK(LENWRK).
81 ! Input, integer ( kind = 4 ) LENWRK, the dimension of the WORK array.
82 ! LENWRK must be at least 2*LOT*N.
84 ! Output, integer ( kind = 4 ) IER, error flag.
86 ! 1 input parameter LENC not big enough;
87 ! 2 input parameter LENSAV not big enough;
88 ! 3 input parameter LENWRK not big enough;
89 ! 4 input parameters INC, JUMP, N, LOT are not consistent.
93 integer ( kind = 4 ) lenc
94 integer ( kind = 4 ) lensav
95 integer ( kind = 4 ) lenwrk
97 complex ( kind = 4 ) c(lenc)
98 integer ( kind = 4 ) ier
99 integer ( kind = 4 ) inc
100 integer ( kind = 4 ) iw1
101 integer ( kind = 4 ) jump
102 integer ( kind = 4 ) lot
103 integer ( kind = 4 ) n
104 real ( kind = 4 ) work(lenwrk)
105 real ( kind = 4 ) wsave(lensav)
110 if ( lenc < ( lot - 1 ) * jump + inc * ( n - 1 ) + 1 ) then
112 call xerfft ( 'CFFTMF', 6 )
116 if ( lensav < 2 * n + int ( log ( real ( n, kind = 4 ) ) ) + 4 ) then
118 call xerfft ( 'CFFTMF', 8 )
122 if ( lenwrk < 2 * lot * n ) then
124 call xerfft ( 'CFFTMF', 10 )
128 if ( .not. xercon ( inc, jump, n, lot ) ) then
130 call xerfft ( 'CFFTMF', -1 )
140 call cmfm1f ( lot, jump, n, inc, c, work, wsave, wsave(iw1), &