*
* $Id$
*
* $Log$
* Revision 1.1  1996/02/15 17:47:36  mclareni
* Initial revision
*
*
#include "kernbit/pilot.h"
      SUBROUTINE ERRLOG (LUN,REC,MAXN,IERR,N,LERR,NBYTE,
     1                   IOERR,NBLOCK,IBLOCK,ITOFW,IRECNO,NWORD,
     2                   ITYPE,IBIT,IBEGIN,ICOUNT,SKIP,NEXTW,
     3                   SEVSIX,IWORDS)
      REAL * 8 REC (*)
      LOGICAL * 1 SKIP,SEVSIX
      IF (LERR .LT. 0) RETURN
      IF (LERR .EQ. 0) THEN
         WRITE (*,100) LUN,MAXN,LERR,IERR,NBYTE,N
         WRITE (*,101) IOERR,NBLOCK,IBLOCK
         WRITE (*,102) IRECNO,ITOFW,NWORD
         WRITE (*,103) SKIP,NEXTW,ITYPE,IBIT,IBEGIN,ICOUNT
         WRITE (*,106) SEVSIX,IWORDS
         IF (NWORD .NE. 0) WRITE (*,105)
         DO 1 J=1,NWORD,5
 1       WRITE (*,104) J,(REC(I),I=J,J+4)
      ELSE
         WRITE (LERR,100) LUN,MAXN,LERR,IERR,NBYTE,N
         WRITE (LERR,101) IOERR,NBLOCK,IBLOCK
         WRITE (LERR,102) IRECNO,ITOFW,NWORD
         WRITE (LERR,103) SKIP,NEXTW,ITYPE,IBIT,IBEGIN,ICOUNT
         WRITE (*,106) SEVSIX,IWORDS
         IF (NWORD .NE. 0) WRITE (LERR,105)
         DO 2 J=1,NWORD,5
 2       WRITE (LERR,104) J,(REC(I),I=J,J+4)
      ENDIF
      RETURN
 100  FORMAT(/,' READWI CALLED WITH LUN = ',I5,' MAXN = ',I10,
     1' LERR = ',I5,' REPORTS',/,' ERROR NO ',I5,
     2' BYTES READ = ',I10,' WORDS RETURNED = ',I10)
 101  FORMAT(/,' IOERR = ',I5,' NBLOCK = ',I10,' IBLOCK = ',I10)
 102  FORMAT(' IRECNO = ',I10,' ITOFIRSTW = ',I10,' NWORDS = ',I10)
 103  FORMAT(' SKIPPING WAS ',L3,' NEXTW = ',I10,' RECORD TYPE ',I5,
     1' NORMAL, DELETED, EOP, EOS 0-3',/,' RECORD PORTION ',I5,
     2' COMPLETE, FIRST, MIDDLE, LAST 0-3 ','IBEGIN = ',I10,
     3' ICOUNT = ',I10)
 104  FORMAT(I10,5Z20)
 105  FORMAT(//)
 106  FORMAT(' SEVSIX WAS ',L3,' IWORDS ',I10)
      END
