optionals Module

Some utilities for working with optional arguments



Contents


Interfaces

public interface get_option_with_default

  • private elemental function get_option_with_default_real32(option, default) result(option_out)

    Returns option if present or default if not.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real32), intent(in), optional :: option
    real(kind=real32), intent(in) :: default

    Return Value real(kind=real32)

  • private elemental function get_option_with_default_real64(option, default) result(option_out)

    Returns option if present or default if not.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real64), intent(in), optional :: option
    real(kind=real64), intent(in) :: default

    Return Value real(kind=real64)

  • private elemental function get_option_with_default_real128(option, default) result(option_out)

    Returns option if present or default if not.

    Arguments

    Type IntentOptional Attributes Name
    real(kind=real128), intent(in), optional :: option
    real(kind=real128), intent(in) :: default

    Return Value real(kind=real128)

  • private elemental function get_option_with_default_complex32(option, default) result(option_out)

    Returns option if present or default if not.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real32), intent(in), optional :: option
    complex(kind=real32), intent(in) :: default

    Return Value complex(kind=real32)

  • private elemental function get_option_with_default_complex64(option, default) result(option_out)

    Returns option if present or default if not.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real64), intent(in), optional :: option
    complex(kind=real64), intent(in) :: default

    Return Value complex(kind=real64)

  • private elemental function get_option_with_default_complex128(option, default) result(option_out)

    Returns option if present or default if not.

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=real128), intent(in), optional :: option
    complex(kind=real128), intent(in) :: default

    Return Value complex(kind=real128)

  • private elemental function get_option_with_default_integer(option, default) result(option_out)

    Returns option if present or default if not.

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in), optional :: option
    integer, intent(in) :: default

    Return Value integer

  • private elemental function get_option_with_default_logical(option, default) result(option_out)

    Returns option if present or default if not.

    Arguments

    Type IntentOptional Attributes Name
    logical, intent(in), optional :: option
    logical, intent(in) :: default

    Return Value logical

  • private pure function get_option_with_default_character(option, default) result(option_out)

    Returns option if present or default if not.

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in), optional :: option
    character(len=*), intent(in) :: default

    Return Value character(len=:), allocatable


Functions

private elemental function get_option_with_default_real32(option, default) result(option_out)

Returns option if present or default if not.

Arguments

Type IntentOptional Attributes Name
real(kind=real32), intent(in), optional :: option
real(kind=real32), intent(in) :: default

Return Value real(kind=real32)

private elemental function get_option_with_default_real64(option, default) result(option_out)

Returns option if present or default if not.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in), optional :: option
real(kind=real64), intent(in) :: default

Return Value real(kind=real64)

private elemental function get_option_with_default_real128(option, default) result(option_out)

Returns option if present or default if not.

Arguments

Type IntentOptional Attributes Name
real(kind=real128), intent(in), optional :: option
real(kind=real128), intent(in) :: default

Return Value real(kind=real128)

private elemental function get_option_with_default_complex32(option, default) result(option_out)

Returns option if present or default if not.

Arguments

Type IntentOptional Attributes Name
complex(kind=real32), intent(in), optional :: option
complex(kind=real32), intent(in) :: default

Return Value complex(kind=real32)

private elemental function get_option_with_default_complex64(option, default) result(option_out)

Returns option if present or default if not.

Arguments

Type IntentOptional Attributes Name
complex(kind=real64), intent(in), optional :: option
complex(kind=real64), intent(in) :: default

Return Value complex(kind=real64)

private elemental function get_option_with_default_complex128(option, default) result(option_out)

Returns option if present or default if not.

Arguments

Type IntentOptional Attributes Name
complex(kind=real128), intent(in), optional :: option
complex(kind=real128), intent(in) :: default

Return Value complex(kind=real128)

private elemental function get_option_with_default_integer(option, default) result(option_out)

Returns option if present or default if not.

Arguments

Type IntentOptional Attributes Name
integer, intent(in), optional :: option
integer, intent(in) :: default

Return Value integer

private elemental function get_option_with_default_logical(option, default) result(option_out)

Returns option if present or default if not.

Arguments

Type IntentOptional Attributes Name
logical, intent(in), optional :: option
logical, intent(in) :: default

Return Value logical

private pure function get_option_with_default_character(option, default) result(option_out)

Returns option if present or default if not.

Read more…

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: option
character(len=*), intent(in) :: default

Return Value character(len=:), allocatable