random

Module

Description

this module contains a motley collection of random number

generator routines, used in various particle setups

References:

None

Owner:

Daniel Price

Runtime parameters:

None

Dependencies:

sortutils

Quick access

Routines:

divide_unit_seg(), gauss_random(), get_gaussian_pos_on_sphere(), get_random(), get_random_pos_on_sphere(), ran2(), rayleigh_deviate(), rinsphere(), ronsphere()

Variables

  • random/pi [real,private/parameter/optional/default=4.*atan(1.)]

Subroutines and functions

function  random/ran2(s1)
Parameters:

s1 [integer,inout]

Return:

ran2 [real]

Called from:

rayleigh_deviate(), get_random_pos_on_sphere(), get_gaussian_pos_on_sphere(), gauss_random(), divide_unit_seg(), rinsphere(), ronsphere(), optimal_rot_angles(), test_neigh()

Call to:

get_random()

function  random/get_random(s1, s2)
Parameters:
  • s1 [integer]

  • s2 [integer]

Return:

get_random [real]

Called from:

ran2()

function  random/rayleigh_deviate(iseed)
Parameters:

iseed [integer]

Return:

rayleigh_deviate [real]

Call to:

ran2()

function  random/get_random_pos_on_sphere(iseed)
Parameters:

iseed [integer,inout]

Return:

dx (3) [real]

Call to:

ran2()

function  random/get_gaussian_pos_on_sphere(iseed, deltheta)
Parameters:
  • iseed [integer,inout]

  • deltheta [real,in]

Return:

dx (3) [real]

Call to:

ran2(), gauss_random()

function  random/gauss_random(iseed)
Parameters:

iseed [integer,inout]

Return:

gauss_random [real]

Called from:

get_gaussian_pos_on_sphere()

Call to:

ran2()

subroutine  random/divide_unit_seg(lengths, mindist, nlengths, iseed)
Parameters:
  • lengths (nlengths) [real,inout]

  • mindist [real,inout] :: we’ll have stars less massive than 0.08 solarmasses but it will assure to never brick the sim…

  • nlengths [integer,in,]

  • iseed [integer,inout]

Use :

sortutils (indexx())

Call to:

ran2()

subroutine  random/rinsphere(x, iseed)
Parameters:
  • x (3) [real,out]

  • iseed [integer,inout]

Call to:

ran2()

subroutine  random/ronsphere(x, iseed)
Parameters:
  • x (3) [real,out]

  • iseed [integer,inout]

Call to:

ran2()