1 subroutine dfft1f ( n, inc, r, lenr, wsave, lensav, work, lenwrk, ier )
3 !*****************************************************************************80
5 !! DFFT1F: real double precision forward fast Fourier transform, 1D.
9 ! DFFT1F computes the one-dimensional Fourier transform of a periodic
10 ! sequence within a real array. This is referred to as the forward
11 ! transform or Fourier analysis, transforming the sequence from physical
12 ! to spectral space. This transform is normalized since a call to
13 ! DFFT1F followed by a call to DFFT1B (or vice-versa) reproduces the
14 ! original array within roundoff error.
24 ! Original real single precision by Paul Swarztrauber, Richard Valent.
25 ! Real double precision version by John Burkardt.
30 ! Vectorizing the Fast Fourier Transforms,
31 ! in Parallel Computations,
32 ! edited by G. Rodrigue,
33 ! Academic Press, 1982.
36 ! Fast Fourier Transform Algorithms for Vector Computers,
37 ! Parallel Computing, pages 45-63, 1984.
41 ! Input, integer ( kind = 4 ) N, the length of the sequence to be
42 ! transformed. The transform is most efficient when N is a product of
45 ! Input, integer ( kind = 4 ) INC, the increment between the locations,
46 ! in array R, of two consecutive elements within the sequence.
48 ! Input/output, real ( kind = 8 ) R(LENR), on input, contains the sequence
49 ! to be transformed, and on output, the transformed data.
51 ! Input, integer ( kind = 4 ) LENR, the dimension of the R array.
52 ! LENR must be at least INC*(N-1) + 1.
54 ! Input, real ( kind = 8 ) WSAVE(LENSAV). WSAVE's contents must be
55 ! initialized with a call to DFFT1I before the first call to routine DFFT1F
56 ! or DFFT1B for a given transform length N.
58 ! Input, integer ( kind = 4 ) LENSAV, the dimension of the WSAVE array.
59 ! LENSAV must be at least N + INT(LOG(REAL(N))) + 4.
61 ! Workspace, real ( kind = 8 ) WORK(LENWRK).
63 ! Input, integer ( kind = 4 ) LENWRK, the dimension of the WORK array.
64 ! LENWRK must be at least N.
66 ! Output, integer ( kind = 4 ) IER, error flag.
68 ! 1, input parameter LENR not big enough:
69 ! 2, input parameter LENSAV not big enough;
70 ! 3, input parameter LENWRK not big enough.
74 integer ( kind = 4 ) lenr
75 integer ( kind = 4 ) lensav
76 integer ( kind = 4 ) lenwrk
78 integer ( kind = 4 ) ier
79 integer ( kind = 4 ) inc
80 integer ( kind = 4 ) n
81 real ( kind = 8 ) work(lenwrk)
82 real ( kind = 8 ) wsave(lensav)
83 real ( kind = 8 ) r(lenr)
87 if ( lenr < inc * ( n - 1 ) + 1 ) then
89 call xerfft ( 'DFFT1F', 6 )
93 if ( lensav < n + int ( log ( real ( n, kind = 8 ) ) ) + 4 ) then
95 call xerfft ( 'DFFT1F', 8 )
99 if ( lenwrk < n ) then
101 call xerfft ( 'DFFT1F', 10 )
109 call dfftf1 ( n, inc, r, work, wsave, wsave(n+1) )