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

Go to the source code of this file.

Functions/Subroutines

subroutine cecent2llh (xyz, llh)
 

Function/Subroutine Documentation

◆ cecent2llh()

subroutine cecent2llh ( type(coord xyz,
type(coord llh 
)

Definition at line 2 of file ceCent2llh.f.

References coord_types().

2 ! xyz: /coord/ structue. Input. The coordinate system is
3 ! such that the origin is at the center of the earth
4 ! x-axis is directed to (0, 0) latitude and longitude.
5 ! y-axis is directed to (0, 90) latitude and longitude.
6 ! z-axsi is directed to the north pole.
7 ! llh: /coord/ structure. Output. to contain data in latitude,
8 ! longitude, height.
9 ! *** note ***
10 ! llh can be the same as xyz. time component is unchanged
11 !
12  implicit none
13 #include "Zglobalc.h"
14 
15 #include "Zcoord.h"
16 #include "Zearth.h"
17  type(coord)::llh
18  type(coord)::xyz
19  type(coord)::temp
20 !
21  real*8 n, cosphi, sinphi, cosl, sinl
22 #include "Zcoordtype.h"
23 
24 ! ecentricity 0 approximation ??
25  n = eradius
26 #ifdef UNIONMAP
27  temp%h = sqrt( xyz%r(1)**2 + xyz%r(2)**2 +xyz%r(3)**2)
28  * - n
29  cosphi = sqrt( (xyz%r(1)/(n+temp%h))**2 +
30  * (xyz%r(2)/(n+temp%h))**2 )
31 ! sinphi = xyz.r(3)/(n*Eone_ecen2 + temp.h)
32  sinphi = xyz%r(3)/(n + temp%h)
33 !
34  cosl = xyz%r(1)/(n+temp%h)/cosphi
35  sinl = xyz%r(2)/(n+temp%h)/cosphi
36  temp%lat = atan2(sinphi, cosphi)*todeg
37  temp%long = atan2(sinl, cosl)*todeg
38  llh%lat = temp%lat
39  llh%long = temp%long
40  llh%h = temp%h
41 #else
42  temp%r(3) = sqrt( xyz%r(1)**2 + xyz%r(2)**2 +xyz%r(3)**2)
43  * - n
44  cosphi = sqrt( (xyz%r(1)/(n+temp%r(3)))**2 +
45  * (xyz%r(2)/(n+temp%r(3)))**2 )
46 ! sinphi = xyz.r(3)/(n*Eone_ecen2 + temp.r(3))
47  sinphi = xyz%r(3)/(n + temp%r(3))
48 !
49  cosl = xyz%r(1)/(n+temp%r(3))/cosphi
50  sinl = xyz%r(2)/(n+temp%r(3))/cosphi
51  temp%r(1) = atan2(sinphi, cosphi)*todeg
52  temp%r(2) = atan2(sinl, cosl)*todeg
53  llh%r(1) = temp%r(1)
54  llh%r(2) = temp%r(2)
55  llh%r(3) = temp%r(3)
56 #endif
57  llh%sys = coord_types(2)
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real ! latitude in deg is to the north ! longitude in deg is to the east *h ! height in m endmap llh map real ! polar angle ! azimuthal angle *radius ! radial distance endmap sph endunion character *sys ! which system xyz
Definition: Zcoord.h:25
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real ! latitude in deg is to the north ! longitude in deg is to the east *h ! height in m endmap llh map real ! polar angle ! azimuthal angle *radius ! radial distance endmap sph endunion character *sys ! which system llh
Definition: Zcoord.h:25
integer max_coord_types * coord_types(2)/'llh'/
Definition: Zcoord.h:43
integer n
Definition: Zcinippxc.h:1
Here is the call graph for this function: