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