We accurately simulate the phase diagram and critical behavior of the $q$-state clock model on the square lattice by using the state-of-the-art loop optimization for tensor network renormalzation(loop-TNR) algorithm. The two phase transition points for $q geq 5$ are determined with very high accuracy. Furthermore, by computing the conformal scaling dimensions, we are able to accurately determine the compactification radius $R$ of the compactified boson theories at both phase transition points. In particular, the compactification radius $R$ at high-temperature critical point is precisely the same as the predicted $R$ for Berezinskii-Kosterlitz-Thouless (BKT) transition. Moreover, we find that the fixed point tensors at high-temperature critical point also converge(up to numerical errors) to the same one for large enough $q$ and the corresponding operator product expansion(OPE) coefficient of the compactified boson theory can also be read out directly from the fixed point tensor.