1 | SUBROUTINE ADDANG( COST0,PHI0, COST,PHI, COST1,PHI1 )
|
---|
2 |
|
---|
3 | C-----------------------------------------------------------------------
|
---|
4 | C ADD(ITION OF) ANG(LES)
|
---|
5 | C
|
---|
6 | C ADDITION OF ANGLES IS DONE BY SEQUENTIAL ROTATIONS :
|
---|
7 | C 1. ROTATE VECTOR AROUND Z AXIS BY -PHI0
|
---|
8 | C 2. ROTATE VECTOR AROUND Y AXIS BY -THETA0 NOW VECTOR IS (0,0,1)
|
---|
9 | C
|
---|
10 | C 3. ROTATE VECTOR AROUND Y AXIS BY THETA ANGLES TO BE ADDED
|
---|
11 | C 4. ROTATE VECTOR AROUND Z AXIS BY PHI
|
---|
12 | C
|
---|
13 | C 5. ROTATE VECTOR AROUND Y AXIS BY THETA0
|
---|
14 | C 6. ROTATE VECTOR AROUND Z AXIS BY -PHI0
|
---|
15 | C NOW VECTOR IS (X,Y,Z) WITH COST1 = Z
|
---|
16 | C AND TAN(PHI1) = Y/X
|
---|
17 | C THIS SUBROUTINE IS CALLED FROM MANY ROUTINES
|
---|
18 | C ARGUMENTS:
|
---|
19 | C COST0 = COSINE THETA OF PARTICLE BEFORE
|
---|
20 | C PHI0 = PHI OF PARTICLE BEFORE
|
---|
21 | C COST = COSINE THETA OF ANGLE TO ADD
|
---|
22 | C PHI = PHI OF ANGLE TO ADD
|
---|
23 | C COST1 = COSINE THETA OF PARTICLE AFTER ADDITION OF ANGLES
|
---|
24 | C PHI1 = PHI THETA OF PARTICLE AFTER ADDITION OF ANGLES
|
---|
25 | C-----------------------------------------------------------------------
|
---|
26 |
|
---|
27 | IMPLICIT NONE
|
---|
28 | *KEEP,CONST.
|
---|
29 | COMMON /CONST/ PI,PI2,OB3,TB3,ENEPER
|
---|
30 | DOUBLE PRECISION PI,PI2,OB3,TB3,ENEPER
|
---|
31 | *KEEP,RUNPAR.
|
---|
32 | COMMON /RUNPAR/ FIXHEI,THICK0,HILOECM,HILOELB,
|
---|
33 | * STEPFC,NRRUN,NSHOW,PATAPE,MONIIN,
|
---|
34 | * MONIOU,MDEBUG,NUCNUC,
|
---|
35 | * CETAPE,
|
---|
36 | * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
|
---|
37 | * N1STTR,MDBASE,
|
---|
38 | * DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
|
---|
39 | * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
|
---|
40 | * ,GHEISH,GHESIG
|
---|
41 | COMMON /RUNPAC/ DSN,HOST,USER
|
---|
42 | DOUBLE PRECISION FIXHEI,THICK0,HILOECM,HILOELB
|
---|
43 | REAL STEPFC
|
---|
44 | INTEGER NRRUN,NSHOW,PATAPE,MONIIN,MONIOU,MDEBUG,NUCNUC,
|
---|
45 | * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
|
---|
46 | * N1STTR,MDBASE
|
---|
47 | INTEGER CETAPE
|
---|
48 | CHARACTER*79 DSN
|
---|
49 | CHARACTER*20 HOST,USER
|
---|
50 |
|
---|
51 | LOGICAL DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
|
---|
52 | * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
|
---|
53 | * ,GHEISH,GHESIG
|
---|
54 | *KEND.
|
---|
55 |
|
---|
56 | DOUBLE PRECISION A,COST,COST0,COST1,CPHI,CPHI0,PHI,PHI0,PHI1,
|
---|
57 | * SINT,SINT0,SPHI,SPHI0,XXX,YYY,ZZZ
|
---|
58 | C-----------------------------------------------------------------------
|
---|
59 |
|
---|
60 | CC IF ( DEBUG ) WRITE(MDEBUG,*) 'ADDANG:'
|
---|
61 |
|
---|
62 | SINT0 = SQRT(1.D0-COST0**2)
|
---|
63 | SINT = SQRT(1.D0-COST **2)
|
---|
64 | SPHI0 = SIN(PHI0)
|
---|
65 | CPHI0 = COS(PHI0)
|
---|
66 | SPHI = SIN(PHI)
|
---|
67 | CPHI = COS(PHI)
|
---|
68 |
|
---|
69 | A = COST0 * CPHI * SINT + COST * SINT0
|
---|
70 | XXX = A * CPHI0 - SPHI0 * SINT * SPHI
|
---|
71 | YYY = A * SPHI0 + CPHI0 * SINT * SPHI
|
---|
72 | ZZZ = COST * COST0 - SINT0 * SINT * CPHI
|
---|
73 |
|
---|
74 | C GET NEW COSINE(THETA) AND PHI
|
---|
75 | COST1 = ZZZ
|
---|
76 | IF ( YYY .EQ. 0.D0 .AND. XXX .EQ. 0.D0 ) THEN
|
---|
77 | PHI1 = 0.D0
|
---|
78 | ELSE
|
---|
79 | PHI1 = ATAN2( YYY, XXX )
|
---|
80 | ENDIF
|
---|
81 |
|
---|
82 | RETURN
|
---|
83 | END
|
---|