1 subroutine rfft1f ( n, inc, r, lenr, wsave, lensav, work, lenwrk, ier )
3 !*****************************************************************************80
5 !! RFFT1F: real single precision forward fast Fourier transform, 1D.
9 ! RFFT1F 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 ! RFFT1F followed by a call to RFFT1B (or vice-versa) reproduces the
14 ! original array within roundoff error.
17 ! Copyright (C) 1995-2004, Scientific Computing Division,
18 ! University Corporation for Atmospheric Research
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 R, of two consecutive elements within the sequence.
50 ! Input/output, real ( kind = 4 ) R(LENR), on input, contains the sequence
51 ! to be transformed, and on output, the transformed data.
53 ! Input, integer ( kind = 4 ) LENR, the dimension of the R array.
54 ! LENR must be at least INC*(N-1) + 1.
56 ! Input, real ( kind = 4 ) WSAVE(LENSAV). WSAVE's contents must be
57 ! initialized with a call to RFFT1I before the first call to routine RFFT1F
58 ! or RFFT1B for a given transform length N.
60 ! Input, integer ( kind = 4 ) LENSAV, the dimension of the WSAVE array.
61 ! LENSAV must be at least N + INT(LOG(REAL(N))) + 4.
63 ! Workspace, real ( kind = 4 ) WORK(LENWRK).
65 ! Input, integer ( kind = 4 ) LENWRK, the dimension of the WORK array.
66 ! LENWRK must be at least N.
68 ! Output, integer ( kind = 4 ) IER, error flag.
70 ! 1, input parameter LENR not big enough:
71 ! 2, input parameter LENSAV not big enough;
72 ! 3, input parameter LENWRK not big enough.
76 integer ( kind = 4 ) lenr
77 integer ( kind = 4 ) lensav
78 integer ( kind = 4 ) lenwrk
80 integer ( kind = 4 ) ier
81 integer ( kind = 4 ) inc
82 integer ( kind = 4 ) n
83 real ( kind = 4 ) work(lenwrk)
84 real ( kind = 4 ) wsave(lensav)
85 real ( kind = 4 ) r(lenr)
89 if ( lenr < inc * ( n - 1 ) + 1 ) then
91 call xerfft ( 'rfft1f ', 6 )
95 if ( lensav < n + int ( log ( real ( n, kind = 4 ) ) ) + 4 ) then
97 call xerfft ( 'rfft1f ', 8 )
101 if ( lenwrk < n ) then
103 call xerfft ( 'rfft1f ', 10 )
111 call rfftf1 ( n, inc, r, work, wsave, wsave(n+1) )