read_argument Function

function read_argument(i, status)

Returns the argument number i of the command line.

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: i
integer, intent(out) :: status

Return Value character(len=:), allocatable


Called by

proc~~read_argument~~CalledByGraph proc~read_argument read_argument program~sonify sonify program~sonify->proc~read_argument

Source Code

    function read_argument(i, status)
        integer, intent(in)  :: i
        integer, intent(out) :: status
        character(:), allocatable :: read_argument, arg
        integer :: length

        ! We allocate the string with the needed length before reading it:
        call get_command_argument(i, length=length)
        allocate(character(length) :: arg)
        call get_command_argument(i, value=arg, status=status)

        read_argument = arg
    end function read_argument