The surface water model is working correctly up to the upstream distance ordering algorithm.