Dynamic adaptation of maize and wheat production to climate change