1 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
2 | ! |
---|
3 | ! FFTPACK 5.0 |
---|
4 | ! |
---|
5 | ! Authors: Paul N. Swarztrauber and Richard A. Valent |
---|
6 | ! |
---|
7 | ! $Id: sintb1.f,v 1.2 2004/06/15 21:29:20 rodney Exp $ |
---|
8 | ! |
---|
9 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
10 | |
---|
11 | SUBROUTINE SINTB1(N,INC,X,WSAVE,XH,WORK,IER) |
---|
12 | REAL X(INC,*) ,WSAVE(*) ,XH(*) |
---|
13 | DOUBLE PRECISION DSUM |
---|
14 | IER = 0 |
---|
15 | IF (N-2) 200,102,103 |
---|
16 | 102 SRT3S2 = SQRT(3.)/2. |
---|
17 | XHOLD = SRT3S2*(X(1,1)+X(1,2)) |
---|
18 | X(1,2) = SRT3S2*(X(1,1)-X(1,2)) |
---|
19 | X(1,1) = XHOLD |
---|
20 | GO TO 200 |
---|
21 | 103 NP1 = N+1 |
---|
22 | NS2 = N/2 |
---|
23 | DO 104 K=1,NS2 |
---|
24 | KC = NP1-K |
---|
25 | T1 = X(1,K)-X(1,KC) |
---|
26 | T2 = WSAVE(K)*(X(1,K)+X(1,KC)) |
---|
27 | XH(K+1) = T1+T2 |
---|
28 | XH(KC+1) = T2-T1 |
---|
29 | 104 END DO |
---|
30 | MODN = MOD(N,2) |
---|
31 | IF (MODN .EQ. 0) GO TO 124 |
---|
32 | XH(NS2+2) = 4.*X(1,NS2+1) |
---|
33 | 124 XH(1) = 0. |
---|
34 | LNXH = NP1 |
---|
35 | LNSV = NP1 + INT(LOG(REAL(NP1))) + 4 |
---|
36 | LNWK = NP1 |
---|
37 | ! |
---|
38 | CALL RFFT1F(NP1,1,XH,LNXH,WSAVE(NS2+1),LNSV,WORK,LNWK,IER1) |
---|
39 | IF (IER1 .NE. 0) THEN |
---|
40 | IER = 20 |
---|
41 | CALL XERFFT ('SINTB1',-5) |
---|
42 | GO TO 200 |
---|
43 | ENDIF |
---|
44 | ! |
---|
45 | IF(MOD(NP1,2) .NE. 0) GO TO 30 |
---|
46 | XH(NP1) = XH(NP1)+XH(NP1) |
---|
47 | 30 FNP1S4 = FLOAT(NP1)/4. |
---|
48 | X(1,1) = FNP1S4*XH(1) |
---|
49 | DSUM = X(1,1) |
---|
50 | DO 105 I=3,N,2 |
---|
51 | X(1,I-1) = FNP1S4*XH(I) |
---|
52 | DSUM = DSUM+FNP1S4*XH(I-1) |
---|
53 | X(1,I) = DSUM |
---|
54 | 105 END DO |
---|
55 | IF (MODN .NE. 0) GO TO 200 |
---|
56 | X(1,N) = FNP1S4*XH(N+1) |
---|
57 | ! |
---|
58 | 200 CONTINUE |
---|
59 | RETURN |
---|
60 | END |
---|