Why does warm coke go flat?

The amount of carbon dioxide depends on the external pressure, and temperature.