ingen_config_type Derived Type

type, public, extends(abstract_config_type) :: ingen_config_type

Used to represent the input configuration of ingen


Contents

Source Code


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?

integer, public :: ncut = 100000

This sets the minimum number of local elements for which processor recommendations will be given. In other words, if the total number of elements is nmesh = (2*ntgrid+1)*2*nlambda*negrid*ntheta0*naky*nspec, then the largest processor count that ingen will recommend would be nmesh/ncut.

integer, public :: npmax = 100000

Sets the maximum processor count considered when calculating sweetspots.

logical, public :: scan = .false.

If true then alongside standard ingen report allows the creation of various types of scans. This will involve user interaction if stdin is true.

logical, public :: stdin = .true.

If true (default) then ask for input from stdin when using ingen to produce parameters for scans (scan = .true.). If false then will look in file named .<run_name>.pythonin instead.


Type-Bound Procedures

procedure, public, :: is_initialised => is_initialised_generic

procedure, public, :: init => init_generic

  • private subroutine init_generic(self, name, requires_index, index)

    Fully initialise the config object

    Arguments

    Type IntentOptional 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

procedure, public, :: setup => setup_generic

  • private subroutine setup_generic(self, name, requires_index, index)

    Do some standard setup/checking

    Arguments

    Type IntentOptional 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

procedure, public, :: write_namelist_header

  • private subroutine write_namelist_header(self, unit)

    Write the namelist header for this instance

    Arguments

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

procedure, public, :: get_name => get_name_generic

  • private function get_name_generic(self)

    Returns the namelist name. Not very useful at the moment but may want to do more interesting things in the future

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_config_type), intent(in) :: self

    Return Value character(len=CONFIG_MAX_NAME_LEN)

procedure, public, :: get_requires_index => get_requires_index_generic

  • private function get_requires_index_generic(self)

    Returns the requires_index value. Allows access whilst keeping the variable private

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_config_type), intent(in) :: self

    Return Value logical

procedure, public, nopass :: write_namelist_footer

  • private subroutine write_namelist_footer(unit)

    Write the namelist footer

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unit
  • private subroutine write_key_val_string(key, val, unit)

    Writes a {key,val} pair where the value is of type character

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: key
    character(len=*), intent(in) :: val
    integer, intent(in) :: unit
  • private subroutine write_key_val_real(key, val, unit)

    Writes a {key,val} pair where the value is of type real

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: key
    real, intent(in) :: val
    integer, intent(in) :: unit
  • private subroutine write_key_val_complex(key, val, unit)

    Writes a {key,val} pair where the value is of type complex

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: key
    complex, intent(in) :: val
    integer, intent(in) :: unit
  • private subroutine write_key_val_integer(key, val, unit)

    Writes a {key,val} pair where the value is of type integer

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: key
    integer, intent(in) :: val
    integer, intent(in) :: unit
  • private subroutine write_key_val_logical(key, val, unit)

    Writes a {key,val} pair where the value is of type logical

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: key
    logical, intent(in) :: val
    integer, intent(in) :: unit
  • private subroutine write_key_val_real_array(self, key, val, unit)

    Writes a {key,val} pair where the value is of type real array

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_config_type), intent(in) :: self
    character(len=*), intent(in) :: key
    real, intent(in), dimension(:) :: val
    integer, intent(in) :: unit
  • private subroutine write_key_val_complex_array(self, key, val, unit)

    Writes a {key,val} pair where the value is of type complex array

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_config_type), intent(in) :: self
    character(len=*), intent(in) :: key
    complex, intent(in), dimension(:) :: val
    integer, intent(in) :: unit
  • private subroutine write_key_val_integer_array(self, key, val, unit)

    Writes a {key,val} pair where the value is of type integer array

    Arguments

    Type IntentOptional Attributes Name
    class(abstract_config_type), intent(in) :: self
    character(len=*), intent(in) :: key
    integer, intent(in), dimension(:) :: val
    integer, intent(in) :: unit

procedure, public :: read => read_ingen_config

  • public subroutine read_ingen_config(self)

    Reads in the ingen_knobs namelist and populates the member variables

    Arguments

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

procedure, public :: write => write_ingen_config

  • public subroutine write_ingen_config(self, unit)

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

    Arguments

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

procedure, public :: reset => reset_ingen_config

  • public subroutine reset_ingen_config(self)

    Resets the config object to the initial empty state

    Arguments

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

procedure, public :: broadcast => broadcast_ingen_config

  • public subroutine broadcast_ingen_config(self)

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

    Arguments

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

procedure, public, nopass :: get_default_name => get_default_name_ingen_config

  • public function get_default_name_ingen_config()

    Gets the default name for this namelist

    Arguments

    None

    Return Value character(len=CONFIG_MAX_NAME_LEN)

procedure, public, nopass :: get_default_requires_index => get_default_requires_index_ingen_config

Source Code

  type, extends(abstract_config_type) :: ingen_config_type
     ! namelist : ingen_knobs
     ! indexed : false
     !> This sets the minimum number of local elements for which
     !> processor recommendations will be given. In other words, if
     !> the total number of elements is `nmesh =
     !> (2*ntgrid+1)*2*nlambda*negrid*ntheta0*naky*nspec`, then the
     !> largest processor count that ingen will recommend would be
     !> `nmesh/ncut`.
     integer :: ncut = 100000
     !> Sets the maximum processor count considered when calculating
     !> sweetspots.
     integer :: npmax = 100000     
     !> If `true` then alongside standard [[ingen]] report allows the
     !> creation of various types of scans. This will involve user
     !> interaction if `stdin` is `true`.
     logical :: scan = .false.
     !> If `true` (default) then ask for input from stdin when using
     !> ingen to produce parameters for scans (`scan = .true.`). If
     !> `false` then will look in file named `.<run_name>.pythonin`
     !> instead.
     logical :: stdin = .true.
   contains
     procedure, public :: read => read_ingen_config
     procedure, public :: write => write_ingen_config
     procedure, public :: reset => reset_ingen_config
     procedure, public :: broadcast => broadcast_ingen_config
     procedure, public, nopass :: get_default_name => get_default_name_ingen_config
     procedure, public, nopass :: get_default_requires_index => get_default_requires_index_ingen_config
  end type ingen_config_type