The standard and the most obvious way - to calculate the band structure of solid, then to calculate the density of electronic states (DOS) and finally to fill these states with a quantity of electrons existing in the system following the principle "from the lower energies to the higher ones". The maximal energy of one-electron state yet being filled is the Fermi energy of system (at T=0 K) - directly according to the defenition of the latter.
Note, for metallic system the Fermi energy determined directly concides with it in the sense of chemical potential. As we deal with pure semiconductor, the Fermi level in the sense of chemical potential, as You know, is placed in the middle of gap, however, there is some kind of "voluntarism" in computational papers, - the Fermi level often is shown just at the top of the filled valence band - if that will not result in misunderstandings.
Either... Maybe that is too obvious, perhaps, I did not understand Your question correctly?
thanks very much for your answer. Actually, I am asking, how DFT packages calcualte fermi surface? Is there any equation, so that it calculates fermi energy. Most of the times fermi energy not in the middle of band gap for insulator or semi-conductor. so how they determine particular value for fermi energy.?
>>>Most of the times fermi energy not in the middle of band gap for insulator or semi-conductor. so how they determine particular value for fermi energy.?