Response and adaptation of agricultural ecosystems to global changes