          Program conv

          Real ASize(500),AB(500),AVTL(500),AVTU(500)
          Real lat,Lon,Pres,Size,B,VTL,VTU
          Integer Time0,Time1,Time2,Dt
 
          Open(Unit=10,file='track.tmp',status='unknown')
          Open(Unit=11,file='track.grads',access='direct',
     &         form='unformatted',recl=4,status='unknown')

          Do 10 I=1,500
              ASize(I)=9.999e20
              AB(I)=9.999e20
              AVTL(I)=9.999e20
              AVTU(I)=9.999e20
10        Continue

          IC=0
          Do While (.true.)
              Read(10,*,end=999) Time1,Time2,Lat,Lon,Pres,Size,
     &                           B,VTL,VTU
              Ic=Ic+1
              If (Ic.eq.1) Then
                  Time0=Time2
              Endif
              If (Abs(B).lt.5000.and.Abs(VTL).lt.5000)Then
                AB(IC)=B
                AVTL(IC)=VTL
                AVTU(IC)=VTU
              Endif
              If (Abs(Size).lt.5000) ASize(IC)=Size
          End Do

999       ITotal=IC

          Irec=0
          Do 20 I=1,ITotal
               Irec=Irec+1
               Write(11,rec=irec) ASize(I)
               Irec=Irec+1
               Write(11,rec=irec) AB(I)
               Irec=Irec+1
               Write(11,rec=irec) AVTL(I)
               Irec=Irec+1
               Write(11,rec=irec) AVTU(I)
20        Continue
          End
          


      
