5 * Revision 1.1.1.1 1995/10/24 10:20:56 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.30 by S.Giani
12 SUBROUTINE GSNEAR (CHMOTH,IN,NLIST,LIST)
14 C. ******************************************************************
16 C. * Gives an ordered LIST of NLIST daughter volumes to search *
17 C. * for when leaving the INth daughter of the volume CHMOTH *
18 C. * (LIST(1) = 0 means back in mother at exit of INth content) *
20 C. * If IN = -1, the mother is regarded to have no contents *
21 C. * contiguous to its boundaries (LIST and NLIST unused) *
22 C. * (Bit 4 set in CHMOTH volume bank for action in GGCLOS) *
24 C. * Default facility : *
25 C. * If IN = 0, for each content in turn, GSNEAR builds a *
26 C. * LIST limited to 1 element LIST(1)=0 *
28 C. * Called by : 'USER' *
29 C. * Author : F.Bruyant ********* *
31 C. ******************************************************************
33 #include "geant321/gcbank.inc"
34 #include "geant321/gcunit.inc"
35 #include "geant321/gcnum.inc"
38 C. ------------------------------------------------------------------
41 IF (JVOLUM.GT.0) CALL GLOOK (CHMOTH, IQ(JVOLUM+1), NVOLUM, IVO)
48 * *** Check that volume CHMOTH has contents positioned by GSPOS or
49 * GSPOSP, and not ordered by User
54 IF (NIN.LE.0.OR.ISEARC.GT.0) THEN
62 * *** Lift a JNEAR bank for current content
65 CALL MZBOOK (IXCONS, JNEAR,JIN,-1,'VONE', 0,0,NLIST+1, 2,0)
66 IQ(JNEAR-5) = 100*IVO +IN
69 IQ(JNEAR+I+1) = LIST(I)
72 ELSE IF (IN.EQ.0) THEN
74 * *** Default option for all contents
78 CALL MZBOOK (IXCONS, JNEAR,JIN,-1,'VONE',0,0,2, 2,0)
79 IQ(JNEAR-5) = 100*IVO+I
86 IQ(JVO) = IBSET(IQ(JVO),3)
90 1001 FORMAT (' GSNEAR : Volume',A4,' does not exist *****')
91 1002 FORMAT (' GSNEAR : Volume',A4,' not a candidate for GSNEAR *****')