Thermodynamics of an idealized hydrologic cycle