In principle any bank in the data structure could be a linear chain of logically independent banks. For example once you reach the MCVX from the MC you are at the start of a chain of Monte Carlo verteces. Note, unless documented to the contrary, you cannot assume anything about the ordering of banks in a linear chain. For example, with the MCVX you cannot assume that they are arranged in time order, or distance from the seed vertex or whatever. Once you have reached the first bank in a chain you can loop over the rest of the chain by following link 0 of the bank, for example:-
include 'z.inc' integer lmcvx_cur . . . do while (lmcvx_cur .ne. 0) * Code to process current vertex. . . . * Move on to the next vertex. lmcvx_cur = lq(lmcvx_cur) enddo
ZEBRA provides a number of utility routines that help while processing linear chains and more complex structures. For example:-
See the Data Structure Utilities section of the ZEBRA MZ Reference Manual for details.ZSORT* Re-arrange a linear chain into order
ZTOPSY Reverse order of a linear chain
LZLAST Find last bank in linear chain
LZFIND Find specific bank in linear chain
NZBANK Count number of banks in linear chain