1 subroutine zfft1f ( n, inc, c, lenc, wsave, lensav, work, lenwrk, ier )
3 !*****************************************************************************80
5 !! ZFFT1F: complex double precision forward fast Fourier transform, 1D.
9 ! ZFFT1F computes the one-dimensional Fourier transform of a single
10 ! periodic sequence within a complex array. This transform is referred
11 ! to as the forward transform or Fourier analysis, transforming the
12 ! sequence from physical to spectral space.
14 ! This transform is normalized since a call to ZFFT1F followed
15 ! by a call to ZFFT1B (or vice-versa) reproduces the original
16 ! array within roundoff error.
26 ! Original complex single precision by Paul Swarztrauber, Richard Valent.
27 ! Complex double precision version by John Burkardt.
32 ! Vectorizing the Fast Fourier Transforms,
33 ! in Parallel Computations,
34 ! edited by G. Rodrigue,
35 ! Academic Press, 1982.
38 ! Fast Fourier Transform Algorithms for Vector Computers,
39 ! Parallel Computing, pages 45-63, 1984.
43 ! Input, integer ( kind = 4 ) N, the length of the sequence to be
44 ! transformed. The transform is most efficient when N is a product of
47 ! Input, integer ( kind = 4 ) INC, the increment between the locations, in
48 ! array C, of two consecutive elements within the sequence to be transformed.
50 ! Input/output, complex ( kind = 8 ) C(LENC) containing the sequence to
53 ! Input, integer ( kind = 4 ) LENC, the dimension of the C array.
54 ! LENC must be at least INC*(N-1) + 1.
56 ! Input, real ( kind = 8 ) WSAVE(LENSAV). WSAVE's contents must be
57 ! initialized with a call to ZFFT1I before the first call to routine ZFFT1F
58 ! or ZFFT1B for a given transform length N. WSAVE's contents may be re-used
59 ! for subsequent calls to ZFFT1F and ZFFT1B with the same N.
61 ! Input, integer ( kind = 4 ) LENSAV, the dimension of the WSAVE array.
62 ! LENSAV must be at least 2*N + INT(LOG(REAL(N))) + 4.
64 ! Workspace, real ( kind = 8 ) WORK(LENWRK).
66 ! Input, integer ( kind = 4 ) LENWRK, the dimension of the WORK array.
67 ! LENWRK must be at least 2*N.
69 ! Output, integer ( kind = 4 ) IER, error flag.
71 ! 1, input parameter LENC not big enough;
72 ! 2, input parameter LENSAV not big enough;
73 ! 3, input parameter LENWRK not big enough;
74 ! 20, input error returned by lower level routine.
78 integer ( kind = 4 ) lenc
79 integer ( kind = 4 ) lensav
80 integer ( kind = 4 ) lenwrk
82 complex ( kind = 8 ) c(lenc)
83 integer ( kind = 4 ) ier
84 integer ( kind = 4 ) inc
85 integer ( kind = 4 ) iw1
86 integer ( kind = 4 ) n
87 real ( kind = 8 ) work(lenwrk)
88 real ( kind = 8 ) wsave(lensav)
92 if ( lenc < inc * ( n - 1 ) + 1 ) then
94 call xerfft ( 'ZFFT1F', 6 )
98 if ( lensav < 2 * n + int ( log ( real ( n, kind = 8 ) ) ) + 4 ) then
100 call xerfft ( 'ZFFT1F', 8 )
104 if ( lenwrk < 2 * n ) then
106 call xerfft ( 'ZFFT1F', 10 )
116 call z1fm1f ( n, inc, c, work, wsave, wsave(iw1), wsave(iw1+1) )