optional_logical_to_string Subroutine

private subroutine optional_logical_to_string(logical_value, string_value, default_value)

Logical to string, specifying the default value if the optional argument is not present.

Arguments

Type IntentOptional Attributes Name
logical, intent(in), optional :: logical_value
character(len=:), intent(out), allocatable :: string_value

integer value stringified

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

default integer value


Called by

proc~~optional_logical_to_string~~CalledByGraph proc~optional_logical_to_string optional_logical_to_string proc~add_hist pyplot%add_hist proc~add_hist->proc~optional_logical_to_string proc~add_sphere pyplot%add_sphere proc~add_sphere->proc~optional_logical_to_string proc~plot_surface pyplot%plot_surface proc~plot_surface->proc~optional_logical_to_string proc~plot_wireframe pyplot%plot_wireframe proc~plot_wireframe->proc~optional_logical_to_string

Source Code

    subroutine optional_logical_to_string(logical_value, string_value, default_value)

    logical,intent(in),optional              :: logical_value
    character(len=:),allocatable,intent(out) :: string_value   !! integer value stringified
    character(len=*),intent(in)              :: default_value  !! default integer value

    if (present(logical_value)) then
        if (logical_value) then
            string_value = 'True'
        else
            string_value = 'False'
        end if
    else
        string_value = default_value
    end if

    end subroutine optional_logical_to_string