INTEGER FUNCTION JulianDay (Month,Day,LeapYearValue)
! FUNCTION INFORMATION:
! AUTHOR Linda K. Lawrie
! DATE WRITTEN September 1997
! MODIFIED na
! RE-ENGINEERED from JDAYF in BLAST/IBLAST
! PURPOSE OF THIS SUBROUTINE:
! This subroutine returns the appropriate Julian Day value for the input
! Month and Day.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: Month ! Month, 1..12
INTEGER, INTENT(IN) :: Day ! Day of Month, not validated by month
INTEGER, INTENT(IN) :: LeapYearValue ! 1 if leap year indicated, 0 if not
! na
! SUBROUTINE PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER, DIMENSION(12) :: EndDayofMonth = (/31,59,90,120,151,181,212,243,273,304,334,365/)
! End day numbers of each month (without Leap Year)
!
SELECT CASE (Month)
CASE(1)
! CASE 1: JANUARY
JulianDay = Day
CASE(2)
! CASE 2: FEBRUARY
JulianDay = Day + EndDayofMonth(1)
CASE(3:12)
! CASE 3: REMAINING MONTHS
JulianDay= Day + EndDayofMonth(Month-1) + LeapYearValue
CASE DEFAULT
JulianDay=0
END SELECT
RETURN
END FUNCTION JulianDay