SLA_DJCAL

MJD to Gregorian for Output

ACTION:
Modified Julian Date to Gregorian Calendar Date, expressed in a form convenient for formatting messages (namely rounded to a specified precision, and with the fields stored in a single array).
CALL:
CALL sla_DJCAL (NDP, DJM, IYMDF, J)
GIVEN:

NDP

I

number of decimal places of days in fraction

DJM

D

modified Julian Date (JD2400000.5)


RETURNED:

IYMDF

I(4)

year, month, day, fraction in Gregorian calendar

J

I

status: nonzero = out of range


NOTES:
(1)
Any date after 4701BC March 1 is accepted.
(2)
Large NDP values risk internal overflows. It is typically safe to use up to NDP=4.
REFERENCE:
The algorithm is adapted from Hatcher, Q. Jl. R. astr. Soc. (1984) 25, 53-55.