Sources and sinks of entropy in the atmosphere