1 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
2 | ! |
---|
3 | ! FFTPACK 5.0 |
---|
4 | ! |
---|
5 | ! Authors: Paul N. Swarztrauber and Richard A. Valent |
---|
6 | ! |
---|
7 | ! $Id: sinq1b.f,v 1.2 2004/06/15 21:29:20 rodney Exp $ |
---|
8 | ! |
---|
9 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
10 | |
---|
11 | SUBROUTINE SINQ1B ( N, INC, X, LENX, WSAVE, LENSAV, & |
---|
12 | & WORK, LENWRK, IER) |
---|
13 | INTEGER N, INC, LENX, LENSAV, LENWRK, IER |
---|
14 | REAL X(INC,*), WSAVE(LENSAV), WORK(LENWRK) |
---|
15 | ! |
---|
16 | IER = 0 |
---|
17 | ! |
---|
18 | IF (LENX .LT. INC*(N-1) + 1) THEN |
---|
19 | IER = 1 |
---|
20 | CALL XERFFT ('SINQ1B', 6) |
---|
21 | ELSEIF (LENSAV .LT. 2*N + INT(LOG(REAL(N))) +4) THEN |
---|
22 | IER = 2 |
---|
23 | CALL XERFFT ('SINQ1B', 8) |
---|
24 | ELSEIF (LENWRK .LT. N) THEN |
---|
25 | IER = 3 |
---|
26 | CALL XERFFT ('SINQ1B', 10) |
---|
27 | ENDIF |
---|
28 | ! |
---|
29 | IF (N .GT. 1) GO TO 101 |
---|
30 | X(1,1) = 4.*X(1,1) |
---|
31 | RETURN |
---|
32 | 101 NS2 = N/2 |
---|
33 | DO 102 K=2,N,2 |
---|
34 | X(1,K) = -X(1,K) |
---|
35 | 102 END DO |
---|
36 | CALL COSQ1B (N,INC,X,LENX,WSAVE,LENSAV,WORK,LENWRK,IER1) |
---|
37 | IF (IER1 .NE. 0) THEN |
---|
38 | IER = 20 |
---|
39 | CALL XERFFT ('SINQ1B',-5) |
---|
40 | GO TO 300 |
---|
41 | ENDIF |
---|
42 | DO 103 K=1,NS2 |
---|
43 | KC = N-K |
---|
44 | XHOLD = X(1,K) |
---|
45 | X(1,K) = X(1,KC+1) |
---|
46 | X(1,KC+1) = XHOLD |
---|
47 | 103 END DO |
---|
48 | 300 RETURN |
---|
49 | END |
---|