This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / erdecks / evolio.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1996/03/06 15:37:35 mclareni
6* Add geane321 source directories
7*
8*
9#include "geant321/pilot.h"
10*CMZ : 3.21/02 29/03/94 15.41.49 by S.Giani
11*-- Author :
12 SUBROUTINE EVOLIO (NVLIN,NAMIN,NUMIN,NVLOUT,NAMOUT,NUMOUT)
13*
14C. ******************************************************************
15C. * *
16C. * Called with INWVOL=2 this routine save the volume's tree *
17C. * *
18C. * Called with INWVOL=1 this routine returns *
19C. * - the list of volumes (and number) left *
20C. * - the list of volumes (and number) entered *
21C. * *
22C. * ==>Called by : ERTRGO *
23C. * Author M.Maire ********* *
24C. * *
25C. ******************************************************************
26C.
27#include "geant321/gcvolu.inc"
28#include "geant321/gctrak.inc"
29*
30 PARAMETER (NVMX=15)
31 COMMON/OLDTRE/NLVOLD,NAMOLD(NVMX),NUMOLD(NVMX),IOFLAG(NVMX),KONLY
32*
33 DIMENSION NAMIN(NVMX),NUMIN(NVMX),NAMOUT(NVMX),NUMOUT(NVMX)
34*
35*
36 NVLOUT = 0
37 NVLIN = 0
38 IF(INWVOL.EQ.0) RETURN
39 IF(NLEVEL.EQ.0) RETURN
40*
41* *** Save the tree when leaving a volume
42*
43 IF(INWVOL.EQ.2) THEN
44 NLVOLD = NLEVEL
45 KONLY = 1
46 DO 1 ILV =1,NLEVEL
47 NAMOLD(ILV) = NAMES (ILV)
48 NUMOLD(ILV) = NUMBER(ILV)
49 IOFLAG(ILV) = 2
50 IF(GONLY(ILV).NE.1.) KONLY = 0
51 1 CONTINUE
52 RETURN
53 ENDIF
54*
55* *** Entering in a new volume : compare the trees
56*
57 IF(INWVOL.NE.1) RETURN
58*
59* *** Simplest case : old tree is 'ONLY'
60*
61 IF(KONLY.EQ.1) THEN
62 NLMIN = MIN(NLEVEL,NLVOLD)
63 NL = 0
64 10 NL = NL + 1
65 IF(NL.GT.NLMIN) GO TO 12
66 IF((NAMES (NL).EQ.NAMOLD(NL)).AND.
67 * (NUMBER(NL).EQ.NUMOLD(NL))) GO TO 10
68*
69 12 CONTINUE
70 IF(NL.LE.NLVOLD) THEN
71 DO 14 IL = NL,NLVOLD
72 NVLOUT = NVLOUT + 1
73 NAMOUT(NVLOUT) = NAMOLD(IL)
74 NUMOUT(NVLOUT) = NUMOLD(IL)
75 14 CONTINUE
76 ENDIF
77*
78 IF(NL.LE.NLEVEL) THEN
79 DO 16 IL = NL,NLEVEL
80 NVLIN = NVLIN + 1
81 NAMIN (NVLIN ) = NAMES (IL)
82 NUMIN (NVLIN ) = NUMBER(IL)
83 16 CONTINUE
84 ENDIF
85*
86 RETURN
87 ENDIF
88*
89* *** Special case for 'NOT ONLY' volumes
90*
91 IF(KONLY.EQ.0) THEN
92 DO 24 IL1 = 1,NLEVEL
93 DO 22 IL2 = 1,NLVOLD
94 IF((NAMES (IL1).EQ.NAMOLD(IL2)).AND.
95 * (NUMBER(IL1).EQ.NUMOLD(IL2))) THEN
96 IOFLAG(IL2) = 0
97 GO TO 24
98 ENDIF
99 22 CONTINUE
100 NVLIN = NVLIN + 1
101 NAMIN (NVLIN ) = NAMES (IL1)
102 NUMIN (NVLIN ) = NUMBER(IL1)
103 24 CONTINUE
104*
105 DO 26 IL2 = 1,NLVOLD
106 IF(IOFLAG(IL2).EQ.0) GO TO 26
107 NVLOUT = NVLOUT + 1
108 NAMOUT(NVLOUT) = NAMOLD(IL2)
109 NUMOUT(NVLOUT) = NUMOLD(IL2)
110 26 CONTINUE
111*
112 ENDIF
113*
114 END