Primarily to avoid recovery to 'next event' at the wrong moment, ZEBRA needs to know in which phase the user program is at any given moment. We distinguish three phases:
The user may subdivide the operation phase for his own purpose. With the change to 'termination' one may request ZPHASE to take action of tidying up the primary store, to make room for end-processing routines (like output of histograms) which may need a large amount of working memory.
signals to Zebra a change of phase, preset by MZEBRA to 'initialization'.
Normal operation phase: JPH .GE. 0 Termination phase: JPH .LT. 0 JPH = -1: reset the working space to be of zero length, but leave the store as it is; -2: reset the working space, wipe all user short-range divisions; -3: reset, wipe, and collapse upwards all short-range user divisions to be of zero length, giving their space to division 1 for use by termination routines; perform clean-up garbage collection in all other divisions.
The program phase is recorded on the variable NQPHAS
of /ZSTATE/
and has the following significance :
NQPHAS = 0 initialisation phase >0 = MAX(JPH,1): normal operation phase <0 = JPH: termination phaseIf the user whishes to subdivide the operation phase, he can pick up the current state from this variable.
ZPHASE prints a log message at level --1 for major phase changes, and at level 2 for minor changes.