Used to represent the input configuration of ballstab
Name  Type  Default  Description 

real 
1.0 
The minimum in scans is


real 
1.0 
The maximum in scans is


real 
0.0 
Controls decentring used in the numerical integration used for solving the ballooning equation. Recommended values are either 0 (default) or 1/3. 

logical 
.false. 
Not currently used for anything. TodoConsider removing this variable 

integer 
1 
How many values should be used in salpha type scans. 

integer 
1 
How many values should be used in salpha type scans. 

real 
0.0 
The maximum value of to use in salpha type scans. NoteThis gets a smart default of the equilibrium value of 

real 
0.0 
The minimum value of to use in salpha type scans. NoteThis gets a smart default of the equilibrium value of 

real 
0.0 
The theta0 value to use in solving the ideal ballooning problem. We don't currently provide a means to study multiple theta0 in a single run. This may change in the future. 
Used to represent the input configuration of collisions
Name  Type  Default  Description 

logical 
.true. 
If true (default) then transform from the gyroaveraged distribution function evolved by GS2 to the nonBoltzmann part of , (), when applying the collision operator. This is the physically appropriate choice, this parameter is primarily for numerical testing. 

real 
1.0 
Factor multipyling the finite Larmor radius terms in the
collision operator. This term is essentially just classical
diffusion. Set NoteDefault changed to 1.0 in order to include classical diffusion April 18 2006 

character(len = 20) 
'default' 
Selects the collision model used in the simulation. Can be one of
If no species have a nonzero collision frequency, 

logical 
.true. 
If true (default) then guarantee exact conservation properties. 

logical 
.true. 
If true (default) then forces conservation corrections to zero in the forbidden region to avoid introducing unphysical nonzero values for the distribution function in the forbidden region of trapped particles. TodoConfirm above documentation is accurate. NoteThe conserving terms calculated as part of the field particle collision operator should respect the forbidden of the distribution function for trapped particles. This is a cosmetic change, but has the result that plots of the distribution function for trapped particles makes sense. Note that terms involving vpa do not need to be modified Because vpa = 0 in the forbidden region because of this explicit forbid statements have not been added to the drag term involving apar. 

logical 
.true. 
If true (default) then guarantee collision operator conserves momentum and energy. TodoClarify the difference with conservative. NoteDefault changed to reflect improved momentum and energy conversation 07/08 

logical 
.false. 
If true (not the default) then use the thermal velocity to evaluate the collision frequencies to be used. This results in an energy independent collision frequency being used for all species. 

character(len = 20) 
'default' 
Controls how the coefficients in the matrix representing the energy diffusion operator are obtained. Can be one of
TodoConsider deprecating/removing the 

logical 
.false. 
If true (not the default) then force the collision frequency used for all nonelectron species to zero and force all electronelectron terms to zero. 

real 
2.e2 
Only used in get_verr as a part of the adaptive collisionality algorithm. Sets the maximum relative error allowed, above which the collision frequency must be increased. TodoConfirm this is really to set the relative error limit. 

real 
2.e2 
Only used in get_verr as a part of the adaptive collisionality algorithm. Sets the maximum absolute error allowed, above which the collision frequency must be increased. TodoConfirm this is really to set the absolute error limit. 

real 
1.e2 
Only used in get_verr as a part of the adaptive collisionality algorithm. Sets an offset to apply to the relative error limit set by etol. This is used to provide hysteresis is the adaptive collisionality algorithm so to avoid adjusting the collision frequency up and down every step (similar to delt_cushion). TodoConfirm the above description. 

real 
1.e2 
Only used in get_verr as a part of the adaptive collisionality algorithm. Sets an offset to apply to the absolute error limit set by etola. This is used to provide hysteresis is the adaptive collisionality algorithm so to avoid adjusting the collision frequency up and down every step (similar to the delt_cushion). TodoConfirm the above description. 

logical 
.false. 
Currently we skip the application of the selected collision
operator for species with zero collision frequency and disable
collisions entirely if no species have nonzero collision
frequency. This is generally sensible, but it can be useful to
force the use of the collisional code path in some situations
such as in code testing. Setting this flag to 

logical 
.false. 
If true (not the default) then calculate collisional heating when applying the collion operator. This is purely a diagnostic calculation. It should not change the evolution. Todo: Verify this does not influence the evolution. 

logical 
.false. 
If true (not the default) then multiply the hyper collision frequency by the species' collision frequency nu_h. This only impacts the pitch angle scattering operator. NoteThe hyper collision frequency is only nonzero if any
species have a nonzero 

character(len = 20) 
'default' 
Controls how the coefficients in the matrix representing the pitch angle scattering operator are obtained. Can be one of
TodoConsider deprecating/removing the 

integer 
100 
Used as a part of the adaptive collisionality algorithm. When
active we check the velocity space error with get_verr
every WarningThe new diagnostics module currently ignores this
value and instead uses its own input variable named 

