function ulf_next_day, date

;Created: Mark Chutter, UNH
;June 1, 2016
;
;Modified:
;
;Description:
;determine the date after input date and return

year = strmid(date, 0, 4)
month = strmid(date, 4, 2)
day = strmid(date, 6, 2)

year_out = year
month_out = month
day_out = day

if month eq '01' and day eq '31' then begin
    month_out = '02'
    day_out = '01'
endif else if year eq '2004' and month eq '02' and day eq '29' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2005' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2006' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2007' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2008' and month eq '02' and day eq '29' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2009' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2010' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2011' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2012' and month eq '02' and day eq '29' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2013' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2014' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2015' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2016' and month eq '02' and day eq '29' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2017' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2018' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2019' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2020' and month eq '02' and day eq '29' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2021' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2022' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2023' and month eq '02' and day eq '28' then begin
    month_out = '03'
    day_out = '01'
endif else if year eq '2024' and month eq '02' and day eq '29' then begin
    month_out = '03'
    day_out = '01'
endif else if month eq '03' and day eq '31' then begin
    month_out = '04'
    day_out = '01'
endif else if month eq '04' and day eq '30' then begin
    month_out = '05'
    day_out = '01'
endif else if month eq '05' and day eq '31' then begin
    month_out = '06'
    day_out = '01'
endif else if month eq '06' and day eq '30' then begin
    month_out = '07'
    day_out = '01'
endif else if month eq '07' and day eq '31' then begin
    month_out = '08'
    day_out = '01'
endif else if month eq '08' and day eq '31' then begin
    month_out = '09'
    day_out = '01'
endif else if month eq '09' and day eq '30' then begin
    month_out = '10'
    day_out = '01'
endif else if month eq '10' and day eq '31' then begin
    month_out = '11'
    day_out = '01'
endif else if month eq '11' and day eq '30' then begin
    month_out = '12'
    day_out = '01'
endif else if month eq '12' and day eq '31' then begin

    month_out = '01'
    day_out = '01'
    if year eq '2004' then year_out = '2005'
    if year eq '2005' then year_out = '2006'
    if year eq '2006' then year_out = '2007'
    if year eq '2007' then year_out = '2008'
    if year eq '2008' then year_out = '2009'
    if year eq '2009' then year_out = '2010'
    if year eq '2010' then year_out = '2011'
    if year eq '2011' then year_out = '2012'
    if year eq '2012' then year_out = '2013'
    if year eq '2013' then year_out = '2014'
    if year eq '2014' then year_out = '2015'
    if year eq '2015' then year_out = '2016'
    if year eq '2016' then year_out = '2017'
    if year eq '2017' then year_out = '2018'
    if year eq '2018' then year_out = '2019'
    if year eq '2019' then year_out = '2020'
    if year eq '2020' then year_out = '2021'
    if year eq '2021' then year_out = '2022'
    if year eq '2022' then year_out = '2023'
    if year eq '2023' then year_out = '2024'
    if year eq '2024' then year_out = '2025'

endif else begin

    day_out = strcompress(string(fix(day) + 1), /remove_all)
    if strlen(day_out) eq 1 then day_out = '0' + day_out

endelse

return, year_out + month_out + day_out

end