Next: RANDOM_SEED, Previous: RADIX, Up: Intrinsic Procedures
RANDOM_NUMBER
— Pseudo-random numberThe runtime-library implementes George Marsaglia's KISS (Keep It Simple Stupid) random number generator (RNG). This RNG combines:
Please note, this RNG is thread safe if used within OpenMP directives,
i. e. its state will be consistent while called from multiple threads.
However, the KISS generator does not create random numbers in parallel
from multiple sources, but in sequence from a single source. If an
OpenMP-enabled application heavily relies on random numbers, one should
consider employing a dedicated parallel random number generator instead.
RANDOM_NUMBER(HARVEST)
HARVEST | Shall be a scalar or an array of type REAL(*) .
|
program test_random_number REAL :: r(5,5) CALL init_random_seed() ! see example of RANDOM_SEED CALL RANDOM_NUMBER(r) end program