def get_dim_names_for_variables(variables):
    """
    Analyses variables to gather a list of dimension (coordinate)
    names. These are returned as a set of dimension names.
    """
    return {dim for v in variables for dim in v.dims}