Gregorian year/month/day to Julian year/day of year and reverse conversion for the Hewlett-Packard 32SII hand held calculator Author: Leif Harcke Date: September 2003 References: Gregorian -> DOY uses algoritm from _Astronomical Algorithms_ by Meeus attributed to U.S. Naval Observatory microcomputer almanac from 1978. DOY -> Gregorian uses algorithm from Meeus attributed to personal correspondence with ... Use: XEQ G to find a Gregorian month/day given a day of year. Program displays YYYYPDOY to indicate intput format. Press run/stop (R/S) and program prompts for Julian dear/doy e.g. J?2003.254. Enter a date/doy and press R/S. Program computes and displays Gregorian year/month/day in format YYYY.MMDD. XEQ J to find a Julian day number given a Gregorian month and day. Prompts and input are similar. Variables: G = Gregorian date in YYYY.MMDD format Y = 4 digit Gregorian year M = month (range 1-12) D = day (range 1-31) J = Julian date in YYYY.DOY format N = day of year (range 1 - 366) K = 1 for bisextile (leap) year, 2 for common (non-leap) year ---- begin program listing ---- # Mnemonic G = Gregorian. Entry point for computing Gregorian # calendar date from Julian day number. G01 LBL G G02 SF 10 # show eqns as text G03 EQN YYYYPDOY # display input format e.g. 2003.260 G04 FIX 3 # use only 3 places after decimal G05 INPUT J # prompt user for Julian date G06 IP # integer part is yar G07 STO Y G08 XEQ L # subroutine to test for leap year G09 RCL J G10 FP # fractional part of J is day of year G11 1000 G12 * G13 STO N G14 1 G15 STO M G16 32 G17 RCL N G18 x