Map from Google - Catalonia

In Catalonia, an autonomous community located in north-eastern Spain, the climate is Alpine (cold mountain climate) in the Pyrenees, on the border with France, it's oceanic (cool and wet) in the small area of the Garonne valley, located to the north of the Pyrenees, and it's Mediterranean along the coast, while in inland areas (see Lleida) it gets a little more continental and drier than the real Mediterranean climate.
The rains exceed 1,000 millimetres (40 inches) per year in the Pyrenean area, where some rains and thunderstorms occur also in summer, they remain above 700 mm (27.5 in) in the Girona province, they hover around 600 mm (23.5 in) in the coast of Barcelona and around 500 mm (20 in) in the coast of Tarragona, while they drop below 400 mm (16 in) in the central and southern inland areas (see Lleida), which are therefore definitely arid.
There are also some mountain ranges parallel to the coast (the Catalan Mediterranean System), whose climate gets colder with increasing altitude. In the Montseny Massif, the highest point is Turó de l'Home, 1,707 metres (5,600 feet) high. The range of Montserrat goes up to 1,236 metres (4,055 feet), but the monastery is at 700 metres (2,300 feet). In the valleys between these mountain ranges, in winter fog can form, while during cold spells from Eastern Europe it can snow at hill altitudes.

Monastery of Montserrat

In the far north, along the border with France, we find the chain of the Pyrenees; the highest peak of Catalonia is Pica d'Estats, 3,143 metres (10,312 feet) high, on the border with France. In the area at the foot of the Pyrenees, at the same altitude, the climate is cooler than in the south-central region; in addition, this area is exposed to outbreaks of cold air, with strong winds, in winter. At high altitudes, in winter heavy snowfalls occur. Summer is cool, with possible afternoon thunderstorms, but given the position, some Atlantic fronts can pass also in this season.
In the Pyrenean valleys, in winter cold spells can occur, with night frosts, while in periods of stable weather, cold and foggy days can occur; in summer the temperatures are pleasantly warm during the day, but sometimes days with scorching heat are possible, even though the air is dry and nights remain cool.

On the coast the climate is Mediterranean, with mild and relatively rainy winters, and hot and sunny summers, in which the air is humid, but tempered by the breeze.
The northernmost part of the coast, in the province of Girona, is called Costa Brava. There are towns such as Portbou, Colera, Llançà, Cadaqués, Roses, Sant Pere Pescador, L'Escala, Estartit, Begur, Palafrugell, Palamós, Platja d'Aro, Sant Feliu de Guixols, Tossa de Mar, Lloret de Mar and Blanes. Due to its northern location, the climate is quite cold in winter, the rains have two maxima in spring and autumn, and some occasional disturbances may pass also in summer.
Here are the average temperatures of Girona, the chief town, located at 25 km (15 miles) from the coast.
Average temperatures - Girona
Min (°C)124610141717141152
Max (°C)131417192227303026221714
Min (°F)343639435057636357524136
Max (°F)555763667281868679726357

In Girona, 720 mm (28.5 in) of rain per year fall, with a minimum in July and a maximum in October.
Here is the average precipitation.
Average precipitation - Girona
Prec. (mm)605050657060304570907055720
Prec. (in)2.4222.

The temperature of the sea is lower in the northernmost part of the Costa Brava than in the central and southern part, because beyond the French border the Gulf of Lions receives cold Atlantic air masses for many months a year, which are able to cool down the sea. In Colera, the water temperature does not go over 21 °C (70 °F) in July and 22 °C (72 °F) in August.
Further south, in the Gulf of Roses, the sea is never very warm, however, it reaches 23 °C (73 °F) in August, while it is still at only 21 °C (70 °F), so definitely cool, in July. Here is the temperature of the sea at Figueres.
Sea temperature - Figueres
Sea (°C)131313141619212321181614
Sea (°F)555555576166707370646157

Continuing to the south, the sea temperature increases slightly, but remains cool enough, down to Palamós and Sant Feliu de Guíxols.
In the southernmost part of the Costa Brava (see Tossa de Mar, Lloret de Mar, Blanes), the sea becomes warmer. Here is the temperature of the sea at Blanes.
Sea temperature - Blanes
Sea (°C)131313141720232523201715
Sea (°F)555555576368737773686359

Tossa de Mar, Costa Brava

