Magma

Magma is the molten or semi-molten natural material from which all igneous rocks are formed. Magma (sometimes colloquially but incorrectly referred to as lava by laypeople) is found beneath the surface of the Earth, and evidence of magmatism has also been discovered on other terrestrial planets and some natural satellites. Besides molten rock, magma may also contain suspended crystals and gas bubbles.

Magma is produced by melting of the mantle or the crust in various tectonic settings, which on Earth include subduction zones, continental rift zones, mid-ocean ridges and hotspots. Mantle and crustal melts migrate upwards through the crust where they are thought to be stored in magma chambers or trans-crustal crystal-rich mush zones. During magma's storage in the crust, its composition may be modified by fractional crystallization, contamination with crustal melts, magma mixing, and degassing. Following its ascent through the crust, magma may feed a volcano and be extruded as lava, or it may solidify underground to form an intrusion, such as a dike, a sill, a laccolith, a pluton, or a batholith.

While the study of magma has relied on observing magma after its transition into a lava flow, magma has been encountered in situ three times during geothermal drilling projects, twice in Iceland (see Use in energy production) and once in Hawaii.

Physical and chemical properties
Magma consists of liquid rock that usually contains suspended solid crystals. As magma approaches the surface and the overburden pressure drops, dissolved gases bubble out of the liquid, so that magma near the surface consists of materials in solid, liquid, and gas phases.

Composition
Most magma is rich in silica. Rare nonsilicate magma can form by local melting of nonsilicate mineral deposits or by separation of a magma into separate immiscible silicate and nonsilicate liquid phases.

Silicate magmas are molten mixtures dominated by oxygen and silicon, the most abundant chemical elements in the Earth's crust, with smaller quantities of aluminium, calcium, magnesium, iron, sodium, and potassium, and minor amounts of many other elements. Petrologists routinely express the composition of a silicate magma in terms of the weight or molar mass fraction of the oxides of the major elements (other than oxygen) present in the magma.

Because many of the properties of a magma (such as its viscosity and temperature) are observed to correlate with silica content, silicate magmas are divided into four chemical types based on silica content: felsic, intermediate, mafic, and ultramafic.

Felsic magmas
Felsic or silicic magmas have a silica content greater than 63%. They include rhyolite and dacite magmas. With such a high silica content, these magmas are extremely viscous, ranging from 108 cP (105 Pa⋅s) for hot rhyolite magma at 1200 C to 1011 cP (108 Pa⋅s) for cool rhyolite magma at 800 C. For comparison, water has a viscosity of about 1 cP (0.001 Pa⋅s). Because of this very high viscosity, felsic lavas usually erupt explosively to produce pyroclastic (fragmental) deposits. However, rhyolite lavas occasionally erupt effusively to form lava spines, lava domes or "coulees" (which are thick, short lava flows). The lavas typically fragment as they extrude, producing block lava flows. These often contain obsidian.

Felsic lavas can erupt at temperatures as low as 800 °C. Unusually hot (>950 °C; >1,740 °F) rhyolite lavas, however, may flow for distances of many tens of kilometres, such as in the Snake River Plain of the northwestern United States.

Intermediate magmas
Intermediate or andesitic magmas contain 52% to 63% silica, and are lower in aluminium and usually somewhat richer in magnesium and iron than felsic magmas. Intermediate lavas form andesite domes and block lavas, and may occur on steep composite volcanoes, such as in the Andes. They are also commonly hotter, in the range of 850 to 1100 °C). Because of their lower silica content and higher eruptive temperatures, they tend to be much less viscous, with a typical viscosity of 3.5 × 106 cP (3,500 Pa⋅s) at 1200 C. This is slightly greater than the viscosity of smooth peanut butter. Intermediate magmas show a greater tendency to form phenocrysts. Higher iron and magnesium tends to manifest as a darker groundmass, including amphibole or pyroxene phenocrysts.

