Development of an algorithm for using weather-dependent dynamic speed limits to enhance safety