def getData(nc, mname, loc):
    """
    Find all the variables that are attached to a mesh name
    @param nc netCDF4 file handle
    @param mname mesh name
    @param loc "node", "edge", or "face"
    @return {vname: var}
    """
    res = {}
    for vname, var in nc.variables.items():
        meshName = getattr(var, 'mesh', '')
        location = getattr(var, 'location', '')
        if meshName == mname and location == loc:
            res[vname] = var
    return res