Stomatal and photosynthetic responses to variable sunlight