1 *
2 * \$Id\$
3 *
4 * \$Log\$
5 * Revision 1.1.1.1  1995/10/24 10:19:43  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.31  by  S.Giani
11 *-- Author :
12       SUBROUTINE CGHDFA(NFACE,XYZ,IFACE,IPFACE,DFACE)
13 ************************************************************************
14 *                                                                      *
15 *     Name: CGHDFA                                                     *
16 *     Author: E. Chernyaev                       Date:    07.08.88     *
17 *                                                Revised:              *
18 *                                                                      *
19 *     Function: Compute faces min-max                                  *
20 *                                                                      *
21 *     References: none                                                 *
22 *                                                                      *
23 *     Input: NFACE - number of faces                                   *
24 *         XYZ(3,*) - node coordinates                                  *
25 *         IFACE(*) - face array                                        *
26 *        IPFACE(*) - pointers to faces beginings in IFACE              *
27 *                                                                      *
28 *     Output: DFACE(6,*) - faces min-max                               *
29 *                                                                      *
30 *     Errors: none                                                     *
31 *                                                                      *
32 ************************************************************************
33       REAL      XYZ(3,*),DFACE(6,*)
34 *SG
35       INTEGER      IFACE(*)
36       INTEGER      IPFACE(*)
37 *
38 *  Error status flag for integer*2 variables :
39 *SG
40       COMMON /CGOVER/ IHSERR
41        IHSERR=0
42 *JS
43 *-
44       DO 300 NF=1,NFACE
45         J      = IPFACE(NF)
46         NEDGE  = IFACE(J)
47         J      = J + 1
48         DFACE(1,NF) = 99999.
49         DFACE(2,NF) = 99999.
50         DFACE(3,NF) = 99999.
51         DFACE(4,NF) =-99999.
52         DFACE(5,NF) =-99999.
53         DFACE(6,NF) =-99999.
54         DO 200 NE=1,NEDGE
55           DO 100 NN=1,2
56             N      = IFACE(J)
57 ***SG
58 *    Eliminating integer*2 variables, it's impossible to obtain
59 *    iface(j) < 0.
60 *JS
61             IF(N.LT.0)THEN
62                IHSERR=1
63                RETURN
64             ENDIF
65 *JS
66 ***SG
67             J      = J + 1
68             IF(XYZ(1,N) .LT. DFACE(1,NF))       DFACE(1,NF) = XYZ(1,N)
69             IF(XYZ(2,N) .LT. DFACE(2,NF))       DFACE(2,NF) = XYZ(2,N)
70             IF(XYZ(3,N) .LT. DFACE(3,NF))       DFACE(3,NF) = XYZ(3,N)
71             IF(XYZ(1,N) .GT. DFACE(4,NF))       DFACE(4,NF) = XYZ(1,N)
72             IF(XYZ(2,N) .GT. DFACE(5,NF))       DFACE(5,NF) = XYZ(2,N)
73             IF(XYZ(3,N) .GT. DFACE(6,NF))       DFACE(6,NF) = XYZ(3,N)
74   100       CONTINUE
75   200     CONTINUE
76         DFACE(1,NF) =-DFACE(1,NF)
77         DFACE(2,NF) =-DFACE(2,NF)
78         DFACE(3,NF) = DFACE(4,NF)
79         DFACE(4,NF) = DFACE(5,NF)
80         DFACE(5,NF) = DFACE(6,NF)
81         DFACE(6,NF) =-99999.
82   300   CONTINUE
83       RETURN
84       END