random_Weibull Function

public function random_Weibull(a) result(fn_val)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: a

Return Value real


Contents

Source Code


Source Code

FUNCTION random_Weibull(a) RESULT(fn_val)

!     Generates a random variate from the Weibull distribution with
!     probability density:
!                      a
!               a-1  -x
!     f(x) = a.x    e

REAL, INTENT(IN) :: a
REAL             :: fn_val

!     For speed, there is no checking that a is not zero or very small.

fn_val = random_exponential() ** (one/a)
RETURN

END FUNCTION random_Weibull