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: mcsqf1.f,v 1.2 2004/06/15 21:29:19 rodney Exp $ |
---|
11 | ! |
---|
12 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
13 | |
---|
14 | SUBROUTINE MCSQF1 (LOT,JUMP,N,INC,X,WSAVE,WORK,IER) |
---|
15 | DIMENSION X(INC,*) ,WSAVE(*) ,WORK(LOT,*) |
---|
16 | IER = 0 |
---|
17 | LJ = (LOT-1)*JUMP+1 |
---|
18 | NS2 = (N+1)/2 |
---|
19 | NP2 = N+2 |
---|
20 | DO 101 K=2,NS2 |
---|
21 | KC = NP2-K |
---|
22 | M1 = 0 |
---|
23 | DO 201 M=1,LJ,JUMP |
---|
24 | M1 = M1 + 1 |
---|
25 | WORK(M1,K) = X(M,K)+X(M,KC) |
---|
26 | WORK(M1,KC) = X(M,K)-X(M,KC) |
---|
27 | 201 CONTINUE |
---|
28 | 101 END DO |
---|
29 | MODN = MOD(N,2) |
---|
30 | IF (MODN .NE. 0) GO TO 301 |
---|
31 | M1 = 0 |
---|
32 | DO 202 M=1,LJ,JUMP |
---|
33 | M1 = M1 + 1 |
---|
34 | WORK(M1,NS2+1) = X(M,NS2+1)+X(M,NS2+1) |
---|
35 | 202 CONTINUE |
---|
36 | 301 DO 102 K=2,NS2 |
---|
37 | KC = NP2-K |
---|
38 | M1 = 0 |
---|
39 | DO 302 M=1,LJ,JUMP |
---|
40 | M1 = M1 + 1 |
---|
41 | X(M,K) = WSAVE(K-1)*WORK(M1,KC)+WSAVE(KC-1)*WORK(M1,K) |
---|
42 | X(M,KC) = WSAVE(K-1)*WORK(M1,K) -WSAVE(KC-1)*WORK(M1,KC) |
---|
43 | 302 CONTINUE |
---|
44 | 102 END DO |
---|
45 | IF (MODN .NE. 0) GO TO 303 |
---|
46 | M1 = 0 |
---|
47 | DO 304 M=1,LJ,JUMP |
---|
48 | M1 = M1 + 1 |
---|
49 | X(M,NS2+1) = WSAVE(NS2)*WORK(M1,NS2+1) |
---|
50 | 304 END DO |
---|
51 | 303 CONTINUE |
---|
52 | LENX = (LOT-1)*JUMP + INC*(N-1) + 1 |
---|
53 | LNSV = N + INT(LOG(REAL(N))) + 4 |
---|
54 | LNWK = LOT*N |
---|
55 | ! |
---|
56 | CALL RFFTMF(LOT,JUMP,N,INC,X,LENX,WSAVE(N+1),LNSV,WORK,LNWK,IER1) |
---|
57 | IF (IER1 .NE. 0) THEN |
---|
58 | IER = 20 |
---|
59 | CALL XERFFT ('MCSQF1',-5) |
---|
60 | GO TO 400 |
---|
61 | ENDIF |
---|
62 | ! |
---|
63 | DO 103 I=3,N,2 |
---|
64 | DO 203 M=1,LJ,JUMP |
---|
65 | XIM1 = .5*(X(M,I-1)+X(M,I)) |
---|
66 | X(M,I) = .5*(X(M,I-1)-X(M,I)) |
---|
67 | X(M,I-1) = XIM1 |
---|
68 | 203 CONTINUE |
---|
69 | 103 END DO |
---|
70 | 400 CONTINUE |
---|
71 | RETURN |
---|
72 | END |
---|