Earth's atmosphere

# Overview
The Earth's atmosphere is a layer of gases surrounding the planet Earth and retained by the Earth's gravity. It contains roughly (by molar content/volume) 78.08% nitrogen, 20.95% oxygen, 0.93% argon, 0.038% carbon dioxide, trace amounts of other gases, and a variable amount (average around 1%) of water vapor. This mixture of gases is commonly known as air. The atmosphere protects life on Earth by absorbing ultraviolet solar radiation and reducing temperature extremes between day and night.
There is no definite boundary between the atmosphere and outer space. It slowly becomes thinner and fades into space. Three quarters of the atmosphere's mass is within 11 km of the planetary surface. In the United States, people who travel above an altitude of 80.5 km (50 statute miles) are designated astronauts. An altitude of 120 km (~75 miles or 400,000 ft) marks the boundary where atmospheric effects become noticeable during re-entry. The Karman line, at 100 km (62 miles or 328,000 ft), is also frequently regarded as the boundary between atmosphere and outer space.

# Temperature and layers
The temperature of the Earth's atmosphere varies with altitude; the mathematical relationship between temperature and altitude varies among five different atmospheric layers (ordered highest to lowest, the ionosphere is part of the thermosphere):
- Exosphere: from 500  1000 km (300  600 mi) up to 10,000 km (6,000 mi), free-moving particles that may migrate into and out of the magnetosphere or the solar wind.
- Ionosphere: is the part of the atmosphere that is ionized by solar radiation. It plays an important part in atmospheric electricity and forms the inner edge of the magnetosphere. It has practical importance because, among other functions, it influences radio propagation to distant places on the Earth. It is located in the thermosphere and is responsible for auroras.
- Thermosphere: from 80  85 km (265,000  285,000 ft) to 640+ km (400+ mi), temperature increasing with height.
- Mesosphere: From the Greek word "" meaning middle. The mesosphere extends from about 50 km (160,000 ft) to the range of 80 to 85 km (265,000  285,000 ft), temperature decreasing with height. This is also where most meteors burn up when entering the atmosphere.
- Stratosphere: From the Latin word "stratus" meaning a spreading out. The stratosphere extends from the troposphere's 7 to 17 km (23,000  60,000 ft) range to about 50 km (160,000 ft). Temperature increases with height. The stratosphere contains the ozone layer, the part of the Earth's atmosphere which contains relatively high concentrations of ozone. "Relatively high" means a few parts per millionmuch higher than the concentrations in the lower atmosphere but still small compared to the main components of the atmosphere. It is mainly located in the lower portion of the stratosphere from approximately 15 to 35 km (50,000  115,000 ft) above Earth's surface, though the thickness varies seasonally and geographically.
- Troposphere: From the Greek word "" meaning to turn or change. The troposphere is the lowest layer of the atmosphere; it begins at the surface and extends to between 7 km (23,000 ft) at the poles and 17 km (60,000 ft) at the equator, with some variation due to weather factors. The troposphere has a great deal of vertical mixing due to solar heating at the surface. This heating warms air masses, which makes them less dense so they rise. When an air mass rises the pressure upon it decreases so it expands, doing work against the opposing pressure of the surrounding air. To do work is to expend energy, so the temperature of the air mass decreases. As the temperature decreases, water vapor in the air mass may condense or solidify, releasing latent heat that further uplifts the air mass. This process determines the maximum rate of decline of temperature with height, called the adiabatic lapse rate. It contains roughly 80% of the total mass of the atmosphere. 50% of the total mass of the atmosphere is located in the lower 5 km of the troposphere.
The average temperature of the atmosphere at the surface of Earth is 15 C (59 F).

