The calculation of vibrational frequencies of atoms adsorbed on metal surfaces: H, O, and S on Ni(100) and Ni(111) as examples