Versions Compared

Key

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

...

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 all configurations and not just gnu-opt.cfg. 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:

...

After a successful compilation, the OpenIFS executable, master.exe, can be found in the 'make/gnu-opt/oifs/bin' subdirectory (or whichever compiler you choose):

Code Block
% ls
cfg  gnu-opt
% ls gnu-opt/oifs
bin   include   o
% ls gnu-opt/oifs/bin
master.exe

...