;+ ; NAME: ; JDAY2DATE ; ; PURPOSE: ; This procedure converts julian day to date. ; ; CALLING SEQUENCE: ; JDAY2DATE, JDAY, MO, DY, YR ; ; INPUTS: ; JDAY (Integer) Julian day. ; ; OUTPUTS: ; MO (Integer) Month of the year. ; DY (Integer) Day of the month. ; YR (Integer) Year. ;- pro jday2date, jday, mo, dy, yr day_of_yr = [31,28,31,30,31,30,31,31,30,31,30,31] day_of_leapyr = [31,29,31,30,31,30,31,31,30,31,30,31] if (yr MOD 4) EQ 0 then days = day_of_leapyr $ else days = day_of_yr dy = FIX(jday) mo = 0 while dy GT days(mo) do begin dy = dy - days(mo) mo = mo + 1 endwhile mo = mo + 1 end