      subroutine whead (ngcoar,outfor)
c
c     this subroutine writes header card for file
c
      character*8 outfor
      integer     ngcoar
c
      include     'limit.h'
      include     'header.h'
      include     'racc.h'
      include     'unit.h'
      integer     itemp,jtemp,n13
c
c     write FISPACT header
      if (outfor .eq. 'FISPACT')then
         write (iuot,601) title
         write (iuot,602) niso
         write (iuot,603) sumrec
      endif
c
c     write RACC header
      if (outfor .eq. 'RACC') then
         write (iuot,610) 
         write (iuot,611) title(1:55)
         write (iuot,612) niso,nzmin,nzmax,maxr,ngcoar
         write (iuot,613)
         n13 = min0(13,maxr)
         do 10 itemp = 1,niso
            write (iuot,614) syr(itemp),nz(itemp),jza(itemp),nrc(itemp),
     1                      (nrtyp(itemp,jtemp),hrtyp(itemp,jtemp),
     2                      jtemp=1,n13)
            write (iuot,615)(nrtyp(itemp,jtemp),hrtyp(itemp,jtemp),
     2                      jtemp=14,maxr)
10       continue
         write (iuot,616)
      endif
c
c     write REAC header
      if (outfor .eq. 'REAC') write (iuot,621) title(1:55),ipar,ngcoar
c
c     return
      return
c
c
601   format (80(1h*) / '* collapsed library ',59x,1h* /
     1        80(1h*) / '  collapsed from' / a //)
602   format (/ ' number of isotopes = ',i5)
603   format (/ ' number of reactions = ',i5 //// 80(1h#) )
610   format ('*start')
611   format ('collapsed from ',a55,2i5)
612   format ('Control Integers    ',5i6)
613   format ('... XLIB 1 ... Isotopes ID, ',
     1        'No of Reactions & reaction modes')
614   format (a6,i4,i8,i3,2x,13(i3,a5))
615   format (23x,13(i3,a5))
616   format ('... XLIB 2 ... Multigroup Neutron Cross Sections')
621   format ('collapsed from ',a55,2i5)
      end
