CFG_get_type Subroutine

public subroutine CFG_get_type(cfg, var_name, res)

Get the type of a given variable of a configuration type

Arguments

Type IntentOptional Attributes Name
type(CFG_t), intent(in) :: cfg
character(len=*), intent(in) :: var_name
integer, intent(out) :: res

Calls

proc~~cfg_get_type~~CallsGraph proc~cfg_get_type CFG_get_type proc~get_var_index get_var_index proc~cfg_get_type->proc~get_var_index proc~handle_error handle_error proc~cfg_get_type->proc~handle_error proc~binary_search_variable binary_search_variable proc~get_var_index->proc~binary_search_variable

Source Code

  subroutine CFG_get_type(cfg, var_name, res)
    type(CFG_t), intent(in)      :: cfg
    character(len=*), intent(in) :: var_name
    integer, intent(out)         :: res
    integer                      :: ix

    call get_var_index(cfg, var_name, ix)

    if (ix /= -1) then
       res = cfg%vars(ix)%var_type
    else
       res = -1
       call handle_error("CFG_get_type: variable ["//var_name//"] not found")
    end if
  end subroutine CFG_get_type