      program dcomp
c
c     Reads .AVG file and plots delays
c
      character data*80
      real*4 hours(10000),delay(10000)
      integer*4 isymb(10000)
c
   10 write(6,'(a,$)')' Enter .AVG filename: '
      read(5,1)data
    1 format(a80)
      open(1,file=data,status='old',err=10)
      call pgbegin(0,'?',1,1)
      xmin=8.
      xmax=8.
      ymin=0.
      ymax=0.
      do i=1,10000
      READ (1,1000,END=900,ERR=900) IMON, IDAY, IYEAR, HOURS(i), ISTAR,
     $           DELAY(i), ISCAN, IBASE, SIGMA, NPTS
 1000 FORMAT (I2, 1X, I2.2, 1X, I2.2, F12.9, I5, F18.4, 1X, I5,
     $        I2, 1X, F7.2, I5 )
      delay(i)=delay(i)/1000000.
      if(npts.eq.200)then
       isymb(i)=-1
      else
       isymb(i)=1
      endif
      xmin=min(xmin,hours(i))
      xmax=max(xmax,hours(i))
      ymin=min(ymin,delay(i))
      ymax=max(ymax,delay(i))
      enddo
c
  900 n=i-1
      call pgenv(xmin,xmax,ymin,ymax,0,1)
      do i=1,n
       call pgpoint(1,hours(i),delay(i),isymb(i))
      enddo
      call pglabel('UT','delay [m]',
     & 'Predicted and observed delays on 920815')
      call pgend
      end

