Contact: | Jeff Anderson |
Reviewers: | |
Revision: | $Revision: 1.2 $ |
Release Name: | $Name: pre_hawaii $ |
Change Date: | $Date: 2004/12/22 20:48:13 $ |
Change history: | see CVS log |
A linear congruential random number generator (see Knuth). The values for the parameters are the same as those used in numerical recipes.
types_mod utilities_mod
use random_nr_mod, only : | random_seq_type |
init_ran1 | |
ran1 | |
gasdev |
type random_seq_type private integer :: ix1, ix2, ix3, iset real(r8) :: r(97), gset end type random_seq_type
Keeps the state history of the linear congruential number generator. See Knuth for details.
type(random_seq_type), intent(out) :: s integer, intent(in) :: temp
Initializes a random sequence with an integer. Any sequence initialized with the same integer will produce the same sequence of 'random' numbers.
s | A random sequence to be initialized |
temp | An integer seed to start the sequence. |
real(r8) :: ran1 type(random_seq_type), intent(inout) :: s
Generate the next uniform [0, 1] random number in the sequence.
ran1 | Next uniformly distributed [0, 1] number in sequence. |
s | A random sequence. |
real(r8) :: gasdev type(random_seq_type), intent(inout) :: s
Generates a random draw from a standard gaussian.
gasdev | A random draw from a standard gaussian. |
s | A random sequence. |
Routine | Message | Comment |
---|---|---|
ran1 | Fatal error in random number | This should probably be removed; should never happen. |