Used to represent the input configuration of theta_grid
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? |
|
real, | public | :: | alpha_input | = | 0.0 |
Used in calculation of NoteThis gets a "smart" default. |
|
real, | public | :: | beta_prime_input | = | 0.0 |
The gradient of the pressure. Strictly speaking this parameter
is not but : in other words,
the gradient of the magnetic field is ignored. Used only if
NoteThis gets a "smart" default. |
|
integer, | public | :: | bishop | = | 5 |
Use Bishop relations to generate metric coefficients.
|
|
logical, | public | :: | chs_eq | = | .false. |
Use equilbrium data from the CHEASE file ogyropsi.dat |
|
real, | public | :: | delrho | = | 1e-3 |
Step size for radial derivatives, . Should be "small enough", typically 0.001. |
|
logical, | public | :: | dfit_eq | = | .false. |
Vacuum magnetic dipole geometry |
|
real, | public | :: | dp_mult | = | 1.0 |
Used to scale the pressure gradient, only if bishop = 7 or 8. |
|
logical, | public | :: | efit_eq | = | .false. |
Use EFIT equilibrium (EFIT, codes with eqdsk format) |
|
character(len=EQFILE_LENGTH), | public | :: | eqfile | = | "default_unset_value" |
Name of file with numerical equilibrium data (if required) |
|
character(len=EQFILE_LENGTH), | public | :: | eqnormfile | = | "default_unset_value" |
Name of file with numerical equilibrium normalization data (if required) currently, only used for dipole equilibrium (deq) |
|
logical, | public | :: | equal_arc | = | .true. |
Change field-line coordinate. Recommended value: F NoteWe recommend |
|
logical, | public | :: | force_sym | = | .false. |
If true then forces up-down symmetry in some geometrical quantities |
|
logical, | public | :: | gen_eq | = | .false. |
Use Toq-style NetCDF equilibrium (TOQ) |
|
logical, | public | :: | gs2d_eq | = | .false. |
Read Colin Roach's GS2D equilibrium file |
|
logical, | public | :: | idfit_eq | = | .false. |
Unknown equilibrium file. You probably don't want this. FIXME: Add documentation |
|
integer, | public | :: | iflux | = | -1 |
Deprecated -- redundant information. |
|
real, | public | :: | invlp_input | = | 0. |
Used with bishop == 3: controls pressure length scale by multiplying |
|
integer, | public | :: | irho | = | 2 |
Choose definition of flux surface coordinate
NB For consistency fprim, tprim, shat, uprim, g_exb etc must be computed using same radial variable, i.e. depend on choice of irho! |
|
integer, | public | :: | isym | = | -1 |
Deprecated, see force_sym instead |
|
integer, | public | :: | itor | = | -1 |
Deprecated, see use_large_aspect instead |
|
logical, | public | :: | local_eq | = | .true. |
If |
|
integer, | public | :: | ntheta_geometry | = | -1 |
The number of theta grid points to use in eikcoefs calls. Currently may not have an effect for all equilibrium types. If not set then defaults to ntheta |
|
logical, | public | :: | ppl_eq | = | .false. |
Use Menard-style NetCDF equilibrium (JSOLVER) |
|
real, | public | :: | s_hat_input | = | 0.0 |
Used to overrides s_hat prescribed by the numerical equilibrium, but only if bishop=2,3,4,5,8, or 9. NoteThis gets a "smart" default. |
|
logical, | public | :: | transp_eq | = | .false. |
Use PPL NetCDF equilibrium (psipqgrz equilibrium from TRANSP/TRXPL) |
|
logical, | public | :: | use_large_aspect | = | .false. |
If true use large aspect ratio expansions in eik geometry to get ~s-alpha |
|
logical, | public | :: | writelots | = | .false. |
Write a little extra about geometry to the screen. |
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 theta_grid_eik_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(theta_grid_eik_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(theta_grid_eik_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(theta_grid_eik_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(theta_grid_eik_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 theta_grid_eik_config_type instance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(theta_grid_eik_config_type), | intent(inout) | :: | self |
type, extends(abstract_config_type) :: theta_grid_eik_config_type
! namelist : theta_grid_eik_knobs
! indexed : false
!> Used in calculation of `dp_new = -alpha_input/qval**2/rmaj*drhodpsi`
!> @note This gets a "smart" default.
real :: alpha_input = 0.0
!> The gradient of the pressure. Strictly speaking this parameter
!> is not \(\frac{\partial \beta}{\partial \rho}\) but \(\beta
!> \frac{1}{p}\frac{\partial p}{\partial \rho}\): in other words,
!> the gradient of the magnetic field is ignored. Used only if
!> `bishop` = 4 or 9.
!> @note This gets a "smart" default.
real :: beta_prime_input = 0.0
!> Use Bishop relations to generate metric coefficients.
!>
!> - 0: Use high-aspect ratio coefficients (only for debugging)
!> - 1: Use actual equilibrium values of shat, p' recommended
!> - 2: Use numerical equilibrium + s_hat_input and p_prime_input
!> - 3: Use numerical equilibrium + s_hat_input and inv_Lp_input
!> - 4: Use numerical equilibrium + s_hat_input and beta_prime_input
!> - 5: Use numerical equilibrium + s_hat_input and alpha_input
!> - 6: Use numerical equilibrium + beta_prime_input
!> - 7: Use numerical equilibrium and multiply pressure gradient by dp_mult
!> - 8: Use numerical equilibrium + s_hat_input and multiply pressure gradient by dp_mult
!> - 9: Use numerical equilibrium + s_hat_input and beta_prime_input
!> - Otherwise: Use magnetic shear and pressure gradient as set elsewhere.
!>
integer :: bishop = 5
!> Use equilbrium data from the CHEASE file ogyropsi.dat
logical :: chs_eq = .false.
!> Step size for radial derivatives, \(\Delta r_{\psi N}\). Should be
!> "small enough", typically 0.001.
real :: delrho = 1e-3
!> Vacuum magnetic dipole geometry
logical :: dfit_eq = .false.
!> Used to scale the pressure gradient, only if bishop = 7 or 8.
real :: dp_mult = 1.0
!> Use EFIT equilibrium (EFIT, codes with eqdsk format)
logical :: efit_eq = .false.
!> Name of file with numerical equilibrium data (if required)
character(len = EQFILE_LENGTH) :: eqfile = "default_unset_value"
!> Name of file with numerical equilibrium normalization data (if required)
!> currently, only used for dipole equilibrium (deq)
character(len = EQFILE_LENGTH) :: eqnormfile = "default_unset_value"
!> Change field-line coordinate. Recommended value: F
!> @note We recommend `.false.` but default to `.true.`. We should consider
!> changing the default.
logical :: equal_arc = .true.
!> If true then forces up-down symmetry in some geometrical quantities
logical :: force_sym = .false.
!> Use Toq-style NetCDF equilibrium (TOQ)
logical :: gen_eq = .false.
!> Read Colin Roach's GS2D equilibrium file
logical :: gs2d_eq = .false.
!> Unknown equilibrium file. You probably don't want this.
!> FIXME: Add documentation
logical :: idfit_eq = .false.
!> Deprecated -- redundant information.
integer :: iflux = -1
!> Used with [[theta_grid_eik_knobs:bishop]] == 3: controls pressure length
!> scale by multiplying \(p \frac{d \rho}{d \psi}\)
real :: invlp_input = 0.
!> Choose definition of flux surface coordinate
!>
!> - 1: rho == sqrt(toroidal flux)/sqrt(toroidal flux of LCFS)
!> - 2: rho == midplane diameter/LCFS diameter - Recommended
!> - 3: rho == poloidal flux/poloidal flux of LCFS
!> - 4: rho == rho_mid (vacuum ring dipole, `dfit_eq = T`, only)
!>
!> NB For consistency fprim, tprim, shat, uprim, g_exb etc
!> *must be computed using same radial variable*,
!> i.e. *depend on choice of irho*!
integer :: irho = 2
!> Deprecated, see force_sym instead
integer :: isym = -1
!> Deprecated, see use_large_aspect instead
integer :: itor = -1
!> If `.true.` use Miller-style local equilibrium else use other
!> numerical equilibrium types
logical :: local_eq = .true.
!> The number of theta grid points to use in eikcoefs calls.
!> Currently may not have an effect for all equilibrium types.
!> If not set then defaults to [[theta_grid_parameters:ntheta]]
integer :: ntheta_geometry = -1
!> Use Menard-style NetCDF equilibrium (JSOLVER)
logical :: ppl_eq = .false.
!> Used to overrides s_hat prescribed by the numerical
!> equilibrium, but _only_ if bishop=2,3,4,5,8, or 9.
!> @note This gets a "smart" default.
real :: s_hat_input = 0.0
!> Use PPL NetCDF equilibrium (psipqgrz equilibrium from TRANSP/TRXPL)
logical :: transp_eq = .false.
!> If true use large aspect ratio expansions in eik geometry to get ~s-alpha
logical :: use_large_aspect = .false.
!> Write a little extra about geometry to the screen.
logical :: writelots = .false.
contains
procedure, public :: read => read_theta_grid_eik_config
procedure, public :: write => write_theta_grid_eik_config
procedure, public :: reset => reset_theta_grid_eik_config
procedure, public :: broadcast => broadcast_theta_grid_eik_config
procedure, public, nopass :: get_default_name => get_default_name_theta_grid_eik_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_theta_grid_eik_config
procedure :: set_smart_defaults => set_smart_defaults_local
end type theta_grid_eik_config_type