High-contrast transmitarray (HCTA) metasurfaces, named as metalines in this article, a category of lithographically defined on-chip diffractive elements with minimized scattering loss, enables parallel on-chip optical signal processing. While high-performance devices with different functionalities are reported, most of them are static, and their optical functions are fixed after fabrication. However, dynamically tunable metasurfaces are of essential need in many modern optical systems. Here, we employ an inverse design method, combining FDTD parameter sweep with Fourier-optics simulations, to design thermally-controlled varifocal metalenses. Thermal tunability is accomplished through the thermo-optical effect of silicon. Maximum focal length tunability of 12% and 24% are demonstrated for 400µm and 200µm aperture varifocal metalens doublets at the wavelength of 1.55µm, respectively. The focusing efficiency is more than 74% for the whole temperature range. The 400µm and 200µm aperture metalenses are able to concentrate the input beam to spot sizes less than one wavelength and two wavelengths, respectively. This paves the way for dynamically controlled silicon photonics computational chips.