      program  ampr_reader_MC3E
c
c Sample read program for AMPR data from MC3E.
c

      integer*4  NR
      parameter (NR=6400)

      integer*2  elev(50,NR)
      integer*4  ntime(11,NR), ner2_time(4,NR), icon(NR)
      real*4  tbs(8,50,NR)
      real*8  er2_nav(18,NR), dplat(50,NR), dplon(50,NR), flnd(3,50,NR)

      integer*4  i, n, nscans
      logical  done

      print*,'   Started'

      open (42, file='mc3e_ampr_2011127_tbs_v01.txt')

      i = 1
      done = .false.
      do while (.not. done)

         read (42, 4201, end=999) n, (ntime(j,i),j=1,3),
     >                 (ner2_time(j,i),j=1,4), icon(i),
     >                 ((tbs(k,j,i),j=1,50),k=1,8),
     >                 (dplat(j,i),j=1,50), (dplon(j,i),j=1,50),
     >                 (er2_nav(j,i),j=1,18),
     >                 ((flnd(k,j,i),j=1,50),k=1,3),
     >                 (elev(j,i),j=1,50)
         i = i + 1
      enddo

  999 close (42)
      nscans = i - 1

 4201 format ( i5, 1x,i4,2(1x,i2), 1x,i3,3(1x,i2), 1x,i3,1x,
     >         400(1x,f6.2), 118(1x,f11.5), 150(1x,f7.5), 50(1x,i5) )


      print*,'   Done'
      stop
      end
