Theoretical study of the valence and K-shell spectra of atmospherically relevant CO2