Preparation of Mg and Ca metal by carbothermic reduction method – A thermodynamics approach