simplified yearrun calc, added maxdategap
created logvalidcompare as a separate variable, cleaned up commented code
moved SnowMelt processing inside year loop