theta_grid Module

FIXME : Add documentation



Contents


Variables

Type Visibility Attributes Name Initial
real, public, dimension (:), allocatable :: theta
real, public, dimension (:), allocatable :: theta2
real, public, dimension (:), allocatable :: delthet
real, public, dimension (:), allocatable :: delthet2
real, public, dimension (:), allocatable :: bset
real, public, dimension (:), allocatable :: bmag
real, public, dimension (:), allocatable :: gradpar
real, public, dimension (:), allocatable :: itor_over_B
real, public, dimension (:), allocatable :: IoB
real, public, dimension (:), allocatable :: gbdrift
real, public, dimension (:), allocatable :: gbdrift0
real, public, dimension (:), allocatable :: cvdrift
real, public, dimension (:), allocatable :: cvdrift0
real, public, dimension (:), allocatable :: cdrift
real, public, dimension (:), allocatable :: cdrift0
real, public, dimension (:), allocatable :: gds2
real, public, dimension (:), allocatable :: gds21
real, public, dimension (:), allocatable :: gds22
real, public, dimension (:), allocatable :: gds23
real, public, dimension (:), allocatable :: gds24
real, public, dimension (:), allocatable :: gds24_noq
real, public, dimension (:), allocatable :: grho
real, public, dimension (:), allocatable :: jacob
real, public, dimension (:), allocatable :: Rplot
real, public, dimension (:), allocatable :: Zplot
real, public, dimension (:), allocatable :: aplot
real, public, dimension (:), allocatable :: Bpol
real, public, dimension (:), allocatable :: Rprime
real, public, dimension (:), allocatable :: Zprime
real, public, dimension (:), allocatable :: aprime
real, public :: bmin
real, public :: bmax
real, public :: eps_trapped
real, public :: shat
real, public :: drhodpsi
real, public :: kxfac
real, public :: qval
real, private :: cvdriftknob
real, private :: gbdriftknob
real, public :: surfarea
real, public :: dvdrhon
real, public :: rhoc
integer, public :: ntheta
integer, public :: ntgrid
integer, public :: nperiod
integer, public :: nbset
logical, public :: gb_to_cv
real, private, parameter :: smallest_non_zero_shear = 1.0e-5
integer, private :: eqopt_switch
integer, private, parameter :: eqopt_eik = 1
integer, private, parameter :: eqopt_salpha = 2
integer, private, parameter :: eqopt_file = 3
integer, private, parameter :: eqopt_file_nc = 4
character(len=8), public :: shape
logical, private :: exist
logical, public :: initialized = .false.
real, private :: field_line_average_weight
type(theta_grid_config_type), private :: theta_grid_config

Interfaces

public interface field_line_average

  • private function field_line_average_real(quantity) result(integral)

    Calculates the field line / theta average of a passed quantity

    Arguments

    Type IntentOptional Attributes Name
    real, intent(in), dimension(:) :: quantity

    Return Value real

  • private function field_line_average_complex(quantity) result(integral)

    Calculates the field line / theta average of a passed quantity

    Arguments

    Type IntentOptional Attributes Name
    complex, intent(in), dimension(:) :: quantity

    Return Value complex


Derived Types

type, public, extends(abstract_config_type) ::  theta_grid_config_type

Used to represent the input configuration of theta_grid

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?

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

Read more…
real, public :: gbdriftknob = 1.0

Scales the grad-B drift.

real, public :: cvdriftknob = 1.0

Scales the curvature drift.

logical, public :: gb_to_cv = .false.

If true then force grad-B drift to be equal to curvature drift. This is not recommended when fbpar is not 0.

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_config Subroutine
procedure , public :: write => write_theta_grid_config Subroutine
procedure , public :: reset => reset_theta_grid_config Subroutine
procedure , public :: broadcast => broadcast_theta_grid_config Subroutine
procedure , public , nopass :: get_default_name => get_default_name_theta_grid_config Function
procedure , public , nopass :: get_default_requires_index => get_default_requires_index_theta_grid_config Function

Functions

private function field_line_average_real(quantity) result(integral)

Calculates the field line / theta average of a passed quantity

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension(:) :: quantity

Return Value real

private function field_line_average_complex(quantity) result(integral)

Calculates the field line / theta average of a passed quantity

Arguments

Type IntentOptional Attributes Name
complex, intent(in), dimension(:) :: quantity

Return Value complex

public pure function is_effectively_zero_shear(shear_in) result(zero_shear)

Helper function to determine if the shear is small enough that we consider it to be zero for the purposes of periodicity etc.

Arguments

Type IntentOptional Attributes Name
real, intent(in), optional :: shear_in

Return Value logical

public function get_theta_grid_config()

Get the module level config instance

Arguments

None

Return Value type(theta_grid_config_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


Subroutines

public subroutine check_theta_grid(report_unit, alne, dbetadrho)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: report_unit
real, intent(in) :: alne
real, intent(in) :: dbetadrho

public subroutine wnml_theta_grid(unit)

FIXME : Add documentation

Arguments

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

public subroutine init_theta_grid(theta_grid_config_in, theta_grid_gridgen_config_in, theta_grid_salpha_config_in, theta_grid_file_config_in, theta_grid_eik_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(theta_grid_config_type), intent(in), optional :: theta_grid_config_in
type(theta_grid_gridgen_config_type), intent(in), optional :: theta_grid_gridgen_config_in
type(theta_grid_salpha_config_type), intent(in), optional :: theta_grid_salpha_config_in
type(theta_grid_file_config_type), intent(in), optional :: theta_grid_file_config_in
type(theta_grid_eik_config_type), intent(in), optional :: theta_grid_eik_config_in

public subroutine finish_theta_grid()

FIXME : Add documentation

Arguments

None

private subroutine broadcast_results()

FIXME : Add documentation

Arguments

None

private subroutine read_parameters(theta_grid_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(theta_grid_config_type), intent(in), optional :: theta_grid_config_in

private subroutine allocate_arrays()

FIXME : Add documentation

Arguments

None

private subroutine deallocate_arrays()

FIXME : Add documentation

Arguments

None

private subroutine finish_init()

FIXME : Add documentation

Arguments

None

private subroutine get_sizes(theta_grid_gridgen_config_in, theta_grid_salpha_config_in, theta_grid_file_config_in, theta_grid_eik_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(theta_grid_gridgen_config_type), intent(in), optional :: theta_grid_gridgen_config_in
type(theta_grid_salpha_config_type), intent(in), optional :: theta_grid_salpha_config_in
type(theta_grid_file_config_type), intent(in), optional :: theta_grid_file_config_in
type(theta_grid_eik_config_type), intent(in), optional :: theta_grid_eik_config_in

private subroutine get_grids()

FIXME : Add documentation

Arguments

None

public subroutine set_theta_grid_config(theta_grid_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_config_type), intent(in), optional :: theta_grid_config_in

private subroutine read_theta_grid_config(self)

Reads in the theta_grid_knobs namelist and populates the member variables

Arguments

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

private subroutine write_theta_grid_config(self, unit)

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

Arguments

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

private subroutine reset_theta_grid_config(self)

Resets the config object to the initial empty state

Arguments

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

private subroutine broadcast_theta_grid_config(self)

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

Arguments

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