Introduction
This page lists every gs2 input parameter currently known about, along with any help available. It is intended as a reference, not an introduction. Note: some parameters are highly specialised and not intended for general use.
A full introduction to writing input files is to be written, but until then, this is an old example input file. Be aware that not every section should be included.
gs2 Reference Input File
Format
The parameters are divided into namelists. Each parameter has type information and written help where available. The format is:
Name 
Type 
Def 
CR Name 
Description

Name as it appears in gs2 
Fortran Data Type 
Autoscanned Default(s): guesses at what the default value of this parameter will be if you do not specify it in the input file. They are usually correct.

CodeRunner Name: is the variable name used by CodeRunner to refer to the quantity (only given if it is different to the gs2 name).

Long and detailed help for the variable

Updating this Page
This page is automatically generated by CodeRunner, but any changes you make will be kept, so please feel free to contribute. Please keep to the same format as this allows easy automatic syncing of your changes with the CodeRunner database. Please only edit in between the <! begin help > <! end help > or the <! begin namelist help > <! end namelist help > tags. Don't edit type/default information (or this introduction) as it will not be kept.
Namelists
Each gs2 module is controlled by its own namelist. For typical applications, not all 32+ namelists should appear in a single file. For a run called runname, this file should be called runname.in. In most cases, defaults are loaded for each namelist element, so that if a namelist or element does not appear, the run will not automatically stop. (It may still be forced to stop if the defaults are incompatible with your other choices.) The namelists and defaults appear below.
parameters
Name 
Type 
Def 
CR Name 
Description

beta 
Float 
0.0 
beta

 In GS2 $ \beta $ is the ratio of the reference pressure to the reference magnetic energy density, $ \beta = 2 \mu_0 n_{\rm ref} T_{\rm ref}/B_{\rm ref}^2 $. Mainly GS2 uses $ \beta $ to determine the amplitude of the perturbed magnetic fields.
 For electromagnetic runs, the contribution of each species to the total parallel current is weighted by a factor of $ w_s = 2 \beta Z_s n_s \sqrt{T_s/m_s} $.
 Handy formula: 403. * nref_19 * T_ref(kev) / 1.e5 / B_T**2, where nref_19 is the reference density / 10**19 and B_T is the magnetic field in Tesla.
 For electromagnetic runs that include $ \delta B_\parallel $, this field is proportional to $ \beta $.
 The contribution of $ (\delta B)^2 $ to the total gyrokinetic energy is inversely proportional to this input parameter.
 If an antenna is set up to drive Alfven waves, then $ \beta $ is used to calculate the Alfven frequency.
 For some collision operator models, $ \beta $ is used to calculate the resistivity.
 For some rarelyused initial conditions, $ \beta $ appears explicitly.
 Important: $ \beta $ is not a GS2 plasma equilibrium parameter, but it must be chosen with care. $ \beta $ is not automatically consistent with the value of $ \beta' $ used in the local magnetic equilibrium. The user is responsible for ensuring that the values of $ \beta $ together with the densities, temperatures and gradients for all species are consistent with the local equilibrium value of $ \beta' $.

k0 
Float 
1.0 
parameters_k0


rhostar 
Float 
0.003 
rhostar

 Normalised gyroradius, $ \frac{\rho}{a} $, needed for calculating the momentum flux in the low flow limit.

teti 
Float 
100.0 
teti

 Ratio of electron to ion temperatures. Deprecated. Do not use unless you know what you are doing.

tite 
Float 
1.0 
tite

 Ratio of ion to electron temperatures. This parameter is used only when there is no species called "electron" included.

zeff 
Float 
1.0 
zeff

 Effective ionic charge. The parameter $ Z_{\rm eff} $ appears only in the electron collision frequency, and is not automatically set to be consistent with the mix of species specified in the species namelists.

kt_grids_knobs
There are two variables which may be determined at the highest level
of the kt_grids module: grid_option and norm_option. The first determines which
Fourier modes perpendicular to the field lines will be evolved in
time. For each possible choice, there is a subsidiary module (and
namelist) which controls the details. The norm_option variable
simply fixes the definition of the thermal velocity.
Name 
Type 
Def 
CR Name 
Description

grid_option 
String 
default 
grid_option

 The general layout of the perpendicular grid.
 'single' Evolve a single Fourier mode. Set up kt_grids_single_parameters.
 'default' Same as 'single'
 'range' Evolve a range of equally spaced Fourier modes. Set up kt_grids_range_parameters.
 'specified' Evolve an arbitrary set of Fourier modes. Set up kt_grids_specified_parameters.
 'box' Simulation domain is logically rectangular. Set up kt_grids_box_parameters.
 'nonlinear' Same as 'box.'
 'xbox' Experimental.

kt_grids_box_parameters
Name 
Type 
Def 
CR Name 
Description

jtwist 
Integer 

jtwist

 For finite magnetic shear, determines box size in x direction according to
 $ L_x = L_y jtwist / (2 \pi \hat{s}) $
 Also affects the number of "connections" at each ky when linked boundary conditions are selected in the dist_fn_knobs namelist.
 Internally initialised to $ jtwist=MAX(Int[2\pi\hat{s}+0.5],1) $ such that $ L_x \sim L_y $ except for very small shear ($ \hat{s}<\sim 0.16 $).

ly 
Float 
0.0 
ly

 Box size in y direction.
 If ly=0, it is set to be 2*pi*y0 (below).

n0 
Integer 
0 
n0

 Number of toroidal mode numbers: if set, overrides y0... y0=1.0/(n0*rhostar_box*drhodpsi)

naky 
Integer 
1 
naky

 The actual number of ky modes (do not use for nonlinear runs, use ny). If left as zero (recommended), automatically set to (ny1)/3+1.

nkpolar 
Integer 
0 
nkpolar


ntheta0 
Integer 
lntheta0,ntheta0_private,size(akx) 
ntheta0

 If left as zero (recommended), automatically set to 2*((nx1)/3)+1.

nx 
Integer 
0 
nx

 The number of kx modes: the number of kx modes actually simulated (ntheta0) is equal to 2*(nx  1)/3 + 1, due to the need to prevent aliasing.

ny 
Integer 
ny_private,yxf_lo%ny 
ny

 The number of ky modes: the number of ky modes actually simulated (naky) is equal to (ny  1)/3 + 1, due to the need to prevent aliasing.

rhostar_box 
Float 

rhostar_box

 If rhostar_box and n0 are set then y0=1.0/(n0*rhostar_box*drhodpsi)

rtwist 
Float 
0.0 
rtwist


x0 
Float 
sqrt(epts(negrid)) 
x0

 The length of the box in the x direction (measured in the Larmour radius of species 1) if shat is 0 (ie 1e6)

y0 
Float 

y0

 The length of the box in the y direction (measured in the Larmour radius of species 1). Box size in y direction is 2*pi*y0.
 Note if $ y0<0 $ then replaced with $ 1/y0 $ so effectively setting the minimum wavelength captured by the box (related to aky_min).

kt_grids_single_parameters
Name 
Type 
Def 
CR Name 
Description

akx 
Float 
0.0 
akx

 kx rho (but set theta_0 instead.)

aky 
Float 
0.4 
aky

 $ k_y \rho $ for the reference species. Used only in certain modes (e.g. in single mode).

n0 
Integer 
0 
n0

 if n0>0 use toroidal mode number to override aky and set aky=n0*drhodpsi*rhostar_single

rhostar_single 
Float 

rhostar_single

 Used in conjunction with n0: aky=n0*drhodpsi*rhostar_single (if n0 is set).

theta0 
Float 
0.0 
theta0


theta_grid_parameters
Name 
Type 
Def 
CR Name 
Description

akappa 
Float 
1.0 
akappa

 The flux surface elongation (only used when geoType=0, which selects the Generalised Miller analytic geometry specification).

akappri 
Float 
0.0 
akappri

 The radial gradient flux surface elongation (only used when geoType=0, which selects the Generalised Miller analytic geometry specification).
 akappri = $ d\kappa/d\rho $

alpmhd 
Float 

alpmhd

 Default = 0. Do not use unless you know what you are doing.

aSurf 
Float 
1.0 
aSurf

 Minor radius of the flux surface that receives the specified shaping (only used when geoType=1, which selects the Global MHD analytic geometry specification). See Section 2.1.2 of the Analytic Geometry Specification documentation for more details.

asym 
Float 
0.0 
asym


asympri 
Float 
0.0 
asympri


btor_slab 
Float 
0.0 
btor_slab

 In the slab limit, determines the angle between the field and the background flow (which flows in an imaginary toroidal direction). It is effectively equal to $ \frac{B_t}{B}=\frac{u_{\parallel}}{u} $.

deltam 
Float 
1.0 
deltam

 The magnitude of the mMode shaping effect (only used when geoType=2 or 3, which selects the Generalised Elongation or Fourier analytic geometry specifications). See Sections 2.1.3 and 2.1.4 of the Analytic Geometry Specification documentation for more details.

deltan 
Float 
1.0 
deltan

 The magnitude of the nMode shaping effect (only used when geoType=2 or 3, which selects the Generalised Elongation or Fourier analytic geometry specifications). See Sections 2.1.3 and 2.1.4 of the Analytic Geometry Specification documentation for more details.

deltampri 
Float 
0.0 
deltampri

 Radial derivative of the magnitude of the mMode shaping effect (only used when geoType=2 or 3, which selects the Generalised Elongation or Fourier analytic geometry specifications). See Sections 2.1.3 and 2.1.4 of the Analytic Geometry Specification documentation for more details.

deltanpri 
Float 
0.0 
deltanpri

 Radial derivative of the magnitude of the nMode shaping effect (only used when geoType=2 or 3, which selects the Generalised Elongation or Fourier analytic geometry specifications). See Sections 2.1.3 and 2.1.4 of the Analytic Geometry Specification documentation for more details.

delta2 
Float 
1.0 
delta2

 The elongation of the flux surface labeled by aSurf (only used when geoType=1, which selects the Global MHD analytic geometry specifications). See Section 2.1.2 of the Analytic Geometry Specification documentation for more details.

delta3 
Float 
1.0 
delta3

 The triangularity of the flux surface labeled by aSurf (only used when geoType=1, which selects the Global MHD analytic geometry specifications). See Section 2.1.2 of the Analytic Geometry Specification documentation for more details.

eps 
Float 
0.3 
eps

 Controls particle trapping (among other things) in simple geometric models. $ \epsilon = r/R $

epsl 
Float 
0.3 
epsl

 $ \epsilon_\ell = \frac{2 L_{ref}}{ R} $ Sets curvature drift in salpha model, where $ L_{ref} $ is the GS2 equilibrium reference normalisation length and R is the major radius at the centre of the flux surface.

geoType 
Integer 
0 
geoType

 Selects between different analytic geometry specifications (only used when iflux=0 and local_eq=T): geoType=0 selects the Generalised Miller, geoType=1 selects the Global MHD, geoType=2 selects the Generalised Elongation, and geoType=3 selects the Fourier specification. See Section 2.1 of the Analytic Geometry Specification documentation for more details.

kp 
Float 

kp

 kp sets parallel wavenumber and box length in slab geometry. $ k_p = \frac{2 \pi L_{ref}}{L_z} $.
 always use kp instead of pk in slab geometry (if kp > 0 then gs2 sets pk = 2*kp)
 in slab limit $ shat = \frac{L_z}{2 \pi L_s} = \frac{L_{ref}}{k_p L_s} $ : nb if kp = 1, $ shat = \frac{L_{ref}}{L_s} $, where L_s is the magnetic shear scale length.

mMode 
Integer 
2 
mMode

 First flux surface shaping mode number (only used when geoType=2 or 3, which selects the Generalised Elongation or Fourier analytic geometry specifications). See Sections 2.1.3 and 2.1.4 of the Analytic Geometry Specification documentation for more details.

nMode 
Integer 
3 
nMode

 Second flux surface shaping mode number (only used when geoType=2 or 3, which selects the Generalised Elongation or Fourier analytic geometry specifications). See Sections 2.1.3 and 2.1.4 of the Analytic Geometry Specification documentation for more details.

