Norm,
A long time ago, someone suplied me JDATE, which calculates the number of days since some nominal day. I think that it copes with a leap century every 400 years. It would be easy to check.
integer*4 year, month, day, days, next, jdate
external jdate
!
month = 1
day = 1
!
do year = 0,2000
days = jdate (year, month, day)
next = jdate (year+1, month, day)
if (next-days /= 365 .or. year<4) &
write (*,*) year, days, next-days
end do
end
integer*4 FUNCTION jdate (year,month,day)
!
! Converts DAY/MONTH/YEAR to a Julian day
!
INTEGER*4 day, month, year
!
! 'Tony T. Warnock' <u091889@lanl.gov>
! Sent by: fortran-owner@lahey.com
! 31/10/2002 02:04 AM
!
! jdate = 367*year
! 1 - 7*(year+(month+9)/12)/4
! 1 - 3*((year+(month-9)/7)/100+1)/4
! 1 + 275*month/9+day
! 1 - 730516
!
jdate = 367*year &
- 7*(year+(month+9)/12)/4 &
- 3*((year+(month-9)/7)/100+1)/4 &
+ (275*month)/9 - 30 &
+ day-1
! - 366 ! 1/1/1
! - 584388 ! 1600/1/1
! - 693961 ! 1900/1/1
! - 723180 ! 1980/1/1
! - 726833 ! 1990/1/1
! - 728659 ! 1995/1/1
! - 730485 ! 2000/1/1
!
END FUNCTION jdate