<<

A reprint from American Scientist the magazine of Sigma Xi, The Scientific Research Society

This reprint is provided for personal and noncommercial use. For any other use, please send a request Brian Hayes by electronic mail to [email protected]. Computing Science Clarity in Modeling

Computational models are splendid tools for understanding the intricacies of climate. But can we understand the intricacies of the models?

Brian Hayes

o computer made. I have been dipping into the ing can cause a dramatic dimming or have ever had broader con- primary literature, working through brightening of the . sequences for textbooks, sampling the criticisms of The most interesting thing about than the current generation global-warming skeptics, browsing the this formula is that it seems to give the Nof climate models. The models tell us source code of climate models, build- wrong answer. Plugging in appropri- that rising levels of atmospheric carbon ing a tiny model of my own, and strug- ate values of Q, α, and σ, then solv- dioxide and other greenhouse gases can gling to get a couple of larger models ing for T, yields a in the trigger abrupt shifts in the planet’s cli- running on my computers. The expe- neighborhood of –15 degrees Celsius. mate; to avert those changes or mitigate rience has been rewarding, although If the ’s surface were really that their effects, the entire human popula- the learning curve is steeper than it cold, we would be living in an ice age. tion is urged to make fundamental eco- needs to be. So I have also been think- The true surface temperature, aver- nomic and technological adjustments. ing about how the basics of climate aged over the entire area of the globe, In particular, we may have to forgo ex- modeling could be made more widely is about +15 degrees. ploiting most of the world’s remaining accessible. This discrepancy was recognized reserves of fossil fuels. It’s not every early in the 19th century and resolved day that the output of a computer pro- Sunshine Equals Earthshine in the 1890s by the Swedish scientist gram leads to a call for seven billion Underneath all the complexity of a big Svante Arrhenius, who constructed people to change their behavior. climate model lies a simple bedrock what deserves to be called the first I hasten to add that computer mod- fact: In the long run, the Earth must climate model. The key idea is the eling is not the only line of evidence balance its budget. However greenhouse effect: Incoming , connecting human activities with glob- much incoming solar the which is most intense at visible wave- al warming. We have observations of planet absorbs, the same amount must lengths, readily passes through the changes already under way, and there eventually be radiated back into . , but outgoing emissions are records of past climate fluctuations The planet warms or cools as needed at longer, infrared, wavelengths are showing a close correlation between to satisfy this rule. absorbed by vapor and carbon temperature and atmospheric CO2. A climate model based on energy dioxide in the air. Seen from afar, the Still, the models provide a crucial link. balance can be simple enough to solve Earth does radiate like a body at –15 They offer the only practical way to car- with pencil and paper. It comes down degrees, but that radiation comes from ry out controlled climate experiments— to a single equation: high in the atmosphere. The surface to change the inputs to the system and below is warmed by the blanket of Q(1–α) = σT4 see the effect on the outputs. Moreover, infrared-absorbing­ gases. It’s­ worth the models can reveal causation rather Here sunshine is on the left side of the noting that Arrhenius viewed green- than mere correlation, and they prom- equal sign, balanced by earthshine on house warming as a benign effect; only ise insight into the underlying mecha- the right. Q is the influx of solar en- later did accumulating CO2 begin to nisms of climate change. ergy averaged over the entire spherical look like too much of a good thing. As someone interested in both cli- surface of the Earth. The factor α is the mate and computation—and as a life- planet’s albedo, or reflectivity, with a The Striped Planet long resident of planet Earth—I have possible range of 0 to 1; thus 1– α is The simplest energy balance calcula- been trying to gain a deeper under- the proportion of sunlight absorbed. tion reduces the climate of the whole standing of how climate models are On the right side of the equation, T is planet to a single number: the average the effective temperature of the Earth, temperature. A little more detail can be Brian Hayes is senior writer for American Scien- and σ (the Stefan-Boltzmann constant) coaxed from the model by dividing the tist. Additional material related to the Comput- relates temperature to radiant emis- globe into latitudinal zones. Each band ing Science column can be found online at http:// sion. Because T is raised to the fourth of latitudes finds its own temperature bit-player.org. E-mail: [email protected] power, even a slight cooling or warm- equilibrium, balancing the inflow and

