CliMT: An object-oriented Climate Modeling and diagnostics Toolkit


CliMT is a Python-based software component toolkit providing a flexible problem-solving environment for climate science problems.

CliMT consists of two layers:

The Python structure, summarized in this diagram, is fairly simple and lightweight. It also provides for file input/output in NetCDF format and for graphical display (including runtime monitoring of model fields, as in the screenshot above) using Matplotlib.

CliMT is aimed at a broad audience. Because the accent is on simplicity and intuitiveness, it is accessible to undergraduate or even high-school students. On the other hand, it uses state-of-the-art components, and so is suitable for full-blown research projects.

News

3-June-2009
Version 0.6.6 released. Contains some bug fixes for the CAM3 scheme. This scheme now reproduces CAM3 model output to ~0.1 Wm-2.

9-April-2009
Version 0.6.5 released. Contains some bug fixes for the CAM3 scheme; the most important being that LW cloud forcing now has the correct sign.

12-Feb-2009
Version 0.6.4 released. This version incorporates the NCAR Community Atmosphere Model (CAM3) radiation scheme, which improves on the CCM3 scheme.

13-Mar-2008
Version 0.6.3 is out. This version is compatible with both PyNio and ScientificPython NetCDF interfaces.
Note: when you install ScientificPython, make sure to add the --numpy flag to the build command.

2-Feb-2008
Version 0.6 is out. This version introduces some important changes:

  • uses numpy, and no longer supports Numeric
  • uses the python distutils build process, instead of make as in older versions
  • uses PyNio for NetCDF I/O
For information on earlier versions, see here.

Download

Current version is 0.6.6 (3 June 2009) Download

Installation

Requirements:

  • Python 2.5 or higher.
  • Numpy 1.3 or higher
  • GNU gcc
  • A Fortran 90 compiler
  • The NetCDF libraries

The following are optional; without them, core CliMT will still work but you will lose some functionality:

A painless way of getting everything you need to run CliMT is to first install Enthought Python, a "kitchen-sink included" distribution which is free to academic/research users. For Mac OSX users, a binary distribution of the GNU Fortran 90 compiler (gfortran) is available here and here.

To install CliMT:

  • tar xvzf climt.tar.gz
  • cd CliMT
  • edit the section marked "Resolution" near the top of setup.py, set the desired number of longitude (IM), latitude (JM) and vertical (KM) gridpoints.
  • edit "NC_LIB" near the top of setup.py to point to the location of your NetCDF library
  • edit "NC_INC" near the top of setup.py to point to the location of your NetCDF include files
  • python setup.py install

This builds with the default fortran compiler. For information on the compilers available on your platform, do

  f2py -c --help-fcompiler.

To build with a different compiler, do

  python setup.py install --fcompiler=compiler

where compiler is one of the choices offered by f2py above.

To install in a location different from the default, do

  python setup.py install --prefix=dir

and the package will install in dir/lib/python2.x/site-packages.

Compilers and platforms
The distribution should build out-of-the-box on the following

  • Mac OS X 10.4 Intel, GNU gfortran or Intel ifort
  • Mac OS X 10.4 PPC, GNU gfortran
  • Linux x86_64, GNU gfortran or Intel ifort
On other systems, your mileage may vary; please contact me if you have installation difficulties.

Note: As of numpy 1.0.4, the distutils tool cannot handle the OS X/ifort combination. To successfully compile on this platform, you need to edit the file numpy-root/numpy/distutils/fcompiler/intel.py (where numpy-root is the directory where numpy is installed) and change the line

  'linker_so' : ["", "-shared"],

to

  'linker_so' : ["", "-bundle -undefined dynamic_lookup"],

Using CliMT

One day I will take a sabbatical and write a complete tutorial and users guide. For now, the best way to learn to use CliMT is to look at the example scripts in CliMT/lib/examples. In particular:

  • basic_radiation.py provides the simplest example: it sets up a temperature and humidity profile, and computes the radiative fluxes through the column--a typical diagnostic application.
  • radiative_convective_equilibrium.py provides a simple example of the use of the federation class, which links modules together to form a time-stepping model--in this case, a single-column radiative-convective model.
  • held_hou.py demonstrates the use of the axisymmetric dynamical core. Note the #PBS flags at the top--you can submit CliMT python jobs directly to the PBS queue on a cluster.

Detailed information about the arguments required by each component is avaible using the Python help() function (e.g. help(climt.radiation) will print usage information for the radiation module).

Python is also a good language for CGI scripting, so you can easily build web interfaces to CliMT applications. Here is an example of CliMT used in a CGI script, and here is the script in action.

Authors

CliMT is developed by Rodrigo Caballero, with contributions from Jonathan Mitchell and Mike Steder.

CliMT began as a project of the Climate Systems Center at the Department of the Geophysical Sciences, University of Chicago, with funding from NSF Information Technology Research grant ATM-0121028.



View My Stats