<p>Under unprecedent climate change and increased frequency of extreme events, e.g. drought, it is important to assess and forecast forest ecosystem vulnerability and stability. Large volumes of data from observational and experimental networks, increases in computational power, advances in ecological models, and optimization methodologies are the main measures to improve quantitative forecasting in ecology. Data assimilation is a key tool to improve ecosystem state prediction and forecasting by combining model simulations and observations. We assimilated observations of carbon stocks and fluxes from 271 permanent long-term forest monitoring plots across Switzerland into the 3-PG forest ecosystem model using Bayesian inference, reducing the bias of model predictions from 14% to 5% for forest stem carbon stocks and from 45% to 9% for stem carbon stock changes, respectively. We then estimated the productivity of forests dominated by <em>Picea abies</em> and <em>Fagus sylvatica</em> for the period of 1960-2018 and tested for climate-induced shifts in productivity along elevational gradient and in extreme years. Overall, we demonstrated a high potential of using data assimilation to improve predictions of forest ecosystem productivity. Furthermore, our calibrated model simulations suggest that climate extremes affect forest productivity in more complex ways than by simply shifting the response upwards in elevation.</p>