weibullrnd Function

function weibullrnd(shape, scale) result(ans)

Arguments

Type IntentOptional Attributes Name
real(kind=8) :: shape
real(kind=8) :: scale

Return Value real(kind=8)


Calls

proc~~weibullrnd~~CallsGraph proc~weibullrnd weibullrnd mersenne mersenne proc~weibullrnd->mersenne

Source Code

function weibullrnd(shape,scale) result(ans)
  real(8) :: shape,scale,temp,ans
  if (shape <= 0d0) then
     write(*,*) "WEIBULLRND: Shape parameter must be positive"
  end if
  if (scale <= 0d0) then
     write(*,*) "WEIBULLRND: Scale parameter must be positive"
  end if
  ans= scale * (-log(mersenne()))**(1.d0/shape)
end function weibullrnd