C+ C NAME: C testeph C PURPOSE: C Test program for JPL ephemeris C CATEGORY: C Ephemeris C CALLING SEQUENCE: program jpl_test C INPUTS: C (file $sys/jpl/testpo.405) C OUTPUTS: C (none) C INCLUDE: include 'dirspec.h' C CALLS: C iFilePath, iGetLun, jpl_eph C PROCEDURE: C Compares data read from the ephemeris files with C data in the testpo.405 file. C MODIFICATION HISTORY: C JAN-2001, Paul Hick (UCSD; pphick@ucsd.edu) C- character cFile*80 character ALF3*3 character EPHFMT*22 /'(15X,D10.1,3I3,D22.13)'/ real*8 XI real*8 DEL real*8 ET real*8 R(6) integer LINE / 0/ integer NPT /50/ integer IMAP(0:15) /0,1,2,3,4,5,6,7,8,9,10,11,14,15,12,13/ logical jpl_eph write (*,*) 'JPL ephemeris test program.' I = iFilePath(cEnvi//'EPHEM',1,'jpl','testpo.405',cFile) iU = iGetLun(cFile) open (iU, file=cFile, status='OLD') ALF3 = ' ' do while (ALF3 .ne. 'EOT') read (iU,'(a3)') ALF3 ! Skip the file header comments. end do read (iU,EPHFMT,iostat=I) ET,NTARG,NCTR,NCOORD,XI do while (I .eq. 0) NTARG = IMAP(NTARG) NCTR = IMAP(NCTR) if (jpl_eph(ET,NTARG,NCTR,R,.FALSE.,.FALSE.)) then !call jpl_close() DEL = dabs(R(NCOORD)-XI) if (NTARG .eq. IMAP(15) .and. NCOORD .eq. 3) DEL = DEL/(0.23d0*(ET-2451545.d0)) LINE = LINE+1 if (mod(LINE,NPT) .eq. 0) write (*,'((I6,F10.1,3I5,3F20.13))') & LINE,ET,NTARG,NCTR,NCOORD,XI,R(NCOORD),DEL ! Print WARNING if difference greater than tolerance. if (DEL .ge. 1.D-13) write (*,'(A,/,I6,F10.1,3I5,3F20.13)') & '***** WARNING : next difference >= 1.D-13 *****',LINE,ET,NTARG,NCTR,NCOORD,XI,R(NCOORD),DEL end if read (iU,EPHFMT,iostat=I) ET,NTARG,NCTR,NCOORD,XI end do end