	program stn
cdgd      CHARACTER*4 STID
      character*8 stid

      OPEN (8,file='senclim1.txt',form='formatted')
      OPEN(10,file='senclim.ch',FORM='UNFORMATTED',
     &      access='sequential')

      IFLAG = 0
C Read and Write
10    READ (8,9000,END=90)IYEAR,IMONTH,STID,RLAT,RLON,RVAL
      write(*,9000)IYEAR,IMONTH,STID,RLAT,RLON,RVAL

9000  FORMAT(I4,3x,i2,1x,A5,1x,F8.2,1x,F8.2,1x,F8.1)
      IF (IFLAG.EQ.0) THEN
        IFLAG = 1
        IYROLD =IYEAR
        IMNOLD = IMONTH
      ENDIF
C If new time group, write time group terminator.
C  Assuming no empty time groups.
      IF(IYROLD.NE.IYEAR.OR.IMNOLD.NE.IMONTH) THEN
        NLEV = 0
        WRITE (10)STID,RLAT,RLON,TIM,NLEV,NFLAG
        WRITE (*,*)STID,RLAT,RLON,TIM,NLEV,NFLAG
      ENDIF
      IYROLD = IYEAR
      IMNOLD =IMONTH
C
C  Write this report
C
      TIM = 0.0
      NLEV = 1
      NFLAG = 1
      WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
      WRITE (*,*) STID,RLAT,RLON,TIM,NLEV,NFLAG
      WRITE (10) RVAL
      GO TO 10
C
C  On end of file write last time group terminator.
C
90    CONTINUE
      NLEV = 0
      WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
      WRITE (*,*) STID,RLAT,RLON,TIM,NLEV,NFLAG
      STOP
      END
