KAMEL is a scientific computing framework for modeling plasma response to external magnetic perturbations in fusion plasmas.
The framework consists of three main codes:
- KiLCA - Kinetic Linear Cylindrical Approximation, plasma response solver using finite Larmor radius formalism
- KIM - KiLCA Integral Model using integral formalism for non-local plasma response
- QL-Balance - Quasilinear 1D radial transport code including anomalous and electromagnetic diffusion for time-evolution studies
- CMake 3.24+ and Ninja build system
- Fortran compiler (gfortran 10+ or ifort)
- C/C++ compiler (gcc/g++ 10+ or clang/clang++)
- MPI (MPICH or OpenMPI)
- HDF5 with Fortran bindings
- LAPACK/BLAS - Linear algebra
- Python 3.8+ with pip
- SuperLU (sparse matrix solver, used by KIM if found)
- Doxygen (for documentation generation)
The following are automatically downloaded and built if not found on the system:
- GSL - GNU Scientific Library
- SuiteSparse - Sparse matrix operations (UMFPACK)
- SUNDIALS - Numerical differential equation solvers
- NetCDF - Network Common Data Form (with Fortran bindings)
- LAPACK/BLAS - Fallback if not found on system
- slatec - Special functions and ODE solvers (
common/math/) - libcerf - Complex error function (
KIM/src/math/)
- numpy, scipy, h5py, f90nml, matplotlib
# Build all three codes (Release mode by default)
make all
# Build in Debug mode
CONFIG=Debug make all
# Build individual components
make KiLCA
make KIM
make QL-Balance
# Clean build
make cleanNote: External dependencies (LAPACK, SuiteSparse, GSL, SUNDIALS) are automatically downloaded and built during the first compilation if not found on the system.
To pin libneo to a specific branch, tag, or commit, pass -DLIBNEO_REF=<ref> to cmake or LIBNEO_REF=<ref> to make. To use a local checkout instead of fetching, pass -DLIBNEO_PATH=<dir> / LIBNEO_PATH=<dir>.
To install KIM so it can be run from anywhere as kim:
# Step 1: Build and prepare KIM
make install-kim
# Step 2: Follow the instructions displayed, which will show:
sudo ln -sf /path/to/KAMEL/build/install/bin/KIM.x /usr/local/bin/kimAlternatively, you can add an alias to your shell configuration file (.bashrc, .zshrc, etc.):
alias kim='/path/to/KAMEL/build/install/bin/KIM.x'- Apple Silicon: clang 16.0 + gfortran 14.2
- Debian/Ubuntu: GNU compiler 12.2.0
# 1. Clone repository
git clone https://github.com/itpplasma/KAMEL.git
cd KAMEL
# 2. Build all codes
make all
# 3. Install Python interface
cd python && make init && make install
# 4. Run tests
make test/KiLCA/- Finite Larmor radius plasma response solver/KIM/- Integral formalism plasma response solver/QL-Balance/- Quasilinear transport code (supports KiLCA and KIM wave codes)/PreProc/- Preprocessing utilities (fouriermodes, neo-2 templates)/python/- Python interface (KAMELpy) for all codes/common/- Shared utilities: equilibrium handling, math libraries, logger
Contributions are welcome! See CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License. See LICENSE for details.