Building¶
Download FLEXPART¶
There are two options to download FLEXPART:
- Tarball
You can download a tarball with the latest release from the FLEXPART page and then extract the file:
tar -xvf <flexpart_vX.X.tar>
- Git repository
If you have Git installed, you can clone the latest version from the Git repository:
git clone --single-branch --branch master https://gitlab.phaidra.org/flexpart/flexpart.git
Compiler¶
FLEXPART 11 is written in Fortran 2018. The following compilers can be used to compile FLEXPART:
- GNU Fortran compiler version 8+ (
gfortran) - Intel Fortran compiler (
ifort)
For running FLEXPART in parallel mode, a compiler supporting OpenMP is required. In addition, libraries (in particular HDF5) should be compiled thread-safe.
Libraries¶
FLEXPART uses the following libraries:
These libraries are usually available as packages in most Linux distributions and macOS package managers. For example:
- On Debian/Ubuntu:
sudo apt install libeccodes-dev libnetcdff-dev - On macOS (Homebrew):
brew install eccodes netcdf
Compiling FLEXPART¶
FLEXPART is compiled with make, which uses the Makefile in the src subdirectory. Starting from the root directory, you can compile FLEXPART with:
cd src/
make -j
since 2026, there is only one Makefile. If you want an overview of the allowed Makefile options, run:
make help
This creates the executable FLEXPART_ETA. Note that this executable is intended for ECMWF data.
Parameters¶
Before compiling FLEXPART, you might want to change parameters defined in par_mod.f90:
dp,sp,dep_prec: Set the precision of the simulation.lusekerneloutput: Switch for using a kernel for calculating concentrations/deposition. Default: True.lparticlecountoutput: Switch to set output units to number of particles per grid cell. Default: False.numpf: Number of precipitation fields read by the executable. This should correspond to the number of precipitation fields present in the meteorological data. Default: 1.lpartoutputperfield: When using particle output (IPOUT=1), this switch sets whether all selected fields are written to one NetCDF file or to separate files (one per field).- Many additional parameters govern the different parameterization schemes within FLEXPART.
Compiling FLEXPART without eta coordinates¶
make -j eta=no
This creates the executable FLEXPART.
Compiling FLEXPART without NetCDF libraries¶
make -j eta=<yes/no> ncf=no
This creates the executable FLEXPART_BIN, or FLEXPART_ETA_BIN for eta=yes.
Paths¶
The provided Makefile uses predefined CPATH and LIBRARY_PATH values (defaults on many systems). If these paths are not available on your machine, edit the Makefile and set the correct paths manually or just during compilation with:
CPATH=/usr/include LIBRARY_PATH=/lib64 make
The default paths are also shown when running make help.
Optimisation¶
The default and recommended optimization flags in the Makefile are -O2 -march=native -mtune=native -fopenmp. If a parallelized version is not required, -fopenmp can be disabled using make serial=yes
Dependencies¶
At the bottom of the default Makefile, you can find the list of modules and how they depend on each other, in ascending order.