Using GLIMMER

From SourceWiki
Jump to navigation Jump to search

Obtaining Glimmer

GLIMMER is available from the Glimmer project page. Documentation is also available from this site. It is recommended that the latest version of Glimmer should be used; GENIE will not build with versions of Glimmer prior to 1.0.4.

Building Glimmer

More information is provided in the documentation, but the basic build is quite simple:

  • First, unpack the tarball:
tar xzvf glimmer-1.0.4.tar.gz
  • Descend into the resulting directory:
cd glimmer-1.0.4
  • Set the environment variable FCFLAGS to -DGLIMMERSP. This enables compliation of Glimmer with a single-precision interface, required by GENIE. The mechanism used to set environment variables depends on your shell, but for bash or ksh, do this:
export FCFLAGS="-DGLIMMER_SP"
  • Run configure with the appropriate arguments. The --prefix specifies where the model will be installed; --with-netcdf specifies the location of the NetCDF library. The NetCDF installation is expected to be laid out in the standard way, so that the directory specified includes lib and include directories. For example:
./configure --prefix=/home/ggdagw/glimmer-genie-version \
--with-netcdf=/opt/local/intel_fc_81 FC=ifort F77=ifort
  • You will need to build GLIMMER separately from GENIE:
make
  • GENIE builds will expect to find the GLIMMER libraries and modules in particular locations. Invoke the install target to install GLIMMER:
make install

Configuring the GENIE build

By default, GENIE is expecting to find Glimmer in the directory ~/glimmer-genie-version, as specified in the ./configure command above. If you have installed Glimmer elsewhere, you can either edit the variable GLIMMER_DIR in genie-main/user.mak or create a symbolic link in your home directory with the name 'glimmer-genie-version' to point to your most recently downloaded version of GLIMMER.

To complete the Glimmer configuration, you also need to set FLAG_GLIMMER=ON in genie-main/user.mak.

Configuring Glimmer experiments

To configure GENIE to run Glimmer, it must be enabled in the GENIE config file:

ma_flag_icesheet=.TRUE.

In addition, the forcing timestep should be specified:

ma_kicesheet_loop=1

The Glimmer configuration is specified by setting the gl_config_file variable in the GENIE config file. For example, in the GENIE/Glimmer test job:

gl_config_file=$RUNTIME_ROOT/genie-main/configs/genie_ig_fi_fi_glim_test.glimmer.config

This points to the location of the Glimmer configuration file, which is constructed as described in the Glimmer documentation. It can itself reference other Glimmer configuration files, if more than one ice sheet instance is to be run.

Within the Glimmer configuration file, it can be helpful to be able to reference some properties of the GENIE experiment. It is not possible to use the full range of variables available in the GENIE configuration file, because of the way the Glimmer file is processed. However, four useful variables are substituted when the Glimmer configuration file is processed:

  • $EXPID, the GENIE experiment identifier.
  • $RUNTIME_ROOT, the genie model code directory, typically ~/genie.
  • $RUNTIME_OUTDIR, the main output directory, typically ~/genie_output/$EXPID.
  • $GLIMMER_OUTDIR, the Glimmer output directory within $RUNTIME_OUTDIR, which is icesheet by default.

The GENIE/Glimmer test job configuration file (genie-main/configs/genie_ig_fi_fi_glim_test.glimmer.config) demonstrates their use.