Mafic magmas
Mafic or basaltic magmas have a silica content of 52% to 45%. They are typified by their high ferromagnesian content, and generally erupt at temperatures of 1100 to 1200 °C. Viscosities can be relatively low, around 104 to 105 cP (10 to 100 Pa⋅s), although this is still many orders of magnitude higher than water. This viscosity is similar to that of ketchup. Basalt lavas tend to produce low-profile shield volcanoes or flood basalts, because the fluidal lava flows for long distances from the vent. The thickness of a basalt lava, particularly on a low slope, may be much greater than the thickness of the moving lava flow at any one time, because basalt lavas may "inflate" by supply of lava beneath a solidified crust. Most basalt lavas are of ʻAʻā or pāhoehoe types, rather than block lavas. Underwater, they can form pillow lavas, which are rather similar to entrail-type pahoehoe lavas on land.

Ultramafic magmas
Ultramafic magmas, such as picritic basalt, komatiite, and highly magnesian magmas that form boninite, take the composition and temperatures to the extreme. All have a silica content under 45%. Komatiites contain over 18% magnesium oxide, and are thought to have erupted at temperatures of 1600 °C. At this temperature there is practically no polymerization of the mineral compounds, creating a highly mobile liquid. Viscosities of komatiite magmas are thought to have been as low as 100 to 1000 cP (0.1 to 1 Pa⋅s), similar to that of light motor oil. Most ultramafic lavas are no younger than the Proterozoic, with a few ultramafic magmas known from the Phanerozoic in Central America that are attributed to a hot mantle plume. No modern komatiite lavas are known, as the Earth's mantle has cooled too much to produce highly magnesian magmas.

Alkaline magmas
Some silicic magmas have an elevated content of alkali metal oxides (sodium and potassium), particularly in regions of continental rifting, areas overlying deeply subducted plates, or at intraplate hotspots. Their silica content can range from ultramafic (nephelinites, basanites and tephrites) to felsic (trachytes). They are more likely to be generated at greater depths in the mantle than subalkaline magmas. Olivine nephelinite magmas are both ultramafic and highly alkaline, and are thought to have come from much deeper in the mantle of the Earth than other magmas.

Non-silicate magmas
Some lavas of unusual composition have erupted onto the surface of the Earth. These include:
 * Carbonatite and natrocarbonatite lavas are known from Ol Doinyo Lengai volcano in Tanzania, which is the sole example of an active carbonatite volcano. Carbonatites in the geologic record are typically 75% carbonate minerals, with lesser amounts of silica-undersaturated silicate minerals (such as micas and olivine), apatite, magnetite, and pyrochlore. This may not reflect the original composition of the lava, which may have included sodium carbonate that was subsequently removed by hydrothermal activity, though laboratory experiments show that a calcite-rich magma is possible. Carbonatite lavas show stable isotope ratios indicating they are derived from the highly alkaline silicic lavas with which they are always associated, probably by separation of an immiscible phase. Natrocarbonatite lavas of Ol Doinyo Lengai are composed mostly of sodium carbonate, with about half as much calcium carbonate and half again as much potassium carbonate, and minor amounts of halides, fluorides, and sulphates. The lavas are extremely fluid, with viscosities only slightly greater than water, and are very cool, with measured temperatures of 491 to 544 C.
 * Iron oxide magmas are thought to be the source of the iron ore at Kiruna, Sweden which formed during the Proterozoic. Iron oxide lavas of Pliocene age occur at the El Laco volcanic complex on the Chile-Argentina border. Iron oxide lavas are thought to be the result of immiscible separation of iron oxide magma from a parental magma of calc-alkaline or alkaline composition. When erupted, the temperature of the molten iron oxide magma is about 700 to 800 C.
 * Sulfur lava flows up to 250 m long and 10 m wide occur at Lastarria volcano, Chile. They were formed by the melting of sulfur deposits at temperatures as low as 113 °C.

