This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / giopa / gclose.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:16  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 GCLOSE (LUN,IER)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Routine to close I/O units                               *
17 C.    *                                                                *
18 C.    *       LUN      Logical unit number                             *
19 C.    *       IER      error flag                                      *
20 C.    *                                                                *
21 C.    *    ==>Called by : <USER>, UGLAST                               *
22 C.    *       Authors    R.Brun, F.Carena  *********                   *
23 C.    *                                                                *
24 C.    ******************************************************************
25 C.
26 #include "geant321/gcunit.inc"
27 C.
28 C.    ------------------------------------------------------------------
29 C.
30       IER=0
31       IF(LUN.EQ.0)THEN
32          CALL FZENDO(LUN,'T')
33          CALL FZENDI(LUN,'T')
34       ELSE
35          DO 10 I=1,NUNITS
36             IF(LUN.EQ.ABS(LUNITS(I)))THEN
37                IF(LUNITS(I).LT.0)THEN
38                   CALL FZENDI(LUN,'T')
39                ELSE
40                   CALL FZENDO(LUN,'T')
41                ENDIF
42                LUNITS(I)=0
43                GOTO 999
44             ENDIF
45    10    CONTINUE
46          IER=1
47       ENDIF
48   999 END