An algorithm for determining Debye temperatures