Monday, September 15, 2014

The Grid Box

by Ben Brown-Steiner

The above image is taken from a popular indie game called Minecraft that gives players free access to an environment with in which they can interact with water, land, lava, and other natural resources. It’s blocky textures are a unique style for modern games, but serves as a wonderful example of how climate modelers look at our world.
The Earth is huge and complex. It’s easy to lose yourself observing the infinite details in an ant colony, a thunderstorm, or a sunset. And while that can be fun, if we’re to understand what’s happening over the entire planet, we need to divide it up into parcels and we need to try and understand how each chunk interacts to its surroundings.
Climate scientists who use models are become comfortable with viewing the Earth as a set of boxes. In order to get our increasingly powerful computers to create realistic simulations of our world, we have to divide up the atmosphere, the oceans and the land into grid boxes. For each grid box the computer tracks a single value for each variable. A grid box has one temperature, one value for cloudiness, one relative humidity, and so on. And a typical climate model has a time step of roughly 20 to 30 minutes.
Currently, we consider a high-resolution global climate model to have boxes that are around 60 kilometers or 35 miles per side. That’s roughly the length of Cayuga Lake. So a global climate model isn’t capable of seeing Cayuga Lake! How is it possible that a grid box that encompasses nearly all of Cayuga Lake and that jumps forward in time every 30 minutes has any chance of being realistic?
It’s because, somehow, astonishingly, the movement of mass and energy in the real world is amazingly organized. To some degree, it’s intelligible, which means that we can study it, take some notes, and understand the basic principles of how the it operates.
            Even though you could be standing in a parking lot in direct sunlight blinded and sweating and someone 100 feet away could be lounging in the breeze under a shady tree, if you average all of the temperatures in a region and track those values over time, you find smooth and regular patterns. If you average every temperature in a day (from the high temperature in the afternoon to the low temperature at night) and draw a graph, you can see the regular and repeating cycle of our seasons.
If you are examining a region’s climate you look at these average cycles. You ask questions like: Are the seasonal highs and lows changing over time? Is it drier, on average, this decade than it was last decade? How does the average state of our region influence the surrounding regions and the global climate? These questions are the questions of climate science and the purpose of these questions is to examine averages. In this sense, a large, abstracted grid box, is a really great way of looking at the big picture.
What, however, if you care about the high temperature tomorrow? If you want to know whether you should bring an umbrella on your walk right now, you do not ask a climate scientist. If you did, you would get a funny look and perhaps a response like this: the average daily high for September in Ithaca is 70 degrees and on average it rains 3.5 inches.
If you ask the question “What’s the weather going to be tomorrow?” you would ask a meteorologist, and the meteorologist, because they don’t have to worry about the entire globe all at once, can zoom in on smaller atmospheric patterns. They can run simulations with time steps as short as 10 seconds and grid boxes as small as one mile (~1.5 km) per side.
To look at a concrete example, let’s say you’re a climate modeler trying to capture interactions between clouds, the Earth’s surface, and solar radiation. You recognize that the real world is complicated and chaotic, but you know that there is some underlying structure that you can model. You take a look at a satellite photo over the ocean and it looks like this (from NASA):


How are you going to recreate this reality in your model? Clearly, you’ll have to simplify. If this particular picture is 100 miles per side, you know that your computers can’t capture that level of detail and have any chance of running on your computer. You need grid boxes. What size grid box is appropriate? If you had the computational power, you could build something like this:


Even though you know you’ll have to make simplifications, and parameterize (we’ll talk about these in another post) some of the small cloud features, you can still represent the overall cloud system you see in the satellite photo. But then your IT staff tells you that there’s no way you can run the model at that resolution. You need to try a somewhat coarser resolution:


You aren’t all that happy with this one since you lose a lot of detail and you’ll have to make different and broader assumptions. For instance, you’ll have to completely forget about resolving individual clouds. You’ll have to start representing cloudiness in a grid box as a percentage (real climate models do this). After some time, you hear from your IT staff that you can run this resolution, but it will take three months to run 1 year of your simulated Earth at this resolution. For your purposes, that’s not practical. Since you don’t want to give up you decide to go to an even coarser resolution with grid boxes of roughly 35 miles per side:


This one leaves out even more detail. You can hardly recognize this as a system of clouds anymore. But in exchange you can run your model at this resolution much more quickly and you’ll be able to examine the details of what you think is going on with much more confidence and data points. Right now, this is the grid box size of many climate models. And even though they use this resolution, they can be used to understand our Earth. The following image is an example of North America viewed through a variety of resolutions used today:


            The top left resolution is a course resolution used in the past. The top right is roughly the resolution of the average climate model today. The bottom left image is roughly the resolution that is considered high resolution today (the resolution that doesn’t quite see Cayuga Lake) and the bottom right resolution is one used more by meteorological models than climate models.
            As we’ve mentioned before, a model by definition is a simplification. It’s not going to simulate reality, and you are going to have to make sacrifices. But if you are careful and you understand what parts of reality you’re ignoring and what parts of reality you’re including in your model, you are able to interpret your results and hopefully discover something new that wasn’t understood before. The history of weather and climate modeling is a wonderful history of practical limitations, amazing ingenuity and cleverness, and glorious tales of scientific advancement of our understanding or our Earth.

Tuesday, September 9, 2014

Blog Post: Why Use Models at All?


By Ben Brown-Steiner

I intend on touching on many topics related to the broad expanse that is climate science, but for a first post I’m going to tackle a question that comes up every once in awhile and probably should come up more often: Why use models at all?

At its purest science is about careful experimentation and observation. We take measurements. We come up with theories. We test those theories. And science gets done. Why bother with complicated models at all?


