SRAND — Reinitialize the random number generator¶
- SRAND()¶
SRANDreinitializes the pseudo-random number generator called byRANDandIRAND. 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
RANDandIRANDfor examples.Notes:The Fortran standard specifies the intrinsic subroutines
RANDOM_SEEDto initialize the pseudo-random number generator andRANDOM_NUMBERto generate pseudo-random numbers. These subroutines should be used in new codes.Please note that in GNU Fortran, these two sets of intrinsics (
RAND,IRANDandSRANDon the one hand,RANDOM_NUMBERandRANDOM_SEEDon the other hand) access two independent pseudo-random number generators.See also:RAND, RANDOM_SEED, RANDOM_NUMBER