General Information

XGC is a global gyrokinetic particle-in-cell code, which specializes in the simulation of the edge region of magnetically confined thermonuclear fusion plasma.

Target Domain

The simulation domain can include the magnetic separatrix, magnetic axis and the biased material wall.

Basic Modes of Operation

XGC can model electromagnetic turbulence with toroidal resolution up to Ntor~512. It utilizes a phase space grid in addition to particles in order to handle the non-Maxwellian particle distribution function in the tokamak edge. There are also simplified, less computationally demanding modes of operation: * Electrostatic mode * Axisymmetric (neoclassical transport) mode * Reduced delta-f mode (no phase space grid)

Selected Physics Features

  • Impurities modeling with an arbitrary number of ion species

  • Each ion species can be run in a drift-kinetic or gyrokinetic mode. Electrons can be adiabatic, drift-kinetic, or gyrokinetic.

  • Neutral particles with atomic cross-sections

  • Heat sources

  • Nonlinear Fokker-Planck-Landau collisions

  • Anomalous diffusion model

Selected Numerical Features

  • Particle resampling

  • Core-edge coupling with GENE, GEM, and XGC itself.

  • In-situ analysis via code coupling

Features Under Development

As a flexible state-of-the-art code, XGC is under constant development to add features. Users should work closely with the core development team if they wish to add features. Most existing features are mutually compatible. Some are not, due to fundamental incompatibilities, while others could be made compatible if there is user interest.


XGC is written in C++, with several Fortran 90 components. It achieves high performance across all leading GPU and many-core architectures and HPC systems by utilizing: * MPI * OpenMP * CUDA, HIP, and SYCL, mostly via Kokkos * Cabana Weak scaling is roughly linear to the maximal number of compute nodes of leading HPC systems in the US.

The following pages describe the XGC repository structure and workflow, coding policies, and how to compile and run XGC.


[1] S. Ku et al., Nuclear Fusion 49, 115021 (2009),

[2] S. Ku, R. Hager, C.S. Chang et al., J. Comp. Physics, 315, 467 (2016),

[3] R. Hager, E.S. Yoon, S. Ku et al., J. Comp. Physics, 315, 644 (2016),

[4] R. Hager, J. Lang et al., Phys. Plasmas 24, 054508 (2017),