      subroutine readxs (ngfine,eof)
c
c     this subroutine reads cross section data in REAC format
c
c     ******************************************************************
c
c     input:
c        ngfine   i      number of groups in fine structure
c
c     output:
c        sy       a2     chemical symbol of target
c        iz       i      atomic number of target
c        ia       i      mass number of target
c        isomer   a1     isomeric number of target
c        target   a8     target descriptor
c        nrec     i      number of reactions
c        reac     a4(*)  reaction descriptor
c        prod     a8(*)  product descriptor
c        crossf   r(*,*) fine group cross section values
c
c     ******************************************************************
c
      integer   ngfine
      logical   eof
c
      include   'limit.h'
      include   'target.h'
      include   'unit.h'
      integer   itemp,jtemp
c
c     set end-of-file indicator to false
      eof = .false.
c
c     read cross section title card
      read (iuin,501,end=100) sy,ia,isomer,nrec
      if (nrec .gt. maxrec) go to 80
c
c     get atomic mass
      iz = 0
      call chmchg(sy,iz)
c
c     create target descriptor
      if (ia .lt. 10) then
         write (target,101) sy,ia,isomer
      else if (ia .lt. 100) then
         write (target,102) sy,ia,isomer
      else
         write (target,103) sy,ia,isomer
      endif
c
c     loop over reactions for this target
      do 10 itemp = 1,nrec
c
c        read cross section card
         read (iuin,502,end=90) reac(itemp),prod(itemp),
     1                (crossf(itemp,jtemp),jtemp=1,ngfine)
c
c     end loop over reactions
10    continue
c
c     return
      return
c
c     too many reactions for this isotope
80    write (6,611) sy,ia,isomer,nrec,maxrec
      stop 51
c
c     unexpected end-of-file
90    write (6,612) 
      stop 52
c
c     end-of-file reached 
100   eof = .true.
      return
c
101   format (a2,i1,a1)
102   format (a2,i2,a1)
103   format (a2,i3,a1)
501   format (a2,i3,a1,4x,i10)
502   format (a4,a6,7f10.0 / (8f10.0))
611   format ('  ERROR  too many reactions for target = ',a2,i3,a1,
     1        ',  number = ',i5,' max =',i5)
612   format ('  ERROR  unexpected end-of-file on input cross'
     1        ' section file')
      end
