Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyerrm.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyerrm.f
1 
2 C*********************************************************************
3 
4 C...PYERRM
5 C...Informs user of errors in program execution.
6 
7  SUBROUTINE pyerrm(MERR,CHMESS)
8 
9 C...Double precision and integer declarations.
10  IMPLICIT DOUBLE PRECISION(a-h, o-z)
11  IMPLICIT INTEGER(i-n)
12  INTEGER pyk,pychge,pycomp
13 C...Commonblocks.
14  common/pyjets/n,npad,k(4000,5),p(4000,5),v(4000,5)
15  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
16  SAVE /pyjets/,/pydat1/
17 C...Local character variable.
18  CHARACTER chmess*(*)
19 
20 C...Write first few warnings, then be silent.
21  IF(merr.LE.10) THEN
22  mstu(27)=mstu(27)+1
23  mstu(28)=merr
24  IF(mstu(25).EQ.1.AND.mstu(27).LE.mstu(26)) WRITE(mstu(11),5000)
25  & merr,mstu(31),chmess
26 
27 C...Write first few errors, then be silent or stop program.
28  ELSEIF(merr.LE.20) THEN
29  IF(mstu(29).EQ.0) mstu(23)=mstu(23)+1
30  mstu(30)=mstu(30)+1
31  mstu(24)=merr-10
32  IF(mstu(21).GE.1.AND.mstu(23).LE.mstu(22)) WRITE(mstu(11),5100)
33  & merr-10,mstu(31),chmess
34  IF(mstu(21).GE.2.AND.mstu(23).GT.mstu(22)) THEN
35  WRITE(mstu(11),5100) merr-10,mstu(31),chmess
36  WRITE(mstu(11),5200)
37  IF(merr.NE.17) CALL pylist(2)
38  CALL pystop(3)
39  ENDIF
40 
41 C...Stop program in case of irreparable error.
42  ELSE
43  WRITE(mstu(11),5300) merr-20,mstu(31),chmess
44  CALL pystop(3)
45  ENDIF
46 
47 C...Formats for output.
48  5000 FORMAT(/5x,'Advisory warning type',i2,' given after',i9,
49  &' PYEXEC calls:'/5x,a)
50  5100 FORMAT(/5x,'Error type',i2,' has occured after',i9,
51  &' PYEXEC calls:'/5x,a)
52  5200 FORMAT(5x,'Execution will be stopped after listing of last ',
53  &'event!')
54  5300 FORMAT(/5x,'Fatal error type',i2,' has occured after',i9,
55  &' PYEXEC calls:'/5x,a/5x,'Execution will now be stopped!')
56 
57  RETURN
58  END