1D Exponential distribution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=rk), | intent(in) | :: | x |
random variable |
||
real(kind=rk), | intent(in), | optional | :: | x0 |
mean value |
|
real(kind=rk), | intent(in), | optional | :: | n0 |
initial number of particles |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=rk), | public | :: | x0_ | ||||
real(kind=rk), | public | :: | n0_ |
elemental real(rk) function expo1d(x, x0, n0) result(res) !! 1D Exponential distribution. real(rk), intent(in) :: x !! random variable real(rk), intent(in), optional :: x0 !! mean value real(rk), intent(in), optional :: n0 !! initial number of particles real(rk) :: x0_, n0_ x0_ = optval(x0, ONE) n0_ = optval(n0, ONE) res = (n0_/x0_)*exp(-x/x0_) end function expo1d