      SUBROUTINE HOURS (KYR,KMO,KDAY,NHRS)
C
C DIMENSION OF           NONE
C ARGUMENTS
C
C LATEST REVISION        JANUARY 1985
C
C PURPOSE                GIVEN THE YEAR, MONTH AND DAY OF MONTH, THIS
C                        ROUTINE COMPUTES THE NUMBER OF HOURS UP TO
C                        THIS DAY AFTER 1920.
C
C                        BY MAKING TWO CALLS, THIS ROUTINE CAN BE USED
C                        TO FIND THE NUMBER OF HOURS BETWEEN TWO DATES.
C
C                        USE PACKAGE DATE FOR THE REVERSE PROCEDURE.
C
C USAGE                  CALL HOURS (KYR,KMO,KDAY,NHRS)
C
C ARGUMENTS
C
C ON INPUT               KYR
C                          YEAR (4 DIGITS, EG. 1962).
C
C                        KMO
C                          MONTH.
C
C                        KDAY
C                          DAY OF THE MONTH.
C
C ON OUTPUT              NHRS
C                          NUMBER OF HOURS UP TO THIS DAY AFTER 1920.
C
C SPECIAL CONDITIONS     .  WORKS FOR THE PERIOD 1921 TO 2100.
C                        .  FORTRAN STANDARD DATA STATEMENT LOADS THE
C                           ARRAY MO.
C
C I/O                    NONE
C
C PRECISION              SINGLE
C
C REQUIRED LIBRARY       Q8QST4, WHICH IS LOADED BY DEFAULT ON NCAR'S
C ROUTINES               CRAY MACHINES.
C
C LANGUAGE               FORTRAN
C
C HISTORY                WRITTEN BY ROY JENNE AT NCAR IN JANUARY 1966.
C
C PORTABILITY            FORTRAN 66
C ********************************************************************
      DIMENSION       MO(11)
      DATA MO(1),MO(2),MO(3),MO(4),MO(5),MO(6),MO(7),MO(8),MO(9),MO(10),
     *MO(11) /31,59,90,120,151,181,212,243,273,304,334/
      KYRF = KYR-1921
C
C DAYS UP TO THIS YR. MUST HAVE FIXED PT TRUNCATION OF KYRF/4
C
      LDAY = KYRF*365+KYRF/4
      IF (KMO .EQ. 1) GO TO 102
      IF (KMO .EQ. 2) GO TO 101
      IF (((KYR/4)*4-KYR) .NE. 0) GO TO 101
C
C COUNT DAY OF 29 FEB THIS YEAR
C
      LDAY = LDAY+1
  101 LDAY = LDAY+MO(KMO-1)
C
C NOW GET HOURS UP TO THIS DAY OF THIS MONTH
C
  102 NHRS = 24*(LDAY+KDAY-1)
      RETURN
C
C REVISION HISTORY---
C
C JANUARY 1978     DELETED REFERENCES TO THE  *COSY  CARDS AND
C                  ADDED REVISION HISTORY
C-----------------------------------------------------------------------
      END
