yaml_settings Module


Uses

  • module~~yaml_settings~~UsesGraph module~yaml_settings yaml_settings module~yaml yaml module~yaml_settings->module~yaml module~yaml_types yaml_types module~yaml_settings->module~yaml_types module~yaml->module~yaml_types

Contents


Variables

TypeVisibility AttributesNameInitial
integer, private, parameter:: rk =yaml_real_kind
real(kind=rk), private, parameter:: default_minimum_real =-huge(1._rk)
real(kind=rk), private, parameter:: default_maximum_real =huge(1._rk)
integer, private, parameter:: default_minimum_integer =-huge(1)
integer, private, parameter:: default_maximum_integer =huge(1)

Interfaces

interface

  • private recursive subroutine list_populator_create(self, index, item)

    Arguments

    Type IntentOptional AttributesName
    class(type_list_populator), intent(inout) :: self
    integer, intent(in) :: index
    type(type_list_item), intent(inout) :: item

interface

  • private recursive subroutine dictionary_populator_create(self, pair)

    Arguments

    Type IntentOptional AttributesName
    class(type_dictionary_populator), intent(inout) :: self
    type(type_key_value_pair), intent(inout) :: pair

Abstract Interfaces

abstract interface

  • private function setting_as_string(self, use_default) result(string)

    Arguments

    Type IntentOptional AttributesName
    class(type_scalar_setting), intent(in) :: self
    logical, intent(in) :: use_default

    Return Value character(len=:), allocatable


Derived Types

type, private :: type_value

Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: long_name
character(len=:), public, allocatable:: description
class(type_yaml_node), public, pointer:: backing_store_node=> null()
character(len=:), public, allocatable:: path
class(type_value), public, pointer:: parent=> null()

Type-Bound Procedures

procedure, public :: write_schema => value_write_schema
procedure, public :: write_yaml => value_write_yaml
procedure, public :: get_maximum_depth => value_get_maximum_depth
procedure, public :: get_yaml_style => value_get_yaml_style
procedure, public :: create_child

type, public :: type_settings_node

Components

TypeVisibility AttributesNameInitial
class(type_value), public, pointer:: value=> null()

Type-Bound Procedures

procedure, public :: set_value => node_set_value

type, public, extends(type_settings_node) :: type_key_value_pair

Components

TypeVisibility AttributesNameInitial
class(type_value), public, pointer:: value=> null()
character(len=:), public, allocatable:: key
character(len=:), public, allocatable:: name
logical, public :: accessed =.false.
type(type_key_value_pair), public, pointer:: next=> null()

Type-Bound Procedures

procedure, public :: set_value => node_set_value

type, public, extends(type_settings_node) :: type_list_item

Components

TypeVisibility AttributesNameInitial
class(type_value), public, pointer:: value=> null()
type(type_list_item), public, pointer:: next=> null()

Type-Bound Procedures

procedure, public :: set_value => node_set_value

type, public, abstract :: type_dictionary_populator

Type-Bound Procedures

procedure(dictionary_populator_create), public :: create

type, public, abstract :: type_list_populator

Type-Bound Procedures

procedure, public :: set_length => list_populator_set_length
procedure(list_populator_create), public :: create

type, public, extends(type_value) :: type_settings

Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: long_name
character(len=:), public, allocatable:: description
class(type_yaml_node), public, pointer:: backing_store_node=> null()
character(len=:), public, allocatable:: path
class(type_value), public, pointer:: parent=> null()
class(type_yaml_dictionary), public, pointer:: backing_store=> null()
class(type_dictionary_populator), public, pointer:: populator=> null()
type(type_key_value_pair), public, pointer:: first=> null()

Type-Bound Procedures

procedure, public :: create_child
procedure, public :: write_schema => settings_write_schema
procedure, public :: write_yaml => settings_write_yaml
procedure, public :: get_maximum_depth => settings_get_maximum_depth
procedure, public :: get_yaml_style => settings_get_yaml_style
procedure, public :: load
procedure, public :: save
procedure, public :: write_schema_file
procedure, public :: get_real2
procedure, public :: get_integer2
procedure, public :: get_logical2
procedure, public :: get_string2
procedure, public :: get_integer
procedure, public :: get_logical
procedure, public :: get_string
procedure, public :: get_child
procedure, public :: get_list
procedure, public :: get_node
procedure, public :: check_all_used
generic, public :: get => get_real2, get_integer2, get_logical2, get_string2
procedure, public :: populate => settings_populate
procedure, public :: finalize

