integer function mjdn(d,m,y) integer d,m,y,j c c function returns the modified julian day number (MJDN) given a date (year, c month, day) in the (modern) gregorian calendar. Does not work for years c less than 0 (2 BC or earlier). c MJDN of Nov 17 1858 is 1. This is the day whose Modified c Julian Date (MJD) spans the range 0.0 - 1.0, MJD being the time in days since c 00:00 on Nov 17 1858. MJD is Julian Date - 2400000.5. c j= 367*y - 7*(y+(m+9)/12)/4 - 3*((y+(m-9)/7)/100+1)/4 + + 275*m/9 + d + 1721029 c mjdn=j mjdn=j-2400000 return end c c Nov 17 1858 has a Julian Day Number of 2 400 001 c a Julian date of 2 400 000.5 to 2 400 001.5 c a MJDN of 1 c a MJ date of 0.0 to 1.0 c c So the JDN is the average of the JD for that day (midnight to midnight) c the MJDN is the MJD at the end (midnight, 24:00) of the day. c c MJD = MJDN-1 + hours/24.0 c JD = JDN + (hours-12.0)/24.0 c MJDN = JDN - 2 400 000 c MJD = JD - 2 400 000.5 c MJDN = int(MJD) + 1 c JDN = int(JD + 0.5) c