SRAND — Reinitialize the random number generator#
-
SRAND(SEED)#
SRAND
reinitializes the pseudo-random number generator called byRAND
andIRAND
. The new seed used by the generator is specified by the required argumentSEED
.- Parameters:
SEED – Shall be a scalar
INTEGER(kind=4)
.- Returns:
Does not return anything.
- Standard:
GNU extension
- Class:
Subroutine
- Syntax:
CALL SRAND(SEED)
- Example:
See
RAND
andIRAND
for examples.- Notes:
The Fortran standard specifies the intrinsic subroutines
RANDOM_SEED
to initialize the pseudo-random number generator andRANDOM_NUMBER
to generate pseudo-random numbers. These subroutines should be used in new codes.Please note that in GNU Fortran, these two sets of intrinsics (
RAND
,IRAND
andSRAND
on the one hand,RANDOM_NUMBER
andRANDOM_SEED
on the other hand) access two independent pseudo-random number generators.- See also:
RAND — Real pseudo-random number, RANDOM_SEED — Initialize a pseudo-random number sequence, RANDOM_NUMBER — Pseudo-random number