Used to represent the input configuration of theta_grid_gridgen
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? |
|
real, | public | :: | alknob | = | 0.0 |
Relative weighting of pitch-angle metric to metric |
|
real, | public | :: | bpknob | = | 1.e-8 |
Consider when the right grid point is equal to the target bmag. FIXME: What does this mean? |
|
real, | public | :: | deltaw | = | 0.0 |
Parameter for weighted resolution in theta. Each theta grid point contributes to the resolution metric according to the function which has peaks at theta = +/- thetamax and deltaw controls the relative weighting of the theta dependent contribution. |
|
real, | public | :: | epsknob | = | 1e-5 |
Maximum difference between neighbouring points for determining if a point is an extremum. |
|
real, | public | :: | extrknob | = | 0.0 |
Used to set a "bonus" contribtion to resolution at B extrema with an even number of theta grid points. Those with an odd number of points and the assumed extrema at -pi have a metric of 1e20. Here extrknob can be used to bias the algorithm towards keeping extrema with an even number of points. |
|
integer, | public | :: | npadd | = | 2 |
Number of points between original grid points to oversample by |
|
real, | public | :: | regrid_tension | = | -1.0 |
Tension to use in interpolating splines for regrid of geometrical quantities Defaults to tension if not set. |
|
logical, | public | :: | skip_gridgen | = | .false. |
If true then skip gridgen call and instead just use the existing grid. NoteThis is primarily for debugging and testing. When active we are effectively forced to assumed that the input bmag is symmetric and monotonic. If this is not true then we should not trust the results. |
|
real, | public | :: | tension | = | 1.0 |
Tension for spline |
|
real, | public | :: | thetamax | = | 0.0 |
Parameter for weighted resolution in theta. Each theta grid point contributes to the resolution metric according to the function which has peaks at theta = +/- thetamax. |
|
real, | public | :: | widthw | = | 1.0 |
Parameter for weighted resolution in theta. Each theta grid point contributes to the resolution metric according to the function which has peaks at theta = +/- thetamax and widthw controls the scale length of the peaks. |
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 |
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_gridgen_knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(theta_grid_gridgen_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_gridgen_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_gridgen_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_gridgen_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_gridgen_config_type
! namelist : theta_grid_gridgen_knobs
! indexed : false
!> Relative weighting of pitch-angle metric to \(\theta\) metric
real :: alknob = 0.0
!> Consider when the right grid point is equal to the target bmag.
!>
!> FIXME: What does this mean?
real :: bpknob = 1.e-8
!> Parameter for weighted resolution in theta. Each theta grid point
!> contributes to the resolution metric according to the function
!> $$ 1 + deltaw *[ 1 / (1 + [theta-thetamax]**2/widthw**2) +
!> 1 / (1 + [theta+thetamax]**2/widthw**2)] $$
!> which has peaks at theta = +/- thetamax and deltaw controls the
!> relative weighting of the theta dependent contribution.
real :: deltaw = 0.0
!> Maximum difference between neighbouring points for determining
!> if a point is an extremum.
real :: epsknob = 1e-5
!> Used to set a "bonus" contribtion to resolution at B extrema with an
!> even number of theta grid points. Those with an odd number of points
!> and the assumed extrema at -pi have a metric of 1e20. Here extrknob
!> can be used to bias the algorithm towards keeping extrema with an
!> even number of points.
real :: extrknob = 0.0
!> Number of points between original grid points to oversample \(\theta\) by
integer :: npadd = 2
!> Tension to use in interpolating splines for regrid of geometrical quantities
!> Defaults to [[theta_grid_gridgen_config_type:tension]] if not set.
real :: regrid_tension = -1.0
!> If true then skip gridgen call and instead just use the existing grid.
!>
!> @note This is primarily for debugging and testing. When active we are
!> effectively forced to assumed that the input bmag is symmetric and
!> monotonic. If this is not true then we should not trust the results.
logical :: skip_gridgen = .false.
!> Tension for \(B\) spline
real :: tension = 1.0
!> Parameter for weighted resolution in theta. Each theta grid point
!> contributes to the resolution metric according to the function
!> $$ 1 + deltaw *[ 1 / (1 + [theta-thetamax]**2/widthw**2) +
!> 1 / (1 + [theta+thetamax]**2/widthw**2)] $$
!> which has peaks at theta = +/- thetamax.
real :: thetamax = 0.0
!> Parameter for weighted resolution in theta. Each theta grid point
!> contributes to the resolution metric according to the function
!> $$ 1 + deltaw *[ 1 / (1 + [theta-thetamax]**2/widthw**2) +
!> 1 / (1 + [theta+thetamax]**2/widthw**2)] $$
!> which has peaks at theta = +/- thetamax and widthw controls the
!> scale length of the peaks.
real :: widthw = 1.0
contains
procedure, public :: read => read_theta_grid_gridgen_config
procedure, public :: write => write_theta_grid_gridgen_config
procedure, public :: reset => reset_theta_grid_gridgen_config
procedure, public :: broadcast => broadcast_theta_grid_gridgen_config
procedure, public, nopass :: get_default_name => get_default_name_theta_grid_gridgen_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_theta_grid_gridgen_config
end type theta_grid_gridgen_config_type