COSMOS v7.655  COSMOSv7655
(AirShowerMC)
ce_cent2llh_ellips.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 22 of file ce_cent2llh_ellips.f.

References coord_types(), d, and d0.

Referenced by ctranscoord2().

22 ! xyz: /coord/ structue. Input. The coordinate system is
23 ! such that the origin is at the center of the earth
24 ! x-axis is directed to (0, 0) latitude and longitude.
25 ! y-axis is directed to (0, 90) latitude and longitude.
26 ! z-axsi is directed to the north pole.
27 ! llh: /coord/ structure. Output. to contain data in latitude,
28 ! longitude, height.
29 ! *** note ***
30 ! llh can be the same as xyz. time component is unchanged
31 !
32  implicit none
33 c---- include '../../Zglobalc.h'
34 #include "Zglobalc.h"
35 c---- include '../Zcoord.h'
36 #include "Zcoord.h"
37 c---- include 'Zearth.h'
38 #include "Zearth.h"
39  type(coord)::llh, xyz
40  type(coord):: temp
41 !
42  real*8 n, cosphi, sinphi, cosl, sinl, hold
43  integer i
44 ! start with ecentricity 0 approximation
45  temp%h = 0.
46  n = eradius
47  do i = 1, 6
48  hold = temp%h
49  temp%h = sqrt( xyz%r(1)**2 + xyz%r(2)**2 +(xyz%r(3)/
50  * (1.d0 - n*ecen2/(n+temp%h)))**2 ) - n
51  cosphi = sqrt( (xyz%r(1)/(n+temp%h))**2 +
52  * (xyz%r(2)/(n+temp%h))**2 )
53  sinphi = xyz%r(3)/(n*one_ecen2 + temp%h)
54 !
55  cosl = xyz%r(1)/(n+temp%h)/cosphi
56  sinl = xyz%r(2)/(n+temp%h)/cosphi
57  n = eradius /sqrt(1.d0 - ecen2*sinphi**2)
58  if(abs(temp%h -hold) .lt. 1.d-2) goto 100 ! abs error < 1 mm
59  enddo
60  100 continue
61 ! write(*, *) ' i=', i ! <i> = 4
62 !
63  temp%lat = atan2(sinphi, cosphi)*todeg
64  temp%long = atan2(sinl, cosl)*todeg
65  llh%lat = temp%lat
66  llh%long = temp%long
67  llh%h = temp%h
68  llh%sys = coord_types(2)
nodes i
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'/
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
Definition: Zcoord.h:43
integer n
Definition: Zcinippxc.h:1
Here is the call graph for this function:
Here is the caller graph for this function: