@staticmethod
def _dimensions(n, name, tree=None):
    """ Retrieve  method to get the NetCDF variable """
    if tree is None:
        return n.dimensions[name]
    g = n
    if isinstance(tree, list):
        for t in tree:
            g = g.groups[t]
    else:
        g = g.groups[tree]
    return g.dimensions[name]
