CFG_get_size Subroutine

public subroutine CFG_get_size(cfg, var_name, res)

Get the size of a variable

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_size~~CallsGraph proc~cfg_get_size CFG_get_size proc~get_var_index get_var_index proc~cfg_get_size->proc~get_var_index proc~handle_error handle_error proc~cfg_get_size->proc~handle_error proc~binary_search_variable binary_search_variable proc~get_var_index->proc~binary_search_variable

Source Code

  subroutine CFG_get_size(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_size
    else
       res = -1
       call handle_error("CFG_get_size: variable ["//var_name//"] not found")
    end if
  end subroutine CFG_get_size