A trace facility is to be incorporated in the SPROGS system. It consists of two subroutines. The first, RTRACE, is a system routine and does the tracing and listing. The second, STRACE, is the user called routine and determines the level of tracing.
Both routines contain the following common block
COMMON /TRCE /NUM, CNST ,CNT
where NUM determines the type of tracing done. After CNST display routines have been encountered, extra tracing is output. CNT is the count that determines whether CNST display routines have been entered since the last output of extra tracing.
The probable range of values for NUM will be 0-3 with the following meanings:
NUM = 0 no trace required. NUM = 1 the trace will output the display routine's name and parameters.
NUM = 2 and 3 as for NUM = 1 plus the output of some of the global scalers. Which of these to output has not yet been decided so any relevant comments will be most welcome.
The variable CNST has two settings: either zero or greater than zero.
CNST = 0 no extra tracing. CNST > 0 the extra tracing is output after CNST display routines have been entered since the last extra output. The extra tracing will be the current region parameters, the current region chain and the millitime(sp?).
CNT is in the range 0 ≤ CNT ≤ CNST.
A call of STRACE, eg
CALL STRACE (1,3)
will cause NUM and CNST to be set (to 1 and 3 respectively) and CNT to be reset to zero. Negative arguments are treated as zero and if the first is greater than 3 the message will result.
RTRACE is called from TESTIT by
IF (NUM.GT.0) CALL RTRACE (routine param etc )
(TESTIT is called by each display routine. It determines if routine is to be stored or executed, and whether the array index variables or array parameters).