param_database Derived Type

type, public :: param_database

Damping parameter database


Components

Type Visibility Attributes Name Initial
type(param_record), public, allocatable :: defaults(:)

List of supported damping functions

logical, public, allocatable :: mask(:)

Mask for default damping functions in queries

type(param_record), public, allocatable :: records(:)

List of damping parameter records


Type-Bound Procedures

procedure, public :: get

Get parameters

  • private subroutine get(self, param, method, damping)

    Load damping parameters from data base

    Arguments

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

    Instance of the damping parameter data

    class(damping_param), intent(out), allocatable :: param

    Damping parameters

    character(len=*), intent(in) :: method

    Method identifier

    character(len=*), intent(in), optional :: damping

    Damping function identifier

generic, public :: load => load_from_file, load_from_unit, load_from_toml

Reading of damping parameter data

  • private subroutine load_from_file(self, file, error)

    Read damping parameter data from file

    Arguments

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

    Instance of the damping parameter data

    character(len=*), intent(in) :: file

    File name

    type(error_type), intent(out), allocatable :: error

    Error handling

  • private subroutine load_from_unit(self, unit, error)

    Read damping parameter data from file

    Arguments

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

    Instance of the damping parameter data

    integer, intent(in) :: unit

    File name

    type(error_type), intent(out), allocatable :: error

    Error handling

  • private subroutine load_from_toml(self, table, error)

    Read damping parameter data from TOML data structure

    Arguments

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

    Instance of the damping parameter data

    type(toml_table), intent(inout) :: table

    Data structure

    type(error_type), intent(out), allocatable :: error

    Error handling

Source Code

   type :: param_database
      !> List of supported damping functions
      type(param_record), allocatable :: defaults(:)
      !> List of damping parameter records
      type(param_record), allocatable :: records(:)
      !> Mask for default damping functions in queries
      logical, allocatable :: mask(:)
   contains
      !> Reading of damping parameter data
      generic :: load => load_from_file, load_from_unit, load_from_toml
      !> Read damping parameter data from file
      procedure, private :: load_from_file
      !> Read damping parameter data from formatted unit
      procedure, private :: load_from_unit
      !> Read damping parameter data from TOML data structure
      procedure, private :: load_from_toml
      !> Get parameters
      procedure :: get
   end type param_database