1 subroutine sinqmf ( lot, jump, n, inc, x, lenx, wsave, lensav, &
4 !*****************************************************************************80
6 !! SINQMF: real single precision forward sine quarter wave, multiple vectors.
10 ! SINQMF computes the one-dimensional Fourier transform of multiple
11 ! sequences within a real array, where each sequence is a sine series
12 ! with odd wave numbers. This transform is referred to as the forward
13 ! transform or Fourier synthesis, transforming the sequences from
14 ! spectral to physical space.
16 ! This transform is normalized since a call to SINQMF followed
17 ! by a call to SINQMB (or vice-versa) reproduces the original
18 ! array within roundoff error.
21 ! Copyright (C) 1995-2004, Scientific Computing Division,
22 ! University Corporation for Atmospheric Research
36 ! Vectorizing the Fast Fourier Transforms,
37 ! in Parallel Computations,
38 ! edited by G. Rodrigue,
39 ! Academic Press, 1982.
42 ! Fast Fourier Transform Algorithms for Vector Computers,
43 ! Parallel Computing, pages 45-63, 1984.
47 ! Input, integer ( kind = 4 ) LOT, the number of sequences to be transformed
50 ! Input, integer ( kind = 4 ) JUMP, the increment between the locations,
51 ! in array R, of the first elements of two consecutive sequences to
54 ! Input, integer ( kind = 4 ) N, the length of each sequence to be
55 ! transformed. The transform is most efficient when N is a product of
58 ! Input, integer ( kind = 4 ) INC, the increment between the locations,
59 ! in array R, of two consecutive elements within the same sequence.
61 ! Input/output, real ( kind = 4 ) R(LENR), containing LOT sequences, each
62 ! having length N. R can have any number of dimensions, but the total
63 ! number of locations must be at least LENR. On input, R contains the data
64 ! to be transformed, and on output the transformed data.
66 ! Input, integer ( kind = 4 ) LENR, the dimension of the R array.
67 ! LENR must be at least (LOT-1)*JUMP + INC*(N-1)+ 1.
69 ! Input, real ( kind = 4 ) WSAVE(LENSAV). WSAVE's contents must be
70 ! initialized with a call to SINQMI before the first call to routine SINQMF
71 ! or SINQMB for a given transform length N. WSAVE's contents may be re-used
72 ! for subsequent calls to SINQMF and SINQMB with the same N.
74 ! Input, integer ( kind = 4 ) LENSAV, the dimension of the WSAVE array.
75 ! LENSAV must be at least 2*N + INT(LOG(REAL(N))) + 4.
77 ! Workspace, real ( kind = 4 ) WORK(LENWRK).
79 ! Input, integer ( kind = 4 ) LENWRK, the dimension of the WORK array.
80 ! LENWRK must be at least LOT*N.
82 ! Output, integer ( kind = 4 ) IER, error flag.
84 ! 1, input parameter LENR not big enough;
85 ! 2, input parameter LENSAV not big enough;
86 ! 3, input parameter LENWRK not big enough;
87 ! 4, input parameters INC,JUMP,N,LOT are not consistent;
88 ! 20, input error returned by lower level routine.
92 integer ( kind = 4 ) inc
93 integer ( kind = 4 ) lensav
94 integer ( kind = 4 ) lenwrk
96 integer ( kind = 4 ) ier
97 integer ( kind = 4 ) ier1
98 integer ( kind = 4 ) jump
99 integer ( kind = 4 ) k
100 integer ( kind = 4 ) kc
101 integer ( kind = 4 ) lenx
102 integer ( kind = 4 ) lj
103 integer ( kind = 4 ) lot
104 integer ( kind = 4 ) m
105 integer ( kind = 4 ) n
106 integer ( kind = 4 ) ns2
107 real ( kind = 4 ) work(lenwrk)
108 real ( kind = 4 ) wsave(lensav)
109 real ( kind = 4 ) x(inc,*)
111 real ( kind = 4 ) xhold
115 if ( lenx < ( lot - 1 ) * jump + inc * ( n - 1 ) + 1 ) then
117 call xerfft ( 'sinqmf', 6 )
121 if ( lensav < 2 * n + int ( log ( real ( n, kind = 4 ) ) ) + 4 ) then
123 call xerfft ( 'sinqmf', 8 )
127 if ( lenwrk < lot * n ) then
129 call xerfft ( 'sinqmf', 10 )
133 if ( .not. xercon ( inc, jump, n, lot ) ) then
135 call xerfft ( 'sinqmf', -1 )
144 lj = ( lot - 1 ) * jump + 1
155 call cosqmf ( lot, jump, n, inc, x, lenx, wsave, lensav, work, &
158 if ( ier1 /= 0 ) then
160 call xerfft ( 'sinqmf', -5 )