Difference between revisions of "FLEXPART Model/FLEXPARTCompilerSettings"

From mn/geo/geoit
Jump to: navigation, search
(Compiling FLEXPART in a 64-bit environment)
 
(9 intermediate revisions by one other user not shown)
Line 1: Line 1:
This is the README file included now with the FLEXPART distribution
+
FLEXPART has been compiled on UIO servers so if you do not need to modify the source code, we suggest you use the pre-compiled version. If you have never used FLEXPART, the pre-compiled version is also helpful to become familiar with this new package. Some tutorials/examples are available on UIO servers.
  
==Compiling FLEXPART 8.1 in a 64-bit environment==
+
== Compiling FLEXPART in a 64-bit environment ==
  
 +
This file describes the required compiler flags for compiling FLEXPART  in a 64-bit computing environment for the gfortran compiler (version 4.2 and onward) and absoft compiler (version 10.1).
  
This file describes the required compiler flags for compiling FLEXPART 8.1 in a
+
Using 64-bit environment brings the advantage of using >2GB main memory for FLEXPART data arrays. However, this requires certain adjustments to the compilation settings of FLEXPART and the external libraries GRIB_API and JASPER (the latter as required by GRIB_API).
64-bit computing environment for the gfortran compiler (version 4.2) and absoft
 
compiler (version 10.1).
 
  
Moving from a 32-bit to a 64-bit environment brings the advantage of using
+
The main point to be considered for running FLEXPART in a 64-bit environment is the possiblity to allocate data arrays >2GB. This requires to use the compiler flag '''-mcmodel=medium'''. Note that this memory model slows down calculations, if data arrays of less than 2GB are allocated, the use of -mcmodel=small is said to provide slightly better performance.
>2GB main memory for FLEXPART data arrays. However, this requires certain
 
adjustments to the compilation settings of FLEXPART and the external libraries
 
GRIB_API and JASPER (the latter as required by GRIB_API).
 
 
 
The main point to be considered for running FLEXPART in a 64-bit environment is the possiblity to allocate data arrays >2GB. This requires to use the compiler flag -mcmodel=medium. Note that this memory model slows down calculations, if data arrays of less than 2GB are allocated, the use of -mcmodel=small is said to provide slightly better performance.
 
  
 
An additional requirement is that the external libraries must be compiled with the flag -fPIC to allow for the libraries to be located at any position in the computer's main memory. Without this flag, a 'relocation truncated to fit' error will result when linking FLEXPART.
 
An additional requirement is that the external libraries must be compiled with the flag -fPIC to allow for the libraries to be located at any position in the computer's main memory. Without this flag, a 'relocation truncated to fit' error will result when linking FLEXPART.
  
If the compilers are not set to generate 64-bit binaries by default, the flag <code> -m64 </code> should be included for FLEXPART and the external libraries.
+
If the compilers are not set to generate 64-bit binaries by default, the flag <code>-m64 </code> should be included for FLEXPART and the external libraries.
 
 
All of the required settings for FLEXPART are already made in the makefiles included in the FLEXPART 8.1 distribution.
 
 
 
 
 
Recommended compilation steps using the gfortran or absoft compiler
 
-----------------------------------------------------------------------
 
 
 
1. JASPER:
 
  
<pre>
+
All of the required settings for FLEXPART are already made in the cmake configuration files (cmake directory) included in the FLEXPART distribution.
  
./configure CC=gcc CFLAGS='-O2 -m64 -fPIC'
+
<br />Recommended compilation steps using the gfortran or intel compiler
make
 
make install
 
</pre>
 
  
2. GRIB_API:
 
  
<pre>
 
  
export CC=gcc
+
*&nbsp;JPEG compression is used FLEXPART WINDFIELDS and this requires to compile GRIB-API with jpeg support ([http://www.ece.uvic.ca/~frodo/jasper/ JASPER] &nbsp; library). On UIO servers GRIB-API and Jasper are already installed.
export FC=gfortran/absoft
 
export CFLAGS='-O2 -m64 -fPIC'
 
export FFLAGS='-O2 -m64 -fPIC'
 
./configure
 
make
 
make check
 
make install
 
</pre>
 
  
3. FLEXPART:
+
<br />Even if you wish to compile your own FLEXPART version, the best is to set-up your environment by loading an existing version of flexpart:
  
use one of the following:
+
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; To set-up your environment:
  
<pre>
 
  
make -f makefile.ecmwf_gfortran_64
+
<pre>                      module load flexpart</pre>
make -f makefile.gfs_gfortran_64
+
<br />You then get the right set of compilers and libraries to compile your own version of FLEXPART. Use the following environment variables:
make -f makefile.ecmwf_absoft_64
 
make -f makefile.gfs_absoft_64
 
</pre>
 
  
NOTE: Set -mcmodel=medium or -mcmodel=small in the makefiles,
+
*'''GRIB_API_HOME''': points to the directory where GRIB-API has been installed
depending on memory allocation needs (see above).
+
*'''FLEXPART_HOME''': points to the directory where FLEXPART_HOME has been installed.
 +
*'''FLEXPART_HOME/src''': points to the source code used to compile FLEXPART. the corresponding Makefile is also available in the same src directory. (on abel search for *_abel or use makefile.ecmwf_ifort_geo and on sverdrup for *_geo*)

Latest revision as of 10:38, 26 April 2017

FLEXPART has been compiled on UIO servers so if you do not need to modify the source code, we suggest you use the pre-compiled version. If you have never used FLEXPART, the pre-compiled version is also helpful to become familiar with this new package. Some tutorials/examples are available on UIO servers.

Compiling FLEXPART in a 64-bit environment

This file describes the required compiler flags for compiling FLEXPART  in a 64-bit computing environment for the gfortran compiler (version 4.2 and onward) and absoft compiler (version 10.1).

Using 64-bit environment brings the advantage of using >2GB main memory for FLEXPART data arrays. However, this requires certain adjustments to the compilation settings of FLEXPART and the external libraries GRIB_API and JASPER (the latter as required by GRIB_API).

The main point to be considered for running FLEXPART in a 64-bit environment is the possiblity to allocate data arrays >2GB. This requires to use the compiler flag -mcmodel=medium. Note that this memory model slows down calculations, if data arrays of less than 2GB are allocated, the use of -mcmodel=small is said to provide slightly better performance.

An additional requirement is that the external libraries must be compiled with the flag -fPIC to allow for the libraries to be located at any position in the computer's main memory. Without this flag, a 'relocation truncated to fit' error will result when linking FLEXPART.

If the compilers are not set to generate 64-bit binaries by default, the flag -m64 should be included for FLEXPART and the external libraries.

All of the required settings for FLEXPART are already made in the cmake configuration files (cmake directory) included in the FLEXPART distribution.


Recommended compilation steps using the gfortran or intel compiler


  •  JPEG compression is used FLEXPART WINDFIELDS and this requires to compile GRIB-API with jpeg support (JASPER   library). On UIO servers GRIB-API and Jasper are already installed.


Even if you wish to compile your own FLEXPART version, the best is to set-up your environment by loading an existing version of flexpart:

            To set-up your environment:


                       module load flexpart


You then get the right set of compilers and libraries to compile your own version of FLEXPART. Use the following environment variables:

  • GRIB_API_HOME: points to the directory where GRIB-API has been installed
  • FLEXPART_HOME: points to the directory where FLEXPART_HOME has been installed.
  • FLEXPART_HOME/src: points to the source code used to compile FLEXPART. the corresponding Makefile is also available in the same src directory. (on abel search for *_abel or use makefile.ecmwf_ifort_geo and on sverdrup for *_geo*)