Local topography significantly affects spatial variations of climatic variables and soil water movement in complex terrain. Therefore, the distribution and productivity of ecosystems are closely linked to topography. Using a coupled terrestrial carbon and hydrological model (BEPS-TerrainLab model), the topographic effects on the net primary productivity (NPP) are analyzed through four modelling experiments for a 5700 km(2) area in Baohe River basin, Shaanxi Province, northwest of China. The model was able to capture 81% of the variability in NPP estimated from tree rings, with a mean relative error of 3.1%. The average NPP in 2003 for the study area was 741 gCm(-2)yr(-1) from a model run including topographic effects on the distributions of climate variables and lateral flow of ground water. Topography has considerable effect on NPP, which peaks near 1350 m above the sea level. An elevation increase of 100 m above this level reduces the average annual NPP by about 25 gCm(-2). The terrain aspect gives rise to a NPP change of 5% for forests located below 1900 m as a result of its influence on incident solar radiation. For the whole study area, a simulation totally excluding topographic effects on the distributions of climatic variables and ground water movement overestimated the average NPP by 5%.