1 subroutine sinq1f ( n, inc, x, lenx, wsave, lensav, work, lenwrk, ier )
3 !*****************************************************************************80
5 !! SINQ1F: real single precision forward sine quarter wave transform, 1D.
9 ! SINQ1F computes the one-dimensional Fourier transform of a sequence
10 ! which is a sine series of odd wave numbers. This transform is
11 ! referred to as the forward transform or Fourier analysis, transforming
12 ! the sequence from physical to spectral space.
14 ! This transform is normalized since a call to SINQ1F followed
15 ! by a call to SINQ1B (or vice-versa) reproduces the original
16 ! array within roundoff error.
19 ! Copyright (C) 1995-2004, Scientific Computing Division,
20 ! University Corporation for Atmospheric Research
34 ! Vectorizing the Fast Fourier Transforms,
35 ! in Parallel Computations,
36 ! edited by G. Rodrigue,
37 ! Academic Press, 1982.
40 ! Fast Fourier Transform Algorithms for Vector Computers,
41 ! Parallel Computing, pages 45-63, 1984.
45 ! Input, integer ( kind = 4 ) N, the length of the sequence to be
46 ! transformed. The transform is most efficient when N is a product of
49 ! Input, integer ( kind = 4 ) INC, the increment between the locations,
50 ! in array R, of two consecutive elements within the sequence.
52 ! Input/output, real ( kind = 4 ) R(LENR), on input, the sequence to be
53 ! transformed. On output, the transformed sequence.
55 ! Input, integer ( kind = 4 ) LENR, the dimension of the R array.
56 ! LENR must be at least INC*(N-1)+ 1.
58 ! Input, real ( kind = 4 ) WSAVE(LENSAV). WSAVE's contents must be
59 ! initialized with a call to SINQ1I before the first call to routine SINQ1F
60 ! or SINQ1B for a given transform length N. WSAVE's contents may be re-used
61 ! for subsequent calls to SINQ1F and SINQ1B with the same N.
63 ! Input, integer ( kind = 4 ) LENSAV, the dimension of the WSAVE array.
64 ! LENSAV must be at least 2*N + INT(LOG(REAL(N))) + 4.
66 ! Workspace, real ( kind = 4 ) WORK(LENWRK).
68 ! Input, integer ( kind = 4 ) LENWRK, the dimension of the WORK array.
69 ! LENWRK must be at least N.
71 ! Output, integer ( kind = 4 ) IER, the error flag.
73 ! 1, input parameter LENR not big enough;
74 ! 2, input parameter LENSAV not big enough;
75 ! 3, input parameter LENWRK not big enough;
76 ! 20, input error returned by lower level routine.
80 integer ( kind = 4 ) inc
81 integer ( kind = 4 ) lensav
82 integer ( kind = 4 ) lenwrk
84 integer ( kind = 4 ) ier
85 integer ( kind = 4 ) ier1
86 integer ( kind = 4 ) k
87 integer ( kind = 4 ) kc
88 integer ( kind = 4 ) lenx
89 integer ( kind = 4 ) n
90 integer ( kind = 4 ) ns2
91 real ( kind = 4 ) work(lenwrk)
92 real ( kind = 4 ) wsave(lensav)
93 real ( kind = 4 ) x(inc,*)
94 real ( kind = 4 ) xhold
98 if ( lenx < inc * ( n - 1 ) + 1 ) then
100 call xerfft ( 'sinq1f', 6 )
104 if ( lensav < 2 * n + int ( log ( real ( n, kind = 4 ) ) ) + 4 ) then
106 call xerfft ( 'sinq1f', 8 )
110 if ( lenwrk < n ) then
112 call xerfft ( 'sinq1f', 10 )
129 call cosq1f ( n, inc, x, lenx, wsave, lensav, work, lenwrk, ier1 )
131 if ( ier1 /= 0 ) then
133 call xerfft ( 'sinq1f', -5 )