Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=r64), | intent(in) | :: | a | |||
real(kind=r64), | intent(in) | :: | b | |||
real(kind=r64), | intent(in) | :: | tolF | |||
real(kind=r64), | optional | :: | tolAbs |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
LOGICAL FUNCTION FEQX(a, b, tolF, tolAbs)
!
! FUNCTION INFORMATION:
! AUTHOR <unknown>, ASHRAE 1311-RP
! DATE WRITTEN unknown
! MODIFIED na
! RE-ENGINEERED na
!
! PURPOSE OF THIS FUNCTION:
! Returns true if the difference between two real numbers is within the
! tolerance limit specified.
!
! METHODOLOGY EMPLOYED:
! na
!
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
REAL(r64), INTENT(IN) :: a, b, tolF ! values to compare, fractional tolerance
REAL(r64), OPTIONAL :: tolAbs ! absolute tolerance
!
! FUNCTION PARAMETER DEFINITIONS:
! na
!
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
REAL(r64) :: d
REAL(r64) :: tolAbsX
! Flow
IF (PRESENT( tolAbs)) THEN
tolAbsX = MAX( tolAbs, 1.d-10)
ELSE
tolAbsX = 1.d-10
END IF
d = ABS( a - b);
IF (d < tolAbsX) THEN
FEQX = .TRUE.
ELSE
FEQX = (2.d0 * d / (ABS( a) + ABS( b))) < tolF
END IF
RETURN
END FUNCTION FEQX