nperiod 
Integer 
1,2 
nperiod

 Sets the number of $ 2\pi $ segments along equilibrium magnetic field to include in simulation domain. $ N_{\rm segments} = (2n_{\rm period}  1) $.

ntheta 
Integer 
24,32,64 
ntheta

 Number of grid points along equilibrium magnetic field between $ \theta=(\pi,\pi) $ (in addition to a grid point at $ \theta=0 $).
 Ignored in some cases (when using numerical equilibria)
 ntheta used in code is always odd (equal to $ n_{\theta{\rm in}}+1 $ if input $ n_{\theta{\rm in}} $ is even)
 ntgrid is integer part of $ (n_{\theta{\rm in}}/2) $

pk 
Float 
0.3 
pk

 $ p_k = \frac{epsl}{q} = \frac{2 L_{ref}}{ q R} $ Sets q, the magnetic safety factor, and therefore also sets the connection length, i.e. the length of the box in the parallel direction, in terms of $ L_{ref} $. Used only in high aspect ratio $ s\alpha $ equilibrium model.

qinp 
Float 
1.5 
qinp

 Sets value of the safety factor when using local toroidal equilibrium model.

raxis 
Float 
3.0 
raxis

 Major radial location of the magnetic axis (only used when geoType=1, which selects the Global MHD analytic geometry specification). See Section 2.1.2 of the Analytic Geometry Specification documentation for more details.

r_geo 
Float 
3.0 
r_geo

 When $ iflux = 1 $: Centerpoint of LCFS (normalized to $ L_{ref} $)
 When $ iflux \neq 1 $: Major radius of magnetic field reference point (normalized to $ L_{ref} $). Specifically, the reference magnetic field is defined to be the value of the toroidal magnetic field at R=r_geo on the flux surface labeled by rhoc.

rhoc 
Float 
0.5,0.6,0.8,1.0 
rhoc

 rhoc is flux surface label (0< rhoc< 1). Its exact meaning depends on irho. Usually rho = midplane diameter/midplane diameter of LCFS
