1 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
2 | ! |
---|
3 | ! FFTPACK 5.0 |
---|
4 | ! |
---|
5 | ! Authors: Paul N. Swarztrauber and Richard A. Valent |
---|
6 | ! |
---|
7 | ! $Id: cosqmf.f,v 1.2 2004/06/15 21:14:57 rodney Exp $ |
---|
8 | ! |
---|
9 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
10 | |
---|
11 | SUBROUTINE COSQMF (LOT, JUMP, N, INC, X, LENX, WSAVE, LENSAV, & |
---|
12 | & WORK, LENWRK, IER) |
---|
13 | INTEGER LOT, JUMP, N, INC, LENX, LENSAV, LENWRK, IER |
---|
14 | REAL X(INC,*), WSAVE(LENSAV), WORK(LENWRK) |
---|
15 | LOGICAL XERCON |
---|
16 | ! |
---|
17 | IER = 0 |
---|
18 | ! |
---|
19 | IF (LENX .LT. (LOT-1)*JUMP + INC*(N-1) + 1) THEN |
---|
20 | IER = 1 |
---|
21 | CALL XERFFT ('COSQMF', 6) |
---|
22 | GO TO 300 |
---|
23 | ELSEIF (LENSAV .LT. 2*N + INT(LOG(REAL(N))) +4) THEN |
---|
24 | IER = 2 |
---|
25 | CALL XERFFT ('COSQMF', 8) |
---|
26 | GO TO 300 |
---|
27 | ELSEIF (LENWRK .LT. LOT*N) THEN |
---|
28 | IER = 3 |
---|
29 | CALL XERFFT ('COSQMF', 10) |
---|
30 | GO TO 300 |
---|
31 | ELSEIF (.NOT. XERCON(INC,JUMP,N,LOT)) THEN |
---|
32 | IER = 4 |
---|
33 | CALL XERFFT ('COSQMF', -1) |
---|
34 | GO TO 300 |
---|
35 | ENDIF |
---|
36 | ! |
---|
37 | LJ = (LOT-1)*JUMP+1 |
---|
38 | IF (N-2) 102,101,103 |
---|
39 | 101 SSQRT2 = 1./SQRT(2.) |
---|
40 | DO 201 M=1,LJ,JUMP |
---|
41 | TSQX = SSQRT2*X(M,2) |
---|
42 | X(M,2) = .5*X(M,1)-TSQX |
---|
43 | X(M,1) = .5*X(M,1)+TSQX |
---|
44 | 201 END DO |
---|
45 | 102 RETURN |
---|
46 | 103 CALL MCSQF1 (LOT,JUMP,N,INC,X,WSAVE,WORK,IER1) |
---|
47 | IF (IER1 .NE. 0) THEN |
---|
48 | IER = 20 |
---|
49 | CALL XERFFT ('COSQMF',-5) |
---|
50 | ENDIF |
---|
51 | ! |
---|
52 | 300 CONTINUE |
---|
53 | RETURN |
---|
54 | END |
---|