<p>You might try a latitudinally-resolved climate model.  These were invented in 1969 to see how global warming or cooling moved the boundaries of the polar caps.  One result is that a slight decrease in the Solar constant glaciates the Earth; that's because the models don't include the carbonate-silicate cycle which stabilizes Earth's temperature in the long run.  But for examining small changes it might be okay.</p>
<p>The basic equation is one of power balance (usually incorrectly called &quot;energy balance&quot;):</p>
<p>Qi (1 - Ai) = A + B Ti + C(Ti - T)</p>
<p>Here Qi is the insolation, averaged over the year, in a given latitude band, band i--you need a lot of spherical astronomy and trig to figure this out, but some articles (e.g. Warren and Schneider 1979 or Chylek and Coakley 1975) have precalculated tables you can use.  Ai is the albedo in that band--you can set this to flip from a high value (bright, icy) to a low value (dark, uncovered) when temperature goes over a critical value, like 273 K.  The whole left-hand side of the equation, then, is the solar power absorbed in that climate band.</p>
<p>A + B Ti is the infrared power emitted by that band to space.  A and B are constants (A is not the albedo Ai), and Ti is the band's temperature--normally you start out with an isothermal Earth and then iterate until the simulation stabilizes.  Values for A and B vary somewhat in the literature, but in a recent paper I used A = 214.5 W m^-2 and B = 1.57 W m^-2 K^-1.</p>
<p>The last term is the energy moved from one band to another, in a very simple (read &quot;crude&quot;) &quot;diffusion&quot; model.  C is a constant, Ti is and temperature, and T is the average temperature of the whole globe (I'll tell you how to calculate that in a minute).  Again, values for C vary.  Recently I used C = 3.74 W m^-2 K^-1.</p>
<p>You can find the mean global albedo or temperature or what-have-you by multiplying the zonal values by the zonal area fraction and adding up all the figures.  You find the fraction of a hemisphere's area by subtracting the sine of the more equatorial boundary from the sine of the more polar boundary.  For instance, the area of a hemisphere between 30 and 40 degrees is sin(40) - sin(30) = 0.1428.</p>
<p>P. Chýlek, J.A. Coakley, Jr.  J. Atmos. Sci. 32, 675-679 (1975).</p>
<p>S.G. Warren, S.H. Schneider.  J. Atmos. Sci. 36, 1377-1391 (1979).</p>

CC BY-SA 4.0
2022-11-24T16:48:52.750Z
2022-11-24T16:48:52.750Z
bpl1960
<h1>Full scale climate models</h1>
<p>The atmospheric climate simulations that are presented in the IPCC reports are performed by quite large and complex models. Running these models needs a &quot;<em>supercomputer</em>&quot; (high performance cluster). Additionally, certain &quot;<em>forcing data</em>&quot; and &quot;<em>boundary conditions</em>&quot; are needed.</p>
<p>Boundary conditions are the top of the atmosphere and the Earth's surface/oceans. Partly, atmospheric climate model simulations are directly coupled to ocean model simulations. This makes the models even larger and harder to setup/run. &quot;Forcing data&quot; means thinks like CO<sub>2</sub> emissions, emissions of particulate matter, solar radiation ... .</p>
<p>Having said that: it is quite unrealistic to setup und run a &quot;real&quot; climate model just for fun.</p>
<h1>Further reading on recent climate modeling activities</h1>
<p>Simulation results of the <em>couple model intercomparison project</em> (CMIP) form the basis for the IPCC reports. The CMIP Phase 6 (CMIP6) simulations form the basis of the most recent IPCC reports. There is an overview paper of CMIP6 which might indicate how large the overhead for running &quot;real&quot; climate models in a comparable way is <a href="https://doi.org/10.5194/gmd-9-1937-2016" rel="noreferrer">(Eyring et al., 2016)</a>.</p>
<p>One of the models that were used for the CMIP5 and CMIP6 simuations was the MPI-ESM model. An overview of this model is given in <a href="https://doi.org/10.1002/jame.20038" rel="noreferrer">Giorgette et al. (2013)</a>. Detailed descriptions are available in this <a href="http://agupubs.onlinelibrary.wiley.com/hub/issue/10.1002/(ISSN)1942-2466.MPIESM1/" rel="noreferrer">special issue</a>.</p>
<p>There are several more models used in CMIP5 and CMIP6. The MPI-ESM is just an example.</p>
<h1>Climate models made for training</h1>
<p>There are some simple climate models that are made for students and which are based on a few governing equations. Seems models show the general features of climate models but can be run on a normal end-user computer. One of these models is the &quot;Monash simple climate model&quot;. An instance of that model which can be run via a web-GUI is available <a href="http://mscm.dkrz.de/overview_i18n.html?locale=EN" rel="noreferrer">here</a>. There is a <a href="http://mscm.dkrz.de/GREB_model.html?locale=EN" rel="noreferrer">documentation available</a> in which you will find links to a publication describing the model and to a repository to download the source code.</p>
<p>There is another climate model made for training which is called <a href="https://www.mi.uni-hamburg.de/en/arbeitsgruppen/theoretische-meteorologie/modelle/plasim.html" rel="noreferrer">Planet Simulator</a>. Download details and documentation are offered on that web page.</p>

CC BY-SA 4.0
2021-11-08T18:01:37.333Z
I find it quite confounding that the physical reason for the greenhouse effect, i.e. the increase in infrared optical depth $\rm \tau_{IR}$, and simple solutions for the temperature $\rm T(\tau_{IR})$ such as discussed in https://ui.adsabs.harvard.edu/abs/2010A%26A...520A..27G/abstract are never to be found in the terrestrial climate literature. The only thing to be found are two-stream like 1-layer models with the emissivity and absorptivity being given as magical numbers. Is there a reason for this in the geo community? Did stellar and terrestrial atmospheric physics diverge sometime?
AtmosphericPrisonEscape
CC BY-SA 4.0
2021-11-08T23:32:46.387Z
@AtmosphericPrisonEscape I have no idea.
daniel.heydebreck
CC BY-SA 4.0
2021-11-05T10:37:00.907Z
2021-11-05T11:04:28.293Z
2021-11-05T11:04:28.293Z
daniel.heydebreck
<p>Sorry for the stupid question, but I have been unable to answer it even after wasting time googleing for a while... I know there are several climate-changes scenarios, and I know the several climatic databases offering surfaces (rasters) with those scenarios. However, I want to try some calculations on my own, for which I am looking for the mathematics behind these models (the different scenarios) or some code (preferably in R). Any suggestion?</p>

CC BY-SA 4.0
2021-11-05T13:18:38.323Z
If you are interested in a basic understanding and not in exact results, I suggest to look at basic concepts of climate physics like equilibrium climate sensitivity, the radiative equilibrium and radiative forcing. You can easily estimate for example earths temperature without greenhouse effect. There are probably many example calculations on this site as well. See e.g. my answer here (not directly related to your question though): https://earthscience.stackexchange.com/questions/20937/why-divide-total-insolation-by-4/20944#20944 + comments below.
Joscha Fregin
CC BY-SA 4.0
2021-11-06T03:47:19.590Z
I could've sworn there was a post on some Stack network (perhaps not this one) about getting the nobel prize winner's early model running on your machine... but gosh if I can't find it.  [Simple climate models that predict climate change](https://earthscience.stackexchange.com/questions/4874/simple-climate-models-that-predict-climate-change) may offer little bits of use.
JeopardyTempest
CC BY-SA 4.0
2021-11-06T03:51:09.950Z
These also look interesting: [Simple Climate Model Lab](https://pcc.uw.edu/wp-content/uploads/sites/15/2014/10/climatemodel_lessonplan.pdf) and [this Reddit thread on climate modeling in R](https://www.reddit.com/r/RStudio/comments/9r04y2/climate_modelling_in_r/)
JeopardyTempest
CC BY-SA 4.0
2021-11-06T10:44:32.703Z
@JeopardyTempest [Suki Manabe ftw](https://earthscience.stackexchange.com/questions/22959/nobel-prize-manabes-1967-code-for-solving-the-1d-atmospheric-thermal-equilibriu): I thought it previously had an answer, but apparently not.
Deditos
CC BY-SA 4.0
2021-11-07T03:35:27.083Z
If you're seriously interested, try Raymond PierreHumbert's "Principles of Planetary Climate".  I don't think you're likely to find serious models written in anything but C/C++ or Fortran.
jamesqf
CC BY-SA 4.0
2021-11-11T14:05:36.053Z
If you are talking about the climyte physics model, you will never be able to run a 3D (or even 2.5D model) fast enough in R (unless you execute from R effectively the C or Fortran code: since it is a tedious tasks, people needing these codes are not spending time to allow for their execution under R, so it is a programming question, more than earth science).
If you are discussing the economics model related to climate change ... no idea, seems reasonable you can run it with R, simply by assuming a certain increase in temperature (or other results from global scale climate model).
EarlGrey
<climate-change><climate-models><r>
Looking for the mathematics so I can run climate change simulations
perep1972
# Looking for the mathematics so I can run climate change simulations

(Asked by: username_0 on 2021-11-05)

Sorry for the stupid question, but I have been unable to answer it even after wasting time googleing for a while... I know there are several climate-changes scenarios, and I know the several climatic databases offering surfaces (rasters) with those scenarios. However, I want to try some calculations on my own, for which I am looking for the mathematics behind these models (the different scenarios) or some code (preferably in R). Any suggestion?

**Tags:** climate-change, climate-models, r

> **Comments:**
> **username_1**: If you are interested in a basic understanding and not in exact results, I suggest to look at basic concepts of climate physics like equilibrium climate sensitivity, the radiative equilibrium and radiative forcing. You can easily estimate for example earths temperature without greenhouse effect. There are probably many example calculations on this site as well. See e.g. my answer here (not directly related to your question though): https://earthscience.stackexchange.com/questions/20937/why-divide-total-insolation-by-4/20944#20944 + comments below.  
> **username_2**: I could've sworn there was a post on some Stack network (perhaps not this one) about getting the nobel prize winner's early model running on your machine... but gosh if I can't find it.  [Simple climate models that predict climate change](https://earthscience.stackexchange.com/questions/4874/simple-climate-models-that-predict-climate-change) may offer little bits of use.  
> **username_2**: These also look interesting: [Simple Climate Model Lab](https://pcc.uw.edu/wp-content/uploads/sites/15/2014/10/climatemodel_lessonplan.pdf) and [this Reddit thread on climate modeling in R](https://www.reddit.com/r/RStudio/comments/9r04y2/climate_modelling_in_r/)  
> **username_3**: @username_2 [Suki Manabe ftw](https://earthscience.stackexchange.com/questions/22959/nobel-prize-manabes-1967-code-for-solving-the-1d-atmospheric-thermal-equilibriu): I thought it previously had an answer, but apparently not.  
> **username_4**: If you're seriously interested, try Raymond PierreHumbert's "Principles of Planetary Climate".  I don't think you're likely to find serious models written in anything but C/C++ or Fortran.  
> **username_5**: If you are talking about the climyte physics model, you will never be able to run a 3D (or even 2.5D model) fast enough in R (unless you execute from R effectively the C or Fortran code: since it is a tedious tasks, people needing these codes are not spending time to allow for their execution under R, so it is a programming question, more than earth science). If you are discussing the economics model related to climate change ... no idea, seems reasonable you can run it with R, simply by assuming a certain increase in temperature (or other results from global scale climate model).  

---

## 2 answers

### Answer by username_7 on 2021-11-05. Score: 13 | Accepted answer

# Full scale climate models

The atmospheric climate simulations that are presented in the IPCC reports are performed by quite large and complex models. Running these models needs a "*supercomputer*" (high performance cluster). Additionally, certain "*forcing data*" and "*boundary conditions*" are needed.

Boundary conditions are the top of the atmosphere and the Earth's surface/oceans. Partly, atmospheric climate model simulations are directly coupled to ocean model simulations. This makes the models even larger and harder to setup/run. "Forcing data" means thinks like CO2 emissions, emissions of particulate matter, solar radiation ... .

Having said that: it is quite unrealistic to setup und run a "real" climate model just for fun.

# Further reading on recent climate modeling activities

Simulation results of the *couple model intercomparison project* (CMIP) form the basis for the IPCC reports. The CMIP Phase 6 (CMIP6) simulations form the basis of the most recent IPCC reports. There is an overview paper of CMIP6 which might indicate how large the overhead for running "real" climate models in a comparable way is [(Eyring et al., 2016)](https://doi.org/10.5194/gmd-9-1937-2016).

One of the models that were used for the CMIP5 and CMIP6 simuations was the MPI-ESM model. An overview of this model is given in [Giorgette et al. (2013)](https://doi.org/10.1002/jame.20038). Detailed descriptions are available in this [special issue](http://agupubs.onlinelibrary.wiley.com/hub/issue/10.1002/(ISSN)1942-2466.MPIESM1/).

There are several more models used in CMIP5 and CMIP6. The MPI-ESM is just an example.

# Climate models made for training

There are some simple climate models that are made for students and which are based on a few governing equations. Seems models show the general features of climate models but can be run on a normal end-user computer. One of these models is the "Monash simple climate model". An instance of that model which can be run via a web-GUI is available [here](http://mscm.dkrz.de/overview_i18n.html?locale=EN). There is a [documentation available](http://mscm.dkrz.de/GREB_model.html?locale=EN) in which you will find links to a publication describing the model and to a repository to download the source code.

There is another climate model made for training which is called [Planet Simulator](https://www.mi.uni-hamburg.de/en/arbeitsgruppen/theoretische-meteorologie/modelle/plasim.html). Download details and documentation are offered on that web page.

> **Comments:**
> **username_8**: I find it quite confounding that the physical reason for the greenhouse effect, i.e. the increase in infrared optical depth $\rm \tau_{IR}$, and simple solutions for the temperature $\rm T(\tau_{IR})$ such as discussed in https://ui.adsabs.harvard.edu/abs/2010A%26A...520A..27G/abstract are never to be found in the terrestrial climate literature. The only thing to be found are two-stream like 1-layer models with the emissivity and absorptivity being given as magical numbers. Is there a reason for this in the geo community? Did stellar and terrestrial atmospheric physics diverge sometime?  
> **username_7**: @username_8 I have no idea.  

---

### Answer by username_6 on 2022-11-24. Score: 0

You might try a latitudinally-resolved climate model. These were invented in 1969 to see how global warming or cooling moved the boundaries of the polar caps. One result is that a slight decrease in the Solar constant glaciates the Earth; that's because the models don't include the carbonate-silicate cycle which stabilizes Earth's temperature in the long run. But for examining small changes it might be okay.

The basic equation is one of power balance (usually incorrectly called "energy balance"):

Qi (1 - Ai) = A + B Ti + C(Ti - T)

Here Qi is the insolation, averaged over the year, in a given latitude band, band i--you need a lot of spherical astronomy and trig to figure this out, but some articles (e.g. Warren and Schneider 1979 or Chylek and Coakley 1975) have precalculated tables you can use. Ai is the albedo in that band--you can set this to flip from a high value (bright, icy) to a low value (dark, uncovered) when temperature goes over a critical value, like 273 K. The whole left-hand side of the equation, then, is the solar power absorbed in that climate band.

A + B Ti is the infrared power emitted by that band to space. A and B are constants (A is not the albedo Ai), and Ti is the band's temperature--normally you start out with an isothermal Earth and then iterate until the simulation stabilizes. Values for A and B vary somewhat in the literature, but in a recent paper I used A = 214.5 W m^-2 and B = 1.57 W m^-2 K^-1.

The last term is the energy moved from one band to another, in a very simple (read "crude") "diffusion" model. C is a constant, Ti is and temperature, and T is the average temperature of the whole globe (I'll tell you how to calculate that in a minute). Again, values for C vary. Recently I used C = 3.74 W m^-2 K^-1.

You can find the mean global albedo or temperature or what-have-you by multiplying the zonal values by the zonal area fraction and adding up all the figures. You find the fraction of a hemisphere's area by subtracting the sine of the more equatorial boundary from the sine of the more polar boundary. For instance, the area of a hemisphere between 30 and 40 degrees is sin(40) - sin(30) = 0.1428.

P. Chýlek, J.A. Coakley, Jr. J. Atmos. Sci. 32, 675-679 (1975).

S.G. Warren, S.H. Schneider. J. Atmos. Sci. 36, 1377-1391 (1979).


---