type, private, abstract, extends(type_value) :: type_scalar_setting

Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: long_name
character(len=:), public, allocatable:: description
class(type_yaml_node), public, pointer:: backing_store_node=> null()
character(len=:), public, allocatable:: path
class(type_value), public, pointer:: parent=> null()
character(len=:), public, allocatable:: units
logical, public :: has_default =.false.

Type-Bound Procedures

procedure, public :: write_schema => value_write_schema
procedure, public :: get_yaml_style => value_get_yaml_style
procedure, public :: create_child
procedure(setting_as_string), public :: as_string
procedure, public :: write_yaml => setting_write_yaml
procedure, public :: get_comment => setting_get_comment
procedure, public :: get_maximum_depth => setting_get_maximum_depth

type, public :: type_option

Components

TypeVisibility AttributesNameInitial
integer, public :: value
character(len=:), public, allocatable:: long_name
character(len=:), public, allocatable:: key

type, private, extends(type_value) :: type_list

Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: long_name
character(len=:), public, allocatable:: description
class(type_yaml_node), public, pointer:: backing_store_node=> null()
character(len=:), public, allocatable:: path
class(type_value), public, pointer:: parent=> null()
type(type_list_item), public, pointer:: first=> null()
class(type_list_populator), public, pointer:: populator=> null()

Type-Bound Procedures

procedure, public :: create_child
procedure, public :: write_schema => list_write_schema
procedure, public :: write_yaml => list_write_yaml
procedure, public :: get_maximum_depth => list_get_maximum_depth
procedure, public :: get_yaml_style => list_get_yaml_style

type, private, extends(type_scalar_setting) :: type_integer_setting

Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: long_name
character(len=:), public, allocatable:: description
class(type_yaml_node), public, pointer:: backing_store_node=> null()
character(len=:), public, allocatable:: path
class(type_value), public, pointer:: parent=> null()
character(len=:), public, allocatable:: units
logical, public :: has_default =.false.
integer, public, pointer:: pvalue=> null()
integer, public :: value
integer, public :: default =0
integer, public :: minimum =default_minimum_integer
integer, public :: maximum =default_maximum_integer
type(type_option), public, allocatable:: options(:)

Type-Bound Procedures

procedure, public :: get_yaml_style => value_get_yaml_style
procedure, public :: create_child
procedure, public :: write_yaml => setting_write_yaml
procedure, public :: get_maximum_depth => setting_get_maximum_depth
procedure, public :: as_string => integer_as_string
procedure, public :: write_schema => integer_write_schema
procedure, public :: get_comment => integer_get_comment

type, public, extends(type_scalar_setting) :: type_real_setting

Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: long_name
character(len=:), public, allocatable:: description
class(type_yaml_node), public, pointer:: backing_store_node=> null()
character(len=:), public, allocatable:: path
class(type_value), public, pointer:: parent=> null()
character(len=:), public, allocatable:: units
logical, public :: has_default =.false.
real(kind=rk), public, pointer:: pvalue=> null()
real(kind=rk), public :: default =0.0_rk
real(kind=rk), public :: minimum =default_minimum_real
real(kind=rk), public :: maximum =default_maximum_real

Type-Bound Procedures

procedure, public :: get_yaml_style => value_get_yaml_style
procedure, public :: create_child
procedure, public :: write_yaml => setting_write_yaml
procedure, public :: get_maximum_depth => setting_get_maximum_depth
procedure, public, nopass :: create => type_real_setting_create
procedure, public :: as_string => real_as_string
procedure, public :: write_schema => real_write_schema
procedure, public :: get_comment => real_get_comment

type, public, extends(type_scalar_setting) :: type_logical_setting

Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: long_name
character(len=:), public, allocatable:: description
class(type_yaml_node), public, pointer:: backing_store_node=> null()
character(len=:), public, allocatable:: path
class(type_value), public, pointer:: parent=> null()
character(len=:), public, allocatable:: units
logical, public :: has_default =.false.
logical, public, pointer:: pvalue=> null()
logical, public :: value
logical, public :: default =.true.

Type-Bound Procedures

procedure, public :: get_yaml_style => value_get_yaml_style
procedure, public :: create_child
procedure, public :: write_yaml => setting_write_yaml
procedure, public :: get_comment => setting_get_comment
procedure, public :: get_maximum_depth => setting_get_maximum_depth
procedure, public, nopass :: create => type_logical_setting_create
procedure, public :: as_string => logical_as_string
procedure, public :: write_schema => logical_write_schema

type, private, extends(type_scalar_setting) :: type_string_setting

Components

