5 * Revision 1.1.1.1 1995/10/24 10:20:49 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.28 by S.Giani
14 C. ******************************************************************
18 C. * Scans the JVOLUM structure to find the maximum Number of *
19 C. * LEVels and maximum number of volumes in each level.top *
20 C. * Stores corresponding information in bank next to JVOLUM *
23 C. * Called by : GGCLOS *
24 C. * Author : S.Banerjee *
26 C. ******************************************************************
28 #include "geant321/gcbank.inc"
30 INTEGER ILINK(NLVMAX), LJVOM(NLVMAX), NLINK(NLVMAX)
31 INTEGER NDVLP(NLVMAX), MAXVO(NLVMAX)
33 C. ------------------------------------------------------------------
35 CALL VZERO (MAXVO, NLVMAX)
38 LJVOM(NLEV) = LQ(JVOLUM-1)
42 * *** Loop over volumes going down the tree
44 10 IF (NLEV.GT.NLVT) NLVT = NLEV
46 * ** Check if current volume is a source of local development
48 IF (LQ(LJVOM(NLEV)).GT.0) THEN
50 ELSE IF (NLEV.GT.1) THEN
51 NDVLP(NLEV) = NDVLP(NLEV-1)
55 NIN = Q(LJVOM(NLEV)+3)
58 * * Current volume has contents defined by position
61 IF (NIN.GT.MAXVO(NLEV+1)) MAXVO(NLEV+1) = NIN
62 IF (NLINK(NLEV).EQ.0) GO TO 30
65 JIN = LQ(LJVOM(NLEV)-IN)
68 LJVOM(NLEV) = LQ(JVOLUM-IVOT)
72 ELSE IF (NIN.LT.0) THEN
74 * * Current volume is divided
76 JDIV = LQ(LJVOM(NLEV)-1)
78 IF (NLEV.GT.NDVLP(NLEV)) THEN
79 JPAR = LQ(LJVOM(NDVLP(NLEV)))
80 DO 15 ILEV = NDVLP(NLEV), NLEV-1
81 IF (IQ(JPAR+1).EQ.0) THEN
82 JPAR = LQ(JPAR-ILINK(ILEV+1))
83 IF (JPAR.EQ.0) GO TO 20
87 IF (ILEV.EQ.NLEV-1) THEN
94 IF (NDIV.LT.0) NDIV = -NDIV
96 IF (NDIV.GT.MAXVO(NLEV+1)) MAXVO(NLEV+1) = NDIV
98 LJVOM(NLEV) = LQ(JVOLUM-IVOT)
103 * ** No more content in this volume
108 IF (NLINK(NLEV).EQ.0) GO TO 30
111 JIN = LQ(LJVOM(NLEV)-IN)
114 LJVOM(NLEV) = LQ(JVOLUM-IVOT)
119 * *** Scan is complete; now store the information in next-of-same-type
123 IF (JVOLX.GT.0) CALL MZDROP (IXCONS, JVOLX, ' ')
124 CALL MZBOOK (IXCONS, JVOLX, JVOLUM, 0, 'NLEV', 0, 0, NLVT, 2, 0)
125 CALL UCOPY (MAXVO, IQ(JVOLX+1), NLVT)
126 #if defined(CERNLIB_DEBUGG)
127 IF (IDEBUG.NE.0) THEN
128 WRITE (CHMAIL, 2001) NLVT
131 WRITE (CHMAIL, 2002) (MAXVO(I), I = 1, NLVT)
135 2001 FORMAT (' GGNLEV : Maximum number of levels = ',I4,
136 + ' -- maximum number of volumes in each level')
137 2002 FORMAT (5X,20I6)