Barcelona is on the Mediterranean coast.
Mountains (part of the Pyrenees range) to the north west run immediately behind the Costa Brava and rise to over 1700m - these will have a localised effect on temperatures and rainfall once you move away from the coast. Inland here, temperatures are likely to be significantly lower, particularly in the winter. Winter winds from the Pyrenees are likely to be cold. These mountains become less significant as you approach Roses.
South west of Barcelona, following the Costa Dorada towards Sitges, Tarragona and the Ebro delta, the topography is less mountainous and summer temperatures are likely to be a little higher away from the coast. However, as you near the Ebro delta, the area is known to experience above average winds particularly in the winter.
About 120Km north of Barcelona are the eastern end of the Pyrenees where they are about 2500m high.
The average rainfall for Barcelona is 590mm or 23 inches (Source: World Climate),with most rain expected during September and October.
Daily average temperatures for Barcelona
Source: World Climate