kt_grids Module

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



Contents


Variables

Type Visibility Attributes Name Initial
logical, public, dimension(:,:), allocatable :: kwork_filter
real, public, dimension (:,:,:), allocatable :: kperp2
real, public, dimension (:,:,:), allocatable :: inv_kperp2
real, public, dimension (:,:), allocatable :: theta0

The grid

real, public, dimension (:), allocatable :: akx

The grid

real, public, dimension (:), allocatable :: aky

The grid

integer, public, dimension(:), allocatable :: ikx

Discrete kx grid index

integer, public :: naky

Number of points

integer, public :: ntheta0

Number of points

integer, public :: nx

Number of (real space) points

integer, public :: ny

Number of (real space) points

integer, public :: jtwist_out

Related to the box size in x. See jtwist

character(len=20), public :: grid_option

The type of perpendicular wavenumber grid used. See grid_option

integer, public :: gridopt_switch
integer, public, parameter :: gridopt_single = 1
integer, public, parameter :: gridopt_range = 2
integer, public, parameter :: gridopt_specified = 3
integer, public, parameter :: gridopt_box = 4
logical, public :: reality = .false.
logical, public :: box = .false.
logical, private :: initialized = .false.
logical, private :: kp2init = .false.
logical, private :: nml_exist
logical, private :: parameters_read = .false.
type(kt_grids_config_type), private :: kt_grids_config

Derived Types

type, public, extends(abstract_config_type) ::  kt_grids_config_type

Used to represent the input configuration of kt_grids

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 :: grid_option = "default"

Controls the type of perpendicular wavenumber grid to use. Can be one of

Read more…

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_kt_grids_config Subroutine
procedure , public :: write => write_kt_grids_config Subroutine
procedure , public :: reset => reset_kt_grids_config Subroutine
procedure , public :: broadcast => broadcast_kt_grids_config Subroutine
procedure , public , nopass :: get_default_name => get_default_name_kt_grids_config Function
procedure , public , nopass :: get_default_requires_index => get_default_requires_index_kt_grids_config Function

Functions

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_kt_grids_config()

Get the module level config instance

Arguments

None

Return Value type(kt_grids_config_type)


Subroutines

public subroutine init_kt_grids_parameters(kt_grids_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(kt_grids_config_type), intent(in), optional :: kt_grids_config_in

public subroutine finish_kt_grids_parameters()

FIXME : Add documentation

Arguments

None

public subroutine set_overrides(grids_ov)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(kt_grids_overrides_type), intent(in) :: grids_ov

public subroutine init_kt_grids(kt_grids_config_in)

FIXME : Add documentation

Read more…

Arguments

Type IntentOptional Attributes Name
type(kt_grids_config_type), intent(in), optional :: kt_grids_config_in

private subroutine read_parameters_internal(kt_grids_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(kt_grids_config_type), intent(in), optional :: kt_grids_config_in

public subroutine wnml_kt(unit)

FIXME : Add documentation

Arguments

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

private subroutine allocate_arrays()

FIXME : Add documentation

Arguments

None

private subroutine get_sizes()

FIXME : Add documentation

Arguments

None

private subroutine get_grids()

FIXME : Add documentation

Arguments

None

private subroutine init_kperp2()

FIXME : Add documentation

Arguments

None

public subroutine finish_kt_grids()

FIXME : Add documentation

Arguments

None

public subroutine check_kt_grids(report_unit)

FIXME : Add documentation

Arguments

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

public subroutine set_kt_grids_config(kt_grids_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(kt_grids_config_type), intent(in), optional :: kt_grids_config_in

private subroutine read_kt_grids_config(self)

Reads in the kt_grids_knobs namelist and populates the member variables

Arguments

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

private subroutine write_kt_grids_config(self, unit)

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

Arguments

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

private subroutine reset_kt_grids_config(self)

Resets the config object to the initial empty state

Arguments

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

private subroutine broadcast_kt_grids_config(self)

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

Arguments

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