WSJT-X/libm65/geocentric.f
Joe Taylor c4a1997191 Set properties for native eol style and the "Rev" keyword.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@2464 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2012-05-22 17:09:48 +00:00

18 lines
452 B
Fortran

subroutine geocentric(alat,elev,hlt,erad)
implicit real*8 (a-h,o-z)
C IAU 1976 flattening f, equatorial radius a
f = 1.d0/298.257d0
a = 6378140.d0
c = 1.d0/sqrt(1.d0 + (-2.d0 + f)*f*sin(alat)*sin(alat))
arcf = (a*c + elev)*cos(alat)
arsf = (a*(1.d0 - f)*(1.d0 - f)*c + elev)*sin(alat)
hlt = datan2(arsf,arcf)
erad = sqrt(arcf*arcf + arsf*arsf)
erad = 0.001d0*erad
return
end