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.
- 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 asgfortran
,MPI
, andNetCDF
allowing to run anyMITgcm
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.
- MITgcm_worklow.jl (code link): build, setup, run, and plot for a chosen standard MITgcm configuration.
- MITgcm_run.jl (code link) : a detailed look into compiling and running the model.
- MITgcm_configurations.jl (code link); explore MITgcm configurations and their parameters.
- MITgcm_scan_output.jl (code link) : scan run directory, standard output, read grid files, and vizualize.
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.
- HS94_animation.jl (code link) : run
hs94.cs-32x32x5
configuration, read output, interpolate, and plot maps. - HS94_particles.jl (code link) : compute particle trajectories from
hs94.cs-32x32x5
output generated earlier. - HS94_Makie.jl (code link) : using
Makie.jl
instead ofPlots.jl
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.
- Darwin3_1D.jl (code link) : one-dimensional examples.
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:
- open
julia
in terminal window - type the commands shown below at the
Julia
prompt - 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)
'