Mostly minor style modifications to be ready for cloning with EMCAL
[u/mrichter/AliRoot.git] / MINICERN / packlib / zebra / qend / zphase.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1996/03/06 10:47:14 mclareni
6* Zebra
7*
8*
9#include "zebra/pilot.h"
10 SUBROUTINE ZPHASE (NPHP)
11
12C- CHANGE PROGRAM PHASE, USER CALLED
13
14#include "zebra/zstate.inc"
15#include "zebra/zunit.inc"
16#include "zebra/mqsys.inc"
17C-------------- END CDE --------------
18 DIMENSION NPHP(9)
19#if (defined(CERNLIB_QTRHOLL))&&(!defined(CERNLIB_A6M))
20 DIMENSION NAMESR(2)
21 DATA NAMESR / 4HZPHA, 4HSE /
22#endif
23#if (defined(CERNLIB_QTRHOLL))&&(defined(CERNLIB_A6M))
24 DATA NAMESR / 6HZPHASE /
25#endif
26#if !defined(CERNLIB_QTRHOLL)
27 CHARACTER NAMESR*8
28 PARAMETER (NAMESR = 'ZPHASE ')
29#endif
30
31
32 NPH = NPHP(1)
33 IF (NPH.EQ.0) NPH=1
34 IF (NQPHAS) 41,31,21
35
36C-- CURRENT STATE IS OPERATION
37
38 21 IF (NPH.LT.0) GO TO 51
39 NQPHAS = NPH
40 RETURN
41
42C-- CURRENT STATE IS INIT
43
44 31 IF (NPH.LT.0) GO TO 51
45 NQPHAS = NPH
46#if defined(CERNLIB_QPRINT)
47 IF (NQLOGD.LT.-1) RETURN
48 WRITE (IQLOG,9032) NPH
49 9032 FORMAT (1X/' ZPHASE. Start Operation Phase',I5)
50#endif
51 RETURN
52
53C-- CURRENT STATE IS TERM
54
55 41 IF (NPH.LT.0) GO TO 52
56#if defined(CERNLIB_QPRINT)
57 IF (NQLOGD.LT.-2) RETURN
58 WRITE (IQLOG,9042) NPH
59 9042 FORMAT (1X/' !!!!! ZPHASE refuses to go back from Termination'
60 F,' to Operation Phase',I5)
61#endif
62 RETURN
63
64C---- START TERMINATION PHASE
65
66#if !defined(CERNLIB_QPRINT)
67 51 CONTINUE
68 52 CONTINUE
69#endif
70#if defined(CERNLIB_QPRINT)
71 51 IF (NQLOGD.GE.-1) WRITE (IQLOG,9051)
72 9051 FORMAT (1X/' ZPHASE. Start Termination Phase.')
73
74 52 IF (NQLOGD.GE.-1) WRITE (IQLOG,9052) NPH
75 9052 FORMAT (1X/' ZPHASE. Termination mode',I5)
76#endif
77 NQPHAS = -1
78
79#include "zebra/qtrace.inc"
80
81 CALL MZWORK (0,0,0,-1)
82 IF (NPH.GE.-1) GO TO 999
83
84 CALL MZGARB (JQDVSY,21)
85 IF (NPH.GE.-2) GO TO 999
86
87 LA = LQSTA(JQDVSY)
88
89 JDIV = 1
90 56 JDIV = JDIV + 1
91 LQSTA(JDIV) = LA
92 LQEND(JDIV) = LA
93 NQDRED(JDIV) = NQDRED(JDIV) + 1
94 IF (JDIV.LT.JQDVLL) GO TO 56
95
96 IX = MZIXCO (22,23,0,0)
97 CALL MZGARB (IX,0)
98#include "zebra/qtrace99.inc"
99 RETURN
100 END
101* ==================================================
102#include "zebra/qcardl.inc"