Used to represent the input configuration of theta_grid_salpha
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 | :: | alpmhdfac | = | 0.0 |
Used in conjunction with alpmhd to override
|
|
real, | public | :: | alpha1 | = | 0.0 |
Coefficient in model when |
|
character(len=20), | public | :: | model_option | = | "default" |
Sets the particular model for the magnetic field and related drifts. NB: All options have gbdrift = cvdrift except where noted. Can be one of
NB: For the final two options here ('const-curv' and 'no-curvature') (See also ingen output and contents of theta_grid.f90 for further details |
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 |
An no-op implementation of the set_smart_defaults method. Unless over-ridden the specific config instance will have no smart defaults applied.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(abstract_config_type), | intent(inout) | :: | self |
Has to be intent in out as over-riding procedures need to change 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_salpha_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(theta_grid_salpha_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_salpha_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_salpha_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_salpha_config_type), | intent(inout) | :: | self |
Gets the default name for this namelist
Gets the default requires index for this namelist
type, extends(abstract_config_type) :: theta_grid_salpha_config_type
! namelist : theta_grid_salpha_knobs
! indexed : false
!> Used in conjunction with [[theta_grid_parameters:alpmhd]] to override
!> `shift`, set as `shift=-alpmhd*alpmhdfac`.
real :: alpmhdfac = 0.0
!> Coefficient in model when `model_option='alpha1'` has been selected.
real :: alpha1 = 0.0
!> Sets the particular model for the magnetic field and related
!> drifts. NB: All options have gbdrift = cvdrift except where
!> noted. Can be one of
!>
!> - 's-alpha' - High aspect ratio toroidal equilibrium
!> - 'default' - Same as 's-alpha'
!> - 'alpha1' - Mainly same as 's-alpha' but with different
!> definition of bmag and bset
!> - 'rogers' - (aka. model_eps) From ingen output: "This model
!> differs from the normal s-alpha model only in the curv and
!> grad_B drifts." Indeed, cvdrift and gbdrift have an extra
!> term, -(epsl*eps), while cvdrift0 and gbdrift0 are the same
!> as 's-alpha'
!> - 'b2' - From ingen output: "This model differs from the normal
!> s-alpha model by an additional factor of 1/B(theta)**2 in the
!> curv and grad_B drifts." Definition of bmag is also different.
!> - 'normal_only' - Different definition of cvdrift (shat and
!> shift terms removed) and cvdrift0 set to zero. Presumably this
!> means that only the component of the curvature drift normal to
!> the flux surface is retained while the component on the
!> surface is 0. Useful for picking apart the effect of
!> parameters on drifts and the effects of drifts on other
!> quantities such as stability.
!> - 'const-curv' - From ingen output: "Constant curvature is
!> assumed. The grad-B and curvature drifts are both = epsl",
!> i.e. shape = 'cylinder' NB: in contradiction to ingen output,
!> gbdrift is not equal to cvdrift since cvdrift = epsl but
!> gbdrift = cvdrift*(1.-shift). However, gbdrift0 = cvdrift0 =
!> 0.
!> - 'no-curvature' - From ingen output "Zero curvature is
!> assumed", i.e. shape = 'slab'. NB: cvdrift = cvdrift0 =
!> gbdrift0 = 0 but gbdrift is not 0 (gbdrift = epsl). NB: This
!> does not yield the same result as cvdriftknob=0 in 's-alpha'
!> model with non-zero epsl
!>
!> NB: For the final two options here ('const-curv' and 'no-curvature')
!> (See also ingen output and contents of [[theta_grid.f90]] for further details
character(len = 20) :: model_option = "default"
contains
procedure, public :: read => read_theta_grid_salpha_config
procedure, public :: write => write_theta_grid_salpha_config
procedure, public :: reset => reset_theta_grid_salpha_config
procedure, public :: broadcast => broadcast_theta_grid_salpha_config
procedure, public, nopass :: get_default_name => get_default_name_theta_grid_salpha_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_theta_grid_salpha_config
end type theta_grid_salpha_config_type