So far we have considered the International Standard Atmosphere, where temperature decreases as we go higher in the troposphere. However, this is not always the case and there can be a layer of warmer air sat above a cold layer. As we climb higher, the temperature will increase – this is called an inversion.
We know that colder air has a higher density, so the colder air below the inversion will tend to stay down low and the warmer air above (with lower density) will remain above it. A temperature inversion like this is an indication of a very stable atmosphere.
If an area of the ground is heated, the air will happily rise within the cold layer, but once it reaches the warmer air above it stops rising as it is no longer warmer than the surrounding air.
This can be seen clearly in this photo of rising smoke from a fire taken over Wales. The smoke has reached an inversion, where the temperature has increased and the smoke stops rising. Instead, the smoke remains at the same altitude and is blown horizontally by the wind.
This inversion has also trapped particles of dust, dirt, smoke etc. in the colder layer below, creating visible haze at lower altitude but clear air above.
Here is another incredible photo of an inversion. Smog over Almaty, Kazakhstan has been trapped below an inversion while the mountain peaks are perfectly clear above the inversion.