Novel automated inversion algorithm for temperature reconstruction using gas isotopes from ice cores