Download LAPMOD modeling system
Extract the source archive into a working directory and open a terminal. Build the Linux executables from the sources supplied with the same release as your input files.
The supplied build scripts require Bash, Python 3 and the GNU Fortran compiler gfortran. Install these using your Linux distribution's package manager and make sure that python3 and gfortran are available on PATH. The compiler must support OpenMP to build the OpenMP variants. Check the installed tools with:
python3 --version gfortran --version
From the repository root, compile the serial and parallel OpenMP releases:
bash LAPMOD/code/serial/compile_serial.sh bash LAPMOD/code/omp_parallel/compile_omp.sh
These scripts require gfortran and Bash, with sed for serial and awk for OpenMP. They place executables in LAPMOD/bin/linux and intermediates in the corresponding code subdirectories. Python is not required for compilation.
| Executable | Version |
|---|---|
lapmod_omp_parallel.x | Parallel OpenMP version. |
lapmod_serial.x | Serial version. |
From the simulation directory, run the chosen executable and pass the main input filename as its argument. Use an absolute path to the executable when it is in a different directory:
/path/to/LAPMOD/bin/linux/lapmod_omp_parallel.x lapmod.inp
The OpenMP versions use the value of OMP_NUM_THREADS if it is already set in the environment. Otherwise, the GNU OpenMP runtime normally uses one thread per available logical processor. For example, a machine with 16 available logical processors normally uses 16 threads. The command line shown above does not itself specify a thread count.
At startup, LAPMOD reports the actual team size in its initial parallel region and the configured maximum number of threads. For example:
OpenMP threads available: 16 OpenMP max threads: 16
To request four threads and disable automatic adjustment of the team size, set the following variables in the terminal before launching the program:
export OMP_NUM_THREADS=4 export OMP_DYNAMIC=FALSE /path/to/LAPMOD/bin/linux/lapmod_omp_parallel.x lapmod.inp
The serial version is run in the same way using lapmod_serial.x and does not use OpenMP threads. Quote any paths containing spaces. Relative paths in the input file must be valid from the simulation working directory.
The current Linux build scripts use the compiler's default runtime linking. They do not request static linking of the Fortran or OpenMP libraries. The execution environment therefore needs the shared libraries required by the resulting binary, including the GNU Fortran runtime and, for the OpenMP versions, libgomp.
To inspect the dependencies of a locally built executable, run:
ldd /path/to/LAPMOD/bin/linux/lapmod_omp_parallel.x
If a required library is reported as not found, install the corresponding runtime package for your Linux distribution before running the model.
The Linux scripts currently use -march=native, which enables optimizations for the build machine's processor. Build on the machine where LAPMOD will run, or select architecture options suitable for all target processors before distributing the executable. Shared-library versions must also be compatible with the destination system.
A simulation requires the main LAPMOD input file and the meteorological, emission, species and receptor files referenced by it. For CALMET-driven applications, prepare the meteorological fields with CALMET before starting LAPMOD. The LAPMOD input documentation describes the current input format.
Download a test case to start with a prepared example.