[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: cosqmf.f,v 1.2 2004/06/15 21:14:57 rodney Exp $ |
---|
| 11 | ! |
---|
| 12 | !CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC |
---|
| 13 | |
---|
| 14 | SUBROUTINE COSQMF (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 ('COSQMF', 6) |
---|
| 25 | GO TO 300 |
---|
| 26 | ELSEIF (LENSAV .LT. 2*N + INT(LOG(REAL(N))) +4) THEN |
---|
| 27 | IER = 2 |
---|
| 28 | CALL XERFFT ('COSQMF', 8) |
---|
| 29 | GO TO 300 |
---|
| 30 | ELSEIF (LENWRK .LT. LOT*N) THEN |
---|
| 31 | IER = 3 |
---|
| 32 | CALL XERFFT ('COSQMF', 10) |
---|
| 33 | GO TO 300 |
---|
| 34 | ELSEIF (.NOT. XERCON(INC,JUMP,N,LOT)) THEN |
---|
| 35 | IER = 4 |
---|
| 36 | CALL XERFFT ('COSQMF', -1) |
---|
| 37 | GO TO 300 |
---|
| 38 | ENDIF |
---|
| 39 | ! |
---|
| 40 | LJ = (LOT-1)*JUMP+1 |
---|
| 41 | IF (N-2) 102,101,103 |
---|
| 42 | 101 SSQRT2 = 1./SQRT(2.) |
---|
| 43 | DO 201 M=1,LJ,JUMP |
---|
| 44 | TSQX = SSQRT2*X(M,2) |
---|
| 45 | X(M,2) = .5*X(M,1)-TSQX |
---|
| 46 | X(M,1) = .5*X(M,1)+TSQX |
---|
| 47 | 201 END DO |
---|
| 48 | 102 RETURN |
---|
| 49 | 103 CALL MCSQF1 (LOT,JUMP,N,INC,X,WSAVE,WORK,IER1) |
---|
| 50 | IF (IER1 .NE. 0) THEN |
---|
| 51 | IER = 20 |
---|
| 52 | CALL XERFFT ('COSQMF',-5) |
---|
| 53 | ENDIF |
---|
| 54 | ! |
---|
| 55 | 300 CONTINUE |
---|
| 56 | RETURN |
---|
| 57 | END |
---|