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: sinqmf.f,v 1.2 2004/06/15 21:29:20 rodney Exp $ |
---|
11 | ! |
---|
12 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
13 | |
---|
14 | SUBROUTINE SINQMF (LOT, JUMP, N, INC, X, LENX, WSAVE, LENSAV, & |
---|
15 | & WORK, LENWRK, IER) |
---|
16 | INTEGER LOT, JUMP, N, INC, LENX, LENSAV, LENWRK, IER |
---|
17 | REAL X(INC,*), WSAVE(LENSAV), WORK(LENWRK) |
---|
18 | LOGICAL XERCON |
---|
19 | ! |
---|
20 | IER = 0 |
---|
21 | ! |
---|
22 | IF (LENX .LT. (LOT-1)*JUMP + INC*(N-1) + 1) THEN |
---|
23 | IER = 1 |
---|
24 | CALL XERFFT ('SINQMF', 6) |
---|
25 | GO TO 300 |
---|
26 | ELSEIF (LENSAV .LT. 2*N + INT(LOG(REAL(N))) +4) THEN |
---|
27 | IER = 2 |
---|
28 | CALL XERFFT ('SINQMF', 8) |
---|
29 | GO TO 300 |
---|
30 | ELSEIF (LENWRK .LT. LOT*N) THEN |
---|
31 | IER = 3 |
---|
32 | CALL XERFFT ('SINQMF', 10) |
---|
33 | GO TO 300 |
---|
34 | ELSEIF (.NOT. XERCON(INC,JUMP,N,LOT)) THEN |
---|
35 | IER = 4 |
---|
36 | CALL XERFFT ('SINQMF', -1) |
---|
37 | GO TO 300 |
---|
38 | ENDIF |
---|
39 | ! |
---|
40 | IF (N .EQ. 1) RETURN |
---|
41 | NS2 = N/2 |
---|
42 | LJ = (LOT-1)*JUMP+1 |
---|
43 | DO 101 K=1,NS2 |
---|
44 | KC = N-K |
---|
45 | DO 201 M=1,LJ,JUMP |
---|
46 | XHOLD = X(M,K) |
---|
47 | X(M,K) = X(M,KC+1) |
---|
48 | X(M,KC+1) = XHOLD |
---|
49 | 201 CONTINUE |
---|
50 | 101 END DO |
---|
51 | CALL COSQMF (LOT,JUMP,N,INC,X,LENX,WSAVE,LENSAV,WORK,LENWRK,IER1) |
---|
52 | IF (IER1 .NE. 0) THEN |
---|
53 | IER = 20 |
---|
54 | CALL XERFFT ('SINQMF',-5) |
---|
55 | GO TO 300 |
---|
56 | ENDIF |
---|
57 | DO 102 K=2,N,2 |
---|
58 | DO 202 M=1,LJ,JUMP |
---|
59 | X(M,K) = -X(M,K) |
---|
60 | 202 CONTINUE |
---|
61 | 102 END DO |
---|
62 | 300 CONTINUE |
---|
63 | RETURN |
---|
64 | END |
---|