A recursive algorithm for multidimensional inverse heat conduction problems by means of mode reduction