Merge branch 'master' into bug-4403-remove-polyfill
[maxima.git] / share / fftpack5 / fortran / cost1b.f
blob473fb98c38f63014b576d252313907229166292c
1 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3 C FFTPACK 5.0
5 C Authors: Paul N. Swarztrauber and Richard A. Valent
7 C $Id$
9 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
11 SUBROUTINE COST1B ( N, INC, X, LENX, WSAVE, LENSAV,
12 1 WORK, LENWRK, IER)
13 INTEGER N, INC, LENX, LENSAV, LENWRK, IER
14 REAL X(INC,*), WSAVE(LENSAV), WORK(LENWRK)
16 IER = 0
17 IF (LENX .LT. INC*(N-1) + 1) THEN
18 IER = 1
19 CALL XERFFT ('COST1B', 6)
20 GO TO 100
21 ELSEIF (LENSAV .LT. 2*N + INT(LOG(REAL(N))/LOG(2.)) +4) THEN
22 IER = 2
23 CALL XERFFT ('COST1B', 8)
24 GO TO 100
25 ELSEIF (LENWRK .LT. N-1) THEN
26 IER = 3
27 CALL XERFFT ('COST1B', 10)
28 GO TO 100
29 ENDIF
31 IF (N .EQ. 1) RETURN
33 CALL COSTB1 (N,INC,X,WSAVE,WORK,IER1)
34 IF (IER1 .NE. 0) THEN
35 IER = 20
36 CALL XERFFT ('COST1B',-5)
37 ENDIF
39 100 CONTINUE
40 RETURN
41 END