Calling a Built-In Generator in Fortran
program randtest
implicit none
c note declarations; must be proper for precision
integer*4 seed
integer i
real*8 drand48
c user plants seed
write(*,*) 'enter seed'
read(*,*) seed
call seed48(seed)
c generate and print 10 random numbers
do 100 i=1,10
write(*,*) drand48()
100 continue
end
Compilation Command: f77 callf.f -assume nounderscore
NOTICE: This is the drand48 function, available on
the DEC-system. This is not a standard FORTRAN function.
Back to main document.