29 module random_numbers_mod
34 use platform_mod,
only: r4_kind, r8_kind
42 type(randomNumberSequence) :: theNumbers
51 module procedure :: get_random_number_0d_r4, get_random_number_0d_r8
52 module procedure :: get_random_number_1d_r4, get_random_number_1d_r8
53 module procedure :: get_random_number_2d_r4, get_random_number_2d_r8
73 integer,
intent( in) :: seed
80 function initializerandomnumberstream_v(seed)
result(new)
81 integer,
dimension(:),
intent( in) :: seed
85 end function initializerandomnumberstream_v
95 integer,
intent( in) :: i, j
97 integer,
optional,
intent( in) :: perm
98 integer,
dimension(8) :: seed
101 integer :: year, month, day, hour, minute, second
104 call get_date(time, year, month, day, hour, minute, second)
105 seed = (/ i, j, year, month, day, hour, minute, second /)
106 if(
present(perm)) seed = ishftc(seed, perm)
109 #include "random_numbers_r4.fh"
110 #include "random_numbers_r8.fh"
112 end module random_numbers_mod
The type containing the state variable.
integer function, dimension(8), public constructseed(i, j, time, perm)
Constructs a unique seed from grid cell index and model date/time The perm is supplied we generate a ...
type(randomnumberstream) function initializerandomnumberstream_s(seed)
Initialization.
Returns scalar, 1 or 2 D random real numbers.
Initializes stream for generating random numbers.
Type to hold a stream of randomly generated numbers.
subroutine, public get_date(time, year, month, day, hour, minute, second, tick, err_msg)
Gets the date for different calendar types. Given a time_interval, returns the corresponding date und...
Type to represent amounts of time. Implemented as seconds and days to allow for larger intervals.