C random1 - no number of points
C       shuffle the data within same run
	program random
C ... AUTHOR: KEPLER
C
      implicit double precision (a-h,o-z)
      character*20 infile
      dimension time(100000),y(100000)
c     name input file from tty
c
      write(*,1) 
1     format(1x,' input file is: ',$)
      read(*,2) infile
2     format(a20)
      open(9,file=infile,status='old')
      write(*,120) 
120   format(1x,' output file is: ',$)
      read(*,2) infile
      open(11, file=infile, status='new')
	npoints=0
c  read times
      do 50 i=1,100000
      read (9,*,end=51,err=51) time(i),y(i)
        npoints=npoints+1
   50 continue
51      ndata=npoints
	close(9)
c intel fortan uses ran(i), g77 uses rand(0)
c random do Edu
      do i=1,ndata-1
         xrand=ran(i)
         xintv=float(ndata)-float(i+1)
         xv=xintv*xrand
         xxx=float(i+1)+xv
         k=xxx
         xaux=y(i)
         y(i)=y(k)
         y(k)=xaux
      end do
      do 11 i=1,ndata
      write (11,*) time(i),y(i)
   11 continue


	close(11)
	write(*,5)ndata
5	format(' ndata= ',i5)
    3 continue
      stop
	end
