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.20 by S.Giani
12 SUBROUTINE GRFILE(LUN,CHFILE,CHOPTT)
14 C. ******************************************************************
16 C. * Routine to open a GEANT/RZ data base. *
18 C. * LUN logical unit number associated to the file *
20 C. * CHFILE RZ file name *
22 C. * CHOPT is a character string which may be *
23 C. * 'N' To create a new file *
24 C. * 'U' to open an existing file for update *
25 C. * ' ' to open an existing file for read only *
26 C. * 'Q' The initial allocation (default 1000 records) *
27 C. * is given in IQUEST(10) *
28 C. * 'X' Open the file in exchange format *
29 C. * 'I' Read all data structures from file to memory *
30 C. * 'O' Write all data structures from memory to file *
33 C. * If options 'I' or 'O' all data structures are read or *
34 C. * written from/to file and the file is closed. *
35 C. * See routine GRMDIR to create subdirectories *
36 C. * See routines GROUT,GRIN to write,read objects *
38 C. * ==>Called by : <USER> *
39 C. * Author R.Brun ********* *
41 C. ******************************************************************
43 #include "geant321/gcbank.inc"
44 COMMON/QUEST/IQUEST(100)
45 CHARACTER*(*) CHFILE,CHOPTT
46 CHARACTER*8 CHOPT,CHTOP,CHTAGS(2)
47 CHARACTER*10 CHOPT1,CHOPT2
49 DATA CHTAGS,CHTOP/'Object','Version',' '/
51 C. ------------------------------------------------------------------
56 IOPTN=INDEX(CHOPT,'N')
57 IOPTU=INDEX(CHOPT,'U')
58 IOPTQ=INDEX(CHOPT,'Q')
59 IOPTI=INDEX(CHOPT,'I')
60 IOPTO=INDEX(CHOPT,'O')
61 IF(IOPTN.EQ.0.AND.IOPTU.EQ.0)IOPTO=0
68 CALL RZOPEN(LUN,CHTOP,CHFILE,CHOPT2,1024,ISTAT)
69 IF(ISTAT.NE.0)GO TO 99
74 IF(NQUOT.LT.100.OR.NQUOT.GT.100000)NQUOT=1000
78 CALL RZMAKE(LUN,CHTOP,2,'HI',CHTAGS,NQUOT,CHOPT1)
80 CALL RZFILE(LUN,CHTOP,CHOPT1)
83 * Read/write initialisation structures
86 CALL GRIN('INIT',0,' ')
89 CALL GROUT('INIT',1,' ')
91 IF(IOPTI.NE.0.OR.IOPTO.NE.0)THEN