m_random Module


Interfaces

public interface t_random

  • private function t_random_initialize(zseed) result(self)

    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()
    

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in), optional :: zseed

    if not present, new seed is generated

    Return Value type(t_random), pointer


Derived Types

type, public ::  t_random

Derived type to hold a random number generator, which does not interfere with the global RANDOM_NUMBER() routine of fortran.

Read more…

Components

Type Visibility Attributes Name Initial
integer, public :: zseed

value of zseed at which this instance of t_random is initialized.

Constructor

private function t_random_initialize (zseed)

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()

Finalizations Procedures

final :: t_random_destroy

Type-Bound Procedures

procedure, public :: reseed => t_random_reseed
procedure, public :: random_number => t_random_number