Get the type of a given variable of a configuration type
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(CFG_t), | intent(in) | :: | cfg | |||
| character(len=*), | intent(in) | :: | var_name | |||
| integer, | intent(out) | :: | res |
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