422 American Scientist, Volume 102 © 2014 Brian Hayes. with permission only. Contact [email protected]. outflow of radiant energy. In addition, energy can be redistributed among the zones as heat flows from warmer to cooler regions. Arrhenius constructed the first such striped model, with latitudinal bands 10 degrees wide. By the 1960s, com- puters had made it much easier to explore the behavior of the models, testing their response to different in- puts or assumptions. Today, you can play with a zonal model yourself, with versions that take the form of BASIC programs, Mathematica notebooks, Java applets, or even Excel spread- sheets. I have written yet another ver- sion, which runs in a web browser; see http://bit-player.org/­extras/climate. The zonal models incorporate an important and interesting feedback The simplest climate models balance incoming and outgoing radiant energy. In the model loop. As already noted, the Earth’s shown here the globe is divided into latitudinal zones, whose mean temperature is encoded temperature depends partly on its in color and indicated numerically in the right margin. The interactive version of the model at albedo, but the albedo also depends http://bit-player.org/extras/climate responds to adjustments in the solar constant, the albedo of partly on the temperature. Any region land and ice, and a parameter representing the intensity of the greenhouse effect. Such mod- cold enough to be covered by els are primitive, and yet they capture interesting behavior, such as a feedback loop in which and ice will reflect more light (and ab- cooling promotes ice cover (indicated by snowflakes), which causes further cooling. sorb less heat) than an uncovered sur- face. The effect is self-reinforcing: Once Geophysical Fluid Dynamics Labora- plings between air and sea produce an area cools below the freezing point, tory in Princeton argues that climate some of the most distinctive features the diminished absorption of solar en- science needs a hierarchy of models, of the present climatic regime, such ergy will cause it to cool still further. analogous to the hierarchy of experi- as the El Niño Southern Oscillation of The chilled region will also draw heat mental in , from E. the Pacific basin. The most elaborate out of neighboring latitudes, so that coli to Drosophila to the mouse. The models incorporate these air–sea inter- they too may freeze. The snow line simpler, smaller models help us under- actions as well as the detailed topog- steadily descends from the poles. stand the big, intricate ones. (Admit- raphy of the continents, the dynamics Watching this feedback mechanism tedly, even the models at the bottom of glaciers and sea ice, the chemical at work in the model naturally in- of Held’s proposed hierarchy are more transformations of in the spires thoughts of ice age glaciation. sophisticated than the striped planet atmosphere, and even biological influ- Of course the process can also be re- described here.) ences on climate, such as the uptake of versed: Warming at the margins of by growing . the temperate zone pushes the snow The Swirling Planet Mirroring the complexities of the line poleward, thereby reducing the At the other end of the Held hierar- Earth system are the complexities of albedo and bringing further warming. chy, the models get very complex in- the software system. A climate model With sufficiently extreme settings in deed. And for good reason: There’s a that captures details of all these geo- the model, either of these trends can be lot going on in the Earth’s atmosphere. physical processes necessarily be- taken to a limiting state: a “snowball Water evaporates and condenses; con- comes a major collaborative program- Earth,” frozen all the way to the Equa- vection cells redistribute both heat ming project. A prominent example is tor, or a totally ice-free planet. and moisture; are deflected by the Earth System Model, It’s tempting to dismiss these mod- the Earth’s rotation and break up into or CESM, administered by the Nation- els as cartoonish oversimplifications. turbulent eddies large and small. To al Center for Atmospheric Research Think of all that’s been left out: There is represent all this activity, the model (NCAR) in Colorado, with contribu- no day and night, no summer and win- atmosphere is sliced up into a three- tors at many other institutions. The ter, no continents and , no winds, dimensional lattice with thousands or CESM software has five main modules , storms, mountains, deserts. On millions of cells. The model must track (for the atmosphere, the oceans, the this bald planet, any two places at the flows of energy and mass from to land, ice on land, and ice on the sea) same latitude—say Minneapolis and cell over scales ranging from a plus a sixth “coupler” component that Venice—have the same climate. How few seconds to decades. coordinates interactions between the ridiculous. And it’s not enough to model just subsystems. Yet simple models have one win- the atmosphere. Roughly half the Like other climate research groups, ning virtue: We can easily understand heat transported from the tropics to the CESM collaboration makes the what’s going on inside them. They the poles is carried by currents, source code for its models publicly shine a spotlight on basic mechanisms driven by and by gradients in available (see http://www2.cesm. and principles. Isaac M. Held of the temperature and salinity. The cou- ucar.edu/models). The latest package www.americanscientist.org © 2014 Brian Hayes. Reproduction with permission only. 2014 November–December 423 Contact [email protected]. a much wider public; unfortunately, that potential is going unfulfilled for now. Chandler and his small group struggle to keep the program updated as new computers and mobile devices come along. They also struggle to pro- vide technical support. (I had to ask for help with installation.) Their focus has been on classroom use of the soft- ware, and they have not encouraged “hobbyists.” Another barrier to casual experimenters is that the software is not free. (The price is $29 for students but up to $199 for others.) EdGCM is not the only research-level​ climate model designed for public consumption. Another software pack- age called the Planet Simulator was change in surface air temperature (°C) created by a group at the University of Hamburg Meteorological Institute –10 –8 –6 –4 –2 0 +2 +4 +6 +8 +10 (see http://www.mi.uni-hamburg.de/ The EdGCM model, created by a team at the Goddard Institute for Space Studies, takes about plasim). This one is freely distributed. six hours to simulate the of the Earth’s climate from 1958 to 2100. In a benchmark Setting up and running the Hamburg measurement of sensitivity to greenhouse gases, the atmospheric CO2 level is held steady at software is somewhat more demand- double the 1958 value. The map plots the resulting change in surface air temperature, compar- ing technically: You’ll need to install ing average values for 1958–1962 with those projected for 2096–2100. The average temperature a Fortran compiler and issue various change is 3.92 degrees Celsius, but regions near Antarctica warm by almost 10 degrees. incantations from the command line. The model has higher spatial resolu- consists of 1.6 million lines of Fortran, ice, clouds, , and biology, are tion than EdGCM, which means it re- with miscellaneous bits and pieces all taken into account, although ocean quires a greater commitment of run- written in more than a dozen other mixing and currents are given a sim- ning time and computer resources. programming languages. The pro- pler treatment than they are in more grams and their documentation make recent software. Faith in Numbers fascinating reading, but compiling, In the 1990s a summer program for Why would ordinary citizens take an configuring, and running them is not a high school and college students of- interest in do-it-yourself climate mod- one-click process. I decided that CESM fered hands-on experience with data eling? I can think of two reasons. was not the best vehicle for a beginner generated by the GISS model, but the First comes the pure pleasure of just learning to drive a climate model. students were disappointed that they learning and exploring. Even if climate had no opportunity to run the mod- change had no bearing on human wel- Models for the Rest of Us el itself. To answer this complaint the fare, there would remain a remark- A program called the Educational Glob- EdGCM project was launched by Mark able story of scientific discovery. The al Climate Model (EdGCM) seemed Chandler, a member of the GISS climate mere idea that climate can change is ready-made for my purposes. The soft- modeling group. Chandler emphasizes not new, but until recently it was as- ware derives from a model developed that EdGCM is not a toy but a research sumed that such changes would pro- in the 1980s by James E. Hansen and tool, functionally identical to the 1980s ceed very slowly—at a glacial pace. his colleagues at the Goddard Institute GISS model. Within Held’s hierarchy Now we know (mainly from ice cores) for Space Studies (GISS) in New York. of climate models, it falls somewhere in that the Earth has a history of quite The EdGCM version has been precom- the midrange. The source code is only abrupt and dramatic shifts from one piled for easier installation on Windows about 20,000 lines, or 1 percent of the stable state to another, reminiscent of or Macintosh computers (see http:// CESM total. On the other hand, those phase transitions. It’s like finding out edgcm.columbia.edu/). It comes pack- 20,000 lines are not easy reading: They that your friendly, fuddy-duddy​ insur- aged with a point-and-click interface as were written in a dialect of Fortran that ance agent has led a double life as a well as tools for plotting and displaying had not yet escaped the age of punch tightrope walker. I will never feel quite the results of simulations. cards and teletype machines. the same about the planet I live on. In the 1980s Hansen’s group used The program’s performance on a Computational models offer the best this model in a landmark study of modern laptop is far sprightlier than prospects for figuring out how these CO2-induced global warming. The it was on the GISS mainframe 30 years sudden climate shifts come about— model’s atmosphere has nine layers ago. I can calculate about 25 years of what triggers them, and how all the vertically, with horizontal resolution simulated climate per hour of running tangled feedback loops interact to of 8 degrees in latitude by 10 degrees time. Start an experiment at bedtime amplify small disturbances. And this in longitude (a total of roughly 7,000 and it will be finished in the morning. brings me to the second reason for pay- cells). Atmospheric transport of heat EdGCM has the potential to open ing close attention to the models: Glob- and moisture, as well as the effects of up the world of climate modeling to al warming does have consequences

