Influence of climate, soil moisture, and succession on forest carbon and nitrogen cycles