normalisations Module

FIXME : Add documentation



Contents


Variables

Type Visibility Attributes Name Initial
real, private, parameter :: default_value = -999.0
type(norms_type), public :: norms
logical, private :: initialized = .false.
type(normalisations_config_type), private :: normalisations_config

Derived Types

type, private ::  norms_type

Define a type to hold the set of normalisations, we could imagine extending this in the future to provide a normalise/denormalise routine which can be used to automatically convert quantities

Components

Type Visibility Attributes Name Initial
real, private :: def_val = default_value
logical, private :: some_norms_set = .false.
logical, private :: all_norms_set = .false.
logical, private :: initialised = .false.
integer, private :: nnorm
character(len=6), public, dimension(:), allocatable :: names
real, private :: mref

Reference mass in atomic mass units

real, private :: zref

Reference charge in units of the elementary charge

real, private :: nref

Reference density in

real, private :: tref

Reference temperature in

real, private :: aref

Reference length in

real, private :: vref

Reference (thermal) velocity in

real, private :: bref

Reference magnetic field in Tesla,

real, private :: rhoref

Reference Larmor radius in

Type-Bound Procedures

procedure , public :: init => norms_init Subroutine
procedure , public :: finish => norms_finish Subroutine
procedure , public :: reset => norms_reset Subroutine
procedure , private , :: read_parameters => norms_read_parameters Subroutine
procedure , private , :: set_value => norms_set_value Subroutine
procedure , public :: get_value => norms_get_value Function
procedure , private , :: check_if_set => norms_check_if_set Function
procedure , private , :: set_logicals => norms_set_logicals Subroutine

type, public, extends(abstract_config_type) ::  normalisations_config_type

Used to represent the input configuration of normalisations. These values are not used for anything but will be written to the output file to aid post processing etc.

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 :: aref = default_value

Reference length in

real, public :: bref = default_value

Reference magnetic field in

real, public :: mref = default_value

Reference mass in atomic mass units

real, public :: nref = default_value

Reference density in

real, public :: rhoref = default_value

Reference Larmor radius in

real, public :: tref = default_value

Reference temperature in

real, public :: vref = default_value

Reference (thermal) velocity in

real, public :: zref = default_value

Reference charge in units of the elementary charge

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 , :: set_smart_defaults => set_smart_defaults_null Subroutine
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_normalisations_config Subroutine
procedure , public :: write => write_normalisations_config Subroutine
procedure , public :: reset => reset_normalisations_config Subroutine
procedure , public :: broadcast => broadcast_normalisations_config Subroutine
procedure , public , nopass :: get_default_name => get_default_name_normalisations_config Function
procedure , public , nopass :: get_default_requires_index => get_default_requires_index_normalisations_config Function

Functions

private function norms_get_value(self, val_name)

Get the value of the normalisation associated with val_name. Unknown values of val_name result in a call to mp_abort.

Arguments

Type IntentOptional Attributes Name
class(norms_type), intent(in) :: self
character(len=*), intent(in) :: val_name

Return Value real

private function norms_check_if_set(self, val_name)

Decide if a given normalisation has been set

Arguments

Type IntentOptional Attributes Name
class(norms_type), intent(in) :: self
character(len=*), intent(in) :: val_name

Return Value logical

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_normalisations_config()

Get the module level config instance

Arguments

None

Return Value type(normalisations_config_type)


Subroutines

private subroutine norms_set_value(self, val_name, val)

Sets the value of a particular normalisation, determined by the passed val_name string. Unknown val_name values result in a warning message on proc0.

Arguments

Type IntentOptional Attributes Name
class(norms_type), intent(inout) :: self
character(len=*), intent(in) :: val_name
real, intent(in) :: val

private subroutine norms_read_parameters(self, normalisations_config_in)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
class(norms_type), intent(inout) :: self
type(normalisations_config_type), intent(in), optional :: normalisations_config_in

private subroutine norms_init(self, normalisations_config_in)

Initialise the norms object

Arguments

Type IntentOptional Attributes Name
class(norms_type), intent(inout) :: self
type(normalisations_config_type), intent(in), optional :: normalisations_config_in

private subroutine norms_reset(self)

Reset the properties

Arguments

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

private subroutine norms_finish(self)

Reset and free memory

Arguments

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

private subroutine norms_set_logicals(self)

Decide if all/some of the normalisations have been set

Arguments

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

public subroutine check_normalisations(report_unit)

FIXME : Add documentation

Arguments

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

public subroutine wnml_normalisations(unit)

FIXME : Add documentation

Arguments

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

public subroutine init_normalisations(normalisations_config_in)

Read input file and populate the norms object

Arguments

Type IntentOptional Attributes Name
type(normalisations_config_type), intent(in), optional :: normalisations_config_in

public subroutine finish_normalisations()

Free memory etc. associated with normalisations

Arguments

None

public subroutine set_normalisations_config(normalisations_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(normalisations_config_type), intent(in), optional :: normalisations_config_in

private subroutine read_normalisations_config(self)

Reads in the normalisations_knobs namelist and populates the member variables

Arguments

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

private subroutine write_normalisations_config(self, unit)

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

Arguments

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

private subroutine reset_normalisations_config(self)

Resets the config object to the initial empty state

Arguments

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

private subroutine broadcast_normalisations_config(self)

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

Arguments

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