      SUBROUTINE JULIUS(MONTH,IDAY,IYEAR,JDAY)
C
C**********************************************************************
C
C   NAME- JULIUS
C
C   LANGUAGE- FORTRAN 77      TYPE- SUBROUTINE    COMPUTER- CRAY
C
C   VERSION- 1.0    DATE- 09/01/82   PROGRAMMER- SANDI ROWE (SMSRC)
C   VERSION- 3.0    DATE- 01/12/96   PROGRAMMER- ALEX POZDNYAK (FDC)
C      MODIFIED TO RUN ON THE CRAY.  REPLACED I*4 WITH INT.
C 
C   FUNCTION- GIVEN THE DATE, MONTH AND DAY THIS ROUTINE RETURNS
C            THE JULIAN DAY.
C
C   CALLING PARAMETERS-
C      VARIABLE                TYPE I/O FUNCTION
C      --------                ---- --- --------
C      MONTH                   INT  I   MONTH OF YEAR(I.E., 1-12).
C      IDAY                    INT  I   DAY OF MONTH(I.E., 1-31).
C      IYEAR                   INT  I   YEAR (I.E., 1901-2399).
C      JDAY                    INT  O   DAY OF YEAR(I.E., 1-366).
C

C REPLACED INTEGER*4 BY INTEGER*8 WHEN PORTING FROM CRAY TO IBM-SP
C       INTEGER*4 MONTH,IDAY,IYEAR,JDAY

       INTEGER*8 MONTH,IDAY,IYEAR,JDAY

C
C   LOCAL PARAMETERS-
C      VARIABLE                TYPE     FUNCTION
C      --------                ----     --------
C      ICD                     INT      HIGH COUNT LOOP CONTROL.
C      ICK                     INT      LOOP CONTROL.
C      IY                      INT      YEAR DIVIDED BY 4.
C      IYR                     INT      CHECK FOR LEAP YEAR.
C      MUN(12)                 INT      DAYS PER MONTH TABLE.
C
C   SUBPROGRAMS CALLED-  NONE
C
C   EXIT STATES-  NONE
C
C**********************************************************************
C
      INTEGER   MUN(12),ICK,ICD,IY,IYR
C 
      DATA MUN/31,28,31,30,31,30,31,31,30,31,30,31/
      JDAY = 0
C     TEST FOR LEAP YEAR.
      IY = IYEAR / 4
      IYR = IY * 4
C  IF IT IS A LEAP YEAR CHANGE THE FEBRUARY DAY COUNT TO 29.
      IF(IYR.EQ.IYEAR) THEN
           MUN(2) = 29
      ELSE
           MUN(2) = 28
      ENDIF
C     COMPUTE THE JULIAN DAY.
      ICD = MONTH - 1
      IF(ICD.EQ.0)JDAY = IDAY
      IF(ICD.EQ.0) GO TO 20
      DO 10 ICK = 1,ICD
      JDAY = JDAY + MUN(ICK)
   10 CONTINUE
      JDAY = JDAY + IDAY
   20 CONTINUE
      RETURN
      END
