      PROGRAM XHELIOS
C
C     CONSTRUCT A 30-DAY PHYSICAL EPHEMERIS OF THE SUN,
C     TO TEST AND DEMONSTRATE SUBROUTINE HELIOS
C
C     B. KNAPP, 1996-01-24, 2001-01-03, 2002-04-24 (i*4)
C
C
C     RCS DATA
C     
C     $Header$
C     
C     $Log$
C
C
      IMPLICIT NONE
      REAL*8 JD,JDATE,CARR,LAT,LON,P,DIAM,DIST
      INTEGER*4 Y,M,J
      REAL*8 D,D2R
      PARAMETER (D2R=3.14159265358979324D0/180.0D0)
C
C     EXTERNAL FUNCTIONS, SUBROUTINES
      EXTERNAL YMD2JD, HELIOS
C
      WRITE(*,'(A$)') ' STARTING YEAR, MONTH, DAY: '
      READ(*,*) Y,M,D
      CALL YMD2JD(Y,M,D,JD)
C
C     WRITE HEADER
      WRITE(*,10) Y,M,D
      DO J=0,29
         JDATE=JD+J
         CALL HELIOS(JDATE,CARR,LAT,LON,P,DIAM,DIST)
         WRITE(*,20) JDATE,DIST,P,LAT,LON,DIAM/2.0D0,CARR
      ENDDO
   10 FORMAT(
     &   /12X,'SUN''S APPARENT PHYSICAL EPHEMERIS, STARTING',
     &      I5,'/',I2,'/',F4.1/
     &   /'    JDATE       DIST       P     ',
     &    'LAT      LON    DIAM     CARR'
     &   /'    ~~~~~       ~~~~       ~     ',
     &    '~~       ~~     ~~~~     ~~~~')
   20 FORMAT(F11.1, F12.7, F7.2, F7.2,F9.2, F9.2, F9.2)
      END
