theta_grid_params Module

FIXME : Add documentation



Contents


Variables

Type Visibility Attributes Name Initial
real, public :: rhoc
real, public :: rmaj
real, public :: r_geo
real, public :: eps
real, public :: epsl
real, public :: qinp
real, public :: shat
real, public :: alpmhd
real, public :: pk
integer, public :: geoType
integer, public :: mMode
integer, public :: nMode
real, public :: aSurf
real, public :: shift
real, public :: shiftVert
real, private :: raxis
real, private :: zaxis
real, public :: deltam
real, public :: deltan
real, private :: akappa
real, private :: tri
real, private :: delta2
real, private :: delta3
real, public :: deltampri
real, public :: deltanpri
real, private :: akappri
real, private :: tripri
real, public :: thetam
real, public :: thetan
real, private :: thetak
real, private :: thetad
real, private :: theta2
real, private :: theta3
real, public :: btor_slab
real, public :: betaprim
integer, public :: ntheta
integer, public :: nperiod
integer, private :: n_mxh
real, private :: c0_mxh
real, private, dimension(mxh_max_moments) :: c_mxh
real, private, dimension(mxh_max_moments) :: s_mxh
real, private, dimension(mxh_max_moments) :: dc_mxh_dr
real, private, dimension(mxh_max_moments) :: ds_mxh_dr
logical, private :: initialized = .false.
real, private :: kp = -1.
logical, private :: exist
type(theta_grid_parameters_config_type), private :: theta_grid_parameters_config

Derived Types

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.

Components

Type Visibility Attributes Name Initial
logical, public :: exist = .false.

Does the related namelist exist in the target input file?

integer, public :: index = 0

Used to hold the specific index of numbered namelists

logical, public :: skip_read = .false.

Do we want to skip the read step in init?

logical, public :: skip_broadcast = .false.

Do we want to skip the broadcast step in init?

real, public :: akappa = 1.0

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

real, public :: akappri = 0.0

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

real, public :: alpmhd = 0.0

Used in conjunction with alpmhdfac to override shift, set as shift=-alpmhd*alpmhdfac. Do not use unless you know what you are doing.

real, public :: asurf = 1.0

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

real, public :: btor_slab = 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 . btor_slab = btor/bpol defines direction of a flow relative to B in slab geometry, where flow is by definition in the toroidal direction.

real, public :: c0_mxh = 0.0

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

real, public, dimension(mxh_max_moments) :: c_mxh = 0.0

Cosine moments for the MXH local equilibrum. See geoType and local_eq

real, public, dimension(mxh_max_moments) :: dc_mxh_dr = 0.0

Radial derivatives of cosine moments for the MXH local equilibrum. See geoType and local_eq

real, public :: delta2 = 1.0

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

real, public :: delta3 = 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, public :: deltam = 1.0

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

real, public :: deltampri = 0.0

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

real, public :: deltan = 1.0

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

real, public :: deltanpri = 0.0

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

real, public :: eps = 0.3

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

real, public :: epsl = 0.3

Sets curvature drift in s-alpha model, where is the GS2 equilibrium reference normalisation length and is the major radius at the centre of the flux surface.

integer, public :: geotype = 0

Selects between different analytic geometry specifications (only used when local_eq = T):

Read more…
real, public :: kp = -1.0

kp sets parallel wavenumber and box length in slab geometry. .

Read more…
integer, public :: mmode = 2

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

integer, public :: nmode = 3

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

integer, public :: n_mxh = 0

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

integer, public :: nperiod = 2

Sets the number of segments along equilibrium magnetic field to include in simulation domain. . Ignored in some cases

Read more…
integer, public :: ntheta = 24

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

Read more…
real, public :: pk = 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, public :: qinp = 1.5

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

real, public :: r_geo = 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 R=r_geo on the flux surface labeled by rhoc.

real, public :: raxis = 3.0

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

real, public :: rhoc = 0.5

