expo1d Function

public elemental function expo1d(x, x0, n0) result(res)

1D Exponential distribution.

Arguments

Type IntentOptional 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

Return Value real(kind=rk)


Calls

proc~~expo1d~~CallsGraph proc~expo1d expo1d optval optval proc~expo1d->optval

Variables

Type Visibility Attributes Name Initial
real(kind=rk), public :: x0_
real(kind=rk), public :: n0_

Source Code

   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