Procedure to initialize a random number generator with a seed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(rng_type), | intent(inout) | :: | self | Random Number Generator |
||
integer(kind=Int32), | intent(in) | :: | seed | Initial Seed Value |
subroutine rng_init(self, seed)
!+ Procedure to initialize a random number generator with a seed
type(rng_type), intent(inout) :: self
!+ Random Number Generator
integer(Int32), intent(in) :: seed
!+ Initial Seed Value
self%state(1) = ieor(777755555,abs(seed))
self%state(2) = ior(ieor(888889999,abs(seed)),1)
end subroutine rng_init