int4_from_string Subroutine

public subroutine int4_from_string(lhs, rhs)

Get integer of kind 4 from the string which might contain either octal or binary number

Arguments

Type IntentOptional AttributesName
integer(kind=4), intent(out) :: lhs
character(len=*), intent(in) :: rhs

Calls

proc~~int4_from_string~~CallsGraph proc~int4_from_string int4_from_string interface~bin2int bin2int proc~int4_from_string->interface~bin2int interface~oct2int oct2int proc~int4_from_string->interface~oct2int proc~bin_to_int8 bin_to_int8 interface~bin2int->proc~bin_to_int8 proc~bin_to_int4 bin_to_int4 interface~bin2int->proc~bin_to_int4 proc~oct_to_int8 oct_to_int8 interface~oct2int->proc~oct_to_int8 proc~oct_to_int4 oct_to_int4 interface~oct2int->proc~oct_to_int4

Called by

proc~~int4_from_string~~CalledByGraph proc~int4_from_string int4_from_string interface~assignment(=) assignment(=) interface~assignment(=)->proc~int4_from_string

Contents

Source Code


Source Code

        subroutine int4_from_string(lhs, rhs)
          !< Get integer of kind 4 from the string which might contain either octal or binary number
            implicit none
            integer(kind=4), intent(out) :: lhs
            character(len=*), intent(in) :: rhs
            character(len=len(rhs)-1) :: temp
            temp = rhs(2:)
            if (rhs(1:1) == 'b') then
                call bin2int(lhs, temp)
            else if (rhs(1:1) == 'o') then
                call oct2int(lhs, temp)
            end if
        end subroutine int4_from_string