*
* $Id$
*
* $Log$
* Revision 1.1  1996/03/08 15:21:58  mclareni
* Initial revision
*
*
#include "epio/pilot.h"
#if defined(CERNLIB_ND100B32)
      SUBROUTINE IOREAD(LUNIT,IARR,NBYTE,IRET)
C     ****************************************
C--  NORD 100 32-BIT VERSION
C--  82-04-19  MODIFY JOP
C--  GENERALISE TO MT+DISK:  REPLACE MAGTPZ BY MAGTP
C   READ RECORD FROM FILE
C   LUNIT  = LOGICAL DEVICE NUMBER
C   IARR   = BUFFER ARRAY
C   NBYTE :  ON INPUT,  MAX. NO OF BYTES TO READ  (ALWAYS EVEN !!)
C            ON RETURN: NO. OF BYTES ACTUALLY READ
C   IRET   = RETURN STATUS
      INTEGER*4 LUNIT,IARR(2),NBYTE,IRET,ZERO,IORCNV
       INTEGER*4 NOBYT
      DATA ZERO/0/
C--  NO.BYTES / N100 MACHINE WORD
       NBW=2
       LUN=LUNIT
C-- MAX NO OF WORDS TO READ
       NWMAX=NBYTE/NBW
      MFUNC=0B
C-- IERR = FILE SYSTEM ERROR = ERRCODE
      IERR=MAGTP(MFUNC,IARR,LUN,NWMAX,NWRD)
C--  ' NO SUCH PAGE' = EOF  82/06/04  JOP
       IF(IERR.EQ.18)IERR=3
       NBYTE=NBW*NWRD
       IRET=IERR
      IF(IRET.EQ.ZERO) GOTO 77777
      IRET=IORCNV(IRET)
77777 RETURN
      END
#endif
