A test of the optimality approach to modelling canopy properties and CO2 uptake by natural vegetation