In the rest of the coast of Catalonia, in the provinces of Barcelona and Tarragona, the sea temperature is similar to that of Blanes, or becomes, albeit slightly, even higher.
South of Costa Brava, in the province of Barcelona we find the Costa de Barcelona, which includes towns like Sitges, Vilanova i la Geltru, Arenys de Mar, Malgrat de Mar, Santa Susanna, Calella, Castelldefels, Badalona, Mataro, Sant Pol de Mar and Canet de Mar.
Here are the average temperatures of Barcelona.
Average temperatures - Barcelona
Min (°C)557913172020171496
Max (°C)141416182125282926221714
Min (°F)414145485563686863574843
Max (°F)575761647077828479726357

In Barcelona, precipitation amounts to 620 mm (24.5 in) per year, with an evident maximum in autumn, due to the prevailing southern currents. In winter the rains are not abundant: only 40 mm (1.6 in) per month from December to February.
Here is the average precipitation.
Average precipitation - Barcelona
Prec. (mm)4040354055302065851006540620
Prec. (in)

In Barcelona the sea is warm enough for swimming from July to September, with a peak in August, of 25 °C (77 °F). In June, the sea is still cool, around 20 °C (68 °F).
Here are the average sea temperatures.
Sea temperature - Barcelona
Sea (°C)131313141720232523201715
Sea (°F)555555576368737773686359

Further south, in the province of Tarragona, we find the Costa Dorada, which includes towns such as L'Espluga de Francoli, Salou, Tarragona, Valls, Mont-Roig del Camp, Montblanc, Prades, Altafulla and Calafell. Here the climate is Mediterranean, similar to that of the coast of Barcelona, though a bit drier.
Here are the average temperatures of the airport of Reus, near Tarragona.
Average temperatures - Reus
Min (°C)457912161920171385
Max (°C)141517192226292926221815
Min (°F)394145485461666863554641
Max (°F)575963667279848479726459

In Reus, 500 mm (20 in) of rain per year fall; even here you can notice the autumn peak, while in winter it rains little.
Here is the average precipitation.
Average precipitation - Reus
Prec. (mm)303030355525154075755535500
Prec. (in)

In the Costa Dorada the sea is warm enough for swimming from July to September as well, with a maximum in August of 25 °C (77 °F), while in June it is still cool, around 20 °C (68 °F). Here, for example, the temperature of the sea at Tarragona.
Sea temperature - Tarragona
Sea (°C)131313141720232523201715
Sea (°F)555555576368737773686359

Port of Tarragona from above

In the interior of Catalonia, in the Catalan Central Depression, which is actually a plain area, formed by the Ebro River and its tributaries, the climate becomes slightly more continental and more arid.
In Lleida, the capital of the only landlocked province, the average of January is 5 °C (41 °F), that of July and August is 25 °C (77 °F). In winter, nights are often cold, with possible slight frosts. In summer, torrid days are frequent, with peaks around 40 °C (104 °F), but the air is dry, and at night the temperature drops a lot.
Here are the average temperatures.
Average temperatures - Lleida
Min (°C)124711151717141042
Max (°C)101418212530333228221510
Min (°F)343639455259636357503936
Max (°F)505764707786919082725950

In Lleida, just 340 mm (13.5 in) of rain per year fall. You can notice the considerably low rainfall amount in winter.
Here is the average precipitation.
Average precipitation - Lleida
Prec. (mm)251520404025102040453025340
Prec. (in)

The amount of sunshine in Catalonia is very good in summer on the coast and in inland south-central areas: in Girona the average goes from 4 hours of sunshine per day in December to 9 in July, in Barcelona and Tarragona from 4.5 hours in December to 10 in July, in Tortosa from 5 hours in December to 10.5 in July. Lleida, lying in the interior, in winter experiences more often fogs and low clouds, so there are only 3 hours of sunshine per day in December, which become even 11.5 in July.
Here are the average daily sunshine hours in Barcelona.
Sunshine - Barcelona
Sun (hours)5678891096655

When to go

The best time to visit the Pyrenees and the valleys at the foot of the mountains is summer, being the warmest (or mildest) and sunniest of the year.
The summer, from mid-June to August, is also the best time for a beach holiday in Catalonia.
In low-lying inland areas (see Lleida), being the summer hot, you may prefer spring and autumn, especially in May, and from mid-September to mid-October, although the rains are more frequent.
Those who can stand the heat can choose July and August even for this area, but should be ready to stroll around cities in hot weather.