Magmatic gases
The concentrations of different gases can vary considerably. Water vapor is typically the most abundant magmatic gas, followed by carbon dioxide and sulfur dioxide. Other principal magmatic gases include hydrogen sulfide, hydrogen chloride, and hydrogen fluoride.

The solubility of magmatic gases in magma depends on pressure, magma composition, and temperature. Magma that is extruded as lava is extremely dry, but magma at depth and under great pressure can contain a dissolved water content in excess of 10%. Water is somewhat less soluble in low-silica magma than high-silica magma, so that at 1,100 °C and 0.5 GPa, a basaltic magma can dissolve 8% H2O while a granite pegmatite magma can dissolve 11% H2O. However, magmas are not necessarily saturated under typical conditions.

Carbon dioxide is much less soluble in magmas than water, and frequently separates into a distinct fluid phase even at great depth. This explains the presence of carbon dioxide fluid inclusions in crystals formed in magmas at great depth.

Rheology
Viscosity is a key melt property in understanding the behaviour of magmas. Whereas temperatures in common silicate lavas range from about 800 C for felsic lavas to 1200 C for mafic lavas, the viscosity of the same lavas ranges over seven orders of magnitude, from 104 cP (10 Pa⋅s) for mafic lava to 1011 cP (108 Pa⋅s) for felsic magmas. The viscosity is mostly determined by composition but is also dependent on temperature. The tendency of felsic lava to be cooler than mafic lava increases the viscosity difference.

The silicon ion is small and highly charged, and so it has a strong tendency to coordinate with four oxygen ions, which form a tetrahedral arrangement around the much smaller silicon ion. This is called a silica tetrahedron. In a magma that is low in silicon, these silica tetrahedra are isolated, but as the silicon content increases, silica tetrahedra begin to partially polymerize, forming chains, sheets, and clumps of silica tetrahedra linked by bridging oxygen ions. These greatly increase the viscosity of the magma.

The tendency towards polymerization is expressed as NBO/T, where NBO is the number of non-bridging oxygen ions and T is the number of network-forming ions. Silicon is the main network-forming ion, but in magmas high in sodium, aluminium also acts as a network former, and ferric iron can act as a network former when other network formers are lacking. Most other metallic ions reduce the tendency to polymerize and are described as network modifiers. In a hypothetical magma formed entirely from melted silica, NBO/T would be 0, while in a hypothetical magma so low in network formers that no polymerization takes place, NBO/T would be 4. Neither extreme is common in nature, but basalt magmas typically have NBO/T between 0.6 and 0.9, andesitic magmas have NBO/T of 0.3 to 0.5, and rhyolitic magmas have NBO/T of 0.02 to 0.2. Water acts as a network modifier, and dissolved water drastically reduces melt viscosity. Carbon dioxide neutralizes network modifiers, so dissolved carbon dioxide increases the viscosity. Higher-temperature melts are less viscous, since more thermal energy is available to break bonds between oxygen and network formers.

Most magmas contain solid crystals of various minerals, fragments of exotic rocks known as xenoliths and fragments of previously solidified magma. The crystal content of most magmas gives them thixotropic and shear thinning properties. In other words, most magmas do not behave like Newtonian fluids, in which the rate of flow is proportional to the shear stress. Instead, a typical magma is a Bingham fluid, which shows considerable resistance to flow until a stress threshold, called the yield stress, is crossed. This results in plug flow of partially crystalline magma. A familiar example of plug flow is toothpaste squeezed out of a toothpaste tube. The toothpaste comes out as a semisolid plug, because shear is concentrated in a thin layer in the toothpaste next to the tube, and only here does the toothpaste behave as a fluid. Thixotropic behavior also hinders crystals from settling out of the magma. Once the crystal content reaches about 60%, the magma ceases to behave like a fluid and begins to behave like a solid. Such a mixture of crystals with melted rock is sometimes described as crystal mush.

