General Information

XGC is a gyrokinetic particle-in-cell code, which specializes in the simulation of the edge region of magnetically confined thermonuclear fusion plasma. The simulation domain can include the magnetic separatrix, magnetic axis and the biased material wall. XGC can run in total-delta-f, and conventional delta-f mode. The ion species are always gyrokinetic except for ETG simulation. Electrons can be adiabatic, massless fluid, driftkinetic, or gyrokinetic (for ETG only).

XGC is written in Fortran 90 and is designed for HPC systems utilizing MPI, OpenMP, CUDA (GPU), OpenACC (GPU), and AVX512 vectorization (e.g. for Intel MIC-KNL). Weak scaling is roughly linear to the maximal number of compute nodes of leading HPC systems in the US.

There are several versions of XGC for different purposes:

  1. XGC1 is for turbulence simulation with low parallel wavenumber. Piecewise field-following coordinates are used to handle low k-parallel perturbation with low toroidal resolution (Ntor~64). When run in total-delta-f mode, it utilizes a phase space grid in addition to particles to handle non-Maxwellian particle distribution function in the tokamak edge.

  2. XGCa is an axisymmetric version of XGC1 for simulation of neoclassical transport.

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),