Used to represent the input configuration of kt_grids_box
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? |
|
logical, | public | :: | skip_smart_defaults | = | .false. |
Do we want to skip the smaart defaults in init? |
|
integer, | public | :: | jtwist | = | 1 |
For finite magnetic shear determines the box size in the x
direction according to . This also affects the number
of connections at each This gets a smart default Initialised to |
|
real, | public | :: | ly | = | 0.0 |
Sets the box size in the y direction. If set to 0 (the default) then
we set |
|
integer, | public | :: | n0 | = | 0 |
If set greater than zero (the default) then this sets the
toroidal mode number of the first non-zero |
|
integer, | public | :: | naky | = | 0 |
The actual number of ky modes. For nonlinear runs it is
generally recommended to use |
|
integer, | public | :: | ntheta0 | = | 0 |
The actual number of theta0 modes. For nonlinear runs it is
generally recommended to use |
|
integer, | public | :: | nx | = | 0 |
The number of kx points in inputs to the fft routines, and
hence the number of radial points used in real space
calculations. This differs from the actual number of kx points
simulated in the rest of the code due to the need to prevent
aliasing. The number of kx modes actually simulated
( |
|
integer, | public | :: | ny | = | 0 |
The number of ky points in inputs to the fft routines, and
hence the number of binormal points used in real space
calculations. This differs from the actual number of ky points
simulated in the rest of the code due to the need to prevent
aliasing. The number of ky modes actually simulated
( |
|
real, | public | :: | rhostar_box | = | 0.0 |
The rhostar ( |
|
real, | public | :: | rtwist | = | 0.0 |
Expert usage only -- more documentation required. Used to control the kx spacing in simulations with effectively
zero shear () where linked boundaries are not
appropriate so periodic boundaries are used. Also only used if
|
|
real, | public | :: | x0 | = | 0. |
Controls the box length in the x direction (measured in the reference Larmour radius) if the magnetic shear is small (). The box size in the x direction is given by . See rtwist for an alternative. |
|
real, | public | :: | y0 | = | 2.0 |
Controls the box length in the y direction (measured in the
reference Larmour radius). The box size in the y direction is
given by . Note if |
Is this instance initialised?
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
Fully initialise the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | name | ||
logical, | intent(in), | optional | :: | requires_index | ||
integer, | intent(in), | optional | :: | index | ||
logical, | intent(in), | optional | :: | skip_smart_defaults | ||
logical, | intent(in), | optional | :: | skip_read | ||
logical, | intent(in), | optional | :: | skip_broadcast |
Do some standard setup/checking
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self | |||
character(len=*), | intent(in), | optional | :: | name | ||
logical, | intent(in), | optional | :: | requires_index | ||
integer, | intent(in), | optional | :: | index |
Write the namelist header for this instance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
integer, | intent(in) | :: | unit |
Returns the namelist name. Not very useful at the moment but may want to do more interesting things in the future
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
Returns the requires_index value. Allows access whilst keeping the variable private
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self |
Write the namelist footer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type character
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
character(len=*), | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type real
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
real, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type complex
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
complex, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type integer
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
integer, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type logical
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key | |||
logical, | intent(in) | :: | val | |||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type real array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
real, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type complex array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
complex, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Writes a {key,val} pair where the value is of type integer array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(in) | :: | self | |||
character(len=*), | intent(in) | :: | key | |||
integer, | intent(in), | dimension(:) | :: | val | ||
integer, | intent(in) | :: | unit |
Reads in the kt_grids_box_parameters namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(kt_grids_box_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(kt_grids_box_config_type), | intent(in) | :: | self | |||
integer, | intent(in), | optional | :: | unit |
Resets the config object to the initial empty state
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(kt_grids_box_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(kt_grids_box_config_type), | intent(inout) | :: | self |
Gets the default name for this namelist
Gets the default requires index for this namelist
Set the smart defaults for the kt_grids_box_config_type instance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(kt_grids_box_config_type), | intent(inout) | :: | self |
type, extends(abstract_config_type) :: kt_grids_box_config_type
! namelist : kt_grids_box_parameters
! indexed : false
!> For finite magnetic shear determines the box size in the x
!> direction according to \(L_x = L_y
!> \textrm{jtwist}/2\pi\hat{s}\). This also affects the number
!> of connections at each `ky` when linked boundary conditions
!> are selected in the [[dist_fn_knobs]] namelist.
!>
!> This gets a smart default Initialised to `jtwist =
!> max(int(2*pi*shat+0.5,1))` so that \(L_x\approx L_y\). If the
!> magnetic shear is less than around 0.16 then `jtwist` will
!> default to the minimum allowed value of 1.
integer :: jtwist = 1
!> Sets the box size in the y direction. If set to 0 (the default) then
!> we set `ly=2*pi*y0`.
real :: ly = 0.0
!> If set greater than zero (the default) then this sets the
!> toroidal mode number of the first non-zero `ky` by overriding
!> the value given for `y0` through `y0 =
!> 1.0/(n0*rhostar_box*drhodpsi)` where `drhodpsi` is determined
!> during geometry setup.
integer :: n0 = 0
!> The actual number of ky modes. For nonlinear runs it is
!> generally recommended to use `ny` instead. If set to 0 (the
!> default) this will be automatically set to `1 + (ny-1)/3`. If
!> both `ny` and `naky` are set then GS2 will check that `ny`
!> is sufficiently high to ensure de-aliasing. It can be larger
!> than this minimum value. Setting both values can be useful to
!> allow values to be selected which are performant for the FFTs
!> and provide a good range of sweetspots.
integer :: naky = 0
!> The actual number of theta0 modes. For nonlinear runs it is
!> generally recommended to use `nx` instead. If set to 0 (the
!> default) this will be automatically set to `1 + 2*(nx-1)/3`.
!> If both `nx` and `ntheta0` are set then GS2 will check that
!> `nx` is sufficiently high to ensure de-aliasing. It can be
!> larger than this minimum value. Setting both values can be
!> useful to allow values to be selected which are performant for
!> the FFTs and provide a good range of sweetspots.
integer :: ntheta0 = 0
!> The number of kx points in inputs to the fft routines, and
!> hence the number of radial points used in real space
!> calculations. This differs from the actual number of kx points
!> simulated in the rest of the code due to the need to prevent
!> aliasing. The number of kx modes actually simulated
!> (`ntheta0`) is, by default, equal to `1 + 2*(nx - 1)/3`.
integer :: nx = 0
!> The number of ky points in inputs to the fft routines, and
!> hence the number of binormal points used in real space
!> calculations. This differs from the actual number of ky points
!> simulated in the rest of the code due to the need to prevent
!> aliasing. The number of ky modes actually simulated
!> (`naky`) is, by default, equal to `1 + (ny - 1)/3`.
integer :: ny = 0
!> The rhostar (`rhoref/Lref`) to use. Only used if `n0` also set
!> greater than zero. If `rhostar_box` and `n0` are greater than
!> zero then `y0=1.0/(n0*rhostar_box*drhodpsi)`, which
!> effectively sets the minimum non-zero `ky` used in the
!> simulation.
real :: rhostar_box = 0.0
!> Expert usage only -- more documentation required.
!>
!> Used to control the kx spacing in simulations with effectively
!> zero shear (\(\< 10^{-5}\)) where linked boundaries are not
!> appropriate so periodic boundaries are used. Also only used if
!> `x0` has been set to zero (the default). If `rtwist` is set to
!> 0.0 (the default) then it is set to the value of
!> `jtwist`. Effectively ends up setting the box size in the x
!> direction, as \(L_x = L_y \textrm{rtwist}\) if `rtwist > 0 `
!> and \(L_x = L_y / \textrm{rtwist}\) if `rtwist < 0`. See
!> [[kt_grids_box_parameters:x0]] for an alternative.
real :: rtwist = 0.0
!> Controls the box length in the x direction (measured in the
!> reference Larmour radius) if the magnetic shear is small (\(\<
!> 10^{-5}\)). The box size in the x direction is given by \(L_x
!> = 2\pi x_0\). See [[kt_grids_box_parameters:rtwist]] for an
!> alternative.
real :: x0 = 0.
!> Controls the box length in the y direction (measured in the
!> reference Larmour radius). The box size in the y direction is
!> given by \(L_y = 2\pi y_0\). Note if `y0` is set negative
!> then, it is replaced with `-1/y0` and Effectively sets the
!> minimum wavelength captured by the box.
real :: y0 = 2.0
contains
procedure, public :: read => read_kt_grids_box_config
procedure, public :: write => write_kt_grids_box_config
procedure, public :: reset => reset_kt_grids_box_config
procedure, public :: broadcast => broadcast_kt_grids_box_config
procedure, public, nopass :: get_default_name => get_default_name_kt_grids_box_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_kt_grids_box_config
procedure :: set_smart_defaults => set_smart_defaults_local
end type kt_grids_box_config_type