1 subroutine dfft1b ( n, inc, r, lenr, wsave, lensav, work, lenwrk, ier )
3 !*****************************************************************************80
5 !! DFFT1B: real double precision backward fast Fourier transform, 1D.
9 ! DFFT1B computes the one-dimensional Fourier transform of a periodic
10 ! sequence within a real array. This is referred to as the backward
11 ! transform or Fourier synthesis, transforming the sequence from
12 ! spectral to physical space. This transform is normalized since a
13 ! call to DFFT1B followed by a call to DFFT1F (or vice-versa) reproduces
14 ! the 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, the data to be
49 ! 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
56 ! DFFT1F 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 ) r(lenr)
82 real ( kind = 8 ) work(lenwrk)
83 real ( kind = 8 ) wsave(lensav)
87 if ( lenr < inc * ( n - 1 ) + 1 ) then
89 call xerfft ( 'rfft1b ', 6 )
93 if ( lensav < n + int ( log ( real ( n, kind = 8 ) ) ) + 4 ) then
95 call xerfft ( 'DFFT1B ', 8 )
99 if ( lenwrk < n ) then
100 write ( *, '(a)' ) ' '
101 write ( *, '(a)' ) 'DFFT1B - Fatal error!'
102 write ( *, '(a)' ) ' LENWRK < N:'
103 write ( *, '(a,i6)' ) ' LENWRK = ', lenwrk
104 write ( *, '(a,i6)' ) ' N = ', n
106 call xerfft ( 'DFFT1B ', 10 )
114 call dfftb1 ( n, inc, r, work, wsave, wsave(n+1) )