424 American Scientist, Volume 102 © 2014 Brian Hayes. Reproduction with permission only. Contact [email protected]. for human welfare, and any success- GISTEMP, which extract temperature tenor of the conversation. GISTEMP is ful strategy for addressing the problem trends from historical obser- no longer so controversial. will depend on public understanding vations. The code was released, but Could the same kind of rewriting of what’s at stake. Climate scientists no one could understand it or get it to succeed in the case of a climate model? have been ringing warning bells for at run. Nick Barnes and David Jones, two The undertaking would be substantial- least 25 years about the effects of atmo- British computer scientists, gathered ly more difficult. Modeling programs spheric CO2; governments and interna- up the untidy collection of files and are larger and more complicated both tional organizations have responded rewrote them as a single program in mathematically and algorithmically. with various plans and pledges, but the Python language, “with an empha- High performance is imperative. Still, carbon emissions continue to grow. The sis on code clarity that encouraged in- it’s worth a try. Someday we may rate of increase in 2013 set a new record. terested people to download, inspect, be able to say, “Climate modeling— It’s easy to come up with reasons for and run it themselves.” Their new pro- there’s an app for that.” public inaction: uncertainty about the gram produces the same results as the magnitude of the risk and the cost of original. Furthermore, by taking the For a list of references and links to other the remedies, a reluctance to focus on mystery out of how the resources on climate modeling, see http:// the future in a world where so many are calculated, they have changed the bit-player.org/extras/climate. troubles demand immediate attention, the distraction of politicized wrangling between “believers” and “deniers.” But the subtleties and complexities of the underlying science are also a fac- tor. It’s hard to get motivated about an issue you don’t fully understand. Handing out free climate models on street corners may not restore univer- sal reason and civility, but perhaps it’s a way of tilting the discussion away from politics and back toward science. Right now, we have no climate mod- el suitable for handing out on street corners. The ideal model would be ef- fortless to install and run. Or maybe it would run as a web application, which eliminates installation entirely. (Chan- dler is conducting tests of a web-based follow-on to EdGCM.) The software would have an inviting interface that requires no knowledge of program- ming, but for those who want to delve deeper it would also be open to ex- ploration of its algorithms and data structures. This last criterion may be the hardest to satisfy. It’s not enough to make the source code available; the code must also be written to a high standard of clarity and simplicity. Should the major climate modeling groups be expected to produce such a pedagogical adjunct to their research tools? In my view it would be entirely appropriate for them to do so. Indeed, because climate change affects every person on Earth, and any remedy will have to enlist the support and coop- eration of the whole planet, I find it peculiar that public outreach gets such paltry support. Yet that situation is un- likely to change. A success story from a few years ago suggests there might be another way. Global warming doubters pressed the Hansen group to publish the source code for a suite of programs known as www.americanscientist.org © 2014 Brian Hayes. Reproduction with permission only. 2014 November–December 425 Contact [email protected].