Volume and surface photoemission from tungsten. I. Calculation of band structure and emission spectra