GGA+U method from first principles: application to reduction–oxidation properties in ceria-based oxides