Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / GEANT321 / gkine / gsveru.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:21:19  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.21  by  S.Giani
11 *-- Author :
12       SUBROUTINE GSVERU (IVTX,NWBUF,UBUF,IADR)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C     *       Stores User's informations in VERTEX user bank,          *
17 C     *       for vertex IVTX. (IVTX must be an already existing vertex)*
18 C     *       IADR is the stating location within the bank.            *
19 C     *                                                                *
20 C     *       on output IADR is the new starting location              *
21 C.    *                                                                *
22 C.    *    ==>Called by : <USER>                                       *
23 C.    *       Author     M.Maire                                       *
24 C.    *                                                                *
25 C.    ******************************************************************
26 C.
27 #include "geant321/gcbank.inc"
28 #include "geant321/gcunit.inc"
29 #include "geant321/gcflag.inc"
30 *
31       DIMENSION UBUF(1)
32 *
33       IF ((JVERTX.GT.0).AND.(LQ(JVERTX-IVTX).GT.0)) THEN
34 *
35          JV = LQ(JVERTX-IVTX)
36          NDATA = IADR + NWBUF
37          IF (LQ(JV-1).EQ.0) THEN
38             CALL MZBOOK (IXDIV,JVU,JV,-1,'VERU',0,0,NDATA,3,0)
39             IQ(JVU-5) = IVTX
40          ELSE
41             JVU = LQ(JV-1)
42             NFREE = IQ(JVU-1) - NDATA
43             IF (NFREE.LT.0) CALL MZPUSH (IXDIV,JVU,0,-NFREE,'I')
44          ENDIF
45 *
46          DO 10 I=1,NWBUF
47             Q(JVU+IADR+I) = UBUF(I)
48    10    CONTINUE
49 *
50          IADR = IADR + NWBUF
51       ELSE
52 *
53          IADR = 0
54          WRITE(CHMAIL,1000) IEVENT,IVTX
55          CALL GMAIL(0,0)
56       ENDIF
57 *
58  1000 FORMAT(' **** GSVERU: No Vertex bank in memory for ievent:',I7,
59      &       '   or vertex:',I4,'does not exist')
60 *
61       END