A method is developed for calculating kinetic temperature in molecular dynamics simulations of shear flow. Kinetic temperature, an instantaneous variable whose average during an observable time defines the temperature, is a measure of the mean energy of atomic vibration by thermal agitation. For systems under shear, the velocities of constituent atoms are representative of both microscopic thermal vibrations and macroscopic shear flow. In the case of confined lubricant films under shear, thermal and dynamic transfers occur in all parts of the film and are characterized by temperature and velocity profiles. The difficulty from a microscopic point of view lies in separating the thermal from dynamic aspects which are tightly coupled inside the atomic velocities. The proposed method allows the contributions of each transport phenomenon to be efficiently identified from the microscopic scale of atomic velocities. Based on a double-scale energetic analysis which links the kinetic energy of sliding layers to the energies of their constituent atoms, the method eventually permits the temperature profile across the film to be quantified. Implemented, the method gives more accurate results in non-equilibrium viscosity predictions compared to classical approaches.