5 * Revision 1.1.1.1 1995/10/24 10:21:17 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.21 by S.Giani
11 *FCA : 05/01/99 12:33:28 by Federico Carminati
12 * Modified output options so that the complete linear
15 SUBROUTINE GROUT(CHOBJT,IDVERS,CHOPT)
17 C. ******************************************************************
19 C. * Routine to write GEANT object(s) in the RZ file *
20 C. * at the Current Working Directory (See RZCDIR) *
21 C. * Input is taken from the data structures in memory *
22 C. * (VOLU,ROTM,TMED,MATE,SETS,PART,SCAN) *
24 C. * CHOBJ The type of object to be written: *
25 C. * MATE write JMATE structure *
26 C. * TMED write JTMED structure *
27 C. * VOLU write JVOLUM structure *
28 C. * ROTM write JROTM structure *
29 C. * SETS write JSET structure *
30 C. * PART write JPART structure *
31 C. * SCAN write LSCAN structure *
32 C. * INIT write all initialisation structures *
34 C. * IDVERS is a positive integer which specifies the version *
35 C. * number of the object(s). *
37 C. * CHOPT List of options (none for the time being) *
39 C. * Note that if the cross-sections and energy loss tables *
40 C. * are available in the data structure JMATE, then they are *
41 C. * saved on the data base. *
44 C. * The data structures saved by this routine can be retrieved *
45 C. * with the routine GRIN. *
47 C. * Before calling this routine a RZ data base must have been *
48 C. * created using GRFILE. *
49 C. * The data base must be closed with RZEND. *
51 C. * The RZ data base can be transported between different *
52 C. * machines in using the ZEBRA RZ utility RZTOFZ. *
54 C. * The interactive version of GEANT provides facilities *
55 C. * to interactively update, create and display objects. *
59 C. * CALL GRFILE(1,'Geometry.dat','N') *
60 C. * CALL GROUT('VOLU',1,' ') *
61 C. * CALL GROUT('MATE',1,' ') *
62 C. * CALL GROUT('TMED',1,' ') *
63 C. * CALL GROUT('ROTM',1,' ') *
64 C. * CALL GROUT('PART',1,' ') *
65 C. * CALL GROUT('SCAN',1,' ') *
66 C. * CALL GROUT('SETS',1,' ') *
68 C. * The same result can be achieved by: *
69 C. * CALL GRFILE(1,'Geometry.dat','NO') *
71 C. * ==>Called by : <USER>,GRFILE *
72 C. * Author R.Brun ********* *
74 C. ******************************************************************
76 #include "geant321/gcbank.inc"
77 #include "geant321/gcflag.inc"
78 #include "geant321/gcnum.inc"
79 #include "geant321/gccuts.inc"
80 #include "geant321/gcscal.inc"
81 #include "geant321/gcdraw.inc"
82 #include "geant321/gcunit.inc"
83 * COMMON/GCLINK/JDIGI ,JDRAW ,JHEAD ,JHITS ,JKINE ,JMATE ,JPART
84 * + ,JROTM ,JRUNG ,JSET ,JSTAK ,JGSTAT,JTMED ,JTRACK,JVERTX
85 * + ,JVOLUM,JXYZ ,JGPAR ,JGPAR2,JSKLT
86 COMMON/QUEST/IQUEST(100)
87 PARAMETER (NLINIT=9,NLKINE=2,NLTRIG=6,NMKEY=22)
88 DIMENSION JNAMES(20),KEYS(2)
89 DIMENSION LINIT(NLINIT),LKINE(NLKINE),LTRIG(NLTRIG),IXD(NMKEY)
90 DIMENSION LINK(NMKEY),LDIV(2)
91 EQUIVALENCE (JNAMES(1),JDIGI)
92 CHARACTER*4 CHOBJ,NAMES(NMKEY)
93 CHARACTER*(*) CHOPT,CHOBJT
94 DATA NAMES/'DIGI','DRAW','HEAD','HITS','KINE','MATE','PART',
95 + 'ROTM','RUNG','SETS','STAK','STAT','TMED','NULL','VERT',
96 + 'VOLU','JXYZ','NULL','NULL','NULL','SCAN','NULL'/
97 DATA IXD/2,1,2,2,2,8*1,2,2,1,2,3*0,1,0/
98 DATA LINIT/2,6,7,8,9,10,13,16,21/
100 DATA LTRIG/1,3,4,5,15,17/
102 C. ------------------------------------------------------------------
109 IOPTI=INDEX(CHOPT,'i')+INDEX(CHOPT,'I')
110 IOPTT=INDEX(CHOPT,'t')+INDEX(CHOPT,'T')
111 IOPTK=INDEX(CHOPT,'k')+INDEX(CHOPT,'K')
112 IOPTQ=INDEX(CHOPT,'q')+INDEX(CHOPT,'Q')
114 IF(CHOBJ.EQ.'INIT') THEN
119 ELSEIF(CHOBJ.EQ.'TRIG') THEN
124 ELSEIF(CHOBJ.EQ.'KINE') THEN
131 IF(CHOBJ.EQ.'*') THEN
137 ELSEIF(IOPTT.NE.0) THEN
142 ELSEIF(IOPTK.NE.0) THEN
151 IF(CHOBJ.EQ.NAMES(J)) THEN
154 IF(LINIT(L).EQ.J) GOTO 70
157 ELSEIF(IOPTT.NE.0) THEN
159 IF(LTRIG(L).EQ.J) GOTO 70
162 ELSEIF(IOPTK.NE.0) THEN
164 IF(LKINE(L).EQ.J) GOTO 70
172 80 WRITE(CHMAIL,10000) CHOBJ, CHOPT
180 100 IF(NLINK.EQ.0) THEN
181 WRITE(CHMAIL,10100) CHOBJ
189 CALL UCTOH(NAMES(NKEY),KEYS,4,4)
193 IF(JNAMES(NKEY).GT.0) THEN
194 CALL RZOUT(IDIV,JNAMES(NKEY),KEYS,ICYCLE,'L')
198 IF(ISLINK(NKEY-20).GT.0) THEN
199 CALL RZOUT(IDIV,ISLINK(NKEY-20),KEYS,ICYCLE,'L')
203 IF(LINK(I).GT.0) THEN
205 WRITE(CHMAIL,10200) NAMES(LINK(I))
209 ELSEIF(LINK(I).LT.0) THEN
210 IF(IQUEST(1).EQ.0) THEN
212 WRITE(CHMAIL,10300) NAMES(-LINK(I)), IDVERS
217 WRITE(CHMAIL,10400) NAMES(-LINK(I))
228 10000 FORMAT(' *** GROUT *** Data structure ',A4,' not written ',
230 10100 FORMAT(' *** GROUT *** Unknown key ',A4)
231 10200 FORMAT(' *** GROUT *** Data structure ',A4,' was not found')
232 10300 FORMAT(' *** GROUT *** Data structure ',A4,' version ',I10,
234 10400 FORMAT(' *** GROUT *** Error in writing data structure ',
236 10500 FORMAT(' *** GROUT *** Nothing written to disk !')