C   01/03/80 003061009  MEMBER NAME  DISTRI   (JADESR)      FORTRAN
      SUBROUTINE DISTRI
      IMPLICIT INTEGER*2 (H)
C---
C---    DISTRIBUTES THE CONTENTS OF AN INPUT, UNREFORMATTED TAPE OVER
C---    UP TO FOUR SCRATCH FILES.
C---                                   L.H. O'NEILL, MARCH 1, 1980
C---
      DIMENSION IBUF(1558)
      NREC=0
    1 CONTINUE
      READ(2,ERR=1000,END=2000) IBUF
      NREC=NREC+1
      NUNIT=3
      IF(NREC.GT. 5700) NUNIT=4
      IF(NREC.GT.11400) NUNIT=8
      IF(NREC.GT.17100) NUNIT=9
      WRITE(NUNIT) IBUF
      GO TO 1
 1000 CONTINUE
      WRITE(6,100) NREC
  100 FORMAT(1H1' ****** READ ERROR FROM DISTRI AFTER',I8,' RECORDS.')
      STOP
 2000 CONTINUE
      WRITE(6,101) NREC
  101 FORMAT(1H0,' DISTRI HAS COPIED',I8,' RECORDS.',//)
      IF(NUNIT.LT.4) END FILE 4
      IF(NUNIT.LT.8) END FILE 8
      IF(NUNIT.LT.9) END FILE 9
      RETURN
      END
