def remove_coords(cube):
    """
    Remove non-essential coordinates from ``cube``. This should prevent a number
    of subsequent cube concatenation issues, plus reduce output file size. Note,
    however, that scalar coordinates, such as level number in the case of a
    vertical subset, are also removed.
    """
    removed_coord_names = []

    # First remove any auxiliary coordinates.
    for coord in cube.coords(dim_coords=False):
        removed_coord_names.append(coord.name())
        cube.remove_coord(coord)

    # Then remove any dimension coordinates not in the following list.
    dim_coords_to_keep = ['time', 'latitude', 'longitude']
    for coord in cube.coords(dim_coords=True):
        if coord.standard_name not in dim_coords_to_keep:
            removed_coord_names.append(coord.name())
            cube.remove_coord(coord)

    return removed_coord_names