Thermodynamic foundations of applications of ab initio methods for determination of the adsorbate equilibria: hydrogen at the GaN(0001) surface.