def is_coordinate_variable(ds, variable):
    """
    Returns True if the variable is a coordinate variable

    :param netCDF4.Dataset nc: An open netCDF dataset
    :param str variable: Variable name
    """
    if variable not in ds.variables:
        return False
    return ds.variables[variable].dimensions == (variable,)