TypeVisibility AttributesNameInitial
character(len=:), public, allocatable:: long_name
character(len=:), public, allocatable:: description
class(type_yaml_node), public, pointer:: backing_store_node=> null()
character(len=:), public, allocatable:: path
class(type_value), public, pointer:: parent=> null()
character(len=:), public, allocatable:: units
logical, public :: has_default =.false.
character(len=:), public, pointer:: pvalue=> null()
character(len=:), public, allocatable:: value
character(len=:), public, allocatable:: default

Type-Bound Procedures

procedure, public :: get_yaml_style => value_get_yaml_style
procedure, public :: create_child
procedure, public :: write_yaml => setting_write_yaml
procedure, public :: get_comment => setting_get_comment
procedure, public :: get_maximum_depth => setting_get_maximum_depth
procedure, public :: as_string => string_as_string
procedure, public :: write_schema => string_write_schema

Functions

private recursive function value_get_maximum_depth(self, name) result(maxdepth)

Arguments

Type IntentOptional AttributesName
class(type_value), intent(in) :: self
character(len=*), intent(in) :: name

Return Value integer

private function value_get_yaml_style(self)

Arguments

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

Return Value integer

private function settings_get_yaml_style(self)

Arguments

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

Return Value integer

private function list_get_yaml_style(self)

Arguments

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

Return Value integer

private function check_all_used(self)

Arguments

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

Return Value logical

private recursive function get_node(self, name, treat_as_path, istart) result(pair)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout), target:: self
character(len=*), intent(in) :: name
logical, intent(in), optional :: treat_as_path
integer, intent(out), optional :: istart

Return Value type(type_key_value_pair), pointer

public function type_real_setting_create(node, target, long_name, units, default, minimum, maximum, description) result(setting)

Arguments

Type IntentOptional AttributesName
class(type_settings_node), intent(inout) :: node
real(kind=rk), target:: target
character(len=*), intent(in) :: long_name
character(len=*), intent(in) :: units
real(kind=rk), intent(in), optional :: default
real(kind=rk), intent(in), optional :: minimum
real(kind=rk), intent(in), optional :: maximum
character(len=*), intent(in), optional :: description

Return Value class(type_real_setting), pointer

private function get_integer(self, name, long_name, units, default, minimum, maximum, options, description) result(value)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout) :: self
character(len=*), intent(in) :: name
character(len=*), intent(in) :: long_name
character(len=*), intent(in), optional :: units
integer, intent(in), optional :: default
integer, intent(in), optional :: minimum
integer, intent(in), optional :: maximum
type(type_option), intent(in), optional :: options(:)
character(len=*), intent(in), optional :: description

Return Value integer

private function get_logical(self, name, long_name, default, description) result(value)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout) :: self
character(len=*), intent(in) :: name
character(len=*), intent(in) :: long_name
logical, intent(in), optional :: default
character(len=*), intent(in), optional :: description

Return Value logical

public function type_logical_setting_create(node, target, long_name, default, description, value) result(setting)

Arguments

Type IntentOptional AttributesName
class(type_settings_node), intent(inout) :: node
logical, target:: target
character(len=*), intent(in) :: long_name
logical, intent(in), optional :: default
character(len=*), intent(in), optional :: description
logical, intent(inout), optional :: value

Return Value class(type_logical_setting), pointer

private function get_string(self, name, long_name, units, default, description) result(value)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout) :: self
character(len=*), intent(in) :: name
character(len=*), intent(in) :: long_name
character(len=*), intent(in), optional :: units
character(len=*), intent(in), optional :: default
character(len=*), intent(in), optional :: description

Return Value character(len=:), allocatable

private recursive function create_child(self) result(child)

Arguments

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

Return Value class(type_settings), pointer

private recursive function get_child(self, name, long_name, treat_as_path, populator) result(child)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout), target:: self
character(len=*), intent(in) :: name
character(len=*), intent(in), optional :: long_name
logical, intent(in), optional :: treat_as_path
class(type_dictionary_populator), optional target:: populator

Return Value class(type_settings), pointer

public function type_settings_create(node, long_name, populator) result(child)

Arguments

Type IntentOptional AttributesName
class(type_settings_node), intent(inout), optional :: node
character(len=*), intent(in), optional :: long_name
class(type_dictionary_populator), optional target:: populator

Return Value class(type_settings), pointer

private function string_lower(string) result(lowerstring)

Arguments

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

Return Value character(len=len(string))

private recursive function setting_get_maximum_depth(self, name) result(maxdepth)

Arguments

Type IntentOptional AttributesName
class(type_scalar_setting), intent(in) :: self
character(len=*), intent(in) :: name

Return Value integer

