mitgcm
Analysis of MITgcm output using python
mitgcm Documentation
Author
Ed Doddridge

Overview

This package provides methods and classes for analysing the output of mitgcm simulations.

To install

Download and install python. I'd recommend Annaconda, it's a nice self-contained python distribution.

The code can be installed through conda using

1 conda install -c https://conda.anaconda.org/edoddridge mitgcm

Or, it can be installed by:

Downloading the code (either by downloading the repo or cloning it into a directory)

Navigating to the download directory and running:

1 python setup.py install

in the terminal

To install on ARCHER

The way that python is setup on ARCHER makes this a little trickier.

Firstly, make sure you've loaded the Anaconda module

1 module load anaconda

Then, create a conda environment called ‘VENV’ with base python installed inside it

1 conda create --name VENV python

activate this environment with

1 source activate VENV

remove the PYTHONPATH and PYTHONHOME variables

1 unset PYTHONPATH
2 unset PYTHONHOME
3 
4 conda install -c https://conda.anaconda.org/edoddridge mitgcm

If you want to use ipython notebooks, you’ll also need to run

1 conda install jupyter

It's also worth adding

1 source activate VENV
2 unset PYTHONPATH
3 unset PYTHONHOME

to your .bashrc file, so that you don't have to manually do this everytime you log in.

To use

Import the module and instantiate a simulation object:

1 import mitgcm
2 
3 m = mitgcm.MITgcm_Simulation(path_to_output,'grid.all.nc')

To use notebooks on ARCHER

By using port forwarding when logging in to ARCHER it is possible to run a notebook on ARCHER and access it locally. It's best to run these on the serial nodes. To do this ssh into the login nodes

1 ssh -X -L11111:localhost:11111 USERNAME@login.archer.ac.uk

and from there, ssh into the serial nodes

1 ssh -L11111:localhost:11111 espp1

and run

1 ipython notebook --no-browser --port 11111

to launch the notebook server. Then point your web browser towards "http://localhost:11111/" to use the notebook.

Examples

An example ipython notebook, and the data it relies on, are in the examples folder. Alternatively, the notebook can be viewed, but not edited, here.

There is also an example for the interpolation functions here