In this study, we propose a high order well-balanced weighted compact nonlinear (WCN) scheme for the gas dynamic equations under gravitational fields. The proposed scheme is an extension of the high order WCN schemes developed in (S. Zhang, S. Jiang, C.-W Shu, J. Comput. Phys. 227 (2008) 7294-7321). For the purpose of maintaining the exact steady state solution, the well-balanced technique in (Y. Xing, C.-W Shu, J. Sci. Comput. 54 (2013) 645-662) is employed to split the source term into two terms. The proposed scheme can maintain the isothermal equilibrium solution exactly, genuine high order accuracy and resolve small perturbations of the hydrostatic balance state on the coarse meshes. Furthermore, in order to capture the strong discontinuities and large gradients, the fifth-order upwind weighted nonlinear interpolations together with the fourth/sixth order cell-centered compact schemes with local characteristic projections are used to construct different WCN schemes. Several representative one- and two-dimensional examples are simulated to demonstrate the good performance of the proposed schemes.