def METHOD_NAME(sc, num_released, water=None, substance=None, aggregate=True):
    '''
    Initializes the density of the last num_rel elements of a spill container (sc),
    taking into account environmental conditions.
    :param sc: spill container
    :param num_rel: int
    :param water: Water object to use. If None, uses default values
    :param substance: gnome.spills.substance.Substance or subclass thereof
    :param aggregate: Flag for whether to trigger mass balance updates in spill container
    '''
    substance = sc.substance if substance is None else substance
    water_temp = water_density = None
    #if substance.is_weatherable:
    if water is None:
        water_temp = default_constants.default_water_temperature
        water_density = default_constants.default_water_density
    else:
        water_temp = water.get('temperature', 'K')
        water_density = water.get('density')
    # Only the new elements need to be initialized
    sl = slice(-num_released, None, 1)
    density = substance.density_at_temp(water_temp)
    if density > water_density:
        msg = ("{0} will sink at given water temperature: {1:.1f} {2}. "
                "Setting density to water density"
                .format(substance.name,
                        water_temp,
                        'K')
        )
        logger.error(msg)
        sc['density'][sl] = water_density
    else:
        sc['density'][sl] = density
    if aggregate:
        agg_func(sc, num_released)