RNGET

Retrieves the current value of the seed used in the IMSL random number generators.

Required Arguments

ISEED — The seed of the random number generator. (Output)
ISEED is in the range (1, 2147483646).

FORTRAN 90 Interface

Generic: CALL RNGET (ISEED)

Specific: The specific interface name is RNGET.

FORTRAN 77 Interface

Single: CALL RNGET (ISEED)

Description

Routine RNGET retrieves the current value of the “seed” used in the IMSL random number generators. A reason for doing this would be to restart a simulation, using RNSET to reset the seed.

Example

The following FORTRAN statements illustrate the use of RNGET:

 

INTEGER ISEED

! Call RNSET to initialize the seed.

CALL RNSET(123457)

! Do some simulations.

...

...

CALL RNGET(ISEED)

! Save ISEED. If the simulation is to be continued

! in a different program, ISEED should be output,

! possibly to a file.

...

...

! When the simulations begun above are to be

! restarted, restore ISEED to the value obtained

! above and use as input to RNSET.

CALL RNSET(ISEED)

! Now continue the simulations.

...

...