Next: , Previous: SQRT, Up: Intrinsic Procedures


8.100 SRAND — Reinitialize the random number generator

Description:
SRAND reinitializes the pseudo-random number generator called by RAND and IRAND. The new seed used by the generator is specified by the required argument SEED.
Option:
gnu
Class:
non-elemental subroutine
Syntax:
CALL SRAND(SEED)
Arguments:

SEED shall be a scalar INTEGER(kind=4).

Return value:
Does not return.
Example:
See RAND and IRAND for examples.
Notes:
The Fortran 2003 standard specifies the intrinsic RANDOM_SEED to initialize the pseudo-random numbers generator and RANDOM_NUMBER to generate pseudo-random numbers. Please note that in gfortran, these two sets of intrinsics (RAND, IRAND and SRAND on the one hand, RANDOM_NUMBER and RANDOM_SEED on the other hand) access two independent pseudo-random numbers generators.