LOGICAL FUNCTION BetweenDates(TestDate,StartDate,EndDate)
! FUNCTION INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN June 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function returns true if the TestDate is between
! (StartDate <= TestDate <= EndDate).
! METHODOLOGY EMPLOYED:
! The input dates are Julian Day format, year is irrelevant.
! Thus, if StartDate > EndDate (i.e. StartDate = 1Dec and EndDate = 31Jan),
! this routine accomodates.
! REFERENCES:
! Adapted from BLAST BTWEEN function.
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: TestDate ! Date to test
INTEGER, INTENT(IN) :: StartDate ! Start date in sequence
INTEGER, INTENT(IN) :: EndDate ! End date in sequence
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
! na
BetweenDates=.false. ! Default case
IF (StartDate <= EndDate) THEN ! Start Date <= End Date
IF (TestDate >= StartDate .and. TestDate <= EndDate) BetweenDates=.true.
ELSE ! EndDate <= StartDate
IF (TestDate <= EndDate .or. TestDate >= StartDate) BetweenDates=.true.
ENDIF
RETURN
END FUNCTION BetweenDates