This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / giopa / gopen.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:17  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.20  by  S.Giani
11 *-- Author :
12       SUBROUTINE GOPEN (LUN,LUNTYP,LEN,IER)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Routine to open I/O units                                *
17 C.    *                                                                *
18 C.    *       LUN      Logical unit number                             *
19 C.    *       LUNTYP   ZEBRA flag    I,O,X  (must be CHARACTER)        *
20 C.    *                'I' LUN is an INPUT file                        *
21 C.    *                'O' LUN is an OUTPUT file                       *
22 C.    *                'X' LUN is in exchange mode format              *
23 C.    *       LEN      Buffer length (see FZFILE)                      *
24 C.    *       IER      error flag                                      *
25 C.    *                                                                *
26 C.    *    ==>Called by : <USER>, UGINIT                               *
27 C.    *       Author    R.Brun  *********                              *
28 C.    *                                                                *
29 C.    ******************************************************************
30 C.
31 #include "geant321/gcunit.inc"
32       CHARACTER*(*) LUNTYP
33 C.
34 C.    ------------------------------------------------------------------
35 C.
36       IF (NUNITS.LT.5)THEN
37          CALL FZFILE(LUN,LEN,LUNTYP)
38          NUNITS = NUNITS + 1
39          LUNITS(NUNITS) = LUN
40          IF(INDEX(LUNTYP,'I').NE.0)LUNITS(NUNITS)=-LUN
41          IER    = 0
42       ELSE
43          IER    = 1
44       ENDIF
45 C
46       END