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)
- Zeal - Mathematical special functions (zero finding)
- 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 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
P. Kravanja, M. Van Barel, O. Ragos, M.N. Vrahatis, F.A. Zafiropoulos, ZEAL: A mathematical software package for computing zeros of analytic functions, Computer Physics Communications 124 (2000) 212-232. doi:10.1016/S0010-4655(99)00429-4
Contributions are welcome! See CONTRIBUTING.md for guidelines.
This project is licensed under the MIT License. See LICENSE for details.