Examples
A good place to start is the random walk model example, which is used in the Climate Model Interface documentation. The other examples, below, fall more or less into two categories :
The main language and file format of the model examples vary. The notebook collection shows how Climate Model Interface is easily to a wide range of model types, programming languages, and problem sizes.
In User Manual, the Climate Model Interface section outlines several simple ways that models can be added to the framework. The examples presented here were built in this fashion.
Trying Out The Examples is geared toward users who may want to experiment with models.
ClimateModels.RandomWalker
— FunctionRandomWalker(x::AbstractModelConfig)
Random Walk in 2D over NS
steps (100 by default). Result is provided as an array and a text file.
By default, RandomWalker.csv
will be created in pathof(x)
. That folder itself is created by setup
, possibly via run
as below.
MC=ModelConfig(ClimateModels.RandomWalker)
run(MC)
Workflows That Run Models
- Random Walk model (Julia) ➭ code link
- ShallowWaters.jl model (Julia) ➭ code link
- Oceananigans.jl model (Julia) ➭ code link
- Hector global climate model (C++) ➭ code link
- FaIR global climate model (Python) ➭ code link
- SPEEDY atmosphere model (Fortran90) ➭ code link
- MITgcm general circulation model (Fortran) ➭ code link
Workflows That Replay Models
- IPCC report 2021 (NetCDF, CSV) ➭ code link
- CMIP6 model output (Zarr) ➭ code link
- ECMWF IFS 1km (NetCDF) ➭ code link
- ECCO version 4 (NetCDF) ➭ code link
- Pathway Simulations (binary, jld2) ➭ code link
JuliaCon 2021 Presentation
Trying Out The Examples
The examples can be most easy to run using Pluto.jl. The JuliaClimate/Notebooks webpage links to free cloud resources and directions to run notebooks on your own computer.
Alternatively, you can create a PlutoConfig
to extract dependencies from the notebook, and operate the notebook via the stanndard methods – setup
, build
, and launch
.
Or, You can run the notebooks directly from the command line interface (CLI
) in a terminal window or in the Julia REPL
. In this case, one may need to add packages beforehand (see Pkg.add
).
include("RandomWalker.jl")
Creating Your Own
Please refer to the User Manual section, and Climate Model Interface in particular, for more on this.
A good way to start can be by 1. converting a modeling workflow (setup, build, launch) into a Pluto notebook; 2. then using the PlutoConfig data structure.
System Requirements
The pure Julia examples should immediately work on any laptop or cloud computing service.
Examples that involve Fortran, Python, or C++ should work in all linux based environments (i.e., Linux and macOS). However, those that rely on a Fortran compiler (gfortran
) and / or on Netcdf libraries (libnetcdf-dev
,libnetcdff-dev
) will require that you e.g. install gfortran.
All requirements should be preinstalled in the JuliaClimate notebooks binder (see the JuliaClimate notebooks page for detail and directions).