This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / cgpack / cgtstr.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:19:45  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.32  by  S.Giani
11 *-- Author :
12       SUBROUTINE CGTSTR(CG,IREP)
13 ************************************************************************
14 *                                                                      *
15 *     Name: CGTSTR                                                     *
16 *     Author: E. Chernyaev                       Date:    12.02.89     *
17 *                                                Revised:              *
18 *                                                                      *
19 *     Function: Test structure of CG-object                            *
20 *                                                                      *
21 *     References: none                                                 *
22 *                                                                      *
23 *     Input:  CG(*) - CG-object                                        *
24 *                                                                      *
25 *     Output: IREP - replay (0 - O.K, -1. - error in structure)        *
26 *                                                                      *
27 *     Errors: none                                                     *
28 *                                                                      *
29 ************************************************************************
30 #include "geant321/cggpar.inc"
31       REAL      CG(*)
32 *-
33       IREP   =-1
34       LTOTAL = CG(KCGSIZ)
35       IF (LTOTAL .LT. LCGHEA)                  GOTO 999
36       NFACE  = CG(KCGNF)
37       IF (NFACE .LT. 0)                        GOTO 999
38       IF (NFACE .GT. 99999)                    GOTO 999
39 *
40       JCG    = LCGHEA
41       IF (NFACE .EQ. 0)                         GOTO 200
42       DO 100 NF=1,NFACE
43         IF (LTOTAL .LT. JCG+LCGFAC)            GOTO 999
44         NEDGE  = CG(JCG+KCGNE)
45         IF (NEDGE .LE. 0)                      GOTO 999
46         IF (NEDGE .GT. 99999)                  GOTO 999
47         JCG    = JCG + LCGFAC + NEDGE*LCGEDG
48         IF (LTOTAL .LT. JCG)                   GOTO 999
49   100   CONTINUE
50   200 IF (JCG .EQ. LTOTAL)                      IREP = 0
51 *
52   999 RETURN
53       END