Numerical consistency of metric terms in terrain-following coordinates

In numerically integrating the equations of motion in terrain-following coordinates, care must be taken in treating the metric terms that arise due to the sloping coordinate surfaces. In particular, metric terms that appear in the advection and pressure-gradient operators should be represented in a manner such that they exactly cancel when transformed back to Cartesian coordinates. Noncancellation of these terms can lead to spurious forcing at small scales on the numerical grid. This effect is demonstrated for a mountain wave flow problem through analytic solutions to the linear finite-difference equations. Further confirmation is provided through numerical simulations with a two-dimensional prototype version of the Weather Research and Forecasting (WRF) model, and with the Canadian Mesoscale Compressible Community (MC2) model.