Data Sets
Many of the problems make use of data sets arising from various kinds of observations. These are all in plain text format, and can be read in and used with virtually any graphical or analysis software, though depending on the versatility of your program you might need to make some minor changes with a text editor (e.g. removing header information) before reading in the data.
A tar file of the complete collection of datasets is here. Alternately, you can browse and download individual data files from your web browser here.
Python
If you are going to use the Python courseware instead of rolling your own in some other language (probably MATLAB), you will first need a basic Python installation. This is free and easy for any hardware or operating system you are likely to be using. In fact, if you are using anything other than Windows, it is likely that a satisfactory basic installation is already available on your machine, though it probably won't include graphics capabilities. The installation notes will tell you how to tell if that's the case. If your existing installation doesn't suit your needs, it is better to install a fresh version of Python than to mess with upgrades to your existing one.
I highly recommend the Enthought Python distribution. This gives you everything you need to run my courseware, including graphics. It is free for academic users, and there is a somewhat stripped down version (but still with everything you need) called Enthought Free, which is free to all users. Distributions are available for Mac, Windows and Linux, and on the former two operating systems install with a single click; the Linux distribution is also easy to install. On the Mac, you should install the 32 bit version if you want to use my pre-built version of climt_lite , which provides an interface to the NCAR ccm radiation code (I'll eventually sort out a 64 bit version). If you decide to go with the Enthought distribution, you can skip directly to the Courseware quickstart section, since you don't need to know the details provided below.
The basic installation just requires Python (preferably 2.5 or 2.6 or later, but not Python 3.X, which is not ready for prime time). Installation instructions for Linux, Mac or Windows can be found at python.org,which also has links useful for learning to program in Python. For the Mac, the MacPython distribution is recommended. This installs from a disk image with a single click, and is very simple to install. Besides Python, you will also need the numpy array package, which you can get here. For the Mac, this also installs from a disk image with just a click. (Note: As of 9/10/2010 numpy is not yet available for Python 2.7, so you should stick to Python 2.6 until it becomes available for your system. The Python and numpy Mac distributions labeled as being for 10.3 in fact work fine on later versions of the operating system, up through at least 10.6)
The courseware can be run without graphics, since you can dump output data to a file and plot it in your own favorite graphics package. However it is nice to be able to plot things directly without leaving Python. For that you need PyNgl or MatPlotLib. The courseware ships using PyNgl, but it would be fairly easy to modify the graphics interface to use MatPlotLib instead. Future versions will come with this option implemented. See the installation notes for information on getting and installing graphics packages for Python.
For Mac OS 10.6 and higher there are some issues with the transition from a 32 bit to a 64 bit environment. 32 bit applications work fine on OS 10.6, and I recommend that you stay in a 32 bit world until things settle down; if you install versions of Python, Numpy and PyNgl designed for OS 10.5 or lower, you will be in a consistent 32 bit world. See the installation notes for more details regarding this issue.
Courseware in Python
Although I recommend using Python as the basis of the course, virtually all of the Workbook problems requiring computation can be done using any programming language of your choice, once the basic skills in the Computational Toolkit problems in the Chapter 1 Workbook are mastered in the language you are using. In fact, many of the problems can be done using a good graphing calculator, or perhaps a spreadsheet, though of course serious students should learn a real programming language. The main things that would take a fair amount of work to duplicate in other languages are the homebrew real-gas radiation code introduced in Chapter 4, and the user-friendly Python interface to the compiled NCAR CCM radiation code.
A tarfile of the complete set of courseware in Python is available here, or you can access files individually via the Courseware portal.
Here's where you should put things:
- CoursewareModules contains scripts supporting general physical, numerical and data access functions of general use. These are straight Python scripts, and do not require any compilation; they will run in any Python interpretar. These are not meant to be modified. They are used by the ChapterScripts, and serve as building blocks for calculations done in the course of solving the Workbook problems. The contents of this directory should be put in a place which is in the search path Python uses to look for modules to import. For example, on a Linux or Mac OSX system, if you put them in a directory /home/PlanetaryClimateModules, you can make everything in that directory accessible to Python by setting the PYTHONPATH environment variable to /home/PlanetaryClimateModules . If you are using the "c shell" (csh), then you do this from a terminal window by typing:
setenv PYTHONPATH /home/PlanetaryClimateModules .
If you are using the shell sh instead, then you type:
- CLIMT_lite provides access to the NCAR CCM radiation code from Python. This involves routines that need to be compiled. You will need a Fortran compiler (gfortran works fine) to do this. If you have a suitable fortran compiler, it installs easily using setup.py. Follow the directions in the readme file in the directory. Building this requires that you also have pyfort, but if you installed numpy, pyfort comes with that. The directory currently contains a pre-built version that works with MacOSX, and it also builds easily on a Linux platform. In the future, I will provided pre-built versions for various Mac and Linux platforms. This is currently not supported on Windows, but it might not be too hard to modify the setup script to build it for Windows. Most of the problems can be done without climt, but it is nice to have, especially if you want to recreate all the radiation calculations in the book.
export PYTHONPATH=/home/PlanetaryClimateModules
Once built, the directory containing the climt module should be moved to the same directory where you put the courseware modules. Like the courseware modules, it needs to be in the search path used by PYTHON.
- ChapterScripts Each student should have their own personal copies of theses. They are meant to be customized and modified. They get put in the users home directory. There are a few chapter scripts (notably ccmradFunctions.py and the homebrew radiation models miniClimt.py and miniClimtFancy.py) that are used in several chapters, and to make them available you will either need to put a copy in each directory that uses them, or put an extra copy in the same directory that the contents of CoursewareModules lives in.