module provides an interface to call random_numbers and various other random distributions======= !!This module defines a set of functions that return random numbers in different distributions. !!- ran2. Returns a single float uniformly in the range [0, 1) !!- ranu. Return a single float uniformly in the range [a, b) !!- randint. Returns a single integer uniformly in the range [a, b) !!- rang. Returns a single float from a Gaussian distribution with mean avg and std sigma. !!- init_rng. Seeds the internal random number generator with a reproducible seed.
wrapper for call random number
sample a random integer between [a, b]
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | a |
lower bound |
||
integer, | intent(in) | :: | b |
higher bound |
uniformly sample in range[a, b)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | a |
lower bound |
||
real(kind=wp), | intent(in) | :: | b |
upper bound |
initiate RNG state with reproducible state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | optional | :: | input_seed(:) |
input seed |
|
logical, | intent(in), | optional | :: | fwd |
boolean that if True runs the generator for 100 steps before returning |
sample a 2D Guassian distribution
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=wp), | intent(out) | :: | x |
first value to return |
||
real(kind=wp), | intent(out) | :: | y |
2nd value to return |
||
real(kind=wp), | intent(in) | :: | avg |
mean of the gaussian to sample from |
||
real(kind=wp), | intent(in) | :: | sigma |
of the guassian to sample from. |