These temperature changes represent the conversion of mechanical energy into heat energy and are not associated with the addition or loss of heat from outside sources. Compressed air becomes warmer, expanding air becomes cooler. Some of the mechanical energy needed to force air into a confined space is converted to heat when air is compressed. Consequently, the air in a car tire warms up as tire pressure is increased or the barrel of a bicycle pump becomes warm as a tire is pumped up. When air expands it converts heat to mechanical energy so the air escaping from a punctured tire feels cooler than the surrounding air.
Air pressure decreases with altitude, therefore, air expands as it rises in the atmosphere.
The relative humidity of the air increases as cooling occurs until the air becomes saturated. At that point condensation occurs. Latent heat is released in the conversion of water from a vapor to a liquid state that occurs with condensation. The addition of the latent heat partially counteracts the cooling effect of the adiabatic temperature changes. This results in a reduction of the cooling rate to 4-9 o C per 1000 m, known as the wet adiabatic lapse rate .