C
C	SUBROUTINE  LOKERR
C
C	FUNCTION : TO CHECK THE RETURNED FUNCTION CODE AFTER THE LOOKUP
C		   HAS BEEN PERFORMED AND TO REPORT ALL POSSIBLE ERRORS .
C
C		  ON ERROR THE PROGRAM CAN GENERATE A DIVIDE BY ZERO TO 
C	   	  GIVE A TRACE BACK .
C
C
C
C	AUTHOR:	G. GUELFI	1-APRIL-1985
C
C
C	CALL IS
C
C	SUBROUTINE LOKERR(ICODE,ILOK,NUM)
C
C		WHERE
C
C			ICODE	 IS LOOKUP FUNCTION VALUE
C			ILOK	 CAN CONTAIN ERROR VALUE TO BE IGNORD
C				 AND ITS RETURNS VALUE OF ICODE
C			NUM	 IS VALUE TO GENERATE TRACE BACK
C
C				IF NUM = 0 THEN TRACE BACK
C				IF NUM = 1 ONLY REPORT ERROR
C
	SUBROUTINE LOKERR(ICODE,ILOK,NUM)
C
C
C	ERROR MESSAGES FOR LOOKUP
C
	IF (ICODE.GE.0.OR.ICODE.EQ.ILOK) GOTO 100

	TYPE *,ICODE,'  LOOKUP ERROR'
D	IF (ICODE.EQ.-1) TYPE *,'SPEC CHAN ALREADY IN USE'
D	IF (ICODE.EQ.-2) TYPE *,'FILE NOT FOUND'
D	IF (ICODE.EQ.-3) TYPE *,'DEVICE IN USE'
D	IF (ICODE.EQ.-4) TYPE *,'TAPE NOT AVAIL'
	R = 1./NUM
100	ILOK = ICODE
	RETURN
	END
