GLIMMER Ice Shelf Modeling (OS X HowTo)
May 14th, 2010 by Ken Mankoff
A new beta version of the Community Ice Sheet Model, Glimmer-CISM, has been released. Below are instructions to compile and run it on OS X.
# build NetCDF
export CFLAGS=-m32
export FFLAGS=-m32
./configure --prefix=/Users/mankoff/local/netcdf-4.1.1 \
--disable-cxx --disable-curl --disable-dap
make && make install
say netCDF done
# build GLIMMER
cd ~/local/src/
wget http://download.berlios.de/glimmer-cism/glimmer-1.7.0.tar.gz
tar zxvf glimmer-1.7.0.tar.gz
cd glimmer-1.7.0/
# OS X has issues with 32 and 64 bit libraries.
# The -m32 flag forces 32 bit compilation.
# The following should be one long line:
./configure --prefix=/Users/mankoff/local/glimmer-1.7.0 \
--with-netcdf=/Users/mankoff/local/netcdf-4.0.1 \
FC=gfortran F77=gfortran CFLAGS=-m32
make
make install
say GLIMMER done
There are a few ways to test the installation. The source folder provides a test folder:
export PATH=/Users/mankoff/local/glimmer-1.7.0/bin:$PATH cd ~/local/src/glimmer-1.7.0/tests/shelf python circular-shelf.py circular-shelf.PP.config python confined-shelf.py confined-shelf.PP.config say GLIMMER Test Done # Takes a while. Turn up your volume
Running the above command will result in NetCDF files being created in the output/ subdirectory. You can view the contents of example.nc with most any generic NetCDF viewer. While theses tests run over a given period of time, the output only has one time stored. If you want to see an evolution of the ice shelf, older test suites available from the previous code repository site should be used:
cd ~/tmp/ wget http://forge.nesc.ac.uk/download.php/200/glimmer-example-0.6.tar.gz tar zxvf glimmer-example-0.6.tar.gz cd glimmer-example-0.6/ ~/local/glimmer-1.7.0/bin/glide_launch.py ./example.config say done
Examine the output file example.nc to see ice sheet evolution over time. Basal melt is shown below:
Get the Flash Player to see this content.
@article{Rutt:2009,
Author = {Ian C. Rutt and Nicholas R. J. Hulton and Antony J. Payne},
Title = {{The Glimmer community ice sheet model}},
Year = {2009}}
Journal = {J. Geophys. Res.},
Volume = {114},
Number = {F2},
July 4th, 2010 at 12:44
Hi,
Also, to build glimmer on mac os x one needs a fortran compiler. Correct me if I’m wrong, but it seems that the gcc that comes with the xcode developer tools does not include gfortran. So, one must get that separately. I used fink to re-install gcc44. Not sure if this was the best option because it’s taking a very long time to install and it doesn’t seem like good practice to have a lot of redundant programs loaded onto your machine. But I thought this would be the easiest way to go after reading about problems with compiling gfortran from source and from the HPC Mac OS. (See http://www.macresearch.org/problems-gfortran-snow-leopard and http://www.microscopy.cen.dtu.dk/computing/fortran/index.html). I’ll let you know how successful I am.
July 4th, 2010 at 15:57
Yes you’ll need both a FORTRAN compiler and a variety of other supporting software. See
http://kenmankoff.com/2010/03/15/building-a-softwarehardware-environment-for-research for suggestions on how to set up your system.
Don’t worry about the long time. Some packages (gcc, emacs) can take hours to compile on a modern system. As for redundancy, in theory it is nice to keep it to a minimum, but lots of software has lots of different dependencies, so you often need to have many different versions of the same supporting packages or compilers in order to work with different tools.
July 4th, 2010 at 17:31
Well, by installing ncview and gcc44 through fink and Netcdf (latest version) by hand, I was able to compile and build glimmer. These are the only programs I have installed so far, and glimmer builds successfully. So if your computer’s sole purpose is to run Glimmer, these are the programs you’d need. :) Thanks for your guidance, Ken!