RANDOM_NUMBER — Pseudo-random number#

RANDOM_NUMBER(HARVEST)#

Returns a single pseudorandom number or an array of pseudorandom numbers from the uniform distribution over the range 0 leq x < 1.

Parameters:

HARVEST – Shall be a scalar or an array of type REAL.

Standard:

Fortran 90 and later

Class:

Subroutine

Syntax:
CALL RANDOM_NUMBER(HARVEST)
Example:
program test_random_number
  REAL :: r(5,5)
  CALL RANDOM_NUMBER(r)
end program
See also:

RANDOM_SEED — Initialize a pseudo-random number sequence, RANDOM_INIT — Initialize a pseudo-random number generator