Old-versions

The following applies to versions of UMC well before V4: To be compatible with the CERN version of EGS4, UMC employs the CERNLIB random number generator RNDM. Users requiring random numbers in their user codes are encouraged to make use of RNDM. The calling sequence for RNDM is: X=RNDM(ISEED)

where ISEED is a dummy argument (i.e., it neither affects nor is affected by the call). There are two related routines having the following calling sequences:

CALL RDMOUT(ISEED) and CALL RDMIN(ISEED)

A call to RDMOUT causes the current seed to be placed in ISEED while a call RDMIN causes the seed to be changed to ISEED. The following caveats are found in the CERN library write-up:

1) Using ISEED by calling RDMIN with an arbitrary integer can lead to "serious defects in the randomness " of the ensuing sequence.

2) A different dummy argument should be used when referencing RNDM twice in a single line of code.

3) If RNDM is called within a DO loop, the value of ISEED should be made to depend either directly or indirectly upon the loop index.

Points 2 & 3 are there to avoid problems induced by compiler optimization, and may be superfluous, but taking the recommended precautions can't hurt.