Isotopic composition of atmospheric O2 in ice linked with deglaciation and global primary productivity