A thermocline (also known as the thermal layer or the metalimnion in lakes) is a thin but distinct layer in a large body of fluid (e.g. water, as in an ocean or lake; or air, e.g. an atmosphere) in which temperature changes more drastically with depth than it does in the layers above or below. In the ocean, the thermocline divides the upper mixed layer from the calm deep water below.
Depending largely on season, latitude, and turbulent mixing by wind, thermoclines may be a semi-permanent feature of the body of water in which they occur, or they may form temporarily in response to phenomena such as the radiative heating/cooling of surface water during the day/night. Factors that affect the depth and thickness of a thermocline include seasonal weather variations, latitude, and local environmental conditions, such as tides and currents.
For the use of ocean thermoclines to generate energy, see Ocean thermal energy conversion.
Most of the heat energy of the sunlight that strikes the Earth is absorbed in the first few centimeters at the ocean's surface, which heats during the day and cools at night as heat energy is lost to space by radiation. Waves mix the water near the surface layer and distribute heat to deeper water such that the temperature may be relatively uniform in the upper 100 metres (330 ft), depending on wave strength and the existence of surface turbulence caused by currents. Below this mixed layer, the temperature remains relatively stable over day/night cycles. The temperature of the deep ocean drops gradually with depth. As saline water does not freeze until it reaches −2.3 °C (27.9 °F) (colder as depth and pressure increase) the temperature well below the surface is usually not far from zero degrees.
The thermocline varies in depth. It is semi-permanent in the tropics, variable in temperate regions and shallow to nonexistent in the polar regions, where the water column is cold from the surface to the bottom. A layer of sea ice will act as an insulation blanket. The first accurate global measurements were made during the oceanographic expedition of HMS Challenger.
In the open ocean, the thermocline is characterized by a negative sound speed gradient, making the thermocline important in submarine warfare because it can reflect active sonar and other acoustic signals. This stems from a discontinuity in the acoustic impedance of water created by the sudden change in density.
In scuba diving, a thermocline where water drops in temperature by a few degrees Celsius quite suddenly can sometimes be observed between two bodies of water, for example where colder upwelling water runs into a surface layer of warmer water. It gives the water an appearance of wrinkled glass, the kind often used in bathroom windows to obscure the view, and is caused by the altered refractive index of the cold or warm water column. These same schlieren can be observed when hot air rises off the tarmac at airports or desert roads and is the cause of mirages.
The thermocline in the ocean can vary in depth and strength seasonally. This is particularly noticeable in mid-latitudes with a thicker mixed layer in the winter and thinner mixed layer in summer. The cooler winter temperatures cause the thermocline to drop to further depths and warmed summer temperatures bring the thermocline back to the upper layer. In areas around the tropics and subtropics, the thermocline may become even thinner in the summer than in other locations. At higher latitudes, around the poles, there is more of a seasonal thermocline than a permanent one with warmer surface waters. This is where there is a dichothermal layer instead.
In the Northern hemisphere, the maximum temperatures at the surface occur through August and September and minimum temperatures occur through February and March with total heat content being lowest in March.  This is when the seasonal thermocline starts to build back up after being broken down through the colder months.
A permanent thermocline is one that is not affected by season and lies below the yearly mixed layer maximum depth.
Thermoclines can also be observed in lakes. In colder climates, this leads to a phenomenon called stratification. During the summer, warm water, which is less dense, will sit on top of colder, denser, deeper water with a thermocline separating them. The warm layer is called the epilimnion and the cold layer is called the hypolimnion. Because the warm water is exposed to the sun during the day, a stable system exists and very little mixing of warm water and cold water occurs, particularly in calm weather.
One result of this stability is that as the summer wears on, there is less and less oxygen below the thermocline as the water below the thermocline never circulates to the surface and organisms in the water deplete the available oxygen. As winter approaches, the temperature of the surface water will drop as nighttime cooling dominates heat transfer. A point is reached where the density of the cooling surface water becomes greater than the density of the deep water and overturning begins as the dense surface water moves down under the influence of gravity. This process is aided by wind or any other process (currents for example) that agitates the water. This effect also occurs in Arctic and Antarctic waters, bringing water to the surface which, although low in oxygen, is higher in nutrients than the original surface water. This enriching of surface nutrients may produce blooms of phytoplankton, making these areas productive.
As the temperature continues to drop, the water on the surface may get cold enough to freeze and the lake/ocean begins to ice over. A new thermocline develops where the densest water (4 °C (39 °F)) sinks to the bottom, and the less dense water (water that is approaching the freezing point) rises to the top. Once this new stratification establishes itself, it lasts until the water warms enough for the 'spring turnover,' which occurs after the ice melts and the surface water temperature rises to 4 °C. During this transition, a thermal bar may develop.
Waves can occur on the thermocline, causing the depth of the thermocline as measured at a single location to oscillate (usually as a form of seiche). Alternately, the waves may be induced by flow over a raised bottom, producing a thermocline wave which does not change with time, but varies in depth as one moves into or against the flow.
The lower atmosphere also typically contains a boundary between two distinct regions (the troposphere and stratosphere), but that boundary (the tropopause) displays quite different behavior. However, atmospheric thermoclines, or inversions, can occur, e.g. as nighttime cooling of the Earth's surface produces cold, dense, often calm air adjacent to the ground. The coldest air is adjacent to the ground, with the air temperature increasing with height. At the top of this nighttime boundary layer (which may be only a hundred meters thick), the normal adiabatic temperature profile of the troposphere (i.e. temperature decreasing with altitude) is again observed. The thermocline or inversion layer occurs where the temperature profile changes from positive to negative with increasing height. The stability of the night-time inversion is usually destroyed soon after sunrise as the sun's energy warms the ground, which in turn warms the air in the inversion layer. The warmer, less dense air then rises, thereby destroying the stability that characterizes the nightly inversion.
This phenomenon was first applied to the field of noise pollution study in the 1960s, contributing to the design of urban highways and noise barriers.