	INTEGER	FUNCTION DAYS(MO,DA,YR,I)
	INTEGER	MO,DA,YR,REM		! REM IS REMAINDER
	INTEGER	DAMO(13)
	DATA	DAMO/0,31,59,90,120,151,181,212,243,273,304,334,365/
	IF(I.GE.1)CALL IDATE(MO,DA,YR)
	IF(YR.GT.1900)YR=YR-1900
200	DAYS=DAMO(MO)+DA+(YR-80)*365+(YR-80)/4
	REM=MOD(DAYS,1461)		! DIVIDE BY NO. OF DAYS IN 4 YR PER.
	IF(REM.LT.0)REM=1461-REM	! FOR YRS BEFORE 1980, REM IS NEG
	IF(REM.GT.60)DAYS=DAYS+1
	IF((REM.EQ.60).AND.(MO.EQ.3))DAYS=DAYS+1
	RETURN
	END
