C.hr ran
C@
*....*...1.........2.........3.........4.........5.........6.........7.*
      real*4 function ran(ix)
*  uniform pseudorandom number generator
*  fortran version of lewis, goodman, miller
*  schrage,  acm toms v.5 (1979) p132
*  modified 1/24/90 by a r gallant to set seed differently
      implicit none
      integer*4 a,p,ix,b15,b16,xhi,xalo,leftlo,fhi,k
      intrinsic FLOAT
      data a/16807/,b15/32768/,b16/65536/,p/2147483647/
      save
      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
      return
      end
