SRAND(SEED) (IBM extension)

Purpose

Provides the seed value used by the random number generator function RAND. This intrinsic subroutine is not recommended. Use the standards conforming RANDOM_NUMBER(HARVEST) intrinsic subroutine.

Class

Subroutine

Argument type and attributes

SEED
must be scalar. It must be of type REAL(4) when used to provide a seed value for the RAND function, or of type INTEGER(4) when used to provide a seed value for the IRAND service and utility function. It is an INTENT(IN) argument.

Examples

The following is an example of a program using the SRAND subroutine.
CALL SRAND(0.5)
DO I = 1, 5
   R = RAND()
   PRINT *,R
ENDDO
END
The following is sample output generated by the above program:
0.3984375000
0.4048461914
0.1644897461
0.1281738281E-01
0.2313232422E-01