run_parameters Module

This module is basically a store for the input parameters that are specified in the namelists knobs and parameters. In general, the names of the public variables in this module are the same as the name of the input parameter they correspond to. If true use old diagnostics. Included for testing only and will eventually be removed. Please use the new diagnostics module!



Contents


Variables

Type Visibility Attributes Name Initial
real, public :: beta
real, public :: zeff
real, public :: tite
real, public :: fphi
real, public :: fapar
real, public :: fbpar
real, public :: k0
real, public :: rhostar
logical, public :: has_phi
logical, public :: has_apar
logical, public :: has_bpar
logical, public :: neo_test
real, public :: delt
real, public :: avail_cpu_time
real, public :: margin_cpu_time
real, public :: max_sim_time
integer, public :: ncheck_stop
integer, public :: nstep
integer, private :: seed
logical, public :: reset = .false.
logical, private :: initialized = .false.
logical, public :: immediate_reset
logical, public :: wstar_units
logical, public :: save_timer_statistics
logical, public :: save_init_times
integer, public :: delt_option_switch
integer, private, parameter :: delt_option_hand = 1
integer, public, parameter :: delt_option_auto = 2
logical, private :: knexist
logical, public :: do_eigsolve
logical, public :: use_old_diagnostics
character(len=100000), public :: user_comments
logical, public, allocatable :: ieqzip(:,:)

Used to indicate which wavenumbers we do not want to evolve. This choice is controlled by the eqzip_option input. Primarily intended for secondary mode analysis.

integer, private :: eqzip_option_switch
integer, private, parameter :: eqzip_option_none = 1
integer, private, parameter :: eqzip_option_secondary = 2
integer, private, parameter :: eqzip_option_tertiary = 3
integer, private, parameter :: eqzip_option_equilibrium = 4
type(knobs_config_type), private :: knobs_config

Derived Types

type, public, extends(abstract_config_type) ::  knobs_config_type

Used to represent the input configuration of run_parameters through "knobs"

Components

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 :: 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:

Read more…
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:

Read more…
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 :: k0 = 1.0

Used in ginit_option "harris" and "convect". Should be moved to init_g namelist.

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 .stop file.

logical, public :: neo_test = .false.

Lowflow only. If true, GS2 exits after writing out neoclassical quantities of interest

integer, public :: nstep = 100

Maximum number of steps to take

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 .init_times.

logical, public :: save_timer_statistics = .true.

If true then save some extra timer information to .timing_stats giving min/max/mean values.

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 n q ^2 / T of the adiabatic species, normalised to the reference values.

logical, public :: use_old_diagnostics = .false.

If true use original diagnostics rather than new form

character(len=100000), 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

Type-Bound Procedures

procedure , public , :: is_initialised => is_initialised_generic Function
procedure , public , :: init => init_generic Subroutine
procedure , public , :: setup => setup_generic Subroutine
procedure , public , :: write_namelist_header Subroutine
procedure , public , :: get_name => get_name_generic Function
procedure , public , :: get_requires_index => get_requires_index_generic Function
procedure , public , nopass :: write_namelist_footer Subroutine
generic, public , :: write_key_val => write_key_val_string, write_key_val_real, write_key_val_complex, write_key_val_integer, write_key_val_logical, write_key_val_real_array, write_key_val_complex_array, write_key_val_integer_array
procedure , public :: read => read_knobs_config Subroutine
procedure , public :: write => write_knobs_config Subroutine
procedure , public :: reset => reset_knobs_config Subroutine
procedure , public :: broadcast => broadcast_knobs_config Subroutine
procedure , public , nopass :: get_default_name => get_default_name_knobs_config Function
procedure , public , nopass :: get_default_requires_index => get_default_requires_index_knobs_config Function

Functions

private function get_default_name_knobs_config()

Gets the default name for this namelist

Arguments

None

Return Value character(len=CONFIG_MAX_NAME_LEN)

Gets the default requires index for this namelist

Arguments

None

Return Value logical

public pure function get_knobs_config()

Get the module level config instance

Arguments

None

Return Value type(knobs_config_type)


Subroutines

public subroutine check_run_parameters(report_unit)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: report_unit

public subroutine wnml_run_parameters(unit, electrons, collisions)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: unit
logical, intent(in) :: electrons
logical, intent(in) :: collisions

public subroutine init_run_parameters(knobs_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(knobs_config_type), intent(in), optional :: knobs_config_in

private subroutine read_parameters(knobs_config_in)

FIXME : Add documentation
Identify if we need to warn about removal of parameters If we have zero beta then disable apar and bpar fields as these contribute nothing to result but slow down calculation. If we have non-zero beta then alert the user that they have some of the perturbed magnetic fields disabled. This may be intended behaviour, so we throw a warning. However, if both are disabled, we set beta=0. This will make the simulation electrostatic, as probably intended if both apar and bpar are set to zero.

Arguments

Type IntentOptional Attributes Name
type(knobs_config_type), intent(in), optional :: knobs_config_in

public subroutine set_overrides(tstep_ov)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
type(timestep_overrides_type), intent(in) :: tstep_ov

public subroutine finish_run_parameters()

FIXME : Add documentation

Arguments

None

public subroutine set_run_parameters_config(knobs_config_in)

Set the module level config type Will abort if the module has already been initialised to avoid inconsistencies.

Arguments

Type IntentOptional Attributes Name
type(knobs_config_type), intent(in), optional :: knobs_config_in

private subroutine read_knobs_config(self)

Reads in the knobs namelist and populates the member variables

Arguments

Type IntentOptional Attributes Name
class(knobs_config_type), intent(inout) :: self

private subroutine write_knobs_config(self, unit)

Writes out a namelist representing the current state of the config object

Arguments

Type IntentOptional Attributes Name
class(knobs_config_type), intent(in) :: self
integer, intent(in), optional :: unit

private subroutine reset_knobs_config(self)

Resets the config object to the initial empty state

Arguments

Type IntentOptional Attributes Name
class(knobs_config_type), intent(inout) :: self

private subroutine broadcast_knobs_config(self)

Broadcasts all config parameters so object is populated identically on all processors

Arguments

Type IntentOptional Attributes Name
class(knobs_config_type), intent(inout) :: self