9.223. RANDOM_SEED

9.223 RANDOM_SEED — Initialize a pseudo-random number sequence

Description:

Restarts or queries the state of the pseudorandom number generator used by RANDOM_NUMBER.

If RANDOM_SEED is called without arguments, it is seeded with random data retrieved from the operating system.

As an extension to the Fortran standard, the GFortran RANDOM_NUMBER supports multiple threads. Each thread in a multi-threaded program has its own seed. When RANDOM_SEED is called either without arguments or with the PUT argument, the given seed is copied into a master seed as well as the seed of the current thread. When a new thread uses RANDOM_NUMBER for the first time, the seed is copied from the master seed, and forwarded N * 2^{512