Simulation of tree-ring widths with a model for primary production, carbon allocation, and growth