Model calculations for the terrestrial carbon cycle: carbon isotope geochemistry and evolution of photosynthetic oxygen