Magma is typically also viscoelastic, meaning it flows like a liquid under low stresses, but once the applied stress exceeds a critical value, the melt cannot dissipate the stress fast enough through relaxation alone, resulting in transient fracture propagation. Once stresses are reduced below the critical threshold, the melt viscously relaxes once more and heals the fracture.

Temperature
Temperatures of molten lava, which is magma extruded onto the surface, are almost all in the range 700 to 1400 C, but very rare carbonatite magmas may be as cool as 490 C, and komatiite magmas may have been as hot as 1600 C. Magma has occasionally been encountered during drilling in geothermal fields, including drilling in Hawaii that penetrated a dacitic magma body at a depth of 2488 m. The temperature of this magma was estimated at 1050 C. Temperatures of deeper magmas must be inferred from theoretical computations and the geothermal gradient.

Most magmas contain some solid crystals suspended in the liquid phase. This indicates that the temperature of the magma lies between the solidus, which is defined as the temperature at which the magma completely solidifies, and the liquidus, defined as the temperature at which the magma is completely liquid. Calculations of solidus temperatures at likely depths suggests that magma generated beneath areas of rifting starts at a temperature of about 1300 to 1500 C. Magma generated from mantle plumes may be as hot as 1600 C. The temperature of magma generated in subduction zones, where water vapor lowers the melting temperature, may be as low as 1060 C.

Density
Magma densities depend mostly on composition, iron content being the most important parameter.

Magma expands slightly at lower pressure or higher temperature. When magma approaches the surface, its dissolved gases begin to bubble out of the liquid. These bubbles had significantly reduced the density of the magma at depth and helped drive it toward the surface in the first place.

Origins
The temperature within the interior of the earth is described by the geothermal gradient, which is the rate of temperature change with depth. The geothermal gradient is established by the balance between heating through radioactive decay in the Earth's interior and heat loss from the surface of the earth. The geothermal gradient averages about 25 °C/km in the Earth's upper crust, but this varies widely by region, from a low of 5–10 °C/km within oceanic trenches and subduction zones to 30–80 °C/km along mid-ocean ridges or near mantle plumes. The gradient becomes less steep with depth, dropping to just 0.25 to 0.3 °C/km in the mantle, where slow convection efficiently transports heat. The average geothermal gradient is not normally steep enough to bring rocks to their melting point anywhere in the crust or upper mantle, so magma is produced only where the geothermal gradient is unusually steep or the melting point of the rock is unusually low. However, the ascent of magma towards the surface in such settings is the most important process for transporting heat through the crust of the Earth.

Rocks may melt in response to a decrease in pressure, to a change in composition (such as an addition of water), to an increase in temperature, or to a combination of these processes. Other mechanisms, such as melting from a meteorite impact, are less important today, but impacts during the accretion of the Earth led to extensive melting, and the outer several hundred kilometers of the early Earth was probably a magma ocean. Impacts of large meteorites in the last few hundred million years have been proposed as one mechanism responsible for the extensive basalt magmatism of several large igneous provinces.

Decompression
Decompression melting occurs because of a decrease in pressure. It is the most important mechanism for producing magma from the upper mantle.

The solidus temperatures of most rocks (the temperatures below which they are completely solid) increase with increasing pressure in the absence of water. Peridotite at depth in the Earth's mantle may be hotter than its solidus temperature at some shallower level. If such rock rises during the convection of solid mantle, it will cool slightly as it expands in an adiabatic process, but the cooling is only about 0.3 °C per kilometer. Experimental studies of appropriate peridotite samples document that the solidus temperatures increase by 3 °C to 4 °C per kilometer. If the rock rises far enough, it will begin to melt. Melt droplets can coalesce into larger volumes and be intruded upwards. This process of melting from the upward movement of solid mantle is critical in the evolution of the Earth.

