c--
c       read Guinea_pig file
c--
      subroutine getbeam(kpart, vlab, plab3)
      implicit none
      integer kpart, i, init
      real  vlab(3), plab3(4)
      data init/0/

      if(init.eq.0) then
         open(11,FILE='esa.dat',FORM='FORMATTED')
         init = 1
      end if

      open(11,FILE='esa.dat',FORM='FORMATTED')
      read (11, *, err=9999, end=9999) kpart,(plab3(i),i=1,4),
     + (vlab(i),i=1,3)
      return
9999  continue
      close (11)
      end
