Thermal regime of a glacier in relation to glacier ice formation