derf_count Function

private pure function derf_count(k, r, r0) result(count)

Derivative of the counting function w.r.t. the distance.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: k

Steepness of the counting function.

real(kind=wp), intent(in) :: r

Current distance.

real(kind=wp), intent(in) :: r0

Cutoff radius.

Return Value real(kind=wp)


Source Code

pure function derf_count(k, r, r0) result(count)

   !> Steepness of the counting function.
   real(wp), intent(in) :: k

   !> Current distance.
   real(wp), intent(in) :: r

   !> Cutoff radius.
   real(wp), intent(in) :: r0

   real(wp), parameter :: sqrtpi = sqrt(pi)

   real(wp) :: count

   count = -k/sqrtpi/r0*exp(-k**2*(r-r0)**2/r0**2)

end function derf_count