      SUBROUTINE CALENDAR(TIME,IYEAR,IDAY,IHOUR)
C 
C CONVERT DOUBLE PRECISION DECIMAL YEAR INTO INTEGER YEAR, DAY AND HOUR 
C

      REAL*8 TIME,DYEAR,LEAP
C
      IYEAR = INT(TIME)
      DYEAR = DBLE(IYEAR)
      LEAP = DBLE(DAYS(TIME))
      DDAY = REAL((TIME-DYEAR)*LEAP) + 1.
      IDAY = INT(DDAY)
      DHOUR = (DDAY-REAL(IDAY))*24.
      IHOUR = INT(DHOUR)
      DMIN = DHOUR - REAL(IHOUR)
      IF (DMIN.GT.0.8) IHOUR = IHOUR + 1
C
      IF (IHOUR.EQ.24) THEN
       IDAY = IDAY + 1
       IHOUR = 0
      END IF
C
      ILEAP = INT(LEAP)
      IF (IDAY.GT.ILEAP) THEN
       IYEAR = IYEAR + 1
       IDAY = IDAY - ILEAP
      END IF
C
      RETURN
      END
