Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section


Column


Info
titlePrerequisites

You should have completed: the install grib_apiGRIB library and downloaded and unpacked the OpenIFS data files and OpenIFS source code.

Set your environment

OpenIFS uses software called 'FCM' to handle the compilation of the code. FCM is distributed in the tarball downloaded from the ftp site.

Before trying to compile, make sure the FCM directory is added to your PATH environment variable so the fcm command can be found (if you already have fcm available on your system, we still recommend using the distributed version):

 

Code Block
titlee.g. assuming OpenIFS is unpacked in $HOME/ecmwf/oifs
export PATH=$PATH:$HOME/ecmwf/oifs/fcm/bin



Column
width30px

 


Column
width250px


Panel
bgColorwhite
titleBGColorlightlightgrey
titleOn this page

Table of Contents
maxLevel3
indent10px



...

Code Block
export OIFS_COMP=xlfgnu
export OIFS_BUILD=noopt

means FCM will expect to find a file:

Code Block
make/cfg/xlfgnu-noopt.cfg

suitable for building on IBM Power6 architecture using the XLF/XLCC compilers using non-optimized settings.

If using GNU on a Mac, please see MacOS X known issues.

...

The model requires a number of libraries (see 5.2 Prerequisites) to compile. As well as the GRIB _API librarylibrary (either ECMWF's ecCodes or grib_api libraries), the LAPACK & BLAS numerical libraries are required. An MPI library is also required but this is assumed to be provided by compiler wrappers provided by the MPI implementation (e.g. the command mpif90 rather than gfortran).

To set the location of the GRIB _API & LAPACK libraries, two other environment variables need to be defined as the defaults in the FCM configuration files will most likely not be appropriate.

OIFS_GRIB_API_DIR - Defines the location of the grib_api GRIB library. If you followed the example in For more details see '5.3 Install GRIB library for OpenIFS' it will be installed in $HOME/ecmwf/grib_api_gcc.

OIFS_LAPACK_LIB - Defines the location of the directory containing the liblapack.a and libblas.a files. This varies from system to system but typically /usr/local/lib.

...

Code Block
export OIFS_GRIB_API_DIR=$HOME/ecmwf/grib_apieccodes_gcc
export OIFS_LAPACK_LIB="-L/usr/local/lib -llapack -lblas"

Or if you prefer you can either edit the default value in the appropriate FCM configuration file in make/cfg directory or make a copy of the supplied configuration file (.cfg) and use that.

Info
titleUsing ecCodes instead of grib_api

If you are using the ECMWF ecCodes GRIB library and not the ECMWF grib_api library, a small change is required to the configuration file for older versions of OpenIFS (38r1 and 40r1).

A single line change is required to the configuration file in make/cfg. Find the configuration you are using, for example, if OIFS_COMP=gnu and OIFS_BUILD=opt, edit make/cfg/gnu-opt.cfg and look for the line:

Code Block
$OIFS_GRIB_LIB{?} = -L$OIFS_GRIB_DIR/lib -lgrib_api_f90 -lgrib_api

change this line to use the ecCodes GRIB libraries instead:

Code Block
$OIFS_GRIB_LIB{?}     = -L$OIFS_GRIB_DIR/lib -leccodes_f90 -leccodes

Note that the {?} means this configuration variable can be overwritten by a shell environment variable of the same name.

For example, setting the environment variable:

Code Block
export OIFS_GRIB_LIB="-L\$OIFS_GRIB_DIR/lib -leccodes_f90 -leccodes"

would achieve the same change, for ALL configurations. However, it is better to edit the files directly on first installation to make this a more permanent change. Note the use of the backslash before the dollar sign to prevent the shell from expanding the OIFS_GRIB_DIR variable.

Compiling OpenIFS

Once the environment variables are set, OpenIFS can be compiled (make sure you have edited your PATH environment variable to add the FCM installation /bin directory). Assuming you are in the directory where the OpenIFS source code was unpacked:

...