      SUBROUTINE FIXRL (DATA,N,NREM,ISIGN,IFORM)
C 
C     * FEB 28/83 - R.LAPRISE.
C     FOR IFORM = 0, CONVERT THE TRANSFORM OF A DOUBLED-UP REAL ARRAY,
C     CONSIDERED COMPLEX, INTO ITS TRUE TRANSFORM.  SUPPLY ONLY THE 
C     FIRST HALF OF THE COMPLEX TRANSFORM, AS THE SECOND HALF HAS 
C     CONJUGATE SYMMETRY.  FOR IFORM = -1, CONVERT THE FIRST HALF 
C     OF THE TRUE TRANSFORM INTO THE TRANSFORM OF A DOUBLED-UP REAL 
C     ARRAY.  N MUST BE EVEN. 
C     USING COMPLEX NOTATION AND SUBSCRIPTS STARTING AT ZERO, THE 
C     TRANSFORMATION IS-- 
C     DIMENSION DATA(N,NREM)
C     ZSTP = EXP(ISIGN*2*PI*I/N)
C     DO 10 I2=0,NREM-1 
C     DATA(0,I2) = CONJ(DATA(0,I2))*(1+I) 
C     DO 10 I1=1,N/4
C     Z = (1+(2*IFORM+1)*I*ZSTP**I1)/2
C     I1CNJ = N/2-I1
C     DIF = DATA(I1,I2)-CONJ(DATA(I1CNJ,I2))
C     TEMP = Z*DIF
C     DATA(I1,I2) = (DATA(I1,I2)-TEMP)*(1-IFORM)
C 10  DATA(I1CNJ,I2) = (DATA(I1CNJ,I2)+CONJ(TEMP))*(1-IFORM)
C     IF I1=I1CNJ, THE CALCULATION FOR THAT VALUE COLLAPSES INTO
C     A SIMPLE CONJUGATION OF DATA(I1,I2).
C-----------------------------------------------------------------------
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)
      DIMENSION DATA(2) 
      TWOPI=6.283185307E0*FLOAT(ISIGN)
      IP0=2 
      IP1=IP0*(N/2) 
      IP2=IP1*NREM
      IF (IFORM) 10,70,70 
C     PACK THE REAL INPUT VALUES (TWO PER COLUMN) 
 10   J1=IP1+1
      DATA(2)=DATA(J1)
      IF (NREM-1) 70,70,20
 20   J1=J1+IP0 
      I2MIN=IP1+1 
      DO 60 I2=I2MIN,IP2,IP1
      DATA(I2)=DATA(J1) 
      J1=J1+IP0 
      IF (N-2) 50,50,30 
 30   I1MIN=I2+IP0
      I1MAX=I2+IP1-IP0
      DO 40 I1=I1MIN,I1MAX,IP0
      DATA(I1)=DATA(J1) 
      DATA(I1+1)=DATA(J1+1) 
 40   J1=J1+IP0 
 50   DATA(I2+1)=DATA(J1) 
 60   J1=J1+IP0 
 70   DO 80 I2=1,IP2,IP1
      TEMPR=DATA(I2)
      DATA(I2)=DATA(I2)+DATA(I2+1)
 80   DATA(I2+1)=TEMPR-DATA(I2+1) 
      IF (N-2) 200,200,90 
 90   THETA=TWOPI/FLOAT(N)
      SINTH=SIN(THETA/2.E0) 
      ZSTPR=-2.E0*SINTH*SINTH 
      ZSTPI=SIN(THETA)
      ZR=(1.E0-ZSTPI)/2.E0
      ZI=(1.E0+ZSTPR)/2.E0
      IF (IFORM) 100,110,110
 100  ZR=1.E0-ZR
      ZI=-ZI
 110  I1MIN=IP0+1 
      I1MAX=IP0*(N/4)+1 
      DO 190 I1=I1MIN,I1MAX,IP0 
      DO 180 I2=I1,IP2,IP1
      I2CNJ=IP0*(N/2+1)-2*I1+I2 
      IF (I2-I2CNJ) 150,120,120 
 120  IF (ISIGN*(2*IFORM+1)) 130,140,140
 130  DATA(I2+1)=-DATA(I2+1)
 140  IF (IFORM) 170,180,180
 150  DIFR=DATA(I2)-DATA(I2CNJ) 
      DIFI=DATA(I2+1)+DATA(I2CNJ+1) 
      TEMPR=DIFR*ZR-DIFI*ZI 
      TEMPI=DIFR*ZI+DIFI*ZR 
      DATA(I2)=DATA(I2)-TEMPR 
      DATA(I2+1)=DATA(I2+1)-TEMPI 
      DATA(I2CNJ)=DATA(I2CNJ)+TEMPR 
      DATA(I2CNJ+1)=DATA(I2CNJ+1)-TEMPI 
      IF (IFORM) 160,180,180
 160  DATA(I2CNJ)=DATA(I2CNJ)+DATA(I2CNJ) 
      DATA(I2CNJ+1)=DATA(I2CNJ+1)+DATA(I2CNJ+1) 
 170  DATA(I2)=DATA(I2)+DATA(I2)
      DATA(I2+1)=DATA(I2+1)+DATA(I2+1)
 180  CONTINUE
      TEMPR=ZR-0.5E0 
      ZR=ZSTPR*TEMPR-ZSTPI*ZI+ZR
 190  ZI=ZSTPR*ZI+ZSTPI*TEMPR+ZI
C     RECURSION SAVES TIME, AT A SLIGHT LOSS IN ACCURACY.  IF AVAILABLE,
C     USE DOUBLE PRECISION TO COMPUTE ZR AND ZI.
 200  IF (IFORM) 270,210,210
C     UNPACK THE REAL TRANSFORM VALUES (TWO PER COLUMN) 
 210  I2=IP2+1
      I1=I2 
      J1=IP0*(N/2+1)*NREM+1 
      GO TO 250 
 220  DATA(J1)=DATA(I1) 
      DATA(J1+1)=DATA(I1+1) 
      I1=I1-IP0 
      J1=J1-IP0 
 230  IF (I2-I1) 220,240,240
 240  DATA(J1)=DATA(I1) 
      DATA(J1+1)=0.E0 
 250  I2=I2-IP1 
      J1=J1-IP0 
      DATA(J1)=DATA(I2+1) 
      DATA(J1+1)=0.E0 
      I1=I1-IP0 
      J1=J1-IP0 
      IF (I2-1) 260,260,230 
 260  DATA(2)=0.E0
 270  RETURN
      END 
