Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | prob1 | |||
real(kind=dp), | intent(in) | :: | prob2 | |||
real(kind=dp), | intent(in) | :: | bVal |
function calcStayingProb(prob1, prob2, bVal) result(ret)
! calculate the probability to stay on a certain excitation branch
real(dp), intent(in) :: prob1, prob2, bVal
real(dp) :: ret, tmp
character(*), parameter :: this_routine = "calcStayingProb"
ASSERT(prob1 >= 0.0_dp)
ASSERT(prob2 >= 0.0_dp)
ASSERT(bVal >= 0.0_dp)
! if b == 0 its stupid to use it..
tmp = max(bVal, 1.0_dp)
ret = tmp * prob1 / (tmp * prob1 + prob2)
end function calcStayingProb