This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gbase / geamon.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:08  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 #if defined(CERNLIB_MONITOR)
11 *CMZ :  3.21/02 29/03/94  15.41.19  by  S.Giani
12 *-- Author :
13       SUBROUTINE GEAMON(ICASE,CHINFO)
14 C.
15 C.    ******************************************************************
16 C.    *                                                                *
17 C.    *       Routine for GEANT monitoring                             *
18 C.    *                                                                *
19 C.    *    ==>Called by : <USER>, GUOUT                                *
20 C.    *       Author    R.Brun, F.Carminati ********                   *
21 C.    *                                                                *
22 C.    ******************************************************************
23 C.
24 #include "geant321/gcunit.inc"
25 C.
26 C.    ------------------------------------------------------------------
27 C.
28       COMMON/CWK/IWK
29       CHARACTER*5  ENTRY, EXIT, BATINT
30       LOGICAL FIRST, INTRAC
31       CHARACTER*(*) CHINFO
32       SAVE IWK1,IM1,TIM1,FIRST,ENTRY,EXIT,BATINT
33       DATA ENTRY  /'GINIT'/
34       DATA EXIT   /'GLAST'/
35       DATA BATINT /'BATCH'/
36       DATA FIRST  /.TRUE./
37 *
38 *________________________________________________________
39 *
40       IF(ICASE.LE.1)THEN
41          IF(FIRST) THEN
42             CALL TIMEL(TIM1)
43             IWK1=IWK
44             CALL DATIME(IDAT1,ITIM1)
45             IH1=ITIM1/100
46             IM1=ITIM1-100*IH1+IH1*60
47             IF(INTRAC()) BATINT='INTER'
48             FIRST=.FALSE.
49          ENDIF
50       ENDIF
51       IF(ICASE.EQ.0) THEN
52          ENTRY='GXINT'
53          EXIT ='GXINT'
54       ELSE
55          IF(ICASE.EQ.1) THEN
56             WRITE(CHMAIL,10000)IWK1,CHINFO,ENTRY,BATINT
57          ELSEIF(ICASE.EQ.2) THEN
58             IF(ENTRY.EQ.'GXINT'.AND.CHINFO.EQ.'GLAST') THEN
59                EXIT='GLAST'
60                GOTO 999
61             ENDIF
62             CALL TIMEL(TIM2)
63             CPTIME=TIM1-TIM2
64             CALL DATIME(IDAT2,ITIM2)
65             IH2=ITIM2/100
66             IM2=ITIM2-100*IH2+IH2*60
67             IMD=IM2-IM1
68             IF(IMD.LT.0) IMD=IMD+24*60
69             IRTIME=MIN(9999,MAX(IMD,1))
70             CPTIME=MIN(99999.,CPTIME)
71             IF(IRTIME.GT.999)THEN
72                WRITE(CHMAIL,10101)IWK1,IRTIME,CPTIME,EXIT
73             ELSE
74                WRITE(CHMAIL,10100)IWK1,IRTIME,CPTIME,EXIT
75             ENDIF
76          ENDIF
77 *
78          CALL UMLOG('GEANTMON',CHMAIL(1:LNBLNK(CHMAIL)))
79 *
80       ENDIF
81 *
82 10000 FORMAT('LOG321 WTYP=',I6,1X,A,2(1X,A5))
83 10100 FORMAT('LOGOUT WTYP=',I6,' RT=',I3,' min CP=',F9.3,' sec ',A5)
84 10101 FORMAT('LOGOUT WTYP=',I6,' RT', I4,' min CP=',F9.3,' sec ',A5)
85 *
86   999 END
87 #endif