Climate Change Modelling
This page includes links to a selection of documents on aspects of climate change modelling.
If you were starting out in this field, motivated by our extreme existential challenges for example,
then you would be confronted by a bewildering set of background theories and skills. If you wanted
to explore models and took a look at some online sources, you would find thousands, maybe even hundreds
of thousands of lines of mostly FORTRAN code. If you were well qualified in one of the background
disciplines and, because of position requirements for example, needed to deal with parts of such
a code, then the road ahead would be at least bewildering.
Groups of staff and students at MIT, CALTEX and JPL, together with others, understood these issues
and decided to build a new climate modelling system from the ground up. The young language Julia,
invented at MIT, has many desirable features including a growing list of scientific computation
packages, easy to use parallel computation syntax, well adapted to using graphics processing units
(called GPUs but really parallel processing units). In addition, and very importantly, Julia has
an interactive user interface with a highly simplfied, functional, user interface. This reduces the
time taken to learn and test features. There is a "just-in-time" compiler built in, so no
compile-link-execute work flow.
So even though the young age of Julia is a disincentive - it makes the advent of new features and
changes to existing features more frequent - MIT/CALTEX/JPL/+ took the step of creating a joint project
named CliMA which would be written entirely in Julia.
Note to the reader: you don't need to follow all of these links - that would mean replacing
one insuperable task by another. Think of them as options. The most important aspect is to find
material, for example a book , which you can relate to and grow in understanding of aspects of
climate change. Some links will be for reference, i.e. to be consulted according to need.
To come: a set of representative examples of using CliMA Julia code to model aspects of climate change. To follow
these examples it might be helpful to sometimes refer back to these links and notes.
Corrections, comments and suggestions are very welcome - there is a lot of detail where errors and misunderstandings
creep in. Please email me broughan.kevin@gmail.com.
|
Contents: |
- Energy Balance Climate Modelling.
- Books on Geophysical Fluid Dynamics.
- Books on Climate Change Modelling.
- Sources of Data and Viewers for Climate Modelling.
NEW:
- Some Equations for Geophysical Fluids.
- Some Numerical Methods for Geophysical Fluids.
- The Julia Language.
- The CliMA project.
Energy Balance Climate Modelling: |
- In this section there are links to introductory books, articles and Python/Julia language based
lectures, as well as some more advanced materials.
- Chapter 3 in the book "A Climate Modelling Primer, 4th Ed. by
K. McGuffie and A. Henderson-Sellers, 2014.
The next three links are to an article, book and video lecture by Kevin Trenberth of NCAR and the University of Auckland:
- Tracking Earth's Energy: From El Nino to Global Warming, by K. E. Trenberth and
J. T. Fasullo, Surv in Geophys vol 33 (2011), 413-426.
- The Changing of Energy Flows Through the Climate System,
by K. E. Trenberth, Cambridge, 2022.
- The Changing of Energy Flows Through the Climate System, video presentation (Youtube) by Kevin Trenberth.
The following two links are to related lectures illustrated with interactive code which the reader can experiment with:
- Lectures by Florian Boegel, based on the lectures by
Henri Drake's MIT course, but using on the language Python and presented as HTML.
-
Lectures by Henri Drake et al., being part of the MIT course "Introduction to
Computational Thinking", 2016. Julia language and Pluto.jl are used to illustrate energy balance climate models.
The following three links are to a book chapter and article by G. R. North et al., and related Julia language code by Nils Bochow:
- Energy-balance climate models,
being Chapter 3 by G. R. North and M. J. Stevens in the book "Frontiers of Climate Modelling, eds. J. T. Kiehl and V. Ramanathan, Cambridge, 2006.
- Energy Balance Climate Models by G. R. North, R. F. Cahalan and
J. A. Oakley Jr., Rieviews of Geophysics and Space Physics, vol 19, (1981), 91-121.
- Julia code for an energy balance climate model, by Nils Bochow. This code as of writing needs some updating. It
uses the packages DifferentialEquations.jl, Plots.jl and PyPlot.jl and employs both stochastic DEs and ordinary DEs. It is more comprehensive than the models described
in the lectures of Florian Boegel and Henri Drake linked in this section.
|
Click here to return to the Contents.
|
Click here to return to the Contents.
|
Click here to return to the Contents.
Sources of Data and Viewers for Climate Modelling: |
There are dozens of sites on the web with access to data for climate change. This is bewildering since links are
opten stale and time periods limited. I have chosen a small set which should continue to be well supported and
documented. The user may require free registration to download data. There are frequently interactive data
visualizations available, specialized for a given site. An exception is NASA's These viewers could be useful for data exploration before taking
the step of building calls to functions say in CSV.jl or netCDF.jl - see the pages on Julia below.
|
Click here to return to the Contents.
Some equations and approximations for geophysical fluids |
Including:
- Constants
- Variables
- Equations for air and sea water
- The Boussinesq approximation
- Spherical coordinates
- Perturbed oblate spherical coordinates
- Reynolds averaging of the flow equations
- Earth system models of intermediate complexity
- Boundary conditions
- Scales
- Dimensionless numbers
- Planetary waves
- Geostrophic flows
- Barotropic flows and the shallow water (or air) equations
- Quasi-geostrophic flows
|
Click here to return to the Contents.
Numerical Methods: |
- Including:
- Definitions
- Modelling errors
- Methods for the approximation of derivatives
- Finite volume approximations
- Von Neumann stability analysis for turbulent flows
- Inversion of large sparse matrices arising from implicit methods
- Advective and diffusive flows in 1D
- Highly diffusive flows in 1D
- Finite volume and leapfroging for purely advective 1D flows
- Initial and boundary conditions for the leapfrog method for advective 1D flows
- Stability analysis for the leapfrog method for advective 1D flows
- Upstream upwind or donor cell method
- The Lax-Wendroff method
- The Crank-Nicholson method
- 1D Advection and diffusion with a source/sink term
- 2D Advective flows - double 1D discretizations
- Operator splitting methods for 2D advection - Strang splitting
- The discrete Poisson equation
- Jacobian evaluations
|
Click here to return to the Contents.
The Julia Language: |
The first two links are for someone who wants to decide whether Julia is a language they wish to
persue in more detail. This is best done by installing the (open source) code and then trying the
tutorial, checking back with the manual as needed.
- The main Julia webpage has URL https://julialang.org which you can find by selecting
here.
- Performance comparisons: between Julia and C, LuaJIT, Rust, Gp, Fortran, Java, JavaScript, Matlab,
Mathematica, Python, R, and Octave.
- Installation under Windows, Linux or macOS, go to download link
and follow the instructions.
- For updating or removing instructions for a given version of Julia go to
here and scroll down past the files/directories information. You are not forced to update but will receive messages indicating whether a new version is available and its status.
-
A small Julia manual. This so-called "cheat-sheet" is entitled The fast track to Julia. It has over 50 contributing authors,
and covers many features in a short space. Scroll down to the bottom of the linked pages to see lists of tutorial video material after the
conference videos.
-
A rather large Julia manual PDF version at v1.10.5. written by the Julia Project. It's over 1500 pages and is dated 29th August, 2024. If learning
about Julia, one approach would be to peruse the contents to obtain an idea of what is covered by this extensive compendium.
It contains an abundance of examples of Julia code.
An html version at v1.10.5 is accessible here.
A list of a selection of chapter titles is
given below. All methods in Part I are built in and can be used without any package reference.
Part I Manual:
documentation, integers and floating point numbers, mathematical opatations and elementary functions,
complex and rational numbers, functions, control flow, scope of variables, types, methods, modules,
metaprogramming, multi-dimensional arrays, networking and streams, multi-threading,
multi-processing and distributed computing, calling C and Fortran code, profiling, perforance tips,
unicode input.
Methods in Base are built in but can optionally be called with the package prefix, e.g. Base.fun(x)
Part II Julia Base: essentials, collections and data structures, mathematics, numbers, strings,
arrays, tasks, multi-threading, constants, filesystem, I.O and network, punctuation, sorting
and related functions, iteration utilities, C interface, LLVM interface, C standard library,
stacktraces.
Methods in the Standard Library must be called with the package prefix or by issuing a preliminary
"using" instruction, e.g. the function DateTime can be called by
Dates.DateTime(...,...). There is no need to install packages in the Library however.
Part III Standard Library:
Dates, distributed computing, file events, interactive utilities, dynamic linker, linear algebra,
logging, memory-mapped I/O, NetworkOptions, Pkg, Printf, Profiling, The Julia REPL, random numbers,
shared arrays, sparse arrays, statistics, tar, unit testing, unicode.
Part IV Developer Documentation: Reflection and introspection, documentation of Julia's internals,
developing Julia's C code, building Julia, release notes.
- Comand line options: Once installed, you can run Julia interactively just by typing "julia" into a command line window. However,
there are options, including running non-interactively with Julia statements to be executed in a file, or loading a file containing,
say, function definitions, before running interactively. In addition there is a way to employ multiprocessing and
parallelism, which has to be enacted before Julia commences. For the complete set of command line options click
here.
- Modules and name spaces: Please consult this essential reading, especially if you are investigating extensive bodies of code such as
those related to CliMA.
Julia graphics - Makie Graphics:
There are many different graphics systems options. I have decided to focus on Makie Getting Started because its lack of
external dependencies gives Makie a significant advantage over most of the other main contenders. To see what types of
plot are possible using Makie, peruse some of the examples in the five links below:
- Getting started with Makie. The package name is Makie.jl
-
Visualizing data using Makie.
- Exploring layouts using Makie.
- A gallery of Makie example plots with code. Click on
an image to obtain the code. (This collection of images may move.)
- An introduction to GeoMakie. The package
name is GeoMakie.jl
- Many Projections. The package
Proj.jl provides a wrapper for the extensive and well documented PROJ cartographic projections library. See
for example (PROJ names) Orthographic, Natural Earth II, Gnomic, Airy, Stereographic and even New Zealand Map
Grid to name a few of many. One of my favourites is Mollweide ("moll"). For a complete list with documentation click
here.
- Julia provides a wrapper NaturalEarth.jl for the Natural Earth webpages of earth related information.
These can be accessed directly here. The pages to explore are linked under the main heading and could (should?) include Home, Features and Downloads (in that order!).
- The package system: Click here
to obtain three links to explore the wide family of existing packages, namely JuliaHub, Julia Packages
and Julia.jl. The latter takes the user to a github repository which has a manually curated list of
Julia packages.
- Package commands: The complete documentation is here. Useful fetures are the package environment entered by ] on an empty Julia command line
with backspace to exit the environment,
add Package1, Package2, .. to install packages, status to get a list of all installed packages, remove Package1, Package2, .., update to update all packages by default),
and the Julia command using Package1, Package2, ... to make symbols in packages available to Julia functions directly (without prefixing PackageName.).
Multiprocessing with Julia:
- Parallel computing manual page.
- Easy to use Julia languge features for introducing parallelism/multiprocessing.
- A discussion on Julia loops compared with vectorization.
Running Julia on a GPU
-
NVIDIA introduction to CUDA GPU computation.
- Julia GPU programming by Simon Danish.
- The Julia CUDA.jl package page.
-
Discussion on CUDA.jl v5.1 unified memory and cooperative groups.
- The v5.2 and v5.3 updates of CUDA.jl.
Accessing Data from Julia
We give here only two options, CSV and netCDF:
- Accessing CSV files. The separator between elements
could be commas, tabs or something else. This is a well developed package.
- Wikipedia Notes on the NetCDF file structure.
- Accessing netCDF files. This is a
commonly occuring and flexible data structure. See the entries above on the links for Sources
of Data and Viewers .... for NASA, NCAR, ESA, or Copernicus.
|
Click here to return to the Contents.
The CliMA project: |
At last we can give links which give an overview of the work which is progressing on the Julia based climate change
modelling under the umbrella of the CliMA (standing for Climate Modelling Alliance) group. Roughly speaking, Caltech is
developing the atmosphere, land and coupling components of the models, and MIT the Julia language, the ocean and ice components.
- The main CliMA page, maintained by Caltech.
- The JPL CliMA page.
- Julia in a Nutshell, - official website for the Julia language from MIT giving
many links to all things Julia.
- The Oceananigans.jl repository from MIT, giving modules for
ocean modelling.
- The ClimaOcean.jl repository from MIT giving an example of
modelling the global ocean.
- All CliMA repositories, from Caltech, MIT, JPL and others.
For a list of the main CliMA repositories click here and scroll down.
Alternatively the list is: ClimaCore.jl, ClimaAtmos.jl, Thermodynamics.jl, CloudMicrophysics.jl, SurfaceFluxes.jl, ClimaLSM.jl, Oceananigans.jl, ClimaCoupler.jl
|
Click here to return to the Contents.
Last modified: 13th September 2024.
|