Topography based local spherical Voronoi grid refinement on classical and moist shallow-water finite volume models

Locally refined grids for global atmospheric models are attractive since they are expected to provide an alternative to solve local phenomena without the requirement of a global high-resolution uniform grid, whose computational cost may be prohibitive. The Spherical Centroidal Voronoi Tesselations (SCVT), as used in the atmospheric Model for Prediction Across Scales (MPAS), allows a flexible way to build and work with local refinement. Alongside, the Andes Range plays a key role in the South American weather, but it is hard to capture its fine structure dynamics in global models. This paper describes 5 how to generate SCVT grids that are locally refined in South America and that also capture the sharp topography of the Andes Range by defining a density function based on topography and smoothing techniques. We investigate the use of the mimetic finite volume scheme employed in the MPAS dynamical core on this grid considering the non-linear classic and moist shallowwater equations on the sphere. We show that the local refinement, even with very smooth transitions from different resolutions, generates spurious numerical inertia-gravity waves that may even numerically de-stabilize the model. In the moist shallow10 water model, where physical processes such as precipitation and cloud formation are included, our results show that the local refinement may generate spurious rain that is not observed in uniform resolution SCVT grids. Fortunately, the spurious waves originate from small-scale grid-related numerical errors and therefore can be mitigated using fourth-order hyperdiffusion. We exploit a grid geometry-based hyperdiffusion that is able to stabilize spurious waves and has very little impact on the total energy conservation. We show that, in some cases, the clouds are better represented in a variable resolution grid when 15 compared to a respective uniform resolution grid with the same number of cells, while in other cases, grid effects can affect the cloud and rain representation.


Introduction
The Andes, the world's longest mountain range, located along entire South American western coast, act as an obstacle to atmospheric circulation and play a key role in the weather of South America. For instance, the South American lowlevel jet, formed in the Andes eastern slope, has an important influence on the Brazilian southeast, among other regions, with precipitation transporting moisture from the Amazon Basin (Garreaud, 2009). Furthermore, the Andes are essential for the formation of the South American low-level jet. Insel et al. (2010) and Junquas et al. (2015) show that the remotion of the Andes leads to a reduction of precipitation in the Brazilian southeast. Despite their length, the Andes have a narrow width of less than 200 km almost everywhere, and their elevation is 4000 m on average, but the elevation may suddenly change in a few kilometers.
The Andes' complex topography is hard to capture in a global model due to abrupt changes in elevation and resolution limitations imposed by computational costs. Furthermore, Figueroa et al. (2016) show that both the Brazilian Global Atmospheric Model (BAM) and the Global Forecast System (GFS) produce dry or wet biases in the Amazon Basin, over the Andes and in the Brazilian southeast. This bias is also observed in other models (Silva et al., 2011;Chou et al., 2020). Therefore, aiming to improve the precipitation forecast in those regions, it is desirable to better represent the shape of the Andes Range in the employed model. One alternative to overcome the problem of resolution limitations is to employ regional models (e.g., Freitas et al., 2017). A second alternative is to develop a locally refined global grid that captures the Andes Range well. The second alternative has the advantage of not requiring any artificial boundary conditions, as is usual for regional models, and has been developed for some recent global models (Ullrich et al., 2017).
Locally refined grids for global models are built aiming to solve local phenomena without requiring a global highresolution grid for which computational cost may be prohibitive. For instance, Barros and Garcia (2004) have proposed a locally refined latitude-longitude grid with a coarse global uniform grid successively refined to a region of interest. Local refinements have also been developed for the cubed-sphere grid. For example, in Harris et al. (2016) a local refinement for the cubed sphere was developed using stretching transformations, whereby the region of interest has a resolution 7 times that in the coarse grid region. On the other hand, Lean et al. (2008) proposed nesting models with resolutions of 12, 4 and 1 km using the UK Met Office operational model at that time, with the 4 and 1 km models using two squares centered in England as the domain. Those works propose feasible ways to have a higher resolution in areas of interest. However, they are usually constrained to a rectangular geometry in the region of interest and impose interpolation constraints between different resolutions, which may affect the dynamics of in-and out-propagating waves.
Aiming to run at very high resolutions, many recent global atmospheric models are employing quasi-uniform geodesic spherical grids (Staniforth and Thuburn, 2012). The geodesic grids usually have more complex cell geometry, but they can allow more flexibility in local grid refinement. The added geometry complexity on these grids, such as those using Voronoi (hexagonal-pentagonal) cells, makes the development of numerical schemes on these grids more difficult than in regular quadrilateral grids. Nevertheless, the finitevolume method for the shallow-water equations proposed by Thuburn et al. (2009) and Ringler et al. (2010), hereafter named TRSK, was designed to work on arbitrary orthogonal Voronoi C-grids. This scheme has many desirable mimetic problems, such as mass and total energy conservation, as well as preservation of stationary geostrophic modes on the f sphere, among others. It is used in the dynamical core of some atmospheric models such as the Model for Prediction Across Scales (MPAS) (Skamarock et al., 2012) developed jointly by the National Center for Atmospheric Research (NCAR) and the Los Alamos Laboratory, as well as the model Icosahedral Dynamical Core (DYNAMICO) (Dubos et al., 2015).
TRSK applies to a variety of grids, in particular to spherical centroidal Voronoi tessellation (SCVT) grids, which are adopted in MPAS and may be thought of as an optimized version of the hexagonal-pentagonal grid generated from an icosahedral grid. The SCVT grids are orthogonal grids wherein each grid cell is a Voronoi diagram and the center of mass with respect to a given density function is the corresponding Voronoi region generator (Ju et al., 2011). This grid has the flexibility of allowing local refinements by carefully defining a density function and employing Lloyd's method (Du et al., 1999(Du et al., , 2003Ringler et al., 2011). Using a circular refinement region, Park et al. (2014) show that SCVT variable-resolution (VR) grids have no significant wave reflection detected in the transition zone between high-and low-resolution regions, which occurs in the nested Weather Research and Forecasting (WRF) model analyzed in this work. The work of Kramer et al. (2018) investigates three different meteorological events in Europe and concludes that the VR grid used in MPAS global model yields results comparable to the WRF model. Furthermore, the VR grid performed better than the uniform-resolution grid in the organized convection test case and is computationally cheaper. VR grids are also feasible in the ocean component of MPAS. For instance, Hoch et al. (2020) consider grids with local refinement on the North American coast and conclude that even when the grid quality is degraded, no spurious effects are observed in the MPAS-Ocean model simulation results. On the other hand, some studies show that the local refinements in the MPAS grid may negatively impact the results of the model. For instance, Rauscher and Ringler (2014) show that the VR grid generates an eddy kinetic energy maximum in the refined region for the aquaplanet and Held-Suarez test cases. This maximum is caused by the use of the VR grid and is not observed in the uniform-resolution grid. Also, in the absence of hyperdiffusion, Zhou et al. (2020) report gridscale oscillations in a variable-resolution grid considering baroclinic wave and tropical cyclone test cases. While MPAS allows a model that is suitable to work with grids with local refinement in arbitrary shapes by only defining a density function, wave representation and interaction in these grids are still not well understood.
In this work, we propose generating SCVT grids with local refinement based on Andes topography. Our locally refined grids will be designed to capture the Andes and the South American continent well with smooth transitions to the coarse grid regions, focusing on obtaining a grid that may allow better precipitation forecasts in South America. Also, we will perform a detailed analysis of the intrinsic advantages and problems of using TRSK scheme in such grids in two frameworks that capture many important structures of the atmosphere.
In the first framework, we will consider the nonlinear shallow-water equations on the sphere, some standard tests proposed in the literature (Williamson et al., 1992;Galewsky et al., 2004) and a more recent test proposed by Shamir et al. (2019). In the second framework, the moist shallow-water model proposed by Zerroukat and Allen (2015) is investigated. This model includes physical processes in the shallowwater model and allows us to simulate rain and clouds. The moist shallow-water model will allow us to study the impact of the local refinement on cloud and rain formation. This paper is outlined as follows. In Sect. 2, we describe the development of the SCVT grids with local refinement on the Andes Mountains. In Sect. 3, the classical and moist shallow-water models are presented, along with their discretization schemes. In Sect. 4 we present the results obtained using TRSK on the developed grids considering the classical and moist shallow-water model. Conclusions are drawn in Sect. 5.

