How resilient are ecosystems in adapting to climate variability