On ancient Mars, carbon dioxide ice kept the water running. Here's how