get_forced_zero_double Function

public function get_forced_zero_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

    function get_forced_zero_double(negSwitches, posSwitches, bVal, double) &
        result(zeroWeight)
        real(dp), intent(in) :: posSwitches, negSwitches, bVal
        type(WeightData_t), intent(in) :: double
        real(dp) :: zeroWeight

        ! remove the order(1) branch as we want to switch at the end!
        if (near_zero(bVal)) then
            zeroWeight = negSwitches * double%G + posSwitches * double%F
        else
            zeroWeight = 1.0_dp / bVal * (negSwitches * double%G + posSwitches * double%F)
        end if

    end function get_forced_zero_double