Modules

ModuleSource FileDescription
abstract_configabstract_config.f90

Define abstract type to use as a base type for derived types used to represent the input configuration of a module (actual or logical). In other words it can be used to represent a namelist state.

antennaantenna.f90

Provides random forcing for Alfven wave problem Originally by Hammett, Dorland and Quataert, Dec. 5, 2001

Read more…
antenna_dataantenna_data.f90

FIXME : Add documentation

array_utilsarray_utils.fpp

Provides wrappers to some simple array operations. We use this indirection in order to be able to consistently treat performance concerns. Currently this is limited to adding OpenMP, although in the future it might allow different approaches as appropriate.

ballstabballstab.f90

A small module used to calculate ideal ballooning stability. Based on the original ball program in geo/ball.f90 of GS2 but tweaked to integrate closer to full GS2 runs etc.

benchmarksbenchmarks.f90

Helper functions for running benchmarks

build_configbuild_config.fpp

Compile-time parameters describing the built configuration

ceqceq.f90

Reads in the geometry using a CHEASE output file. The CHEASE output file is read using the helper module read_chease.

collisional_heatingcollisional_heating.f90

FIXME : Add documentation

collisionscollisions.fpp

Routines for implementing the model collision operator defined by Barnes, Abel et al. 2009 or on arxiv. The collision operator causes physically motivated smoothing of structure in velocity space which is necessary to prevent buildup of structure at fine scales in velocity space, while conserving energy and momentum.

config_collectionconfig_collection.fpp

Provides a defined type that contains all possible config objects. This can be used to represent the configuration used for a particular run etc.

constant_randomconstant_random.f90

This module provides 10,000 fixed random numbers used for initialising tests, so as always to give the same result when starting from noise, regardless of compiler/system. These should not be used for production runs.

constantsconstants.fpp

A module which defines a variety of constants, for example, mathematical constants like pi, dimensions of arrays whose sizes are set at compile time, and kind parameters.

Read more…
convertconvert.f90

Convert from complex variable a(d1,d2,d3, ...) to a real variable ar(2,d1,d2,d3,...) and back.
This is necessary for saving complex variables in NetCDF format

Read more…
deqdeq.f90

FIXME : Add documentation

diagnostics_antennadiagnostics_antenna.f90

A module to calculate the properties of the antenna used to drive turbulence

diagnostics_asciidiagnostics_ascii.f90

A module for managing text-based output files for the new diagnostics module

diagnostics_base_configdiagnostics_base_config.f90
diagnostics_configdiagnostics_config.f90

A module for handling the configuration of the diagnostics module via the namelist diagnostics_config.

diagnostics_fieldsdiagnostics_fields.f90

This module contains functions for writing quantities that have the dimensions of the fields, including volume averaged quantities, etc.

diagnostics_final_routinesdiagnostics_final_routines.f90

Diagnostic routines that are called at the end of the simulation, rather than during the run

diagnostics_fluxesdiagnostics_fluxes.fpp

Module which contains functions for calculating and writing out the fluxes of heat and momentum etc.

diagnostics_heatingdiagnostics_heating.f90

Subroutines for writing out the turbulent heating... the turbulent energy dissipated in collisions and hyperviscosity Set averages in gnostics\%current_results to 0.

diagnostics_momentsdiagnostics_moments.f90

A module for writing out moments of the distribution function, for example density, temperature, parallel flow

diagnostics_nonlinear_convergencediagnostics_nonlinear_convergence.f90

A module which contains methods for checking whether nonlinear runs have reached a saturated steady state

diagnostics_omegadiagnostics_omega.f90

A module which calculates and writes the growth rates and frequencies

diagnostics_printoutdiagnostics_screen_printout.f90

A module for printing summary information to stdout during the simulation

diagnostics_turbulencediagnostics_turbulence.f90

A module for calculating properties of the turbulence such as cross phases and correlations

diagnostics_velocity_spacediagnostics_velocity_space.f90

A module which writes out quantities which writes out diagnostic quantities which assess whether the velocity space resolution is sufficient.

diagnostics_zonal_transferdiagnostics_zonal_transfer.f90

FIXME : Add documentation

Read more…
dist_fndist_fn.fpp

The principal function of this module is to evolve the distribution function, that is, to advance the discrete gyrokinetic equation. This involves calculating the source and dealing with the complexities of the parallel boundary conditions. In addition it contains a routine for implementing perpendicular velocity shear and calculating the right-hand side of the field equation, as well as a host of other functions. Initializes a limited selection of arrays, for example g, gnew, vperp2, typically those which are needed by other modules that don't need dist_fn to be fully initialized (e.g. nonlinear_terms) This initialization level depends on grid sizes.

