Clone wiki

gs2 / An_Introduction_to_GS2

An Introduction to GS2


What is GS2?

GS2 is a physics application, developed to study low-frequency turbulence in magnetized plasma. It is typically used to assess the microstability of plasmas produced in the laboratory and to calculate key properties of the turbulence which results from instabilities. It is also used to simulate turbulence in plasmas which occur in nature, such as in astrophysical and magnetospheric systems.


GS2 is a collaborative project with development work spread across multiple institutions, in particular (in alphabetical order):

  • Culham Centre for Fusion Energy
  • Princeton Plasma Physics Laboratory
  • University of Maryland
  • University of Oxford
  • University of York


GS2 is currently supported on Unix platforms ranging from laptops to Beowulf clusters to supercomputers. It is written in object-oriented style, with Fortran 95. Executables are available for supercomputers and clusters that are used within the magnetic confinement fusion program. Compilation requires access to a high-quality Fortran compiler, such as Lahey's lf95 or NAG's f95. GNU gfortran will work. For a full list of compilers see GS2: A Guide for Beginners


Fast microstability assessment

Linear microstability growth rates are calculated on a wavenumber-by-wavenumber basis with an implicit initial-value algorithm in the ballooning (or "flux-tube") limit. Linear and quasilinear properties of the fastest growing (or least damped) eigenmode at a given wavenumber may be calculated independently (and therefore reasonably quickly).

Fully gyrokinetic, nonlinear simulations

Nonlinear simulations of fully developed turbulence can be performed by users with access to a parallel computer. All plasma species are treated on an equal, gyrokinetic footing. Nonlinear simulations provide fluctuation spectra, anomalous (turbulent) heating rates, and species-by-species anomalous transport coefficients for particles, momentum and energy.

Good performance

GS2 is a parallel code which scales well to large numbers of processors. There are separate optimizations to work with for small (Beowulf-style) clusters and large supercomputers.

Flexible Simulation Geometry

Linear and nonlinear calculations may be carried out using a wide range of assumptions, including:

  • Local slab
  • Local cylinder
  • Local torus
  • Vacuum magnetic dipole
  • High aspect ratio torus (analytic axisymmetric equilibrium)
  • Numerically generated, local equilibrium (Miller-style)
  • Axisymmetric, numerically generated equilibria with arbitrary poloidal shaping from
  • Non-axisymmetric (stellarator) equilibria from VMEC

Community diagnostics

GS2 is fully supported by the GKV suite of IDL-based diagnostics developed for gyrokinetic turbulence simulation codes. Contact William Nevins for more information. Output files are written with NetCDF.

Portable implementation

Because it was designed according to object-oriented principles, GS2 has been kept portable without sacrificing performance. For example, all parallelism is expressed in a single communications module, which can easily be adapted to a new platform. MPI and SHMEM are supported; serial execution is also available.

Efficient computational grid

Turbulent structures in gyrokinetics are highly elongated along the magnetic field. GS2 uses field-line following (Clebsch) coordinates to resolve such structures with maximal efficiency, in a flux tube of modest extent. Pseudo-spectral algorithms are used in the spatial directions perpendicular to the field, and for the two velocity space coordinate grids (energy and pitch angle) for high accuracy on computable 5-D grids.

GS2 Scaling

GS2 Scaling


Basic Physics

Current Projects

Bold text