stellaGK / stella

stella is a flux tube gyrokinetic code for micro-stability and turbulence simulations of strongly magnetised plasma.

Home Page:https://stellagk.github.io/stella/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stella

Github Actions badge

stella solves the gyrokinetic-Poisson system of equations in the local limit using an operator-split, implicit-explicit numerical scheme. It is capable of evolving electrostatic fluctuations with fully kinetic electrons and an arbitrary number of ion species in general magnetic geometry, including stellarators.

Dependencies

stella requires MPI, and has several optional dependencies:

  • netCDF Fortran
  • FFTW3
  • LAPACK

Installation

There are two ways to build stella: with CMake (experimental) or with plain make.

CMake

Note: If you have previously built stella with plain make you must run make clean before attempting to build with CMake, or the existing built objects will interfere with the CMake build.

Building stella with CMake requires CMake >= 3.16. You can download the latest version from the CMake website, but it is often easier to install with pip:

pip install cmake

Building stella is then a matter of first configuring the build:

cmake . -B build

and then building proper:

cmake --build build

You may need to pass a few flags to the first cmake command to tell it where to find some dependencies:

cmake . -B build \
  -DnetCDFFortran_ROOT=/path/to/netcdf/fortran
  -DFFTW_ROOT=/path/to/fftw

There are a few build options:

  • STELLA_ENABLE_LAPACK: Enable LAPACK (default: on)
  • STELLA_ENABLE_FFT: Enable FFTs (default: on)
  • STELLA_ENABLE_NETCDF: Enable NetCDF (default: on)
  • STELLA_ENABLE_DOUBLE: Promotes precisions of real and complex to double (default: on)
  • STELLA_ENABLE_LOCAL_SPFUNC: Enable local special functions" (default: off)
  • STELLA_ENABLE_NAGLIB: Use the NAG library (default: off)
  • STELLA_ENABLE_POSIX: Enable POSIX functions for command line functionality (default: off)
  • STELLA_ENABLE_F200X: Enable use of F2003/F2008 functionality (default: on)

You can turn these on or off with -D<option name>=ON/OFF. You can get a complete list of options by running the following in a build directory:

cmake -LH

Makefiles

The other build system uses plain make:

  1. Set GK_SYSTEM='system', with system replaced by the appropriate system on which you are running. See the Makefiles directory for a list of supported systems.
  2. Optionally, set the following environment variables to override the locations in the GK_SYSTEM Makefile:
    • FFTW_LIB_DIR: directory containing libfftw3
    • FFTW_INC_DIR: directory including fftw3.f
    • NETCDF_LIB_DIR: directory containing libnetcdff
    • NETCDF_INC_DIR: directory including netcdf.inc
  3. Set the environment variable MAKEFLAGS=-IMakefiles, or set -IMakefiles when you run make
  4. Run make

For example, to compile on Ubuntu:

# using bash:
export GK_SYSTEM=gnu_ubuntu
export MAKEFLAGS=-IMakefiles
make

# or in one line:
make -IMakefiles GK_SYSTEM=gnu_ubuntu

About

stella is a flux tube gyrokinetic code for micro-stability and turbulence simulations of strongly magnetised plasma.

https://stellagk.github.io/stella/

License:Other


Languages

Language:Fortran 52.4%Language:Python 40.0%Language:TeX 4.5%Language:CMake 1.4%Language:Perl 0.6%Language:Makefile 0.5%Language:Shell 0.4%Language:Emacs Lisp 0.1%Language:C 0.1%Language:NASL 0.0%