9.3.127 RANDOM_SEED ([SIZE] [, PUT] [, GET])

Description:  Changes or queries the seed (starting point) for the pseudorandom number generator used by RANDOM_NUMBER.  
Class:  Subroutine 
Arguments:  No more than one argument can be specified. If no argument is specified, a random number based on the date and time is assigned to the seed. The three optional arguments follow1
  SIZE (opt) Must be scalar and of type default integer. It is set to the number of integers (N) that the processor uses to hold the value of the seed.  
  PUT (opt) Must be a default integer array of rank one and size >= N. It is used to reset the seed value.  
  GET (opt) Must be a default integer array of rank one and size >= N. It is set to the current value of the seed. 
1 SIZE and GET are INTENT(OUT) arguments; PUT is an INTENT(IN) argument. For more information on INTENT, see Section 5.10.

Examples

Consider the following:

CALL RANDOM_SEED                        ! Processor initializes the
                                        !   seed randomly from the date
                                        !   and time
CALL RANDOM_SEED (SIZE = M)             ! Sets M to N
CALL RANDOM_SEED (PUT = SEED (1 : M))   ! Sets user seed
CALL RANDOM_SEED (GET = OLD  (1 : M))   ! Reads current seed


Previous Page Next Page Table of Contents