]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MINICERN/packlib/zebra/rz/rzkeys.F
Mostly minor style modifications to be ready for cloning with EMCAL
[u/mrichter/AliRoot.git] / MINICERN / packlib / zebra / rz / rzkeys.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.2  1996/04/24 17:26:58  mclareni
6 * Extend the include file cleanup to dzebra, rz and tq, and also add
7 * dependencies in some cases.
8 *
9 * Revision 1.1.1.1  1996/03/06 10:47:25  mclareni
10 * Zebra
11 *
12 *
13 #include "zebra/pilot.h"
14       SUBROUTINE RZKEYS(MAXDIM,MAXKEY,KEYS,NKEYS)
15 *
16 ************************************************************************
17 *
18 *        Returns the list of keys currently in the CWD
19 * Input:
20 *   MAXDIM   The actual first dimension of output array KEYS.   It should
21 *            in principle be at least equal to the number of key elements
22 *            NWKEY as declared to RZMDIR.
23 *   MAXKEY   The actual second dimension of output array KEYS
24 * Output:
25 *   KEYS*    A 2-dimensional array  dimensioned KEYS(MAXDIM,MAXKEY).   It
26 *            will contain the key vectors associated with the CWD.
27 *            Its first index runs over the  key elements for a given key,
28 *            while its second index runs over the different keys.
29 *   NKEYS*   Actual number of keys present for the CWD.
30 *
31 * Called by <USER>
32 *
33 *  Author  : R.Brun DD/US/PD
34 *  Written : 05.04.86
35 *  Last mod: 09.02.93 JDS. Return NK and NWK in IQUEST in all cases
36 *
37 ************************************************************************
38 #include "zebra/rzcl.inc"
39 #include "zebra/rzk.inc"
40       DIMENSION KEYS(MAXDIM,MAXKEY)
41 *
42 *-----------------------------------------------------------------------
43 *
44
45 #include "zebra/q_jbyt.inc"
46
47       IQUEST(1)=0
48       NKEYS=0
49       IF(LQRS.EQ.0)GO TO 99
50       IF(LCDIR.EQ.0)GO TO 99
51       LK = IQ(KQSP+LCDIR+KLK)
52       NK = IQ(KQSP+LCDIR+KNKEYS)
53       NWK= IQ(KQSP+LCDIR+KNWKEY)
54       IF(NK.LE.MAXKEY)THEN
55          NKEYS=NK
56          IQUEST(11)=NK
57          IQUEST(12)=NWK
58       ELSE
59          NKEYS=MAXKEY
60          IQUEST(1)=1
61          IQUEST(11)=NK
62          IQUEST(12)=NWK
63       ENDIF
64       IF(NWK.GT.MAXDIM)THEN
65          IQUEST(1)=1
66          IQUEST(11)=NKEYS
67          IQUEST(12)=NWK
68       ENDIF
69 *
70       DO 20 I=1,NKEYS
71          K=LK+(NWK+1)*(I-1)
72          DO 10 J=1,NWK
73             IKDES=(J-1)/10
74             IKBIT1=3*J-30*IKDES-2
75             IF(JBYT(IQ(KQSP+LCDIR+KKDES+IKDES),IKBIT1,3).LT.3)THEN
76                KEYS(J,I)=IQ(KQSP+LCDIR+K+J)
77             ELSE
78                CALL ZITOH(IQ(KQSP+LCDIR+K+J),KEYS(J,I),1)
79             ENDIF
80   10     CONTINUE
81   20  CONTINUE
82 *
83   99  RETURN
84       END