# Pressure and thickness
The average atmospheric pressure, at sea level, is about 101.3 kilopascals (about 14.7 psi); total atmospheric mass is 5.14801018 kg .
Atmospheric pressure is a direct result of the total weight of the air above the point at which the pressure is measured. This means that air pressure varies with location and time, because the amount (and weight) of air above the earth varies with location and time.  However the average mass of the air above a square meter of the earth's surface is known to the same high accuracy as the total air mass of 5148.0 teratonnes and area of the earth of 51007.2 megahectares, namely 5148.0/510.072 = 10.093 metric tonnes, corresponding to 14.356 lbs (mass) per square inch, about 2.5% below the officially standardized unit atmosphere (1 atm) of 101.325 kPa or 14.696 psi.
Atmospheric pressure decreases with height, dropping by 50% at an altitude of about 5.6 km (18,000 ft). For comparison: Mount Everest is higher, at 8.8 km, which is why it is so difficult to climb without supplemental oxygen. Equivalently, about 50% of the total atmospheric mass is within the lowest 5.6 km. This pressure drop is approximately exponential, so that pressure decreases by approximately half every 5.6 km. However, because of changes in temperature throughout the atmospheric column, as well as the fact that the force of gravity begins to decrease at great altitudes, a single equation does not model atmospheric pressure through all altitudes (it is modeled in 7 exponentially decreasing layers, in the equations given above).
Even in the exosphere, the atmosphere is still present (as can be seen for example by the effects of atmospheric drag on satellites).
The equations of pressure by altitude in the above references can be used directly to estimate atmospheric thickness. However, the following published data are given for reference:- 
- 50% of the atmosphere by mass is below an altitude of 5.6 km.
- 90% of the atmosphere by mass is below an altitude of 16 km. The common altitude of commercial airliners is about 10 km.
- 99.99997% of the atmosphere by mass is below 100 km. The highest X-15 plane flight in 1963 reached an altitude of 354,300 ft (107,990.64 m).
Therefore, most of the atmosphere (99.9997%) is below 100 km, although in the rarefied region above this there are auroras and other atmospheric effects.

# Composition
The mean molar mass of air is 28.97 g/mol. Note that the composition figures above are by volume-fraction (V%), which for ideal gases is equal to mole-fraction (that is, fraction of total molecules). By contrast, mass-fraction abundances of gases, particularly for gases with significantly different molecular (molar) mass from that of air will differ from those by volume. For example, in air, helium is 5.2 ppm by volume-fraction and mole-fraction, but only about (4/29)  5.2 ppm = 0.72 ppm by mass-fraction.

## Heterosphere
Below the turbopause at an altitude of about 100 km (not far from the mesopause), the Earth's atmosphere has a more-or-less uniform composition (apart from water vapor) as described above; this constitutes the homosphere. However, above about 100 km, the Earth's atmosphere begins to have a composition which varies with altitude. This is essentially because, in the absence of mixing, the density of a gas falls off exponentially with increasing altitude, but at a rate which depends on the molar mass. Thus higher mass constituents, such as oxygen and nitrogen, fall off more quickly than lighter constituents such as helium, molecular hydrogen, and atomic hydrogen. Thus there is a layer, called the heterosphere, in which the earth's atmosphere has varying composition. As the altitude increases, the atmosphere is dominated successively by helium, molecular hydrogen, and atomic hydrogen. The precise altitude of the heterosphere and the layers it contains varies significantly with temperature. After loss of the hydrogen, helium and other hydrogen-containing gases from early Earth due to the Sun's radiation, primitive Earth was devoid of an atmosphere. The first atmosphere was formed by outgassing of gases trapped in the interior of the early Earth, which still goes on today in volcanoes.   

# Density and mass
The density of air at sea level is about 1.2 kg/m3(1.2 g/L). Natural variations of the barometric pressure occur at any one altitude as a consequence of weather. This variation is relatively small for inhabited altitudes but much more pronounced in the outer atmosphere and space due to variable solar radiation.
The atmospheric density decreases as the altitude increases. This variation can be approximately modeled using the barometric formula. More sophisticated models are used by meteorologists and space agencies to predict weather and orbital decay of satellites.
The average mass of the atmosphere is about 5 quadrillion metric tons or 1/1,200,000 the mass of Earth. According to the National Center for Atmospheric Research, "The total mean mass of the atmosphere is 5.1480Template:E kg with an annual range due to water vapor of 1.2 or 1.5Template:E kg depending on whether surface pressure or water vapor data are used; somewhat smaller than the previous estimate. The mean mass of water vapor is estimated as 1.27Template:E kg and the dry air mass as 5.1352 0.0003Template:E kg."

