where Ei(nc) and Ef (nc-1) is the total energy of the system under investigation in its initial state and final state, respectively. nc and (nc-1) refer to the number of electrons in the corresponding core level before and after excitation. Then, CLS can be calculated by the total energy difference of the same system with excited O at different position. For example, the CLS of surface O atoms referenced to the inner parts is achieved by: