get_option_with_default_character Function

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


Contents


Source Code

  pure function get_option_with_default_character(option, default) result(option_out)
    implicit none
    character(len=*), intent(in), optional :: option
    character(len=*), intent(in) :: default
    character(len=:), allocatable :: option_out

    if( present(option) ) then
       option_out = option
    else
       option_out = default
    end if
  end function get_option_with_default_character