Create the t_random
object with a seed value zseed
. If zseed=0
, a new seed is generated
based on system_clock
values.
Call as:
type( t_random ), pointer :: rnd
integer :: zseed
! with specified value for zseed:
rnd => t_random( zseed )
! or without zseed (this is equivalent to zseed=0)
rnd => t_random()
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in), | optional | :: | zseed |
if not present, new seed is generated |
Derived type to hold a random number generator, which does not interfere with the
global RANDOM_NUMBER()
routine of fortran.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | zseed |
value of |
private function t_random_initialize (zseed) | Create the Call as:
|
final :: t_random_destroy |
procedure, public :: reseed => t_random_reseed | |
procedure, public :: random_number => t_random_number |