	SUBROUTINE JDATE (W,JY,JM,JD,JH,JN)
C--FOR THE PERPETUAL JULIAN DAY D (DBL PREC) RELATIVE TO JAN 1, 1960,
C--JDATE RETURNS THE DATE AND TIME AS 5 INTEGERS.
C--THE YEAR IS 4 DIGITS.  
C--THE JULIAN DAY CAN BE CALCULATED FROM A DATE BY THE ROUTINE DAYJL.
	DOUBLE PRECISION D,E,F,T,A,B,C,W
	D=W+1.D0	!THIS MOD SEEMS TO BE NECESSARY
	E=DINT(D)
	IF (D.LT.0.D0) E=E-1.D0
	F=D-E
	T=E/365.25D0+.8355D0
	A=DINT(T)
	IF (T.LT.0.D0) A=A-1.D0
	T=365.25D0*A+.75D0
	B=DINT(T)
	IF (T.LT.0.D0) B=B-1.D0
	C=DINT((E-B+428.D0)/30.6001D0)
	JD=E-B+428.1D0-DINT(30.6001D0*C)
C	JD=E-B+429.1D0-DINT(30.6001D0*C)
	JM=C-.9D0
	IF (JM.GT.12) JM=JM-12
	JY=A+59.1D0
	IF (JM.LT.3) JY=JY+1
	jy=jy+1900
	JH=24.D0*F+.001D0
	JN=1440.D0*(F-JH/24.D0)
	IF (JH.LT.24) RETURN
	JH=JH-24
	JD=JD+1
	RETURN
	END