rhoc is the flux surface label (0< rhoc< 1). Its exact meaning depends on irho. Usually rho = midplane diameter/midplane diameter of LCFS (here, "LCFS" refers to the flux surface at a radius of . If using Miller geometry with , this is not the physical last closed flux surface.

Read more…
real, public :: rmaj = 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, public, dimension(mxh_max_moments) :: s_mxh = 0.0

Sine moments for the MXH local equilibrum. See geoType and local_eq

real, public, dimension(mxh_max_moments) :: ds_mxh_dr = 0.0

Radial derivatives of sine moments for the MXH local equilibrum. See geoType and local_eq

real, public :: shat = 0.75

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

real, public :: shift = 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 s-alpha and other analytic equilbrium models:

Read more…
real, public :: shiftvert = 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 geoType=0, 2, or 3 (which selects the Generalised Miller, Generalised Elongation, or Fourier analytic geometry specifications). See Sections 2.1.1, 2.1.3, and 2.1.4 of the Analytic Geometry Specification documentation for more details.

real, public :: theta2 = 0.0

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

real, public :: theta3 = 0.0

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

real, public :: thetad = 0.0

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

real, public :: thetak = 0.0

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

real, public :: thetam = 0.0

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

real, public :: thetan = 0.0

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

real, public :: tri = 0.0

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

real, public :: tripri = 0.0

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

real, public :: zaxis = 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.

Type-Bound Procedures

procedure , public , :: is_initialised => is_initialised_generic Function
procedure , public , :: init => init_generic Subroutine
procedure , public , :: setup => setup_generic Subroutine
procedure , public , :: write_namelist_header Subroutine
procedure , public , :: get_name => get_name_generic Function
procedure , public , :: get_requires_index => get_requires_index_generic Function
procedure , public , nopass :: write_namelist_footer Subroutine
generic, public , :: write_key_val => write_key_val_string, write_key_val_real, write_key_val_complex, write_key_val_integer, write_key_val_logical, write_key_val_real_array, write_key_val_complex_array, write_key_val_integer_array
procedure , public :: read => read_theta_grid_parameters_config Subroutine
procedure , public :: write => write_theta_grid_parameters_config Subroutine
procedure , public :: reset => reset_theta_grid_parameters_config Subroutine
procedure , public :: broadcast => broadcast_theta_grid_parameters_config Subroutine
procedure , public , nopass :: get_default_name => get_default_name_theta_grid_parameters_config Function
procedure , public , nopass :: get_default_requires_index => get_default_requires_index_theta_grid_parameters_config Function

Functions

public function get_parameters_as_surf() result(surf)

Packs all relevant parameters into a flux_surface_type instance. Note we can't fully populate the surface instance as we don't hold delrho

Arguments

None

Return Value type(flux_surface_type)

Gets the default name for this namelist

Arguments

None

Return Value character(len=CONFIG_MAX_NAME_LEN)

Gets the default requires index for this namelist

Arguments

None

Return Value logical

public pure function get_theta_grid_parameters_config()

Get the module level config instance

Arguments

None

Return Value type(theta_grid_parameters_config_type)


Subroutines

public subroutine init_theta_grid_params(theta_grid_parameters_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(theta_grid_parameters_config_type), intent(in), optional :: theta_grid_parameters_config_in

public subroutine finish_theta_grid_params()

FIXME : Add documentation

Arguments

None

private subroutine read_parameters(theta_grid_parameters_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(theta_grid_parameters_config_type), intent(in), optional :: theta_grid_parameters_config_in

public subroutine wnml_theta_grid_params(unit)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit

public subroutine set_overrides(mgeo_ov)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(miller_geometry_overrides_type), intent(in) :: mgeo_ov

public subroutine set_theta_grid_parameters_config(theta_grid_parameters_config_in)

Set the module level config type Will abort if the module has already been initialised to avoid inconsistencies.

Arguments

Type IntentOptional Attributes Name
type(theta_grid_parameters_config_type), intent(in), optional :: theta_grid_parameters_config_in

private subroutine read_theta_grid_parameters_config(self)

Reads in the theta_grid_parameters namelist and populates the member variables

Arguments

Type IntentOptional Attributes Name
class(theta_grid_parameters_config_type), intent(inout) :: self

private subroutine write_theta_grid_parameters_config(self, unit)

Writes out a namelist representing the current state of the config object

Arguments

Type IntentOptional Attributes Name
class(theta_grid_parameters_config_type), intent(in) :: self
integer, intent(in), optional :: unit

private subroutine reset_theta_grid_parameters_config(self)

Resets the config object to the initial empty state

Arguments

Type IntentOptional Attributes Name
class(theta_grid_parameters_config_type), intent(inout) :: self

private subroutine broadcast_theta_grid_parameters_config(self)

Broadcasts all config parameters so object is populated identically on all processors

Arguments

Type IntentOptional Attributes Name
class(theta_grid_parameters_config_type), intent(inout) :: self