private recursive function settings_get_maximum_depth(self, name) result(maxdepth)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(in) :: self
character(len=*), intent(in) :: name

Return Value integer

private recursive function list_get_maximum_depth(self, name) result(maxdepth)

Arguments

Type IntentOptional AttributesName
class(type_list), intent(in) :: self
character(len=*), intent(in) :: name

Return Value integer

private function real_as_string(self, use_default) result(string)

Arguments

Type IntentOptional AttributesName
class(type_real_setting), intent(in) :: self
logical, intent(in) :: use_default

Return Value character(len=:), allocatable

private function format_real(value) result(string)

Arguments

Type IntentOptional AttributesName
real(kind=rk), intent(in) :: value

Return Value character(len=:), allocatable

private function format_integer(value) result(string)

Arguments

Type IntentOptional AttributesName
integer, intent(in) :: value

Return Value character(len=:), allocatable

private function integer_as_string(self, use_default) result(string)

Arguments

Type IntentOptional AttributesName
class(type_integer_setting), intent(in) :: self
logical, intent(in) :: use_default

Return Value character(len=:), allocatable

private function logical_as_string(self, use_default) result(string)

Arguments

Type IntentOptional AttributesName
class(type_logical_setting), intent(in) :: self
logical, intent(in) :: use_default

Return Value character(len=:), allocatable

private function string_as_string(self, use_default) result(string)

Arguments

Type IntentOptional AttributesName
class(type_string_setting), intent(in) :: self
logical, intent(in) :: use_default

Return Value character(len=:), allocatable


Subroutines

private recursive subroutine value_write_schema(self, unit, name, indent)

Arguments

Type IntentOptional AttributesName
class(type_value), intent(in) :: self
integer, intent(in) :: unit
character(len=*), intent(in) :: name
integer, intent(in) :: indent

private recursive subroutine value_write_yaml(self, unit, indent, comment_depth, header)

Arguments

Type IntentOptional AttributesName
class(type_value), intent(in) :: self
integer, intent(in) :: unit
integer, intent(in) :: indent
integer, intent(in) :: comment_depth
logical, intent(in) :: header

private subroutine load(self, path, unit)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout) :: self
character(len=*), intent(in) :: path
integer, intent(in) :: unit

private subroutine save(self, path, unit)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(in) :: self
character(len=*), intent(in) :: path
integer, intent(in) :: unit

private subroutine write_schema_file(self, path, unit, version)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(in) :: self
character(len=*), intent(in) :: path
integer, intent(in) :: unit
character(len=*), intent(in) :: version

private subroutine get_real2(self, target, name, long_name, units, default, minimum, maximum, description)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout) :: self
real(kind=rk), target:: target
character(len=*), intent(in) :: name
character(len=*), intent(in) :: long_name
character(len=*), intent(in) :: units
real(kind=rk), intent(in), optional :: default
real(kind=rk), intent(in), optional :: minimum
real(kind=rk), intent(in), optional :: maximum
character(len=*), intent(in), optional :: description

private subroutine real_set_data(self, backing_store_node)

Arguments

Type IntentOptional AttributesName
class(type_real_setting), intent(inout) :: self
class(type_yaml_node), intent(in) :: backing_store_node

private subroutine get_integer2(self, target, name, long_name, units, default, minimum, maximum, options, description, value)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout) :: self
integer, target:: target
character(len=*), intent(in) :: name
character(len=*), intent(in) :: long_name
character(len=*), intent(in), optional :: units
integer, intent(in), optional :: default
integer, intent(in), optional :: minimum
integer, intent(in), optional :: maximum
type(type_option), intent(in), optional :: options(:)
character(len=*), intent(in), optional :: description
integer, intent(out), optional :: value

private subroutine integer_set_data(self, backing_store_node)

Arguments

Type IntentOptional AttributesName
class(type_integer_setting), intent(inout) :: self
class(type_yaml_node), intent(in) :: backing_store_node

private subroutine get_logical2(self, target, name, long_name, default, description, value)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout) :: self
logical, target:: target
character(len=*), intent(in) :: name
character(len=*), intent(in) :: long_name
logical, intent(in), optional :: default
character(len=*), intent(in), optional :: description
logical, intent(inout), optional :: value

private subroutine logical_set_data(self, backing_store_node)

Arguments

Type IntentOptional AttributesName
class(type_logical_setting), intent(inout) :: self
class(type_yaml_node), intent(in) :: backing_store_node

