RANDOM_SEED intrinsic subroutine
Standard: F77 F90 F95 F2003 F2008
Example Program
<Syntax>

Call RANDOM_SEED ( [ SIZE, PUT, GET ] )

SIZE : scalar Integer with default kind;
PUT : Integer array with default kind;
GET : Integer array with default kind.

<Semantics>

All arguments are optional. If no arguments are supplied, the pseudo-random number generator is re-initialised; this should not be done while using the generator as the relationship between the number sequence before and after the re-initialisation will be unknown.

SIZE is assigned the value N, the number of integer values needed to represent the internal state of the pseudo-random number generator.

GET must have at least N elements; it is assigned the internal state of the pseudo-random number generator. This value can be used for a later PUT argument to RANDOM_SEED to reset the internal state of the generator.

PUT must have at least N elements; it is used to determine the internal state of the pseudo-random number generator. If the value of PUT is one that was retrieved with GET, the generator will be reset to the same state as of the call with GET. It is strongly recommended never to use PUT with anything other than the result of GET, as the generator has an extremely long period and a user-specified seed is highly likely to set the generator into an initial low-entropy state.

<Related>
RANDOM_NUMBER intrinsic subroutine.