Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / gbase / gsrung.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:11  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.19  by  S.Giani
11 *-- Author :
12       SUBROUTINE GSRUNG (NWBUF,UBUF,IADR)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C     *       Stores User's informations in RUNG user bank.            *
17 C     *       IADR is the stating location in the bank                 *
18 C     *                                                                *
19 C     *       on output IADR is the new starting location              *
20 C.    *                                                                *
21 C.    *    ==>Called by : <USER>                                       *
22 C.    *       Author     M.Maire                                       *
23 C.    *                                                                *
24 C.    ******************************************************************
25 C.
26 #include "geant321/gcbank.inc"
27 #include "geant321/gcunit.inc"
28 *
29       DIMENSION UBUF(1)
30 *
31       IF (JRUNG.GT.0) THEN
32 *
33          NDATA = IADR + NWBUF
34          IF (LQ(JRUNG-1).EQ.0) THEN
35             CALL MZBOOK (IXCONS,JRU,JRUNG,-1,'RUNU',0,0,NDATA,3,0)
36          ELSE
37             JRU = LQ(JRUNG-1)
38             NFREE = IQ(JRU-1) - NDATA
39             IF (NFREE.LT.0) CALL MZPUSH (IXCONS,JRU,0,-NFREE,'I')
40          ENDIF
41 *
42          DO 10 I=1,NWBUF
43             Q(JRU+IADR+I) = UBUF(I)
44    10    CONTINUE
45 *
46          IADR = IADR + NWBUF
47 *
48       ELSE
49          IADR = 0
50          WRITE(CHMAIL,1000)
51          CALL GMAIL(0,0)
52       ENDIF
53 *
54  1000 FORMAT(' **** GSRUNG: No RUNG bank existing in memory ')
55 *
56       END