;+ ; NAME month_day.pro ; ; PURPOSE Compute month & day corresponding to a Day-Of-Year. ; ; AUTHOR Alice Lecinski HAO/NCAR mon_day.c ; ; HISTORY Andrew L. Stanger HAO/NCAR 19 Nov 2002 ; 19 Nov 2002: Convert from C to IDL. ; ;- PRO month_day, doy, year, month, day day_tab = INTARR (13, 2) day_tab [*, 0] = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] day_tab [*, 1] = [0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] leap = (y4 EQ 0) AND (y100 NE 0) OR (y400 EQ 0) ii = 1 WHILE (doy GT day_tab [ii, leap]) DO $ BEGIN doy = doy - day_tab [ii, leap] ii = ii + 1 END month = ii ; day = doy ; END