Ecosystem dynamics under climate change