      program xelong
!
!     Exercise driver for function elong
!
!     B. Knapp, 96.01.29
!
C
C     RCS DATA
C     
C     $Header$
C     
C     $Log$
C
C
      implicit none
!
!     Constants:
      integer*4 APPARENT, EQUATORIAL, SPHERICAL
      parameter (APPARENT=2, EQUATORIAL=1, SPHERICAL=1)

!     Variables:
      integer*4 p, status
      real*8 jd, pv(6), dist
!
!     Function:
      real*8 elong
!
    1 write(*,'(/a$)') ' JD, Planet ID (1-10)? '
      read(*,*) jd, p
      call ephem(jd,p,APPARENT,EQUATORIAL,SPHERICAL,pv,status)
      dist = elong(jd,pv(1),pv(2))
      write(*,'(f24.12)') dist
      goto 1
      end
