def real_space_shape_2d_tag_from_real_space_shape_2d(real_space_shape_2d):
    """Generate a sub-grid tag, to customize phase names based on the sub-grid size used.

    This changes the phase name 'phase_name' as follows:

    real_space_shape_2d = None -> phase_name
    real_space_shape_2d = 1 -> phase_name_real_space_shape_2d_2
    real_space_shape_2d = 4 -> phase_name_real_space_shape_2d_4
    """
    if real_space_shape_2d is None:
        return ''
    y = str(real_space_shape_2d[0])
    x = str(real_space_shape_2d[1])
    return '__rs_shape_' + y + 'x' + x
