Rename *ll* and *ul* to ll and ul in in-interval
[maxima.git] / share / fftpack5 / fortran / rfft2b.f
blob1483a86b17fc221f9ae90b156abdfadd4c6e433d
1 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
3 C FFTPACK 5.0
5 C Authors: Paul N. Swarztrauber and Richard A. Valent
7 C $Id$
9 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
11 SUBROUTINE RFFT2B (LDIM, L, M, R, WSAVE, LENSAV, WORK,
12 1 LENWRK, IER)
13 INTEGER LDIM, L, M, LENSAV, LENWRK, IER
14 REAL R(LDIM,M), WSAVE(LENSAV), WORK(LENWRK)
17 C Initialize IER
19 IER = 0
21 C Verify LENSAV
23 LWSAV = L + INT(LOG (REAL(L))) +4
24 MWSAV = 2*M + INT(LOG (REAL(M))) +4
25 IF (LENSAV .LT. LWSAV+MWSAV) THEN
26 IER = 2
27 CALL XERFFT ('RFFT2B', 6)
28 GO TO 100
29 ENDIF
31 C Verify LENWRK
33 IF (LENWRK .LT. 2*(L/2+1)*M) THEN
34 IER = 3
35 CALL XERFFT ('RFFT2B', 8)
36 GO TO 100
37 ENDIF
39 C Verify LDIM is as big as L
41 IF (LDIM .LT. 2*(L/2+1)) THEN
42 IER = 5
43 CALL XERFFT ('RFFT2B', -6)
44 GO TO 100
45 ENDIF
47 C transform second dimension of array
49 CALL CFFTMB(L/2+1,1,M,LDIM/2,R,M*LDIM/2,
50 . WSAVE(L+INT(LOG(REAL(L)))+5),
51 . 2*M+INT(LOG(REAL(M)))+4,WORK,2*(L/2+1)*M,IER1)
52 IF(IER1.NE.0) THEN
53 IER=20
54 CALL XERFFT('RFFT2B',-5)
55 GO TO 100
56 ENDIF
58 C reshuffle
60 DO J=1,M
61 DO I=2,L
62 R(I,J)=R(I+1,J)
63 ENDDO
64 ENDDO
66 C Transform first dimension of array
68 CALL RFFTMB(M,LDIM,L,1,R,M*LDIM,WSAVE(1),
69 . L+INT(LOG(REAL(L)))+4,WORK,2*(L/2+1)*M,IER1)
70 IF(IER1.NE.0) THEN
71 IER=20
72 CALL XERFFT('RFFT2F',-5)
73 GO TO 100
74 ENDIF
76 100 CONTINUE
78 RETURN
79 END