Simple climate models have been around for more than a century but have recently come back into fashion: they are useful for explaining global warming and the habitability of extrasolar planets. The Climate App ( is an interactive web-based application that describes the radiative transfer governing planetary climate. The App is currently available in French and English and is suitable for teaching high-school through college students, or public outreach. The beginner version can be used to explore the greenhouse effect and planetary albedo, sufficient for explaining anthropogenic climate change, the the habitability of TRAPPIST planets and other simple scenarios. There is also an advanced option with more atmospheric layers and incorporating the absorption and scattering of shortwave radiation for students and educators wishing a deeper dive into atmospheric radiative transfer. A number of pedagogical activities are being beta tested and rolled out. 1. Global warming has become a matter of increasing concern in recent decades [1, 2]. In parallel, astronomers have discovered thousands of exoplanets with varied atmospheres, some of which could harbour life. Despite tremendous public and academic interest in both topics, it is not widely appreciated that the same 19 th century atmospheric physics governing anthropogenic climate change also governs planetary habitability [3, 4]. A visually intuitive and interactive way to convey the concepts of albedo and the greenhouse effect can be useful for students, educators and the public, e.g., [5, 6]. This motivated the web-based Climate App, which serves as a tool to explore the roles that atmospheric absorption and emission play in planetary climate. We introduce each component of the Climate App in Section 2 and explain the underlying physical concepts and mathematical model in Section 3. The Climate App is a single-page web application written in HTML5, javascript and CSS using React.js v16.5.1 so it works on a computer, tablet or smartphone. The app is currently available in French and English. You can change between the beginner and advanced version using the switch below the title. The two versions differ in the complexity of their underlying atmospheric models, and consequently have different number of adjustable The graphical panel of the Climate App is a visual representation of the energy flows controlling the planet's climate. The pale blue swath above the planet's surface represents the atmosphere. The yellow arrows show shortwave radiation from the star, roughly corresponding to visible light for the Sun. The red arrows represent longwave thermal emission, typically infrared, from the planetary surface and atmosphere. The width of each arrow is proportional to the importance of that energy flow as compared to the amount of starlight that reaches the planet. This sort of schematic showing energy flows in a planet's atmosphere is sometimes called a Trenberth Diagram and are commonplace in climate studies of Earth and other worlds [7-9]. Moving the sliders in the control panel changes the planetary parameters and hence the way that energy flows in and out of the atmosphere, which is ultimately what governs the surface temperature. Temperatures are reported in Celsius for the beginner version and Kelvin for the advanced version. The beginner version of the app also reports the magnitude of the greenhouse effect in degrees Celsius; this is the difference between the surface temperature and the value it would take if the infrared opacity of the atmosphere were zero. The default values of the sliders when you open the Climate App, both the beginner and advanced versions, are approximately the average values for modern-day Earth. The control panel on the left lets you vary the planet's properties and hence its climate with the corresponding sliders. Three properties are common to both versions while two extra properties are present exclusively in the Advanced version. Energy from Star (Stellar Radiation in Advanced App) Also known as "instellation", this slider controls the amount of starlight that reaches the top of the planet's atmosphere. For planets in the Solar System, the star in question is none other than the Sun! Incident starlight is the most important factor determining a planet's climate. For convenience, the Climate App expresses the instellation in terms of the solar constant, the average flux that the Earth receives from the Sun (341 W/m 2 ). For example, a value of 10 on this slider would mean that the planet receives ten times the amount of stellar radiation that we receive on Earth. The slider is a logarithmic scale, which allows for values a hundred times smaller or greater than the solar constant. This slider controls the surface reflectivity of the planet. A value of 0 means the planet is perfectly black and absorbs all incoming stellar radiation; there are many planets close to this limit. No planet, on the other hand, reflects all incoming radiation, so the Climate App restricts the albedo to values less than 99%. Albedo and instellation determine how much energy the planet absorbs every second and hence how much energy it must radiate away every second in order to remain in radiative equilibrium. Although this energy balance is only approximate from one second to another, it must be maintained on timescales of years. 1 In the advanced app, starlight can also be reflected back to space by the atmospheric layer(s) so the top-ofatmosphere effective albedo is reported in the Trenberth diagram. The effective albedo can be greater than or less than the underlying surface albedo, depending on the shortwave properties of the atmosphere. The default value for the planetary reflectivity in the beginner app is 30%, while in the advanced app the surface albedo is 18% and the effective albedo-accounting for scattering by the atmosphere-is 30%. The Earth's albedo is approximately 30%, largely due to clouds. When this slider is moved, the planet in the simulation canvas change shade. This box contains properties that are specific to the planetary atmosphere. In the beginner version, the atmosphere is treated as a single layer .
You may remove the atmosphere by clicking the x and add it back by clicking on a + box that only appears when your planet does not have an atmosphere. For the advanced version , a maximum of three atmospheric layers are allowed and each can be assigned different properties. This simulates vertical changes in atmospheric properties, e.g., Earth's atmosphere has more water vapour in the lower, warmer layers compared to the higher and colder layers. In this case, it is more realistic to assign greater infrared opacity to lower layers instead of setting one single value representing the whole atmosphere. You can click on the + Infrared Opacity (Longwave Emissivity in Adv. App) Each atmospheric layer has an adjustable longwave emissivity, its effectiveness in absorbing and emitting thermal radiation. A value of 1 absorbs all infrared radiation that hits it and re-radiates that energy equally up and down. This value depends on the greenhouse gases (GHG) in the atmosphere: for small levels of GHG the infrared opacity increases linearly with gas abundance, but once absorption lines are saturated-as they are on Earth-opacity increases more slowly. As shortwave radiation encounters an atmospheric layer, the photons may pass through without interaction, be absorbed, or be scattered by molecules and aerosols in the atmosphere. This slider determines the fraction of shortwave radiation interacting with the corresponding layer (absorbed or scattered). A value of 1 means that all of the shortwave photons are either absorbed or scattered by that atmospheric layer. Single scattering albedo refers to the fraction of interacting shortwave photons that are scattered rather than absorbed. For example, a value of 0.1 indicates that out of all the shortwave photons having interacted with the atmosphere, 10% are scattered, while the remaining 90% are absorbed. The Climate App assumes isotropic scattering, so half of the scattered photons keep going in their original direction of travel, while the other half are back-scattered from whence they came. The Climate App is built upon atmospheric physics that have been known since the late 19 th century [4]. The following key concepts are essential for users or students who wish to dive deeper into the model derivation. All objects emit radiation, whether you can see it or not. The colour-dependence of this so-called blackbody radiation is quantitatively described by Planck's Law. Hot objects like the Sun emit most of their light at visible wavelengths (the range of light that human eye can see, not coincidentally). Somewhat cooler objects like planets and people tend to emit most of their radiation at longer infrared wavelengths (beyond the red end of the rainbow). Since visible and thermal light interact with the planetary surface and atmosphere in qualitatively different ways, it is customary in climate science to distinguish between the shortwave radiation received from a star and longwave radiation emitted by the planet (among experts, this is known as the two band approximation). In the Climate App visualizations, shortwave light is denoted by yellow arrows, while thermal radiation is denoted by red arrows. The Stefan-Boltzmann law quantifies the relation between the temperature and total emitted flux (at all wavelengths) for a perfectly absorbing and emitting object, a so-called blackbody: F bb = T 4 , where F bb is the emitted flux (units of W/m 2 ), T is the temperature of the object in Kelvin, and  is the Stefan-Boltzmann constant: Real materials are not perfect blackbodies: they do not perfectly absorb and radiate. Since the surface and atmosphere of a planet emit at longer, thermal wavelengths, we quantify the ability of an object to radiate by its longwave emissivity, LW . The flux emitted by an element of the climate system is therefore given by F = LW T 4 . The surface emits this amount of radiation upwards, while an atmospheric layer emits this amount of radiation upwards and the same amount downwards. Kirchhoff's law of thermal radiation dictates that a material's ability to emit radiation at some wavelength is equal to its ability to absorb radiation at that same wavelength. For example, gases that readily absorb infrared light-so-called greenhouse gases-must also emit well at those same wavelengths. Solid and liquid surfaces clearly do not absorb all of the light that hits them (otherwise they would appear perfectly black!). Indeed, the surface reflectance (or albedo) slider in the Climate App controls the fraction of visible light that the planetary surface reflects. 2 These same materials, however, are very close to being perfect blackbodies in the thermal infrared. They all have LW  1. To very good approximation, we therefore adopt LW  1 for the planetary surface in the Climate App. A planet's atmosphere, on the other hand, can have an infrared emissivity anywhere between zero to one (0  LW  1), depending on the presence of greenhouse gases; this is precisely what the Longwave Opacity slider controls (Infrared Opacity in the beginner version). In the beginner version the atmosphere cannot absorb shortwave radiation, so if the longwave emissivity is set to zero then the atmosphere simply cannot absorb any energy and its temperature is ill-defined and we remove the atmospheric temperature label. 3 In the beginner version of the app we assume that shortwave radiation does not interact with the atmosphere ( SW  0). This is approximately correct for planets like Earth and Mars, where most Sunlight indeed makes it down to the surface of the planet, but is utterly inadequate for Venus or Titan. Such thick atmospheres require the Advanced Climate App, which allows for the absorption or scattering of shortwave radiation (0 < SW  1). A planet must radiate as much energy to space as it absorbs from its star, at least on average. Moreover, if radiation is the only way to move energy around in a climate system, then the total absorbed and emitted flux must be equal for each component of the climate system (atmospheric layer or planetary surface).
To understand why this equilibrium arises, imagine a patch of ground that absorbs more energy than it emits: it will warm up and hence radiate away more heat following the Stefan-Boltzmann Law, finding a new, warmer, equilibrium. Conversely, a region that radiates more energy than it absorbs will cool down. 4 Radiation is not the only way to move energy around. Heat conduction is rarely important for planetary climate 5 so we completely neglect it in the Climate App. Convection, on the other hand, operates in many planetary atmosphere, including the Earth's. Since convection is just another means of moving heat from the planetary surface up to the atmosphere, it can roughly be thought of as contributing to the red arrow pointing from the surface up to the atmosphere. The concept of radiative equilibrium is illustrated in the right panel of the Climate App: the total width of all arrows from the planetary surface equal the total width of all arrows reaching the surface. The same situation applies for each atmospheric layer, and indeed even at the top of the atmosphere: the same amount of energy enters the atmosphere from above as exits to space. Photons can go in any direction, but it is expedient for one-dimensional climate calculations such as these to assume that light is either travelling straight up or straight down (this simplification is known to aficionados as the two stream approximation). Conceptually, it is easy to see how the messy reality of multi-directional photons might boil down to the two-stream approximation: any ray of light must be travelling somewhat towards or away from the planet, but typical rays must pass through a bit more atmosphere because they are not entering or exiting the atmosphere perfectly vertically. In the Beginner version we consider the simplest greenhouse model, where the incoming solar radiation passes through the atmosphere without incident. The flow of energy under this simple model is illustrated in The guiding principle is radiative equilibrium: each component of the climate system must emit as much flux as it absorbs. There are two unknowns: the surface temperature, T surf , and the atmospheric temperature, T atm . We therefore need two equations in order to solve the problem. In each case we put the absorbed power on the left hand side and the emitted power on the right. The atmospheric balance is where LW is the longwave emissivity (infrared opacity in the Beginner version). The left hand side is the flux emitted by the surface that is absorbed by the atmosphere (arrow 4) and the right hand side is the sum of the upward and downward fluxes emitted by the atmosphere (arrows 5 and 6). Inspection of Equation 1 reveals many of the same symbols on both sides of the equality, which begs for simplification, yielding T 4 surf = 2T 4 atm . The flux balance at the surface is where F * is the stellar flux reaching the planet 6 and A is the planetary albedo (planetary reflectivity in the Beginner App). The first term on the left hand side is the incident stellar flux (arrow 1), the second term is the reflected light (arrow 2) and the third term is the downward atmospheric emission (arrow 6); on the right hand side there is the emission from the planetary surface (arrow 4)-recall that we assume perfect surface emissivity, an excellent approximation. Substituting our expression for atmospheric radiative equilibrium, T 4 surf = 2T 4 atm , into Equation 1, we obtain which can be solved for the atmospheric temperature: and from thence the surface temperature: Lastly, the Beginner version of the Climate App reports the magnitude of the greenhouse effect. This is calculated by comparing the surface temperature with what it would have been in the absence of the greenhouse effect, i.e., LW = 0. For the default parameters, the magnitude of the greenhouse effect is 33  C, again in good agreement with modern-day Earth. Using the same reasoning as the simple greenhouse model, we can derive the system of equations to solve for the temperatures of the planetary surface and three atmospheric layers. However, the model used in the advanced version is more complicated. In addition to the extra atmospheric layers, the advanced Climate App includes two new parameters for each atmospheric layer to control how they interact with shortwave radiation. These parameters are the shortwave opacity, SW , and the single-scattering albedo, . When shortwave radiation arrives at an atmospheric layer, it can do three things: transmission with a factor of 1 SW , scattering with a factor of SW , and absorption with a factor of SW (1  ). We use F 3 , F 2 , F 1 and F 0 to denote the shortwave flux absorbed at layer 3, layer 2, layer 1 of the atmosphere and at the surface, respectively. The values of the shortwave flux terms F 3 , F 2 , F 1 and F 0 are determined as follows. In the one-dimensional scattering model used in the Climate App, we assume an asymmetry factor of 0 at each atmospheric layer, i.e., isotropic scattering. This means that half of the photons scattered at a given layer are scattered back in the direction they came from, while the other half are scattered forward. Since we use a 1-D model, we treat the forward scattering case as equivalent to transmission. With the isotropic scattering assumption, we can solve the following system of equations to obtain the shortwave terms: where I is the incident stellar flux, u i and d i are the total shortwave radiation heading upward and downward from the i th layer, SW1 , SW2 and SW3 are the shortwave opacities of each atmospheric layer,  1 ,  2 and  3 are their single scattering albedo, and A is the surface albedo. As an example, Figure 4 shows the shortwave radiation transmitted upward from layer 1, u 1 .
It is the sum of three components indicated by three thinner arrows (from left to right): a fraction of shortwave radiation reflected upward from the surface that goes through layer 1 without any interaction, u 0 (1 SW1 ), a fraction of radiation transmitted downward from layer 2 that backscatters off of layer 1, 1 2 d 2 SW1  1 , and another fraction of radiation reflected upward from the surface that forward scatters off layer 1, 1 2 u 0 SW1  1 . The factors of 1 2 comes from the assumption of isotropic scattering. Following the logic that led us to Equation 1, we focus on layer 2 (with absorbed shortwave flux F 2 , temperature T 2 and longwave emissivity LW2 ) as an example to the derivation of the full system of equations shown in Appendix A. The emission from layer 2 is 2 LW2 T 4 2 , identical to the right hand side of Equation 1 since layer 2 also emits both upwards and downwards. As for the absorption, we have shortwave radiation F 2 , thermal radiation from layer 3 and layer 1, and attenuated thermal radiation from the surface. The equation of radiative equilibrium is therefore: The full system of equations and its analytic solutions are listed in Appendix A. Appendix B explains how the shortwave flux terms (F 3 , F 2 , F 1 and F 0 ) are determined; they also result in analytic expressions that only depend on user-input parameters. Near-immediate feedback while using the application is therefore allowed. The Climate App incorporates simple climate models based on radiative equilibrium. It offers an intuitive and user-friendly way to explain various climate concepts to students in high school and college. Example modules at various stages of development and beta testing include: the and the habitability of the TRAPPIST-1 planets. If you would like to test activities or have questions about the Climate App then please contact Nick Cowan. The system of equations that ensure radiative equilibrium at each atmospheric layer and at the surface is: where LW1 , LW2 and LW3 are the longwave emissivity of the three atmopsheric layers (recall that we assume the surface has a longwave emissivity of 1). Solving this system of equation gives: Substituting the expressions for d i and u i into the equations for F i yields Acknowledgements: The authors thank Dorian Abbot and Tim Merlis for constructive feedback. Acknowledgements: The authors thank Dorian Abbot and Tim Merlis for constructive feedback.