Decompression melting creates the ocean crust at mid-ocean ridges, making it by far the most important source of magma on Earth. It also causes volcanism in intraplate regions, such as Europe, Africa and the Pacific sea floor. Intraplate volcanism is attributed to the rise of mantle plumes or to intraplate extension, with the importance of each mechanism being a topic of continuing research.

Effects of water and carbon dioxide
The change of rock composition most responsible for the creation of magma is the addition of water. Water lowers the solidus temperature of rocks at a given pressure. For example, at a depth of about 100 kilometers, peridotite begins to melt near 800 °C in the presence of excess water, but near 1,500 °C in the absence of water. Water is driven out of the oceanic lithosphere in subduction zones, and it causes melting in the overlying mantle. Hydrous magmas with the composition of basalt or andesite are produced directly and indirectly as results of dehydration during the subduction process. Such magmas, and those derived from them, build up island arcs such as those in the Pacific Ring of Fire. These magmas form rocks of the calc-alkaline series, an important part of the continental crust. With low density and viscosity, hydrous magmas are highly buoyant and will move upwards in Earth's mantle.

The addition of carbon dioxide is relatively a much less important cause of magma formation than the addition of water, but genesis of some silica-undersaturated magmas has been attributed to the dominance of carbon dioxide over water in their mantle source regions. In the presence of carbon dioxide, experiments document that the peridotite solidus temperature decreases by about 200 °C in a narrow pressure interval at pressures corresponding to a depth of about 70 km. At greater depths, carbon dioxide can have more effect: at depths to about 200 km, the temperatures of initial melting of a carbonated peridotite composition were determined to be 450 °C to 600 °C lower than for the same composition with no carbon dioxide. Magmas of rock types such as nephelinite, carbonatite, and kimberlite are among those that may be generated following an influx of carbon dioxide into mantle at depths greater than about 70 km.

Temperature increase
Increase in temperature is the most typical mechanism for formation of magma within continental crust. Such temperature increases can occur because of the upward intrusion of magma from the mantle. Temperatures can also exceed the solidus of a crustal rock in continental crust thickened by compression at a plate boundary. The plate boundary between the Indian and Asian continental masses provides a well-studied example, as the Tibetan Plateau just north of the boundary has crust about 80 kilometers thick, roughly twice the thickness of normal continental crust. Studies of electrical resistivity deduced from magnetotelluric data have detected a layer that appears to contain silicate melt and that stretches for at least 1,000 kilometers within the middle crust along the southern margin of the Tibetan Plateau. Granite and rhyolite are types of igneous rock commonly interpreted as products of the melting of continental crust because of increases in temperature. Temperature increases also may contribute to the melting of lithosphere dragged down in a subduction zone.

The melting process
When rocks melt, they do so over a range of temperature, because most rocks are made of several minerals, which all have different melting points. The temperature at which the first melt appears (the solidus) is lower than the melting temperature of any one of the pure minerals. This is similar to the lowering of the melting point of ice when it is mixed with salt. The first melt is called the eutectic and has a composition that depends on the combination of minerals present.

For example, a mixture of anorthite and diopside, which are two of the predominant minerals in basalt, begins to melt at about 1274 °C. This is well below the melting temperatures of 1392 °C for pure diopside and 1553 °C for pure anorthite. The resulting melt is composed of about 43 wt% anorthite. As additional heat is added to the rock, the temperature remains at 1274 °C until either the anorthite or diopside is fully melted. The temperature then rises as the remaining mineral continues to melt, which shifts the melt composition away from the eutectic. For example, if the content of anorthite is greater than 43%, the entire supply of diopside will melt at 1274 °C., along with enough of the anorthite to keep the melt at the eutectic composition. Further heating causes the temperature to slowly rise as the remaining anorthite gradually melts and the melt becomes increasingly rich in anorthite liquid. If the mixture has only a slight excess of anorthite, this will melt before the temperature rises much above 1274 °C. If the mixture is almost all anorthite, the temperature will reach nearly the melting point of pure anorthite before all the anorthite is melted. If the anorthite content of the mixture is less than 43%, then all the anorthite will melt at the eutectic temperature, along with part of the diopside, and the remaining diopside will then gradually melt as the temperature continues to rise.

