Carbon dynamics in forests and croplands: influence of management and climate extremes