        SUBROUTINE JULDA(YEAR,MONTH,DAY,DATE,GMST)
C
C               Returns DATE = Julian Date and GMST = Greenwich Mean
C               sidereal time at 0 hrs U.T. on day DAY/MONTH/YEAR.
C               TJP 1977 August 5
C               NB Accuracy not tested; GMST is correct at least to
C               nearest second
C
        INTEGER DAY,MONTH,YEAR
        INTEGER MOFF(12)
        REAL*8 DATE,GMST,DU,SMD,T,DFLOAT,DMOD
        DATA MOFF/0,31,59,90,120,151,181,212,243,273,304,334/
C
C               JD number at 12 hrs UT on Jan 0 of year YEAR:
C               (Gregorian Calendar)
C
        NYRM1=YEAR-1
        IC=NYRM1/100
        JD=1721425 + 365*NYRM1 + NYRM1/4 - IC + IC/4
C
C               Number of days from Standard Epoch 1900 Jan 0.5
C               (JD 2415020.0) to Jan 0.0 of YEAR:
C
        DU=DFLOAT(JD-2415020) - 0.5D0
C
C               Day number; is it a leap year?
C
        NDAYS=MOFF(MONTH) + DAY
        IF(MONTH.GT.2 .AND. MOD(YEAR,4).EQ.0 .AND. MOD(YEAR,100).NE.0)
     1     NDAYS=NDAYS+1
C
C               UT from Epoch to today (days), (centuries)
C
        SMD=DU+DFLOAT(NDAYS)
        T=SMD/36525.D0
C
C               Greenwich Mean Sidereal Time
C
        GMST= DFLOAT(6*3600 + 38*60) +45.836D0
     1     + 8 640 184.542D0*T  +  0.0929D0*T**2
        GMST=DMOD(GMST,86400D0)
C
C
        DATE=2415020.D0+SMD
C
        RETURN
        END

