| 1 |
PROGRAM WRITESEEDS |
| 2 |
C # A simple program to write the initial seeds in a binary file |
| 3 |
integer lun |
| 4 |
integer ran(4) |
| 5 |
character*256 filename |
| 6 |
|
| 7 |
lun=1 |
| 8 |
print*, " Please enter the filename :" |
| 9 |
read*,filename |
| 10 |
length=len_trim(filename) |
| 11 |
lun=1 |
| 12 |
print*, " Opening file : ",filename(1:len_trim(filename)) |
| 13 |
open(unit=lun,file=filename, |
| 14 |
+ status='unknown',form='unformatted') |
| 15 |
print*, " Please enter four unsigned integer :" |
| 16 |
read*, (ran(i),i=1,4) |
| 17 |
write(lun) ran |
| 18 |
print*," Seeds : ", ran |
| 19 |
print*," Wrote to file : ",filename(1:len_trim(filename)) |
| 20 |
close(lun) |
| 21 |
stop |
| 22 |
end |