  The effect of Mg codoping and its deposition mode on the Fe distribution in
(Ga,Fe)N layers grown by metalorganic vapor phase epitaxy is investigated. Both
homogeneously- and digitally-Mg codoped samples are considered and contrasted
to the case of (Ga,Fe)N layers obtained without any codoping by shallow
impurities. The structural analysis of the layers by high-resolution
transmission electron microscopy and by high-resolution- and synchrotron x-ray
diffraction gives evidence of the fact that in the case of homogenous-Mg
doping, Mg and Fe competitively occupy the Ga-substitutional cation sites,
reducing the efficiency of Fe incorporation. Accordingly, the character of the
magnetization is modified from ferromagnetic-like in the non-codoped films to
paramagnetic in the case of homogeneous Mg codoping. The findings are discussed
vis-`a-vis theoretical results obtained by ab initio computations, showing only
a weak effect of codoping on the pairing energy of two Fe cations in bulk GaN.
However, according to these computations, codoping reverses the sign of the
paring energy of Fe cations at the Ga-rich surface, substantiating the view
that the Fe aggregation occurs at the growth surface. In contrast to the
homogenous deposition mode, the digital one is found to remarkably promote the
aggregation of the magnetic ions. The Fe-rich nanocrystals formed in this way
are distributed non-uniformly, giving reason for the observed deviation from a
standard superparamagnetic behavior.
