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: cosqf1.f,v 1.2 2004/06/15 21:14:57 rodney Exp $ |
---|
11 | ! |
---|
12 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
13 | |
---|
14 | SUBROUTINE COSQF1 (N,INC,X,WSAVE,WORK,IER) |
---|
15 | DIMENSION X(INC,*) ,WSAVE(*) ,WORK(*) |
---|
16 | IER = 0 |
---|
17 | NS2 = (N+1)/2 |
---|
18 | NP2 = N+2 |
---|
19 | DO 101 K=2,NS2 |
---|
20 | KC = NP2-K |
---|
21 | WORK(K) = X(1,K)+X(1,KC) |
---|
22 | WORK(KC) = X(1,K)-X(1,KC) |
---|
23 | 101 END DO |
---|
24 | MODN = MOD(N,2) |
---|
25 | IF (MODN .NE. 0) GO TO 301 |
---|
26 | WORK(NS2+1) = X(1,NS2+1)+X(1,NS2+1) |
---|
27 | 301 DO 102 K=2,NS2 |
---|
28 | KC = NP2-K |
---|
29 | X(1,K) = WSAVE(K-1)*WORK(KC)+WSAVE(KC-1)*WORK(K) |
---|
30 | X(1,KC) = WSAVE(K-1)*WORK(K) -WSAVE(KC-1)*WORK(KC) |
---|
31 | 102 END DO |
---|
32 | IF (MODN .NE. 0) GO TO 303 |
---|
33 | X(1,NS2+1) = WSAVE(NS2)*WORK(NS2+1) |
---|
34 | 303 LENX = INC*(N-1) + 1 |
---|
35 | LNSV = N + INT(LOG(REAL(N))) + 4 |
---|
36 | LNWK = N |
---|
37 | ! |
---|
38 | CALL RFFT1F(N,INC,X,LENX,WSAVE(N+1),LNSV,WORK,LNWK,IER1) |
---|
39 | IF (IER1 .NE. 0) THEN |
---|
40 | IER = 20 |
---|
41 | CALL XERFFT ('COSQF1',-5) |
---|
42 | GO TO 400 |
---|
43 | ENDIF |
---|
44 | ! |
---|
45 | DO 103 I=3,N,2 |
---|
46 | XIM1 = .5*(X(1,I-1)+X(1,I)) |
---|
47 | X(1,I) = .5*(X(1,I-1)-X(1,I)) |
---|
48 | X(1,I-1) = XIM1 |
---|
49 | 103 END DO |
---|
50 | 400 RETURN |
---|
51 | END |
---|