From d63dd8d081a6fcd0715cd13f26df59fb831769d2 Mon Sep 17 00:00:00 2001 From: "Iain R. Learmonth" Date: Sun, 18 Oct 2015 18:51:00 +0100 Subject: Imported Upstream version 1.5.0 --- lib/geocentric.f90 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lib/geocentric.f90 (limited to 'lib/geocentric.f90') diff --git a/lib/geocentric.f90 b/lib/geocentric.f90 new file mode 100644 index 00000000..11ea7cb6 --- /dev/null +++ b/lib/geocentric.f90 @@ -0,0 +1,17 @@ +subroutine geocentric(alat,elev,hlt,erad) + + implicit real*8 (a-h,o-z) + +! 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 subroutine geocentric + -- cgit v1.2.3