Merge branch 'master' of https://git.cern.ch/reps/AliRoot
[u/mrichter/AliRoot.git] / MICROCERN / kerset.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
fe4da5cc 4#include "kernnum/pilot.h"
5 SUBROUTINE KERSET(ERCODE,LGFILE,LIMITM,LIMITR)
6 PARAMETER(KOUNTE = 27)
7 CHARACTER*6 ERCODE, CODE(KOUNTE)
8 LOGICAL MFLAG, RFLAG
9 INTEGER KNTM(KOUNTE), KNTR(KOUNTE)
10 DATA LOGF / 0 /
11 DATA CODE(1), KNTM(1), KNTR(1) / 'C204.1', 255, 255 /
12 DATA CODE(2), KNTM(2), KNTR(2) / 'C204.2', 255, 255 /
13 DATA CODE(3), KNTM(3), KNTR(3) / 'C204.3', 255, 255 /
14 DATA CODE(4), KNTM(4), KNTR(4) / 'C205.1', 255, 255 /
15 DATA CODE(5), KNTM(5), KNTR(5) / 'C205.2', 255, 255 /
16 DATA CODE(6), KNTM(6), KNTR(6) / 'C305.1', 255, 255 /
17 DATA CODE(7), KNTM(7), KNTR(7) / 'C308.1', 255, 255 /
18 DATA CODE(8), KNTM(8), KNTR(8) / 'C312.1', 255, 255 /
19 DATA CODE(9), KNTM(9), KNTR(9) / 'C313.1', 255, 255 /
20 DATA CODE(10),KNTM(10),KNTR(10) / 'C336.1', 255, 255 /
21 DATA CODE(11),KNTM(11),KNTR(11) / 'C337.1', 255, 255 /
22 DATA CODE(12),KNTM(12),KNTR(12) / 'C341.1', 255, 255 /
23 DATA CODE(13),KNTM(13),KNTR(13) / 'D103.1', 255, 255 /
24 DATA CODE(14),KNTM(14),KNTR(14) / 'D106.1', 255, 255 /
25 DATA CODE(15),KNTM(15),KNTR(15) / 'D209.1', 255, 255 /
26 DATA CODE(16),KNTM(16),KNTR(16) / 'D509.1', 255, 255 /
27 DATA CODE(17),KNTM(17),KNTR(17) / 'E100.1', 255, 255 /
28 DATA CODE(18),KNTM(18),KNTR(18) / 'E104.1', 255, 255 /
29 DATA CODE(19),KNTM(19),KNTR(19) / 'E105.1', 255, 255 /
30 DATA CODE(20),KNTM(20),KNTR(20) / 'E208.1', 255, 255 /
31 DATA CODE(21),KNTM(21),KNTR(21) / 'E208.2', 255, 255 /
32 DATA CODE(22),KNTM(22),KNTR(22) / 'F010.1', 255, 0 /
33 DATA CODE(23),KNTM(23),KNTR(23) / 'F011.1', 255, 0 /
34 DATA CODE(24),KNTM(24),KNTR(24) / 'F012.1', 255, 0 /
35 DATA CODE(25),KNTM(25),KNTR(25) / 'F406.1', 255, 0 /
36 DATA CODE(26),KNTM(26),KNTR(26) / 'G100.1', 255, 255 /
37 DATA CODE(27),KNTM(27),KNTR(27) / 'G100.2', 255, 255 /
38 LOGF = LGFILE
39 L = 0
40 IF(ERCODE .NE. ' ') THEN
41 DO 10 L = 1, 6
42 IF(ERCODE(1:L) .EQ. ERCODE) GOTO 12
43 10 CONTINUE
44 12 CONTINUE
45 ENDIF
46 DO 14 I = 1, KOUNTE
47 IF(L .EQ. 0) GOTO 13
48 IF(CODE(I)(1:L) .NE. ERCODE(1:L)) GOTO 14
49 13 IF(LIMITM.GE.0) KNTM(I) = LIMITM
50 IF(LIMITR.GE.0) KNTR(I) = LIMITR
51 14 CONTINUE
52 RETURN
53 ENTRY KERMTR(ERCODE,LOG,MFLAG,RFLAG)
54 LOG = LOGF
55 DO 20 I = 1, KOUNTE
56 IF(ERCODE .EQ. CODE(I)) GOTO 21
57 20 CONTINUE
58 WRITE(*,1000) ERCODE
59 CALL ABEND
60 RETURN
61 21 RFLAG = KNTR(I) .GE. 1
62 IF(RFLAG .AND. (KNTR(I) .LT. 255)) KNTR(I) = KNTR(I) - 1
63 MFLAG = KNTM(I) .GE. 1
64 IF(MFLAG .AND. (KNTM(I) .LT. 255)) KNTM(I) = KNTM(I) - 1
65 IF(.NOT. RFLAG) THEN
66 IF(LOGF .LT. 1) THEN
67 WRITE(*,1001) CODE(I)
68 ELSE
69 WRITE(LOGF,1001) CODE(I)
70 ENDIF
71 ENDIF
72 IF(MFLAG .AND. RFLAG) THEN
73 IF(LOGF .LT. 1) THEN
74 WRITE(*,1002) CODE(I)
75 ELSE
76 WRITE(LOGF,1002) CODE(I)
77 ENDIF
78 ENDIF
79 RETURN
801000 FORMAT(' KERNLIB LIBRARY ERROR. ' /
81 + ' ERROR CODE ',A6,' NOT RECOGNIZED BY KERMTR',
82 + ' ERROR MONITOR. RUN ABORTED.')
831001 FORMAT(/' ***** RUN TERMINATED BY CERN LIBRARY ERROR ',
84 + 'CONDITION ',A6)
851002 FORMAT(/' ***** CERN LIBRARY ERROR CONDITION ',A6)
86 END