is_equal Interface

public interface is_equal

The is equal interface is used to circumvent the fact that Fortran, rightfully, complains about comparing two reals without involving a tolerance, i.e. if(a == b) since there is no guarantee that the two reals are exactly equal due to floating point precision issues. The functions are defined as elemental

Usage: if (is_equal(a, b)) then where a and b are real numbers, and the function will return true if they are equal within the tolerance defined in pic_global_definitions.

Calls

interface~~is_equal~~CallsGraph interface~is_equal is_equal proc~is_equal_dp is_equal_dp interface~is_equal->proc~is_equal_dp proc~is_equal_sp is_equal_sp interface~is_equal->proc~is_equal_sp

Module Procedures

private elemental function is_equal_sp(a, b) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=sp), intent(in) :: a
real(kind=sp), intent(in) :: b

Return Value logical

private elemental function is_equal_dp(a, b) result(res)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: a
real(kind=dp), intent(in) :: b

Return Value logical