Heatwaves and heavy rain predicted to last longer with climate change