Read more…
dist_fn_arraysdist_fn_arrays.fpp

A container for the arrays that are used to store the distribution function among other things.

Read more…
eeqeeq.f90

This module is a submodule of geometry which handles reading from the ascii EQDSK format output by EFIT, but also now by other codes. This file contains psi on an R,Z grid, as well as other quantities such as q (safety factor), I (a.k.a. f) and p (pressure) on a psi grid.

Read more…
egridle_grids.f90

FIXME : Add documentation

eigvaleigval.fpp

A stub module representing the eigenvalue solver

exit_codesexit_codes.f90

Provides the exit_code type used to represent an exit reason. Also provides a number of specific exit_code instances for regular expected exit reasons.

fft_workfft_work.fpp

Provides some wrappers for managing FFTW plans.

Read more…
ffttest_helperffttester.f90

FIXME : Add documentation

fieldsfields.f90

FIXME : Add documentation Made public for unit tests

fields_arraysfields_arrays.f90

Provides storage for the EM potentials and some related data

fields_gf_localfields_gf_local.f90

This module is based on the fields_local module (which is in term a re-implementation of the fields implicit functionality). fields_gf_local implements the implicit field calculation using a gf_lo based data decomposition to improve performance on large process counts. It utilises a smaller set of processes to reduce communication costs (at the expense of significant load imbalance in the fields calculations). It assumes gf_lo velocity space integration and stores field data in gf_lo format (i.e. ik,it are decomposed over processes, everthing else is local).

Read more…
fields_implicitfields_implicit.f90

FIXME : Add documentation

fields_localfields_local.f90

This module implements the same implicit algorithm as fields_implicit. However, it is an almost complete rewrite of the implementation which can give large gains in the speed of calculating the response matrix, as well as significant gains to the advance steps

fields_parallelizationfields_parallelization.f90

FIXME : Add documentation

fields_testfields_test.f90

FIXME : Add documentation

file_utilsfile_utils.fpp

Various utilities for working with input and output files, as well as some shims/backfills for standard features not present in older compilers.

Read more…
functional_testsfunctional_tests.fpp

A module which contains a series of high level tests used in the linear and nonlinear test cases, as well as a driver function which runs GS2. Check that the relative error of the growth rates as a function of ky with respect to the given rslt is less than err. rslt should be an array of length naky which contains the growth rates as a function of ky. Returns .true. for pass and .false. for fail

Read more…
gauss_quadgauss_quad.f90

Utilities for Gaussian quadrature. This module provides subroutines to obtain zeros and weights of Gauss-Legendre and Gauss-Laguerre quadrature rules.

genquadgenquad.fpp

Allows a general weight function (as specified by an external function) for integration. Returns the Gaussian quadrature weights and abscissae corresponding to the set of orthogonal polynomials associated with this weight. See: Gnauchi, in: "Orthogonal Polynomials: Theory and Practice", Nevai (Ed.). Kluwer, 1990. Wheeler, Rocky Mountain Journal of Mathematics, Vol 4, p. 287 (1974)

Read more…
geo_utilsgeo_utils.fpp

A module to provide utilities used in geometry calculations. Mainly to provide an abstract type used as a base for specific geometry implementations.

geometrygeometry.f90

Deals with most types of equilibria to generate GS2's expected geometrical parameters Input: rhoc :: minor radius of surface of interest (see irho below) use_large_aspect :: default false. Choose true to get "s-alpha" equilibria (see local_eq) Equilibrium options : Choose 1 of: local_eq : Analytic parameterization of local equilibrium ppl_eq = .true. :: use PPL style NetCDF equilibrium (Menard) transp_eq = .true. :: use TRXPL style NetCDF equilibrium (Menard) gen_eq = .true. :: use GA style NetCDF equilibrium (TOQ) chs_eq = .true. :: Use CHEASE generated equilibrium efit_eq = .true. :: use EFIT equilibrium dfit_eq = .true. :: use dipole equilibrium -------------------> [note: if any of the above except local_eq are true set eqfile = input file name] irho :: choose flux surface label case (1) :: sqrt(toroidal flux)/sqrt(toroidal flux of LCFS) case (2) :: diameter/(diameter of LCFS). recommended case (3) :: poloidal flux/(poloidal flux of LCFS) case (4) :: rho_mid? Only used for the vacuum ring dipole, dfit_eq = T

Read more…
geqgeq.fpp

FIXME : Add documentation

