Crop switching as a strategy for adapting to climate change