In meteorology, an inversion is a deviation from the normal change of an atmospheric property with altitude. It almost always refers to an inversion of the air temperature lapse rate, in which case it is called a temperature inversion. Normally, air temperature decreases with an increase in altitude, but during an inversion warmer air is held above cooler air.
An inversion traps air pollution, such as smog, close to the ground. An inversion can also suppress convection by acting as a "cap". If this cap is broken for any of several reasons, convection of any moisture present can then erupt into violent thunderstorms. Temperature inversion can notoriously result in freezing rain in cold climates.
Usually, within the lower atmosphere (the troposphere) the air near the surface of the Earth is warmer than the air above it, largely because the atmosphere is heated from below as solar radiation warms the Earth's surface, which in turn then warms the layer of the atmosphere directly above it, e.g., by thermals (convective heat transfer). Air temperature also decreases with an increase in altitude because higher air is at lower pressure, and lower pressure results in a lower temperature, following the ideal gas law and adiabatic lapse rate.
Under the right conditions, the normal vertical temperature gradient is inverted so that the air is colder near the surface of the Earth. This can occur when, for example, a warmer, less-dense air mass moves over a cooler, denser air mass. This type of inversion occurs in the vicinity of warm fronts, and also in areas of oceanic upwelling such as along the California coast in the United States. With sufficient humidity in the cooler layer, fog is typically present below the inversion cap. An inversion is also produced whenever radiation from the surface of the earth exceeds the amount of radiation received from the sun, which commonly occurs at night, or during the winter when the sun is very low in the sky. This effect is virtually confined to land regions as the ocean retains heat far longer.