git_version_modgit_version_mod.f90

Explicit interfaces for the functions in git_hash.fpp

gk_complex_rootgk_complex_root.f90

FIXME : Add documentation

gridgen4modgridgen4mod.f90

Given B{theta_i} attempt to produce an optimal set of theta values with the same size as the input {theta_i}. The output {theta} set should include all extrema (global and local) and as many other grid points as required to meet the requested number.

Read more…
gs2_diagnosticsgs2_diagnostics.fpp

A module for calculating and writing the main GS2 outputs.

gs2_diagnostics_newgs2_diagnostics_new.f90

A module for calculating and writing gs2 outputs. It can write these outputs both to a netcdf file .cdf or to ascii text files. It is controlled via the namelist diagnostics_config. This module is intended to replace the old gs2_diagnostics module with a simpler and more structured interface.

gs2_heatinggs2_heating.f90

FIXME : Add documentation

Read more…
gs2_initgs2_init.fpp

This module is analogous to the init() function in Linux-based operating systems: it initialises gs2 to a certain init_level. At a given init level, certain modules are initialised and certain are not.

Read more…
gs2_iogs2_io.fpp

A module for writing to netcdf.

gs2_io_gridsgs2_io_grids.fpp

A module for writing geometry to netcdf.

gs2_layoutsgs2_layouts.fpp

FIXME : Add documentation

gs2_maings2_main.fpp

This module provides the external interface to gs2. It contains functions to initialize gs2, functions to run gs2, functions to finalize gs2 and functions to override/tweak gs2 parameters.

Read more…
gs2_metadatags2_metadata.fpp

Write some standard metadata to a netCDF file

Read more…
gs2_optimisationgs2_optimisation.f90

This module sits on top of gs2_main and provides a toolkit for measuring and optimising performance

gs2_reinitgs2_reinit.f90

FIXME : Add documentation

gs2_savegs2_save.fpp

FIXME : Add documentation

gs2_timegs2_time.f90

FIXME : Add documentation

gs2_transformsgs2_transforms.fpp

FIXME : Add documentation

gs2deeq.f90

This module contains routines to read from CMR's GS2D equilibrium solver

hdf_wrapperhdf_wrapper.fpp

hdf5 wrapper subroutines written by Tomo Tatsuno once ver. 1.8.0 becomes available, we can remove this module and use those High-level APIs.

Read more…
hyperhyper.f90

FIXME : Add documentation

Read more…
ideqideq.f90

FIXME : Add documentation

ingen_modingen_mod.fpp

Reads in namelists, checks for consistency of inputs, writes a report to runname.report, checks for requested variations, generates new input files, and exits.

Read more…
init_ginit_g.f90

This module contains the subroutines which set the initial value of the fields and the distribution function.

integrationintegration.f90

Utility module containing generic integration routines

job_managejob_manage.fpp

FIXME : Add documentation

kt_gridskt_grids.f90

Set up the perpendicular wavenumbers by calling the appropriate sub-modules.

kt_grids_boxkt_grids.f90

Set the perpendicular box size and resolution for linear or nonlinear runs.

kt_grids_rangekt_grids.f90

Set up ranges of kx and ky for linear runs.

kt_grids_singlekt_grids.f90

Set up values of kx and ky for linear runs that use a single k_perp mode.

kt_grids_specifiedkt_grids.f90

Set up sets of (kx, ky) values for linear runs.

lapack_wrapperlapack_wrapper.fpp

A small module just designed to provide interfaces to commonly used lapack routines so that we can forget about the precision of the arguments at the calling site and the compiler has some information about the lapack routine arguments.

Read more…
layouts_typelayouts_type.f90

FIXME : Add documentation

le_derivativesle_derivatives.fpp

FIXME : Add documentation

le_gridsle_grids.f90

FIXME : Add documentation

leqleq.f90

Analytic local equilibria via generalised forms of the Miller model

Read more…
lowflowlowflow.f90

FIXME : Add documentation

mat_invmatrix_inverse.fpp

A module to hold different routines which can be used to invert a matrix

Read more…
matrix_multiplymatrix_multiply.fpp

Provides a consistent wrapper to different matrix multiply implementations

memory_usagememory_usage.fpp

Provide some small utilty functions for trying to monitor memory use.

mpmp.fpp

Easier Fortran90 interface to the 1 Message Passing Library.

Read more…
mt19937mt19937.f90

Mersenne-Twister pseudorandom number generator (PRNG), specifically MT19937

Read more…
netcdf_utilsnetcdf_utils.fpp

