      SUBROUTINE STKOUNT (NF,KOUNT,DELT,IDAY,NDAYS,NSECS) 
C
C     * MAR 19/97 - M.LAZARE. ROUTINE NOW SEARCHES FOR "4H SNO" TO
C     *                       AVOID USING ONCE-DAILY FIELDS (I.E
C     *                       STMX/STMN) TO DETERMINE KOUNT.  
C     * JAN 12/94 - M.LAZARE. REPLACE CALL TO FUNCTION "INT" BY
C     *                       CALL TO FUNCTION "NINT" TO AVOID
C     *                       TRUNCATION TO WRONG ANSWER FOR "IDAY". 
C     * JUL 26/92 - M.LAZARE. REPLACEMENT OF UNFORMATTED READ BY CALL
C     *                       TO FBUFFIN.  
C     * AUTHOR : STEPHANE GOYETTE 
C     * DATE WRITTEN : JULY 7 1989. 
C 
C     * THIS SUBROUTINE SET KOUNT AND IDAY TO THE FIRST 
C     * TIMESTEP AND JULIAN DAY SAVED IN A PREVIOUS G.C.M.
C     * RUN AS WELL AS THE INTEGER VALUE OF GREENWICH TIME
C     * OF THIS DAY IN SECONDS (NSECS) AND THE ACTUAL NUMBER OF DAYS RUN
C     * IN THE SIMULATION (NDAYS).
C 
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)

      COMMON /ICOM /IBUF(8),IDAT(1) 
C ----------------------------------------------------------------------
      REWIND NF 
  130 CALL FBUFFIN(NF,IBUF,-8,K,LEN)
      IF(K.GE.0) GO TO 150  
      IF(IBUF(3).NE.NC4TO8(" SNO")) GO TO 130
      KOUNT = IBUF(2) 
      IDAYO = IDAY
      FKOUNT= FLOAT(KOUNT)
      DAYS  = FKOUNT*DELT/86400.
      IDELT = NINT(DELT) 
      NSECS = MOD((KOUNT*IDELT),86400)
      IDAY  = NINT(DAYS) + IDAYO 
      IDAY  = MOD(IDAY,365) 
      IF(IDAY.EQ.0) IDAY=365
      NDAYS = IDAY-1
      WRITE(6,6010) KOUNT,IDAY
      RETURN
  150 CALL XIT('STKOUNT',-1)
C ----------------------------------------------------------------------
 6010 FORMAT(1X,' FOR THIS FIZ RUN, INITIAL KOUNT HAS BEEN SET',/,
     1       1X,' TO :',I10,'            AND IDAY TO :',I5) 
      END 
