program rand_binary !------------------------------------------------------------------------------ !Program: Random Binary File !Author: Chris Harper !Date: 4/8/2008 !------------------------------------------------------------------------------ use random_numbers implicit none !constants integer, parameter :: ARRAY_SIZE = 5000 !variables integer :: rand_array(0:ARRAY_SIZE-1) integer :: i !fill array with random numbers call init_random do i = 0, ARRAY_SIZE-1 rand_array(i) = random_range(1, 10000) end do !write the array to a binary file open (unit = 10, file = "randombi.dat", status = "replace", form = "unformatted") write (unit = 10) rand_array close (10) !write the array to an ASCII text file open (unit = 20, file = "random.txt", status = "replace") write (20, "(4(I5, 2X))") rand_array close (20) end program