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

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

command_linecommand_line.fpp

A wrapper module for handling command line arguments. This module provides subroutine cl_getarg and integer function cl_iargc. Most of the compilers have getarg and iargc as their extensions. If not, one can use POSIX pxfgetarg and ipxfargc.

Read more…
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_create_and_writediagnostics_create_and_write.f90

A module which contains two high level interfaces for writing to the netcdf file, one for variables which are local to all processors, and one for variables which may be distributed in the same manner as the fields. Create and/or write the given variable depending on the values of the flags gnostics%create and gnostics%wryte

Read more…
diagnostics_dimensionsdiagnostics_dimensions.f90

This module provides a dimension class (derived type) The idea is to make it easier to support different output backends at some point by putting backend specific setup in here.

Read more…
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

Contains a lot of old routines for writing stuff out at the end of the simulation that I had no time to upgrade

diagnostics_fluxesdiagnostics_fluxes.fpp

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

Read more…
diagnostics_geometrydiagnostics_geometry.f90

A module for writing out geometric coefficients and information such as bpar, drifts and plotting coefficients

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_metadatadiagnostics_metadata.f90

A module for for writing help, metadata and the input file to the netcdf file.

Read more…
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_normalisationsdiagnostics_normalisations.f90

This module writes the parameters in the normalisations namelist to the netcdf output file. These parameters play no part in the simulation, but will typically have been used in calculating the dimensionless inputs, and will typically be used to dimensionalise the outputs.

diagnostics_omegadiagnostics_omega.f90

A module which calculates and writes the growth rates and frequencies

Read more…
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

FIXME : Add documentation

Read more…
ffttest_helperffttester.f90

FIXME : Add documentation

fieldsfields.f90

FIXME : Add documentation Made public for unit tests Made public for replay

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…
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) itor :: default one. Choose zero to get "s-alpha" equilibria (see iflux=0) iflux :: chooses mode of operation.
case (0) :: no equilibrium. Analytic parameterization of local equilibrium iflux = 0 forces local_eq = .true. and irho = 2 case (1) :: use numerical equilibrium. 5 choices: 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 -------------------> [note: if either of the above == .true., set eqfile = input file name] efit_eq = .true. :: use EFIT equilibrium dfit_eq = .true. :: use dipole equilibrium case (2) :: running inside nt without actual equilibria iflux = 2 forces local_eq = .true. and irho = 2 case (10) :: used by nt to initialize some variables. Obsolescent. 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)

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

FIXME : Add more documentation

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. Options passed to init_gs2_diagnostics_new

gs2_gryfx_zonalgs2_gryfx_zonal.f90

FIXME : Add documentation

Read more…
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_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

Read more…
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 DD>

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…
mdsiomds.fpp

FIXME : Add documentation (or tidy up above)

mdslibmdslib.f90

FIXME : Add documentation

Read more…
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

old_interface_storegs2_main.fpp

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

FIXME : Add documentation

peqpeq.fpp

FIXME : Add documentation

pgplot_utilspgplot_utils.fpp

FIXME : Add documentation!

profprof.fpp

FIXME : Add documentation

Read more…
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

CHEASE Output Reader

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

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 and nonlinear_mode is "off", return simple diffusive estimates of fluxes to trinity If true and nonlinear_mode is "off", and trinity_linear_fluxes is true, return quasilinear estimates of fluxes to trinity 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

simpledataiosimpledataiof.F90

Fortran interface to simpledataio, which requires the iso_c_binding intrinsic module introduced in Fortran 2003. All functions of simpledataio are provided in this module with the exception of write_variable which is provided in simpledataio_write ifdef SIMPLEDATAIO_HAS_PARALLEL_NETCDF endif

simpledataio_readsimpledataio_read.F90

Wrapper routines for reading variables from netcdf file.

simpledataio_writesimpledataio_write.F90

Wrapper routines for writing variables to a netcdf file.

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

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…