COSMOS v7.655  COSMOSv7655
(AirShowerMC)
ceCent2sph.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine cecent2sph (a, bb)
 

Function/Subroutine Documentation

◆ cecent2sph()

subroutine cecent2sph ( type(coord a,
type(coord bb 
)

Definition at line 2 of file ceCent2sph.f.

References d0.

Referenced by chookenevent(), and ctranscoord2().

2 ! rectangular coord to spherical coord
3  implicit none
4 
5 #include "Zglobalc.h"
6 
7 #include "Zcoord.h"
8  type(coord)::a
9  type(coord)::bb
10 !
11  type(coord)::b
12  real*8 sint, cost, sinphi, cosphi
13 !
14 ! b.radius = sqrt(a.r(1)**2 + a.r(2)**2 + a.r(3)**2)
15  b%r(3) = sqrt(a%r(1)**2 + a%r(2)**2 + a%r(3)**2)
16 ! if(b.radius .gt. 0.) then
17  if(b%r(3) .gt. 0.) then
18 ! sint =sqrt( (a.r(1)/b.radius)**2 + (a.r(2)/b.radius)**2)
19  sint =sqrt( (a%r(1)/b%r(3))**2 + (a%r(2)/b%r(3))**2)
20 ! cost = a.r(3)/b.radius
21  cost = a%r(3)/b%r(3)
22 ! b.theta = atan2(sint, cost)*Todeg
23  b%r(1) = atan2(sint, cost)*todeg
24  if(sint .ne. 0.d0) then
25 ! cosphi = a.r(1) / b.radius*sint
26 ! sinphi = a.r(2) / b.radius *sint
27  cosphi = a%r(1) / b%r(3)*sint
28  sinphi = a%r(2) / b%r(3) *sint
29 ! b.phi = atan2(sinphi, cosphi)*Todeg
30  b%r(2) = atan2(sinphi, cosphi)*todeg
31  else
32 ! b.phi = 0.d0
33  b%r(2) = 0.d0
34  endif
35  else
36 ! b.theta = 0.d0
37 ! b.phi = 0.d0
38  b%r(1) = 0.d0
39  b%r(2) = 0.d0
40  endif
41  b%sys='sph'
42  bb = b
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save b
Definition: cNRLAtmos.f:21
Definition: Zcoord.h:43
Here is the caller graph for this function: