The definition and actual calculation of metal gate work function is discussed in this tutorial
http://docs.quantumwise.com/tutorials/inas_p-i-n_junction/inas_p-i-n_junction.html.
A gate electrode is treated as a continuum (nonatomistic) material having dielectric properties of metal, i.e., assuming that the dielectric constant is infinite for this continuum material, and the electrostatic potential is constant across the entire metal gate region.
In the ATK, the default value for the gate electrostatic potential defined with respect to the Fermi energy is set to zero, and in the tutorial, the Fermi energy is considered as a reference (zero) energy . However, the Fermi energy and gate potential value defined with respect to the vacuum level are not zero, and the Fermi energy defined with respect to the vacuum level (in the gate region) is called work function (of metal gate). The metal gate treated within the continuum approximation can, in principle, be related to a real atomisic metal with similar work function.
The work function of the metal gate electrode can be tuned by applying a gate voltage that means that we set the gate electrostatic potential (defined with respect to the Fermi level) of the metal gate to a non-zero value, changing the energy difference (=work function) between the vacuum level in the gate region and the Fermi level. This also gives rise to a shift of the semiconductor bands in the semiconductor channel (under or above the top or bottom gate, respectively) with respect to the Fermi level. This can be seen as a local electrostatic doping of the channel material because either conduction or valence band of the channel semiconductor material gets closer to the Fermi level due to the band structure shift, becoming more occupied by electrons or holes, respectively.
Note that the Fermi level is fixed by the electrodes and does not shift upon gating the channel region.