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