config_t Derived Type

type, public :: config_t

type~~config_t~~InheritsGraph type~config_t config_t type~pair_t pair_t type~pair_t->type~config_t pairs
Help


Type to store a set of pairs and access their data



Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: fn

Filename data was read from

type(pair_t), public, dimension(:), allocatable:: pairs

Pairs of data


Constructor

public interface config_t

Constructor for config_t

  • private function newConfig(fn) result(self)

    Constructor for config_t

    Arguments

    Type IntentOptional AttributesName
    character(len=*), intent(in) :: fn

    Name of file to read

    Return Value type(config_t)

    Returned config_t object


Type-Bound Procedures

procedure, public :: isFound

  • private function isFound(self, key) result(o)

    Check for presence of a key in config

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(in) :: self

    Config to check in

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

    Key to check

    Return Value logical

    Presence of key

procedure, public :: getType

  • private function getType(self, key) result(o)

    Get the type of an entry for a key

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(in) :: self

    Config to check in

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

    Key to check

    Return Value integer

    Type of data for key

procedure, public :: getLogical

  • private function getLogical(self, key) result(o)

    Return a logical value from a config

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(in) :: self

    Config to search in

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

    Key to search for

    Return Value logical

    Logical value for key

procedure, public :: getInteger

  • private function getInteger(self, key) result(o)

    Return an integer value from a config

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(in) :: self

    Config to search in

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

    Key to search for

    Return Value integer

    Integer value for key

procedure, public :: getReal

  • private function getReal(self, key) result(o)

    Return a real value from a config

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(in) :: self

    Config to search in

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

    Key to search for

    Return Value real(kind=wp)

    Read value for key

procedure, public :: getComplex

  • private function getComplex(self, key) result(o)

    Return a complex value from a config

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(in) :: self

    Config to search in

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

    Key to search for

    Return Value complex(kind=wp)

    Complex value for key

procedure, public :: getVector

  • private function getVector(self, key) result(o)

    Return a real vector value from a config

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(in) :: self

    Config to search in

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

    Key to search for

    Return Value real(kind=wp), dimension(:), allocatable

    Real vector value for key

procedure, public :: getMatrix

  • private function getMatrix(self, key) result(o)

    Return a real matrix value from a config

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(in) :: self

    Config to search in

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

    Key to search for

    Return Value real(kind=wp), dimension(:,:), allocatable

    Real matrix value for key

procedure, public :: getString

  • private function getString(self, key) result(o)

    Return a string value from a config

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(in) :: self

    Config to search in

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

    Key to search for

    Return Value character(len=:), allocatable

    String value for key

procedure, public :: writeContents

  • private subroutine writeContents(self, iou)

    Write the contents of a config to an I/O unit

    Arguments

    Type IntentOptional AttributesName
    class(config_t), intent(inout) :: self

    Config to write

    integer, intent(in) :: iou

    I/O unit to write to