Abstract. The accurate simulation of heat transfer with phase change is a central problem in cryosphere studies. This is because the nonlinear behaviour of enthalpy as function of temperature can prevent thermal models of snow, ice and frozen soil from converging to the correct solution. Existing numerical techniques rely on increased temporal resolution in trying to keep corresponding errors withing acceptable bounds. Here, we propose an algorithm, originally applied to solve water flow in soils, as a method to solve these integration issues with guaranteed convergence and conservation of energy for any time step size. We review common modeling approaches, focusing on the fixed-grid method and on frozen soil. Based on this, we develop a conservative formulation of the governing equation and outline problems of alternative formulations in discretized form. Then, we apply the nested Newton-Casulli-Zanolli (NCZ) algorithm to a one-dimensional finite-volume discretization of the energy-enthalpy formulation. Model performance is demonstrated against the Neumann and Lunardini analytical solutions and by comparing results from numerical experiments with integration time steps of one hour, one day, and ten days. Using our formulation and the NCZ algorithm, the convergence of the solver is guaranteed for any time step size. With this approach, the integration time step can be chosen to match the time scale of the processes investigated.