Rename *ll* and *ul* to ll and ul in in-interval
[maxima.git] / share / fftpack5 / fortran / sinqmb.f
blobd78432a4c408c1f4a65adabef52250414a669a09
1 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3 C FFTPACK 5.0
5 C Authors: Paul N. Swarztrauber and Richard A. Valent
7 C $Id$
9 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
11 SUBROUTINE SINQMB (LOT, JUMP, N, INC, X, LENX, WSAVE, LENSAV,
12 1 WORK, LENWRK, IER)
13 INTEGER LOT, JUMP, N, INC, LENX, LENSAV, LENWRK, IER
14 REAL X(INC,*), WSAVE(LENSAV), WORK(LENWRK)
15 LOGICAL XERCON
17 IER = 0
19 IF (LENX .LT. (LOT-1)*JUMP + INC*(N-1) + 1) THEN
20 IER = 1
21 CALL XERFFT ('SINQMB', 6)
22 ELSEIF (LENSAV .LT. 2*N + INT(LOG(REAL(N))/LOG(2.)) +4) THEN
23 IER = 2
24 CALL XERFFT ('SINQMB', 8)
25 ELSEIF (LENWRK .LT. LOT*N) THEN
26 IER = 3
27 CALL XERFFT ('SINQMB', 10)
28 ELSEIF (.NOT. XERCON(INC,JUMP,N,LOT)) THEN
29 IER = 4
30 CALL XERFFT ('SINQMB', -1)
31 ENDIF
33 LJ = (LOT-1)*JUMP+1
34 IF (N .GT. 1) GO TO 101
35 DO 201 M=1,LJ,JUMP
36 X(M,1) = 4.*X(M,1)
37 201 CONTINUE
38 RETURN
39 101 NS2 = N/2
40 DO 102 K=2,N,2
41 DO 202 M=1,LJ,JUMP
42 X(M,K) = -X(M,K)
43 202 CONTINUE
44 102 CONTINUE
45 CALL COSQMB (LOT,JUMP,N,INC,X,LENX,WSAVE,LENSAV,WORK,LENWRK,IER1)
46 IF (IER1 .NE. 0) THEN
47 IER = 20
48 CALL XERFFT ('SINQMB',-5)
49 GO TO 300
50 ENDIF
51 DO 103 K=1,NS2
52 KC = N-K
53 DO 203 M=1,LJ,JUMP
54 XHOLD = X(M,K)
55 X(M,K) = X(M,KC+1)
56 X(M,KC+1) = XHOLD
57 203 CONTINUE
58 103 CONTINUE
59 300 CONTINUE
60 RETURN
61 END