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