logical 
.true. 
If true (default) then potentially include the drag term in
the pitch angle scattering operator. This is a necessary but
not sufficient criteria. For the drag term to be included we
also require , more than one simulated species
and finite perturbations included in the simulation
(i.e. 

logical 
.false. 
If true (not the default) then use special handling for the wfb particle in the pitch angle scattering operator. NoteMRH changed default 16/08/2018. Previous default of true seemed to cause a numerical issue in flux tube simulations for the zonal modes at large . TodoImprove this documentation 

logical 
.false. 
If true (not the default) then remove the collision operator from the usual time advance algorithm. Instead the collision operator is only applied every timesteps_between_collisions timesteps. This can potentially substantially speed up collisional simulations, both in the initialisation and advance phases. WarningCurrently the input
timesteps_between_collisions is ignored
so collisions are applied every time step. The primary result
of 

logical 
.false. 
If true (not the default) then performs some additional checks of the data redistribution routines associated with transforming being the standard and collisional data decompositions. 

integer 
1 
Should set the number of timesteps between application of the collision operator if split_collisions is true. Currently this is ignored. WarningThis value is currently ignored. 

logical 
.true. 
If true (default) then use a data decomposition for collisions that brings both pitch angle and energy local to a processor. This is typically the most efficient option, however for collisional simulations that only use part of the collision operator (either energy diffusion or pitch angle scattering) then it may be beneficial to set this flag to false such that we use a decomposition that only brings either energy or pitch angle local. 

logical 
.false. 
Set to true (not the default) to activate the adaptive collisionality algorithm. TodoProvide more documentation on the adaptive collisionality algorithm. 

real 
1.1 
If the collisionality is to be increased as a part of the adaptive collisionality algorithm then increase it by this factor. 

real 
0.9 
If the collisionality is to be decreased as a part of the adaptive collisionality algorithm then decrease it by this factor. 

logical 
.true. 
Controls how the duplicate TodoConsider removing this option. 
Used to represent the input configuration of dist_fn
Name  Type  Default  Description 

character(len = 30) 
'default' 
The form of the adiabatic response (if a species is being modeled as adiabatic). Ignored if there are electrons in the species list.
TodoRemove 'iphi00=3' 

real 
0.0 
For debugging only. TodoImprove documentation 

real 
1.0 
Leave as unity. For debugging. TodoImprove documentation 

logical 
.false. 
If true then attempt to enforce gnew == 0 at a half grid point past the end of the grid rather than on the last grid point. This is an experimental feature which has been seen to help suppress grid scale oscillations near the boundary. 

character(len = 20) 
'default' 
Sets the boundary condition along the field line (i.e. the boundary conditions at in fluxtube simulations or in ballooning space). Possible values are:
See also nonad_zero 

real 
0.0 
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. 

logical 
.false. 
True only allows solutions of single parity as determined by the input even. 

real 
1.0 
Leave as unity for physical runs can be used for debugging. Multiplies the passing particle drifts (also see tpdriftknob). 

logical 
.false. 
If 

logical 
.true. 
If 

logical 
.false. 
If true then attempt to enforce an exponential decay boundary condition on gnew or hnew (depending on nonad_zero). Decay rate scaled by exponential_boundary_factor 

real 
1.0 
Factor scaling the exponential decay boundary condition 

real 
0.0 
where is toroidal angular velocity normalised to the reference frequency and is the normalised flux label which has value on the local surface. 

real 
0.0 
With flow shear in single mode, constrains relative error in TodoAdd more documentation 

real 
1 
Flow shear switched on when simulation time exceeds this time. 

integer 
1 
Flow shear switched on when simulation timestep exceeds this timestep. 

real 
1.0 
Multiplies 

logical 
.false. 
Perform velocity space integration using TodoConsider if this should be a field input. 

real 
1.0 
Affects boundary condition at end of theta grid. Recommended value: 1. _ NoteThis used to default to 5.e4 TodoImprove documentation 

logical 
.true. 
Determines if we include the hyperviscosity term during the initialisation of the response matrix or not. 

logical 
.false. 
Set up lowflow term 

logical 
.true. 
Treatment of radial variation of temperature in NEO energy variable:


real 
0.0 
Number multiplying the coriolis drift. TodoExpand documentation 

logical 
.false. 
Allow different species to have different values of NoteThe restriction to 

logical 
.true. 
If true switches on "new" parallel boundary condition where h=0 at incoming boundary instead of g=0. This is considered the correct boundary condition but old behaviour retained for experimentation. 

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

logical 
.false. 
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 at least 1025% savings for linear electrostatic
collisionless simulations. For more complicated runs the
savings may be less. If enabled memory usage will
increase due to using an additional array of size 24 times


real 
0.0 
If nonzero, quasineutrality is not enforced,


logical 
.false. 
Determines if we set gnew = 0 (if flag is false) or gnew = g in invert_rhs_1 or not. This is currently considered experimental, but the intention is to change the default to true. 

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

real 
1.0 
For debugging only. Scales the calculated vparallel. NoteIf set to zero then the homogeneous contribution, 

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

character(len = 20) 
'unset' 
Deprecated option, moved to le_grids. Setting will lead to an error message and abort. To be removed entirely in future release 

logical 
.false. 
If true then force 
Used to represent the input configuration of dist_fn_species. There should be one of this namelist for each species simulated.
Name  Type  Default  Description 

real 
0.0 
Spatial implicitness parameter. Any value greater than 0 adds
numerical dissipation which is often necessary to avoid grid
scale oscillations. When WarningIt is possible to have different values for the different species simulated, but in a number of places we only use the value given by the first species. It is strongly recommended to use the same value for all species. TodoClarify the motivation for the electromagnetic recommendation. TodoConsider forcing this to be constant across all species. TodoConsider changing the default to the recommended value. 

real 
0.0 
Sets the imaginary part of the temporal implicitness parameter. It is considered an error for this to be nonzero. TodoConsider removing this variable as it should always be zero. Is this used for numerical testing? 

real 
0.4 
Sets the real part of the temporal implicitness parameter. Any
value smaller than 0.5 adds numerical dissipation. When TodoConsider changing the default to the recommended value. 
Used to represent the input configuration of driver. See the documentation of the antenna module for more details.
Name  Type  Default  Description 

real 
0.0 
Amplitude of Langevin antenna. 

logical 
.false. 
Overrides all other options and turns off antenna if 

integer 
1 
Number of independent Fourier modes driven by antenna. 

logical 
.false. 
If 

real 
1.0 
Sets the time at which the antenna frequency changes from
constant w_antenna to linearly varying, with linear piece
proprtional to w_dot multiplied by 

complex 
(1.0, 0.0) 
Frequency of Langevin antenna. Sets the constant part of the complex antenna frequency. 

real 
0.0 
Sets the coefficient in front of the time varying antenna
frequency (real) component activated when 

logical 
.false. 
Write antenna amplitudes to ASCII file for debugging. 
Used to represent the input configuration of eigval. Several of these options are controlling SLEPc settings, which can also be set using the SLEPc command line flags.
Name  Type  Default  Description 

logical 
.false. 
Determines which operator SLEPc is finding eigenvalues of. If
.false. then SLEPc analyses the time advance operator, so
internally works with the eigenvalue 

character(len = 20) 
'default' 
Sets the extraction technique, must be one of:


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

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

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

logical 
.false. 
If 

character(len = 20) 
'default' 
Sets the type of solver to use, must be one of:
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. 

real 
0.5 
Imaginary part of the eigenvalue target. Often beneficial to
set this fairly large (e.g. 10) when looking for unstable
modes. Used with the 

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

real 
1.0d6 
Sets tolerance on SLEPC eigenmode search. Used to determine when an eigenmode has been found. Note this is the tolerance based on the SLEPc eigenvalue, which is the time advance eigenvalue rather than the GS2 eigenvalue, . 

character(len = 20) 
'default' 
Sets the type of spectral transform to be used. This can help extract interior eigenvalues. Must be one of
Not all options are available in all versions of the library. 

logical 
.false. 
If 

character(len = 20) 
'default' 
Sets SLEPC mode of operation (i.e. what sort of eigenvalues it
looks for). Note that this refers to the SLEPc eigenvalue,
i.e. the time advance eigenvalue
. In other
words one should select

Used to represent the input configuration of fields
Name  Type  Default  Description 

logical 
.false. 
Used with 

logical 
.false. 
Writes files containing the field response matrix after
initialisation. This currently works for


logical 
.false. 
Set to true to use an allreduce (on 

logical 
.false. 
Set to 

logical 
.false. 
If 

logical 
.false. 
Set to 

character(len = 20) 
'default' 
The


logical 
.false. 
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


logical 
.true. 
If TodoConsider if this should this go into the reinit namelist. 

integer 
16 
Used with 

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

logical 
.false. 
Delete zonal flows at every timestep. 

character(len = 256) 
'' 
Sets location in which to store/look for response dump files. 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. 

character(len = 256) 
'' 
Allows customisation of the base filename to be used for
response files. If not set then we use 
Used to represent the input configuration of gs2_diagnostics. This is the version used by the original diagnostics module.
Name  Type  Default  Description 

logical 
.false. 
Append output data to a previous output file 

integer 
80000 
Used for Trinity nonlinear convergence check (use_nonlin_convergence). The maximum number of time steps, after which consider the run converged regardless. 

integer 
4000 
Used for the Trinity nonlinear convergence check (use_nonlin_convergence). The minimum number of time steps before convergence condition can trigger an exit. 

integer 
4000 
Used for the Trinity nonlinear convergence check (use_nonlin_convergence). The number of timesteps the convergence condition averages over 

integer 
10000 
Used for the Trinity nonlinear convergence check (use_nonlin_convergence). The number of steps where convergence is true before convergence is accepted 

real 
4e1 
Used for the Trinity nonlinear convergence check (use_nonlin_convergence). Multiplier for the cumulative average of the heat flux 

logical 
.false. 
Write out the fieldline average of to WarningYou probably don't want this? WarningNonfunctional in new diagnostics 

logical 
.false. 
Write out at WarningYou probably don't want this? WarningNonfunctional in new diagnostics 

logical 
.false. 
Write out to WarningYou probably don't want this? Expensive. 

logical 
.false. 
Enable parallel IO in the .out.nc file. Currently disabled by default and doesn't activate feature when set to true as we hard code that parallel IO isn't supported for the .out.nc file. WarningOnly in new diagnostics 

logical 
.true. 
Exit when the run has reached convergence 

logical 
.true. 
Verify that the restart file(s) can be written before starting the run 

integer 
0 
Index in to measure various diagnostics at. By default, this is the outboard midplane , but it may be useful to set this to a nonzero value for tearing parity modes. 

logical 
.false. 
Write out in real space over time, suitable for creating animations. Timestep period is controlled with nmovie WarningThis option can write a lot of data! Consider doing the Fourier transforms of the fields in postprocessing instead. WarningIn new diagnostics, the timestep period is controlled with nwrite 

integer 
10 
Number of timesteps to average over for timeaveraged diagnostics WarningDefault value differs between old (100) and new (10) diagnostics 

integer 
10 
Sets the number of output steps between syncing the netcdf file. Higher values may reduce disk overheads but increase the risk of data loss on unclean exit. 

integer 
10 
FIXME: Timestep period of which to check velocity space resolution and correction by varying collisionality. But doesn't happen on timesteps when diagnostics are written. WarningOnly in new diagnostics WarningThis value "shadows" the 

integer 
1 
Timestep period to write real space fields WarningNonfunctional in new diagnostics. Instead use nwrite WarningDefault value differs between old (1000) and new (1) diagnostics 

integer 
1 
Timestep period for writing restart data if
save_for_restart is 

integer 
10 
Timestep period for writing outputs WarningDefault value differs between old ( 

integer 
10 
Timestep period multiplier for certain "large" diagnostics, which are
written every FIXME: What datasets? WarningControls different diagnostics in new diagnostics 

logical 
.false. 
If WarningNonfunctional in new diagnostics WarningDefault value differs between old (.true.) and new (.false.) diagnostics 

real 
1.0e6 
Threshold complex frequency () for detecting a numerical
instability. If averaged over
navg timesteps is greater than WarningDefault value differs between old (1.0) and new (1.0e6) diagnostics 

real 
1e3 
Frequency () convergence tolerance. Consider the simulation
converged and finish the run if has changed by less than
More explicitly, the convergence criterion is:
where is averaged over the last 

logical 
.false. 
Print the instantaneous fluxes to screen/stdout every nwrite timesteps 

logical 
.false. 
Print estimated frequencies and growth rates to screen/stdout every nwrite timesteps WarningDefault value differs between old ( 

logical 
.false. 
Write the distribution function to 

logical 
.false. 
Write restart files at the end of the simulation. If
nsave is positive, then also enable
checkpoints by writing restart files every 

logical 
.false. 
Save some layout and distribution information in restart files 

logical 
.false. 
If If If 

logical 
.false. 
Save parallel and perpendicular velocities in final restart and/or distribution function files 

logical 
.false. 
WarningNot used WarningOnly in new diagnostics 

logical 
.false. 
For nonlinear runs, stop the run when the averaged differential of the summed averaged heat flux drops below a threshold for a period of time, controlled by conv_test_multiplier, conv_nsteps_converged, gs2_diagnostics_knobs, conv_max_step, and conv_min_step. 

logical 
.true. 
If WarningOnly in new diagnostics WarningThis also turns off checking the linear convergence 

logical 
.false. 
Write the entire field every nwrite timesteps WarningNew diagnostics requires
write_fields to also be 

logical 
.true. 
Write diagnostics to text files. Generally this creates a different text file for each diagnostic. Note that this independent of whether or not netCDF files are used. FIXME: Verify old and new diagnostics write these files in same format 

logical 
.false. 
Write flux surface averaged loworder moments of every nwrite timesteps WarningPrints a warning that this is ignored unless


logical 
.false. 
Write the entire field every nwrite timesteps WarningNew diagnostics requires
write_fields to also be 

logical 
.false. 
Write the collision error every nwrite
timesteps to text file with suffix FIXME: What does this mean? WarningIn new diagnostics, only writes to ascii WarningThis is expensive 

logical 
.false. 
Write collisional heating (collisional and hyper viscous rate of loss of free energy for each mode) every nwrite timesteps WarningOnly in new diagnostics 

logical 
.true. 
Write two point parallel correlation function calculated from the electric potential as a function of and parallel separation every nwrite timesteps WarningDefault value differs between old ( 

logical 
.false. 
Write two point parallel correlation function calculated from the electric potential as a function of and parallel separation, time averaged and calculated along the extended domain every nwrite timesteps once istep > nstep/4. WarningThis diagnostic can have large persistent memory cost. 

logical 
.false. 
Write the cross phase between electron density and perpendicular electron temperature every nwrite timesteps. Calculated at both the outboard midplane, averaged across and ; and averaged across all space WarningIn old diagnostics, only written to text files 

logical 
.false. 
Write the whole nonadiabatic part of the density moment every nwrite timesteps WarningRequires write_moments to also be
WarningOnly in new diagnostics 

logical 
.false. 
Write normalised to the value of at the outboard midplane every nwrite timesteps. If write_ascii is enabled, the text file is
NoteThe normalising factor for a given point may not be exactly at the outboard midplane if this value is zero there. If the adjacent point in is also zero, then the fields will be unnormalised at that . WarningIf this option is turned on, the same normalising factor will also be used for the text output in write_final_moments WarningIn old diagnostics, this is only done on exit, not every
WarningThe text output is normalised (see note above), but the netCDF output is not 

logical 
.true. 
Enable writing every nwrite timesteps WarningIn old diagnostics, this only writes them on exit and
write_phi_over_time,
write_apar_over_time and
write_bpar_over_time instead control writing
the fields over time, respectively. In new diagnostics, this will disable
writing all three fields if set to WarningDefault value differs between old ( 

logical 
.false. 
Write the righthand sides of the field equations at the final
timestep. If write_ascii is enabled, the file
suffix is WarningIn new diagnostics, this is not written to netCDF! 

logical 
.false. 
Write at the final timestep. If
write_ascii is enabled, the file suffix is
WarningIn new diagnostics, this is not written to netCDF! 

logical 
.false. 
Write at the final timestep. If
write_ascii is enabled, the file suffix is
WarningIn new diagnostics, this is not written to netCDF! 

logical 
.false. 
Write at the final timestep. If
write_ascii is enabled, the file suffix is
WarningIn new diagnostics, this is not written to netCDF! 

logical 
.false. 
Write various moments (densities, parallel and perpendicular
velocities and temperatures, and heat and momentum fluxes) at
the final timestep. If write_ascii
is enabled, the file suffix is WarningIf write_eigenfunc is enabled, then the same normalising factor is used for the final moments. Otherwise, the moments are unnormalised. WarningIn new diagnostics, this is not written to netCDF! WarningThe text output is normalised (see note above), but the netCDF output is not 

logical 
.false. 
Write instantaneous fluxes to output file every nwrite timesteps WarningOutput formats and quantities differ between old and new diagnostics 

logical 
.false. 
Write fluxes (heat, momentum and particle; total and perspecies) every nwrite timesteps. If run is nonlinear, this defaults to true WarningIn old diagnostics, this also turns on 

logical 
.false. 
Write fluxes (heat, momentum and particle; total and perspecies) as a function of Fourier mode every nwrite timesteps. If run is nonlinear, this defaults to true WarningIn old diagnostics, this is combined with 

logical 
.false. 
Write moments (density, parallel flow, and parallel and perpendicular temperatures) in nonguiding centre coordinates every nwrite timesteps 

logical 
.false. 
Write at WarningOnly to text files 

logical 
.false. 
FIXME: Add documentation WarningOnly outputs to text files 

logical 
.false. 
Write as a function of real space every
nmovie timesteps to text file
" WarningOnly to text files 

logical 
.false. 
Write out various heating, free energy and energy injection
diagnostics. Text file extension is 

logical 
.false. 
Write time averaged external current in the antenna,
, as a function of
. File suffix is WarningOnly in new diagnostics 

logical 
.false. 
Write the parallel spectrum of at final timestep. File suffix is WarningOutput only to text files 

logical 
.true. 
Print estimated frequencies and growth rates to text file every nwrite timesteps 

logical 
.false. 
Write FIXME: Define WarningOld diagnostics only writes to text files WarningNew diagnostics only writes to netCDF 

logical 
.false. 
Write the estimated maximum error from velocity space integrals for various quantities WarningOld diagnostics only outputs to text file 

logical 
.true. 
Write various moments (total and nonadiabatic part of perturbed species density, perturbed parallel flow, perturbed parallel and perpendicular temperatures, parallel heat flux, particule flux and heat flux) every nwrite timesteps WarningOnly outputs to netCDF files WarningNew diagnostics writes various averages of the moments. To get
the same output as old diagnostics, also set
write_ntot_over_time,
write_density_over_time,
write_upar_over_time,
write_tperp_over_time to WarningDefault value differs between old ( 

logical 
.false. 
Write the poloidal distributions of the fluxes of particles, parallel momentum, perpendicular momentum, and energy every nwrite timesteps. See section 3.1 and appendix A of Ball et al. PPCF 58 (2016) 045023 as well as section 5 of "GS2 analytic geometry specification" 

logical 
.false. 
Write the whole total density moment every nwrite timesteps WarningRequires write_moments to also be
WarningOnly in new diagnostics 

logical 
.true. 
Write timeaveraged growth rate and frequency to the output text file every nwrite timesteps. Time average is rolling window over the previous navg timesteps WarningNonfunctional in new diagnostics, timeaverage is also written with write_omega instead 

logical 
.true. 
Write instantaneous growth rate and frequency every nwrite timesteps WarningOld diagnostics only writes to output text file WarningNew diagnostics only writes to netCDF file WarningNew diagnostics also writes timeaverage with this option. Output is the complex frequency, rather than separate growth rate and real frequency 

logical 
.false. 
Write parities in distribution and particle fluxes to text file with the
suffix FIXME: Clarify what this means 

logical 
.false. 
Write particle flux density as a function of and velocity space every nwrite timesteps. Used for looking at the effect of asymmetry. See Parra et al POP 18 062501 2011 and ask JungPyo Lee WarningOnly outputs to netCDF WarningNonfunctional in new diagnostics, use write_symmetry instead 

logical 
.false. 
Write toroidal angular momentum flux carried by particle flux every
nwrite timesteps. Only calculated if WarningOnly outputs to netCDF WarningNonfunctional in new diagnostics 

logical 
.false. 
Write the entire field every nwrite timesteps WarningNew diagnostics requires
write_fields to also be 

logical 
.true. 
Write a simple quasilinear metric to netcdf. 

logical 
.false. 
Write the particle and momentum flux as a function of and velocity space. See write_pflux_sym and write_pflux_tormom WarningOnly outputs to netCDF WarningOld diagnostics does not write the particle flux, use write_pflux_sym instead 

logical 
.false. 
Write the whole perturbed perpendicular temperature moment every nwrite timesteps WarningRequires write_moments to also be
WarningOnly in new diagnostics 

logical 
.false. 
Write the whole perturbed parallel velocity moment every nwrite timesteps WarningRequires write_moments to also be
WarningOnly in new diagnostics 

logical 
.false. 
Write estimates of error resulting from velocity space integrals in the calculation of various quantities every nwrite timesteps. WarningOutput only to text file WarningNew diagnostics also writes to netCDF every ncheck timesteps, along with some other quantities such as collisionality WarningThis is expensive 

logical 
.false. 
Write the transfer of free energy, , as a function of , averaged over , every nwrite timesteps WarningOnly in new diagnostics 
Used to represent the input configuration of hyper
Name  Type  Default  Description 

logical 
.false. 
Determines whether hyperviscosity includes time dependent amplitude
factor when calculating damping rate. Recommend 

real 
10.0 
If 

real 
10. 
Used with the simple3D hyperviscosity model of the form D_hyper3D * (kperp/ max kperp)^P_hyper3D and ky_cut, kx_cut set max kperp 

real 
10.0 
Sets hyperresistivity parameter multiplying damping term. 

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

logical 
.false. 
If 

logical 
.true. 
If 

character(len = 9) 
'default' 
Selects the type of hyper terms included. Should be one of


logical 
.false. 
Not used. TodoRemove this variable. 

logical 
.true. 
if true damp zonal and drift waves with same dissipation formula 

logical 
.true. 
If 

real 
10. 
Used with the simple3D hyperviscosity model of the form D_hyper3D * (kperp/ max kperp)^P_hyper3D and ky_cut, kx_cut set max kperp 

real 
10. 
Used with the simple3D hyperviscosity model of the form D_hyper3D * (kperp/ max kperp)^P_hyper3D and ky_cut, kx_cut set max kperp 

integer 
2 
Sets the power to which is raised in the dissipation filter. 

real 
0.4 
Sets a parameter in the anisotropic shearing rate calculation. 

real 
4. 
Used with the simple3D hyperviscosity model of the form D_hyper3D * (kperp/ max kperp)^P_hyper3D and ky_cut, kx_cut set max kperp 
Used to represent the input configuration of ingen
Name  Type  Default  Description 

integer 
100000 
This sets the minimum number of local elements for which
processor recommendations will be given. In other words, if
the total number of elements is 

integer 
100000 
Sets the maximum processor count considered when calculating sweetspots. 

logical 
.false. 
If 

logical 
.true. 
If 
Used to represent the input configuration of init_g
Name  Type  Default  Description 

real 
0.0 
Amplitude of equilibrium 

integer 
0 
Used by ginit_option FIXME: What input parameter, what conditions? 

real 
0.0 
Used by ginit_option 

complex, dimension(6) 
cmplx(0.0,0.0) 
Used in initialization for the OrszagTang 2D vortex problem
(ginit_option 

real 
0.0 
Amplitude of equilibrium 

logical 
.true. 
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 

logical 
.true. 
Used with ginit_option 

logical 
.false. 
Use the constant_random number generator, which always gives the same random numbers. Useful for testing. 

real 
1.0 
Amplitude of zeroth density perturbation for ginit_option options:


real 
0.0 
Amplitude of first density perturbation for ginit_option options:


real 
0.0 
Amplitude of second density perturbation for ginit_option options:


real 
1.0 
Amplitude of for 

integer 
0 
Mode number in for the sinusoidal equilbrium option of
ginit_option 

integer 
1 
Mode number in for the sinusoidal equilbrium option of
ginit_option 

character(len = 20) 
'sinusoidal' 
Equilbrium choice for ginit_option


logical 
.true. 
Sometimes initial conditions have definite parity; this picks the parity in those cases. Affects the following choices of ginit_option:


character(len = 20) 
"default" 
Method for initialising
All the options are detailed further in the initialisation options documentation 

integer, dimension(2) 
[1, 2] 
indices of two modes to initialise for certain options 

integer, dimension(3) 
[1, 2, 2] 
indices of three modes to initialise for certain options 

integer 
0 
Parallel mode number to initialise for ginit_option


integer 
1 
If greater than zero, initialise only the given with
ginit_option 

real 
0.0 
Amplitude of imaginary part of for various ginit_option options 

logical 
.true. 
Do we want to include the explicit source terms and related timesteps when saving/restoring from the restart file. 

logical 
.false. 
If true then the initial condition is used to set the nonadiabatic
distribution function rather than the 

logical 
.false. 
Print some debug information for ginit_option 

integer, dimension(2) 
[1, 2] 
indices of two modes to initialise for certain options 

integer, dimension(3) 
[1, 2, 2] 
indices of three modes to initialise for certain options 

real 
0.0 
Parallel mode number to initialise for ginit_option


logical 
.true. 
If chop_side is true, chop out left side in theta if true, right side if false. Applies to: FIXME: list of initial conditions 

integer 
128 
The maximum mode number to initialise for ginit_option


logical 
.true. 
Change fields implicit initialisation somehow FIXME: Add documentation 

logical 
.false. 
"Nullify fields". Used by ginit_option FIXME: Add documentation 

logical 
.false. 
"Nullify fields". Used by ginit_option FIXME: Add documentation 

logical 
.false. 
"Nullify fields". Used by ginit_option FIXME: Add documentation 

complex, dimension(6) 
cmplx(0.0,0.0) 
Used in initialization for the OrszagTang 2D vortex problem. FIXME: expand 

real 
0.1 
If doing multiple flux tube calculations, multiply
phiinit by 

real 
1.0 
Average amplitude of initial perturbation of each Fourier mode. Used by most ginit_option options 

real 
0.0 
Amplitude of equilibrium. Used by ginit_option 

real 
0.0 
Amplitude of random perturbation. Used by ginit_option 

integer 
0 
Which processor is responsible for saving/reading potentials to/from restart files. If <0 then all procs write to restart files. If >= nproc then set to proc_to_save_fields = mod(proc_to_save_fields, nproc) 

real 
0.1 
Width of "porcelli", "doubleharris" profiles in
ginit_option 

logical 
.false. 
Restart from many restart files. If false, use a single restart file: this requires GS2 to have been built with parallel netCDF. 

real 
1.0 
Amplitude of real part of for various ginit_option options 

character(len = 150) 
"./" 
Directory to read/write restart files to/from. Make sure this exists before running (see file_safety_check) 

integer 
0 
Used to select with eigensolver generated restart file to load. Sets


character(len = run_name_size) 
"restart_file_not_set.nc" 
Basename of restart files Notegets a smart default 

real 
1.0 
Rescale amplitudes of fields for restart ginit_option
options such as 

real 
0.0 
Amplitude of zeroth parallel temperature perturbation for ginit_option options:


real 
0.0 
Amplitude of first parallel temperature perturbation for ginit_option options:


real 
0.0 
Amplitude of second parallel temperature perturbation for ginit_option options:


real 
0.0 
Amplitude of zeroth perpendicular temperature perturbation for ginit_option options:


real 
0.0 
Amplitude of first perpendicular temperature perturbation for ginit_option options:


real 
0.0 
Amplitude of second perpendicular temperature perturbation for ginit_option options:


real 
0.0 
Force 

complex, dimension(3) 
cmplx(0.,0.) 
Perturbation amplitude of parallel velocity? Used by
ginit_option FIXME: Add documentation 

real 
0.0 
Amplitude of zeroth parallel velocity perturbation for ginit_option options:


real 
0.0 
Amplitude of first parallel velocity perturbation for ginit_option options:


real 
0.0 
Amplitude of second parallel velocity perturbation for ginit_option options:


real 
3.5 
Width of initial perturbation Gaussian envelope in 

real 
1.0 
Amplitude of initial zonal flow perturbations relative to other modes 
Used to represent the input configuration of run_parameters through "knobs"
Name  Type  Default  Description 

real 
1.0e10 
The maximum wall clock time available to GS2 

real 
0.0 
is the ratio of the reference pressure to the reference magnetic energy density, . 

real 
0.1 
Initial timestep 

character(len = 20) 
'default' 
Determines how initial timestep is set. Possible options are:
If "check_restart" is used but the restart files aren't present for any reason (for instance, the current run is not a restart), GS2 will error when trying to read the timesteps. You can run the ingen tool on your input file to check this issue before running your job 

logical 
.false. 
If true then use eigensolver instead of initial value solver. 

character(len = 20) 
'none' 
Advanced option to freeze evolution of certain modes. Possible values are:
Only used in dist_fn, should be moved to dist_fn_knobs. 

real 
0.0 
Multiplies throughout. 

real 
1.0 
Multiplies throughout. 

real 
1.0 
Multiplies throughout. 

logical 
.true. 
Determines the behaviour when the CFL condition is broken in the nonlinear term: 

real 
1.0 
Used in ginit_option "harris" and "convect". Should be moved to init_g namelist. 

real 
300.0 
How close to avail_cpu_time can we go before trying to stop the run cleanly 

real 
1.0e6 
The simulation time after which the run should stop. 

integer 
5 
Sets the time step interval at which check for the existence
of the 

logical 
.false. 
Lowflow only. If true, GS2 exits after writing out neoclassical quantities of interest 

integer 
100 
Maximum number of steps to take 

real 
3.0e3 
Normalised gyroradius, only used for low flow builds 

logical 
.false. 
If true then save init timer information to


logical 
.true. 
If true then save some extra timer information to


integer 
0 
Used to set the random seed used in the random number generators provided by ran. If this input is 0 (the default) then we don't set the seed and use the system default instead. 

real 
1.0 
Only used when there is an adiabatic species. Sets 

logical 
.false. 
If true use original diagnostics rather than new form 

character(len = 100000) 
'' 
Custom description of run to be added to netcdf output (new diagnostics only) 

logical 
.false. 
If true makes timestep proportional to ky*rho. Only sensible for linear runs. 

real 
1.0 
Effective ionic charge appearing in electron collision frequency 
Used to represent the input configuration of kt_grids_box
Name  Type  Default  Description 

integer 
1 
For finite magnetic shear determines the box size in the x
direction according to . This also affects the number
of connections at each This gets a smart default Initialised to 

real 
0.0 
Sets the box size in the y direction. If set to 0 (the default) then
we set 

integer 
0 
If set greater than zero (the default) then this sets the
toroidal mode number of the first nonzero 

integer 
0 
The actual number of ky modes. For nonlinear runs it is
generally recommended to use 

integer 
0 
The actual number of theta0 modes. For nonlinear runs it is
generally recommended to use 

integer 
0 
The number of kx points in inputs to the fft routines, and
hence the number of radial points used in real space
calculations. This differs from the actual number of kx points
simulated in the rest of the code due to the need to prevent
aliasing. The number of kx modes actually simulated
( 

integer 
0 
The number of ky points in inputs to the fft routines, and
hence the number of binormal points used in real space
calculations. This differs from the actual number of ky points
simulated in the rest of the code due to the need to prevent
aliasing. The number of ky modes actually simulated
( 

real 
0.0 
The rhostar ( 

real 
0.0 
Expert usage only  more documentation required. Used to control the kx spacing in simulations with effectively
zero shear () where linked boundaries are not
appropriate so periodic boundaries are used. Also only used if


real 
0. 
Controls the box length in the x direction (measured in the reference Larmour radius) if the magnetic shear is small (). The box size in the x direction is given by . See rtwist for an alternative. 

real 
2.0 
Controls the box length in the y direction (measured in the
reference Larmour radius). The box size in the y direction is
given by . Note if 
Used to represent the input configuration of kt_grids
Name  Type  Default  Description 

character(len = 20) 
"default" 
Controls the type of perpendicular wavenumber grid to use. Can be one of

Used to represent the input configuration of kt_grids_range
Name  Type  Default  Description 

real 
0.0 
Max kx for periodic finite kx ballooning space runs with . 

real 
0.0 
Min kx for periodic finite kx ballooning space runs with . 

real 
0.0 
Upper limit of range. Should set to something other than zero. 

real 
0.0 
Lower limit of range. Should typically set to something other than zero. 

character(len = 20) 
'default' 
Sets the type of spacing between ky grid points, available options are :


integer 
0 
Maximum toroidal mode number. Can use instead of 

integer 
0 
Minimum toroidal mode number. Can use instead of 

integer 
1 
The number of 'actual' ky modes. 

integer 
1 
Number of toroidal modes, only used if 

integer 
1 
Number of (kx) modes 

real 
1.0e4 
Used to convert 

real 
0.0 
Upper limit of 

real 
0.0 
Lower limit of 
Used to represent the input configuration of kt_grids_single
Name  Type  Default  Description 

real 
default_unset_value 
for the reference species (but recommended to set 

real 
0.4 
for the reference species. 

integer 
0 
if 

real 
1.0e4 
Used in conjunction with 

real 
0.0 
is the ballooning angle, sets the point in where the radial wavenumber is zero 
Used to represent the input configuration of a specific specified wavenumber pair
Name  Type  Default  Description 

real 
0.0 
Sets the value for this wavenumber element (but should set 

real 
0.4 
Sets the value for this wavenumber element. 

real 
0.0 
Sets the value for this wavenumber element. 
Used to represent the input configuration of kt_grids_specified
Name  Type  Default  Description 

integer 
1 
The number of 

integer 
1 
The number of 

integer 
0 
Mostly ignored. Does not set the number of modes used. TodoConsider removing 

integer 
0 
Mostly ignored. Does not set the number of modes used. TodoConsider removing 
Used to represent the input configuration of layouts
Name  Type  Default  Description 

logical 
.false. 
If false then fftw will use heuristics to determine the best fft plan. If true then timing measurements will be made to determine an optimal plan. When true it can take somewhat longer to initialise the fft plans. WarningIf true then results will not be exactly reproducible as the choice of the optimal plan can vary from run to run when timing different approaches. This is the main reason why the default is false here. 

logical 
.true. 
Try to load and save wisdom about fftw plans to


character(len = run_name_size) 
'default' 
Location of fftw wisdom file, if left as default, this is set to
run_name//'.fftw_wisdom', unless overriden by the environment
variable 

logical 
.false. 
If true then perform initial decomposition setup related to
the 

logical 
.false. 
When set to true use subcommunicators in the velocity space
integration routines associated with taking moments of the
distribution function. The subcommunicator involves all
processors with a given NoteThese subcommunicators affect calls to
integrate_moment with complex variables. By default there
is no gather of data from other procs so the integration
result may only be known for the local 

logical 
.false. 
When set to true use subcommunicators in the velocity space
integration routines associated with taking species summed
moments of the distribution function. The subcommunicator
involves all processors with a given 

character(len = 5) 
'lxyes' 
This string determines how the distributed dimensions (k) Valid options are:
The optimal choice depends on the type of simulation being
run. It is typically expensive to parallelise TodoConsider changing the default to either 

logical 
.false. 
Can strongly affect initialization time on some parallel computers. Recommendation: Set true 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. NoteThis only impacts simulations with a Todoinvestigate if this setting is still helpful on current machines and if we can determine heuristics for when to enable it. 

real 
0.0 
Sets maximum allowable fractional imbalance between the two
different blocksizes used in the 

real 
0.0 
Sets maximum allowable fractional imbalance between the two
different blocksizes used in the 

integer 
0 
The number of processors to use in e_lo layout. Capped to number of processors in comm world. If not set (<=0) defaults to global nproc. 

integer 
0 
The number of processors to use in g_lo layout. Capped to number of processors in comm world. If not set (<=0) defaults to global nproc. 

integer 
0 
The number of processors to use in le_lo layout. Capped to number of processors in comm world. If not set (<=0) defaults to global nproc. 

integer 
0 
The number of processors to use in lz_lo layout. Capped to number of processors in comm world. If not set (<=0) defaults to global nproc. 

integer 
0 
The number of processors to use in xxf_lo layout. Capped to number of processors in comm world. If not set (<=0) defaults to global nproc. 

integer 
0 
The number of processors to use in yxf_lo layout. Capped to number of processors in comm world. If not set (<=0) defaults to global nproc. 

logical 
.false. 
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. See Adrian Jackson's DCSE report for more details. 

logical 
.true. 
Set to true to use nonblocking communications in the redistribute routines. This is generally more performant but has been observed to be slower in one or two rare cases. 

logical 
.false. 
Set to true to use persistent (nonblocking) communications in
the redistribute routines. Requires 

logical 
.false. 
Set to true to try to overlap the mpi and local parts of the
gather/scatter routines. Should only be used with


logical 
.true. 
When in 

logical 
.false. 
Setting to true allows GS2 to adopt a more flexible domain
decomposition of the xxf data decomposition (used in nonlinear
FFTs). By default GS2 allocates each MPI task with the same
uniform blocksize in Note ingen can provide data on the imbalance and communication required. See Adrian Jackson's DCSE report for more details. 

logical 
.false. 
Setting to true allows GS2 to adopt a more flexible domain
decomposition of the yxf data decomposition (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 Note ingen can provide data on the imbalance and communication required. See Adrian Jackson's DCSE report for more details. 
Used to represent the input configuration of le_grids
Name  Type  Default  Description 

real 
10*epsilon(0.0) 
Acts as a small tolerance in deciding if a particular pitch
angle is forbidden at a particular theta grid point. Rather
than considering particles to be forbidden if 

logical 
.false. 
If true use generalised quadrature scheme for velocity integrals and energy grid. See G. Wilkie thesis. 

integer 
10 
Sets the number of energy grid points to use. If specified
then overrides values of 

integer 
8 
Sets the number of energy grid points below the cutoff. 

integer 
2 
Sets the number of energy grid points above the cutoff. 

logical 
.false. 
If 

logical 
.false. 
If 

integer 
5 
The number of untrapped pitchangles moving in one direction
along field line is 

integer 
500 
Influences the minimum number of grid points in an integration subinterval used in calculating the integration grid weights. 

integer 
1 
The number of untrapped pitchangles moving in one direction along field line. 

logical 
.true. 
The default lambda grid is now gaussradau, for passing particles up to and including the passingtrapped boundary (wfb). The grid gives finite weight to the class of particles which bounce at theta = +/ pi (wfb) in the passing integral Note that the old gausslegendre is used in the case that trapped_particles =.false. NoteIn reference to above comment  code doesn't seem to change radau_gauss_grid when trapped_particles is false, should it? 

logical 
.false. 
If true then we split the passing region into two separate regions for the purpose of choosing the integration weights. The split point is determined automatically by an attempt to minimise the passing weights error. 

logical 
.false. 
If 

logical 
.true. 
If set to 

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

character(len = 20) 
'default' 
Set boundary condition for WFB in the linear/parallel solve:


real 
10.0 
Influences the maximum integration weight allowed. 
Used to represent the input configuration of nonlinear_terms
Name  Type  Default  Description 

real 
0.1 
Scales the estimate CFL limit used to determine when the
timestep should be changed. The maximum allowed timestep
satisfies 

real 
0.1 
Set the error threshold used to determine when the timestep should change if use_order_based_error is true. 

logical 
.true. 
Flag for testing. If false do not include apar contribution to nonlinear term. 

logical 
.true. 
Flag for testing. If false do not include bpar contribution to nonlinear term. 

logical 
.true. 
Flag for testing. If false do not include phi contribution to nonlinear term. 

integer 
30 
Set the first timestep for which the order based error checks are made if use_order_based_error is true. 

logical 
.true. 
If 

character(len = 20) 
'default' 
Determines if the nonlinear terms should be calculated. Must be one of:
Could consider changing this to a logical. 

logical 
.false. 
Do we evolve the nonlinear term separately from the linear terms (true) or include the nonlinear term as a source in the standard algorithm (false). 

logical 
.true. 
If true then use the cfl limit to set the maximum timestep allowed. 

logical 
.false. 
If true then use an error estimate from comparing the nonlinear source calculated using 2nd and 3rd order AdamsBashforth schemes to control the timestep in use. This does not disable the CFL estimate. 

logical 
.false. 
Not currently used, should consider removing. Original
documentation was "Experts only (for secondary/tertiary
calculations)." which suggests a close relation to the

Used to represent the input configuration of normalisations. These values are not used for anything but will be written to the output file to aid post processing etc.
Name  Type  Default  Description 

real 
default_value 
Reference length in 

real 
default_value 
Reference magnetic field in 

real 
default_value 
Reference mass in atomic mass units 

real 
default_value 
Reference density in 

real 
default_value 
Reference Larmor radius in 

real 
default_value 
Reference temperature in 

real 
default_value 
Reference (thermal) velocity in 

real 
default_value 
Reference charge in units of the elementary charge 
Used to represent the input configuration for GS2's optimisation
procedure. When turned on, GS2 performs a scan for the given input file,
varying different optimisation flags. Results of this scan are reported
in
Name  Type  Default  Description 

logical 
.true. 
When true, automatically continues GS2 to run the input file with the optimised parameters. 

logical 
.true. 
Estimate the absolute and relative errors in timing data FIXME: Why would we want this to be false? On small core counts it doesn't seem like a big overhead. 

real 
1.0 
The maximum fraction of unused procs to allow in the optimisation scan. 

integer 
0 
The maximum number of unused procs to allow in the optimisation scan. 

logical 
.false. 
When true, use the "advance" timer. When false, use the "timestep" timer. 

real 
1.0 
The minimum efficiency (relative to the optimal parameters) considered when looking for a constrained set of parameters. A negative value implies only the optimal parameters are considered. 

integer 
5 
The number of timestep to use in the timing experiments. Must be greater than 1 

logical 
.false. 
Set true to turn on optimisation procedure 

logical 
.false. 
When true, perform a few runs before beginning the timing experiment 
Used to represent the input configuration of parameter_scan
Name  Type  Default  Description 

real 
0.0 
When the increment condition is 

real 
0.0 
When the increment condition is 

character(len = 20) 
'delta_t' 
Specifies the condition for incrementing the parameter. Possible values are:


integer 
0 
When the increment condition is 

integer 
0 
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. 

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

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

real 
0.0 
Specifies the starting value for the parameter scan. 

character(len = 20) 
'tprim' 
Specify the parameter to be varied. If the parameter pertains to a species, the scan_spec must be specified as well. 

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

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

character(len = 20) 
'none' 
Specifies the way that the parameter scan is conducted. Possible values are:


character(len = 20) 
'hflux_tot' 
If the scan is being run in 'target' or 'root_finding' mode, specifies the target parameter. Possible values are:


real 
0.0 
Used to represent the input configuration of reinit
Name  Type  Default  Description 

logical 
.true. 
If 

real 
2.0 
When the time step needs to be changed it is adjusted by this
factor, i.e 

real 
1.5 
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 

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

real 
0.0 
Sets the maximum value the time step can take. NoteThis gets a smart default of delt. 

logical 
.false. 
If 
Used to represent the input configuration of source
Name  Type  Default  Description 

real 
0.0 
Growth rate of nonstandard source used with 

real 
0.0 
Frequency of nonstandard source used with 

real 
0.0 
Amplitude of external phi added as source term with


real 
1.0 
Amplitude of nonstandard source used with 

character(len = 20) 
'default' 
Controls the source term used in the time advance. Should be one of:


real 
100.0 
Turn on any artificial sources after time = t0. Only used with

Used to represent the input configuration of species
Name  Type  Default  Description 

real 
1.0 
Specifies the electron mass used in calculating the slowing down parameters in simulations without kinetic electrons. 

integer 
2 
Number of kinetic species to evolve. 

real 
1.0 
Specify the ion charge factor used in calculating the slowing down parameters. If not specified that will attempt to calculate from the kinetic ion species. 
Used to represent the input configuration of species
Name  Type  Default  Description 

real 
1.0 
Multiplies the argument of the Bessel function for this species. Useful for exploring the effect of the Bessel functions. 

real 
1.0 
Set the normalised density for this species 

real 
1.0 
Parameter used for a few specific initial condition types. TodoConsider moving this parameter to init_g_knobs. 

character(len = 20) 
"default" 
Select which type of background distribution should be assumed for this species. Must be one of:
See G. Wilkie thesis. 

real 
2.2 
Normalised inverse density gradient: (Note here is the normalised radius . 

real 
1.0 
Normalised mass of this species 

real 
0.0 
Set the species hyper collision frequency used in the pitch
angle scattering collision operator if
[[collision_knobs::hypermult]] is 

real 
1.0 
Set the normalised species temperature 

real 
0. 
Parameter used for a few specific initial condition types. TodoConsider moving this parameter to init_g_knobs. 

real 
0. 
Parameter used for a few specific initial condition types. TodoConsider moving this parameter to init_g_knobs. 

real 
6.9 
Normalised inverse temperature gradient: (Note here is the normalised radius . 

character(len = 20) 
"default" 
Sets the characterisation of the species. Should be one of
This primarily controls the treatment in the collision operator, the detection of adiabatic species. Tracer species do not contribute to velocity space integrals. 

real 
1.0 
Parameter used for a few specific initial condition types. TodoConsider moving this parameter to init_g_knobs. 

real 
0.0 
Controls an energy independent part of a source term. NoteDocumentation needs improving, looks like it's an early attempt at adding in the parallel flow shear drive term. This effectively provides a constant offset to the parallel flow shear term, allowing one to add a species dependent shift. 

real 
0.0 
Controls an energy dependent part of a source term. NoteDocumentation needs improving, looks like it's an early attempt at adding in the parallel flow shear drive term. This effectively provides a energy dependent offset to the parallel flow shear term, allowing one to add a species and energy dependent shift. 

real 
999.9 
Part of the 

real 
1.0 
Part of the 

real 
0.0 
Sets the normalised speciesspecies collisionality
frequency. For species s, 

real 
1.0 
Normalised species charge 
Used to represent the input configuration of split_nonlinear_terms
Name  Type  Default  Description 

real 
1.0e3 
The absolute tolerance used in error controlled schemes. Attempt to adjust time step to keep error below this tolerance. 

logical 
.false. 
If true then nonlinear integrator advances the nonadiabatic dfn, h, rather than the modified distribution function, g. 

real 
1.0e1 
The tolerance used in convergence checks. Currently only used for halting the fixedpoint iteration in the beuler method 

real 
1.0e2 
The relative tolerance used in error controlled schemes. Attempt to adjust time step to keep error below this tolerance. 

character(len = 20) 
'default' 
Choose which specific RK scheme to use in the RK method. Generally if the tolerances are small a higher order scheme will be more effective than low order. At loose tolerances low order schemes are generally more efficient Valid options include:
See rk_schemes for other options. 

logical 
.false. 
If true then reports the number of right hand side (NL term) calculations, the number of failed internal steps and the number of successful steps at the end of each linear size step. 

character(len = 20) 
'default' 
What algorithm do we use to advance the nonlinear term if split_nonlinear is true. Valid options include:


real 
0.9 
Multiplies the new time step calculated from either the error or cfl limits. Smaller values are more conservative but may help avoid repeated violation of the error/cfl limits and hence reduce the number of failed steps. 
Used to represent the input configuration of stir. See the documentation of the antenna module for more details.
Name  Type  Default  Description 

real 
1.0 
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. 

real 
1.0 
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. 

integer 
1 
Mode number for stirring. 

integer 
1 
Mode number for stirring. 

integer 
1 
Mode number for stirring. 

logical 
.true. 
Launches traveling wave if 
Used to represent the input configuration of theta_grid
Name  Type  Default  Description 

real 
0.0 
Used in calculation of NoteThis gets a "smart" default. 

real 
0.0 
The gradient of the pressure. Strictly speaking this parameter
is not but : in other words,
the gradient of the magnetic field is ignored. Used only if
NoteThis gets a "smart" default. 

integer 
5 
Use Bishop relations to generate metric coefficients.


logical 
.false. 
Use equilbrium data from the CHEASE file ogyropsi.dat 

real 
1e3 
Step size for radial derivatives, . Should be "small enough", typically 0.001. 

logical 
.false. 
Vacuum magnetic dipole geometry 

real 
1.0 
Used to scale the pressure gradient, only if bishop = 7 or 8. 

logical 
.false. 
Use EFIT equilibrium (EFIT, codes with eqdsk format) 

character(len = eqfile_length) 
"default_unset_value" 
Name of file with numerical equilibrium data (if required) 

character(len = eqfile_length) 
"default_unset_value" 
Name of file with numerical equilibrium normalization data (if required) currently, only used for dipole equilibrium (deq) 

logical 
.true. 
Change fieldline coordinate. Recommended value: F NoteWe recommend 

logical 
.false. 
If true then forces updown symmetry in some geometrical quantities 

logical 
.false. 
Use Toqstyle NetCDF equilibrium (TOQ) 

logical 
.false. 
Read Colin Roach's GS2D equilibrium file 

logical 
.false. 
Unknown equilibrium file. You probably don't want this. FIXME: Add documentation 

integer 
1 
Deprecated  redundant information. 

real 
0. 
Used with bishop == 3: controls pressure length scale by multiplying 

integer 
2 
Choose definition of flux surface coordinate
NB For consistency fprim, tprim, shat, uprim, g_exb etc must be computed using same radial variable, i.e. depend on choice of irho! 

integer 
1 
Deprecated, see force_sym instead 

integer 
1 
Deprecated, see use_large_aspect instead 

logical 
.true. 
If 

integer 
1 
The number of theta grid points to use in eikcoefs calls. Currently may not have an effect for all equilibrium types. If not set then defaults to ntheta 

logical 
.false. 
Use Menardstyle NetCDF equilibrium (JSOLVER) 

real 
0.0 
Used to overrides s_hat prescribed by the numerical equilibrium, but only if bishop=2,3,4,5,8, or 9. NoteThis gets a "smart" default. 

logical 
.false. 
Use PPL NetCDF equilibrium (psipqgrz equilibrium from TRANSP/TRXPL) 

logical 
.false. 
If true use large aspect ratio expansions in eik geometry to get ~salpha 

logical 
.false. 
Write a little extra about geometry to the screen. 
Used to represent the input configuration of theta_grid
Name  Type  Default  Description 

character(len = run_name_size) 
"grid.out" 
Name of file with output from rungridgen. 

logical 
.false. 
If false, read 
Used to represent the input configuration of theta_grid_gridgen
Name  Type  Default  Description 

real 
0.0 
Relative weighting of pitchangle metric to metric 

real 
1.e8 
Consider when the right grid point is equal to the target bmag. FIXME: What does this mean? 

real 
0.0 
Parameter for weighted resolution in theta. Each theta grid point contributes to the resolution metric according to the function which has peaks at theta = +/ thetamax and deltaw controls the relative weighting of the theta dependent contribution. 

real 
1e5 
Maximum difference between neighbouring points for determining if a point is an extremum. 

real 
0.0 
Used to set a "bonus" contribtion to resolution at B extrema with an even number of theta grid points. Those with an odd number of points and the assumed extrema at pi have a metric of 1e20. Here extrknob can be used to bias the algorithm towards keeping extrema with an even number of points. 

integer 
2 
Number of points between original grid points to oversample by 

real 
1.0 
Tension to use in interpolating splines for regrid of geometrical quantities Defaults to tension if not set. 

logical 
.false. 
If true then skip gridgen call and instead just use the existing grid. NoteThis is primarily for debugging and testing. When active we are effectively forced to assumed that the input bmag is symmetric and monotonic. If this is not true then we should not trust the results. 

real 
1.0 
Tension for spline 

real 
0.0 
Parameter for weighted resolution in theta. Each theta grid point contributes to the resolution metric according to the function which has peaks at theta = +/ thetamax. 

real 
1.0 
Parameter for weighted resolution in theta. Each theta grid point contributes to the resolution metric according to the function which has peaks at theta = +/ thetamax and widthw controls the scale length of the peaks. 
Used to represent the input configuration of theta_grid
Name  Type  Default  Description 

real 
1.0 
Scales the curvature drift. 

character(len = 20) 
"default" 
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:


logical 
.false. 
If true then force gradB drift to be equal to curvature
drift. This is not recommended when 

real 
1.0 
Scales the gradB drift. 
Used to represent the input configuration of theta_grid. Sets a number of parameters used by the different theta grid implementations. Not all parameters are active for a given theta grid type.
Name  Type  Default  Description 

real 
1.0 
The flux surface elongation (only used when 

real 
0.0 
The radial gradient flux surface elongation (only used when


real 
0.0 
Used in conjunction with alpmhdfac
to override 

real 
1.0 
Minor radius of the flux surface that receives the specified
shaping (only used when 

real 
0.0 
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
. 

real 
0.0 
Zeroth cosine moment for the MXH local equilibrum. See geoType and local_eq 

real, dimension(mxh_max_moments) 
0.0 
Cosine moments for the MXH local equilibrum. See geoType and local_eq 

real, dimension(mxh_max_moments) 
0.0 
Radial derivatives of cosine moments for the MXH local equilibrum. See geoType and local_eq 

real 
1.0 
The elongation of the flux surface labeled by aSurf (only used
when 

real 
1.0 
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. 

real 
1.0 
The magnitude of the mMode shaping effect (only used when


real 
0.0 
Radial derivative of the magnitude of the mMode shaping effect
(only used when 

real 
1.0 
The magnitude of the nMode shaping effect (only used when


real 
0.0 
Radial derivative of the magnitude of the nMode shaping effect
(only used when 

real, dimension(mxh_max_moments) 
0.0 
Radial derivatives of sine moments for the MXH local equilibrum. See geoType and local_eq 

real 
0.3 
Controls particle trapping (among other things) in simple geometric models. 

real 
0.3 
Sets curvature drift in salpha model, where is the GS2 equilibrium reference normalisation length and is the major radius at the centre of the flux surface. 

integer 
0 
Selects between different analytic geometry specifications
(only used when
See Section 2.1 of the Analytic Geometry Specification documentation for more details on options 03, and PPCF 63 (2021) 012001 (5pp) for details of 4 (MXH). NoteThe default for this MUST be zero otherwise the Trinity interface will break. 

real 
1.0 


integer 
2 
First flux surface shaping mode number (only used when


integer 
0 
Number of moments for the MXH local equilibrum. Maximum value is mxh_max_moments. See geoType and local_eq for more details. 

integer 
3 
Second flux surface shaping mode number (only used when


integer 
2 
Sets the number of segments along equilibrium magnetic field to include in simulation domain. . Ignored in some cases TodoDocument when this is ignored 

integer 
24 
Rough number of grid points along equilibrium magnetic field between . Actual number of grid points determined as follows:


real 
0.3 
Sets , 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 . Used only in high aspect ratio equilibrium model. 

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

real 
3.0 
When not local_eq: Centerpoint of LCFS (normalized to
)  When local_eq: Major radius of
magnetic field reference point (normalized to
). Specifically, the reference magnetic
field is defined to be the value of the toroidal magnetic
field at 

real 
3.0 
Major radial location of the magnetic axis (only used when


real 
0.5 


real 
3.0 
When not local_eq: Position of magnetic axis (normalized to ). When local_eq: Major radius of the centre of the flux surface of interest (normalized to ) 

real, dimension(mxh_max_moments) 
0.0 
Sine moments for the MXH local equilibrum. See geoType and local_eq 

real 
0.75 
Sets value of magnetic shear in simple geometric models.
Overridden by 

real 
0.0 
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:
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.


real 
0.0 
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 

real 
0.0 
The tilt angle of the elongation of the flux surface labeled
by 

real 
0.0 
The tilt angle of the triangularity of the flux surface
labeled by 

real 
0.0 
The tilt angle of the triangularity (only used when


real 
0.0 
The tilt angle of the elongation (only used when 

real 
0.0 
The tilt angle of the mMode shaping effect (only used when


real 
0.0 
The tilt angle of the nMode shaping effect (only used when


real 
0.0 
The flux surface triangularity (only used when 

real 
0.0 
The radial gradient of the flux surface triangularity (only
used when 

real 
0.0 
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. 
Used to represent the input configuration of theta_grid_salpha
Name  Type  Default  Description 

real 
0.0 
Coefficient in model when 

real 
0.0 
Used in conjunction with alpmhd to override


character(len = 20) 
"default" 
Sets the particular model for the magnetic field and related drifts. NB: All options have gbdrift = cvdrift except where noted. Can be one of
NB: For the final two options here ('constcurv' and 'nocurvature') (See also ingen output and contents of theta_grid.f90 for further details 