randomer Derived Type

type, public :: randomer

the class to generate random number


Contents


Type-Bound Procedures

procedure, public :: check_uninited

check if the randomer is initiated

  • private function check_uninited(myrand)

    check if the randomer is initiated

    Arguments

    Type IntentOptional AttributesName
    class(randomer), intent(inout) :: myrand

    Return Value logical

procedure, public :: clean

clean the randomer

  • private subroutine clean(myrand)

    clean the randomer

    Arguments

    Type IntentOptional AttributesName
    class(randomer), intent(inout) :: myrand

generic, public :: initialize => initialize1, initialize2

initialize the randomer

  • private subroutine initialize1(myrand, myseed, my_rank)

    initialize the randomer, if parallel all procs have different random seeds

    Arguments

    Type IntentOptional AttributesName
    class(randomer), intent(inout) :: myrand
    integer, intent(in) :: myseed
    integer, intent(in) :: my_rank
  • private subroutine initialize2(myrand, myseed)

    initialize the randomer, if parallel all procs has the same random seed

    Arguments

    Type IntentOptional AttributesName
    class(randomer), intent(inout) :: myrand
    integer, intent(in) :: myseed

procedure, public :: randreal

return a random double number

  • private function randreal(myrand)

    return a random double number form 0.0 to 1.0

    Arguments

    Type IntentOptional AttributesName
    class(randomer), intent(inout) :: myrand

    Return Value real(kind=8)

procedure, public :: randInteger

return a random integer

  • private function randInteger(myrand, iMin, iMax)

    return a random double number form iMin to iMax

    Arguments

    Type IntentOptional AttributesName
    class(randomer), intent(inout) :: myrand
    integer, intent(in) :: iMin
    integer, intent(in) :: iMax

    Return Value integer

procedure, public :: get_seed

return the random seed

  • private function get_seed(myrand)

    return the random seed

    Arguments

    Type IntentOptional AttributesName
    class(randomer), intent(inout) :: myrand

    Return Value integer

procedure, public :: get_subseed

return the random seed of this core

  • private function get_subseed(myrand)

    return the random seed of this core

    Arguments

    Type IntentOptional AttributesName
    class(randomer), intent(inout) :: myrand

    Return Value integer