CCPP SciDoc  v6.0.0
Common Community Physics Package Developed at DTC
Mersenne Twister Module

Module: mersenne_twister Modern random number generator.

Author
Iredell Org: W/NX23 date: 2005-06-14 Abstract: This module calculates random numbers using the Mersenne twister. (It has been adapted to a Fortran 90 module from open source software. The comments from the original software are given below in the remarks.) The Mersenne twister (aka MT19937) is a state-of-the-art random number generator based on Mersenne primes and originally developed in 1997 by Matsumoto and Nishimura. It has a period before repeating of 2^19937-1, which certainly should be good enough for geophysical purposes. :-) Considering the algorithm's robustness, it runs fairly speedily. (Some timing statistics are given below in the remarks.) This adaptation uses the standard Fortran 90 random number interface, which can generate an arbitrary number of random numbers at one time. The random numbers generated are uniformly distributed between 0 and 1. The module also can generate random numbers from a Gaussian distribution with mean 0 and standard deviation 1, using a Numerical Recipes algorithm. The module also can generate uniformly random integer indices. There are also thread-safe versions of the generators in this adaptation, necessitating the passing of generator states which must be kept private.