      REAL*8 FUNCTION dRAN(IX)
C  UNIFORM PSEUDORANDOM NUMBER GENERATOR
C  FORTRAN VERSION OF LEWIS, GOODMAN, MILLER
C  SCHRAGE,  ACM TOMS V.5 (1979) P132
C  MODIFIED 1/24/90 BY A R GALLANT TO SET SEED DIFFERENTLY
C  MODIFIED 12/26/92 BY A R GALLANT TO REAL*8 VERSION
      implicit real*4 (a-h,o-z)
      implicit integer*4 (i-n)
      save
      INTEGER*4 A,P,IX,B15,B16,XHI,XALO,LEFTLO,FHI,K
      DATA A/16807/,B15/32768/,B16/65536/,P/2147483647/
      XHI=IX/B16
      XALO=(IX-XHI*B16)*A
      LEFTLO=XALO/B16
      FHI=XHI*A+LEFTLO
      K=FHI/B15
      IX=(((XALO-LEFTLO*B16)-P)+(FHI-K*B15)*B16)+K
      IF(IX.LT.0) IX=IX+P
      RAN=FLOAT(IX)*4.656612875E-10
      dran=ran
      RETURN
      END
