||Croplands play an important role in the carbon budget of many regions. However, the estimation of their carbon balance remains difficult due to diversity and complexity of the processes involved. We report the coupling of a one-dimensional soil water, heat, and CO2 flux model (SOILCO2), a pool concept of soil carbon turnover (RothC), and a crop growth module (SUCROS) to predict the net ecosystem exchange (NEE) of carbon. The coupled model, further referred to as AgroC, was extended with routines for managed grassland as well as for root exudation and root decay. In a first step, the coupled model was applied to two winter wheat sites and one upland grassland site in Germany. The model was calibrated based on soil water content, soil temperature, biometric, and soil respiration measurements for each site, and validated in terms of hourly NEE measured with the eddy covariance technique. The overall model performance of AgroC was sufficient with a model efficiency above 0.78 and a correlation coefficient above 0.91 for NEE. In a second step, AgroC was optimized with eddy covariance NEE measurements to examine the effect of different objective functions, constraints, and data-transformations on estimated NEE. It was found that NEE showed a distinct sensitivity to the choice of objective function and the inclusion of soil respiration data in the optimization process. In particular, both positive and negative day- and nighttime fluxes were found to be sensitive to the selected optimization strategy. Additional consideration of soil respiration measurements improved the simulation of small positive fluxes remarkably. Even though the model performance of the selected optimization strategies did not diverge substantially, the resulting cumulative NEE over simulation time period differed substantially. Therefore, it is concluded that data transformations, definitions of objective functions, and data sources have to be considered cautiously when a terrestrial ecosystem model is used to determine NEE by means of eddy covariance measurements. (C) 2017 Elsevier B.V. All rights reserved.