def find_grid_topology_var(nc):
    """
    Get the variable from a netCDF dataset
    that have a `cf_role `attribute of 'grid_topology' and
    `topology_dimension` of 2.

    :params nc: netCDF dataset
    :type nc: netCDF4.Dataset
    :return: variable name that contain grid topologies
    :rtype: string

    """
    grid_topology = nc.get_variables_by_attributes(cf_role='grid_topology')

    if not grid_topology:
        raise ValueError('Could not find the `grid_topology` variable.')
    if len(grid_topology) > 1:
        msg = 'Expected 1 `grid_topology` variable.  Got {0}'.format
        raise ValueError(msg(len(grid_topology)))

    grid_topology = grid_topology[0]
    topology_dimension = grid_topology.topology_dimension if hasattr(grid_topology, 'topology_dimension') else None  # noqa

    if topology_dimension != 2:
        msg = ('Only 2 dimensions topology are supported.'
               'Got {0}'.format)
        raise ValueError(msg(topology_dimension))

    return grid_topology.name