rng_init Subroutine

public subroutine rng_init(self, seed)

Procedure to initialize a random number generator with a seed

Arguments

Type IntentOptional AttributesName
type(rng_type), intent(inout) :: self

Random Number Generator

integer(kind=Int32), intent(in) :: seed

Initial Seed Value


Contents

Source Code


Source Code

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