Because of eutectic melting, the composition of the melt can be quite different from the source rock. For example, a mixture of 10% anorthite with diopside could experience about 23% partial melting before the melt deviated from the eutectic, which has the composition of about 43% anorthite. This effect of partial melting is reflected in the compositions of different magmas. A low degree of partial melting of the upper mantle (2% to 4%) can produce highly alkaline magmas such as melilitites, while a greater degree of partial melting (8% to 11%) can produce alkali olivine basalt. Oceanic magmas likely result from partial melting of 3% to 15% of the source rock. Some calk-alkaline granitoids may be produced by a high degree of partial melting, as much as 15% to 30%. High-magnesium magmas, such as komatiite and picrite, may also be the products of a high degree of partial melting of mantle rock.

Certain chemical elements, called incompatible elements, have a combination of ionic radius and ionic charge that is unlike that of the more abundant elements in the source rock. The ions of these elements fit rather poorly in the structure of the minerals making up the source rock, and readily leave the solid minerals to become highly concentrated in melts produced by a low degree of partial melting. Incompatible elements commonly include potassium, barium, caesium, and rubidium, which are large and weakly charged (the large-ion lithophile elements, or LILEs), as well as elements whose ions carry a high charge (the high-field-strength elements, or HSFEs), which include such elements as zirconium, niobium, hafnium, tantalum, the rare-earth elements, and the actinides. Potassium can become so enriched in melt produced by a very low degree of partial melting that, when the magma subsequently cools and solidifies, it forms unusual potassic rock such as lamprophyre, lamproite, or kimberlite.

When enough rock is melted, the small globules of melt (generally occurring between mineral grains) link up and soften the rock. Under pressure within the earth, as little as a fraction of a percent of partial melting may be sufficient to cause melt to be squeezed from its source. Melt rapidly separates from its source rock once the degree of partial melting exceeds 30%. However, usually much less than 30% of a magma source rock is melted before the heat supply is exhausted.

Pegmatite may be produced by low degrees of partial melting of the crust. Some granite-composition magmas are eutectic (or cotectic) melts, and they may be produced by low to high degrees of partial melting of the crust, as well as by fractional crystallization.

Evolution of magmas


Most magmas are fully melted only for small parts of their histories. More typically, they are mixes of melt and crystals, and sometimes also of gas bubbles. Melt, crystals, and bubbles usually have different densities, and so they can separate as magmas evolve.

As magma cools, minerals typically crystallize from the melt at different temperatures. This resembles the original melting process in reverse. However, because the melt has usually separated from its original source rock and moved to a shallower depth, the reverse process of crystallization is not precisely identical. For example, if a melt was 50% each of diopside and anorthite, then anorthite would begin crystallizing from the melt at a temperature somewhat higher than the eutectic temperature of 1274 °C. This shifts the remaining melt towards its eutectic composition of 43% diopside. The eutectic is reached at 1274 °C, the temperature at which diopside and anorthite begin crystallizing together. If the melt was 90% diopside, the diopside would begin crystallizing first until the eutectic was reached.

If the crystals remained suspended in the melt, the crystallization process would not change the overall composition of the melt plus solid minerals. This situation is described as equillibrium crystallization. However, in a series of experiments culminating in his 1915 paper, Crystallization-differentiation in silicate liquids, Norman L. Bowen demonstrated that crystals of olivine and diopside that crystallized out of a cooling melt of forsterite, diopside, and silica would sink through the melt on geologically relevant time scales. Geologists subsequently found considerable field evidence of such fractional crystallization.