Well, there are a lot of reasons. The first is that experimentation and observations can be expensive. Or extremely difficult. Or even impossible. We can’t create a second Earth and start tweaking with the climate. No one is advocating that neuroscientists start methodical lobotomies to learn about the brain. And it’s no longer computationally prohibitive to run a meteorological model a dozen times and look at the possible weather patterns in order to make informed decisions about tomorrow’s weather.


Second, as any tinkerer, engineer, mechanic, or chef will tell you, the best way to learn about how something works is to take it apart, look at the individual pieces and how they interact, and put it all back together. Modeling of any type, from simple toy models to expansive climate models, hold at their core this basic mentality.


To introduce the beauty and power of models of all sizes, I’m going to explore a particularly practical type of model: a model intended to help us cook a perfect steak. Apologies if you’re not a meat eater. Just pretend the rest of this post is talking about tofu or seitan.


Before we start, it’s always a good idea to define our terms. For our purposes, a simple and workable definition of a model is: a model is a representation of some aspect of the real world. I like this definition for its simplicity and its brevity. It has three main parts, each of which is important. First, “representation.” A representation is not the real thing, it doesn’t strive to be the real thing. But it does strive to approach the real thing. Any model is going to be a simplification. Second, “some aspect.” A model doesn’t try to represent the entirety of the world around us. A model represents a part of the whole, and often for a particular purpose. Third, “real world.” A model tries to represent some part of the actual real world that we all live in. A model strives to claim some aspect of “reality” and “truth.” These are big, philosophical concepts, but concepts that are at the core of any modeler or programmer’s vision for their model.


So let’s explore various types of models used to cook our perfect steak.



Perfect Steak Model #0:



To really start at the beginning, we should imagine how we would try and cook our perfect steak without any models informing our procedure. We could, perhaps, buy a thousand steaks and randomly toss them on the grill, flip them on occasion, and hope to discern the secret to steak. It’s extremely unlikely that you’ll learn much through this method. Alternatively, we could skip the whole idea of trying to cook steak ourselves and follow a procedure instead.

Perfect Steak Model #1:

So this first model is less of a model and more of a procedure. This procedure goes: go to your favorite restaurant (or friend’s house) and have them make the perfect steak for you. Alternatively, we could describe this procedure more generally: go to an expert and rely upon the expert’s knowledge to produce a perfect steak for you.

Really, this is a great model for the perfect steak. Chefs are culinary experts trained in the alchemical combination of physics, chemistry, thermodynamics, and practical realm of food science. They know how to make a great steak. For our current purposes, however, this is cheating.


Perfect Steak Model #2:

If you happen to enjoy cooking, you probably consider yourself an amateur steak-cooker (or perhaps an expert steak-cooker), and thus have your own procedure for cooking a perfect steak. This procedure, almost certainly, is based off other experts’ procedures which have been simplified for your purposes. For instance, there are many cookbooks with cooking times per side for a perfect steak that probably look something like this (taken from http://www.raysmarketonthecommon.com/):
 

This table is a simple procedure distilled from some expert model (i.e. representation of a real-world steak cooking procedure) prepared for the at-home cook’s needs. This simple table can be further simplified  by the following recipe: “Heat a grill to 350 degrees F. Cook the steak on one side for 3 minutes plus one minute for every quarter inch of thickness over one-half inch. Then flip the steak over and cook the other side for two minutes plus one minute for each quarter inch thickness of the steak greater than one-half inch.” It’s not a graceful recipe. It ignores some of the complexity, but it gets the job done.

The following graph is a more insightful representation of this our Perfect Steak Model #2:



Note that the blue line (for the first side) is quite simple. A straight line like this is called a linear trend. The red line (for the second side), however, is not so simple. It’s not linear, and this non-linearity implies that there is some underlying steak science that has been simplified in this method. 

Perfect Steak #3:

If you are a particularly dedicated at-home cook and was determined to produce the perfect steak, you might create on your own (or stumble upon, like me) this website https://groups.csail.mit.edu/uid/science-of-cooking/home-screen.html, which turns up the complexity to the maximum. This site includes many parameters (which we’ll talk about in a later post) including: thickness, time per side, meat type, starting temperature, and number of sides (i.e. number of times you flip the steak). If you fill out the individual parameters and click on the “cook” button, you’ll get a figure, similar to this one which represents a particular slice of meat and the amount of “doneness” throughout:

Quite quickly you’ll notice the complexity captured by this method:
  • note that the meat keeps cooking for over five minutes after you remove it from the heat.
  • note the percentage of meat that’s “done” for each category: raw, rare, medium rare, medium, well done, browned, and charred) and how complicated the interior of the steak looks.
  • note an option to view the final temperature of each portion of the meat.
  • if you visit the link, you’ll find caveats and sources and alternative methods to compare.
This particular model, developed by the people at MIT for an online class on the science of cooking, has taken into account aspects of physics, chemistry, and food science to develop, parameterize, tune, and code this model. It’s informative, a little absurd, and a great analogy for the complexity possible for any type of system, for any type of model. If you follow this procedure, you can have high confidence that you’ll get your perfect steak.

So now we need to address the question: Which model is the best model?


All three methods above rely on assumptions and simplifications of the complex task of cooking a steak. Models help us understand a complex part of our world by simplifying the complexity into something that’s palatable (pun intended). Determining which model is the best model depends on you and your goals and various constraints. Do you want a quick-and-dirty method? Then methods #1 and #2 are probably the best for you. Do you like the challenge of an involved and detailed recipe? Then play with method #3 and tweak the model until you get exactly what you’re looking for.
I’ve stretched this analogy too far already, so I’ll leave this post here for now. I’ll touch on many other aspects of climate and climate modeling in upcoming posts.