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