When crystals separate from a magma, then the residual magma will differ in composition from the parent magma. For instance, a magma of gabbroic composition can produce a residual melt of granitic composition if early formed crystals are separated from the magma. Gabbro may have a liquidus temperature near 1,200 °C, and the derivative granite-composition melt may have a liquidus temperature as low as about 700 °C. Incompatible elements are concentrated in the last residues of magma during fractional crystallization and in the first melts produced during partial melting: either process can form the magma that crystallizes to pegmatite, a rock type commonly enriched in incompatible elements. Bowen's reaction series is important for understanding the idealised sequence of fractional crystallisation of a magma.

Magma composition can be determined by processes other than partial melting and fractional crystallization. For instance, magmas commonly interact with rocks they intrude, both by melting those rocks and by reacting with them. Assimilation near the roof of a magma chamber and fractional crystallization near its base can even take place simultaneously. Magmas of different compositions can mix with one another. In rare cases, melts can separate into two immiscible melts of contrasting compositions.

Primary magmas
When rock melts, the liquid is a primary magma. Primary magmas have not undergone any differentiation and represent the starting composition of a magma. In practice, it is difficult to unambiguously identify primary magmas, though it has been suggested that boninite is a variety of andesite crystallized from a primary magma. The Great Dyke of Zimbabwe has also been interpreted as rock crystallized from a primary magma. The interpretation of leucosomes of migmatites as primary magmas is contradicted by zircon data, which suggests leucosomes are a residue (a cumulate rock) left by extraction of a primary magma.

Parental magma
When it is impossible to find the primitive or primary magma composition, it is often useful to attempt to identify a parental magma. A parental magma is a magma composition from which the observed range of magma chemistries has been derived by the processes of igneous differentiation. It need not be a primitive melt.

For instance, a series of basalt flows are assumed to be related to one another. A composition from which they could reasonably be produced by fractional crystallization is termed a parental magma. Fractional crystallization models would be produced to test the hypothesis that they share a common parental magma.

Migration and solidification
Magma develops within the mantle or crust where the temperature and pressure conditions favor the molten state. After its formation, magma buoyantly rises toward the Earth's surface, due to its lower density than the source rock. As it migrates through the crust, magma may collect and reside in magma chambers (though recent work suggests that magma may be stored in trans-crustal crystal-rich mush zones rather than dominantly liquid magma chambers ). Magma can remain in a chamber until it either cools and crystallizes to form intrusive rock, it erupts as a volcano, or it moves into another magma chamber.

Plutonism
When magma cools it begins to form solid mineral phases. Some of these settle at the bottom of the magma chamber forming cumulates that might form mafic layered intrusions. Magma that cools slowly within a magma chamber usually ends up forming bodies of plutonic rocks such as gabbro, diorite and granite, depending upon the composition of the magma. Alternatively, if the magma is erupted it forms volcanic rocks such as basalt, andesite and rhyolite (the extrusive equivalents of gabbro, diorite and granite, respectively).

Volcanism
Magma that is extruded onto the surface during a volcanic eruption is called lava. Lava cools and solidifies relatively quickly compared to underground bodies of magma. This fast cooling does not allow crystals to grow large, and a part of the melt does not crystallize at all, becoming glass. Rocks largely composed of volcanic glass include obsidian, scoria and pumice.

Before and during volcanic eruptions, volatiles such as CO2 and H2O partially leave the melt through a process known as exsolution. Magma with low water content becomes increasingly viscous. If massive exsolution occurs when magma heads upwards during a volcanic eruption, the resulting eruption is usually explosive.

Use in energy production
The Iceland Deep Drilling Project, while drilling several 5,000 m holes in an attempt to harness the heat in the volcanic bedrock below the surface of Iceland, struck a pocket of magma at 2,100 m in 2009. Because this was only the third time in recorded history that magma had been reached, IDDP decided to invest in the hole, naming it IDDP-1.

A cemented steel case was constructed in the hole with a perforation at the bottom close to the magma. The high temperatures and pressure of the magma steam were used to generate 36 MW of power, making IDDP-1 the world's first magma-enhanced geothermal system.