{"text": "* Date: Mon, 4 May 1998 13:22:30 +0200 (MET DST)\n* From: Bengt Edvardsson Tom Underwood \n!! \n !!
\n!!\n!! rng_mod Documentation Author
\n!! Description
\n!! rng_mod is a module which contains procedures for\n!! generating random numbers by the Mersenne twister MT19937 algorithm\n!! by acting as a wrapper for 'mt95.f90'), as well as a number of \n!! other useful random-number-related procedures.\n!! Dependencies
\n !! \n !!
\n !! kinds_mod mt95
subroutine init_random_seed() \n !! init_random_seed initialises the random number generator\n !! using the (optional) integer seed specified in the argument. If there is\n !! no argument then a random seed is used - which is taken from the system\n !! clock.\n !!
| Argument | \n !!Type | \n !!Description | \n !!
seed | \n !! integer, intent(in), optional | \n !! A specific seed for the random number generator. | \n !!
function get_random_number() \n !! get_random_number generates a random number between\n !! 0 and 1. We emphasise that this number may be 0, but not 1.\n !!
Returns: real(rk)
function top_hat_rand(L) \n !! top_hat_rand generates a random number between\n !! -L and L, where L>0.\n !!
| Argument | \n !!Type | \n !!Description | \n !!
L | \n !! real(rk), intent(in) | \n !! \n !! The highest magnitude of random number generated by the\n !! function.\n !! | \n !!
Returns: real(rk)
function bag_array(nspec) \n !! This function returns a random array with the specified number of occurences of the numbers 1, 2, ...\n !! Its name reflects the fact that the array reflects drawing at random balls of various types from\n !! a 'bag' containing the specified number of each type of ball.\n !!
\n !!| Argument | \n !!Type | \n !!Description | \n !!
nspec | \n !! integer(ik), dimension(:), allocatable, intent(in) | \n !! \n !! Array containing the number of occurences of each number to occur in the returned array:\n !! nspec(1) is the number of times 1 should occur; nspec(2) is the number\n !! of times 2 should occur; etc. E.g. nspec=\n !! This array should have 1 as its first index.\n !! | \n !!
Returns: integer(ik), dimension(:), allocatable