getZero_double Function

private function getZero_double(negSwitches, posSwitches, bVal, double) result(zeroWeight)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: negSwitches
real(kind=dp), intent(in) :: posSwitches
real(kind=dp), intent(in) :: bVal
type(WeightData_t), intent(in) :: double

Return Value real(kind=dp)


Contents

Source Code


Source Code

    function getZero_double(negSwitches, posSwitches, bVal, double) &
        result(zeroWeight)
        real(dp), intent(in) :: posSwitches, negSwitches, bVal
        type(WeightData_t), intent(in) :: double
        real(dp) :: zeroWeight
        character(*), parameter :: this_routine = "getZero_double"
        ASSERT(negSwitches >= 0.0_dp)
        ASSERT(posSwitches >= 0.0_dp)

        ! UPDATE: cant set it to one, because there are cases, when a 0
        ! branch comes to a 2 in a double excitation, where one has to
        ! compare against the -2 branch, which can also be non-zero
        ! so to have the correct weights, just ignore b
        zeroWeight = 1.0_dp + &
                     (negSwitches * double%G + posSwitches * double%F) / max(1.0_dp, bVal)

        ASSERT(zeroWeight >= 0.0_dp)
    end function getZero_double