! This program needs the file  "ruti.f"  These are routines in Fortran 77
! To compile  f90 pro1.f90 ruti.f
!  If file links correctly
!  pro1.f90:
!  ruti.f:
!  Linking:
!  After running a.out.  It will generate 3 files uniform.dat
!  normal.dat and gamma.dat

      PROGRAM routines
       IMPLICIT NONE
       REAL, DIMENSION(1000) :: out
       REAL :: gasdev, ran2, rgam
       INTEGER ::  ix, i,N
!
       open(1, file="uniform.dat",status="unknown")
       open(2, file="normal.dat", status="unknown")
       open(3, file="gamma.dat", status="unknown")
!     
       ix = 12345678
       N=1000
!
!
       do i=1,N
          PRINT *, i 
          out(i)=ran2(ix)
          write(1,*) out(i)
          out(i)=gasdev(ix)
          write(2,*) out(i)
          out(i)= rgam(2.0,1.0,ix)
          write(3,*) out(i)
       end do 
!
       close(1)
       close(2)
       close(3)
!
       END PROGRAM routines

