ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
grun.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file grun.F
1 
2  SUBROUTINE grun
3 *.
4 *. ******************************************************************
5 *. * *
6 *. * Steering routine to process all the events *
7 *. * *
8 *. * ==>Called by : <USER>, main program *
9 *. * Author R.Brun ********* *
10 *. * *
11 *. ******************************************************************
12 *.
13 
14 #include "geant321/gcbank.inc"
15 #include "geant321/gcunit.inc"
16 #include "geant321/gcflag.inc"
17 #include "geant321/gctime.inc"
18 
19  SAVE ifirst
20  DATA ifirst/0/
21 *.
22 *. ------------------------------------------------------------------
23 *.
24 * Keep starting time
25 *
26  IF(ifirst.EQ.0)THEN
27  ifirst=1
28  CALL timel(timint)
29  ENDIF
30 *
31  10 IF(ievent.LT.nevent) THEN
32  ievent=ievent+1
33 *
34 * Initialises event partition
35 *
36  CALL gtrigi
37 *
38 * Process one event (trigger)
39 *
40  CALL gtrig
41 *
42 * Clear event partition
43 *
44  CALL gtrigc
45 *
46  IF(ieorun.EQ.0) THEN
47 *
48 * Check time left
49 *
50  go to 10
51  IF(itime.LE.0)go to 10
52  IF(mod(ievent,itime).NE.0)go to 10
53  CALL timel(timnow)
54  IF(timnow.GT.timend)go to 10
55  WRITE(chmail,10000)timend
56  CALL gmail(0,2)
57  ieorun = 1
58  ENDIF
59  ENDIF
60 *
61 10000 FORMAT(5x,'***** THE JOB STOPS NOW BECAUSE THE TIME LEFT IS LESS',
62  +' THAN ',f8.3,' SECONDS *****')
63  END