Design and optimization of a portable LQCD Monte Carlo code using OpenACC