LOGICAL FUNCTION IntegerIsWithinTwoValues(ValueToCheck, LowerBound, UpperBound) RESULT(ValueIsBetween)
! FUNCTION INFORMATION:
! AUTHOR Edwin Lee
! DATE WRITTEN September 2010
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! Provides a clean way to quickly check if an integer is within two values
! METHODOLOGY EMPLOYED:
! TRUE if ValueToCheck = [LowerBound, UpperBound]
! in other words, it returns true if ValueToCheck=LowerBound, or if ValueToCheck=UpperBound
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: ValueToCheck
INTEGER, INTENT(IN) :: LowerBound
INTEGER, INTENT(IN) :: UpperBound
ValueIsBetween = (ValueToCheck.GE.LowerBound).AND.(ValueToCheck.LE.UpperBound)
RETURN
END FUNCTION IntegerIsWithinTwoValues