Examples, Notebooks

There are several ways to use MITgcm.jl to e.g. analyze model results or run a new model simulation. The notebooks presented here focus on running MITgcm mostly.

Tip
  • Compiling MITgcm requires a fortran compiler. This is a requirement for all notebooks except MITgcm_configurations.jl.
  • The ECCO-Docker image has MITgcm.jl pre-installed, as well as gfortran, MPI, and NetCDF allowing to run any MITgcm configuration. The ECCO-Binder instance (free, but small) is available to try functionalities in the cloud.

Notebooks Listing

The following notebooks demonstrate core features of MITgcm.jl, for running MITgcm and analyzing results.

The HS94* series of examples need to be run in sequence, as they rely on output from one another. This tutorial runs the Held and Suarez 94 benchmark with MITgcm on a cube sphere grid, and illustrates particle tracking in the Atmosphere using MeshArrays.jl and IndividualDisplacements.jl.

Note

The three examples in this series have to be run in sequence. HS94_animation.jl generates files that are then used in HS94_particles.jl, which generates output in turn used in HS94_Makie.jl.

The following example uses the Darwin3 package that models marine microbes and microbial communities. See MIT's Darwin Project for more information about this effort.

Standard Modeling Workflow

Here is the standard way to run a model configuration using MITgcm.jl.

using MITgcm
MC=MITgcm_config(configuration="advect_xy")
run(MC)
MC.inputs
OrderedCollections.OrderedDict{Any, Any} with 4 entries:
  :main   => OrderedDict{Any, Any}(:PARM01=>OrderedDict{Symbol, Any}(:rigidLid=…
  :pkg    => OrderedDict{Any, Any}(:PACKAGES=>OrderedDict{Symbol, Any}())
  :eedata => OrderedDict{Any, Any}(:EEPARMS=>OrderedDict{Symbol, Any}(:nTx=>1, …
  :setup  => OrderedDict{Any, Any}(:main=>OrderedDict(:category=>"verification"…
rundir=joinpath(MC,"run")
sc=scan_rundir(rundir)
sc.params_grid
(usingCurvilinearGrid = false, nSy = 2, usingCartesianGrid = true, nPx = 1, sNy = 10, usingCylindricalGrid = false, Nx = 20, sNx = 20, nSx = 1, Nr = 1, Ny = 10, usingSphericalPolarGrid = false, nPy = 1)

Pluto Notebooks

Below are links to static html versions of the examples which one can open with a web browser.

If instead you wanted to run the notebooks using Pluto.jl, then you might proceed as follows:

  1. open julia in terminal window
  2. type the commands shown below at the Julia prompt
  3. in web-browser, open one of the notebooks' code link using the Pluto interface.
using Pluto
Pluto.run(notebook="examples/MITgcm_configurations.jl")

Alternatively, you can run an example at the command line as, e.g.,

julia -e 'using Pluto
notebook="examples/MITgcm_configurations.jl"
Pluto.activate_notebook_environment(notebook)
using Pkg; Pkg.instantiate()
include(notebook)
'