1 subroutine dcosq1i ( n, wsave, lensav, ier )
3 !*****************************************************************************80
5 !! DCOSQ1I: initialization for DCOSQ1B and DCOSQ1F.
9 ! DCOSQ1I initializes array WSAVE for use in its companion routines
10 ! DCOSQ1F and DCOSQ1B. The prime factorization of N together with a
11 ! tabulation of the trigonometric functions are computed and stored
12 ! in array WSAVE. Separate WSAVE arrays are required for different
23 ! Original real single precision by Paul Swarztrauber, Richard Valent.
24 ! Real double precision version by John Burkardt.
29 ! Vectorizing the Fast Fourier Transforms,
30 ! in Parallel Computations,
31 ! edited by G. Rodrigue,
32 ! Academic Press, 1982.
35 ! Fast Fourier Transform Algorithms for Vector Computers,
36 ! Parallel Computing, pages 45-63, 1984.
40 ! Input, integer ( kind = 4 ) N, the length of the sequence to be
41 ! transformed. The transform is most efficient when N is a product of small
44 ! Input, integer ( kind = 4 ) LENSAV, the dimension of the WSAVE array.
45 ! LENSAV must be at least 2*N + INT(LOG(REAL(N))) + 4.
47 ! Output, real ( kind = 8 ) WSAVE(LENSAV), containing the prime factors of
48 ! N and also containing certain trigonometric values which will be used
49 ! in routines DCOSQ1B or DCOSQ1F.
51 ! Output, integer ( kind = 4 ) IER, error flag.
53 ! 2, input parameter LENSAV not big enough;
54 ! 20, input error returned by lower level routine.
58 integer ( kind = 4 ) lensav
62 integer ( kind = 4 ) ier
63 integer ( kind = 4 ) ier1
64 integer ( kind = 4 ) k
65 integer ( kind = 4 ) lnsv
66 integer ( kind = 4 ) n
68 real ( kind = 8 ) wsave(lensav)
72 if ( lensav < 2 * n + int ( log ( real ( n, kind = 8 ) ) ) + 4 ) then
74 call xerfft ( 'dcosq1i', 3 )
78 pih = 2.0D+00 * atan ( 1.0D+00 )
79 dt = pih / real ( n, kind = 8 )
84 wsave(k) = cos ( fk * dt )
87 lnsv = n + int ( log ( real ( n, kind = 8 ) ) ) + 4
89 call dfft1i ( n, wsave(n+1), lnsv, ier1 )
93 call xerfft ( 'dcosq1i', -5 )