     CHARACTER*25 STID
     OPEN (25,NAME='./INPUT/Out4Crt_sta.txt')
     OPEN (10,NAME='T_test.dat',FORM='UNFORMATTED',RECORDTYPE='STREAM')
10   READ (25,*,END=90) IYEAR,IMONTH,STID,RLON,RLAT,RVAL
     WRITE (*,9000) IYEAR,IMONTH,STID,RLAT,RLON,RVAL
9000 FORMAT (I4,X,I2,X,A3,3F6.1)
     IF (IFLAG.EQ.0) THEN
       IFLAG = 1
       IYROLD = IYEAR
       IMNOLD = IMONTH
     ENDIF
       IF (IYROLD.NE.IYEAR.OR.IMNOLD.NE.IMONTH) THEN
         NLEV = 0
         WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
       ENDIF
       IYROLD = IYEAR
       IMNOLD = IMONTH
       TIM = 0.0
       NLEV = 1
       NFLAG = 1
       WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
       WRITE (10) RVAL
       GO TO 10
  90   CONTINUE
       NLEV = 0
       WRITE (10) STID,RLAT,RLON,TIM,NLEV,NFLAG
       STOP
       END
