9.3.126 RANDOM_NUMBER (HARVEST)

Description:  Returns one pseudorandom number or an array of such numbers. 
Class:  Subroutine 
Arguments:  HARVEST must be of type real. It is an INTENT(OUT) argument (see Section 5.10), and can be a scalar or an array variable. It is set to contain pseudorandom numbers from the uniform distribution within the range 0 <= x < 1. 

Examples

Consider the following:

  REAL Y, Z (5, 5)
  ! Initialize Y with a pseudorandom number
  CALL RANDOM_NUMBER (HARVEST = Y)
  CALL RANDOM_NUMBER (Z)

Y and Z contain uniformly distributed random numbers.


Previous Page Next Page Table of Contents