      subroutine RECPAK(RECNUM,INPUT,LENGTH)
      include 'SIZE.INC'
      include 'UNITS.INC'
      integer RECNUM,LENGTH,BUFFER(VARIEC),L,I
      integer INPUT(LENGTH)
      L = 1
      BUFFER(1) = LENGTH
      do 100 I = 1, LENGTH
         L = L+1
         if (L.gt.VARIEC) then
         RECNUM = RECNUM+1
         write (RANUNT(MACHNO),rec=RECNUM) BUFFER
            L = 1
         endif
         BUFFER(L) = INPUT(I)
100   continue
      RECNUM = RECNUM+1
      write (RANUNT(MACHNO),rec=RECNUM) BUFFER
      return
      end
