Fortran Random NumbersFortran 90 Random Number Generators These are Unif[0,1] generators. One is the generator supplied by Fortran 90; the other is a Numerical Recipes generator.
stat.uga.edu/~seymour/8060/tutorial.pdf
DOWNLOAD
| Find Similar
advertisement
Text Previews (text result may be not accurate) a Numerical Recipes generator.
This one generates many uniforms at once - or even one at a time, if you require it. It is
implemented by two intrinsic Fortran subroutines:
This subroutine is used to initialize the random number
generator. If it is called without an argument, the subroutine chooses a seed from
somewhere in the system. Otherwise, there are three possible inputs, but you can't use all
three at once (at least not on this department's system!). They must be accessed in a
call random_seed(size=) size
The output-only variable is a scalar integer
which tells the number of integers, or that the seed uses.
call random_seed(put=) put
The input variable is an integer vector
which uses the seed you choose to initialize the random number generator.
They offer a bounty on two of their routines - one is faster, but the other is more cautious
in the shuffling algorithms employed. The one I put on the course web page is the fast
The equivalent of is ; but to initialize the random number
random_seedran_seed
generator with a seed of your choice, you must use
=seed)seed
where is a value you choose to initialize the sequence.
The equivalent of is . Although may be a multi-
random_numberranharvest
dimensional array with , it can only be a one-dimensional array for
random.f90MODULE
. This is a special kind of programming building block called a .