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