Introduction to Glimmer II
In this session, we're going to download Glimmer-CISM and learn how to compile and run some simple examples using the core ice-sheet model.
Before we can compile Glimmer, we need to have some important prerequisite in place: the NetCDF library. There's more information about what NetCDF is and how we use it here, but for now, all you need to know is that NetCDF is a library used by Glimmer for reading and writing data files.
Installing NetCDF is relatively straightforward. The source code can be obtained as a tarball from the NetCDF website:
Save this somewhere convenient: I tend to have a directory called downloads where I can build software like NetCDF, and another directory called installs, where I install the compiled binaries. Assuming you've downloaded the NetCDF tarball into your ~/downloads directory, here's what you need to do next...
First, change to the appropriate directory, unpack the tarball, and change to the NetCDF directory:
cd ~/downloads tar xzvf netcdf-4.0.1.tar.gz cd netcdf-4.0.1
NetCDF uses standard Linux build tools (autoconf and automake), so installation is relatively straightforward — the basic sequence is configure then make. In addition, we need to specify where we want to install the binaries. We configure the build like this:
Configure produces lots of diagnostic output. For example, it will tell you which Fortran compiler it finds, and confirm that the f90 interface will be built. To compile and install the binaries, we just need to run make:
NetCDF comes with a thorough test suite — a commendable thing — so we should make use of this before continuing:
Watch the output to check you get messages saying the test have been passed. If all is well, we can install the binaries in our chosen location:
We could actually accomplish the build and installation with this command on its own (make knows not to try and install something which hasn't been built), but it's convenient to separate the steps, to aid troubleshooting.
NetCDF comes with a couple of useful utilities, ncdump and ncgen, now installed in the place we specified. However, we can't easily use them from the command-line at the moment, so we need to put the installation directory into our path. We can do this at the shell prompt, using this command:
However, it's convenient to also add this line to your shell configuration file (~/.bashrc), so that the environment variable will be set whenever you open a new terminal window.
The first step is to acquire the model code. In common with many open-source projects, the Glimmer-CISM team makes regular releases of code — these are numbered snapshots of the code, and represent a stable version of the model, in comparison to the development repository. The latest release can be downloaded from the Glimmer-CISM website:
In the centre of the page is a list of latest file releases, comprising not only Glimmer, but also packages of related code. Click on the download link for the latest Glimmer release; you'll be taken to a list of glimmer packages, where you can click on the highlighted Glimmer release (version 1.0.18), and and save it somewhere convenient. As before, we need to change to the appropriate directory, unpack the tarball and go into the Glimmer directory:
cd ~/downloads tar xzvf glimmer-1.0.18.tar.gz cd glimmer-1.0.18
Glimmer also uses autoconf and automake, and, as with NetCDF, we'll want to specify an install destination using the --prefix flag. However, we also need to tell the configure script where to find the NetCDF library, as well as the name of the compiler we want to use:
./configure --prefix=$HOME/installs/glimmer-1.0.18 --with-netcdf=$HOME/installs/netcdf-4.0.1 FC=gfortran F77=gfortran
Now, we can run make and make install, as before. Glimmer takes a while to build, but when it's finished you can look in ~/installs/glimmer-1.0.18/bin to find the executables, and ~/installs/glimmer-1.0.18/lib to see the libraries which have been built.
The final step is to add the location of the Glimmer executables to your path variable, which we do in the same way as before:
And of course we can add this to our .bashrc file as well.
EISMINT 1 examples
The EISMINT project was a pioneering model intercomparison exercise involving an international collection of ice sheet models. The project defined a number of benchmark experiments as the basis for the intercomparison, and although other verification and comparison tests have been devised since then, the EISMINT experiments are still relevant and instructive. All EISMINT scenarios are designed to be used with shallow ice models: the first set of scenarios (EISMINT 1) concern isothermal models, while the second set (EISMINT 2) introduce thermomechanical coupling and basal sliding.
We'll take a look at the relatively simple EISMINT 1 tests to start with, and move on to the more interesting EISMINT 2 examples after that. One aspect of interest is the validation of Glimmer against these test scenarios has been published in Rutt et al. (2009), so you can check your results against those in the paper.
The EISMINT 1 and EISMINT 2 experiment scenarios are both available as part of a package called glimmer-tests. The latest version is numbered 1.2, and can be downloaded from the Glimmer website (see above). Unpack the tarball and cd into the resulting directory. If you list the contents of the top-level directory, you'll see directories for various test suites. It's possible to use configure and make to run each suite of test cases, but it's more instructive to look at them individually. So, let's change to the EISMINT 1 directory and see what we've got:
cd EISMINT-1 ls
There are configuration files for six experiments, as described in the EISMINT 1 paper (Huybrechts et al., 1996):
e1-fm.1.config e1-fm.3.config e1-mm.2.config e1-fm.2.config e1-mm.1.config e1-mm.3.config
We run any of these files using the simple_glide executable which gets built as part of Glimmer. Assuming the Glimmer executables are in your PATH, you can just run this at the command line:
You'll be prompted to enter the name of the configuration file, so choose one of the ones listed. In these filenames, fm is fixed margin, mm is moving margin, and the number refers to the type of forcing: 1 is steady, 2 and 3 are time-varying. A full description is given in Huybrechts et al. (1996)
Viewing the output
The output from these scenarios is in the form of NetCDF files (see Representing and manipulating data for a full description). The filenames are logical: running e1-fm.1.config produces an output file called e1-fm.1.nc, as well a log file (e1-fm.1.config.log). You can use tail to view the most recent part of the log file, to see how the model run is progressing. Once the run has finished, you can look at the NetCDF file it produced. For a quick look at the data, the ncview tool is an excellent choice. You can bring up the data on screen with this command:
ncview e1-fm.1.nc &
The interface is simple: details of how to use ncview are given here. For more complex visualisation, different tools are necessary, such as python with matplotlib. Again, details of how to use this are given in Representing and manipulating data.
- Example visualization of EISMINT1-fm showing cross-sectional growth of ice sheet over time by group 6:
Finding out more
You can view the most recent version of the Glimmer documentation here. These documents are mostly up to date, but they're not perfect.
- Compare your results with those from Huybrechts et al. (1996) and Rutt et al. (2009). Can you suggest causes for any differences you observe?
- Look at the configuration file, and make sure you understand how it defines the experiment you're running. Note that the forcing is not defined in the config file: this is specified in the simple_glide code.
- Adjust the configuration file to change the resolution of one of the experiments. How well does the model converge as the resolution increase? How does the CFL criterion affect the size of the timestep you can use? How long does it take before you get bored with waiting for the model run to complete?
EISMINT 2 examples
The EISMINT 2 scenarios follow on directly from EISMINT 1, and are described in Payne et al. (2000). These experiments generate idealised hypothetical ice sheets similar in scale to the first EISMINT experiments, but at double the resolution (61x61 cells at 20km). Additionally, the models are vertically resolved to deal with temperature calculations and thermomechanical coupling.
There are eleven EISMINT 2 idealised scenarios that mainly consider the thermomechanical behaviour of the models, and also introduce a form of sliding. To run the scenarios, just cd back up to the main glimmer-tests directory, and then to EISMINT-2. Again, these experiments are run using the simple_glide executable you built earlier. The available configuration files correspond to the experiments described in Payne at al. (2000), so read this carefully before you begin. Some of the experiments require the output from previous runs to be available before starting.
It takes a relatively long time to run one of these experiments so you will not be able to explore every one. However, each group should have access to enough computing resource to run a few in the time available. The instructions below tell you which ones to run
Questions and exercises
- How does the output from Scenario A compare qualitatively with the output from the EISMINT 1 moving margin scenario we looked at earlier?
- How sensitive is the solution to the relationship between the timesteps of the mechanics and thermodynamics?
- Several of the scenarios show interesting behaviour, due to thermomechanical feedbacks: these were the subject of a separate paper . Read the paper, and try and reproduce some of their results. Discuss in your groups what you're most interested in first!
Footnotes and References
- Glimmer-CISM is hosted on the BerliOS repository in Germany
- Rutt, I. C., M. Hagdorn, N. R. J. Hulton, and A. J. Payne. The Glimmer community ice sheet model. Journal of Geophysical Research, 114, F02004. doi:10.1029/2008JF001015 pdf
- Huybrechts P, T Payne, and the EISMINT Intercomparison Group (1996) The EISMINT benchmarks for testing ice-sheet models. Annals of Glaciology, 23 1-14
- Payne AJ, P Huybrechts, A Abe-Ouchi, R Calov, JL Fastook, R Greve, SJ Marshall, et al. (2000) Results from the EISMINT model intercomparison: the effects of thermomechanical coupling. Journal of Glaciology, 46(153), 227-238
- Payne AJ, and DJ Baldwin (2000) Analysis of ice-flow instabilities identified in the EISMINT intercomparison exercise. Ann. Glaciol., 30, 204-210 doi:10.3189/172756400781820534