Sets the seed for the random number generator provided by the standard based on a single integer. We use create_seed_from_single_integer to ensure we have enough values in the series rather than just duplicating this number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | initial_seed |
subroutine set_seed_from_single_integer(initial_seed)
# if RANDOM == _RANMT_
use mt19937, only: sgrnd
# endif
implicit none
integer, intent(in) :: initial_seed
# if RANDOM == _RANMT_
call sgrnd(initial_seed)
# else
call random_seed(put = create_seed_from_single_integer(initial_seed))
# endif
end subroutine set_seed_from_single_integer