Earth science, read from a fieldworker's source
In 1862 William Thomson, Lord Kelvin, calculated how long the Earth could have taken to cool to its present state and gave an age of 20 to 400 million years. He had left out two things: radioactivity, which keeps the Earth supplied with heat, and the movement of the interior, which carries heat outward to keep it hot for longer. In 1956 Clair Patterson dated meteorites, including the Canyon Diablo meteorite, by the lead in them, and found 4.55 billion years, give or take 70 million. The present figure is 4.54 billion, give or take 50 million. The Earth did not change between the two estimates. What changed was a way to read the rocks, and it was a calculation.
The earthscience library for DKE, the Deterministic Knowledge Engine, puts some of the arithmetic and some of the classifying of the Earth in DKE Python, and this essay teaches the subject by reading it. You record three kinds of fact. A weather station is written as its coldest and warmest month, its annual mean temperature, its rainfall and how much of that falls in the high-sun half of the year, and the library's rules conclude its Köppen climate. A storm is written as its sustained wind, and the rules conclude whether it is a hurricane, its Saffir-Simpson category and whether it is a major one. A set of minerals is written as their hardnesses, and the rules conclude which scratches which. Each answer names the facts it rests on, and correcting a fact withdraws the answers it supported. The second half of the library calculates: the dew point, the heat index, the wind chill, the standard atmosphere, potential temperature, the Coriolis parameter, the height at which a cloud forms, the age of a rock from its decay products and the energy of an earthquake. Every program below runs as shown once the library's source file has been compiled into a store, and every output is copied from a run.
1. Five climates
Wladimir Köppen, a German-Russian climatologist who lived from 1846 to 1940 and was also a botanist, built his classification on the plants that grow under each climate, which is why its main groups read like vegetation zones. He first published it in 1884 and revised it in 1918 and 1936, and Rudolf Geiger changed it in 1954 and 1961, so that it is sometimes called the Köppen-Geiger system. It is the most widely used scheme for the climates of the world. It has five groups: A, tropical, where every month averages at least 18 degrees Celsius; E, polar, where none averages as much as 10; B, arid, where the rainfall is below a threshold that depends on the temperature; C, temperate, where the coldest month is above 0 degrees (or above minus 3 in some versions) but under 18, and at least one month passes 10; and D, continental, where the coldest month is below that line and at least one month passes 10.
The B group is the only one with arithmetic in it. Rain is lost faster in hot air, so the threshold rises with the annual mean: 20 times the mean in degrees, plus 280 millimetres where 70 percent or more of the rain falls in the half of the year when the sun is high, 140 where the share is between 30 and 70 percent, and nothing where it is under 30. A place with less than half the threshold is a desert, BW, and one with more is a steppe, BS. The library writes the whole of it as fields and rules on a station:
threshold: float = 20.0 * annual_temp + addition
dry: bool = rain < threshold
polar: bool = warmest < 10.0The page that describes the system gives no order in which to apply the groups. The library tests E first, since the page says B applies where the climate is not polar, and then B, and puts B before A, C and D, and says so in its header. The stations below are invented, and none is any town's record. They are one of each kind:
import earthscience
earthscience.station("equatorial", 26.0, 28.0, 27.0, 2300.0, 0.5, 0.0)
earthscience.station("hot-desert", 14.0, 31.0, 23.0, 25.0, 0.5, 0.0)
earthscience.station("mild-coast", 5.0, 19.0, 12.0, 900.0, 0.4, 0.0)
earthscience.station("prairie", -12.0, 21.0, 5.0, 600.0, 0.6, 0.0)
earthscience.station("ice-plateau", -60.0, -30.0, -50.0, 40.0, 0.5, 0.0)
earthscience.station("tundra-shore", -25.0, 6.0, -8.0, 250.0, 0.5, 0.0)
for n in ["equatorial", "hot-desert", "mild-coast", "prairie", "ice-plateau", "tundra-shore"]:
print(n, earthscience.climate(n), earthscience.dryness_threshold(n))
reason = why_not(earthscience.Station.prairie.temperate)
print(reason)equatorial A 680.0
hot-desert BW 600.0
mild-coast C 380.0
prairie D 240.0
ice-plateau EF -860.0
tundra-shore ET -20.0
rule `earthscience.temperate` needs earthscience.Station[prairie].coldest > earthscience.Station[prairie].boundary, and earthscience.Station[prairie].coldest is -12.0 (real)Each name is followed by its climate and the rainfall below which the station would be dry. The equatorial station is A, and the hot desert is a desert, since 25 millimetres is under half of 600. The ice plateau and the tundra shore are both polar; the first is the ice cap, EF, because its warmest month is below freezing, and the second is tundra, ET. The threshold of the ice plateau is negative, minus 860, which is only the formula's arithmetic on a mean of minus 50: no rain can fall below it, and the polar test comes first. The last line is the answer to why the prairie is not temperate: its coldest month is minus 12, which is not above the line that divides C from D.
2. Where the line falls
The line between C and D is the one place where versions of the system disagree. It is 0 degrees in some and minus 3 in others, and a station's boundary field records which one its author follows. A coldest month of minus 1 degree is continental under one and temperate under the other, and a station whose rain is measured again can move out of a group altogether. Here are those two cases, and the share of rain that sets which of the three seasonal additions applies:
import earthscience
earthscience.station("border", -1.0, 22.0, 9.0, 800.0, 0.5, 0.0)
print(earthscience.climate("border"))
earthscience.station("border", -1.0, 22.0, 9.0, 800.0, 0.5, -3.0)
print(earthscience.climate("border"))
earthscience.station("steppe-edge", 3.0, 28.0, 14.0, 400.0, 0.5, 0.0)
print(earthscience.climate("steppe-edge"), earthscience.dryness_threshold("steppe-edge"))
earthscience.station("steppe-edge", 3.0, 28.0, 14.0, 500.0, 0.5, 0.0)
print(earthscience.climate("steppe-edge"))
earthscience.station("wet-summer", 3.0, 28.0, 14.0, 500.0, 0.8, 0.0)
earthscience.station("dry-summer", 3.0, 28.0, 14.0, 500.0, 0.2, 0.0)
print(earthscience.climate("wet-summer"), earthscience.dryness_threshold("wet-summer"))
print(earthscience.climate("dry-summer"), earthscience.dryness_threshold("dry-summer"))D
C
BS 420.0
C
BS 560.0
C 280.0The border station is D and then C, with nothing changed but the version of the system. The steppe edge is a steppe at 400 millimetres, below its threshold of 420, and temperate at 500, once the figure is corrected: what depended on the old rainfall went when it did. And two stations of identical temperature and rainfall differ by the season of the rain. Where the rain falls mostly in summer the threshold is 560 and 500 millimetres is dry; where it falls mostly in winter it is 280 and the same rain is plenty. In a study of 1950 to 2010 by a Nanjing University group, about 5.7 percent of the world's land area moved from wetter and colder classes of this system to drier and hotter ones, which the authors attributed to human causes. A classification that can be recomputed from a station's figures is the kind that can be checked against such a claim.
3. A storm and its category
Herbert Saffir was an engineer hired by the United Nations in 1969 to study low-cost housing in hurricane-prone areas, who needed a simple guide to the damage a hurricane was likely to do where there were no building codes. With Robert Simpson, then director of the National Hurricane Center, he developed the scale in 1971, and it was published in 1975. Simpson later based it on the one-minute sustained wind, and the Center dropped the storm-surge and pressure ranges in 2009 and made the wind-only scale operational on 15 May 2010. There is no category 6. Simpson argued that none was needed, since the scale measures damage to what people build and winds above about 155 miles an hour already do serious damage. The library has one rule for each band:
import earthscience
for w in [73, 74, 95, 96, 110, 111, 129, 130, 156, 157, 200]:
earthscience.storm("w" + str(w), w)
print(w, earthscience.category("w" + str(w)))73 0
74 1
95 1
96 2
110 2
111 3
129 3
130 4
156 4
157 5
200 5A wind of 73 miles an hour is below hurricane force, and the category is 0. At 74 it is category 1, and category 3, at 111, is the first of the major hurricanes. The category 4 band reads 130 to 156 because the National Hurricane Center adjusted it to that in 2012. The scale knows nothing of rainfall, storm surge, size or the place a storm lands, and the library inherits that: a category 2 storm over a large city can cost more than a category 5 storm over open country, and a number between 1 and 5 is not a forecast of damage.
4. Which scratches which
Friedrich Mohs introduced his scale in 1812 in a book about identifying fossils. Theophrastus about 300 BC and Pliny the Elder about AD 77 had both described ranking minerals by which could scratch which, and Mohs fixed ten of them as the reference: talc 1, gypsum 2, calcite 3, fluorite 4, apatite 5, orthoclase 6, quartz 7, topaz 8, corundum 9 and diamond 10. The numbers are an order and not a measure. Corundum is about twice as hard as topaz in absolute terms, and diamond about four times as hard as corundum. The library writes a pair for every two minerals and one rule: the first scratches the second if it is strictly harder.
import earthscience
earthscience.minerals(["talc", "gypsum", "calcite", "fluorite", "apatite", "orthoclase", "quartz", "topaz", "corundum", "diamond"], [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
print(earthscience.scratched_by("quartz"), earthscience.scratches("quartz", "topaz"), earthscience.scratches("topaz", "quartz"))
print(earthscience.scratched_by("talc"), earthscience.scratched_by("diamond"))['apatite', 'calcite', 'fluorite', 'gypsum', 'orthoclase', 'talc'] False True
[] ['apatite', 'calcite', 'corundum', 'fluorite', 'gypsum', 'orthoclase', 'quartz', 'talc', 'topaz']Quartz scratches the six softer minerals and not topaz, and topaz scratches quartz. Talc scratches nothing on the list, and diamond scratches the other nine. The ten minerals write ninety pairs, which is why the module says a mineral list is for a handful.
5. Moisture and heat in the air
The dew point is the temperature at which air holds all the water it can, and the formula the library uses to find it, from the relative humidity, is Magnus's, with constants chosen to fit minus 40 to plus 50 degrees Celsius. At a humidity of 100 percent the dew point is the air temperature, to a rounding. Espy's rule, published in 1836 by James Pollard Espy in the Journal of the Franklin Institute, turns the gap between air and dew point into a height: rising air cools about 8 kelvins a kilometre faster than its dew point does, so it reaches saturation at 125 metres for each degree of the gap. That is the height of the base of the cloud on a day when the air is lifted from the ground, and the rule is accurate to about 1 percent in ordinary air:
import earthscience
print(earthscience.dew_point(30.0, 60.0), earthscience.dew_point(20.0, 100.0), earthscience.dew_point(10.0, 50.0))
td = earthscience.dew_point(30.0, 60.0)
print(earthscience.lcl_height(30.0, td))21.390006900020513 20.000000000000004 0.04665901595385489
1076.2491374974359Air at 30 degrees and 60 percent humidity has a dew point of 21.4, and a cloud lifted from it would form about 1,076 metres up. The 20.000000000000004 is the formula's own rounding: it is one unit of the last place from the exact answer.
Heat is felt through humidity too. Robert Steadman developed the theory of the heat index in 1979, and the regression the National Weather Service uses was fitted to it by Rothfusz in 1990. It was fitted for air of at least 80 degrees Fahrenheit and 40 percent humidity, in which it is within 1.3 degrees of the table, and elsewhere it returns a number that means little. The wind chill has an older source: Paul Siple and Charles Passel measured it in the Antarctic before the Second World War from how fast a small plastic bottle froze in the wind. In November 2001 the United States, Canada and the United Kingdom adopted a new index, calculated for a bare face walking into the wind at 1.4 metres a second, and valid for air at 10 degrees Celsius or colder (50 Fahrenheit) and a wind above 4.8 kilometres an hour (3 miles). The library takes both in Fahrenheit and miles an hour, and leaves their ranges to the reader:
import earthscience
print(earthscience.heat_index(90.0, 70.0), earthscience.heat_index(96.0, 65.0), earthscience.heat_index(70.0, 30.0))
print(earthscience.wind_chill(5.0, 10.0), earthscience.wind_chill(-10.0, 25.0), earthscience.wind_chill(30.0, 2.0))105.92202060000027 121.03162930000015 76.10136320000001
-9.737344294197483 -37.46372963656345 28.77119235969436The National Weather Service table gives 105 for 90 degrees and 70 percent, and the library gives 105.9, within the 1.3 of the fit. The third value, 76 for air at 70 degrees and 30 percent, is outside the range of the regression, and it is warmer than the air. The wind chill of 5 degrees in a 10 mile wind is minus 9.7 and of minus 10 in a 25 mile wind is minus 37.5, and 28.8 for a wind of 2 miles an hour is outside the definition. The script computes any number it is given. Romps and Lu found that the heat index underestimated the severity of intense heat waves such as the Chicago heat wave of 1995, and a sustained wet-bulb temperature of about 35 degrees Celsius is the point beyond which the body can no longer cool itself.
6. Pressure and the height of the air
The standard atmosphere has a sea level of 15 degrees Celsius and 101,325 pascals, and the troposphere cools by 6.5 degrees a kilometre. The library gives temperature in kelvins to 11,000 metres and pressure in hectopascals, 1013.25 (1 - h / 44307.694)^5.2553, up to the same height. Mount Everest was measured in 2020 by a joint Nepalese and Chinese survey at 8,848.86 metres, and Edmund Hillary and Tenzing Norgay made the first documented ascent on 29 May 1953:
import earthscience
print(earthscience.pressure_at(0.0), earthscience.pressure_at(1500.0), earthscience.pressure_at(5000.0), earthscience.pressure_at(8848.0))
print(earthscience.temperature_at(0.0), earthscience.temperature_at(5000.0), earthscience.temperature_at(11000.0))
t = earthscience.temperature_at(5000.0)
p = earthscience.pressure_at(5000.0)
print(earthscience.potential_temperature(t, p))1013.25 845.495770151454 540.0484237684415 314.26571676215383
288.15 255.64999999999998 216.64999999999998
304.90885988069977At the height of Everest the pressure is 314 hectopascals, 31 percent of the sea-level figure, and at 5,000 metres the air is at 255.65 kelvins and 540 hectopascals. The last value is the potential temperature, the temperature the air at 5,000 metres would have if brought dry-adiabatically to 1,000 hectopascals, T (1000 / p)^0.286, which is 304.9 kelvins. It is what lets air at different heights be compared.
The Earth turns, and a moving thing on it is deflected. Gaspard-Gustave de Coriolis published in 1835 a paper on the energy of machines with rotating parts, such as waterwheels, and the expression for the force is in it. The Coriolis parameter is f = 2 Omega sin(latitude), with Omega the Earth's rate of rotation, 7.2921 × 10⁻⁵ radians a second:
import earthscience
print(earthscience.coriolis(0.0), earthscience.coriolis(45.0), earthscience.coriolis(60.0), earthscience.coriolis(90.0))0.0 0.00010312586718180846 0.0001263028769387301 0.000145842It is zero at the equator and largest at the poles, and about 10⁻⁴ per second in the middle latitudes. That is why large storms turn, anticlockwise around a low in the Northern Hemisphere and clockwise in the Southern, and why cyclones rarely form at the equator, where the effect is weak. The force is negligible at the scale of a bathtub, and the direction a drain turns is set by the shape of the basin and any residual motion of the water.
7. Dating a rock
When the uranium in a mineral decays to lead, the lead stays; the mineral is a clock that started when it crystallised. Radioactivity was the thing Kelvin did not know, and Bertram Boltwood's work of 1907 on the lead in uranium minerals gave ages from 410 million to 2.2 billion years. Arthur Holmes championed lead dating from the 1910s, and a committee of the U.S. National Research Council that he largely wrote concluded in 1931 that radioactive dating was the only reliable way to set a geological time scale. The Earth's own oldest rocks are no help to the age of the Earth, because plate tectonics and weathering have recycled them: the oldest material from the Earth itself is a zircon crystal of Jack Hills in Western Australia, at least 4.404 billion years old, and meteorites, which stayed closed systems, record the age of the solar disk. That is why Patterson used Canyon Diablo.
The library does the simple case, one parent decaying to one daughter: the age is the half-life times the base-2 logarithm of one plus the ratio of daughter atoms to parent atoms, and it assumes no daughter at the start and none gained or lost since. Uranium-238 decays to lead-206 with a half-life of about 4.463 billion years. Patterson dated by the ratios of lead isotopes, a different method from this one-parent formula, and the figures here are for teaching:
import earthscience
print(earthscience.radiometric_age(1.0, 4.463), earthscience.radiometric_age(0.5, 4.463), earthscience.radiometric_age(1.0242, 4.463))4.463 2.61068764071852 4.54044126989884One lead atom for each uranium atom is one half-life, 4.463 billion years. Half a lead atom per uranium atom is 2.6. And a ratio of 1.0242, a figure chosen for the example, gives 4.54, the modern age of the Earth. A sample that lost some lead would read young and one that gained it would read old, and that, not the arithmetic, is what a geochemist works to rule out.
8. Earthquakes
Charles Richter published his local magnitude scale in 1935, built from shallow earthquakes of moderate size 100 to 600 kilometres away. For large earthquakes it saturates: the surface-wave magnitude levels off around 8, which is why it undervalued the Chilean earthquake of 1960 and the Alaskan of 1964. Hanks and Kanamori defined the moment magnitude in 1979 from the seismic moment. The 1960 Chilean earthquake, at Valdivia, had an estimated moment magnitude of 9.4 to 9.6. The energy radiated is related to the surface-wave magnitude by log E = 4.8 + 1.5 M in joules, so one whole step is 10^1.5, about 32 times the energy, and two steps are 1,000:
import earthscience
print(earthscience.quake_energy_joules(9.0), earthscience.quake_energy_joules(5.0), earthscience.quake_ratio(5.0, 6.0), earthscience.quake_ratio(5.0, 7.0))
print(earthscience.magnitude_from_energy(earthscience.quake_energy_joules(7.0)), earthscience.magnitude_from_energy(1.0e15))
print(earthscience.sp_distance_km(10.0, 6.0, 3.5), earthscience.sp_distance_km(30.0, 6.0, 3.5))1.995262314968883e+18 1995262314968.8828 31.622776601683793 1000.0
7.0 6.8
84.0 252.0A magnitude 9 releases about 2 × 10¹⁸ joules and a 5 about 2 × 10¹². A step is 31.6 times the energy and two steps are 1,000, and the inverse takes 10¹⁵ joules back to magnitude 6.8. The last line is how a seismologist reads a distance. The two kinds of body wave leave the quake together, the compressional P wave faster than the shear S wave, and the later one falls further behind the farther they go. At speeds of 6.0 and 3.5 kilometres a second, which are chosen for the example, a gap of 10 seconds between them puts the quake 84 kilometres away and a gap of 30 seconds 252.
9. What the library leaves out
A climate is four numbers and a share, and the library does not read a monthly series. Köppen's third letters, the seasonal variants of the dry climates and the cold-dry subtypes are not here. It does not draw a map or move a plate or predict a tide. Every formula holds over a range that its comment names and the script does not check, and the heat index and wind chill above returned a number outside theirs without complaint. The magnitude scale is the surface-wave one, which saturates, and the age of a rock is a one-chain model. The numbers in the examples about stations, storms and wave speeds are invented, and the library supplies the reasoning and not the data.
Closing
The Earth is read with a few thresholds and a few formulas. A coldest month and a share of rain make a climate, a wind makes a storm, a scratch makes a hardness, a ratio of lead to uranium makes an age and a gap of seconds makes a distance. The library keeps those, with their ranges beside them, and it can say why a place is not the climate you expected and what would move it. And because every answer rests on recorded facts, a rainfall measured again, or a version of the system chosen differently, changes the climate and carries nothing of the old one into the new.