Comment on gmd-2021-82

The authors focus on Spherical Centroidal Voronoi Tesselations (SCVT), refined using a density function that depends on four parameters and on the topography. The dry and moist shallow water equations are solved using the TRSK discretization of the MPAS dynamical core and applied to a set of standard test cases. The main result is that this local refinement may generate numerical inertia-gravity waves that produce both qualitative and quantitative errors, but that these waves can be easily removed by increasing Laplacian horizontal diffusion of both the divergent and rotational modes. Local refinement over topography sometimes improves cloud representation, although overall it is not clear it improves precipitation results.

The authors focus on Spherical Centroidal Voronoi Tesselations (SCVT), refined using a density function that depends on four parameters and on the topography. The dry and moist shallow water equations are solved using the TRSK discretization of the MPAS dynamical core and applied to a set of standard test cases. The main result is that this local refinement may generate numerical inertia-gravity waves that produce both qualitative and quantitative errors, but that these waves can be easily removed by increasing Laplacian horizontal diffusion of both the divergent and rotational modes. Local refinement over topography sometimes improves cloud representation, although overall it is not clear it improves precipitation results.

General Comments
The question of how to appropriately refine computational grids is vital to avoid unacceptably large errors generated by small scale features that cannot be resolved on a uniform grid. These features may be topographical (e.g. mountains), dynamical (e.g. localized fronts or hurricanes), or related to user-defined criteria (e.g. need for more accuracy in urban areas). Topography details should be easier to deal with than dynamical features since their location is fixed and the grid refinement can be static. In this case, one may decide that the topography geometry itself is a sufficient "error indicator" to determine grid resolution. Nevertheless, the problems are not independent since topography features may generate localized waves whose influence extends beyond the topography. It is also not obvious that a grid refinement criterion based exclusively on orography is sufficient to control the error of the shallow water equations. However, this paper shows that even this relatively simply case presents challenges The choice of the four parameters and the sensitivity of the computations to these choices needs more justification and investigation. How sensitive are the results/errors to each of the parameters? Could their choice be optimized in some way? (Please also see questions below.) This investigation considers only one example of local refinement on the Andes range (a long narrow structure with multiple steep valleys), so it is not obvious how much the results can be generalized to other cases of local refinement (e.g. around cities or topography with different gradient structures). Could you please comment on how generalizable you think the current results are?
Recommendation This is an interesting and well written paper that advances our understanding of how well-designed local static grid stretching can be used to make the representation of small scale orographic features more accurate. I will be happy to recommend publication in GMD after my general comments and specific questions have been addressed.
Questions P 3 Nested grids and static AMR type refinement requires a bit more discussion of their advantages and disadvantages compared with the grid "stretching" approach used here. Nested grids are used extensively in numerical weather prediction, and they do not not always suffer from wave reflection at refinement boundaries. AMR techniques could also be used to provide static grid refinement and it has been used successful for dynamical adaptivity. Multi-scale or multigrid approaches, such as wavelet based adaptive refinement used in WAVETRISK, also do not show spurious effects at refinement boundaries because of the use of prolongation/restriction between scales to ensure consistency. Is it necessary for the refined region to extend beyond the topography to ensure proper representation of dynamical features, such as waves? Because your grids are refined very smoothly, the refined regions actually do have this property (extending well beyond the Andes region). Is this necessary for dynamical accuracy as well as to guarantee good grid properties? P 6 Please give more explanation and justification for the precise form of the density function in equation (7). It is clearly not the unique density function consistent with relation (4). For example, the density function depends on the topography b(x), but not (directly) on its gradient (which is presumably an important factor). P 6 The density function (7) is based purely on the topography and will therefore not necessarily reduce errors in the solutions of the shallow water equations. However, it is also possible to optimise the choice of parameters using optimal control to minimize the height errors for certain shallow water test cases (e.g. the Williamson suite and the Galewsky jet). Have you considered a more systematic way of choosing these parameters? An optimized set of parameters may avoid the need for numerical diffusion and make better use of computational resources by refining the grid only where it is needed for accurate representation of the dynamics. Figure 3 How did you choose the parameters for the refined grid shown here? Are these the choices you will use for all simulations? Given the shape of the Andes, would an elliptical (rather than circular) refinement region be a better choice? It would be helpful to include the grid refinement parameters in the caption for table 1. P 6 What is the actual resolution in km of the ETOPO data used? How is this choice related to the resolution of the computational grids? P 12 Since numerical diffusion is entirely for stabilizing purposes, why did you not use hyper diffusion, which limits diffusion to larger wavenumbers? Laplacian diffusion smooths over more wavenumbers and is often not the best choice to stabilize a computation. P 12 Have you tried a local diffusion coefficient that is zero outside the refined grid area? How sensitive are the results to the precise choice of each of the grid refinement parameters? Have you done any sensitivity analysis (e.g. using Sobol' indices or Global Sensitivity Analysis GSA) on the parameters? It would be helpful to know which parameters are most influential.
Conclusions. Please comment on the extent to which the results can be generalized to a 3D hydrostatic atmosphere model, which presumably is even more sensitive to topography gradients and structure than the shallow water models considered here because of vertical fluxes.