Used to represent the input configuration of run_parameters through "knobs"
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 | :: | avail_cpu_time | = | 1.0e10 |
The maximum wall clock time available to GS2 |
|
real, | public | :: | beta | = | 0.0 |
is the ratio of the reference pressure to the reference magnetic energy density, . |
|
real, | public | :: | delt | = | 0.1 |
Initial timestep |
|
character(len=20), | public | :: | delt_option | = | 'default' |
Determines how initial timestep is set. Possible options are:
If "check_restart" is used but the restart files aren't present for any reason (for instance, the current run is not a restart), GS2 will error when trying to read the timesteps. You can run the ingen tool on your input file to check this issue before running your job |
|
logical, | public | :: | do_eigsolve | = | .false. |
If true then use eigensolver instead of initial value solver. |
|
character(len=20), | public | :: | eqzip_option | = | 'none' |
Advanced option to freeze evolution of certain modes. Possible values are:
Only used in dist_fn, should be moved to dist_fn_knobs. |
|
real, | public | :: | fapar | = | 0.0 |
Multiplies throughout. |
|
real, | public | :: | fbpar | = | -1.0 |
Multiplies throughout. |
|
real, | public | :: | fphi | = | 1.0 |
Multiplies throughout. |
|
logical, | public | :: | immediate_reset | = | .true. |
Determines the behaviour when the CFL condition is broken in the nonlinear term: |
|
real, | public | :: | margin_cpu_time | = | 300.0 |
How close to avail_cpu_time can we go before trying to stop the run cleanly |
|
real, | public | :: | max_sim_time | = | 1.0e6 |
The simulation time after which the run should stop. |
|
integer, | public | :: | ncheck_stop | = | 5 |
Sets the time step interval at which check for the existence
of the |
|
integer, | public | :: | nstep | = | 100 |
Maximum number of steps to take |
|
integer, | public | :: | progress_frequency | = | 0 |
How frequently, in integer steps, do we display a progress message. If <= 0 then no progress messages are displayed |
|
real, | public | :: | rhostar | = | 3.0e-3 |
Normalised gyro-radius, only used for low flow builds |
|
logical, | public | :: | save_init_times | = | .false. |
If true then save init timer information to
|
|
logical, | public | :: | save_timer_statistics | = | .true. |
If true then save some extra timer information to
|
|
integer, | public | :: | seed | = | 0 |
Used to set the random seed used in the random number generators provided by ran. If this input is 0 (the default) then we don't set the seed and use the system default instead. |
|
real, | public | :: | tite | = | 1.0 |
Only used when there is an adiabatic species. Sets |
|
logical, | public | :: | use_old_diagnostics | = | .false. |
If true use original diagnostics rather than new form |
|
character(len=65000), | public | :: | user_comments | = | '' |
Custom description of run to be added to netcdf output (new diagnostics only) |
|
logical, | public | :: | wstar_units | = | .false. |
If true makes timestep proportional to ky*rho. Only sensible for linear runs. |
|
real, | public | :: | zeff | = | 1.0 |
Effective ionic charge appearing in electron collision frequency |
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 knobs namelist and populates the member variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(knobs_config_type), | intent(inout) | :: | self |
Writes out a namelist representing the current state of the config object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(knobs_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(knobs_config_type), | intent(inout) | :: | self |
Broadcasts all config parameters so object is populated identically on all processors
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(knobs_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) :: knobs_config_type
! namelist : knobs
! indexed : false
!> The maximum wall clock time available to GS2
real :: avail_cpu_time = 1.0e10
!> \(\beta\) is the ratio of the reference pressure to the reference
!> magnetic energy density, \(\beta=2\mu_0n_{ref}T_{ref}/B^2_{ref}\).
real :: beta = 0.0
!> Initial timestep
real :: delt = 0.1
!> Determines how initial timestep is set. Possible options are:
!>
!> - "default" or "set_by_hand": use timestep from input file
!> - "check_restart": read timestep(s) from restart file
!>
!> If "check_restart" is used but the restart files aren't
!> present for any reason (for instance, the current run is not a
!> restart), GS2 will error when trying to read the
!> timesteps. You can run the [[ingen]] tool on your input file
!> to check this issue before running your job
character(len = 20) :: delt_option = 'default'
!> If true then use eigensolver instead of initial value solver.
logical :: do_eigsolve = .false.
!> Advanced option to freeze evolution of certain modes. Possible values are:
!>
!> - "secondary": don't evolve `ik == 2, it == 1`;
!> - "tertiary": dont' evolve `ik == 1, it == 2 or ntheta0`;
!> - "harris": don't evolve `ik == 1`.
!>
!> Only used in [[dist_fn]], should be moved to [[dist_fn_knobs]].
character(len = 20) :: eqzip_option = 'none'
!> Multiplies \(A_\|\) throughout.
real :: fapar = 0.0
!> Multiplies \(B_\|\) throughout.
real :: fbpar = -1.0
!> Multiplies \(\phi\) throughout.
real :: fphi = 1.0
!> Determines the behaviour when the CFL condition is broken in the nonlinear term:
logical :: immediate_reset = .true.
!> How close to avail_cpu_time can we go before trying to stop the run cleanly
real :: margin_cpu_time = 300.0
!> The simulation time after which the run should stop.
real :: max_sim_time = 1.0e6
!> Sets the time step interval at which check for the existence
!> of the <runname>.stop file.
integer :: ncheck_stop = 5
!> Maximum number of steps to take
integer :: nstep = 100
!> How frequently, in integer steps, do we display a progress message.
!> If <= 0 then no progress messages are displayed
integer :: progress_frequency = 0
!> Normalised gyro-radius, only used for low flow builds
real :: rhostar = 3.0e-3
!> If true then save init timer information to
!> <run_name>.init_times.
logical :: save_init_times = .false.
!> If true then save some extra timer information to
!> <run_name>.timing_stats giving min/max/mean values.
logical :: save_timer_statistics = .true.
!> Used to set the random seed used in the random number
!> generators provided by [[ran]]. If this input is 0 (the
!> default) then we don't set the seed and use the system default
!> instead.
integer :: seed = 0
!> Only used when there is an adiabatic species. Sets `n q ^2 / T` of the adiabatic
!> species, normalised to the reference values.
real :: tite = 1.0
!> If true use original diagnostics rather than new form
logical :: use_old_diagnostics = .false.
!> Custom description of run to be added to netcdf output (new diagnostics only)
character(len = 65000) :: user_comments = ''
!> If true makes timestep proportional to ky*rho. Only sensible for linear runs.
logical :: wstar_units = .false.
!> Effective ionic charge appearing in electron collision frequency
real :: zeff = 1.0
contains
procedure, public :: read => read_knobs_config
procedure, public :: write => write_knobs_config
procedure, public :: reset => reset_knobs_config
procedure, public :: broadcast => broadcast_knobs_config
procedure, public, nopass :: get_default_name => get_default_name_knobs_config
procedure, public, nopass :: get_default_requires_index => get_default_requires_index_knobs_config
end type knobs_config_type