Flexpart containerization with simflex.
SIMFLEX – Source Inversion Module-FLEXPART.
To make Flexpart work you should install all required libraries and provide the required inputs. This project is created to make it easy and isolated from your work environment.
FLEXPART (“FLEXible PARTicle dispersion model”) is a Lagrangian transport and dispersion model suitable for simulating a large range of atmospheric transport processes. Apart from transport and turbulent diffusion, it is able to simulate dry and wet deposition, decay, linear chemistry; it can be used in forward or backward mode, with defined sources, or in a domain-filling setting. It can be used from local to global scale.
Tested for compatibility with 3 cores; if more than 3 cores are provided, an error will occur after the first calculation. In OpenStack, you can utilize $(nproc)
to utilize all available cores.
# Assuming you are in the root folder of the git repository
cp -rf flexpart_v10.4/test 1;
docker build -t simflex:beta -f Dockerfile .;
cd 1;
mkdir results;
docker run --privileged -d -v "$PWD":/data/ -v "$PWD/results/":/series/ --name calculation_$(basename "$(pwd)") simflex:beta
dockerize-simflex
folder: docker build -t simflex:v1 .
1
and input
inside it, then put there two files: measurements.txt
and options.xml
, also create folder series
for Flexpart output in the same path that 1
has. --privileged
argument: docker run --privileged -d -v --name=simflex "$PWD":/data/ simflex:v1
docker exec -it simflex /bin/bash
data/output/Nuclide-name
, these folders are generated by simflex. docker rm --volumes simflex
Description of the processes inside the container:
As input data used two files: measurements.txt
and options.xml
which are located in the /data/input/
folder. The main script run.sh
will parse these files and create all required files for Flexpart and Simflex. After that, the calculation will start. The output data will be located in the /data/output/
and /series/series_id/
folders. After the calculation is complete, the container will be stopped.
All process logs will be located in the /data/calculations.log
file or you can use docker logs -t container_id
command.
141 - integer,parameter :: nxmax=361,nymax=181,nuvzmax=138,nwzmax=138,nzmax=138
141 + integer,parameter :: nxmax=721,nymax=361,nuvzmax=138,nwzmax=138,nzmax=138 ! 0.5 degree 138 level
198 - integer,parameter :: maxreceptor=20 ! maximum number of receptor points
198 + integer,parameter :: maxreceptor=200
207 - integer,parameter :: maxpart=100000 ! Maximum number of particles
207 + integer,parameter :: maxpart=7500000
208 - integer,parameter :: maxspec=1 ! Maximum number of chemical species per release
208 + integer,parameter :: maxspec=6
INCPATH1 = /usr/include
INCPATH2 = /usr/include
LIBPATH1 = /usr/lib
F90 = gfortran
The model scales well up to using 256 processors, with a parallel efficiency greater than 75 % for up to 64 processes on multiple nodes in runs with very large numbers of particles. The deviation from 100 % efficiency is almost entirely due to the remaining nonparallelized parts of the code, suggesting a large potential for further speedup. A new turbulence scheme for the convective boundary layer has been developed that considers the skewness in the vertical velocity distribution (updrafts and downdrafts) and vertical gradients in air density. FLEXPART is the only model available considering both effects, making it highly accurate for small-scale applications, e.g., to quantify dispersion in the vicinity of a point source.
Open Multi-Processing (OpenMP)
make [-j] mpi ncf=yes - Compile parallel FLEXPART_MPI
make [-j] serial ncf=yes - Compile serial FLEXPART
Where | System | Type | Model name | CPU(s) | RAM | Loutstep | Parts | Calc Times |
---|---|---|---|---|---|---|---|---|
Docker | macOS | MPI | Apple M1(ARM64) | 8 | 8Gb | 3600 | 10000 | 1d, 18:26:27.673187 |
Docker | Ubuntu 18.04.4 | Serial | Intel Xeon CPU E5335 2.0GHs(15) | 8 | 15.66GiB | 3600 | 10000 | 17:40:18.740042 |
Docker | Windows 10 | Serial | Intel Core i5-8250U 1.6GHs(142) | 8 | 16Gb | 3600 | 10000 | 10:53:27.204476 |
Docker | Ubuntu 18.04.4 | MPI | Intel Xeon CPU E5335 2.0GHs(15) | 8 | 15.66GiB | 3600 | 10000 | 3:44:23.769362 |
Docker | Windows 10 | MPI | Intel Core i5-8250U 1.6GHs(142) | 4 | 10Gb | 3600 | 10000 | 1:47:01.369211 |
Docker | Windows 10 | MPI | Intel Core i5-8250U 1.6GHs(142) | 8 | 16Gb | 3600 | 10000 | 1:45:34.842323 |
Server | Ubuntu 18.04 | MPI | Intel Xeon Gold 6240 2.6GHz(85) | 72 | 187G | 3600 | 10000 | 1:02:03.195422 |
Serial - single core, MPI – multiply core using open-mpi
CPUs value shows all cores virtual and real
docker run -d -it --entrypoint="/bin/bash" -v "$PWD":/data/ -v /home/flexpart/series/:/series/ simflex:final
to connect to the container without calculations(for example test purpose)docker exec -it simflex /bin/bash
to connect to the running containerCommand docker inspect -f '{{.State.ExitCode}}' container_name
.
If the container after calculation has ExitCode 0 then everything is ok, if ExitCode 1 then something went wrong while calculation, container should be restarted, if ExitCode 2 then something went wrong with user files and user should be informed about it.
https://gmd.copernicus.org/articles/12/4955/2019/
Flexpart v10.4 instalation process
FLEXPART installation notes