Panel | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
Download grib_api
...
...
...
Code Block |
---|
ftp ftp.ecmwf.int
Connected to ftp-int.ecmwf.int.
Name (ftp.ecmwf.int:nagc): openifs
331 User openifs OK. Password required
Password:
ftp> cd src/grib_api
ftp> get grib_api-1.9.18.tar.gz
ftp> close |
For versions of grib_api before 1.9.18 you will also need to download and install the oifs_samples.tar.gz
file in the src/grib_api
directory on the ftp server, because some of the GRIB templates that OpenIFS requires are not present in the 1.9.16 (or previous) distribution. Please see the README file in the grib_api directory for more information.
Unpacking grib_api
To unpack the software:
Code Block |
---|
tar zxf grib_api-1.9.18.tar.gz |
or if your version of tar doesn't support the 'z' option, do:
Code Block |
---|
gunzip grib_api_1.9.18.tar.gz
tar xf grib_api-1.9.18.tar |
In order to make the build configuration generic and make it easier to swap to later versions of grib_api, we recommend creating a link to the version of grib_api:
Code Block |
---|
ln -s grib_api-1.9.18 grib_api |
so all future references to this directory will refer to 'oifs/grib_api
'.
Configuring grib_api
If you are familiar with compiling and installing software on linux systems, you will be used to the following steps. Grib_api uses the GNU configure tool to ease building and compilation. It is tested on different platforms and compilers and should not cause any problems. If however, you do have a problem installing grib_api, please email: Software.Support@ecmwf.int.
The configure command is contained in the grib_api directory you have just unpacked. We will use the command with a few options to suit OpenIFS and assume we'll use the gcc & gfortran compilers. If you use different compilers, see below.
Code Block |
---|
cd grib_api
CC=gcc FC=gfortran \
./configure --prefix=$(pwd)/myinstall --enable-pthread --disable-jpeg --disable-omp-packing --disable-vector --enable-python |
Note the use of the backslash '\' to allow the command to use two lines.
A quick description of what these options are for:
--prefix=$(pwd)/myinstall | This specifies where you want the grib_api files to be installed. In our example here, we will put the compiled grib_api libraries in our example directory oifs/grib_api/myinstall. If you are on a shared high performance computer facility, the install path would most likely be somewhere central. If you specify nothing for --prefix , by default grib_api will install in /usr/local. |
--enable-python | Enabling the python interface is recommended as some OpenIFS supplementary software makes use of Python e.g. plotting/analysis. If the make fails because of a missing numpy header file you should add the --disable-numpy option. |
--disable-jpeg | OpenIFS does not need to support JPEG and PNG for data compression. This removes the need to link OpenIFS against the Jasper library (libjasper.a). |
--disable-omp-packing | OpenMP enabled packing is removed as the model needs to have control over OpenMP multithreading. This is usually disabled by default but it's best to enforce it in case the default changes for future releases. |
--disable-vector | Likewise, on vector computer hardware (e.g. NEC), you can enable this option and grib_api will use a more efficient packing/unpacking method suitable for vector machines. |
--enable-pthread | This option ensures that grib_api is thread-safe. Again, this is normally the default but we enforce it here as OpenIFS will call grib_api from parallel threads. |
The --help
option to configure can be used to what other options are possible, though see the grib_api website for more detailed documentation.
Choice of compiler and options
...
...
The configure script usually chooses a sensible set of optimized compiler flags for the choice of supported compiler. If you need to override the compiler flags you can do so as shown in the following example. Note also the use of '\' to extend the command over multiple lines.
Intel compiler:
...
...
IBM compiler:
...
...
Info |
---|
In this example, note the use of the '_r' form of the IBM compiler to ensure grib_api is compiled 'thread-safe'. This is important as grib_api will be called by multiple threads with OpenIFS. |
...
...
...
...
...
...
would allow make to compile 3 files at once - appropriate on a 4 core machine.
...
...
...
...
...
...
...
Finally, to install grib_api do:
Code Block |
---|
make install | tee install.out |
At the end of this step, in the directory oifs/grib_api we are using in this example you should now have a directory called 'myinstall' which contains the following:
Code Block |
---|
% ls myinstall
bin include lib share
% ls myinstall/lib
libgrib_api.a libgrib_api.la libgrib_api_f77.a libgrib_api_f77.la libgrib_api_f90.a libgrib_api_f90.la pkgconfig |
After this stage, proceed to downloading the OpenIFS model itself.
...