PB3D  [2.45]
Ideal linear high-n MHD stability in 3-D
Interfaces and Types | Functions/Subroutines | Variables
x_vars Module Reference

Variables pertaining to the perturbation quantities. More...

Interfaces and Types

type  modes_type
 mode number type More...
 
interface  set_nm_x
 Sets n_X and m_X. More...
 
type  x_1_type
 vectorial perturbation type More...
 
type  x_2_type
 tensorial perturbation type More...
 

Functions/Subroutines

subroutine init_x_1 (X, mds, grid_X, lim_sec_X)
 Initializes a vectorial perturbation. More...
 
subroutine init_x_2 (X, mds, grid_X, lim_sec_X, is_field_averaged)
 Initializes a tensorial perturbation. More...
 
subroutine copy_x_1 (X_i, mds, grid_i, X_o)
 Deep copy of vectorial perturbation variables. More...
 
subroutine copy_x_2 (X_i, mds, grid_i, X_o)
 Deep copy of tensorial perturbation variables. More...
 
integer function, public set_nn_mod (sym, lim_sec_X)
 Sets number of entries for tensorial perturbation variables. More...
 
subroutine dealloc_mds (mds)
 Deallocates modes variables. More...
 
subroutine dealloc_x_1 (X)
 Deallocates vectorial perturbation variables. More...
 
subroutine dealloc_x_2 (X)
 Deallocates tensorial perturbation variables. More...
 

Variables

type(modes_type), public mds_x
 modes variables for perturbation grid More...
 
type(modes_type), public mds_sol
 modes variables for solution grid More...
 
integer, public prim_x
 n_X (pol. flux) or m_X (tor. flux) More...
 
integer, public min_sec_x
 m_X (pol. flux) or n_X (tor. flux) (only for X style 1) More...
 
integer, public max_sec_x
 m_X (pol. flux) or n_X (tor. flux) (only for\ c X style 1) More...
 
integer, public n_mod_x
 size of m_X (pol. flux) or n_X (tor. flux) More...
 
integer, public min_nm_x = 5
 minimum for the high-n theory (debable) More...
 
integer, dimension(:), allocatable, public min_n_x
 lowest poloidal mode number m_X, in total eq grid More...
 
integer, dimension(:), allocatable, public max_n_x
 highest poloidal mode number m_X, in total eq grid More...
 
integer, dimension(:), allocatable, public min_m_x
 lowest poloidal mode number m_X, in total eq grid More...
 
integer, dimension(:), allocatable, public max_m_x
 highest poloidal mode number m_X, in total eq grid More...
 
real(dp), public min_r_sol
 min. normal range for pert. More...
 
real(dp), public max_r_sol
 max. normal range for pert. More...
 
integer, public n_alloc_x_1s
 nr. of allocated X_1's More...
 
integer, public n_alloc_x_2s
 nr. of allocated X_2's More...
 

Detailed Description

Variables pertaining to the perturbation quantities.

Function/Subroutine Documentation

◆ copy_x_1()

subroutine x_vars::copy_x_1 ( class(x_1_type), intent(in)  X_i,
type(modes_type), intent(in)  mds,
type(grid_type), intent(in)  grid_i,
type(x_1_type), intent(inout)  X_o 
)

Deep copy of vectorial perturbation variables.

Parameters
[in]x_iX_1 to be copied
[in]mdsgeneral modes variables
[in]grid_igrid of eq_i
[in,out]x_ocopied X_1

Definition at line 338 of file X_vars.f90.

◆ copy_x_2()

subroutine x_vars::copy_x_2 ( class(x_2_type), intent(in)  X_i,
type(modes_type), intent(in)  mds,
type(grid_type), intent(in)  grid_i,
type(x_2_type), intent(inout)  X_o 
)

Deep copy of tensorial perturbation variables.

Parameters
[in]x_iX_2 to be copied
[in]mdsgeneral modes variables
[in]grid_igrid of eq_i
[in,out]x_ocopied X_1

Definition at line 359 of file X_vars.f90.

◆ dealloc_mds()

subroutine x_vars::dealloc_mds ( class(modes_type), intent(inout)  mds)

Deallocates modes variables.

Parameters
[in,out]mdsmodes variables to be deallocated

Definition at line 412 of file X_vars.f90.

◆ dealloc_x_1()

subroutine x_vars::dealloc_x_1 ( class(x_1_type), intent(inout)  X)

Deallocates vectorial perturbation variables.

Parameters
[in,out]xperturbation variables to be deallocated

Definition at line 428 of file X_vars.f90.

+ Here is the call graph for this function:

◆ dealloc_x_2()

subroutine x_vars::dealloc_x_2 ( class(x_2_type), intent(inout)  X)

Deallocates tensorial perturbation variables.

Parameters
[in,out]xperturbation variables to be deallocated

Definition at line 474 of file X_vars.f90.

+ Here is the call graph for this function:

◆ init_x_1()

