  Among the known Ap stars, HD101065 is probably one of the most interesting
objects, demonstrating very rich spectra of rare-earth elements (REE). Strongly
peculiar photometric parameters of this star that can not be fully reproduced
by any modern theoretical calculations, even those accounting for realistic
chemistry of its atmosphere. In this study we investigate a role of missing REE
line opacity and construct a self-consistent atmospheric model based on
accurate abundance and chemical stratification analysis. We employed the
LLmodels stellar model atmosphere code together with DDAFit and SynthMag
software packages to derive homogeneous and stratified abundances for 52
chemical elements and to construct a self-consistent model of HD101065
atmosphere. The opacity in REE lines is accounted for in details, by using
up-to-date extensive theoretical calculations. We show that REE elements play a
key role in the radiative energy balance in the atmosphere of HD101065, leading
to the strong suppression of the Balmer jump and energy redistribution very
different from that of normal stars. Introducing new line lists of REEs allowed
us to reproduce, for the first time, spectral energy distribution of HD101065
and achieve a better agreement between the unusually small observed Str\"omgren
c1 index and the model predictions. Using combined photometric and
spectroscopic approaches and based on the iterative procedure of abundance and
stratification analysis we find effective temperature of HD101065 to be
Teff=6400K.
