Calculation of standard free energy of formation for ions