private subroutine get_string2(self, target, name, long_name, units, default, description, value)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout) :: self
character(len=*), target:: target
character(len=*), intent(in) :: name
character(len=*), intent(in) :: long_name
character(len=*), intent(in), optional :: units
character(len=*), intent(in), optional :: default
character(len=*), intent(in), optional :: description
character(len=:), optional allocatable:: value

private subroutine node_set_value(self, value)

Arguments

Type IntentOptional AttributesName
class(type_settings_node), intent(inout) :: self
class(type_value), target:: value

private subroutine settings_populate(self, populator)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout), target:: self
class(type_dictionary_populator), target:: populator

private recursive subroutine settings_set_data(self, backing_store_node)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout), target:: self
class(type_yaml_node), target:: backing_store_node

private recursive subroutine get_list(self, name, populator, long_name, treat_as_path)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(inout), target:: self
character(len=*), intent(in) :: name
class(type_list_populator), target:: populator
character(len=*), intent(in), optional :: long_name
logical, intent(in), optional :: treat_as_path

private subroutine list_set_data(self, backing_store_node)

Arguments

Type IntentOptional AttributesName
class(type_list), intent(inout), target:: self
class(type_yaml_node), target:: backing_store_node

private subroutine finalize(self)

Arguments

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

public subroutine report_error(message)

Arguments

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

private recursive subroutine settings_write_yaml(self, unit, indent, comment_depth, header)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(in) :: self
integer, intent(in) :: unit
integer, intent(in) :: indent
integer, intent(in) :: comment_depth
logical, intent(in) :: header

private recursive subroutine list_write_yaml(self, unit, indent, comment_depth, header)

Arguments

Type IntentOptional AttributesName
class(type_list), intent(in) :: self
integer, intent(in) :: unit
integer, intent(in) :: indent
integer, intent(in) :: comment_depth
logical, intent(in) :: header

private recursive subroutine setting_write_yaml(self, unit, indent, comment_depth, header)

Arguments

Type IntentOptional AttributesName
class(type_scalar_setting), intent(in) :: self
integer, intent(in) :: unit
integer, intent(in) :: indent
integer, intent(in) :: comment_depth
logical, intent(in) :: header

private recursive subroutine setting_get_comment(self, comment)

Arguments

Type IntentOptional AttributesName
class(type_scalar_setting), intent(in) :: self
character(len=:), intent(inout), allocatable:: comment

private recursive subroutine real_get_comment(self, comment)

Arguments

Type IntentOptional AttributesName
class(type_real_setting), intent(in) :: self
character(len=:), intent(inout), allocatable:: comment

private subroutine append_string(target, infix, string)

Arguments

Type IntentOptional AttributesName
character(len=:), intent(inout), allocatable:: target
character(len=*), intent(in) :: infix
character(len=*), intent(in) :: string

private recursive subroutine integer_get_comment(self, comment)

Arguments

Type IntentOptional AttributesName
class(type_integer_setting), intent(in) :: self
character(len=:), intent(inout), allocatable:: comment

private recursive subroutine settings_write_schema(self, unit, name, indent)

Arguments

Type IntentOptional AttributesName
class(type_settings), intent(in) :: self
integer, intent(in) :: unit
character(len=*), intent(in) :: name
integer, intent(in) :: indent

private recursive subroutine list_write_schema(self, unit, name, indent)

Arguments

Type IntentOptional AttributesName
class(type_list), intent(in) :: self
integer, intent(in) :: unit
character(len=*), intent(in) :: name
integer, intent(in) :: indent

private recursive subroutine integer_write_schema(self, unit, name, indent)

Arguments

Type IntentOptional AttributesName
class(type_integer_setting), intent(in) :: self
integer, intent(in) :: unit
character(len=*), intent(in) :: name
integer, intent(in) :: indent

private recursive subroutine real_write_schema(self, unit, name, indent)

Arguments

Type IntentOptional AttributesName
class(type_real_setting), intent(in) :: self
integer, intent(in) :: unit
character(len=*), intent(in) :: name
integer, intent(in) :: indent

private recursive subroutine logical_write_schema(self, unit, name, indent)

Arguments

Type IntentOptional AttributesName
class(type_logical_setting), intent(in) :: self
integer, intent(in) :: unit
character(len=*), intent(in) :: name
integer, intent(in) :: indent

private recursive subroutine string_write_schema(self, unit, name, indent)

Arguments

Type IntentOptional AttributesName
class(type_string_setting), intent(in) :: self
integer, intent(in) :: unit
character(len=*), intent(in) :: name
integer, intent(in) :: indent

private subroutine list_populator_set_length(self, n)

Arguments

Type IntentOptional AttributesName
class(type_list_populator), intent(inout) :: self
integer, intent(in) :: n