Even in non-tropical areas the air temperature decreases with height in the lower 10km of the Earth's atmosphere. This is illustrated graphically in a plot of the atmospheric temperature profile. For every kilometer of elevation you gain, the temperature decreases about 6.5 degrees Celsius. This happens because solar energy absorbed by the Earth warms the lowest layer of the atmosphere (the first 10km, called the troposphere). Even though the troposphere is well mixed by winds, the warm surface keeps the base of the atmosphere warmer than the air above. On rare occasions, such as clear nights when the Earth cools off a lot, part of the temperature profile can reverse, creating a stable air layer known as a temperature inversion. Air pollution often concentrates when a temperature inversion has occurred. An additional reason that the sea shore is usually cooler than land is that the oceans can absorb the same amount of sunlight as the land, but warm up relatively little as a result. That is to say, sea water has a much higher specific heat capacity than dirt.