	SUBROUTINE DFT2R(WORK,L2PRV,L2CUR,ISGN,L2NEL,NELEM)
C	DISCRETE FOURIER TRANSFORM OF LENGTH 2**L2CUR.  EFFECTIVELY --
C	DIMENSION WORK(2**L2PRV,2**L2CUR,2*NELEM/2**(L2PRV+L2CUR))
C	SEE DFT2D FOR FURTHER COMMENTS.
	DIMENSION WORK(1)
	TWOPI=6.2831853071795865D0*DBLE(ISGN)
	IP0=2
	NWORD=IP0*NELEM
	IF (L2PRV-L2NEL) 10,10,90
10	IP1=IP0*2**L2PRV
	IF (L2NEL-L2PRV+1-L2CUR) 20,20,30
20	IP3MX=IP1*2**(L2NEL-L2PRV+1)
	GO TO 40
30	IP3MX=IP1*2**L2CUR
40	I5MAX=2*NWORD
	IP2=IP1
	THETA=TWOPI/2.
	SINTH=0.
50	IP3=IP2*2
	IF (IP3-IP3MX) 60,60,90
60	WSTPI=SINTH
	THETA=THETA/2.
	SINTH=SIN(THETA)
	WSTPR=-2.*SINTH*SINTH
	WR=1.
	WI=0.
	DO 80 I2=1,IP2,IP1
	DO 70 I5=I2,I5MAX,IP3
	I1MAX=I5+IP1-IP0
	DO 70 I1=I5,I1MAX,IP0
	I3A=I1
	I3B=I3A+IP2
	TEMPR=WR*WORK(I3B)-WI*WORK(I3B+1)
	TEMPI=WR*WORK(I3B+1)+WI*WORK(I3B)
	WORK(I3B)=WORK(I3A)-TEMPR
	WORK(I3B+1)=WORK(I3A+1)-TEMPI
	WORK(I3A)=WORK(I3A)+TEMPR
70	WORK(I3A+1)=WORK(I3A+1)+TEMPI
	TEMP=WR
	WR=TEMP*WSTPR-WI*WSTPI+TEMP
	WI=WSTPR*WI+WSTPI*TEMP+WI
C	OMIT THE NEXT THREE CARDS IF ROUNDED ARITHMETIC IS USED.
	FACTR=1.5-.5*(WR*WR+WI*WI)
	WR=WR*FACTR
80	WI=WI*FACTR
	IP2=IP3
	GO TO 50
90	RETURN
	END