Spherical centroidal Voronoi tessellation
We start by defining the spherical Voronoi concepts that will be important for the local refinement technique discussed in this work.
Given a set of distinct points on the sphere that we call generators, {x i } n i=1 ⊂ S 2 , we define the ith Voronoi region as where d(x, y) is the geodesic distance on the sphere, ∀x, y ∈ S 2 . The sets { } n i=1 are called spherical Voronoi tessellation (SVT) and decompose the sphere into disjoint convex spherical polygons to generate a spherical grid (Ju et al., 2011).
With the Voronoi tessellation, we can associate a dual grid by connecting nearest-neighbor generators. The geodesic segment connecting neighbors is orthogonal to the sharing edge between these two generators. This orthogonality is important for the numerical schemes that we shall present later. Under the assumption that no four near neighbors are cocircular with empty an interior, these dual cells all consist of triangles and form a Delaunay triangulation (Okabe et al., 2000). In this duality relation, each Voronoi region corresponds to a unique dual-cell vertex, each Voronoi vertex is associated with a unique dual cell and each Voronoi edge is associated with a unique dual edge.
An example of SVT is the primal grid of the icosahedral grid, the pentagonal-hexagonal grid. The icosahedral grid is obtained by gnomonically projecting the edges of an icosahedral inscribed within a sphere. This process generates 12 vertices and 20 triangles. Each of these triangles can be divided into four new triangles and we can proceed in this manner recursively. Given a level of recursion l = 0, 1, 2, · · ·, it can be shown that the icosahedral grid obtained by recursion has N l = 10·2 2l +2 vertices, and consequently, the dual pentagonal-hexagonal grid has N l cells. The number l is also called the grid level.
A particular case of SVT that we are interested in is the spherical centroidal Voronoi tessellation (SCVT). Given a density function ρ : S 2 →]0, ∞[, for each Voronoi region , Figure 1. SCVT grids using a uniform density function for 12 (a), 42 (b) and 162 (c) generators.
the center of mass with respect to ρ is given by For this definition of the center of mass, it does not necessarily hold that x * ∈ S 2 . Therefore, following Du et al. (2003), we introduce the concept of a spherical center of mass, which may be calculated using radial projection as An SCVT is an SVT such that each generator is the center of mass of the corresponding Voronoi region with respect to a given density function ρ. As we can notice, SCVT generates spherical grids that we call SCVT grids. An algorithm that creates SCVT from initial random generators is the iterative Lloyd's method (Du et al., 1999(Du et al., , 2003, which iteratively pushes the Voronoi generators to the Voronoi mass centroid position, and is the method employed in this work. Given two Voronoi cells i and j , we denote their diameter by h i and h j , respectively. It is possible to show that (Du et al., 2003;Ju et al., 2011) This estimation plays a key role in this work because it allows us to build grids with local refinement.
We show examples of SCVTs for ρ = 1 generated using Lloyd's method in Fig. 1 where we use the pentagonalhexagonal grid as an initial guess in Lloyd's method. The corresponding dual grid is showed in Fig. 2. We use N l generators for l = 2, 3, 4. The dual grid of an SCVT grid may be seen as an optimized version of the icosahedral grid (Miura and Kimoto, 2005).
Next, we present how to build a grid with local refinement on the Andes Mountains based on Eq. (4), with the density function presented in Ju et al. (2011) and the topography data from Amante and Eakins (2009).

Locally refined SCVT
We represent the R 3 coordinates of a point x ∈ S 2 in spherical coordinates as and define the parameters (φ c , λ c ) = − π 9 , − π 3 and x c = (sin φ c cos λ c , sin φ c sin λ c , cos φ c ). We also consider real values γ , α and ε that will be set later. Denoting the Euclidean norm as · , we define the distance from x c by d(x, x c ) = x − x c for x ∈ S 2 and introduce the following auxiliary function: A density function that will allow us to refine based on two criteria, in our case the topography (Andes Mountains) and the continent (South America), is given by where b represents the topography (in our case, the Andes region), in this work retrieved from Amante and Eakins (2009) and normalized for the interval [0, 1], γ ≥ 1 and µ ∈ [0, 1]. Note that for µ = 1, the density function will refine only South America without capturing the Andes' sharp topography. For µ = 0, the density function will refine only the Andes' sharp topography. Therefore, for a value µ ∈]0, 1[, the generated grid will capture both the Andes' sharp topography and the South American continent and will have a transition to the coarse global grid. The closer the parameter µ is to 1, the less the topography will be represented in the refinement. And the closer the parameter µ is to 0, the more the sharp topography will be represented and the lower the refinement will be on the rest of the South American continent. With α, µ and s(x) properly specified, the parameter γ will approximately represent the ratio between coarse-and finegrid-resolution areas, which follows from Eq. (4). We will provide further details at the end of this section.
For the numerical schemes that will be adopted in this work, sometimes termed mimetic finite-volume schemes, grid quality plays a major role. On staggered (C-type, using the meteorology terminology) grids, different variables are placed on different positions of the grid, and operators, differential or not, act on taking variables from one place to another. On highly distorted grids, this can lead to loss of accuracy of some operators (see, for instance, Peixoto and Barros, 2013) or even inadequate physical representation of a model field. One of the key properties of interest is the position of the circumcenters of the Delaunay triangles, which are also the Voronoi cell vertices. Delaunay grids have the socalled well-centered property if all circumcenters lie in the interior of their respective triangles (see, for instance, Engwirda, 2017). Here, we will consider grid smoothing techniques to ensure grids with the well-centered property, as we will discuss below.
The ETOPO data (Amante and Eakins, 2009) used in the function b are defined in a latitude-longitude grid with 720 × 1440 points, which is enough resolution to represent the Andes' topography well for our experiments. We employed bilinear interpolation to compute the function b in SCVT grid points that are not in the latitude-longitude grid. In order to guarantee grids with smooth transitions between the high-and low-resolution regions, we applied a smoothing technique on ETOPO data based on the Jacobi method. For each index (i, j ) representing a point on the latitudelongitude grid, 0 ≤ i ≤ 720, 0 ≤ j ≤ 1440, we apply the classic Jacobi iteration process: where k = 0, 1, 2, · · · and b 0 ij is the initial Andes topography data from ETOPO. The number of iterations was empirically defined as 500 steps, ensuring that the basic shape of the Andes Range is still well represented in the topography dataset. More importantly, this smoothing later ensures that the generated SCVT primal grids all have circumcenters inside the triangles.
We also applied a smoothing filter in the function s, considering it defined in the latitude-longitude grid with 720 × 1440 points. We used a moving average method by replacing the value of s at a point in the latitude-longitude grid considering the mean of s in a box with 55 × 55 points centered at the considered point. This box size has been shown to guarantee that the generated grids have circumcenters inside the triangles.
We set the parameters to γ = 3, α = 7π 45 , ε = π 12 and µ = 0.8. The parameter ε, which represents the width of the circular refinement region, and the parameter γ were defined as in Ju et al. (2011). The parameter α was defined in such a way to guarantee that the circular refinement region contains the South American continent, and µ was empirically chosen aiming to represent the Andes' shape well. In Fig. 3, we show the grid generated with 10 242 nodes after apply- ing Lloyd's method. The diameters of cells are also shown in Fig. 3, including the diameters of the grid generated with 163 842 nodes. The diameter of a Voronoi cell is estimated as the average distance from its generator to its neighbors. As we can notice, the ratio of the diameters of the cells on the Andes and the cells in the coarser-grid region is approximately 3. We can derive this from Eqs. (4) and (7). Indeed, observe that if x i ∈ S 2 is a Voronoi generator such that d(x c , x i ) > α +ε, i.e., x i is in the uniform-resolution region, we have s(x i ) = b(x i ) = 0 and therefore ρ(x i ) = 1 γ 4 . On the other hand, notice that if x j ∈ S 2 is a Voronoi generator and a point in the Andes region, we have s(x j ) = 1 and b(x j ) ≈ 1, and therefore ρ(x j ) ≈ 1 using Eq. (7). At last, using Eq. (4), we can see that h i h j ≈ 1 γ , where h i and h j are the diameters of the Voronoi regions i and j , respectively.
We generate the variable-resolution SCVT grids using the density function defined in Eq. (7) using N l = 10·2 2l +2 generators for l = 1, 2, · · ·, 7, and we refer to these grids as VR1, VR2, · · ·, VR7, respectively. These generated grids and the uniform SCVT grids will be used in our numerical experiments in Sect. 4. The uniform-resolution SCVT grids were generated from grid level 1 up to 9, and we refer to these grids as UR1 to UR9. We show the minimum and maximum diameters of the cells for the uniform-and variable-resolution SCVT grids in Table 1. We also generated locally refined grids with a 1 : 6 ratio of diameters between the coarse grid and cells in the Andes region with γ = 5, α = 7π 45 , ε = π 12 and µ = 0.8. These grids will be analyzed in our numerical experiments only in the Sect. 4.2.1 aiming to investigate the impact of increasing the resolution of the refined region.
3 Model description

Shallow-water model
As is usual in the development of numerical methods for global atmospheric models, we first evaluate it considering the shallow-water equations on the sphere. These equa-tions represent important aspects of the atmosphere, such as Rossby waves, the Coriolis effect and geostrophic adjustment, and they have the advantage of being two-dimensional; therefore, they are computationally cheaper to run at high resolutions.
We denote a point on the sphere by x and a time instant by t ≥ 0. Then, we consider the nonlinear shallow-water equations on the sphere written in the vector-invariant form (Ringler et al., 2010): where h = h(x, t) denotes the total fluid depth, u = u(x, t) is the velocity vector tangent to the sphere for all t ≥ 0 and all other terms are defined in Table 2. The operators ∇ and ∇· are assumed to be the horizontal gradient and divergence on the sphere, respectively. These equations define an initial value problem that describes the evolution of a thin layer of a two-dimensional fluid on the sphere. The finite-volume scheme adopted here was proposed in Thuburn et al. (2009) and Ringler et al. (2010), also denoted as TRSK, and considers a grid with an orthogonal dual grid and a C-grid staggering of the variables. We consider three positions in the C-grid: primal-cell centers (or dual-cell vertices), primal-cell vertices (or dual-cell centers), and the intersection point between a primal edge and dual edge that we call edge points (Fig. 4).
We summarize the notation needed for TRSK in Table 3. In TRSK, the height h is stored at primal centers and is denoted by h i (t) = h(x i , t). Given an edge e, we define a normal vector n e to the edge pointing to the direction such that the normal component of the velocity given by u e (t) = u(x e , t) · n e is positive. The normal component of the velocity is stored at edge points. Our prognostic variables in TRSK are h i and u e for each primal center i and edge e. Taking the Table 1. Minimum and maximum diameters of the Voronoi cells for the uniform SCVT grid (UR) and for the variable-resolution (VR) grid that captures the Andes well. The VR grids considers the parameters γ = 3, α = 7π 45 , ε = π 12 and µ = 0.8.  Table 3. Grid notation following Ringler et al. (2010).

Description Symbol
Primal cell dot product of Eq. (9) with n e , we get where [F ] e = F (x e , t) · n e and [G] i = G(x i , t) for any vector field F and scalar field G. Each term on the right-hand side of Eqs. (11) and (12) is approximated using the spatial discrete operators from Ringler et al. (2010). After discretizing each term for all primal cells and edges, we get an ordinary differential equation system. In this work, we employed a fourth-order Runge-Kutta scheme to solve the ordinary differential equation system since we are aiming to analyze only the impact of the local refinement on the horizontal discretization. At last, TRSK has been known for its mimetic properties; i.e., the discrete equations mimic some of the continuous equations, such as 1. mass conservation, 2. the Coriolis term not being an energy source or sink (u e u ⊥ e = 0), 3. total energy being conserved within time error truncation, and 4. preservation of stationary geostrophic modes on the f sphere. The TRSK discretization is also known to be very loworder accurate and may even lack consistency on nonregular grids (Peixoto and Barros, 2013;Peixoto, 2016). However, due to its mimetic properties and flexibility, it is still adopted in some modern global atmospheric models such as MPAS (Skamarock et al., 2012) and DYNAMICO (Dubos et al., 2015).

Moist shallow-water model
Even though the shallow-water model retains keys properties of the atmosphere, it lacks the representation of sub-scale physical processes. Therefore, we consider here an intermediate step of a two-dimensional moist shallow-water model, avoiding the computational expense of a three-dimensional primitive equation model while being able to account for water-related sub-grid processes.
We follow the moist shallow-water model proposed by Zerroukat and Allen (2015), wherein moist dynamics are included in the classic shallow-water model. This model is two-dimensional, which is computationally cheaper than three-dimensional models at high resolutions, and is derived from the Boussinesq approximation of the three-dimensional Euler equations. The model can be summarized in the following equations: where θ is the temperature, k = 1, 2, 3, q 1 = q v is the water vapor state, q 2 = q c is the cloud state and q 3 = q r is the rain state. We are using the flux form for the advection equations for numerical purposes that we shall see later. The moisture variables are tracers that are advected in this system. The other variables are the same as in the shallow-water model ( Table 2). The source terms of the advection equations define a three-state moist physics, wherein vapor may be converted to clouds, clouds are allowed to evaporate and clouds may be converted to rain. These three-state moist physics depend on a saturation function, which is given by Zerroukat and Allen (2015) as and the initial vapor state is given by q v (λ, φ, 0) = G(λ, φ)q sat (θ ), where λ denotes the longitude and q 0 is a constant chosen in order to guarantee that the initial maximum value of q v is 0.02 and G is a function between 0 and 1. The additional variables and parameters to the moist shallowwater model are shown in Table 4. Note that S q v +S q c +S q r = 0; therefore, the integral of h(q v +q c +q r ) is conserved in this model. In this model, we consider the prognostic variables u, h, hθ and hq k , k = 1, 2, 3. Similarly to the shallow-water model, we store h, hθ and hq k at Voronoi centers, and the normal component of u is stored at the edges. We write equations similar to Eqs. (11) and (12) for the moist shallow-water equations and discretize the right-hand side using TRSK operators.
The divergence term in Eqs. (15) and (16) for hθ and hq k may be computed using the divergence discretization of TRSK, and this explains why we used the advection equa- Table 4. Variables and parameters for the moist shallow-water model (Zerroukat and Allen, 2015).

Variable description Symbol Definition
Precipitation threshold q precip 10 −4 Pseudo-latent heat constant L 10 Vapor-cloud conversion rate tion in flux form. The source terms for Eqs. (15)-(16) are straightforward to calculate once they depend only on θ and q k , and thus we only need to divide these variables by h. Equation (13) has a source term and it needs to be evaluated at edge points. This source may be calculated using TRSK interpolation and gradient operators. We point out that MPAS solves the tracer equations such as Eqs. (15)-(16) using a high-order advection scheme (Skamarock and Gassmann, 2011). Here, we consider the TRSK scheme to solve tracer equations aiming to analyze how TRSK simulates the formation of cloud and rain. Furthermore, as we shall see in Sect. 4.3, a monotonic (positivity-preserving) filter is employed in our simulations.

Numerical results
This section is dedicated to presenting the results of the TRSK method on the variable-resolution grids considering two frameworks: the classical shallow-water model and the moist shallow-water model developed by Zerroukat and Allen (2015). We will consider the variable-resolution grids developed in Sect. 2.2 and the uniform SCVT grids to compare the impact of introducing a local refinement. We also consider the addition of variable numerical fourth-order hyperdiffusion on the locally refined grid tests. It will be clear whether we are adding hyperdiffusion or not. We give details about the hyperdiffusion employed in the numerical experiments in Sect. 4.1, and we show the results for the shallow-water model and for the moist shallow-water model in Sect. 4.2 and 4.3, respectively. The L 2 error will be referred to as the root mean square error (RMSE hereafter) and the L ∞ error as the maximum error.

Hyperdiffusion
As we will show in the next sections, the variable-resolution grid triggers unstable modes of the numerical method and spurious waves are generated, destabilizing the numerical solution. While undesirable for the shallow-water equations, artificial numerical diffusion can be used to mitigate the problem. Here we discuss the numerical diffusion mechanisms that will be explored in this study. To ensure selectiveness of the diffusion mechanism, we will employ fourth-order diffusion (hyperdiffusion), but results with second-order diffusion may be found in an earlier version of the work, available from the journal open discussion material. The numerical hyperdiffusion was included in the momentum equation (Eq. 11), following Skamarock et al. (2012) and Jablonowski and Williamson (2011), based on the following vector identity for the vector Laplacian: Evaluating the above identity on an edge e and taking the dot product with corresponding normal vector n e , we have The first term on the right-hand side of Eq. (19) is calculated using the gradient at edges in the normal direction using the divergence given at Voronoi centers. The second term of the right-hand side of Eq. (19) is calculated as ∇ζ (x e ) · t e (Skamarock et al., 2012), where t e = k × n e , and is obtained as the gradient at edges in the tangent direction using the relative vorticity ζ given at primal vertex positions. The fourthorder hyperdiffusion ∇ 4 is obtained using Eq. (19) and the relations ∇ 2 = and ∇ 4 u = ∇ 2 (∇ 2 u) = ( u).
In order to introduce a variable coefficient of hyperdiffusion, we follow Klemp (2017) using the formula where K 2 denotes the variable diffusion coefficient. This formula (20) is not exact. However, as Klemp (2017) shows, this formulation ensures a dissipative behavior. This formulation allows us to discretize the Eq. (20) just as we discretized Eq. (19). Given a variable hyperdiffusion coefficient K 4 , we may obtain a fourth-order filter using Eq. (20) recursively with K 2 = √ K 4 , as explained by Klemp (2017). After the hyperdiffusion in computed, we add it on the right-hand side of the momentum equation (Eq. 11) considering a negative sign to ensure the dissipative behavior the hyperdiffusion operator. We where h i is the diameter of the ith Voronoi cell, h max is the maximum diameter of all cells and p = log 2 10. With this choice of p, the hyperdiffusion coefficient reduces 10 times when the cell diameter is divided by 2.
As will be shown in the numerical results, the dominant factor for larger errors in the numerical solution is the cell geometry. With the variable-resolution grid, the occurrence of more distorted cells is almost inevitable, and these are also responsible for triggering the numerical instabilities. Peixoto and Barros (2013) showed that one can detect such problematic cells following an "alignment index", which measures how well the cell edges are aligned. Perfectly aligned cells have edges 2 × 2 parallel and of the same length, ensuring second-order accuracy of typical finite-volume operators. Peixoto (2016) shows how the grid alignment can affect the solution of the shallow-water equations, and Peixoto and Barros (2014) used the alignment index to build vector reconstructions that use different schemes depending on the cell geometry. Following similar reasoning, here we propose a variable hyperdiffusion that adapts the coefficient based on this alignment index. We therefore employ less diffusion in better-aligned cells, so we can be more selective in imposing the diffusion mechanism where it is really needed.
For the alignment-based hyperdiffusion, we considered a variable coefficient K 4 , which, in a Voronoi cell, is given by a smoothed alignment index (normalized between 0 and 1) multiplied by a value K max for each cell. The alignment index is defined in Peixoto and Barros (2013), and the value of 0 indicates a perfectly aligned cell; therefore, on almost perfectly aligned cells the diffusion coefficient will be close to zero. The value K max indicates that the maximum of the fourth-order hyperdiffusion coefficient allowed is employed in the most ill-aligned cells. To avoid abrupt transitions in the diffusion mechanism, here the alignment index is smoothed by replacing its cell value by the average of its neighbors (including its own value). The smoothed alignment on edges and vertex positions may be obtained using TRSK interpolation operators.
The values of K max used in this work were chosen after an investigation of the geostrophically balanced flow test case from Williamson et al. (1992), looking for the minimum coefficient that could minimize the error of the normal component of the velocity. We describe this experiment in detail in Sect. 4.2.1.
We highlight the fact that other (different) diffusion mechanisms were investigated in this work but are not shown here. Second-order Laplace diffusion was applied in the early stages of this work, with adequate stabilization of the model but with greater impacts on accuracy and energy conservation. Vorticity base stabilization mechanisms (Weller, 2012) were also explored, but these generally failed to stabilize the model (see specific comments in Sect. 4.2.3).

Steady geostrophic flow
This test case is proposed in Williamson et al. (1992) and is known as test case 2 (hereafter, TC2). The initial conditions are given by u(λ, φ, 0) = u 0 cos φ, The bottom topography is equal to zero. The functions defined above satisfy the shallow-water equations and represent a balanced geostrophic flow. Thus, the initial condition should remain constant. We define the parameters h 0 = 3 × 10 3 and u 0 = 2πa 12 d , where a is the Earth's radius. In Fig. 5 we show the evolution of the relative error in norm L ∞ for the grids of level 7 (UR7 and VR7). This result shows that the error for the normal component of the velocity field grows from early stages of the integration for the VR7 grid without numerical hyperdiffusion. This error triggers errors in the height field that start to grow significantly after day 15. This behavior does not occur in the UR7 grid. A similar error evolution as shown in Fig. 5 may be obtained for the VR6 grid (not shown). There is therefore a clear need for artificial numerical diffusion mechanisms for stabilization purposes.
To decide on the best hyperdiffusion strategy, we now examine the different formulations: a constant coefficient, a diameter-based variable coefficient and an alignment-based variable coefficient. For the variable-resolution grid of level 6 (VR6), we show in Fig. 6 the height field error after 30 d considering constant and diameter-based hyperdiffusion co- Figure 5. Steady geostrophic flow test case: time evolution of relative error in the L ∞ norm for the height field (a) and the normal component of the velocity field (b). The blue lines indicate the errors for the UR7 grid, while the orange lines show the error for the VR7 grid with refinement based on topography, and the green lines show the error for the same VR7 grid but adding numerical fourth-order hyperdiffusion based on the alignment index with K max = 10 12 m 4 s −1 in the shallow-water model. Figure 6. (a) Height field error using a constant hyperdiffusion coefficient and a (b) diameter-based hyperdiffusion coefficient for the steady geostrophic flow test case considering a VR6 grid at day 30 and K max = 10 13 m 4 s −1 (see Sect. 4.1). (c) Alignment index (Peixoto and Barros, 2013) for the VR6 grid. efficients considering K max = 10 13 m 4 s −1 . The error pattern of both solutions ( Fig. 6a and b) has a clear correspondence with the alignment index (Fig. 6c). However, we note that the error patterns are not necessarily related to the grid resolution, indicating that, while diameter-based hyperdiffusion may be well justified from a physical point of view, it may not be ideal for stabilization requirements originating from grid irregularities.
In Fig. 7 we present the relative errors after 30 d for the height and velocity fields in L ∞ and L 2 norms considering the VR6 grid with respect to different hyperdiffusion coefficient choices (K max ) for the constant, diameter-based and alignment-based hyperdiffusion described in Sect. 4.1. We can notice from this figure that the error of the velocity field requires more hyperdiffusion to be stabilized for all the employed methods. Also, the error of the diameter-based coefficient requires higher values of K max to stabilize the error of the height field. The stabilization behavior of the alignmentbased method is more similar to the behavior of the constant coefficient, while imposing diffusion only where necessary. This motivated us to move forward with the alignment-based hyperviscosity for further experiments.
For a variable-resolution grid of level 7 (VR7), an optimal choice for the hyperdiffusion coefficient may be found at around K max = 10 12 m 4 s −1 , as shown in Fig. 8b, where we also show the distribution of the coefficient on the sphere (Fig. 8a). Note that large areas of the globe are dominated by coefficients orders of magnitude smaller than K max (ranging around 10 9 to 10 10 m 4 s −1 ). With this approach, we see in Fig. 5 how the model is now stable in the period of 30 d, with the error evolution in the VR7 grid with numerical hyperdiffusion having behavior similar to the UR7 grid. Figure 9 shows the error after 30 d for the height field in the VR7 grid without (Fig. 9a) and with alignment-based hy-    (Peixoto and Barros, 2013). Plots for the UR7 grid: (d) height field error for each grid cell after 30 d. (e) Grid alignment index. perdiffusion (Fig. 9b). We also show the alignment index (Fig. 9c). From Fig. 9a, we can see that the error for the height field propagates similarly as gravity waves, although spurious, when no numerical fourth-order hyperdiffusion is employed. From Fig. 9b and c, it is clear that the error obtained for the height field is greater in the cells that are illaligned, and the same holds for the UR7 grid, as Fig. 9d-e show. This result is in agreement with the results from Peixoto (2016), wherein it is shown that the divergence discretization accuracy used in TRSK is related to the alignment index.
Following these analyses, we will consider in the next sections the hyperdiffusion always based on alignment and adopt for VR7 a coefficient K max = 10 12 m 4 s −1 . For VR6 we will adopt K max = 10 13 m 4 s −1 , and for all coarser grids (VR1 to VR5), K max = 5 × 10 13 m 4 s −1 was enough to stabilize the model.
In this test case, the total energy is conserved with precision 10 −10 for the UR7 grid and 10 −9 for the VR7 grid without fourth-order hyperdiffusion and with precision 10 −8 considering fourth-order hyperdiffusion on the VR7 grid. Overall, we can see that the addition of fourth-order hyperdiffusion did not deteriorate the total energy conservation of TRSK, since this dissipation method is a scale-selective damping mechanism (Jablonowski and Williamson, 2011). We point out that the second-order diffusion ∇ 2 is also able to stabilize the errors in this test case. However, the operator ∇ 2 is not as selective as ∇ 4 and leads to deterioration of total energy conservation. Indeed, we re-run this test for the VR7 grid using ∇ 2 with constant diffusion coefficient equal to 8.2 × 10 3 m 2 s −1 , as in spectral methods with truncation level T85 (Jablonowski and Williamson, 2011), and we observe that the errors remained stable and the total energy was conserved with precision 10 −4 (not shown).
Furthermore, Fig. 10 shows that adding fourth-order hyperdiffusion in the variable-resolution SCVT grid simulations is needed to achieve better convergence in both L ∞ and L 2 norms. We can see that the error does not converge to zero for both height and velocity fields, even when we add the fourth-order hyperdiffusion. Nevertheless, lack of convergence is also observed in the uniform-resolution SCVT grids although in the maximum norm, as is shown in Peixoto (2016). We point out that Fig. 10 may suggest that the grids VR1 to VR5 do not develop spurious gravity waves as in the grids VR6 and VR7. Nevertheless, they form such waves but for longer times of integrations.
In order to analyze the impact of increasing the resolution of the refined region, we consider the 1 : 6 ratio of fine-to-coarse cell diameter grid as discussed in Sect. 2.2. In Fig. 11a we illustrate the diameters (in km) of the 1 : 6 variable-resolution grid with a grid level equal to 7. We ran the steady geostrophic flow for this grid. In Fig. 11b we show the time evolution of the relative error in the L ∞ norm. The behavior is similar to the one depicted in Fig. 7a; however, the error starts to grow at an earlier time. Also, the error after 30 d is greater for the 1 : 6 variable-resolution grid. Therefore, we can conclude that the error starts to develop earlier and is larger when we increase the ratio between fine and coarse cell diameters, which is in agreement with Liu and Yang (2017), wherein the authors investigate the impact of SCVT grids with a circular refinement region considering the classical shallow-water model. Their work suggests that ratios between high-and low-resolution cell diameters bigger than 1 : 3 produce unacceptable errors, recommending only 1 : 2 and 1 : 3 ratios. Finally, we observe that using the same amount of fourth-order hyperdiffusion based on the alignment index stabilizes the error, as the green line in Fig. 11b shows.

Flow over the Andes
This test case is an adaption of the flow over a mountain test case proposed by Williamson et al. (1992), wherein we replace the bottom topography b with the smooth Andes topography described in Sect. 2.2. The velocity field is initialized as in the previous test case of the steady geostrophic flow. The initial height field is then given by We adopted h 0 = 5400 and normalized the bottom topography to lie in the interval [0,2000]. Since the exact solution for this test case is not available, we use as a reference solution the solution yielded by ENDGame, a semi-Lagrangian dynamical core model developed by Thuburn et al. (2010), in a latitude-longitude grid of 512 × 1024 points. We interpolate the values from the latitude-longitude grid to the grid points needed in SCVT grids using cubic interpolation. We ran this test case for 30 d on the uniform-and variableresolution SCVT grids of level 7 (UR7 and VR7, respectively). In Fig. 12, we show the error of the height field considering the ENDGame solution as a reference. We can notice that the error is initially concentrated on the Andes Mountains (Fig. 12a), and it is propagated to the other regions of the grid (Fig. 12b-c) and finally on the whole grid (Fig. 12d). A similar result is obtained in Tian (2020), wherein the author considers this test case using a cosine bell topography instead of the smoothed Andes topography; it is shown that this test case generates errors that propagate as gravity waves, and these errors can be larger in the highresolution grid region.
Our simulation shows that, even though the Andes are represented more accurately in the VR7 grid, the height field errors are larger in the Andes in the first days of integration. Despite that, the magnitude of the error does not increase as in the steady geostrophic flow test case. However, Fig. 13a illustrates how the L ∞ error for the velocity field increases with time. Even though they increase, they do not trigger larger errors as in the steady geostrophic flow test case. Figure 13b shows that the normal component of the velocity error is greater on the Africa continent, which is a coarse-grid region. This velocity field error in the VR7 grid is mitigated when we add fourth-order hyperdiffusion based on the alignment index, as in Sect. 4.2.1, in the shallow-water model, as Fig. 13a shows. Again, the addition of fourthorder hyperdiffusion allowed us to have a similar temporal error evolution in both variable-and uniform-resolution SCVT grids, breaking the total energy conservation, which is conserved with precision 10 −10 without fourth-order hyperdiffusion and 10 −8 with fourth-order hyperdiffusion. Figure 10. Steady geostrophic flow test case: convergence of relative error in the L ∞ norm for the height field (a) and the normal component of the velocity field (b) with respect to errors at day 30. Panels (c) and (d) show the same as (a) and (b), respectively, but for the L 2 norm. The blue lines indicate the errors for the uniform SCVT grids, while the orange lines show the error for the variable-resolution grids with refinement based on topography, and the green lines show the error for the same variable-resolution grids but adding numerical fourth-order hyperdiffusion based on the alignment index in the shallow-water model.
We ran this test for 7 d for the VR7, UR7 and UR8 grids. In Fig. 14 we illustrate the potential vorticity. On day 6, in the VR7 grid, numerical noise is generated in a few grid cells on the topography-based refined region, as is shown in Fig. 14a. This noise propagates to other grid cells at day 7 (Fig. 14b) and its magnitude is reduced. These results show that the performance of the VR7 grid is problematic for this test case. For this reason, we ran this test again employing the fourth-order hyperdiffusion based on the alignment index, as in Sect. 4.2.1, in the shallow-water model. As Fig. 14c shows, Figure 11. (a) Diameters in kilometers for the variable-resolution grid with 1 : 6 coarse-to-fine cell ratio. The grid level is equal to 7. (b) Steady geostrophic flow test case showing the time evolution of relative error in the L ∞ norm for the height field considering the variable-resolution grid with a 1 : 6 coarse-to-fine cell ratio. The blue lines indicate the errors for the uniform SCVT grids, while the orange lines show the error for the variable-resolution grids with refinement based on topography with 1 : 6 coarse-to-fine cell ratio, and the green lines show the error for the same variable-resolution grids but adding numerical fourth-order hyperdiffusion based on the alignment index with K max = 10 12 m 4 s −1 in the shallow-water model. the numerical noise in the VR7 grid is mitigated when we add numerical hyperdiffusion. In Fig. 14d and e, we depict the potential vorticity at day 7 for the UR7 and UR8 grids, respectively, for which no numerical fourth-order hyperdiffusion was employed. When we compare the potential vorticity at day 7 for the grids VR7 and UR7, both of level 7, with the UR8 grid, we can observe that the potential vorticity in the VR7 grid (Fig. 14c), considering numerical hyperdiffusion, better represents the vortex formed near the Andes region than in the uniform-resolution grid with the same number of cells (Fig. 14d); i.e., the vortex formed near the Andes region in the VR7 grid with numerical fourth-order hyperdiffusion is more similar to the vortex formed in the same area in the UR8 grid (Fig. 14e) compared to the vortex generated in the UR7 grid. This simulation shows that the variable-resolution grid has a good performance in this test case when we add numerical hyperdiffusion in the shallowwater model compared to the uniform grid with the same number of grid cells, showing a computational advantage of the variable-resolution grid. We do, however, highlight the fact that since the test case is dynamically unstable, exact agreement of uniform-and variable-resolution grid solutions is not necessarily expected, but one may notice the similar qualitative representation of the vortex formation in both solutions. Figure 14b shows a grid-scale checker-boarding pattern in the potential vorticity. TRSK is known for having grid-scale oscillations in the potential vorticity, and some potential stabilization methods have been proposed in the literature to tackle this problem, such as the anticipated potential vorticity method (APVM) (Ringler et al., 2010) and the continuous, linear-upwind stabilized transport scheme (CLUST) (Weller, 2012). We re-run the barotropic unstable jet test case for the VR7 grid using APVM and CLUST; however, our results show that these methods do not help to mitigate the potential vorticity grid-scale oscillations.

Matsuno baroclinic wave
This test case has been proposed by Shamir et al. (2019) and considers analytical wave solutions to the linearized shallowwater equations on the beta plane that approximate analytical solutions to the shallow-water equations on the sphere for low gravity wave speed and are taken as initial and reference solutions for this test case. It is recommended to analyze two types of waves: eastward inertia-gravity waves (EIGWs hereafter) and Rossby waves (RWs hereafter). We follow Shamir et al. (2019) by analyzing both waves in this work. The mean atmosphere depth is set to H = 30 m, the wavenumber is defined as k = 5 and the mode number is defined as n = 1. The EIGW period is T = 1.9 d and the RW period is T = 18.5 d. We recall that the time frequency is defined by ω = 2π T . For these parameters, the analytical solutions are expected to be waves that propagate in the zonal direction, while the EIGW propagates in the eastward direction and the RW propagates in the westward direction. In order to guarantee that waves pass through the whole Andes topography-based locally refined region, we applied a threedimensional rotation of 21 • in the x−z plane in the VR7 grid. We integrate the shallow-water equations for 100 wave periods for each EIGW and RW, as is suggested in Shamir et al. (2019), for both rotated VR7 and UR7 grids to investigate any local refinement impact on the solution. Figure 12. Flow over the Andes test case for the shallow-water model: height field cell-wise error plots for the VR7 grid after 1 h (a), 2 d (b), 3 d (c) and 30 d (d). We consider the ENDGame solution as a reference solution. We show the height field for the VR7 grid in (e) and the reference height field (f) after 30 d.
We define the variable h = h − H in order to analyze the mean atmosphere depth perturbation and for plot reasons. In Fig. 15 we depict the h field obtained for the EIGW (Fig. 15a) and the analytical h (Fig. 15b) in the VR7 grid. The same results for the RW are shown Fig. 15c and d. For both EIGW and RW, the error caused is due to phase error, which is a common error for many numerical schemes, and similar results are obtained for the UR7 grid. Despite the waves propagating along the locally refined region, the obtained solutions preserved the wave shape even for a long time of integration.
We also depict Hovmöller diagrams for h considering the EIGW and RW in Figs. 16 and 17, respectively, for both rotated VR7 and UR7 grids. The latitude-time Hovmöller diagram is obtained by intersecting h at λ = −65 • , and the longitude-time Hovmöller diagram is obtained by intersect-ing h at φ = 0 • . As Fig. 16a and b show, the VR7 and UR7 grids have the same phase error for h in the EIGW test case. From Fig. 16c-d, comparing the black lines with the white line, we can conclude that the obtained EIGW is propagating in agreement with the analytical speed for both grids since the analytical solutions propagate zonally; the longitudetime Hovmöller diagrams are expected to be straight lines with slope k ω (Shamir et al., 2019). The same analysis holds for the RW Hovmöller diagrams depicted in Fig. 17. Therefore, the local refinement introduces no impact on the obtained solution for this test case as we observed in the previous test cases.
We remark that these test cases proposed by Shamir et al. (2019), while providing valuable insight into wave propagation properties, seem not to be very sensitive to different numerical methods. We expect that most numerical methods would perform well on these tests. This was the case for our experiments on both uniform and locally refined grids and was also noticed in Brachet and Croisille (2021) for a cubedsphere-based model.

Moist shallow-water model
We now focus our analyses of the variable-resolution grids on the moist shallow-water model framework (Zerroukat and Allen, 2015) described in Sect. 3.2. We consider two test cases. The first test case is suggested by Zerroukat and Allen (2015) and is similar to the flow over a mountain test case (Williamson et al., 1992). The second test case is similar to the barotropic unstable jet test case (Galewsky et al., 2004). This test case was analyzed in Ferguson et al. (2019); however, in their work, the rain formed is considered precipitated and is removed from the model. In our analysis, we consider the rain to be advected as a tracer following Zerroukat and Allen (2015). In this section, on all test cases that use variable-resolution grids, we have added the alignment-based hyperdiffusion in the momentum equation (Eq. 13) just as in Sect. 4.1, aiming to mitigate the variable-resolution numerical noise observed in Sect. 4.2. We considered the maximum value of hyperdiffusion as described in Sect. 4.2.1. As we pointed out in Sect. 3.2, we discretize the tracer equations using the TRSK divergence operator, which is a centered scheme. Such centered schemes are known for having inherent grid-scale oscillations that are not necessarily removed using the dissipation mechanism proposed in this work. Despite that, this analysis will allow us to understand how the discrete divergence is affected by grid distortions.
The vapor, cloud and rain variables in the moist shallowwater model must assume only non-negative values. For this purpose, we employed a monotonic filter to ensure that the moisture variables assume only non-negative values. At each time step of the model integration, we apply the monotonic filter for each tracer (vapor, cloud and rain), which is implemented as an iterative process. At each iteration of the filter, the tracer mass is computed for each grid cell. The grid cells with negative tracer mass are set to zero mass and the negative mass is distributed equally in the neighbor cells. This iterative process is repeated until the maximum magnitude of the negative values is small enough. After that, all the remaining mass negative values are set to zero, and the tracer value for a cell is computed as the value of its mass divided by its grid cell area. This process, even though it does not conserve the tracer mass, is shown to avoid negative mass, and the total mass of h(q v + q c + q r ) relative to variation is less than 10 −5 for the simulations that we shall see in the remaining of this section.

Flow over a mountain
This test case is proposed in Zerroukat and Allen (2015). We only slightly changed the initial conditions by translating the initial fields into 30 • longitude in order to ensure cloud and rain formation on the South American continent. The initial height and velocity are defined as in the flow over a mountain test case for the classical shallow-water model described in Sect. 4.2.2. The initial temperature and vapor are respectively given by q v (λ, φ, 0) = µ 2 q sat (b, h(λ, φ, 0), θ (λ, φ, 0)) , 6936 L. F. Santos and P. S. Peixoto: Locally refined spherical Voronoi grids on a moist shallow-water model Figure 14. Barotropic unstable zonal jet for the shallow-water model: potential vorticity for the VR7 grid at (a) day 6 and (b) day 7 without fourth-order hyperdiffusion. Panel (c) shows the potential vorticity at day 7 with fourth-order hyperdiffusion in the shallow-water model for the VR7 grid. In (d) and (e) we depict the potential vorticity at day 7 for the UR7 and UR8 grids, respectively, as references.
where F is the function given by The parameters are set as θ NP = −40ε, θ EQ = 40ε, θ SP = −20ε, ε = 1 300 , µ 1 = 0.05 and µ 2 = 0.98. The function q sat is described in Sect. 3.2,Eq. (17). The topography is given by Figure 15. Matsuno baroclinic wave test case: simulated h for the EIGW in the rotated VR7 grid (a) and the analytical h (b) after 100 EIGW periods (190 d). In (c) and (d) we depict the simulated and analytical h for the Rossby wave in the rotated VR7 grid after 100 RW periods (1850 d).
We ran this test for 30 d on the uniform-resolution SCVT grids using the grids UR6 to UR9 and the VR7 grid. In Fig. 19 we present the results for the cloud field in the south of the continent of South America at day 30 for the grids considered in our simulations. Figure 20 illustrates the same for the rain field. We employed numerical fourth-order hyperdiffusion based on the alignment index in the VR7 grid simulation as in -d we can notice that both cloud and rain fields are converging in the uniform-resolution SCVT grids. For the variable-resolution SCVT grid with local refinement on the Andes, the cloud field is better represented in the refined region when we compare Fig. 19e and b with Fig. 19d. This illustrates a potential benefit of the locally refined grid, as the resulting clouds are well represented in the refined region while having lower computational cost with respect to the globally high-resolution uniform grid. However, when we look at the rain field in Fig. 20, we can see that the rain in the VR7 grid (Fig. 20e) is more similar to the rain in the UR7 (Fig. 20b) than in the UR8 (Fig. 20c) or UR9 (Fig. 20d) when we look at the topography-based refined region. Notice that the formed rain in the topographybased refined region that is not formed in the UR8 and UR9 grids is present in the UR6 and UR7 grids. This indicates that the low-resolution region of the variable-resolution grid is affecting the observed rain in the high-resolution region.

Barotropic unstable zonal jet
In this test case, we initialize the height and velocity fields as in the unstable barotropic jet for the classical shallow-water model (Sect. 4.2.3). The temperature and vapor are set as in the previous test (Eqs. 29 and 30) with µ 1 = 0. This test considers the bottom topography to be zero on the whole sphere. A perturbation in the height field is also added, and we consider the longitude to be coordinated and translated using the transformation λ = λ−0.93π only for the perturbation since the other fields do not depend on λ.
We ran this test for 8 d in the UR8, UR9 and VR7 grids, whereby we consider numerical fourth-order hyperdiffusion only for the VR7 grid just as the previous test case. Figures 21 and 22 show cloud and rain formation for these grids at days 7 and 8. The rain at day 7 in the variable-resolution grid (Fig. 22c) has a higher magnitude when compared to the UR8 (Fig. 22a) and UR9 grids (Fig. 22b). Nevertheless, this is expected since the region of the maximum magnitude of the rain is in the transition zone between the low-and highresolution grid. A similar analysis applies for the cloud field at day 7.
At day 8, the rain is generated on the Andes in the UR8 (Fig. 22d) and UR9 grids (Fig. 22e). However, this rain formation is not properly generated in the Andes region (Fig. 22f), being misplaced westward of the Andes, even though the Andes are better represented in our variableresolution grid. This illustrates how the local refinement was not able to solve the rain field in this case and influenced the large-scale dynamics. Once again, a similar influence is observed for the cloud field on day 8.

Conclusions
In this work, we developed SCVT grids with local refinement based on topography that refines and captures the Andes Range well and is smoothly transitioned to a circular grid region centered in South America. This circular region is again smoothly transitioned to a coarse global uniform grid. We used smoothing techniques in the Andes topography data in order to generate these grids using Lloyd's method. These grids were developed in the hope to provide a better basis for weather forecasting in South America, aiming at reduced computational cost. We evaluate the TRSK method on these grids, considering the classical shallow-water model and a moist shallow-water model proposed by Zerroukat and Allen Figure 19. Flow over a mountain test case for the moist shallowwater model: cloud field at day 30 for the grids UR6 (a), UR7 (b), UR8 (c), UR9 (d) and VR7 (e) as well as the cell diameters in kilometers for the VR7 grid (f). The UR6, UR7, UR8 and UR9 grids have an average resolution of 120, 60, 30 and 15 km, respectively.
(2015), discussing the pros and cons of the developed grids in this work.
We began our analysis with the classical shallow-water model. Although the TRSK method is designed for arbitrary orthogonal C-grids, in particular SCVT grids, we showed some of its deficiencies when considering the SCVT grid with local refinement based on topography. For instance, in test case 2 from Williamson et al. (1992), the error in the normal velocity component grows from the beginning of the model integration, triggering spurious gravity waves in the height field. This test case is known for being stable for a long time of integration in the uniform-resolution SCVT grids. Therefore, our results show a negative impact on the local refinement. However, we could mitigate the error evolution of the velocity field by adding fourth-order hyperdiffusion with a coefficient based on the alignment index. The maximum of the hyperdiffusion coefficient was chosen by looking for the smaller maximum coefficient that stabilized the errors considering test case 2. We also investigated constant and diameter-based hyperdiffusion coefficients, and we could observe that the alignment-based coefficient has behavior similar to the constant coefficient, while adding hyperdiffusion where it is needed. Therefore, we adopted the alignment- Figure 20. Flow over a mountain test case for the moist shallowwater model: rain field at day 30 for the grids UR6 (a), UR7 (b), UR8 (c), UR9 (d) and VR7 (e) as well as the cell diameters in kilometers for the VR7 grid (f). The UR6, UR7, UR8 and UR9 grids have an average resolution of 120, 60, 30 and 15 km, respectively. based hyperdiffusion coefficient in the further simulations. After adding hyperdiffusion, spurious gravity waves were not generated in the height field and we obtained a similar evolution of the errors with time as the ones obtained in the uniform SCVT grids. Also, we observed that when we increased the ratio between high-and low-resolution cell diameters, the errors started to develop at earlier times and the final error increased, but the same quantity of fourth-order hyperdiffusion was enough to stabilize the error. For test case 5 from Williamson et al. (1992), we replace their mountain considering smooth Andes topography data. This test case showed that the height errors were concentrated over the Andes and generated gravity waves. This result is undesirable since the height errors were greater in the high-resolution region. We could notice that the error in the normal component of the velocity started to grow significantly after 23 d, but this was mitigated with the same amount of hyperdiffusion. For the unstable barotropic jet test case from Galewsky et al. (2004), we observed a lot of numerical noise in the potential vorticity on the Andes refined region. Again, fourth-order hyperdiffusion mitigated the problem, and a vortex near the Andes formation was better represented in the variable-resolution grid in comparison with a uniform grid considering the same Figure 21. Unstable barotropic jet test case for the moist shallow-water model. (a-c) Cloud field at day 7 for the UR8, UR9 and VR7 grids, respectively. (d-f) Cloud field at day 8 for the UR8, UR9 and VR7 grids, respectively. (g) Grid cell diameters in kilometers for the VR7 grid. The UR8 and UR9 grids have an average resolution of 30 and 15 km, respectively. number of cells. From these results, we can conclude that the local refinement introduced errors in the velocity field that generate spurious gravity waves, which are visible in the height field. A fourth-order hyperdiffusion is necessary to stabilize the velocity field error. These results are consistent with Zhou et al. (2020), wherein the authors show that the employment of horizontal hyperdiffusion removes numerical noise in the transition zone of a VR SCVT grid.
The moist shallow-water model developed by Zerroukat and Allen (2015) includes moist variables in the classical shallow-water model, wherein conversion of vapor to cloud, cloud to vapor and cloud to rain is possible. We analyzed the TRSK method on the variable-resolution grids considering two test cases. In the first test, similar to test case 5 from Williamson et al. (1992), we observed that the cloud field after 30 d was better represented in the variable-resolution grid of level 7 than in the uniform grid of the same level. However, for the cloud field, we notice spurious rain in the transition zone. Furthermore, spurious rain was also detectable over the Andes refined region, which we address as interference of the coarse grid. For the unstable barotropic test case with moist variables, we notice that both cloud and rain fields were not properly represented in the Andes refined region after 8 d in comparison with a high-resolution solution, whereby we observed a misposition of rain and clouds in the Andes region despite the employment of numerical fourth-order hyperdiffusion.
Our work shows that, despite its flexibility, working with general local refinements in SCVT grids using TRSK, which is also possible in the MPAS global model, requires some care. The main issues are related to spurious numerical waves that may trigger numerical instabilities, requiring numerical dissipation mechanisms to solve this problem. The requirement of dissipation is very common in most general circulation models, and TRSK has so far shown exceptionally good stability properties on quasi-uniform-resolution grids. On locally refined grids, our results show that, while requiring dissipation, the imposed hyperdiffusion had very little impact on the total energy conservation of TRSK. However, the grid may influence rain and cloud formation in the refined region with the TRSK advection scheme used here for the tracers. Overall, our results indicate that locally refined grids can be effective for short periods of time (a few days) but require additional caution for longer periods.
This choice of method for local grid refinement is one among several possibilities (Behrens, 2006). Nested local Figure 22. Unstable barotropic jet test case for the moist shallow-water model. (a-c) Rain field at day 7 for the UR8, UR9 and VR7 grids, respectively. (d-f) Rain field at day 8 for the UR8, UR9 and VR7 grids, respectively. (g) Grid cell diameters in kilometers for the VR7 grid. The UR8 and UR9 grids have an average resolution of 30 and 15 km, respectively. grid refinement, while requiring some additional computational effort on transition zones, can preserve more regularly shaped cells and is therefore less prone to such spurious modes encountered here. But it can be challenging to build a nesting grid to capture such a slim-shaped featured as the Andes Range. Static adaptive mesh refinement (AMR) could also be a potentially adequate solution to better represent the local feature of interest. A way to preserve the quality of cells observed in quasi-uniform grids, using static AMR to capture features of interest, is by using wavelet representation, as in Kevlahan and Dubos (2019). Overall, the most adequate way to represent the Andes Range for atmospheric modeling purposes still seems to be an open issue.
Additionally, we remark that our tracer equations were discretized here considering the same scheme as used for the continuity equation for the TRSK scheme, which is very low-order. MPAS employs a high-order advection scheme for the tracer equations, which could reduce some of the issues encountered here. Results from high-order finite-volume schemes for tracer transport on unstructured locally refined grids are to be presented in a follow-up work.
Finally, the grids developed in this work, which are available in the open repository https://github.com/pedrospeixoto/ imodel (last access: 11 November 2021), can be applied directly in the MPAS model or other models that use unstructured grids, and their impact may be investigated considering the full three-dimensional model, along similar lines as Zhou et al. (2020). From one side, we expect that the unstable modes could be challenging to mitigate due to other already existing unstable modes (e.g., Peixoto et al., 2018). However, since such 3D models already employ a relatively large amount of diffusion or hyperdiffusion (for numerical or physical reasons), most of the issues encountered here could be adequately controlled in 3D.
Code availability. All codes used in this work are openly provided in the GitHub repository at https://github.com/ pedrospeixoto/imodel, and the release version relative to results of this paper may be accessed as the Zenodo file https://doi.org/10.5281/zenodo.5667336 (Peixoto et al., 2021).