subroutine x_vars::init_x_1 ( class(x_1_type), intent(inout)  X,
type(modes_type), intent(in)  mds,
type(grid_type), intent(in)  grid_X,
integer, dimension(2), intent(in), optional  lim_sec_X 
)

Initializes a vectorial perturbation.

Allocates the variables, the number of modes, as well as n and m .

Optionally, the secondary mode numbers can be specified (m if poloidal flux is used and n if toroidal flux). By default, they are taken from the global X_vars variables.

Note
If the lowest limits of the grid is not 1 (e.g. grid_soli_min = 1 for first process), the input variable i_min should be set to set correctly. For a full grid, it should be set to 1.
Parameters
[in,out]xvectorial perturbation variables
[in]mdsgeneral modes variables
[in]grid_xperturbation grid
[in]lim_sec_xlimits of m_X (pol. flux) or n_X (tor. flux)

Definition at line 204 of file X_vars.f90.

+ Here is the call graph for this function:

◆ init_x_2()

subroutine x_vars::init_x_2 ( class(x_2_type), intent(inout)  X,
type(modes_type), intent(in)  mds,
type(grid_type), intent(in)  grid_X,
integer, dimension(2,2), intent(in), optional  lim_sec_X,
logical, intent(in), optional  is_field_averaged 
)

Initializes a tensorial perturbation.

See also
See init_X_1().
Note
The tensorial perturbation type can also be used for field-aligned variables, in which case the first index is assumed to have dimension 1 only. This can be triggered using is_field_averaged. There is no difference between a tensorial perturbation type with size of first dimension set to one through the use of this flag, or through other means.
Parameters
[in,out]xtensorial perturbation variables
[in]mdsgeneral modes variables
[in]grid_xperturbation grid
[in]lim_sec_xlimits of m_X (pol. flux) or n_X (tor. flux) for both dimensions
[in]is_field_averagedif field-aligned, only one dimension for first index

Definition at line 271 of file X_vars.f90.

+ Here is the call graph for this function:

◆ set_nn_mod()

integer function, public x_vars::set_nn_mod ( logical, intent(in)  sym,
integer, dimension(2,2), intent(in), optional  lim_sec_X 
)

Sets number of entries for tensorial perturbation variables.

Parameters
[in]symwhether the variable is symmetric
[in]lim_sec_xlimits of m_X (pol flux) or n_X (tor flux) for both dimensions

Definition at line 383 of file X_vars.f90.

+ Here is the caller graph for this function:

Variable Documentation

◆ max_m_x

integer, dimension(:), allocatable, public x_vars::max_m_x

highest poloidal mode number m_X, in total eq grid

Definition at line 134 of file X_vars.f90.

◆ max_n_x

integer, dimension(:), allocatable, public x_vars::max_n_x

highest poloidal mode number m_X, in total eq grid

Definition at line 132 of file X_vars.f90.

◆ max_r_sol

real(dp), public x_vars::max_r_sol

max. normal range for pert.

Definition at line 136 of file X_vars.f90.

◆ max_sec_x

integer, public x_vars::max_sec_x

m_X (pol. flux) or n_X (tor. flux) (only for\ c X style 1)

Definition at line 128 of file X_vars.f90.

◆ mds_sol

type(modes_type), public x_vars::mds_sol

modes variables for solution grid

Definition at line 125 of file X_vars.f90.

◆ mds_x

type(modes_type), public x_vars::mds_x

modes variables for perturbation grid

Definition at line 124 of file X_vars.f90.

◆ min_m_x

integer, dimension(:), allocatable, public x_vars::min_m_x

lowest poloidal mode number m_X, in total eq grid

Definition at line 133 of file X_vars.f90.

◆ min_n_x

integer, dimension(:), allocatable, public x_vars::min_n_x

lowest poloidal mode number m_X, in total eq grid

Definition at line 131 of file X_vars.f90.

◆ min_nm_x

integer, public x_vars::min_nm_x = 5

minimum for the high-n theory (debable)

Definition at line 130 of file X_vars.f90.

◆ min_r_sol

real(dp), public x_vars::min_r_sol

min. normal range for pert.

Definition at line 135 of file X_vars.f90.

◆ min_sec_x

integer, public x_vars::min_sec_x

m_X (pol. flux) or n_X (tor. flux) (only for X style 1)

Definition at line 127 of file X_vars.f90.

◆ n_alloc_x_1s

integer, public x_vars::n_alloc_x_1s

nr. of allocated X_1's

Note
Debug version only

Definition at line 138 of file X_vars.f90.

◆ n_alloc_x_2s

integer, public x_vars::n_alloc_x_2s

nr. of allocated X_2's

Note
Debug version only

Definition at line 139 of file X_vars.f90.

◆ n_mod_x

integer, public x_vars::n_mod_x

size of m_X (pol. flux) or n_X (tor. flux)

Definition at line 129 of file X_vars.f90.

◆ prim_x

integer, public x_vars::prim_x

n_X (pol. flux) or m_X (tor. flux)

Definition at line 126 of file X_vars.f90.