def _get_var_meta(cr, case_name, var):
    """
    Return the metadata for the variable of the given name in the given case.

    Parameters
    ----------
    cr : CaseReader
        The case reader housing the data.
    case_name : str
        The case from which the outputs with available metadata is to be returned.
    var : str
        The output whose metadata is desired.

    Returns
    -------
    list
        A dictionary of the metadata for the given output
    """
    case = cr.get_case(case_name)

    case_outputs = case.list_outputs(prom_name=True, units=True, shape=True, val=False,
                                     residuals=False, out_stream=None)

    for _, meta in case_outputs:
        if meta['prom_name'] == var:
            return meta

    case_inputs = case.list_inputs(prom_name=True, units=True, shape=True, val=False,
                                   out_stream=None)

    for _, meta in case_inputs:
        if meta['prom_name'] == var:
            return meta

    raise KeyError(f'No output named {var} found')