SNORAN is initialized by the routine SNORAN_INI.FOR which
loads titles bank SEED. This bank contains
two integer seeds which determine which random number sequence will be
generated, and a third integer which is the point in the sequence to start from.
The first integer must be in the range 1 - 31328, and the second 1 - 30081;
each pair of such integers generates a different random number sequence of
length 2. .
At the beginning of each event the routine MCMAIN writes the current event
number, these two integers, and the number of random numbers used so far
to a file called `rseed.dat'. This can be overridden using a FILE
command (see section 3.9.2) e.g.:-
file mco 1 my_seeds.dat checkpoint=10The checkpoint option can be used to decrease the frequency with which the file is updated; in this case it is output every 10th. event. If the program crashes for some reason it can be restarted at the same point by using the same two seeds and copying the number of random numbers used to the 3rd entry in the SEED bank. Otherwise this number should be set to 0 so that the random number sequence starts at the beginning.
There was one change made to the algorithm as published. As published the routine would produce a true zero once every 4.2 billion numbers. This would then crash those routines that take log(SNORAN). Rather than trap all of these routines and pay a price in speed we decided to make a different change that would accomplish the same thing. The routine actually implemented in SNORAN substitutes 1.0 whenever the original routine would have produced 0.0 without altering the subsequent sequence (we think). This avoids the crashes without increasing the run time.
For further information see the Companion:-