Restarts or queries the pseudo-random number generator used by RANDOM_NUMBER.

There must either be exactly one or no arguments present.

**SIZE (optional)**- must be scalar and of type default integer. It is an INTENT(OUT) argument. It is set to the number of default type integers (N) that are needed to hold the value of the seed, which is an 8-byte variable.
**PUT (optional)**- must be a default integer array of rank one and size >= N. It is an INTENT(IN) argument. The seed for the current generator is transferred from it.
**GET (optional)**- must be a default integer array of rank one and
size >= N. It is an INTENT(OUT) argument. The seed for
the current generator is transferred to it.
**+-------------------------------IBM Extension--------------------------------+**

**GENERATOR (optional)**- must be a scalar and of type default integer. It is an INTENT(IN)
argument. Its value determines the random number generator to be used
subsequently. The value must be either 1 or 2.
**+----------------------------End of IBM Extension----------------------------+**

+-------------------------------IBM Extension--------------------------------+

Random_seed allows the user to toggle between two random number generators. Generator 1 is the default. Each generator maintains a private seed and normally resumes its cycle after the last number it generated.

Generator 1 uses the multiplicative congruential method, with

```
S(I+1) = ( 16807.0 * S(I) ) mod (2.0**31-1)
```

and

```
X(I+1) = S(I+1) / (2.0**31-1)
```

Generator 1 cycles after 2**31-2 random numbers.

Generator 2 also uses the multiplicative congruential method, with

```
S(I+1) = ( 44,485,709,377,909.0 * S(I) )
mod (2.0**48)
```

and

```
X(I+1) = S(I+1) / (2.0**48)
```

Generator 2 cycles after (2**46) random numbers. Although generator 1 is the default (for reasons of backwards compatibility) the use of generator 2 is recommended for new programs since it typically runs faster than generator 1 and has a longer period.

If no argument is present, the seed of the current generator is set to the default value 1d0.

+----------------------------End of IBM Extension----------------------------+

**Class**

Subroutine

**Examples**

```
CALL RANDOM_SEED
! Current generator sets its seed to 1d0
CALL RANDOM_SEED (SIZE = K)
! Sets K = 64 / BIT_SIZE( 0 )
CALL RANDOM_SEED (PUT = SEED (1 : K))
! Transfer seed to current generator
CALL RANDOM_SEED (GET = OLD (1 : K))
! Transfer seed from current generator
```