This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / ggeom / grpar.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:55  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.30  by  S.Giani
11 *-- Author :
12       SUBROUTINE GRPAR(SHAP,NP,P,NDIV,STEP,C0,IN,GP,NSP,SP)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       ROUTINE TO COMPUTE RMIN AND RMAX FOR THE IN TH DIVISION  *
17 C.    *       OF NDIV DIVISIONS STARTING AT C0 WITH STEP OF STEP       *
18 C.    *       (FOR ISHAPE 5 & 6) AND TO INSERT THEM INTO THE SHAPE     *
19 C.    *       PARAMETER LIST FROM P OUTPUTING THE RESULT AS THE        *
20 C.    *       LIST SP.                                                 *
21 C.    *                                                                *
22 C.    *    ==>Called by : not used                                     *
23 C.    *         Author  A.McPherson  *********                         *
24 C.    *                                                                *
25 C.    ******************************************************************
26 C.
27 #include "geant321/gcunit.inc"
28       DIMENSION P(3),SP(5),GP(5)
29 C.
30 C.    ------------------------------------------------------------------
31 C.
32       ISH=SHAP
33       IF(ISH.NE.5)GO TO 5
34       NSP=3
35       SP(3)=P(3)
36       SP(2)=C0+STEP*IN
37       SP(1)=SP(2)-STEP
38       GO TO 99
39 C
40    5  IF(ISH.LT.5.OR.ISH.GT.12) GO TO 90
41       IF(ISH.EQ.10) GO TO 90
42 C
43       NSP=NP
44       DO 10 I=1,NP
45   10  SP(I)=P(I)
46 C
47       IF(ISH.GT.6.AND.ISH.NE.9) GO TO 20
48       SP(2)=C0+STEP*IN
49       SP(1)=SP(2)-STEP
50       GO TO 99
51 C
52    20 CONTINUE
53 C
54       IF(ISH.GT.9) GO TO 30
55 C
56       DR=(GP(3)-GP(2))/NDIV
57       SP(3)=GP(2)+DR*IN
58       SP(2)=SP(3)-DR
59       DR=(GP(5)-GP(4))/NDIV
60       SP(5)=GP(4)+DR*IN
61       SP(4)=SP(5)-DR
62       GO TO 99
63 C
64    30 CONTINUE
65 C
66 C               POLYGONS AND POLYCONES.
67 C
68       IPNZ=3
69       IF(ISH.EQ.11) IPNZ=4
70       NZ=GP(IPNZ)
71 C
72       DO 40 IZ=1,NZ
73 C
74       IPZ=IPNZ+IZ*3-2
75       OR=GP(IPZ+1)
76       ST=(GP(IPZ+2)-OR)/NDIV
77       SP(IPZ+2)=OR+ST*IN
78       SP(IPZ+1)=SP(IPZ+2)-ST
79 C
80    40 CONTINUE
81 C
82       GO TO 99
83 C
84   90  CONTINUE
85       WRITE(CHMAIL,1000) ISH
86       CALL GMAIL(0,0)
87 C
88  1000 FORMAT(' SHAPE #',I5,' AS A DIVISION IN R NOT YET IMPLEMENTED')
89   99  RETURN
90       END