  The orbital, lattice, and spin ordering phenomena in KCuF3 are investigated
by means of LDA+U calculations, based on ab-initio pseudopotentials.We examine
the Cu-3d orbital ordering and the associated Jahn-Teller distortion in several
different spin-ordered structures of KCuF3. The ground state is correctly
predicted to be an A-type antiferromagnetic structure, and the calculated
Jahn-Teller distortion agrees also well with experiment. Concerning the orbital
ordering, we find that even for a highly ionic compound such as KCuF3, the
orbital-order parameter is significantly reduced with respect to its nominal
value due to Cu(3d)--F(2p) hybridization. We also calculate the Cu K-edge
resonant x-ray scattering spectra for Bragg reflections associated with orbital
order. Consistent with previous studies, we find that the resonant signal is
dominated by the structural anisotropy in the distribution of the F neighbors
of the resonant Cu atom, and that the Cu-3d orbital ordering has only a minor
influence on the spectra. Our LDA+U results, however, also indicate that a
change in the magnetic structure has a small influence on the Jahn-Teller
distortion, and hence on the resonant spectrum, in the conventional
(room-temperature) crystallographic structure of KCuF3. This may indicate that
the large change observed experimentally in the resonant signal near the N\'eel
temperature is related to a low-temperature structural transformation in KCuF3.
