This function returns .true. if the given pair of values agree with each other in the given precision (order), or .false. otherwise.
LOGICAL(bool) FUNCTION isNearlyEqual(cmp, compared, precision)
REAL, intent(in) :: cmp, compared ! or INTEGER
INTEGER, intent(in) :: precision
END FUNCTION isNearlyEqual
For the pair of the first two arguments, any combination of int8, int16, int32, single and double is allowed.