Provides some convenience wrappers around netCDF procedures, mostly for handling netCDF errors in a consistent manner, removing the need to manually check the returned status code.

Read more…
nonlinear_termsnonlinear_terms.fpp

FIXME : Add documentation

normalisationsnormalisations.f90

FIXME : Add documentation

optimisation_configoptimisation_config.f90

A module for handling the configuration of the optimisation module via the namelist optimisation_config.

optionalsoptionals.fpp

Some utilities for working with optional arguments

overridesoverrides.f90

A module which defines the override types. These types are used within the init object (which itself is contained within the gs2_program_state object) to override values of the specified parameters (i.e. modify their values from what is specified in the input file). The appropriate "prepare_..." function from gs2_main must always be called before setting overrides.

Read more…
parameter_scanparameter_scan.f90

A module which allows multiple values of certain parameters to be considered within a single simulation.

Read more…
parameter_scan_arraysparameter_scan_arrays.f90

Data module holding variables associated with the parameter scan functionality. Held separately from parameter_scan module to avoid complicating dependencies.

peqpeq.fpp

FIXME : Add documentation

pgplot_utilspgplot_utils.fpp

FIXME : Add documentation!

print_utilsprint_utils.f90

Various utilities for printing text

quadpackquadpack.f90
ranran.fpp

A wrapper module for random number generator. This module provides real function ranf using intrinsic random_number/random_seed or Mersenne Twister 19937 (see mt19937.f90).

read_cheaseread_chease.f90

A module to read in datafiles from CHEASE.

Read more…
redistributeredistribute.f90

Redistribute distributed (integer, real, complex or logical) (1, 2, 3, or 4) dimensional arrays into two dimensional arrays with first index on local processor, and vice versa.

Read more…
regressionregression.f90

FIXME : Add documentation

rk_schemesrk_schemes.f90

A small helper module for storing and providing RK schemes

run_parametersrun_parameters.f90

This module is basically a store for the input parameters that are specified in the namelists knobs and parameters. In general, the names of the public variables in this module are the same as the name of the input parameter they correspond to. If true use old diagnostics. Included for testing only and will eventually be removed. Please use the new diagnostics module!

runtime_testsruntime_tests.fpp

This module is intended to be used for runtime tests which interrogate what is functional/what compile time options were enabled/disabled, and also any enviroment variables which affect what happens at runtime.

shm_mpi3shm_mpi3.f90

This module handles share memory using MPI3 and records the allocation in a linked list such that shared memory can be accessed later in arbitrary location of the code (hopefully)

Read more…
shmemshmem.fpp

FIXME : Add documentation

sortingsorting.f90

This module provides various routines for sorting arrays This isn't something we commonly do but these routines are useful in a few places.

Read more…
speciesspecies.f90

FIXME : Add documentation

spfuncspfunc.fpp

FIXME : Add documentation (or tidy existing documentation)

splinesspl.f90

FIXME : Add documentation

split_nonlinear_termssplit_nonlinear_terms.fpp

A module to deal with advancing the nonlinear term separately from the linear terms.

standard_headerstandard_header.f90

Contains functions for creating a standard header for files and output

summationsummation.f90

Provides utility routines for compenstated summation. The purpose of these approaches is to try to minimise the accumulation of floating point errors.

text_optionstext_options.f90

FIXME : Add documentation

theta_gridtheta_grid.f90

FIXME : Add documentation

theta_grid_eiktheta_grid.f90

FIXME : Add documentation

theta_grid_filetheta_grid.f90

Use output from rungridgen

theta_grid_gridgentheta_grid.f90

FIXME : Add documentation

theta_grid_paramstheta_grid_params.f90

FIXME : Add documentation

theta_grid_salphatheta_grid.f90

FIXME : Add documentation

unit_testsunit_tests.f90

A module containing functions for running unit tests Is the relative error of the first argument with respect to the correct answer less than err? If the correct value is 0.0, then err is treated as an absolute error

Read more…
uuid_moduuid_mod.fpp

Create a random (version 4) Universally Unique Identifier (UUID)

Read more…
volume_averagesvolume_averages.f90

This module contains functions for averaging quantities which have the dimensions of space, and potentially species. For example, (y), (x), (x,y), (theta,x,y), (x,y,s) etc. The names of the interfaces are self-explanatory: for example, the function average_theta averages the theta dimension.

Read more…
warning_helperswarning_helpers.f90

Small functions for making semantically-correct code that doesn't raise compiler warnings (or at least, fewer). The main downside of this is requiring a function call, which can destroy vectorisation of loops.