Modelling the long-term dynamics of populations and communities of trees in boreal forests based on competition for light and nitrogen