      SUBROUTINE SYMRV (DATA,NPREV,N,NREM,IFACT,NFACT)
C     SHUFFLE THE DATA ARRAY BY REVERSING THE DIGITS OF ONE INDEX.
C     DIMENSION DATA(NPREV,N,NREM)
C     REPLACE DATA(I1,I2,I3) BY DATA(I1,I2REV,I3) FOR ALL I1 FROM 1 TO
C     NPREV, I2 FROM 1 TO N AND I3 FROM 1 TO NREM.  I2REV-1 IS THE
C     INTEGER WHOSE DIGIT REPRESENTATION IN THE MULTI-RADIX NOTATION
C     OF FACTORS IFACT(IF) IS THE REVERSE OF THE REPRESENTATION OF I2-1.
C     FOR EXAMPLE, IF ALL IFACT(IF) = 2, I2-1 = 11001, I2REV-1 = 10011. 
C     THE FACTORS MUST BE SYMMETRICALLY ARRANGED, I.E., IFACT(IF) = 
C     IFACT(NFACT+1-IF).
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)
      DIMENSION DATA(1), IFACT(1) 
      IF (NFACT-1) 80,80,10 
 10   IP0=2 
      IP1=IP0*NPREV 
      IP4=IP1*N 
      IP5=IP4*NREM
      I4REV=1 
      DO 70 I4=1,IP4,IP1
      IF (I4-I4REV) 20,40,40
 20   I1MAX=I4+IP1-IP0
      DO 30 I1=I4,I1MAX,IP0 
      DO 30 I5=I1,IP5,IP4 
      I5REV=I4REV+I5-I4 
      TEMPR=DATA(I5)
      TEMPI=DATA(I5+1)
      DATA(I5)=DATA(I5REV)
      DATA(I5+1)=DATA(I5REV+1)
      DATA(I5REV)=TEMPR 
 30   DATA(I5REV+1)=TEMPI 
 40   IP3=IP4 
      DO 60 IF=1,NFACT
      IP2=IP3/IFACT(IF) 
      I4REV=I4REV+IP2 
      IF (I4REV-IP3) 70,70,50 
 50   I4REV=I4REV-IP3 
 60   IP3=IP2 
 70   CONTINUE
 80   RETURN
      END 
