summaryrefslogtreecommitdiff
path: root/lib/moondopjpl.f90
diff options
context:
space:
mode:
Diffstat (limited to 'lib/moondopjpl.f90')
-rw-r--r--lib/moondopjpl.f9024
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/moondopjpl.f90 b/lib/moondopjpl.f90
index 20fbb5e8..f05de384 100644
--- a/lib/moondopjpl.f90
+++ b/lib/moondopjpl.f90
@@ -1,6 +1,9 @@
subroutine MoonDopJPL(nyear,month,nday,uth4,lon4,lat4,RAMoon4, &
- DecMoon4,LST4,HA4,AzMoon4,ElMoon4,vr4,dist4)
+ DecMoon4,LST4,HA4,AzMoon4,ElMoon4,vr4,dist4,ephemeris_result)
+ use ieee_arithmetic, only: ieee_is_finite
+ use jpl_ephemeris_status, only: EPHEMERIS_INVALID_INPUT, &
+ EPHEMERIS_UNAVAILABLE
implicit real*8 (a-h,o-z)
real*4 uth4 !UT in hours
real*4 lon4 !East longitude, degrees
@@ -13,12 +16,28 @@ subroutine MoonDopJPL(nyear,month,nday,uth4,lon4,lat4,RAMoon4, &
real*4 ElMoon4 !Topocentric Elevation of moon, degrees
real*4 vr4 !Radial velocity of moon wrt obs, km/s
real*4 dist4 !Echo time, seconds
+ integer ephemeris_result
+
+ RAMoon4=0.
+ DecMoon4=0.
+ LST4=0.
+ HA4=0.
+ AzMoon4=0.
+ ElMoon4=0.
+ vr4=0.
+ dist4=0.
+ ephemeris_result=EPHEMERIS_INVALID_INPUT
+
+ if(.not.ieee_is_finite(uth4) .or. uth4.lt.0. .or. uth4.ge.24.) return
+ if(.not.ieee_is_finite(lon4) .or. .not.ieee_is_finite(lat4)) return
+ if(lat4.lt.-90. .or. lat4.gt.90.) return
twopi=8.d0*atan(1.d0) !Define some constants
rad=360.d0/twopi
clight=2.99792458d5
call sla_CLDJ(nyear,month,nday,djutc,j)
+ if(j.ne.0) return
djutc=djutc + uth4/24.d0
dut=-0.460d0
@@ -28,7 +47,8 @@ subroutine MoonDopJPL(nyear,month,nday,uth4,lon4,lat4,RAMoon4, &
nspecial=0
call ephem(djutc,dut,east_long,geodetic_lat,height,nspecial, &
- RA,Dec,Az,El,techo,dop,fspread_1GHz,vr)
+ RA,Dec,Az,El,techo,dop,fspread_1GHz,vr,ephemeris_result)
+ if(ephemeris_result.eq.EPHEMERIS_UNAVAILABLE) return
RAMoon4=RA
DecMoon4=Dec