For optoelectronic devices semiconductors with large band gap doped with rare earth are used. Doping is generally performed during growth but for more structured doping the ion implantation technique is preferable. The perturbed γγ-angular correlation technique is an ideal tool to study the behavior of semiconductors after implantation. An adequate rare earth isotope for such investigations of semiconductors is 172Yb. The temperature dependence of the hyperfine fields for 172Lu(172Yb) in GaN has been analysed. The total electric field gradient (EFG) at the site of this probe is a superposition of the lattice EFG due to the GaN wurtzite structure and the EFG due to the 4f shell of the rare earth probe itself. The latter is strongly temperature dependent and opposed to the lattice EFG which in contrast is nearly constant since the lattice parameters change only negligibly with temperature. At elevated temperatures the sublevels of the 4f shell, split by the crystal electric field, are equally populated. But at low temperatures the lowest level is occupied preferentially. Sign and magnitude of the EFG caused by the 4f shell can be calculated and the result compared to the experimental data.