Rename *ll* and *ul* to ll and ul in in-interval
[maxima.git] / share / fftpack5 / fortran / costmi.f
blob5b20a2889b2b4fbe4c8a373e6265a936b848b407
1 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3 C FFTPACK 5.0
5 C Authors: Paul N. Swarztrauber and Richard A. Valent
7 C $Id$
9 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
11 SUBROUTINE COSTMI (N, WSAVE, LENSAV, IER)
12 INTEGER N, LENSAV, IER
13 REAL WSAVE(LENSAV)
15 IER = 0
17 IF (LENSAV .LT. 2*N + INT(LOG(REAL(N))/LOG(2.)) +4) THEN
18 IER = 2
19 CALL XERFFT ('COSTMI', 3)
20 GO TO 300
21 ENDIF
23 IF (N .LE. 3) RETURN
24 NM1 = N-1
25 NP1 = N+1
26 NS2 = N/2
27 PI = 4.*ATAN(1.)
28 DT = PI/FLOAT(NM1)
29 FK = 0.
30 DO 101 K=2,NS2
31 KC = NP1-K
32 FK = FK+1.
33 WSAVE(K) = 2.*SIN(FK*DT)
34 WSAVE(KC) = 2.*COS(FK*DT)
35 101 CONTINUE
36 LNSV = NM1 + INT(LOG(REAL(NM1))/LOG(2.)) +4
37 CALL RFFTMI (NM1, WSAVE(N+1), LNSV, IER1)
38 IF (IER1 .NE. 0) THEN
39 IER = 20
40 CALL XERFFT ('COSTMI',-5)
41 ENDIF
42 300 CONTINUE
43 RETURN
44 END