next up previous index
Next: IOPA500 Data structure Up: GEANT Previous: IOPA300 Data structure

IOPA400 ZEBRA direct access files handling

Routine ID: IOPA400
Author(s): Submitted: 20.08.87
Origin: R.BrunRevised: 17.12.93

I/O with direct access files is the most efficient way to use direct access devices. All the routines described in this section and in ( [IOPA500]) are based on the ZEBRA-RZ package and the user is referred to the related documentation [] for an understanding of the basic principles.

CALL GRFILE (LUN,CHFILE,CHOPT)

LUN
( INTEGER) logical unit number;
CHFILE
( CHARACTER*(*)) file name;
CHOPT
( CHARACTER*(*)) any valid option for RZOPEN, RZMAKE and RZFILE and in particular:
N
create a new file;
U
open an existing file for update;
Q
the initial allocation (default 1000 records) is in IQUEST(10);
I
read all initialisation data structures (see description of GRIN/GROUT) from file to memory;
O
write all initialisation data structures from memory to file;

This routine opens a file for direct access I/O of ZEBRA data structures. By default the file is opened in exchange mode and the option W is added, which creates an RZ top level directory with the name //LUNnn where nn is the logical unit number.

The default allocation of an RZ directory is enough for 1000 records, which allows for a 4Mb file with the standard record length of 1024 words. If a larger file is needed, the size of the directory should be changed when creating the file. This can be done by assigning to the variable IQUEST(10) in the common /QUEST/ the requested number of records, and calling GRFILE with the option Q as shown in the following example:

      COMMON / QUEST / IQUEST(100)
      .
      .
      .
      IQUEST(10) = 5000
      CALL GRFILE(1,'mygeom.geom','Q')

CALL GRMDIR (CHDIR,CHOPT)

CHDIR
( CHARACTER*(*)) subdirectory name to create;
CHOPT
option string:
' '
create a subdirectory;
S
create a subdirectory and set the current directory to it;
This routine creates an RZ subdirectory.

CALL GREND (LUN)

LUN
( INTEGER) logical unit number (see RZEND in the ZEBRA manual []);

Routine to close an RZ file. It is very important to call this routine for all RZ files open in write mode. Failure to do may result in the files being incompletely written or corrupted.

IOPA500


next up previous index
Next: IOPA500 Data structure Up: GEANT Previous: IOPA300 Data structure


Janne Saarela
Mon Apr 3 12:46:29 METDST 1995