JuliaClimate/Notebooks

Showcase for climate related notebooks written in Julia.
View on GitHub Star

The listed notebooks highlight JuliaClimate packages used within the broader Julia package ecosystem.


Website shields.io Binder DOI

Data Sets

Climate Change

Let's start by plotting important aspects of climate change like global warming and sea level rise. The notebooks use model projections and data stored in various file formats.

Gridded Data

Gridded data can be read from files and written to files in various file formats. NetCDF and GeoTIFF are two common examples. Gridded data may include climatologies, reanalyses, or gridded satellite data products.

  • Earth observation (multiple notebooks) : popular data sources and use cases covered in JuliaEO23

  • sea surface temperature (notebook url coming soon) : visualize global warming at the sea surface

  • regional sea level (notebook url) : visualize regional sea level anomalies as mapped out by satellites

  • Ocean color (multiple notebooks) : notebooks focused on satellite data that characterize marine ecosystems

The OceanStateEstimation.jl and MeshArrays.jl packages can deal with gridded model output.

Sparse Data

For both land and ocean areas, data collected locally in the field is often sparse. The examples below cover common file formats and various access protocols (http, ftp, opendap, thredds). OceanRobots.jl and ArgoData.jl deal with such data collected in the Ocean.

Numerical Models

ClimateModels.jl

ClimateModels.jl provides a uniform interface to climate models of varying complexity and completeness (up to whole Earth System models). The examples also illustrate cloud computing workflows that replay model output accessed from the web. Common file formats are supported. Version control, using git, is included to allow for workflow documentation and reproducibility.

Particle Tracking Models

IndividualDisplacements.jl supports the modeling of geophysical fluids at moving point locations. It computes single point displacements within a flow field, and follow individual fluid parcels as they move over time.

IndividualDisplacements.jl is geared towards the analysis of Climate, Ocean, etc model output over a gridded domain. It can simulate material transports within the Earth System (e.g., for plastics or planktons in the Ocean; dusts or chemicals in the Atmosphere).

General Circulation Models

MITgcmTools.jl is a set of tools for running MITgcm, and analyzing its output.

The examples run MITgcm interactively via ClimateModels.jl, use MeshArrays.jl for visualizing outputs, and exploit IndividualDisplacements.jl to derive material pathways.

Marine Ecosystem Models

The JuliaCon 2021 Workshop on Modeling Marine Ecosystems was based on notebooks listed below. Additional detail is available in this repository.

  • AIBECS (notebook url) : global steady-state biogeochemistry and gridded transport models that run fast for long time scales (centuries or even millennia).

  • PlanktonIndividuals (notebook url) local to global agent-based model, particularly suited to study microbial communities, plankton physiology, and nutrient cycles.

  • MITgcm global biogeo (notebook url) : interface to full-featured, Fortran-based, general circulation model and its output (transports, chemistry, ecology, ocean, sea-ice, atmosphere, and more).

  • IndividualDisplacements (notebook url) : local to global particle tracking, for simulating dispersion, connectivity, transports in the ocean or atmosphere, etc.

Model Grids and Geography

MeshArrays.jl defines an array type that can contain / organize / distribute collections of inter-connected arrays as generally done in climate models. These data structures can be used to simulate variables of the climate system such as particles and transports.

  • Geography (notebook url) tutorial : deals with interpolation, projection, and visualization of gridded fields in geographic coordinates.

  • Vector Fields (notebook url) tutorial : covers the computation of global transports, streamfunctions, potentials, gradients, curls, and more.

  • Basics (notebook url) tutorial : illustrates how the MeshArrays.jl data structures let us write generic code readily applicable to whole families of grids.

Files and Formats

NetCDF

The examples below use NCDatasets.jl and NetCDF.jl.

Data structures from YAXArrays.jl, Rasters.jl, ClimateTools.jl, and ClimateBase.jl also support NetCDF.

TIFF, JSON, etc

Here we look at vector and raster data. These notebooks illustrate several packages from the JuliaGeo organization.

Other Files
  • The Data Sets section provides examples also for file formats like CSV, JLD2, and binary files.

  • The Grids and Geography section looks at gridded output from a climate model more closely.

  • Zarr.jl supports reading and writing Zarr Datasets from Julia.

  • NCTiles.jl converts binary data into meta-data-rich NetCDF files for (1) a simple rectangular grid; (2) a tiled domain distributed over multiple files.

How To

Get in Touch

Please use the repository issue tracker (this one) for feedback, bug reports, queries, new contribution ideas, etc.


Run Notebooks

The Pluto notebook server can be used directly from your familiar Julia environment. Alternatively, you should be able use the computer configuration that we provide on any platform (cloud, laptop, or cluster) as explained below.

To start an interactive version of a notebook, you then launch Pluto and proceed as follows :

  • copy notebook url from webpage

  • paste notebook url into Pluto

  • click open and wait for notebook to boot up

  • interact with the reactive notebook

  • shut down or restart notebooks as needed


Video demonstration (3 min)
Video Tutorial
Step by step summary

Step 1 Step 2 Step 3 Step 4


Alternative Methods

You can specify the notebook URL or file path directly via Pluto.run.

using Pluto, Downloads
path="examples/IPCC.jl"
Pluto.run(notebook=path)

Additionally, the ClimateModels.jl package provides methods to gather and open any of the notebooks found in this page.

using Pluto, ClimateModels

Pluto.run()
pluto_url="http://localhost:1234/"

nbs=notebooks.list()
notebooks.open(pluto_url,notebook_url=nbs.url[1])

Computer Configuration

Anyone should be able to run the provided computer configuration on a commercial cloud, a laptop, or a cluster from the Docker image using this command for example:

docker run -p 8888:8888 gaelforget/notebooks:latest

A bit more explanation is provided here in text and here in video.


Free Binder Service

Binder

We are very grateful to the BinderHub Federation for deploying public BinderHubs to serve the community at no cost to the user.

Step 1 Step 2 Step 3

About

Packages

The notebooks mostly come from the examples section of various Julia packages.

Examples that use gridded data sets include the OceanStateEstimation.jl notebooks. OceanRobots.jl in turn deals with sparse data collected in situ by diverse methods. The examples cover common file formats and protocols for accessing data.

The ClimateModels.jl package provides an interface to models often used in climate science. The examples either run models and generate new output, or replay model output generated earlier (e.g. from CMIP6 or the 2021 IPCC report). Additional examples for the MIT general circulation model are provided in MITgcmTools.jl.

An important requirement in climate science is to derive transports using native model grid output to e.g. precisely close energy budgets. This is one of the applications of MeshArrays.jl – the analysis of global transports derived from gridded model output. Topics covered via MeshArrays.jl also include interpolation and geography.

IndividualDisplacements.jl extends this approach by providing a particle tracking framework that readily operates on climate model C-grids using MeshArrays.jl. Examples that let you access and explore ocean data products are provided in OceanRobots.jl and OceanStateEstimation.jl.

Visualization

The maps, histograms, and other graphs found in the notebooks are generally created with Makie.jl.

Other popular plotting libraries include Plots.jl, Gnuplot.jl, PyPlot.jl, PlotlyJS.jl, GR.jl, and UnicodePlots.jl.

IPCC report figure 1b IPCC report figure 2 IPCC report figure 3 IPCC report figure 5
Meridional Overturning Particle Tracking Vector Potential Scalar Potential