PROGRAM Random

  IMPLICIT NONE

  INTEGER :: Ndata, idim, i
  INTEGER, ALLOCATABLE :: arr(:)
  REAL :: ran
  CHARACTER(LEN=20) :: fout

  PRINT *,"Numero di valori causali da generare:"
  READ *,Ndata
  PRINT *,"Nome del file di uscita:"
  READ *,fout
  CALL RANDOM_SEED(SIZE=idim)
  ALLOCATE(arr(idim))
  DO i=1,idim
     arr(i)=2*i+1
  ENDDO
  CALL RANDOM_SEED(PUT=arr)

  OPEN (FILE=fout, UNIT=16, STATUS='UNKNOWN')
  DO i=1,Ndata
     CALL RANDOM_NUMBER(ran)
     WRITE(16,*) ran
  ENDDO
  CLOSE(UNIT=16)

END PROGRAM Random
