The city is spending millions to expand existing parks, and as many roofs and walls will be covered with greenery as possible. Twenty-two vacant lots will be turned into urban gardens. Paved squares will become parks that can suck up rainfall. Near the river that runs through the middle of the city–where a major highway was torn down in 2003–the city is spending over $4.3 million to finish filling in the banks with trees.

As the city starts to ban cars from central streets, the Department of the Environment is considering turning some of those streets into linear, tree-filled parks, too.

It’s all part of sweeping plan to help adapt to some of the biggest challenges the city faces from climate change: More blisteringly hot days, more severe drought, and–when it does rain–heavier floods.

“The idea is that over time as these interventions increase they will work together–and work with other larger city climate change schemes and projects–to help build vital climate change resilience at a larger scale up to city scale,” says Tom Armour, director of global landscape architecture for Arup, the design and engineering firm that worked with Madrid to create a long menu of ways the city can prepare by integrating more nature into the concrete.

Madrid has always been hot in the summer, but it’s getting hotter. During a heat wave in 2015, 104-degree days broke the city’s all-time records for the month of June and July. Heat waves that used to happen once every two decades now happen every five years. By 2050, there will be 20% more unusually hot days in the summer, and it will rain 20% less.

Each of the planned changes in landscaping can help. Planting gardens on roofs, and adding plants on outdoor walls, helps insulate buildings so they can save energy, and helps reduce street noise. But it also helps bring down local temperatures by shading pavement and by releasing evaporated water that can create clouds. In pilot green roof tests in some Madrid neighborhoods, temperatures went down more than four degrees. Replacing paved squares with plantings that can absorb and store water will help the city cope with more frequent heavy rain.