As the diversity of HPC systems increases, even legacy HPC applications often need to use accelerators for higher performance. To migrate large-scale legacy HPC applications to modern HPC systems including accelerators, OpenACC is a promising approach because its directive-based approach can prevent drastic code modifications. This paper shows a case study of the migration of a large-scale atmospheric simulation code to an OpenACC platform by keeping the maintainability of the original code. Although OpenACC enables an application to use accelerators by adding a small number of directives, it requires modifying the original code to achieve a high performance in most cases, and tends to degrade the maintainability and/or portability. To avoid such code modifications, this paper adopts a code transformation framework, Xevolver. Instead of directly modifying the code, custom code transformation rules and custom directives are defined using the Xevolver framework. This paper first shows that just inserting OpenACC directives does not lead to high performance and non-Trivial code modifications are required in practice. Then, the direct code modification can be avoided by using externally defined transformation rules and directives to keep the original code unchanged as much as possible. Finally, the performance evaluation shows that the code modifications can improve the performance of the OpenACC code.