Coevolution of photosynthetic organisms and the environment