Improvements in water quality could reduce the ecological impact of climate change on rivers, finds a new study.