(here, "LCFS" refers to the flux surface at a radius of L_ref. If using Miller geometry with $ L_{ref} \neq a $, this is *not* the physical last closed flux surface.
 When irho = 1, rhoc = sqrt(toroidal flux)/sqrt(toroidal flux of LCFS)
 When irho = 2, rhoc = midplane diameter/(midplane diameter of LCFS). recommended
 When irho = 3, rhoc = poloidal flux/(poloidal flux of LCFS)

rmaj 
Float 
1.0,3,3.0 
rmaj

 When $ iflux = 1 $: Position of magnetic axis (normalized to $ L_{ref} $)
 When $ iflux \neq 1 $: Major radius of the centre of the flux surface of interest (normalized to $ L_{ref} $)

shat 
Float 
0.0,0.75 
shat

 Sets value of magnetic shear in simple geometric models.
 overridden by s_hat_input in theta_grid_eik_knobs for most values of bishop.

shift 
Float 
0.0,0 
shift

 shift is related to minor radial derivatives of the major radial location of the flux surface centers (i.e. the Shafranov shift), but this input variable has different physical definitions in salpha and other analytic equilbrium models:
 In salpha (i.e. equilibrium_option='salpha'), shift$ \propto $ p' is a parameter for local $ J_{\phi} $ (and NOT $ B_{\theta} $ which is constant): $ shift = \frac{2epsl}{pk^2}\frac{d\beta}{d\rho}=\frac{q^2R}{L_{ref}}\frac{d\beta}{d\rho} > 0 $
 In other analytic specifications (i.e. equilibrium_option='eik' and geoType=0, 2, or 3), shift is a parameter for local $ B_{\theta} $ (and NOT for $ J_{\phi} $): $ shift = \frac{1}{L_{ref}} \frac{dR}{d\rho} < 0 $
 NB in Miller shift contains the 1st radial derivative of the Shafranov shift, BUT in salpha shift is related to a 2nd radial derivative of the Shafranov shift.
 in salpha (i.e. equilibrium_option='salpha'), no additional parameter is required as the piece of $ J_{\phi} \propto $ p' is specified by shift.
 in other analytic specifications (i.e. equilibrium_option='eik'), an additional parameter (beta_prime) is required to specify the piece of $ J_{\phi} \propto $ p'

shiftVert 
Float 
0.0 
shiftVert

 Minor radial derivative of the axial location of the flux surface centers (i.e. the vertical Shafranov shift). It is only used when equilibrium_option='eik' and geoType=0, 2, or 3 (which selects the Generalised Miller, Generalised Elongation, or Fourier analytic geometry specifications). See Sections 2.1.1, 2.1.3, and 2.1.4 of the Analytic Geometry Specification documentation for more details.

thetak 
Float 
0.0 
thetak

 The tilt angle of the elongation (only used when geoType=0, which selects the Generalised Miller specification). See Section 2.1.1 of the Analytic Geometry Specification documentation for more details.

thetad 
Float 
0.0 
thetad

 The tilt angle of the triangularity (only used when geoType=0, which selects the Generalised Miller specification). See Section 2.1.1 of the Analytic Geometry Specification documentation for more details.

thetam 
Float 
0.0 
thetam

 The tilt angle of the mMode shaping effect (only used when geoType=2 or 3, which selects the Generalised Elongation or Fourier analytic geometry specifications). See Sections 2.1.3 and 2.1.4 of the Analytic Geometry Specification documentation for more details.

thetan 
Float 
0.0 
thetan

 The tilt angle of the nMode shaping effect (only used when geoType=2 or 3, which selects the Generalised Elongation or Fourier analytic geometry specifications). See Sections 2.1.3 and 2.1.4 of the Analytic Geometry Specification documentation for more details.

theta2 
Float 
0.0 
theta2

 The tilt angle of the elongation of the flux surface labeled by aSurf (only used when geoType=1, which selects the Global MHD analytic geometry specification). See Section 2.1.2 of the Analytic Geometry Specification documentation for more details.

theta3 
Float 
0.0 
theta3

 The tilt angle of the triangularity of the flux surface labeled by aSurf (only used when geoType=1, which selects the Global MHD analytic geometry specification). See Section 2.1.2 of the Analytic Geometry Specification documentation for more details.

tri 
Float 
0.0 
tri

 The flux surface triangularity (only used when geoType=0, which selects the Generalised Miller analytic geometry specification).
 triangularity is tri = arcsin[(R(max(Z))R_major)/r_mid]

tripri 
Float 
0.0 
tripri

 The radial gradient of the flux surface triangularity (only used when geoType=0, which selects the Generalised Miller analytic geometry specification).

zaxis 
Float 
0.0 
zaxis

 Axial location of the magnetic axis (only used when geoType=1, which selects the Global MHD analytic geometry specification). See Section 2.1.2 of the Analytic Geometry Specification documentation for more details.

theta_grid_knobs
Name 
Type 
Def 
CR Name 
Description

cvdriftknob 
Float 
1.0 
cvdriftknob

 Scales the curvature drift.

equilibrium_option 
String 
default 
equilibrium_option

 The equilibrium_option variable controls which geometric assumptions are used in the run. Additional namelists determine the geometric parameters according to the choice made here. Allowed values are:
 'eik' Use routines from the geometry module, controlled mainly by the subsidiary namelists theta_grid_parameters and theta_grid_eik_knob. This includes options for Miller as well as a range of different numerical equilibrium file formats.
 'default' Same as 'eik'
 'salpha' Use high aspectratio toroidal equilbrium (which can be simplified to slab or cylinder), controlled by the subsidiary namelist theta_grid_parameters and theta_grid_salpha_knob
 'file' Use output from rungridgen code directly. Controlled by theta_grid_file_knobs. Note: in this case, the variables nperiod and ntheta (from the theta_grid_parameters namelist) are ignored.
 'grid.out' Same as 'file'

gb_to_cv 
Fortran_Bool 
.false. 
gb_to_cv

 If true then force gradB drift to be equal to curvature drift. This is not recommended when fbpar$ \neq $0.

gbdriftknob 
Float 
1.0 
gbdriftknob


theta_grid_salpha_knobs
Name 
Type 
Def 
CR Name 
Description

alpha1 
Float 
0.0 
alpha1

 Coefficient in model when model_option='alpha1' has been selected.

alpmhdfac 
Float 
0.0 
alpmhdfac


model_option 
String 
default 
model_option

 Sets the particular model for the magnetic field and related drifts.
 'salpha' High aspect ratio toroidal equilibrium. (Note that the curvature and gradB drifts are equal.)
 'default' Same as 'salpha'
 'alpha1','rogers','b2','normal_only',constcurv',nocurvature': See output of ingen (or contents of theta_grid.f90) until this page is improved.

theta_grid_file_knobs
Name 
Type 
Def 
CR Name 
Description

gridout_file 
String 
grid.out 
gridout_file

 Name of file with output from rungridgen.

no_geo_info 
Fortran_Bool 

no_geo_info


theta_grid_gridgen_knobs
theta_grid_eik_knobs
Name 
Type 
Def 
CR Name 
Description

alpha_input 
Float 
alpmhd_in,bp_in 
alpha_input

 Used only if bishop = 5. Needs to be checked.

beta_prime_input 
Float 
1,0.0 
beta_prime_input

 The gradient of the pressure. Strictly speaking this parameter is not $ \frac{\partial \beta}{\partial \rho} $ but $ \beta \frac{1}{p}\frac{\partial p}{\partial \rho} $: in other words, the gradient of the magnetic field is ignored. Used only if bishop = 4 or 9.

bishop 
Integer 
1,5,6 
bishop

 Use Bishop relations to generate metric coefficients.
 0: Use highaspect ratio coefficients (only for debugging)
 1: Use actual equilibrium values of shat, p' Recommended
 2: Use numerical equilibrium + s_hat_input and p_prime_input
 3: Use numerical equilibrium + s_hat_input and inv_Lp_input
 4: Use numerical equilibrium + s_hat_input and beta_prime_input
 5: Use numerical equilibrium + s_hat_input and alpha_input
 6: Use numerical equilibrium + beta_prime_input
 7: Use numerical equilibrium and multiply pressure gradient by dp_mult
 8: Use numerical equilibrium + s_hat_input and multiply pressure gradient by dp_mult
 9: Use numerical equilibrium + s_hat_input and beta_prime_input
 Otherwise: Use magnetic shear and pressure gradient as set elsewhere.


chs_eq 
Fortran_Bool 
.false.,.true. 
chs_eq

 Use equilbrium data from the CHEASE file ogyropsi.dat

delrho 
Float 
0.01 
delrho


dfit_eq 
Fortran_Bool 
.false. 
dfit_eq

 Vacuum magnetic dipole geometry

dp_mult 
Float 
1.0 
dp_mult

 Used only if bishop = 7 or 8.

efit_eq 
Fortran_Bool 
.false.,.t.,.true. 
efit_eq

 Use EFIT equilibrium (EFIT, codes with eqdsk format)

eqfile 
String 
dskeq.cdf,eqfile_in,ogyropsi.dat,test8_efit.dat 
eqfile

 Name of file with numerical equilibrium data (if required)

equal_arc 
Fortran_Bool 
.false.,.true. 
equal_arc

 Change fieldline coordinate. Recommended value: F

gen_eq 
Fortran_Bool 
.false. 
gen_eq

 Use Toqstyle NetCDF equilibrium (TOQ)

gs2d_eq 
Fortran_Bool 
.false. 
gs2d_eq

 Read Colin Roach's GS2D equilibrium file

idfit_eq 
Fortran_Bool 
.false. 
idfit_eq


iflux 
Integer 
0,1 
iflux

 Choose mode of operation:
 0: Use analytic parameterization of local toroidal MHD equilibrium.
 1: Read equilibrium data from output of MHD code
 2: Running inside a transport code without numerical equilibrium

invLp_input 
Integer 

invlp_input


irho 
Integer 
1,2 
irho

 Choose definition of flux surface coordinate
 1: rho == sqrt(toroidal flux)/sqrt(toroidal flux of LCFS)
 2: rho == midplane diameter/LCFS diameter Recommended
 3: rho == poloidal flux/poloidal flux of LCFS

isym 
Integer 
0 
isym


 0: Recommended
 1: Force updown symmetry.

itor 
Integer 
1 
itor


local_eq 
String 
.false.,.true. 
local_eq

 Use Millerstyle local equilibrium

ppl_eq 
Fortran_Bool 
.false.,.true. 
ppl_eq

 Use Menardstyle NetCDF equilibrium (JSOLVER)

rmax 
Float 
0.0,1.0 
rmax


rmin 
Float 
0.01,0.05 
rmin


s_hat_input 
Float 
0.8,1 
s_hat_input


transp_eq 
Fortran_Bool 
.false.,F 
transp_eq

 Use new PPL NetCDF equilibrium (TRANSP)

writelots 
Fortran_Bool 
.false.,.t. 
writelots

 Write a little extra about geometry to the screen.

le_grids_knobs
A concise description of the original GS2 pitch angle and energy grid choices may be found in the article entitled "Comparison of Initial Value and Eigenvalue Codes for Kinetic Toroidal Plasma Instabilities" by M. Kotschenreuther, et al., in Computer Physics Communications, Vol. 88, page 128, 1995.
Since then the energy grid has been updated to use the Candy/Waltz grid, but the pitch angle grid remains the same.
Name 
Type 
Def 
CR Name 
Description

bouncefuzz 
Float 

bouncefuzz

 Should not have to change this

genquad 
Fortran_Bool 

genquad

 If true use generalised quadrature scheme for velocity integrals.

test 
Fortran_Bool 
.false. 
le_grids_test

 Write some data to the screen and stop before doing much calculation. (Debugging only)

ne_int_genquad 
Integer 

ne_int_genquad

 Velocity space res used to calculate moments of the distribution prior to calculating general quadrature scheme. Suggested value: large! (>200).

negrid 
Integer 
10 
negrid

 Total number of energy grid points

nesub 
Integer 
8 
nesub

 Only used if advanced_egrid = F; sets number of energy grid points below ecut

nesuper 
Integer 
2 
nesuper

 Only used if advanced_egrid = F; sets number of energy grid points above ecut

new_trap_int 
Fortran_Bool 
.false. 
new_trap_int


ngauss 
Integer 
5 
ngauss

 2*ngauss is the number of untrapped pitchangles moving in one direction along field line.

nmax 
Integer 
size(dv),size(h) 
nmax


nterp 
Integer 

nterp


trapped_particles 
Fortran_Bool 

trapped_particles

 If set to False then the $ \lambda $ grid weighting (wl) is set to zero for trapped pitch angles. This means that integrals over velocity space do not include a contribution from trapped particles which is equivalent to the situation where eps<=0.0.
 Trapped particle drifts are not set to zero so "trapped" particles still enter the source term through wdfac. At least for salpha the drifts are the main difference (?please correct if not true?) between the eps<=0.0 and the trapped_particles = False cases as Bmag is not a function of $ \theta $ in the eps<=0.0 case whilst it is in the trapped_particles = False case.

vcut 
Float 
2.5 
vcut

 No. of standard deviations from the standard Maxwellian beyond which the distribution function will be set to 0

wgt_fac 
Float 

wgt_fac


dist_fn_knobs
Two important choices are made in this namelist:
(a) The boundary conditions along the field line
(b) The form of the adiabatic response (if a species is being modeled as adiabatic)
Name 
Type 
Def 
CR Name 
Description

adiabatic_option 
String 
default 
adiabatic_option

 The form of the adiabatic response (if a species is being modeled as adiabatic). Ignored if there are electrons in the species list.
 'nofieldlineaverageterm' Adiabatic species has n = Phi. Appropriate for singlespecies ETG simulations.
 'default' Same as 'nofieldlineaverageterm'
 'iphi00=0' Same as 'nofieldlineaverageterm'
 'iphi00=1' Same as 'nofieldlineaverageterm'
 'fieldlineaverageterm' Adiabatic species has n=Phi< Phi >. Appropriate for singlespecies ITG simulations.
 'iphi00=2' Same as fieldlineaverageterm'
 'iphi00=3' Adiabatic species has n=Phi< Phi >_y. Incorrect implementation of fieldlineaverageterm.

afilter 
Float 
0.0 
afilter


apfac 
Float 
1.0 
apfac

 Leave as unity. For debugging.

boundary_option 
String 
default 
boundary_option

 Sets the boundary condition along the field line (i.e. the boundary conditions at theta = + pi). Possible values are:
 'zero', 'default', 'unconnected'  Use Kotschenreuther boundary condition at endpoints of theta grid
 'selfperiodic', 'periodic', 'kperiod=1'  Each mode is periodic in theta with itself
 'linked'  Twist and shift boundary conditions (used for kt_grids:grid_option='box')
 'alternatezero'  Ignored
 See also nonad_zero

btor_slab 
Float 
0.0 
btor_slab

 Overrides the itor_over_B internal parameter, meant only for slab runs where it sets the angle between the magnetic field and the toroidal flow.

cllc 
Fortran_Bool 
.false. 
cllc


def_parity 
Fortran_Bool 
.false. 
def_parity

 True only allows solutions of single parity.

even 
Fortran_Bool 
.true. 
dist_fn_even

 If def_parity=T, determines allowed parity.

driftknob 
Float 
1.0 
driftknob

 Leave as unity. For debugging. Multiplies the passing particle drifts (also see tpdriftknob).

esv 
Fortran_Bool 
.false. 
esv

 If esv=.true. and boundary_option='linked' (i.e. flux tube simulation) then at every time step we ensure the fields are exactly single valued by replacing the field at one of the repeated boundary points with the value at the other boundary (i.e. of the two array locations which should be storing the field at the same point in space we pick one and set the other equal to the one we picked). This can be important in correctly tracking the amplitude of damped modes to very small values. Also see clean_init.

g_exb 
Float 
0.0 
g_exb

 $ \frac{\rho}{q} \frac{d\Omega^{\rm GS2}}{d\rho_n} $ where $ \Omega^{\rm GS2} $ is toroidal angular velocity normalised to the reference frequency $ v_{t}^{\rm ref}/a $
and $ \rho_n $ is the normalised flux label which has value $ \rho $ on the local surface.

g_exb_error_limit 
Float 
0.0 
g_exb_error_limit

 With flow shear in single mode, constrains relative error in phi^2.

g_exb_start_time 
Integer 
1 
g_exb_start_time

 Flow shear switched on at this time.

g_exb_start_timestep 
Integer 
1 
g_exb_start_timestep

 Flow shear is switched on at this time step.

g_exbfac 
Float 
1.0 
g_exbfac

 Multiplies g_exb in the perpendicular shearing term but not in the parallel drive term. Use for simulations with purely parallel flow.

gf_lo_integrate 
Fortran_Bool 
.false. 
gf_lo_integrate

 Performs velocity space integration using gf_lo, rather than g_lo, data decomposition. If used without field_option = 'gf_local' in fields_knobs it is likely to give poor performance.
 If field_option = 'gf_local' in fields_knobs then this needs to be present and set to .true.

gridfac 
Float 
1.0 
gridfac

 Affects boundary condition at end of theta grid. Recommended value: 1.

include_lowflow 
Fortran_Bool 

include_lowflow


Include calculation of terms present in the low flow limit of gyrokinetics. Many new terms... will slow calculation... don't set true unless you know what you are doing. not currently implemented : lowflow terms automatically active if gs2 compiled with LOWFLOW=on

kfilter 
Float 
0.0 
kfilter


lf_decompose 
Fortran_Bool 
.false. 
lf_decompose


lf_default 
Fortran_Bool 
.true. 
lf_default


mach 
Float 
0.0 
mach

 Number multiplying the coriolis drift

mult_imp 
Fortran_Bool 
.false. 
mult_imp

 Allow different species to have different values of bakdif and fexpr. Not allowed for nonlinear runs.

nonad_zero 
Fortran_Bool 
.true. 
nonad_zero

 If true switches on new parallel boundary condition where h=0 at incoming boundary instead of g=0.

omprimfac 
Float 
1.0 
omprimfac

 Factor multiplying the parallel shearing drive term when running with nonzero g_exb

opt_init_bc 
Fortran_Bool 
.false. 
opt_init_bc

 If true then use an optimised init_connected_bc. This routine can become quite expensive for large problems and currently does not scale well. The optimised routine improves serial performance but does not yet help with scaling.

opt_source 
Fortran_Bool 
.false. 
opt_source

 If true then use an optimised linear source calculation which uses precalculated coefficients, calculates both sigma together and skips work associated with empty fields. Can contribute 1025% savings for linear electrostatic collisionless simulations. For more complicated runs the savings will likely be less. If enabled memory usage will increase due to using an additional array of size 24 times gnew. Can potentially slow down certain runs.

poisfac 
Float 
0.0 
poisfac

 If nonzero, quasineutrality is not enforced; poisfac= (lambda_Debye/rho)**2

test 
String 
.false. 
test

 For debugging only. If set then run will print various grid sizes and then stop.

tpdriftknob 
Float 
9900000000.0 
tpdriftknob

 For debugging only. Multiplies the trapped particle drifts (also see driftknob).

wfb 
Float 
1.0 
wfb

 For debugging only. Sets the boundary value for the barely trapped/passing particle.

wfb_cmr 
Fortran_Bool 
.false. 
wfb_cmr


zero_forbid 
Fortran_Bool 
.false. 
zero_forbid

 If true then force `gnew=0` in the forbidden region at the end of invert_rhs_1 (this is the original behaviour).
 Nothing should depend on the forbidden region so g should be 0 here and if it's not for some reason then it shouldn't impact on results. If the results of your simulation depend upon this flag then something has likely gone wrong somewhere.

fields_knobs
Name 
Type 
Def 
CR Name 
Description

do_smart_update 
Fortran_Bool 
.false. 
do_smart_update

 Used with field_option='local'. If .true. and x/y distributed then in advance only update local part of field in operations like "phinew=phinew+phi" etc.

dump_response 
Fortran_Bool 
.false. 
dump_response

 Writes files containing the field response matrix after initialisation. This currently works for field_option='implicit' or 'local'.
 Note: We write to netcdf files by default but fall back to fortran unformatted (binary) files (which are not really portable) in the absence of netcdf.

field_local_allreduce 
Fortran_Bool 
.false. 
field_local_allreduce

 Set to true to use an allreduce (on mp_comm) in field calculation (field_option='local' only) rather than a reduction on a subcommunicator followed by a global broadcast.
 Typically a little faster than default performance but may depend on MPI implementation.

field_local_allreduce_sub 
Fortran_Bool 
.false. 
field_local_allreduce_sub

 Set to true, along with field_local_allreduce and intspec_sub, to replace the allreduce used in field calculation with an allreduce on a subcommunicator followed by a reduction on a "perpendicular" communicator.
 Typically a bit faster than default and scales slightly more efficiently.
 Note if this option is active only proc0 has knowledge of the full field arrays. Other processors know the full field for any supercell (connected xy domains) for which it has any of the xy indices local in the g_lo layout.

field_local_tuneminnrow 
Fortran_Bool 
.false. 
field_local_tuneminnrow

 Set to true when using field_option='local' to set the automatically tune, and select the best performing, minimum block size (in a single supercell) assigned to a single processor. This can improve performance, but is not guaranteed to.

field_option 
String 
default 
field_option

 The field_option variable controls which timeadvance algorithm is used for the linear terms. Allowed values are:
 'implicit' Advance linear terms with Kotschenreuther's implicit algorithm.
 'default' Same as 'implicit'
 'local' Same implicit algorithm as 'implicit' but with different data decomposition (typically much faster for flux tube runs).
 'gf_local' Same as 'local' but with gf_lo field decomposition. To use this you also need to set gf_lo_integrate= .true. in dist_fn_knobs and gf_local_fields = .true. in layout_knobs
 'explicit' Use secondorder RungeKutta. Experimental.
 'test' Use for debugging.

field_subgath 
Fortran_Bool 
.false. 
field_subgath

 Set to true to use allgatherv to fetch parts of the field update vector calculated on other procs. When false uses a sum_allreduce instead. This doesn't rely on subcommunicators so should work for any layout and processor count.
 Note: This only impacts field_option='implicit'

force_maxwell_reinit 
Fortran_Bool 
.true. 
force_maxwell_reinit


minnrow 
Integer 
64 
minnrow

 Used with field_option='local' to set the minimum block size (in a single supercell) assigned to a single processor. Tuning this parameter changes the balance between work parallelisation and communication. The lower this is set the more communication has to be done but the fewer processors don't get assigned work (i.e. helps reduce computation time). The optimal value is likely to depend upon the size of the problem and the number of processors being used. Furthermore it will effect intialisation and advance in different ways.

read_response 
Fortran_Bool 
.false. 
read_response

 Reads files containing the field response matrix and uses to initialise GS2s response matrix rather than using the usual initialisation process.

remove_zonal_flows_switch 
Fortran_Bool 
.false. 
remove_zonal_flows_switch

 Delete zonal flows at every timestep.


response_dir 
String 
"" 
response_dir

 Sets location in which to store/look for response dump files.
 Note We don't currently check that this location exists before attempting to use it, which could cause problems.
 The default is to save them in the working directory.

knobs
Name 
Type 
Def 
CR Name 
Description

avail_cpu_time 
Float 
10000000000.0 
avail_cpu_time

 Specify the available wall clock time in seconds. GS2 will start to exit up to 5 minutes before this time is up. This ensures that all the output files are written correctly. CodeRunner automatically sets this quantity unless it is given the value false.

delt 
Float 

delt

 Timestep, in units of $ a/v_{t0} $. For linear runs, this value does not change. For nonlinear runs, the timestep used by the code will not be allowed to exceed this value.

delt_option 
String 
default 
delt_option

 Determines how the initial timestep is set. Options: "default", "set_by_hand" (identical to "default") and "check_restart".
 When delt_option="default", the initial timestep is set to delt.
 If delt_option="check_restart" when restarting a job, the initial timestep will be set to the last timestep of the job you are restarting, even if delt is larger. Thus, you usually want to set delt_option="check_restart" when restarting a job and delt_option="default" otherwise.

do_eigsolve 
Fortran_Bool 
.false. 
do_eigsolve

 If true then use eigensolver instead of initial value solver. Only valid for executables compiled with WITH_EIG=on and linked with PETSC+SLEPC libraries. Should only be used in linear simulations with a single ky and theta0.

eqzip 
Fortran_Bool 
.false. 
eqzip

 Default = .false. Do not evolve certain $ k $ modes in time. Set this to true only if you know what you are doing. True only for secondary/tertiary instability calculations.

eqzip_option 
String 
none 
eqzip_option


fapar 
Float 
0.0,1.0 
fapar

 Multiplies $ A_\parallel $ throughout. Set to zero for electrostatic calculations, or unity for electromagnetic. Set to zero if $ \beta = 0 $.

faperp 
Float 
0.0 
faperp

 Multiplies A_perp. Use 1 for high beta, 0 otherwise. Deprecated: use fbpar instead. Defaults to zero. Do not change this value unless you know what you are doing.

fbpar 
Float 
1.0,0.0 
fbpar

 Multiplies $ B_\parallel $ throughout. Set to zero or unity, depending on whether you want to include physics related to $ \delta B_\parallel $. Set to zero if $ \beta = 0 $.

fixpar_secondary 
Integer 

fixpar_secondary


fphi 
Float 

fphi

 Multiplies $ \Phi $ (electrostatic potential) throughout. Useful for debugging. Nonexperts use 1.0

harris 
Fortran_Bool 
.false. 
harris

 Default = .false. Do not set to true unless you know what you are doing.

immediate_reset 
Fortran_Bool 
.true. 
immediate_reset


margin 
Float 
0.05 
margin

 Obsolete. Fraction of T3E batch job used for finishing up.

margin_cpu_time 
Float 
300.0 
margin_cpu_time

 Time (in seconds) before avail_cpu_time at which finalisation triggered. May need to set this quite large for large problems to make certain the run finishes cleanly.

neo_test 
Fortran_Bool 
.false. 
neo_test

 If true, GS2 exits after writing out neoclassical quantities of interest.

nstep 
Integer 

nstep

 Number of timesteps that will be taken, unless the code stops for some (usually userspecified) reason.

secondary 
Fortran_Bool 
.false.,.true. 
secondary

 Default = .false. Do not set to true unless you know what you are doing.

tertiary 
Fortran_Bool 
.false. 
tertiary

 Default = .false. Do not set to true unless you know what you are doing.

trinity_linear_fluxes 
Fortran_Bool 
.false. 
trinity_linear_fluxes

 If true and running linearly, return linear diffusive flux estimates to Trinity.

wstar_units 
String 
.false. 
wstar_units

 Default = .false. Make the timestep proportional to $ k_y \rho $. This can be useful for linear stability calculations that have a wide range of $ k_y $ values. Do not set to true for nonlinear runs. Be aware that the units of some output quantities can change when wstar_units = .true.

reinit_knobs
Name 
Type 
Def 
CR Name 
Description

abort_rapid_time_step_change 
Fortran_Bool 
.true. 
abort_rapid_time_step_change

 If true (default), exit if time step changes rapidly, that is, if the time step changes at four consecutive time steps.

delt_adj 
Float 
2.0 
delt_adj

 When the time step needs to be changed it is adjusted by this factor (i.e dt>dt/delt_adj or dt>dt*delt_adj when reducing/increasing the timestep).
 For implicit nonlinear runs good choice of delt_adj can make a moderate difference to efficiency. Need to balance time taken to reinitialise against frequency of time step adjustments (i.e. if your run takes a long time to initialise you probably want to set delt_adj to be reasonably large).

delt_cushion 
Float 
1.5 
delt_cushion

 Used in deciding when to increase the time step to help prevent oscillations in time step around some value. We only increase the time step when it is less than the scaled cfl estimate divided by delt_adj*delt_cushion (whilst we decrease it as soon as the time step is larger than the scaled cfl estimate).

delt_minimum 
Float 
1.0e05 
delt_minimum

 The minimum time step allowed is delt_minimum. If the code wants to drop below this value then the run will end.

in_memory 
Fortran_Bool 
.false. 
in_memory

 If true then attempts to create temporary copies of the dist fn and fields in memory to be restored after the time step reset rather than dumping to fields.
 This could be faster on machines with slow file systems.
 If the required memory allocation fails then we set `in_memory=.false.` and fall back to the traditional file based approach.

layouts_knobs
Name 
Type 
Def 
CR Name 
Description

fft_measure_plan 
Fortran_Bool 
.true. 
fft_measure_plan

 When set to true fft will use timing data during plan creation to select optimal settings. When false it will fall back to a simple heuristic estimate.

fft_use_wisdom 
Fortran_Bool 

fft_use_wisdom


fft_wisdom_file 
String 

fft_wisdom_file


gf_local_fields 
Fortran_Bool 
.false. 
gf_local_fields

 Enable the creation and setup of gf_lo data decomposition. This is required if using field_option = 'gf_local' in fields_knobs.

intmom_sub 
Fortran_Bool 
.false. 
intmom_sub

 When set to true we will use subcommunicators to do the reduction associated with calculating moments of the dist. fn. These subcommunicators involve all procs with a given XYS block.
 This is particularly advantageous for collisional runs which don't use LE layouts.
 PLEASE NOTE: These changes only effect calls to integrate_moments with complex variables and where the optional 'all' parameter is supplied. There is no gather of data from other procs so the integration result is only known for the local XYS block. This could cause a problem for diagnostics which want to write the full array if they also pass "all" (see [1])

intspec_sub 
Fortran_Bool 
.false. 
intspec_sub

 When set to true we will use subcommunicators to do the reduction associated with calculating species integrated moments of the dist. fn. These subcommunicators involve all procs with a given XY block.
 This should help improve the field update scaling.
 PLEASE NOTE: Unlike intmom_sub we currently gather the results from other procs such that we are sure to have the whole array populated correctly.

layout 
String 
llayout,lxyes 
layout

 Determines the way the grids are laid out in memory. Rightmost is parallelised first.
 Can be 'yxles', 'lxyes', 'lyxes', 'lexys','xyles'
 Strongly affects performance on parallel computers
 In general avoid parallelizing over x. For this reason 'lxyes' is often a good choice.
 Depending on the type of run you are doing, and how many processors you are using, the optimal layout will vary.
 In nonlinear runs FFTs are taken in x and y, so keeping these as local as possible (i.e. keeping xy to the left in layout) will help these.
 In calculating collisions we need to take derivatives in l and e, hence keeping these as local as possible will help these.
 The best choice will vary depending on grid sizes generally for linear runs with collisions 'lexys' is a good choice whilst for nonlinear runs (with or without collisions) 'xyles' (or similar) is usually fastest.

local_field_solve 
String 
.false. 
local_field_solve

 Strongly affects initialization time on some parallel computers.
 Recommendation: Use T on computers with slow communication networks.
 It's probably worth trying changing this on your favourite machine to see how much difference it makes for you.

max_unbalanced_xxf 
Float 
0.0,1.0 
max_unbalanced_xxf


max_unbalanced_yxf 
Float 
0.0,1.0 
max_unbalanced_yxf


opt_local_copy 
Fortran_Bool 
.false. 
opt_local_copy

 Setting to .true. enables optimising redistribute code, used in FFTs for evaluating nonlinear terms, that avoids indirect addressing.
This can introduces worthwhile savings in nonlinear GS2 simulations at lower core counts.

opt_redist_init 
Fortran_Bool 
.false. 
opt_redist_init

 Set to true to use optimised initialisation routines for creating redist objects. This should be beneficial for all but the smallest number of processors.

opt_redist_nbk 
Fortran_Bool 
.false. 
opt_redist_nbk

 Set to true to use nonblocking comms in the redistribute routines.

opt_redist_persist 
Fortran_Bool 
.false. 
opt_redist_persist

 Set to true to use persistent (nonblocking) comms in the redistribute routines.
 Must also set opt_redist_nbk=.true.
 Can help improve scaling efficiency at large core counts, but can cause slow down at low core counts.

opt_redist_persist_overlap 
Fortran_Bool 
.false. 
opt_redist_persist_overlap

 Set to true to try to overlap the mpi and local parts of the gather/scatter routines.
 Should only be used with opt_redist_persist=.true.
 See Optimising your runs for more details.

unbalanced_xxf 
Fortran_Bool 
.false. 
unbalanced_xxf

 Setting to .true. allows GS2 to adopt a more flexible domain decomposition of the xxf data type (used in nonlinear FFTs).
 By default GS2 allocates each MPI task with the same uniform blocksize in xxf_lo, one task may have a smaller block of data, and other tasks may be empty. There is no attempt to keep both x and y as local as possible, and sometimes large MPI data transfers are required to map from xxf to yxf and viceversa during FFTs.
 With "unbalanced_xxf = .true.", two slightly different blocksizes are chosen in order to keep both x and y as local as possible, and avoid this potentially large MPI communication overhead. The level of imbalance is limited by max_unbalanced_xxf.
 See Adrian Jackson's DCSE report "Improved Data Distribution Routines for Gyrokinetic Plasma Simulations"

unbalanced_yxf 
Fortran_Bool 
.false. 
unbalanced_yxf

 Setting to .true. allows GS2 to adopt a more flexible domain decomposition of the yxf data type (used in nonlinear FFTs).
 By default GS2 allocates each MPI task with the same uniform blocksize in yxf_lo, one task may have a smaller block of data, and other tasks may be empty. There is no attempt to keep both x and y as local as possible, and sometimes large MPI data transfers are required to map from xxf to yxf and viceversa during FFTs.
 With "unbalanced_yxf = .true.", two slightly different blocksizes are chosen in order to keep both x and y as local as possible, and avoid this potentially large MPI communication overhead. The level of imbalance is limited by max_unbalanced_yxf.
 See Adrian Jackson's DCSE report "Improved Data Distribution Routines for Gyrokinetic Plasma Simulations"

collisions_knobs
Name 
Type 
Def 
CR Name 
Description

adjust 
Fortran_Bool 
.true. 
adjust

 If adjust is .true., transform from the gyroaveraged dist. fn., g, to the nonBoltzmann part of delta f, h, when applying the collision operator

cfac 
Float 
0.0,1.0 
cfac

 Factor multiplying FLR terms in collision operator. 1.0 by default. Set to 0.0 to turn off FLR corrections.

collision_model 
String 
default 
collision_model

 Collision model used in the simulation.
 default = pitch angle scattering and energy diffusion
 collisionless,none = collisionless
 lorentz = pitch angle scattering only
 ediffuse = energy diffusion only
 krook = use home made krook operator (no reason to use this!)

conservative 
Fortran_Bool 
.true. 
conservative

 Set to .true. to guarantee exact conservation properties.

conserve_moments 
Fortran_Bool 
.true. 
conserve_moments

 Set to .true. to guarantee collision operator conserves momentum and energy.

const_v 
Fortran_Bool 
.false. 
const_v


ediff_scheme 
String 
default 
ediff_scheme


ei_coll_only 
Fortran_Bool 
.false. 
ei_coll_only


etol 
Float 
0.02 
etol


etola 
Float 
0.02 
etola


ewindow 
Float 
0.01 
ewindow


ewindowa 
Float 
0.01 
ewindowa


heating 
Fortran_Bool 
.false. 
heating

 Set to .true. to compute collisional heating.

hypermult 
Fortran_Bool 
.false. 
hypermult


lorentz_scheme 
String 
default 
lorentz_scheme


ncheck 
Integer 
10,100 
ncheck


resistivity 
Fortran_Bool 
.true. 
resistivity


special_wfb_lorentz 
Fortran_Bool 
.true. 
special_wfb_lorentz

 If true (the default) then the wfb is treated in a special way in the lorentz collision operator. This is the standard behaviour. Setting to false has been seen to help an issue in linear flux tube simulations in which the zonal modes at large kx grow rapidly.

test 
Fortran_Bool 
.false. 
test_collisions


use_le_layout 
Fortran_Bool 
.true. 
use_le_layout

 Use more efficient layouts for le grid

vary_vnew 
Fortran_Bool 
.false. 
vary_vnew


vnfac 
Float 
1.1 
vnfac


vnslow 
Float 
0.9 
vnslow


hyper_knobs
Name 
Type 
Def 
CR Name 
Description

const_amp 
String 
.false. 
const_amp

 Determines whether hyperviscosity includes time dependent amplitude factor when calculating damping rate. Recommend TRUE for linear runs and FALSE for nolinear runs, since amplutide of turbulence grows linearly with time in linear run.

d_hyper 
Float 

d_hyper


d_hyperres 
Float 

d_hyperres


d_hypervisc 
Float 

d_hypervisc

 Sets hyperviscosity parameter multiplying damping term. See Belli (2006) thesis for more information.

damp_zonal_only 
Fortran_Bool 
.false. 
damp_zonal_only


gridnorm 
Fortran_Bool 
.true. 
gridnorm


hyper_option 
String 
default 
hyper_option

 Should be set to 'default','none','visc_only', 'res_only', or 'both'. 'default' and 'none' are identical.

include_kpar 
Fortran_Bool 
.false. 
include_kpar


isotropic_shear 
String 
.true. 
isotropic_shear


nexp 
Integer 
2 
nexp


omega_osc 
Float 
0.4 
omega_osc


nonlinear_terms_knobs
Name 
Type 
Def 
CR Name 
Description

C_par 
Float 

c_par


C_perp 
Float 

c_perp


cfl 
Float 
0.1 
cfl

 The maximum delt < cfl * min(Delta_perp/v_perp)

flow_mode 
String 
default 
flow_mode


nl_forbid_force_zero 
Fortran_Bool 

nl_forbid_force_zero


nonlinear_mode 
String 
default 
nonlinear_mode

 Should the nonlinear terms be calculated?
 'none', 'default', 'off': Do not include nonlinear terms, i.e. run a linear calculation.
 'on' Include nonlinear terms.

p_x 
Float 
6.0 
p_x


p_y 
Float 
6.0 
p_y


p_z 
Float 
6.0 
p_z


zip 
Fortran_Bool 

zip

 Experts only (for secondary/tertiary calculations).

additional_linear_terms_knobs
Name 
Type 
Def 
CR Name 
Description

species_knobs
Name 
Type 
Def 
CR Name 
Description

nspec 
Integer 
2 
nspec

 Number of kinetic species evolved.

species_parameters
There should be a separate namelist for each species. For example, if
there are two species, there will be namelists called
species_parameters_1 and species_parameters_2. Charge, mass, density and temperature for each species are relative to some reference species.
Name 
Type 
Def 
CR Name 
Description

bess_fac 
Float 
1.0 
bess_fac

 Multiplies the argument of the Bessel function for this species. Useful for removing the effect of the Bessel functions (set to 0.0)

dens 
Float 
1.0 
dens


dens0 
Float 
1.0 
dens0


fprim 
Float 
2.2 
fprim

 Normalised inverse density gradient: $ 1/n (dn/d\rho) $ (Note here $ \rho $ is the normalised radius $ \rho/L_{ref} $)

gamma_ae 
Float 

gamma_ae

 Alpha electron collion rate. Normalisation chosen so that this parameter should be roughly the same as nu_ee.

gamma_ai 
Float 

gamma_ai

 Alpha ion collion rate. Normalisation chosen so that this parameter should be roughly the same as nu_ii.

mass 
Float 
1.0 
mass


nu 
Float 
1.0 
nu


nu_h 
Float 
0.0 
nu_h


nustar 
Float 
1.0 
nustar


source 
Float 
0.0 
source

 Sets the normalised source for alphas. If set negative will be automatically adjusted to give the specified alpha density.

sprim 
Float 

sprim

 Gradient of normalised source.

temp 
Float 
1.0 
temp


tpar0 
Float 
0.0 
tpar0


tperp0 
Float 
0.0 
tperp0


tprim 
Float 
6.9 
tprim

 Normalised inverse temperature gradient: $ 1/T (dT/d\rho) $ (Note here $ \rho $ is the normalised radius $ \rho/L_{ref} $)

type 
String 
default 
type

 Type of species:
 'ion' Thermal ion species
 'default' Same as 'ion'
 'electron' Thermal electron species
 'e' Same as 'electron'
 'beam' Slowing down distribution (Requires advanced_egrid = F)
 'slowing_down' Same as 'beam'
 'fast' Same as 'beam'
 'alpha' Same as 'beam'

u0 
Float 
1.0 
u0


uprim 
Float 
0.0 
uprim


uprim2 
Float 
0.0 
uprim2


vnewk 
Float 
0.0 
vnewk

 Collisionality parameter: For species $ s $, vnewk = $ \nu_{ss} L_{ref} / v_{ref} $ where $ L_{ref} $ is the reference length (halfminorradius at the elevation of the magnetic axis), $ v_{ref} = \sqrt{2 T_{ref} / m_{ref}} $ is the reference thermal speed (not the thermal speed of species $ s $!), $ \nu_{ss} = \frac{\sqrt{2} \pi n_s Z_s^4 e^4 \ln(\Lambda)}{\sqrt{m_s} T_s^{3/2}} $ is a dimensional collision frequency, $ e $ is the proton charge, $ \ln(\Lambda) $ is the Coloumb logarithm, and ($ Z_s, T_s, n_s, m_s $) are the (charge, temperature, density, mass) of species $ s $. (The dimensional collision frequency given here is in Gaussian units. For SI units, include an extra factor $ (4 \pi \epsilon_0)^2 $ in the denominator of the definition of $ \nu_{ss} $.)

z 
Float 
1 
z


dist_fn_species_knobs
Name 
Type 
Def 
CR Name 
Description

bakdif 
Float 
bakdif_out 
bakdif

 Spatial implicitness parameter. Any value greater than 0 adds numerical dissipation (usually necessary). bakdif=0 is 2cdorder spacecentered, bakdif=1.0 is fully upwinded.
 Recommended value for electrostatic runs: 0.05. For electromagnetic runs, bakdif should be 0.

bd_exp 
Integer 
bd_exp_out 
bd_exp


fexpi 
Float 
aimag(fexp_out) 
fexpi


fexpr 
Float 
real(fexp_out) 
fexpr

 Temporal implicitness parameter. Any value smaller than 0.5 adds numerical dissipation. fexpr=0.5 is 2cd order timecentered, fexpr=0 is fully implicit backward Euler, fexpr=1.0 is fully explicit forward Euler.

init_g_knobs
Name 
Type 
Def 
CR Name 
Description

a0 
Float 
0.0 
a0


adj_spec 
Integer 
0 
adj_spec


apar0 
Float 
0.0 
apar0


aparamp 
Complex 

aparamp

 Used in initialization for the OrszagTang 2D vortex problem

b0 
Float 
0.0 
b0


chop_side 
Fortran_Bool 
.true. 
chop_side

 Rarely needed. Forces asymmetry into initial condition. Warning: This does not behave as one may expect in flux tube simulations (see clean_init), this can be important as the default is to use chop_side.

clean_init 
Fortran_Bool 
.false. 
clean_init

 Used with ginit_option='noise'. Ensures that in flux tube simulations the connected boundary points are initialised to the same value. Also allows for chop_side to behave correctly in flux tube simulations.

den0 
Float 
1.0 
den0

 Parameters for setting up special initial conditions.

den1 
Float 
0.0 
den1

 Parameters for setting up special initial conditions.

den2 
Float 
0.0 
den2

 Parameters for setting up special initial conditions.

dphiinit 
Float 
1.0 
dphiinit


eq_mode_n 
Integer 
0 
eq_mode_n


eq_mode_u 
Integer 
1 
eq_mode_u


eq_type 
String 
sinusoidal 
eq_type


even 
Fortran_Bool 
.true. 
even

 Sometimes initial conditions have definite parity; this picks the parity in those cases.

force_single_kpar 
Fortran_Bool 

force_single_kpar

 When initialised with single parallel mode, sets other modes to zero at every time step.

ginit_option 
String 
default 
ginit_option

 Sets the way that the distribution function is initialized. There are many possible choices.
 'default' This gives a gaussian in theta (see width0)
 'noise' This is the recommended selection (but not the default). Pretty random.
 'test1'
 'xi'
 'xi2'
 'zero'
 'test3'
 'convect'
 'rh'
 'many' This is the option to read the (many) restart files written by a previous run. Use for restarts
 'small'
 'file'
 'cont'
 'kz0' initialise only with k_parallel=0
 'nl'
 'nl2'
 'nl3'
 'nl4'
 'nl5'
 'nl6'
 'gs'
 'kpar'
 'zonal_only' Restart but set all nonzonal components of the potential and the distribution function to 0. Noise can be added to these other components by setting iphiinit > 0.
 'single_parallel_mode' Initialise only with a single parallel mode specified by either ikpar_init for periodic boundary conditions or kpar_init for linked boundary conditions. Intended for linear calculations.
 'all_modes_equal' Initialise with every single parallel and perpendicular mode given the same amplitude. Intended for linear calculations.
 'eig_restart' Uses the restart files written by the eigensolver. Also see restart_eig_id.
 'stationary_mode' Initialises the distribution function such that it is a timeindependent solution to the gyrokinetic equation when collisions are neglected and only one mode (with aky = 0) is present. See Section 4 of the Analytic Geometry Specification documentation for more details.

ikk 
Integer 

ikk

 Used only for secondary/tertiary calculations.

ikkk 
Integer 

ikkk


ikpar_init 
Integer 
0 
ikpar_init


ikx_init 
Integer 
1 
ikx_init

 Only initialise a single kx with noise. This input parameter is used when noise is being initialised. If specified, i.e. if it is set greater than zero, noise will only be initialised for itheta0 = ikx_index, i.e. for the mode indexed by ikx_index. this is useful for linear runs with flow shear, to track the evolution of a single Lagrangian mode.

imfac 
Float 
0.0 
imfac


input_check_recon 
Fortran_Bool 
.false. 
input_check_recon


itt 
Integer 

itt

 Used only for secondary/tertiary calculations.

ittt 
Integer 

ittt


kpar_init 
Float 
0.0 
kpar_init


left 
Fortran_Bool 
.true. 
left

 Chop out left side in theta.

new_field_init 
Fortran_Bool 
.true. 
new_field_init


nkxy_pt 
Complex 
cmplx(0.,0.) 
nkxy_pt


null_apar 
Fortran_Bool 
.false. 
null_apar


null_bpar 
Fortran_Bool 
.false. 
null_bpar


null_phi 
Fortran_Bool 
.false. 
null_phi


phiamp 
Complex 

phiamp

 Used in initialization for the OrszagTang 2D vortex problem.

phifrac 
Float 
0.1 
phifrac


phiinit 
Float 
1.0 
phiinit

 Average amplitude of initial perturbation of each Fourier mode.

phiinit0 
Float 
0.0 
phiinit0


phiinit_rand 
Float 
0.0 
phiinit_rand

 Amplitude of random perturbation for ginit_recon3 (R Numata)

prof_width 
Float 
0.1 
prof_width


read_many 
Fortran_Bool 
.false. 
read_many

 Only applies if GS2 has been build with USE_PARALLEL_NETCDF=on. If .true., restart the old way from many restart files, if .false. use the new single restart file.

refac 
Float 
1.0 
refac


restart_dir 
String 
./,trim(restart_dir)//"/" 
restart_dir

 Directory in which to write/read restart files. Make sure this exists before running.

restart_eig_id 
Integer 

restart_eig_id

 Used to select with eigensolver generated restart file to load. Sets <id> in restart_file//eig_<id>//.<proc> string used to set filename. Note this is zero indexed.

restart_file 
String 
file,trim(restart_dir)//trim(restart_file),trim(restart_file(1:ind_slash))//trim(restart_dir)//trim(restart_file(ind_slash+1:)),trim(run_name)//".nc" 
restart_file

 Base of filenames with restart data.

scale 
Float 
1.0 
scale

 Allows rescaling of amplitudes for restarts.

tpar0 
Float 
0.0 
tpar0

 Parameters for setting up special initial conditions.

tpar1 
Float 
0.0 
tpar1

 Parameters for setting up special initial conditions.

tpar2 
Float 
0.0 
tpar2

 Parameters for setting up special initial conditions.

tperp0 
Float 
0.0 
tperp0

 Parameters for setting up special initial conditions.

tperp1 
Float 
0.0 
tperp1

 Parameters for setting up special initial conditions.

tperp2 
Float 
0.0 
tperp2

 Parameters for setting up special initial conditions.

tstart 
Float 
1.0,0.0 
tstart

 Force t=tstart at beginning of run.

ukxy_pt 
Complex 
cmplx(0.,0.) 
ukxy_pt


upar0 
Float 
0.0 
upar0

 Parameters for setting up special initial conditions.

upar1 
Float 
0.0 
upar1

 Parameters for setting up special initial conditions.

upar2 
Float 
0.0 
upar2

 Parameters for setting up special initial conditions.

width0 
Float 
3.5 
width0

 Initial perturbation has Gaussian envelope in theta, with width width0

zf_init 
Float 
1.0 
zf_init

 Amplitude of initial zonal flow perturbations relative to other modes

gs2_diagnostics_knobs
Controls what information is output by GS2 during and at the end of a simulation.
Name 
Type 
Def 
CR Name 
Description

conv_max_step 
Integer 
80000 
conv_max_step


conv_min_step 
Integer 
4000 
conv_min_step


conv_nstep_av 
Integer 
4000 
conv_nstep_av


conv_nsteps_converged 
Integer 
10000 
conv_nsteps_converged


conv_test_multiplier 
Float 

conv_test_multiplier


dump_check1 
Fortran_Bool 
.false. 
dump_check1

 Fieldline avg of Phi written to dump.check1

dump_check2 
Fortran_Bool 
.false. 
dump_check2

 Apar(kx, ky, igomega) written to dump.check2

dump_fields_periodically 
Fortran_Bool 
.false. 
dump_fields_periodically

 Phi, Apar, Bpar written to dump.fields.t=(time). This is expensive!

exit_when_converged 
Fortran_Bool 
.true. 
exit_when_converged

 When the frequencies for each k have converged, the run will stop.

file_safety_check 
Fortran_Bool 
.true. 
file_safety_check

 If .true. and either save_for_restart or save_distfn are true then checks that files can be created in restart_dir near the start of the simulation. This should probably be turned on by default after some "in the wild" testing.

igomega 
Integer 
0 
igomega

 Theta index at which frequencies are calculated.

make_movie 
Fortran_Bool 
.false. 
make_movie


navg 
Integer 
10,100 
navg

 Any time averages performed over navg timesteps.

nmovie 
Integer 
1000 
nmovie


nsave 
Integer 
1 
nsave

 Write restart files every nsave timesteps

nwrite 
Integer 
10,100 
nwrite

 Output diagnostic data every nwrite timesteps.

nwrite_mult 
Integer 
10 
nwrite_mult

 Multiplies nwrite to determine when large/expensive to calculate datasets such as the parallel correlation function are written to file.

ob_midplane 
Fortran_Bool 

ob_midplane

 If write_moments is true, then:
 if ob_midplane is true, then write the various velocity moments of the distribution function as functions of t ONLY at THETA=0 (and set write_full_moments_notgc = false),
 if ob_midplane is false, then write moments as functions of t at ALL THETA.

omegatinst 
Float 
1.0,1000000.0 
omegatinst

 If any growth rate is greater than omegatinst, assume there is a numerical instability and abort.

omegatol 
Float 
0.001 
omegatol

 In linear runs GS2 will exit if the growth rate has converged to an accuracy of one part in 1/omegatol. Set negative to switch off this feature.

print_flux_line 
Fortran_Bool 
.false. 
print_flux_line

 Instantaneous fluxes output to screen every nwrite timesteps

print_line 
Fortran_Bool 
.false.,.true. 
print_line

 Estimated frequencies and output to the screen/stdout every nwrite timesteps

save_distfn 
Fortran_Bool 
.false. 
save_distfn

 If true, saves the restart files with name 'rootname.nc.dfn.<proc>' with lots of extra detail about the dist function  velocity space grids and so on, when GS2 exits.

save_for_restart 
Fortran_Bool 
.false.,.true. 
save_for_restart

 If true then restart files written to the local folder and the simulation can be restarted from the point it ended.
 Restart files written to restart_file.PE#.
 Recommended for nonlinear runs.

save_many 
Fortran_Bool 
.false. 
save_many

 Only applies if GS2 has been build with USE_PARALLEL_NETCDF=on. If .true., save for restart the old way to many restart files, if .false. save the new single restart file.

use_nonlin_convergence 
Fortran_Bool 
.false. 
use_nonlin_convergence


write_apar_over_time 
Fortran_Bool 
.false. 
write_apar_over_time

 If this variable is set to true then the entire field A_parallel will be written to the NetCDF file every nwrite. This can cause the NetCDF file to be huge, if resolution is large or nwrite is small.

write_ascii 
Fortran_Bool 
.true. 
write_ascii

 If true, some data is written to runname.out
 Also controls the creation of a large number of ascii data files (such as <run_name>.fields). Many of the write_* settings in this namelist will only have an effect when write_ascii= .TRUE.

write_avg_moments 
Fortran_Bool 
.false. 
write_avg_moments

 Ignored unless grid_option='box'
 Flux surface averaged loworder moments of g written to runname.out.nc
 If (write_ascii = T) flux surface averaged loworder moments of g written to runname.moments

write_bpar_over_time 
Fortran_Bool 
.false. 
write_bpar_over_time

 If this variable is set to true then the entire field B_parallel will be written to the NetCDF file every nwrite. Useful for making films. This can cause the NetCDF file to be huge, if resolution is large or nwrite is small.

write_cerr 
Fortran_Bool 
.false. 
write_cerr


write_correlation 
Fortran_Bool 
.false.,.true. 
write_correlation

 Write correlation function diagnostic... shows parallel correlation as a function of ky. See arXiv 1104.4514.

write_correlation_extend 
Fortran_Bool 
.false. 
write_correlation_extend

 If used in conjunction with write_correlation, extends the length of $ \Delta \theta $ for which the correlation function is calculated.

write_cross_phase 
Fortran_Bool 
.false. 
write_cross_phase


write_eigenfunc 
Fortran_Bool 
.false. 
write_eigenfunc

 If (write_ascii = T) Normalized Phi(theta) written to runname.eigenfunc
 Write to runname.out.nc even if (write_ascii = F)

write_fields 
Fortran_Bool 
.false.,.true. 
write_fields

 Updates the phi, apar and bpar arrays in the netcdf output every nwrite steps. This is useful to allow the impatient to get an idea of the eigenfunction quality before the simulation ends without having to store the fields as a function of time.
 note : previously this flag triggered attempts to write phi, apar and bpar as a function of time. This behaviour is now available through the write_phi_over_time flags (and related for other fields).

write_final_antot 
Fortran_Bool 
.false. 
write_final_antot

 If (write_ascii = T) Sources for Maxwell eqns. written to runname.antot
 Write to runname.out.nc even if (write_ascii = F)

write_final_db 
Fortran_Bool 
.false. 
write_final_db


write_final_epar 
Fortran_Bool 
.false. 
write_final_epar

 If (write_ascii = T) E_parallel(theta) written to runname.eigenfunc
 Write to runname.out.nc even if (write_ascii = F)

write_final_fields 
Fortran_Bool 
.false. 
write_final_fields

 If (write_ascii = T) Phi(theta) written to runname.fields
 Write to runname.out.nc even if (write_ascii = F)

write_final_moments 
Fortran_Bool 
.false. 
write_final_moments

 If (write_ascii = T) loworder moments of g written to runname.moments and int dl/B averages of loworder moments of g written to runname.amoments
 Write to runname.out.nc even if (write_ascii = F)

write_flux_line 
Fortran_Bool 
.true. 
write_flux_line

 If (write_ascii = T) instantaneous fluxes output to runname.out every nwrite timesteps

write_full_moments_notgc 
Fortran_Bool 
.false. 
write_full_moments_notgc


write_g 
Fortran_Bool 
.false. 
write_g

 Write the distribution function to the '.dist' (NetCDF?)

write_gg 
Fortran_Bool 
.false. 
write_gg


write_gs 
Fortran_Bool 
.false. 
write_gs


write_gyx 
Fortran_Bool 
.false. 
write_gyx

 Write dist fn at a given physical spacial point to a file

write_hrate 
Fortran_Bool 
.false. 
write_hrate

 Write heating rate, collisonal entropy generation etc to '.heat'

write_kpar 
Fortran_Bool 
.false. 
write_kpar

 Spectrum in k_parallel calculated and written.

write_line 
Fortran_Bool 
.true. 
write_line

 If (write_ascii = T) write estimated frequencies and growth rates to the output file (usually runname.out) every nwrite steps.

write_lorentzian 
Fortran_Bool 
.false. 
write_lorentzian


write_lpoly 
Fortran_Bool 
.false. 
write_lpoly


write_max_verr 
Fortran_Bool 
.false. 
write_max_verr


write_moments 
Fortran_Bool 
.false.,.true. 
write_moments

 If true then we write the various velocity moments of the distribution function to the netcdf file every nwrite steps.

write_nl_flux 
Fortran_Bool 
.false. 
write_nl_flux

 Phi**2(kx,ky) written to runname.out

write_nl_flux_dist 
Fortran_Bool 
.false. 
write_nl_flux_dist

 Writes the poloidallydependent electrostatic turbulent fluxes of particles, parallel momentum, perpendicular momentum, and energy (i.e. the usual turbulent fluxes without the flux surface average) to the es_part_flux_dist, es_mom_flux_par_dist, es_mom_flux_perp_dist, and es_heat_flux_dist variables of the netCDF output file respectively. See Section 3 of the Analytic Geometry Specification documentation for more details.

write_omavg 
Fortran_Bool 
.false. 
write_omavg

 If (write_ascii = T) timeaveraged frequencies written to runname.out every nwrite timesteps.
 Average is over navg steps.
 Worth noting that setting this to true does not result in omegaavg being written to netcdf file (see write_omega).

write_omega 
Fortran_Bool 
.false.,.true. 
write_omega

 If (write_ascii = T) instantaneous omega to output file every nwrite timesteps. Very heavy output.
 If true writes omega to netcdf file every nwrite timesteps.
 Also writes out omegaavg (omega averaged over navg steps) to netcdf file no matter what the value of write_omavg is.

write_parity 
Fortran_Bool 
.false. 
write_parity

 Writes parities in dist fn and particle fluxes

write_pflux_sym 
Fortran_Bool 
.false. 
write_pflux_sym


write_pflux_tormom 
Fortran_Bool 
.false. 
write_pflux_tormom


write_phi_over_time 
Fortran_Bool 
.false. 
write_phi_over_time

 If this variable is set to true then the entire field Phi will be written to the NetCDF file every nwrite. Useful for making films. This can cause the NetCDF file to be huge, if resolution is large or nwrite is small.

write_symmetry 
Fortran_Bool 
.false. 
write_symmetry

 Switch on a diagnostic to test the symmetry properties of the GK eqn. It calculates the momentum flux as a function of vpar, theta, and time.

write_verr 
Fortran_Bool 
.false.,.true. 
write_verr

 Write velocity space diagnostics to '.lpc' and '.verr' files

testgridgen
driver
Name 
Type 
Def 
CR Name 
Description

amplitude 
Float 
0.0 
amplitude

 Amplitude of Langevin antenna.

ant_off 
Fortran_Bool 
.false. 
ant_off

 Overrides all and turns off antenna if true.

t0 
Float 
1.0,100.0 
driver_t0


nk_stir 
Integer 
1 
nk_stir

 Number of independent Fourier modes driven by antenna.

restarting 
Fortran_Bool 

restarting


w_antenna 
Complex 
1.0+0.0i 
w_antenna

 Frequency of Langevin antenna.

w_dot 
Float 
0.0 
w_dot


write_antenna 
Fortran_Bool 

write_antenna

 Write antenna amplitudes to ASCII file for debugging.

stir
Name 
Type 
Def 
CR Name 
Description

a 
Float 
1.0,0.0 
stir_a

 Initial amplitude of rightmoving component. It is not necessary to set a and b unless you are
doing restarts, which are rather clunky at the moment with the antenna included.

b 
Float 
1.0,0.0 
stir_b

 Initial amplitude of leftmoving component. It is not necessary to set a and b unless you are
doing restarts, which are rather clunky at the moment with the antenna included.

kx 
Integer 
1 
stir_kx


ky 
Integer 
1 
stir_ky


kz 
Integer 
1 
stir_kz


travel 
Fortran_Bool 
.true. 
stir_travel

 Launches traveling wave (or standing wave if F).

source_knobs
Name 
Type 
Def 
CR Name 
Description

gamma0 
Float 
0.0 
gamma0

 Growth rate of nonstandard source (if selected above).

omega0 
Float 
0.0 
omega0

 Frequency of nonstandard source (if selected above).

phi_ext 
Float 
0.0 
phi_ext

 Amplitude of external Phi added as source term.

source0 
Float 
1.0 
source0

 Amplitude of nonstandard source (if selected above).

source_option 
String 
default 
source_option


 'source_option_full' Solve GK equation in standard form (with no artificial sources)
 'default' Same as 'source_option_full'
 'zero' The GK distribution function will be advanced nonselfconsistently.
 'sine' The GK distribution function will be advanced nonselfconsistently.
 'cosine'The GK distribution function will be advanced nonselfconsistently.
 'test1' The GK distribution function will be advanced nonselfconsistently.
 'phiext_full' Solve GK equation with additional source proportional to phi_ext*F_0.
 'test2_full' Solve GK equation with additional developmental sources included. Experts only.
 'convect_full' Solve GK equation with additional developmental sources included. Experts only.
 'test1' The GK distribution function will be advanced nonselfconsistently.

t0 
Float 
1.0,100.0 
t0

 Turn on any artificial sources after time t0.

kt_grids_range_parameters
Name 
Type 
Def 
CR Name 
Description

akx_max 
Float 

akx_max

 Max kx for periodic finite kx ballooning space runs with $ \hat{s} $=0.

akx_min 
Float 
0.0 
akx_min

 Min kx for periodic finite kx ballooning space runs with $ \hat{s}=0 $.

aky_max 
Float 
1.0 
aky_max

 Upper limit of (ky rho) range. Should set to something other than zero.

aky_min 
Float 
0.0 
aky_min

 Lower limit of (ky rho) range. Should set to something other than zero.

kyspacing_option 
String 

kyspacing_option

 Sets the type of spacing between ky grid points, available options are :
 'default' : Same as 'linear'
 'exponential' : Evenly spaced in log(ky).
 'linear' : Evenly spaced in ky.

n0_max 
Integer 

n0_max

 Maximum toroidal mode number.
If n0_min > 0 then
if (mod(n0_maxn0_min,nn0).ne.0 .or. nn0 .eq. 1 .or. n0_min.ge.n0_max) then
set naky=1, aky_max=aky_min
else
set naky=nn0, aky_max=n0_max*drhodpsi*rhostar_range
endif

n0_min 
Integer 
0 
n0_min

 Minimum toroidal mode number.
if n0_min > 0 then
set aky_min=n0_min*drhodpsi*rhostar_range
endif

naky 
Integer 
1 
naky

 The number of 'actual' ky modes.

nn0 
Integer 
1 
nn0

 Number of toroidal modes, only used if n0_min>0. Overrides naky in kt_grids_range_parameters.

ntheta0 
Integer 
lntheta0,ntheta0_private,size(akx) 
ntheta0

 Number of theta_0 (kx) modes

rhostar_range 
Float 
0.0001 
rhostar_range


theta0_max 
Float 

theta0_max

 Upper limit of theta_0 range

theta0_min 
Float 
0.0 
theta0_min

 Lower limit of theta_0 range

kt_grids_specified_parameters
Name 
Type 
Def 
CR Name 
Description

naky 
Integer 
1 
naky

 Number of ky values evolved. Total number of modes evolved = max(naky, ntheta0). Also set up the appropriate number of kt_grids_specified_element_i namelists.

ntheta0 
Integer 
lntheta0,ntheta0_private,size(akx) 
ntheta0

 Number of theta0 values. Total number of modes evolved = max(naky, ntheta0). Also set up the appropriate number of kt_grids_specified_element_i namelists.

nx 
Integer 
0 
nx


ny 
Integer 
ny_private,yxf_lo%ny 
ny


kt_grids_specified_element
There should be a separate namelist for each Fourier mode. For example, if there are two modes, there will be namelists called kt_grids_specified_element_1 and kt_grids_specified_element_2.
Name 
Type 
Def 
CR Name 
Description

akx 
Float 
0.0 
akx


aky 
Float 
0.4 
aky


theta0 
Float 
0.0 
theta0


kt_grids_xbox_parameters
Name 
Type 
Def 
CR Name 
Description

gs2_flux_knobs
Name 
Type 
Def 
CR Name 
Description

flux_target
Name 
Type 
Def 
CR Name 
Description

parameter_scan_knobs
Name 
Type 
Def 
CR Name 
Description

delta_t_inc 
Float 
0.0 
delta_t_inc

 When the increment condition is 'delta_t', the parameter will be changed every time delta_t time has elapsed.

delta_t_init 
Float 
0.0 
delta_t_init

 When the increment condition is 'delta_t', the parameter will not be changed until delta_t_init time has elapsed from the beginning of the simulation. Note, that if the simulation is restarted, this parameter will measure from beginning of original simulation.

inc_con 
String 
delta_t 
inc_con

 Specifies the condition for incrementing the parameter. Possible values are:
 'n_timesteps'  change the parameter after a given number of time steps
 'delta_t'  change the parameter after an elapsed time
 'saturated'  change the parameter after the simulation has reached a saturated state (determined using the target parameter) at the current value of the parameter

nstep_inc 
Integer 
0 
nstep_inc

 When the increment condition is 'n_timesteps', the parameter will be changed every nstep_inc.

nstep_init 
Integer 
0 
nstep_init

 When the increment condition is 'n_timesteps' or 'saturated', the parameter will not be changed until nstep_init have elapsed from the beginning of the simulation. Note that if the simulation is restarted, this parameter will measure from the restart.

par_end 
Float 
0.0 
par_end

 If the scan is being run in 'range' mode, specifies the value of the parameter that will be reached.

par_inc 
Float 
0.0 
par_inc

 If the parameter scan is being run in 'range' or 'target' modes, specifies the amount by which the parameter is varied at one go.

par_start 
Float 
0.0 
par_start

 Specifies the starting value for the parameter scan.

scan_par 
String 
tprim 
scan_par

 Specify the parameter to be varied. If the parameter pertains to a species, the scan_spec must be specified as well.

scan_restarted 
Fortran_Bool 
.false. 
scan_restarted

 Must be set to true if the current value of the scan parameter must be read from the restart files. Otherwise, the scan will start from the beginning.

scan_spec 
Integer 
1 
scan_spec

 When parameter pertains to a species, specifies the index of the species.

scan_type 
String 
none 
scan_type

 Specifies the way that the parameter scan is conducted. Possible values are:
 'none'  do not conduct a parameter scan (default)
 'range'  vary parameter in constant increments between 2 values: par_start and par_end. The step size is given by par_inc.
 'target'  start with the parameter at par_start, and then change the parameter by par_inc until the target parameter has reached the target value
 'root_finding'  the same as target, but the increment is changed intelligently using a Newtonlike method.

target_par 
String 
hflux_tot 
target_par

 If the scan is being run in 'target' or 'root_finding' mode, specifies the target parameter.
 Possible values are 'hflux_tot', 'momflux_tot', 'phi2_tot'.

target_val 
Float 
0.0 
target_val

 If the scan is being run in 'target' or 'root_finding' mode, specifies the value to be targeted. The scan will complete when this target value is reached.

general_f0_parameters
Name 
Type 
Def 
CR Name 
Description

alpha_f0 
String 

alpha_f0

 The distribution function for alphas can be "maxwellian", or it can be "analytic" based on a formula generated for the Ti=Te case, or it can be "external", i.e. read from an external table.

beam_f0 
String 

beam_f0


energy_0 
Float 

energy_0

 Lower limit of the alpha distribution function for : F_alpha(energy_0)=0.

energy_min 
Float 

energy_min


main_ion_species 
Integer 

main_ion_species

 Select the main ion species which will be used to generate the analytical F0.

print_egrid 
Fortran_Bool 

print_egrid

 Diagnostic: when true print the energy grid and generalised temperature.

rescale_f0 
Fortran_Bool 

rescale_f0

 When reading the distribution function from an external table, rescale to a specified density if true.

diagnostics_config
This namelists controls the behaviour of the new diagnostics module (which can be enabled by setting USE_NEW_DIAG=on).
Name 
Type 
Def 
CR Name 
Description

conv_max_step 
Integer 

conv_max_step


conv_min_step 
Integer 

conv_min_step


conv_nstep_av 
Integer 

conv_nstep_av


conv_nsteps_converged 
Integer 

conv_nsteps_converged


conv_test_multiplier 
Float 

conv_test_multiplier


dump_fields_periodically 
Fortran_Bool 

dump_fields_periodically

 Phi, Apar, Bpar written to dump.fields.t=(time). This is expensive!

enable_parallel 
Fortran_Bool 

enable_parallel

 If built with parallel IO capability, enable it. There are currently issues with parallel IO on some systems which cause GS2 to hang. If you enable this parameter, test it on a smaller problem (but with at least two nodes) before using it on a prouction run. Bug reports welcome.

exit_when_converged 
Fortran_Bool 
.true. 
exit_when_converged

 If .true. when the frequencies for each k have converged, the run will stop.

igomega 
Integer 
0 
igomega

 Theta index at which frequencies are calculated.

navg 
Integer 
10,100 
navg

 Any time averages (for example growth rates and frequencies) performed over navg timesteps

ncheck 
Integer 

ncheck

 If vary_vnew, check to see whether to vary the collisionality every ncheck timesteps.

nwrite_large 
Integer 

nwrite_large


nwrite 
Integer 
10,100 
nwrite_new

 Diagnostic quantities are written every nwrite timesteps.

omegatinst 
Float 
1.0,1000000.0 
omegatinst

 If any growth rate is greater than omegatinst, assume there is a numerical instability and abort.

omegatol 
Float 
0.001 
omegatol

 In linear runs GS2 will exit if the growth rate has converged to an accuracy of one part in 1/omegatol. Set negative to switch off this feature.

print_flux_line 
Fortran_Bool 

print_flux_line

 Instantaneous fluxes output to screen every nwrite timesteps

print_line 
Fortran_Bool 

print_line

 Estimated frequencies and growth rates output to the screen/stdout every nwrite timesteps

save_distfn 
Fortran_Bool 

save_distfn

 If true, saves the restart files with name 'rootname.nc.dfn.<proc>' with lots of extra detail about the dist function  velocity space grids and so on, when GS2 exits.

save_for_restart 
Fortran_Bool 

save_for_restart

 If true then restart files written to the local folder and the simulation can be restarted from the point it ended.
 Restart files written to restart_file.PE#.
 Recommended for nonlinear runs.

serial_netcdf4 
Fortran_Bool 

serial_netcdf4


use_nonlin_convergence 
Fortran_Bool 

use_nonlin_convergence


write_any 
Fortran_Bool 
.true. 
write_any

 If .false. disables the new diagnostics module. No output is written.

write_apar_over_time 
Fortran_Bool 
.false. 
write_apar_over_time

 If this variable is set to true then the entire field apar will be written to the NetCDF file every nwrite. Useful for making films. This can cause the NetCDF file to be huge, if resolution is large or nwrite is small.

write_ascii 
Fortran_Bool 

write_ascii

 Controls the creation of a large number of ascii data files (such as <run_name>.new.fields). Many of diagnostics will write to ascii files as well as the netdf file if this flag is true.

write_bpar_over_time 
Fortran_Bool 
.false. 
write_bpar_over_time

 If this variable is set to true then the entire field bpar will be written to the NetCDF file every nwrite. Useful for making films. This can cause the NetCDF file to be huge, if resolution is large or nwrite is small.

write_cerr 
Fortran_Bool 

write_cerr


write_correlation 
Fortran_Bool 

write_correlation

 Write correlation function diagnostic... shows parallel correlation as a function of ky. See arXiv 1104.4514.

write_correlation_extend 
Fortran_Bool 

write_correlation_extend

 If used in conjunction with write_correlation, extends the length of $ \Delta \theta $ for which the correlation function is calculated.

write_cross_phase 
Fortran_Bool 

write_cross_phase

 Write cross phase between electron temperature and density.

write_density_over_time 
Fortran_Bool 

write_density_over_time

 Write nonadiabitic density as a function theta, ky, kx, species and time... very expensive!

write_eigenfunc 
Fortran_Bool 

write_eigenfunc

 If (write_ascii = T) Normalized Phi(theta) written to runname.eigenfunc
 Write to runname.out.nc even if (write_ascii = F)

write_fields 
Fortran_Bool 
.false.,.true. 
write_fields

 If .true. write out values of phi, apar and bpar.

write_final_antot 
Fortran_Bool 

write_final_antot

 If (write_ascii = T) Sources for Maxwell eqns. written to runname.antot
 Write to runname.out.nc even if (write_ascii = F)

write_final_db 
Fortran_Bool 

write_final_db


write_final_epar 
Fortran_Bool 

write_final_epar

 If (write_ascii = T) E_parallel(theta) written to runname.eigenfunc
 Write to runname.out.nc even if (write_ascii = F)

write_final_fields 
Fortran_Bool 

write_final_fields

 If (write_ascii = T) Phi(theta) written to runname.fields
 Write to runname.out.nc even if (write_ascii = F)

write_final_moments 
Fortran_Bool 

write_final_moments

 If (write_ascii = T) loworder moments of g written to runname.moments and int dl/B averages of loworder moments of g written to runname.amoments
 Write to runname.out.nc even if (write_ascii = F)

write_flux_line 
Fortran_Bool 

write_flux_line

 Instantaneous fluxes output to runname.new.out every nwrite timesteps (regardless of the value of write_ascii)

write_fluxes 
Fortran_Bool 
.true. 
write_fluxes

 If .true. write fluxes of heat, momentum & particles to the new netcdf file.

write_fluxes_by_mode 
Fortran_Bool 
.false. 
write_fluxes_by_mode

 If .true., write fluxes as a function of ky, kx, species and time (otherwise they will only be written out as functions of species, time and kx or ky). Creates large output files.

write_full_moments_notgc 
Fortran_Bool 

write_full_moments_notgc


write_g 
Fortran_Bool 

write_g

 Write the distribution function (in fourier space) at a fixed wavenumber to the '.dist' file

write_gs 
Fortran_Bool 

write_gs


write_gyx 
Fortran_Bool 

write_gyx

 Write dist fn (in real space) at a given physical spacial point to a file

write_heating 
Fortran_Bool 

write_heating

 Write multiple diagnostics of turbulent heating and free energy generation and dissipation.

write_jext 
Fortran_Bool 

write_jext

 Write the external current in the antenna if enabled.

write_kpar 
Fortran_Bool 

write_kpar

 Spectrum in k_parallel calculated and written. Only works for periodic boundary??

write_line 
Fortran_Bool 

write_line

 Write estimated frequencies and growth rates to the output file (usually runname.new.out) every nwrite steps (regardless of the value of write_ascii).

write_lorentzian 
Fortran_Bool 

write_lorentzian


write_lpoly 
Fortran_Bool 

write_lpoly

 computes and returns lagrange interpolating polynomial for g. Needs checking.

write_max_verr 
Fortran_Bool 

write_max_verr

 Write the spatial index corresponding to the maximum error in the velocity space integrals

write_moments 
Fortran_Bool 

write_moments

 If true then we write the various velocity moments (density, parallel flow, temperature) of the distribution function to the netcdf file every nwrite steps.

write_movie 
Fortran_Bool 

write_movie

 Write fields in real space as a function of time. Note this uses transform2 and so includes the aliased gridpoints in the real space dimensions. This means that there is 30% reduncancy in the output. Consider writing the fields in k space as a function of time and doing the Fourier transforms in post processing

write_ntot_over_time 
Fortran_Bool 

write_ntot_over_time

 Write total density as a function theta, ky, kx, species and time... very expensive!

write_omega 
Fortran_Bool 
.false.,.true. 
write_omega

 If true writes omega (both growth rate and frequency) to netcdf file every nwrite timesteps.
 Also writes out omegaavg (omega averaged over navg steps) to netcdf file.

write_parity 
Fortran_Bool 

write_parity

 Writes parities in dist fn and particle fluxes

write_phi_over_time 
Fortran_Bool 
.false. 
write_phi_over_time

 If this variable is set to true then the entire field phi will be written to the NetCDF file every nwrite. Useful for making films. This can cause the NetCDF file to be huge, if resolution is large or nwrite is small.

write_symmetry 
Fortran_Bool 

write_symmetry

 Switch on a diagnostic to test the symmetry properties of the GK eqn. It calculates the momentum flux as a function of vpar, theta, and time.

write_tperp_over_time 
Fortran_Bool 

write_tperp_over_time

 Write perpendicular temperature perturbation as a function theta, ky, kx, species and time... very expensive!

write_upar_over_time 
Fortran_Bool 

write_upar_over_time

 Write parallel flow perturbation as a function theta, ky, kx, species and time... very expensive!

write_verr 
Fortran_Bool 

write_verr

 Write velocity space diagnostics to netcdf file and (if write_ascii) '.new.lpc' and '.new.vres' files. Clear documentation of the outputs is given in the netcdf file.

eigval_knobs
Name 
Type 
Def 
CR Name 
Description

extraction_option 
String 
default 
extraction_option

 Sets the extraction technique, must be one of:
 'default' (use SLEPC default)
 'slepc_default' (use SLEPC default)
 'ritz'
 'harmonic'
 'harmonic_relative'
 'harmonic_right'
 'harmonic_largest'
 'refined'
 'refined_harmonic'

max_iter 
Integer 
PETSC_DECIDE 
max_iter

 Sets the maximum number of SLEPC iterations used.
 If not set (recommended) then let SLEPC decide what to use (varies with different options).

n_eig 
Integer 
1 
n_eig

 The number of eigenmodes to search for. number of modes found may be larger than this.

nadv 
Integer 

nadv

 How many GS2 timesteps to take each time SLEPc wants to advance the distribution function. Useful to separate closely spaced eigenvalues without changing delt.

save_restarts 
Fortran_Bool 

save_restarts

 If true then we save a set of restart files for each eigenmode found. These are named as standard restart file (i.e. influenced by the restart_file input), but have eig_<id> appended near end, where <id> is an integer representing the eigenmode id.
 If save_distfn of gs2_diagnostics_knobs is true then will also save the distribution function files.

solver_option 
String 
default 
solver_option

 Sets the type of solver to use, must be one of:
 'default' (KrylovSchur)
 'slepc_default' (KrylovSchur)
 'power'
 'subspace'
 'arnoldi'
 'lanczos'
 'krylov'
 'GD'
 'JD'
 'RQCG'
 'CISS'
 'lapack'
 'arpack'
 'blzpack'
 'trlan'
 'blopex'
 'primme'
 'feast'
 Not all solver types are compatible with other eigenvalue options, some options may not be supported in older SLEPC versions and some may require certain flags to be set when SLEPC is compiled.

targ_im 
Float 
0.5 
targ_im

 Imaginary part of the eigenvalue target
 Often beneficial to set this fairly large (e.g. 10)

targ_re 
Float 
0.5 
targ_re

 Real part of the eigenvalue target
 Often beneficial to set this fairly small (e.g. ~0)

tolerance 
Float 
1.0e06 
tolerance

 Sets tolerance on SLEPC eigenmode search.

transform_option 
String 
default 
transform_option

 Sets the type of spectral transform to be used. Must be one of
 'default' (let SLEPC decide)
 'slepc_default' (let SLEPC decide)
 'shell'
 'shift'
 'invert'
 'cayley'
 'fold'
 'precond' (not implemented)
 Not all options are available in all versions of the library.

use_ginit 
Fortran_Bool 
.false. 
use_ginit

 If true then provide an initial guess for the eigenmode based on using init_g routines to initialise g.
 Probably most useful with ginit_option='many' (etc.) to start an eigenvalue search from a previously obtained solution.

which_option 
String 
default 
which_option

 Sets SLEPC mode of operation (i.e. what sort of eigenvalues it looks for). Must be one of
 'default' (equivalent to 'target_magnitude')
 'slepc_default' (let SLEPC decide)
 'largest_magnitude'
 'smallest_magnitude'
 'largest_real'
 'smallest_real'
 'largest_imaginary'
 'smallest_imaginary'
 'target_magnitude' (complex eigenvalue magnitude closest to magnitude of target)
 'target_real'
 'target_imaginary'
 'all' (only some solver types, e.g. lapack)
 'user' (will use a user specified function to pick between eigenmodes, note not currently implemented)

ballstab_knobs
This namelist can be used to control how the ideal ballooning stability calculations are performed.
Name 
Type 
Def 
CR Name 
Description

make_salpha 
Fortran_Bool 
.false. 
make_salpha

 Doesn't currently do anything.

n_shat 
Integer 
1 
n_shat

 How many shat values should be used in salpha type scans

shat_min 
Float 
shat 
shat_min

 The minimum value of shat to use in scans

shat_max 
Float 
shat 
shat_max

 The maximum value of shat to use in scans

n_beta 
Integer 
1 
n_beta

 How many beta_prime values should be used in salpha type scans

beta_mul 
Float 
1.0 
beta_mul

 The maximum beta_prime in scans is beta_prime_equib*beta_mul

beta_div 
Float 
1.0 
beta_div

 The minimum beta_prime in scans is beta_prime_equib/beta_div

diff 
Float 
0. 
diff

 Numerical value, should usually by 0 or 1/3.