# Evolution on Earth
The history of the Earth's atmosphere prior to one billion years ago is poorly understood and an active area of scientific research. The following discussion presents a plausible scenario.
The modern atmosphere is sometimes referred to as Earth's "third atmosphere", in order to distinguish the current chemical composition from two notably different previous compositions. The original atmosphere was primarily helium and hydrogen. Heat from the still-molten crust, and the sun, plus a probably enhanced solar wind, dissipated this atmosphere.
About 4.4 billion years ago, the surface had cooled enough to form a crust, still heavily populated with volcanoes which released steam, carbon dioxide, and ammonia. This led to the early "second atmosphere", which was primarily carbon dioxide and water vapor, with some nitrogen but virtually no oxygen. This second atmosphere had approximately 100 times as much gas as the current atmosphere, but as it cooled much of the carbon dioxide was dissolved in the seas and precipitated out as carbonates. The later "second atmosphere" contained largely nitrogen and carbon dioxide. However, simulations run at the University of Waterloo and University of Colorado in 2005 suggest that it may have had up to 40% hydrogen. It is generally believed that the greenhouse effect, caused by high levels of carbon dioxide and methane, kept the Earth from freezing.
One of the earliest types of bacteria was the cyanobacteria. Fossil evidence indicates that bacteria shaped like these existed approximately 3.3 billion years ago and were the first oxygen-producing evolving phototropic organisms. They were responsible for the initial conversion of the earth's atmosphere from an anoxic state to an oxic state (that is, from a state without oxygen to a state with oxygen) during the period 2.7 to 2.2 billion years ago. Being the first to carry out oxygenic photosynthesis, they were able to produce oxygen while sequestering carbon dioxide in organic molecules, playing a major role in oxygenating the atmosphere.
Photosynthesising plants would later evolve and continue releasing oxygen and sequestering carbon dioxide. Over time, excess carbon became locked in fossil fuels, sedimentary rocks (notably limestone), and animal shells. As oxygen was released, it reacted with ammonia to release nitrogen; in addition, bacteria would also convert ammonia into nitrogen. But most of the nitrogen currently present in the atmosphere results from sunlight-powered photolysis of ammonia released steadily over the aeons from volcanoes.
As more plants appeared, the levels of oxygen increased significantly, while carbon dioxide levels dropped. At first the oxygen combined with various elements (such as iron), but eventually oxygen accumulated in the atmosphere, resulting in mass extinctions and further evolution. With the appearance of an ozone layer (ozone is an allotrope of oxygen) lifeforms were better protected from ultraviolet radiation. This oxygen-nitrogen atmosphere is the "third atmosphere". 200  250 million years ago, up to 35% of the atmosphere was oxygen (as found in bubbles of ancient atmosphere were found in an amber).
This modern atmosphere has a composition which is enforced by oceanic blue-green algae as well as geological processes. O2 does not remain naturally free in an atmosphere, but tends to be consumed (by inorganic chemical reactions, and by animals, bacteria, and even land plants at night), and CO2 tends to be produced by respiration and decomposition and oxidation of organic matter. Oxygen would vanish within a few million years due to chemical reactions and CO2 dissolves easily in water and would be gone in millennia if not replaced. Both are maintained by biological productivity and geological forces seemingly working hand-in-hand to maintain reasonably steady levels over millions of years (see Gaia theory).

# Air pollution
Air pollution is a chemical, physical (e.g. particulate matter) or biological agent that modifies the natural characteristics of the atmosphere in an unwanted way. Stratospheric ozone depletion due to air pollution (chiefly from chlorofluorocarbons) has long been recognized as a threat to human health as well as to the earth's ecosystems.
Worldwide air pollution is responsible for large numbers of deaths and cases of respiratory disease. Enforced air quality standards, like the Clean Air Act in the United States, have reduced the presence of some pollutants. While major stationary sources are often identified with air pollution, the greatest source of emissions is actually mobile sources, principally the automobile. Gases such as carbon dioxide, methane, and fluorocarbons contribute to global warming, and these gases, or excess amounts of some emitted from fossil fuel burning, have recently been identified by the United States and many other countries (see Kyoto accord), as pollutants.