Version: dev

duo

Generic gnomonic cubed-sphere grid with the duo-grid halo system of Chen (2021): six N-by-N tiles interlocked in the 'staircase' arrangement, 6 N^2 cells, unstaggered (A-grid) so every prognostic variable is collocated at cell centres.

Generic gnomonic cubed-sphere grid with the duo-grid halo system of Chen (2021): six N-by-N tiles interlocked in the ‘staircase’ arrangement, 6 N^2 cells, unstaggered (A-grid) so every prognostic variable is collocated at cell centres. The name is the paper’s: ‘duo’ denotes the TWO coexisting halo point sets at each tile edge – the KINKED grid (the neighbour tile’s own cell centres, copied verbatim, which is what FV3 does) and the EXTENDED grid (the analytic continuation of the RECEIVING tile’s coordinate lines into its ghost region). Field values are remapped kinked -> extended by 1-D interpolation along the shared great circle, so halo operations are a literal continuation of the interior stencils and no one-sided boundary stencil appears anywhere in the solver; that is what removes cubed-sphere grid imprinting at the seams. KEY CONSEQUENCE FOR THIS FILE: the extended grid is just the reference-line formula evaluated at out-of-range indices, so all halo GEOMETRY is closed-form and local – only halo FIELD VALUES need the cross-tile remap. Every geometry array here therefore spans the interior plus 3 ghost layers with no boundary region and no seam gather. UNIFIED PROJECTIONS: the orthogonality and symmetry of a gnomonic tile mean one reference COLUMN determines the whole grid, so equidistance, equiangular (FV3 grid_type 2) and equi-edge (FV3 grid_type 0) differ ONLY in duo_ref_x/duo_ref_y; everything downstream reads duo_node_cart and is projection-agnostic. RESOLUTION-GENERIC: unlike an icosahedral mesh, whose 20*4^level sizing would need a ^ metaparameter op and a build-time subdivision fold, every size here is N plus a literal, inside the esm-spec 9.7.6 closure of + - * / – so NO companion mesh-data file is needed at any resolution and duo_tile_map is a fixed 6x3x3 topology constant. Real-valued quantities are consumer-supplied free names per the AGENTS.md extent convention: R_sphere, and alpha_ref/R_ref (the projection pair; unused by the equidistant templates). AXES. tile is a literal-6 interval, NOT a metaparameter: scripts/validate-library.py binds every metaparameter to its sample size when it checks that a rule’s makearray regions tile the axes (L006), so a metaparameter NTILE would fold to 16 and every rule would fail the tiling check. Prognostic fields are shaped [tile, x, y] and face fluxes [tile, x_nodes, y] or [tile, x, y_nodes]. Geometry uses three EXTENDED axes per direction, all sharing the convention ’extended index k <-> tile-local index k - 3’, so k = 4 is the first interior entry: x_nodes_ext (N+8) for corner nodes, x_cell_ext (N+6) for cell centres and areas, and x_metric (N+6) for cos(alpha). cos(alpha) is built by a forward difference that consumes a +1 neighbour, so the node halo is kept one layer WIDER than the cell-centre array and duo_cos_alpha is SOURCED FROM NODES (raw corner sums, scale-invariant) rather than from the collocated cell-centre array – that is what lets the metric span the full N+6 cell halo including the outermost ghost cell that the 5-point (Ng=3) flux reconstruction reaches. x_cell_ext stays N+6 (the prognostic axis duo_extend fills, capped at 3 remappable ghost layers). SEAM TOPOLOGY (needed by every rule’s boundary regions; derived and verified pointwise on node coordinates, not read off the figure): odd tiles n in {1,3,5} have E=n+1, N=n+2, W=n+4, S=n+5; even tiles n in {2,4,6} have N=n+1, E=n+2, W=n+5, S=n+4; wrap n+l-6 when n+l>6. The neighbour edge is traversed in FORWARD index order across the unrotated seams (odd E and S, even N and W) and in REVERSED order across the +-90-degree ones (odd N and W, even E and S) – the discrete statement of the Fig. 2c/2d rotation table, derived independently of it and in agreement with it.

Metaparameters

NameTypeDefaultDescription
Ninteger48Cells along each edge of each cube tile; the sphere carries 6 N^2 cells (the C[N] convention, so N=48 is C48).

All sizes are load-time metaparameters (esm-spec §9.7.6): rebind them at the import edge (or through the loader API) and the same files serve every resolution.

Consumer-supplied free names

R_ref R_sphere alpha_ref gi gj gt

These names are supplied by the consuming model’s scope at evaluation (the keyed-factor / free-name geometry contract); they are neither metaparameters (load-time integers) nor template parameters (bound per apply site).

Index sets

NameKindSize
tileinterval6
xintervalN
yintervalN
x_nodesinterval{'op': '+', 'args': ['N', 1]}
y_nodesinterval{'op': '+', 'args': ['N', 1]}
x_nodes_extinterval{'op': '+', 'args': ['N', 8]}
y_nodes_extinterval{'op': '+', 'args': ['N', 8]}
x_cell_extinterval{'op': '+', 'args': ['N', 6]}
y_cell_extinterval{'op': '+', 'args': ['N', 6]}
x_metricinterval{'op': '+', 'args': ['N', 6]}
y_metricinterval{'op': '+', 'args': ['N', 6]}
spaceinterval3

Geometry templates

TemplateParametersDefinitionDescription
duo_ref_x—sum[gi] (R_ref * tan(-alpha_ref + (gi - 3 - 1) * (2 * alpha_ref / N))) where {gi in x_nodes_ext}Gnomonic reference-line node positions along x for the ANGULAR projections (Chen 2021 B16-B17, B23), on the EXTENDED node axis x_nodes_ext: x_ref(jn) = R_ref tan(-alpha_ref + (jn-1) 2 alpha_ref / N), evaluated at jn = k - 3 so that k = 4 is the tile’s first interior node. alpha_ref and R_ref are consumer-supplied FREE NAMES (real-valued, hence not metaparameters – the reprojection/lambert_conformal.esm convention): (pi/4, 1) gives the EQUIANGULAR grid (FV3 grid_type 2), (asin(1/sqrt(3)), sqrt(2)) the EQUI-EDGE grid (FV3 grid_type 0); both send jn=1 to -1 and jn=N+1 to +1 exactly. Evaluating outside jn in [1, N+1] gives the DIRECT analytic continuation of the tile’s own coordinate lines into the ghost region. Two things follow. (1) Halo GEOMETRY is closed-form and LOCAL – no cross-tile gather is needed to build it; only halo FIELD VALUES need the duo-grid remap. On the overlap jn in [1, N+1] the extended nodes equal the un-extended construction bitwise. (2) SCOPE LIMIT, read this before using the halo for a non-equiangular grid: Chen (2021) section 2.3 states that direct extension of this kind ‘does not produce the duo-grid 1D alignment’ for the equidistance or equi-edge projections – only the equiangular grid has its halo points automatically co-circular with the donor tile’s, which is what makes the remap 1-D. For the other two the paper builds the halo instead by its section 2.3 steps 2-4: identify the points on the SPHERE TILE CENTRE lines, mirror the outermost three into the ghost region, and populate the halo from those mirrored points. That construction is NOT yet implemented here. So the halo nodes this template produces are exact for equiangular and PROVISIONAL for equidistance and equi-edge; interior nodes (jn in [1, N+1]) are exact for all three, and every interior-cell quantity downstream is unaffected.
duo_ref_y—sum[gj] (R_ref * tan(-alpha_ref + (gj - 3 - 1) * (2 * alpha_ref / N))) where {gj in y_nodes_ext}Gnomonic reference-line node positions along y for the ANGULAR projections (Chen 2021 B16-B17, B23), on the EXTENDED node axis y_nodes_ext: y_ref(jn) = R_ref tan(-alpha_ref + (jn-1) 2 alpha_ref / N), evaluated at jn = k - 3 so that k = 4 is the tile’s first interior node. alpha_ref and R_ref are consumer-supplied FREE NAMES (real-valued, hence not metaparameters – the reprojection/lambert_conformal.esm convention): (pi/4, 1) gives the EQUIANGULAR grid (FV3 grid_type 2), (asin(1/sqrt(3)), sqrt(2)) the EQUI-EDGE grid (FV3 grid_type 0); both send jn=1 to -1 and jn=N+1 to +1 exactly. Evaluating outside jn in [1, N+1] gives the DIRECT analytic continuation of the tile’s own coordinate lines into the ghost region. Two things follow. (1) Halo GEOMETRY is closed-form and LOCAL – no cross-tile gather is needed to build it; only halo FIELD VALUES need the duo-grid remap. On the overlap jn in [1, N+1] the extended nodes equal the un-extended construction bitwise. (2) SCOPE LIMIT, read this before using the halo for a non-equiangular grid: Chen (2021) section 2.3 states that direct extension of this kind ‘does not produce the duo-grid 1D alignment’ for the equidistance or equi-edge projections – only the equiangular grid has its halo points automatically co-circular with the donor tile’s, which is what makes the remap 1-D. For the other two the paper builds the halo instead by its section 2.3 steps 2-4: identify the points on the SPHERE TILE CENTRE lines, mirror the outermost three into the ghost region, and populate the halo from those mirrored points. That construction is NOT yet implemented here. So the halo nodes this template produces are exact for equiangular and PROVISIONAL for equidistance and equi-edge; interior nodes (jn in [1, N+1]) are exact for all three, and every interior-cell quantity downstream is unaffected.
duo_ref_x_equidistant—sum[gi] (-1 + (gi - 3 - 1) * (2 / N)) where {gi in x_nodes_ext}Gnomonic reference-line node positions along x for the EQUIDISTANCE projection (Chen 2021 B12), on the EXTENDED node axis x_nodes_ext: x_ref(jn) = -1 + (jn-1) 2/N at jn = k - 3. Uniform in the cube-face coordinate, which is why it gives the LEAST uniform cell areas on the sphere (measured C48 max/min area ratio 4.97, against 1.39 equiangular and 2.27 equi-edge). Linear rather than a tangent, so it is a separate template rather than an (alpha_ref, R_ref) choice, and it carries no free names at all: the cube face is [-1,1] by construction (B11). Outside jn in [1, N+1] this is the DIRECT extension, which per Chen (2021) section 2.3 does NOT give the duo-grid 1D alignment for equidistance – see the scope limit in duo_ref_x; the section 2.3 mirrored construction is not yet implemented.
duo_ref_y_equidistant—sum[gj] (-1 + (gj - 3 - 1) * (2 / N)) where {gj in y_nodes_ext}Gnomonic reference-line node positions along y for the EQUIDISTANCE projection (Chen 2021 B12), on the EXTENDED node axis y_nodes_ext: y_ref(jn) = -1 + (jn-1) 2/N at jn = k - 3. Uniform in the cube-face coordinate, which is why it gives the LEAST uniform cell areas on the sphere (measured C48 max/min area ratio 4.97, against 1.39 equiangular and 2.27 equi-edge). Linear rather than a tangent, so it is a separate template rather than an (alpha_ref, R_ref) choice, and it carries no free names at all: the cube face is [-1,1] by construction (B11). Outside jn in [1, N+1] this is the DIRECT extension, which per Chen (2021) section 2.3 does NOT give the duo-grid 1D alignment for equidistance – see the scope limit in duo_ref_x; the section 2.3 mirrored construction is not yet implemented.
duo_tile_map—[[[1, 0, 0], [0, 1, 0], [0, 0, 1]], [[0, -1, 0], [1, 0, 0], [0, 0, 1]], [[0, -1, 0], [0, 0, -1], [1, 0, 0]], [[-1, 0, 0], [0, 0, -1], [0, -1, 0]], [[0, 0, 1], [-1, 0, 0], [0, -1, 0]], [[0, 0, 1], [0, 1, 0], [-1, 0, 0]]]The six-tile ‘staircase’ placement table (Chen 2021 Fig. 2b, Eqs. B29-B34), shaped [tile, space, 3]: tile t’s cube-face point is p[t,d] = M[t,d,1] + M[t,d,2] X + M[t,d,3] Y, each row a signed selection of {1, X, Y}. The six maps are (1,X,Y), (-X,1,Y), (-X,-Y,1), (-1,-Y,-X), (Y,-1,-X), (Y,X,-1), placing the tiles on the +x, +y, +z, -x, -y, -z faces. DERIVATION: obtained by exhaustive search over the 24 proper rotations of the cube for the assignment under which (a) the six tiles cover the six faces once each and (b) the Fig. 2c/2d staircase neighbour table holds POINTWISE on node coordinates. Exactly ONE assignment satisfies both, and all 24 seam relations verify to 1e-12. The result reproduces B29-B34 EXACTLY as published, all six maps, which is the independent confirmation that this table is right (the search never consulted them). Further check: total sphere area from this table reproduces 4 pi R^2 to 2e-14 at every resolution and projection tested. A fixed 6x3x3 topology constant that does NOT vary with resolution, which is why this grid needs no mesh-data file.
duo_node_cartrefx, refysum[gt, gi, gj, gd] (R_sphere * ((duo_tile_map<>)[gt, gd, 1] + (duo_tile_map<>)[gt, gd, 2] * refx[gi] + (duo_tile_map<>)[gt, gd, 3] * refy[gj]) / sqrt(((duo_tile_map<>)[gt, 1, 1] + (duo_tile_map<>)[gt, 1, 2] * refx[gi] + (duo_tile_map<>)[gt, 1, 3] * refy[gj])^2 + ((duo_tile_map<>)[gt, 2, 1] + (duo_tile_map<>)[gt, 2, 2] * refx[gi] + (duo_tile_map<>)[gt, 2, 3] * refy[gj])^2 + ((duo_tile_map<>)[gt, 3, 1] + (duo_tile_map<>)[gt, 3, 2] * refx[gi] + (duo_tile_map<>)[gt, 3, 3] * refy[gj])^2)) where {gd in space, gi in x_nodes_ext, gj in y_nodes_ext, gt in tile}Cell-CORNER (node) positions on the sphere, shaped [tile, x_nodes_ext, y_nodes_ext, space] – the gnomonic projection proper, over the interior AND the 3-layer halo. The cube-face point p = M[t,:,1] + M[t,:,2] refx[i] + M[t,:,3] refy[j] (duo_tile_map) is carried to the sphere of radius R_sphere by normalisation, which IS the gnomonic map: the ray from the sphere centre through the cube point (Chen 2021 B11 and Fig. 3). Bind refx/refy to duo_ref_x/duo_ref_y for an angular projection or to the _equidistant pair for equidistance – every template downstream reads only this array and is projection-agnostic, which is the paper’s unified reference-line formulation. R_sphere is a consumer-supplied free name, so one grid file serves any sphere (AGENTS.md extent convention). Because each row and column of nodes shares one cube-face coordinate, the projected grid lines are great circles – the property the duo-grid halo remap relies on.
duo_cell_centernodesum[gt, gi, gj, gd] (R_sphere * (node[gt, gi, gj, gd] + node[gt, gi + 1, gj, gd] + node[gt, gi + 1, gj + 1, gd] + node[gt, gi, gj + 1, gd]) / sqrt((node[gt, gi, gj, 1] + node[gt, gi + 1, gj, 1] + node[gt, gi + 1, gj + 1, 1] + node[gt, gi, gj + 1, 1])^2 + (node[gt, gi, gj, 2] + node[gt, gi + 1, gj, 2] + node[gt, gi + 1, gj + 1, 2] + node[gt, gi, gj + 1, 2])^2 + (node[gt, gi, gj, 3] + node[gt, gi + 1, gj, 3] + node[gt, gi + 1, gj + 1, 3] + node[gt, gi, gj + 1, 3])^2)) where {gd in space, gi in x_cell_ext, gj in y_cell_ext, gt in tile}Cell-CENTRE positions on the sphere, shaped [tile, x_cell_ext, y_cell_ext, space]: the mean of the cell’s four corner nodes, renormalised back onto the R_sphere sphere. This is the unstaggered (A-grid) collocation point at which EVERY prognostic variable lives in Chen (2021) – the depth h and both covariant wind components share it, which is what makes the solver unstaggered. Renormalising after averaging matters: the chord midpoint of four points on a sphere lies strictly inside it, and skipping the projection would put the collocation point off the manifold by O(h^2). Index convention: cell index k on x_cell_ext takes its corners from node indices k and k+1 on x_nodes_ext, so the halo offset cancels and no index arithmetic beyond +1 appears. Bind node to duo_node_cart.
duo_cell_areanodesum[gt, gi, gj] (R_sphere^2 * (duo_spherical_angle<pix=node[gt, gi, gj + 1, 1], piy=node[gt, gi, gj + 1, 2], piz=node[gt, gi, gj + 1, 3], pjx=node[gt, gi, gj, 1], pjy=node[gt, gi, gj, 2], pjz=node[gt, gi, gj, 3], pkx=node[gt, gi + 1, gj, 1], pky=node[gt, gi + 1, gj, 2], pkz=node[gt, gi + 1, gj, 3]> + duo_spherical_angle<pix=node[gt, gi, gj, 1], piy=node[gt, gi, gj, 2], piz=node[gt, gi, gj, 3], pjx=node[gt, gi + 1, gj, 1], pjy=node[gt, gi + 1, gj, 2], pjz=node[gt, gi + 1, gj, 3], pkx=node[gt, gi + 1, gj + 1, 1], pky=node[gt, gi + 1, gj + 1, 2], pkz=node[gt, gi + 1, gj + 1, 3]> + duo_spherical_angle<pix=node[gt, gi + 1, gj, 1], piy=node[gt, gi + 1, gj, 2], piz=node[gt, gi + 1, gj, 3], pjx=node[gt, gi + 1, gj + 1, 1], pjy=node[gt, gi + 1, gj + 1, 2], pjz=node[gt, gi + 1, gj + 1, 3], pkx=node[gt, gi, gj + 1, 1], pky=node[gt, gi, gj + 1, 2], pkz=node[gt, gi, gj + 1, 3]> + duo_spherical_angle<pix=node[gt, gi + 1, gj + 1, 1], piy=node[gt, gi + 1, gj + 1, 2], piz=node[gt, gi + 1, gj + 1, 3], pjx=node[gt, gi, gj + 1, 1], pjy=node[gt, gi, gj + 1, 2], pjz=node[gt, gi, gj + 1, 3], pkx=node[gt, gi, gj, 1], pky=node[gt, gi, gj, 2], pkz=node[gt, gi, gj, 3]> + (-2 * 3.141592653589793))) where {gi in x_cell_ext, gj in y_cell_ext, gt in tile}Cell areas on the sphere, shaped [tile, x_cell_ext, y_cell_ext], by the SPHERICAL EXCESS of the geodesic quadrilateral through the cell’s four corner nodes (Chen 2021 B8): area = R^2 (a412 + a123 + a234 + a341 - 2 pi), each interior angle supplied by the imported scalar atom ../stencils/duo_spherical_angle.esm. ORIENTATION NOTE: B9 as printed sets a_ijk = acos( (p_i x p_j).(p_j x p_k) / … ), whose first factor is the arc normal p_i x p_j; combined with B8 that returns the NEGATIVE of the area, under either corner traversal (measured -4 pi R^2 exactly). The angle B8 needs is the polygon’s INTERIOR angle at p_j, which is what B9’s own prose asks for – ’the angle between three points with right-hand rule FROM p_j’, i.e. both arc normals taken outward from p_j, (p_j x p_i) and (p_j x p_k). The atom implements that reading and the areas come out positive and sum to 4 pi R^2. Traversal order of the four corners is then immaterial (verified: clockwise and counter-clockwise agree bitwise), since reversing it maps each interior angle to itself. This is exact, not an approximation, and it is the natural conformance gate for the whole geometry chain: summed over all 6 N^2 interior cells it reproduces 4 pi R_sphere^2 to 2e-14 at every resolution and projection tested. Bind node to duo_node_cart.
duo_cos_alphanodesum[gt, gi, gj] (duo_tangent_cos<kax=node[gt, gi, gj, 1] + node[gt, gi + 1, gj, 1] + node[gt, gi + 1, gj + 1, 1] + node[gt, gi, gj + 1, 1], kay=node[gt, gi, gj, 2] + node[gt, gi + 1, gj, 2] + node[gt, gi + 1, gj + 1, 2] + node[gt, gi, gj + 1, 2], kaz=node[gt, gi, gj, 3] + node[gt, gi + 1, gj, 3] + node[gt, gi + 1, gj + 1, 3] + node[gt, gi, gj + 1, 3], kbx=node[gt, gi + 1, gj, 1] + node[gt, gi + 2, gj, 1] + node[gt, gi + 2, gj + 1, 1] + node[gt, gi + 1, gj + 1, 1], kby=node[gt, gi + 1, gj, 2] + node[gt, gi + 2, gj, 2] + node[gt, gi + 2, gj + 1, 2] + node[gt, gi + 1, gj + 1, 2], kbz=node[gt, gi + 1, gj, 3] + node[gt, gi + 2, gj, 3] + node[gt, gi + 2, gj + 1, 3] + node[gt, gi + 1, gj + 1, 3], kcx=node[gt, gi, gj + 1, 1] + node[gt, gi + 1, gj + 1, 1] + node[gt, gi + 1, gj + 2, 1] + node[gt, gi, gj + 2, 1], kcy=node[gt, gi, gj + 1, 2] + node[gt, gi + 1, gj + 1, 2] + node[gt, gi + 1, gj + 2, 2] + node[gt, gi, gj + 2, 2], kcz=node[gt, gi, gj + 1, 3] + node[gt, gi + 1, gj + 1, 3] + node[gt, gi + 1, gj + 2, 3] + node[gt, gi, gj + 2, 3]>) where {gi in x_metric, gj in y_metric, gt in tile}cos(alpha) per cell, shaped [tile, x_metric, y_metric], where alpha is the angle between the two local curvilinear coordinate directions (Chen 2021 C17). This single scalar IS the entire metric on this grid: g_ij = [[1, cos a],[cos a, 1]], g^ij = (1/sin^2 a)[[1,-cos a],[-cos a,1]], sqrt(g)=sin(alpha) (C18-C20). Built as the C13-C14 TANGENT directions e1 ~ (k x k_i+1) x k, e2 ~ (k x k_j+1) x k via duo_tangent_cos. SOURCED FROM NODES: k(i,j) is taken as the RAW SUM of the four corner nodes of cell (i,j) (an unnormalised cell-centre direction); duo_tangent_cos is scale-invariant in each of its three point arguments, so the omitted 1/4 and the omitted renormalisation onto the sphere both cancel and the cos(alpha) is identical (to machine precision) to the duo_cell_center-based form. Sourcing from node rather than center lets the metric span x_metric = N+6 (interior + 3 ghost layers) using the node halo x_nodes_ext = N+8, one layer wider than the collocated cell-centre array x_cell_ext = N+6 – which the 5-point (Ng=3) flux reconstruction requires at the outermost ghost cell, where a centre-based metric would need a non-existent forward centre. cos(alpha) is 0 at a tile centre and about -+0.45 at the cube corners. Bind node to duo_node_cart.
duo_cell_area_mean—4 * 3.141592653589793 * R_sphere^2 / (6 * N^2)The nominal resolution measure: 4 pi R_sphere^2 / (6 N^2), the mean cell area over the sphere, with nominal spacing h ~ sqrt(duo_cell_area_mean). Convergence sweeps use it exactly as cartesian_uniform_1d uses dx = 1/N. The ACTUAL areas vary about this mean by the projection’s area ratio – about 1.39 equiangular, 2.27 equi-edge, 4.97 equidistance at C48 – so it is a resolution label, not a bound on any one cell.

Stencils

Interior-only, match-less templates importing grid.esm; the rules below wrap them with boundary-condition face regions into complete rewrite rules.

duo_arc_length

op:arc_length interior-only (match-less)

Source: grids/duo/stencils/duo_arc_length.esm

Parameters: ax, ay, az, bx, by, bz, radius

radius * acos(min(1, max(-1, ((ax * bx + ay * by + az * bz) / (sqrt(ax * ax + ay * ay + az * az) * sqrt(bx * bx + by * by + bz * bz))))))

Great-circle (geodesic) distance between two points a=(ax,ay,az) and b=(bx,by,bz) on a sphere of radius radius: duo_arc_length = radius * acos( (a.b) / (|a| |b|) ). Scalar stencil atom (Chen 2021, great-circle length used throughout Appendix B, Eqs B6-B7). The duo spatial-operator rules bind it inline on the halo-extended cartesian node array (grid.esm duo_node_cart) to obtain physical cell-face lengths: the x-normal face on the WEST side of cell (t,i,j) is the arc from node(t,i,j) to node(t,i,j+1); the y-normal face on the SOUTH side is the arc from node(t,i,j) to node(t,i+1,j). East face of cell i equals West face of cell i+1 (single-valued), so the flux-divergence is discretely conservative. This face length is the ‘Delta y’/‘Delta x’ multiplying the LMARS normal velocity in the continuity flux (Eqs 4-5), the coordinate-line edge weight in the relative vorticity (Eq 9 / C38), and the pressure-force lever in the momentum update (Eqs 7-8). AXIS-NEUTRAL: swap the node pair to measure any face on either grid direction.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_contravariant

op:metric interior-only (match-less)

Source: grids/duo/stencils/duo_contravariant.esm

Parameters: u, v, cosA

(u - cosA * v) / (1 - cosA * cosA)

Raise one covariant wind component to its contravariant counterpart through the duo metric g^{ij} = (1/(1-cosA^2)) [[1,-cosA],[-cosA,1]] (Chen 2021 C35): given the covariant component u aligned with this coordinate and the other covariant component v, returns u^i = (u - cosA v)/(1 - cosA^2). Apply once per coordinate direction (bind u,v to the same-direction and cross-direction covariant winds); cosA is duo_cos_alpha at the evaluation point. AXIS-NEUTRAL scalar algebra, no grid knowledge.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_corner_assy_1

op:corner_fill interior-only (match-less)

Source: grids/duo/stencils/duo_corner_assy_1.esm

Parameters: center, p1, p2, p3, p4, p5, p6

duo_arc_length<ax=center[gt, gi, gj, 1], ay=center[gt, gi, gj, 2], az=center[gt, gi, gj, 3], bx=p1, by=p2, bz=p3, radius=R_sphere> / duo_arc_length<ax=p4, ay=p5, az=p6, bx=p1, by=p2, bz=p3, radius=R_sphere>

Corner-fill assembly, level 1: great-circle arc-length remap weight over a corner node pair (applies duo_arc_length on the halo-extended node array). Outlined from the generated corner rules (exact-tree verified).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_corner_assy_2

op:corner_fill interior-only (match-less)

Source: grids/duo/stencils/duo_corner_assy_2.esm

Parameters: center, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p15, p16, p17, p18

p1 * duo_corner_assy_1<center=center, p1=p2, p2=p3, p3=p4, p4=p5, p5=p6, p6=p7> * p8 * duo_corner_assy_1<center=center, p1=p9, p2=p10, p3=p11, p4=p5, p5=p6, p6=p7> * p15 * duo_corner_assy_1<center=center, p1=p16, p2=p17, p3=p18, p4=p5, p5=p6, p6=p7>

Corner-fill assembly, level 2: composition of duo_corner_assy_1 remap weights across the corner stencil. Outlined from the generated corner rules (exact-tree verified).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_corner_assy_3

op:corner_fill interior-only (match-less)

Source: grids/duo/stencils/duo_corner_assy_3.esm

Parameters: center, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p26, p39, p52

duo_corner_assy_2<center=center, p1=-1, p10=p8, p11=p9, p15=-1, p16=p10, p17=p11, p18=p12, p2=p1, p3=p2, p4=p3, p5=p4, p6=p5, p7=p6, p8=-1, p9=p7> * p13 + duo_corner_assy_2<center=center, p1=1, p10=p8, p11=p9, p15=-1, p16=p10, p17=p11, p18=p12, p2=p4, p3=p5, p4=p6, p5=p1, p6=p2, p7=p3, p8=-1, p9=p7> * p26 + duo_corner_assy_2<center=center, p1=1, p10=p2, p11=p3, p15=-1, p16=p10, p17=p11, p18=p12, p2=p4, p3=p5, p4=p6, p5=p7, p6=p8, p7=p9, p8=1, p9=p1> * p39 + duo_corner_assy_2<center=center, p1=1, p10=p2, p11=p3, p15=1, p16=p7, p17=p8, p18=p9, p2=p4, p3=p5, p4=p6, p5=p10, p6=p11, p7=p12, p8=1, p9=p1> * p52

Corner-fill assembly, level 3: full corner interpolant assembled from duo_corner_assy_2. Shared by duo_corner_diag and duo_corner_offdiag. Outlined from the generated corner rules (exact-tree verified).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_corner_sel_1

op:corner_fill interior-only (match-less)

Source: grids/duo/stencils/duo_corner_sel_1.esm

Parameters: center, q, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32

ifelse((gi - gj) * (gi - gj) < 0.5, 0.5 * (duo_corner_assy_3<center=center, p1=p1, p10=p10, p11=p11, p12=p12, p13=p13, p2=p2, p26=p14, p3=p3, p39=p15, p4=p4, p5=p5, p52=p16, p6=p6, p7=p7, p8=p8, p9=p9> + duo_corner_assy_3<center=center, p1=p17, p10=p26, p11=p27, p12=p28, p13=p29, p2=p18, p26=p30, p3=p19, p39=p31, p4=p20, p5=p21, p52=p32, p6=p22, p7=p23, p8=p24, p9=p25>), q[gt, gi, gj])

Corner-fill one-sided extrapolation selector over duo_corner_assy_3 values, used by duo_corner_diag at panel-edge corners. Outlined from the generated corner rules (exact-tree verified).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_cross_x

op:cross interior-only (match-less)

Source: grids/duo/stencils/duo_cross_x.esm

Parameters: a1, a2, a3, b1, b2, b3

a2 * b3 - a3 * b2

One Cartesian component of a vector cross product a x b: cross_x(a2,a3,b2,b3) = a2b3 - a3b2. AXIS-NEUTRAL: bind the (y,z) components for the x output, (z,x) for y, (x,y) for z. Atom of the great-circle tangent construction cross(cross(a,b),a) used by the duo staggered-wind remap.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_extend_strip_e

op:halo_extend interior-only (match-less)

Source: grids/duo/stencils/duo_extend_strip_e.esm

Parameters: q, center, refx, refy, dt, X, Y

sum[1, gi, gj] (max(0, min(((X - 0.5 * (refx[k + 2] + refx[k + 3])) / (0.5 * (refx[k + 3] + refx[k + 4]) - 0.5 * (refx[k + 2] + refx[k + 3]))), ((0.5 * (refx[k + 4] + refx[k + 5]) - X) / (0.5 * (refx[k + 4] + refx[k + 5]) - 0.5 * (refx[k + 3] + refx[k + 4]))))) * max(0, min(((Y - 0.5 * (refy[l + 2] + refy[l + 3])) / (0.5 * (refy[l + 3] + refy[l + 4]) - 0.5 * (refy[l + 2] + refy[l + 3]))), ((0.5 * (refy[l + 4] + refy[l + 5]) - Y) / (0.5 * (refy[l + 4] + refy[l + 5]) - 0.5 * (refy[l + 3] + refy[l + 4]))))) * ifelse(l < 1, 2 * ifelse(k < 1, 2 * q[dt, 1, 1] - q[dt, 2, 1], ifelse(k > N, 2 * q[dt, N, 1] - q[dt, N - 1, 1], q[dt, max(1, min(N, k)), 1])) - ifelse(k < 1, 2 * q[dt, 1, 2] - q[dt, 2, 2], ifelse(k > N, 2 * q[dt, N, 2] - q[dt, N - 1, 2], q[dt, max(1, min(N, k)), 2])), ifelse(l > N, 2 * ifelse(k < 1, 2 * q[dt, 1, N] - q[dt, 2, N], ifelse(k > N, 2 * q[dt, N, N] - q[dt, N - 1, N], q[dt, max(1, min(N, k)), N])) - ifelse(k < 1, 2 * q[dt, 1, N - 1] - q[dt, 2, N - 1], ifelse(k > N, 2 * q[dt, N, N - 1] - q[dt, N - 1, N - 1], q[dt, max(1, min(N, k)), N - 1])), ifelse(k < 1, 2 * q[dt, 1, max(1, min(N, l))] - q[dt, 2, max(1, min(N, l))], ifelse(k > N, 2 * q[dt, N, max(1, min(N, l))] - q[dt, N - 1, max(1, min(N, l))], q[dt, max(1, min(N, k)), max(1, min(N, l))]))))) where {gi in N + 4:N + 6, gj in 4:N + 3, k in 0:N + 1, l in 0:N + 1}

East-edge halo strip of the duo_extend donor-cube remap: tent-basis remap of the donor tile’s field over the strip’s gnomonic coordinates (X, Y), with one-sided extrapolation at the strip ends. Parameters (q, center, refx, refy, dt, X, Y); the caller binds the donor tile dt and the signed center-component ratios X, Y.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_extend_strip_n

op:halo_extend interior-only (match-less)

Source: grids/duo/stencils/duo_extend_strip_n.esm

Parameters: q, center, refx, refy, dt, X, Y

sum[1, gi, gj] (max(0, min(((X - 0.5 * (refx[k + 2] + refx[k + 3])) / (0.5 * (refx[k + 3] + refx[k + 4]) - 0.5 * (refx[k + 2] + refx[k + 3]))), ((0.5 * (refx[k + 4] + refx[k + 5]) - X) / (0.5 * (refx[k + 4] + refx[k + 5]) - 0.5 * (refx[k + 3] + refx[k + 4]))))) * max(0, min(((Y - 0.5 * (refy[l + 2] + refy[l + 3])) / (0.5 * (refy[l + 3] + refy[l + 4]) - 0.5 * (refy[l + 2] + refy[l + 3]))), ((0.5 * (refy[l + 4] + refy[l + 5]) - Y) / (0.5 * (refy[l + 4] + refy[l + 5]) - 0.5 * (refy[l + 3] + refy[l + 4]))))) * ifelse(l < 1, 2 * ifelse(k < 1, 2 * q[dt, 1, 1] - q[dt, 2, 1], ifelse(k > N, 2 * q[dt, N, 1] - q[dt, N - 1, 1], q[dt, max(1, min(N, k)), 1])) - ifelse(k < 1, 2 * q[dt, 1, 2] - q[dt, 2, 2], ifelse(k > N, 2 * q[dt, N, 2] - q[dt, N - 1, 2], q[dt, max(1, min(N, k)), 2])), ifelse(l > N, 2 * ifelse(k < 1, 2 * q[dt, 1, N] - q[dt, 2, N], ifelse(k > N, 2 * q[dt, N, N] - q[dt, N - 1, N], q[dt, max(1, min(N, k)), N])) - ifelse(k < 1, 2 * q[dt, 1, N - 1] - q[dt, 2, N - 1], ifelse(k > N, 2 * q[dt, N, N - 1] - q[dt, N - 1, N - 1], q[dt, max(1, min(N, k)), N - 1])), ifelse(k < 1, 2 * q[dt, 1, max(1, min(N, l))] - q[dt, 2, max(1, min(N, l))], ifelse(k > N, 2 * q[dt, N, max(1, min(N, l))] - q[dt, N - 1, max(1, min(N, l))], q[dt, max(1, min(N, k)), max(1, min(N, l))]))))) where {gi in 4:N + 3, gj in N + 4:N + 6, k in 0:N + 1, l in 0:N + 1}

North-edge halo strip of the duo_extend donor-cube remap: tent-basis remap of the donor tile’s field over the strip’s gnomonic coordinates (X, Y), with one-sided extrapolation at the strip ends. Parameters (q, center, refx, refy, dt, X, Y); the caller binds the donor tile dt and the signed center-component ratios X, Y.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_extend_strip_s

op:halo_extend interior-only (match-less)

Source: grids/duo/stencils/duo_extend_strip_s.esm

Parameters: q, center, refx, refy, dt, X, Y

sum[1, gi, gj] (max(0, min(((X - 0.5 * (refx[k + 2] + refx[k + 3])) / (0.5 * (refx[k + 3] + refx[k + 4]) - 0.5 * (refx[k + 2] + refx[k + 3]))), ((0.5 * (refx[k + 4] + refx[k + 5]) - X) / (0.5 * (refx[k + 4] + refx[k + 5]) - 0.5 * (refx[k + 3] + refx[k + 4]))))) * max(0, min(((Y - 0.5 * (refy[l + 2] + refy[l + 3])) / (0.5 * (refy[l + 3] + refy[l + 4]) - 0.5 * (refy[l + 2] + refy[l + 3]))), ((0.5 * (refy[l + 4] + refy[l + 5]) - Y) / (0.5 * (refy[l + 4] + refy[l + 5]) - 0.5 * (refy[l + 3] + refy[l + 4]))))) * ifelse(l < 1, 2 * ifelse(k < 1, 2 * q[dt, 1, 1] - q[dt, 2, 1], ifelse(k > N, 2 * q[dt, N, 1] - q[dt, N - 1, 1], q[dt, max(1, min(N, k)), 1])) - ifelse(k < 1, 2 * q[dt, 1, 2] - q[dt, 2, 2], ifelse(k > N, 2 * q[dt, N, 2] - q[dt, N - 1, 2], q[dt, max(1, min(N, k)), 2])), ifelse(l > N, 2 * ifelse(k < 1, 2 * q[dt, 1, N] - q[dt, 2, N], ifelse(k > N, 2 * q[dt, N, N] - q[dt, N - 1, N], q[dt, max(1, min(N, k)), N])) - ifelse(k < 1, 2 * q[dt, 1, N - 1] - q[dt, 2, N - 1], ifelse(k > N, 2 * q[dt, N, N - 1] - q[dt, N - 1, N - 1], q[dt, max(1, min(N, k)), N - 1])), ifelse(k < 1, 2 * q[dt, 1, max(1, min(N, l))] - q[dt, 2, max(1, min(N, l))], ifelse(k > N, 2 * q[dt, N, max(1, min(N, l))] - q[dt, N - 1, max(1, min(N, l))], q[dt, max(1, min(N, k)), max(1, min(N, l))]))))) where {gi in 4:N + 3, gj in 1:3, k in 0:N + 1, l in 0:N + 1}

South-edge halo strip of the duo_extend donor-cube remap: tent-basis remap of the donor tile’s field over the strip’s gnomonic coordinates (X, Y), with one-sided extrapolation at the strip ends. Parameters (q, center, refx, refy, dt, X, Y); the caller binds the donor tile dt and the signed center-component ratios X, Y.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_extend_strip_w

op:halo_extend interior-only (match-less)

Source: grids/duo/stencils/duo_extend_strip_w.esm

Parameters: q, center, refx, refy, dt, X, Y

sum[1, gi, gj] (max(0, min(((X - 0.5 * (refx[k + 2] + refx[k + 3])) / (0.5 * (refx[k + 3] + refx[k + 4]) - 0.5 * (refx[k + 2] + refx[k + 3]))), ((0.5 * (refx[k + 4] + refx[k + 5]) - X) / (0.5 * (refx[k + 4] + refx[k + 5]) - 0.5 * (refx[k + 3] + refx[k + 4]))))) * max(0, min(((Y - 0.5 * (refy[l + 2] + refy[l + 3])) / (0.5 * (refy[l + 3] + refy[l + 4]) - 0.5 * (refy[l + 2] + refy[l + 3]))), ((0.5 * (refy[l + 4] + refy[l + 5]) - Y) / (0.5 * (refy[l + 4] + refy[l + 5]) - 0.5 * (refy[l + 3] + refy[l + 4]))))) * ifelse(l < 1, 2 * ifelse(k < 1, 2 * q[dt, 1, 1] - q[dt, 2, 1], ifelse(k > N, 2 * q[dt, N, 1] - q[dt, N - 1, 1], q[dt, max(1, min(N, k)), 1])) - ifelse(k < 1, 2 * q[dt, 1, 2] - q[dt, 2, 2], ifelse(k > N, 2 * q[dt, N, 2] - q[dt, N - 1, 2], q[dt, max(1, min(N, k)), 2])), ifelse(l > N, 2 * ifelse(k < 1, 2 * q[dt, 1, N] - q[dt, 2, N], ifelse(k > N, 2 * q[dt, N, N] - q[dt, N - 1, N], q[dt, max(1, min(N, k)), N])) - ifelse(k < 1, 2 * q[dt, 1, N - 1] - q[dt, 2, N - 1], ifelse(k > N, 2 * q[dt, N, N - 1] - q[dt, N - 1, N - 1], q[dt, max(1, min(N, k)), N - 1])), ifelse(k < 1, 2 * q[dt, 1, max(1, min(N, l))] - q[dt, 2, max(1, min(N, l))], ifelse(k > N, 2 * q[dt, N, max(1, min(N, l))] - q[dt, N - 1, max(1, min(N, l))], q[dt, max(1, min(N, k)), max(1, min(N, l))]))))) where {gi in 1:3, gj in 4:N + 3, k in 0:N + 1, l in 0:N + 1}

West-edge halo strip of the duo_extend donor-cube remap: tent-basis remap of the donor tile’s field over the strip’s gnomonic coordinates (X, Y), with one-sided extrapolation at the strip ends. Parameters (q, center, refx, refy, dt, X, Y); the caller binds the donor tile dt and the signed center-component ratios X, Y.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_ke

op:kinetic_energy order:2 interior-only (match-less)

Source: grids/duo/stencils/duo_ke.esm

Parameters: u, v, cosA

(u * u + v * v + (-2 * cosA * u * v)) / (2 * (1 - cosA * cosA))

Chen (2021) Eq 10 / C39 kinetic energy on the covariant curvilinear frame: K = (u^2 - 2 cosA u v + v^2) / (2 (1 - cosA^2)), the invariant K = 1/2(u u^1 + v u^2) for covariant components (u,v) raised by the metric g^{ij} = (1/sin^2 a) [[1,-cos a],[-cos a,1]] with sin^2 a = 1 - cos^2 a. Equals the paper’s interface expression 1/2(u|| u~|| + u_perp u~_perp) and is independent of the gnomonic projection. cosA is the grid’s duo_cos_alpha (the angle between the unit covariant basis vectors) at the evaluation point; on the diagonal-metric limit cosA -> 0 it collapses to 1/2(u^2+v^2). AXIS-NEUTRAL scalar algebra; the consumer binds (u,v) to the interface-reconstructed covariant components and cosA to the interface metric. K enters the momentum RHS as -grad K (Eqs 7-8).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_ke_orthogonal

op:kinetic_energy interior-only (match-less)

Source: grids/duo/stencils/duo_ke_orthogonal.esm

Parameters: ut, up

0.5 * (ut * ut + up * up)

Interface kinetic energy K = 1/2 (ut^2 + up^2) built from the ORTHOGONAL pair at an LMARS interface: the normal Riemann velocity ut (duo_lmars_ustar_a) and the upwinded tangential velocity up (duo_upwind). This is the paper’s interface KE (Chen 2021 Eq 10 evaluated on the orthogonalised interface state), distinct from the covariant duo_ke which carries the cross-metric term; on an orthogonal interface frame the cross term vanishes and K reduces to 1/2(ut^2+up^2). AXIS-NEUTRAL scalar algebra.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_lmars_a

op:wavespeed order:1 interior-only (match-less)

Source: grids/duo/stencils/duo_lmars_a.esm

Parameters: piE, piW

1 / 2 * (sqrt(piE) + sqrt(piW))

Chen (2021) LMARS interface solve, Eq 13: the interface gravity-wave speed a = 1/2(sqrt(piE)+sqrt(piW)), the single approximation LMARS makes (the group velocity at the face). Pi carries units of velocity^2 so sqrt(Pi) is a speed; a>0 whenever piE,piW>0 (Pi = G h, h>0). AXIS- AND DIRECTION-NEUTRAL scalar algebra taking the four reconstructed states at one cell interface – the EAST value of the left cell (uE, piE, from duo_recon_*) and the WEST value of the right cell (uW, piW) – so a y-interface reuses it verbatim with the North/South reconstructions bound in. Pi = G h is the pressure forcing (kept distinct from the transported depth h, which is chosen by upwinding). Semi-discrete: the ODE integrator owns dt.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2 Eqs 11-13 LMARS interface solve; Section 3.3 Eqs 20-22 the L97-compatible averaging/viscous split.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2013). A control-volume model of the compressible Euler equations with a vertical Lagrangian coordinate. Monthly Weather Review, 141(7), 2526-2544. (Origin of the Low Mach number Approximate Riemann Solver.) doi:10.1175/MWR-D-12-00129.1

duo_lmars_pibar

op:riemann order:2 interior-only (match-less)

Source: grids/duo/stencils/duo_lmars_pibar.esm

Parameters: piE, piW

1 / 2 * (piE + piW)

Chen (2021) LMARS interface solve, Eq 21: the geometric (averaging) part of the interface pressure, Pi_bar = 1/2(piE+piW). The L97 pressure-gradient rule differences THIS term as the four-corner geometric identity, separately from the viscous part. AXIS- AND DIRECTION-NEUTRAL scalar algebra taking the four reconstructed states at one cell interface – the EAST value of the left cell (uE, piE, from duo_recon_*) and the WEST value of the right cell (uW, piW) – so a y-interface reuses it verbatim with the North/South reconstructions bound in. Pi = G h is the pressure forcing (kept distinct from the transported depth h, which is chosen by upwinding). Semi-discrete: the ODE integrator owns dt.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2 Eqs 11-13 LMARS interface solve; Section 3.3 Eqs 20-22 the L97-compatible averaging/viscous split.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2013). A control-volume model of the compressible Euler equations with a vertical Lagrangian coordinate. Monthly Weather Review, 141(7), 2526-2544. (Origin of the Low Mach number Approximate Riemann Solver.) doi:10.1175/MWR-D-12-00129.1

duo_lmars_pistar

op:riemann order:2 interior-only (match-less)

Source: grids/duo/stencils/duo_lmars_pistar.esm

Parameters: uE, uW, piE, piW

duo_lmars_pibar<piE=piE, piW=piW> + duo_lmars_pivis<piE=piE, piW=piW, uE=uE, uW=uW>

Chen (2021) LMARS interface solve, Eq 12 = Eq 20: the full LMARS interface pressure, Pi* = Pi_bar + Pi_vis (Eq 20 = Eq 12). Provided as the sum of its two published parts so both the plain LMARS flux rule and the L97 split rule draw on the SAME averaging and viscous atoms. AXIS- AND DIRECTION-NEUTRAL scalar algebra taking the four reconstructed states at one cell interface – the EAST value of the left cell (uE, piE, from duo_recon_*) and the WEST value of the right cell (uW, piW) – so a y-interface reuses it verbatim with the North/South reconstructions bound in. Pi = G h is the pressure forcing (kept distinct from the transported depth h, which is chosen by upwinding). Semi-discrete: the ODE integrator owns dt.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2 Eqs 11-13 LMARS interface solve; Section 3.3 Eqs 20-22 the L97-compatible averaging/viscous split.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2013). A control-volume model of the compressible Euler equations with a vertical Lagrangian coordinate. Monthly Weather Review, 141(7), 2526-2544. (Origin of the Low Mach number Approximate Riemann Solver.) doi:10.1175/MWR-D-12-00129.1

duo_lmars_pivis

op:riemann order:2 interior-only (match-less)

Source: grids/duo/stencils/duo_lmars_pivis.esm

Parameters: uE, uW, piE, piW

duo_lmars_a<piE=piE, piW=piW> / 2 * (uE - uW)

Chen (2021) LMARS interface solve, Eq 22: the LMARS viscous part of the interface pressure, Pi_vis = -(a/2)(uW-uE) = (a/2)(uE-uW): the implicit 2nd-order diffusion the Riemann solver supplies. It is what the L97 geometric form lacks, and adding it back yields the stable scheme. AXIS- AND DIRECTION-NEUTRAL scalar algebra taking the four reconstructed states at one cell interface – the EAST value of the left cell (uE, piE, from duo_recon_*) and the WEST value of the right cell (uW, piW) – so a y-interface reuses it verbatim with the North/South reconstructions bound in. Pi = G h is the pressure forcing (kept distinct from the transported depth h, which is chosen by upwinding). Semi-discrete: the ODE integrator owns dt.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2 Eqs 11-13 LMARS interface solve; Section 3.3 Eqs 20-22 the L97-compatible averaging/viscous split.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2013). A control-volume model of the compressible Euler equations with a vertical Lagrangian coordinate. Monthly Weather Review, 141(7), 2526-2544. (Origin of the Low Mach number Approximate Riemann Solver.) doi:10.1175/MWR-D-12-00129.1

duo_lmars_ustar

op:riemann order:2 interior-only (match-less)

Source: grids/duo/stencils/duo_lmars_ustar.esm

Parameters: uE, uW, piE, piW

1 / 2 * (uE + uW) + (piE - piW) / (2 * duo_lmars_a<piE=piE, piW=piW>)

Chen (2021) LMARS interface solve, Eq 11: the normal velocity at the interface, u* = 1/2(uE+uW) - (piW-piE)/(2a): a centered average plus the pressure-driven acoustic correction. Reduces to the arithmetic mean when the two reconstructed pressures agree. AXIS- AND DIRECTION-NEUTRAL scalar algebra taking the four reconstructed states at one cell interface – the EAST value of the left cell (uE, piE, from duo_recon_*) and the WEST value of the right cell (uW, piW) – so a y-interface reuses it verbatim with the North/South reconstructions bound in. Pi = G h is the pressure forcing (kept distinct from the transported depth h, which is chosen by upwinding). Semi-discrete: the ODE integrator owns dt.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2 Eqs 11-13 LMARS interface solve; Section 3.3 Eqs 20-22 the L97-compatible averaging/viscous split.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2013). A control-volume model of the compressible Euler equations with a vertical Lagrangian coordinate. Monthly Weather Review, 141(7), 2526-2544. (Origin of the Low Mach number Approximate Riemann Solver.) doi:10.1175/MWR-D-12-00129.1

duo_lmars_ustar_a

op:riemann interior-only (match-less)

Source: grids/duo/stencils/duo_lmars_ustar_a.esm

Parameters: uE, uW, piE, piW, a

0.5 * (uE + uW) + (piE - piW) / (2 * a)

LMARS interface normal velocity u* = 1/2(uE + uW) + (piE - piW)/(2 a) (Chen 2021 Eq 13), with the acoustic wave speed a supplied EXPLICITLY as a parameter rather than recomputed from (piE,piW). This matches the reference code default in which a is formed from the two adjacent CELL pressures (a = duo_lmars_a(dp_L, dp_R)) while the pressure jump piE-piW uses the face-reconstructed pressures – the two use different pressure pairs, so the speed cannot be recovered from (piE,piW) alone (contrast duo_lmars_ustar, which bundles a = duo_lmars_a(piE,piW)). AXIS-NEUTRAL scalar algebra.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_recon_pt_g1

op:reconstruct order:1 stencil width 1 interior-only (match-less)

Source: grids/duo/stencils/duo_recon_pt_g1.esm

Parameters: a0

a0

Chen (2021) fixed-coefficient polynomial reconstruction of the EAST-side cell-face midpoint value on an Nc = 2*Ng-1 = 1-point stencil from point-value variables (Ng = 1 ghost layers; Table 1 row). eta^E = sum_l c_l a_l with c = [1@l=0] over offsets l = -(Ng-1)..(Ng-1); the coefficients sum to 1 (constant-preserving) and reproduce the true face value to design order 1 on a smooth field (numerically verified: Ng=1,2,3 -> order 1,3,5). AXIS- AND DIRECTION-NEUTRAL scalar algebra: this atom knows nothing about x/y or which tile edge. The consumer places it at any of the four faces by binding the params to the appropriate neighbour gathers on the halo-EXTENDED field (grids/duo/rules/duo_extend), where the 1-D duo-grid alignment makes every interface – interior and tile-seam alike – a uniform interior stencil with no one-sided closure. EAST face of cell i: a_l <- q_{i+l}. WEST face of cell i uses the paper’s mirror gamma^W_l = gamma^E_{-l}: bind a_l <- q_{i-l} (params reversed). NORTH/SOUTH are the same two binding patterns along the y axis. Rational coefficients are emitted as exact integer divisions so every binding evaluates the identical IEEE double. No limiter (this work implements no monotonic filter); Nc = 1, stencil symmetric with reach Ng-1 = 0.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2, Eqs 16-19 and Tables 1-2: fixed-coefficient polynomial reconstruction to cell-face midpoints.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2018). Toward an unstaggered finite-volume dynamical core with a fast Riemann solver: 1-D linearized analysis of dissipation, dispersion, and noise control. Journal of Advances in Modeling Earth Systems (source of the reconstruction coefficient tables). doi:10.1029/2018MS001361

duo_recon_pt_g2

op:reconstruct order:3 stencil width 3 interior-only (match-less)

Source: grids/duo/stencils/duo_recon_pt_g2.esm

Parameters: am1, a0, ap1

-1 / 8 * am1 + 3 / 4 * a0 + 3 / 8 * ap1

Chen (2021) fixed-coefficient polynomial reconstruction of the EAST-side cell-face midpoint value on an Nc = 2*Ng-1 = 3-point stencil from point-value variables (Ng = 2 ghost layers; Table 1 row). eta^E = sum_l c_l a_l with c = [-1/8@l=-1, 3/4@l=0, 3/8@l=1] over offsets l = -(Ng-1)..(Ng-1); the coefficients sum to 1 (constant-preserving) and reproduce the true face value to design order 3 on a smooth field (numerically verified: Ng=1,2,3 -> order 1,3,5). AXIS- AND DIRECTION-NEUTRAL scalar algebra: this atom knows nothing about x/y or which tile edge. The consumer places it at any of the four faces by binding the params to the appropriate neighbour gathers on the halo-EXTENDED field (grids/duo/rules/duo_extend), where the 1-D duo-grid alignment makes every interface – interior and tile-seam alike – a uniform interior stencil with no one-sided closure. EAST face of cell i: a_l <- q_{i+l}. WEST face of cell i uses the paper’s mirror gamma^W_l = gamma^E_{-l}: bind a_l <- q_{i-l} (params reversed). NORTH/SOUTH are the same two binding patterns along the y axis. Rational coefficients are emitted as exact integer divisions so every binding evaluates the identical IEEE double. No limiter (this work implements no monotonic filter); Nc = 3, stencil symmetric with reach Ng-1 = 1.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2, Eqs 16-19 and Tables 1-2: fixed-coefficient polynomial reconstruction to cell-face midpoints.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2018). Toward an unstaggered finite-volume dynamical core with a fast Riemann solver: 1-D linearized analysis of dissipation, dispersion, and noise control. Journal of Advances in Modeling Earth Systems (source of the reconstruction coefficient tables). doi:10.1029/2018MS001361

duo_recon_pt_g3

op:reconstruct order:5 stencil width 5 interior-only (match-less)

Source: grids/duo/stencils/duo_recon_pt_g3.esm

Parameters: am2, am1, a0, ap1, ap2

3 / 128 * am2 + -5 / 32 * am1 + 45 / 64 * a0 + 15 / 32 * ap1 + -5 / 128 * ap2

Chen (2021) fixed-coefficient polynomial reconstruction of the EAST-side cell-face midpoint value on an Nc = 2*Ng-1 = 5-point stencil from point-value variables (Ng = 3 ghost layers; Table 1 row). eta^E = sum_l c_l a_l with c = [3/128@l=-2, -5/32@l=-1, 45/64@l=0, 15/32@l=1, -5/128@l=2] over offsets l = -(Ng-1)..(Ng-1); the coefficients sum to 1 (constant-preserving) and reproduce the true face value to design order 5 on a smooth field (numerically verified: Ng=1,2,3 -> order 1,3,5). AXIS- AND DIRECTION-NEUTRAL scalar algebra: this atom knows nothing about x/y or which tile edge. The consumer places it at any of the four faces by binding the params to the appropriate neighbour gathers on the halo-EXTENDED field (grids/duo/rules/duo_extend), where the 1-D duo-grid alignment makes every interface – interior and tile-seam alike – a uniform interior stencil with no one-sided closure. EAST face of cell i: a_l <- q_{i+l}. WEST face of cell i uses the paper’s mirror gamma^W_l = gamma^E_{-l}: bind a_l <- q_{i-l} (params reversed). NORTH/SOUTH are the same two binding patterns along the y axis. Rational coefficients are emitted as exact integer divisions so every binding evaluates the identical IEEE double. No limiter (this work implements no monotonic filter); Nc = 5, stencil symmetric with reach Ng-1 = 2.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2, Eqs 16-19 and Tables 1-2: fixed-coefficient polynomial reconstruction to cell-face midpoints.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2018). Toward an unstaggered finite-volume dynamical core with a fast Riemann solver: 1-D linearized analysis of dissipation, dispersion, and noise control. Journal of Advances in Modeling Earth Systems (source of the reconstruction coefficient tables). doi:10.1029/2018MS001361

duo_recon_vm_g1

op:reconstruct order:1 stencil width 1 interior-only (match-less)

Source: grids/duo/stencils/duo_recon_vm_g1.esm

Parameters: a0

a0

Chen (2021) fixed-coefficient polynomial reconstruction of the EAST-side cell-face midpoint value on an Nc = 2*Ng-1 = 1-point stencil from volume-mean variables (Ng = 1 ghost layers; Table 2 row). eta^E = sum_l c_l a_l with c = [1@l=0] over offsets l = -(Ng-1)..(Ng-1); the coefficients sum to 1 (constant-preserving) and reproduce the true face value to design order 1 on a smooth field (numerically verified: Ng=1,2,3 -> order 1,3,5). AXIS- AND DIRECTION-NEUTRAL scalar algebra: this atom knows nothing about x/y or which tile edge. The consumer places it at any of the four faces by binding the params to the appropriate neighbour gathers on the halo-EXTENDED field (grids/duo/rules/duo_extend), where the 1-D duo-grid alignment makes every interface – interior and tile-seam alike – a uniform interior stencil with no one-sided closure. EAST face of cell i: a_l <- q_{i+l}. WEST face of cell i uses the paper’s mirror gamma^W_l = gamma^E_{-l}: bind a_l <- q_{i-l} (params reversed). NORTH/SOUTH are the same two binding patterns along the y axis. Rational coefficients are emitted as exact integer divisions so every binding evaluates the identical IEEE double. No limiter (this work implements no monotonic filter); Nc = 1, stencil symmetric with reach Ng-1 = 0.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2, Eqs 16-19 and Tables 1-2: fixed-coefficient polynomial reconstruction to cell-face midpoints.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2018). Toward an unstaggered finite-volume dynamical core with a fast Riemann solver: 1-D linearized analysis of dissipation, dispersion, and noise control. Journal of Advances in Modeling Earth Systems (source of the reconstruction coefficient tables). doi:10.1029/2018MS001361

duo_recon_vm_g2

op:reconstruct order:3 stencil width 3 interior-only (match-less)

Source: grids/duo/stencils/duo_recon_vm_g2.esm

Parameters: am1, a0, ap1

-1 / 6 * am1 + 5 / 6 * a0 + 1 / 3 * ap1

Chen (2021) fixed-coefficient polynomial reconstruction of the EAST-side cell-face midpoint value on an Nc = 2*Ng-1 = 3-point stencil from volume-mean variables (Ng = 2 ghost layers; Table 2 row). eta^E = sum_l c_l a_l with c = [-1/6@l=-1, 5/6@l=0, 1/3@l=1] over offsets l = -(Ng-1)..(Ng-1); the coefficients sum to 1 (constant-preserving) and reproduce the true face value to design order 3 on a smooth field (numerically verified: Ng=1,2,3 -> order 1,3,5). AXIS- AND DIRECTION-NEUTRAL scalar algebra: this atom knows nothing about x/y or which tile edge. The consumer places it at any of the four faces by binding the params to the appropriate neighbour gathers on the halo-EXTENDED field (grids/duo/rules/duo_extend), where the 1-D duo-grid alignment makes every interface – interior and tile-seam alike – a uniform interior stencil with no one-sided closure. EAST face of cell i: a_l <- q_{i+l}. WEST face of cell i uses the paper’s mirror gamma^W_l = gamma^E_{-l}: bind a_l <- q_{i-l} (params reversed). NORTH/SOUTH are the same two binding patterns along the y axis. Rational coefficients are emitted as exact integer divisions so every binding evaluates the identical IEEE double. No limiter (this work implements no monotonic filter); Nc = 3, stencil symmetric with reach Ng-1 = 1.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2, Eqs 16-19 and Tables 1-2: fixed-coefficient polynomial reconstruction to cell-face midpoints.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2018). Toward an unstaggered finite-volume dynamical core with a fast Riemann solver: 1-D linearized analysis of dissipation, dispersion, and noise control. Journal of Advances in Modeling Earth Systems (source of the reconstruction coefficient tables). doi:10.1029/2018MS001361

duo_recon_vm_g3

op:reconstruct order:5 stencil width 5 interior-only (match-less)

Source: grids/duo/stencils/duo_recon_vm_g3.esm

Parameters: am2, am1, a0, ap1, ap2

1 / 30 * am2 + -13 / 60 * am1 + 47 / 60 * a0 + 9 / 20 * ap1 + -1 / 20 * ap2

Chen (2021) fixed-coefficient polynomial reconstruction of the EAST-side cell-face midpoint value on an Nc = 2*Ng-1 = 5-point stencil from volume-mean variables (Ng = 3 ghost layers; Table 2 row). eta^E = sum_l c_l a_l with c = [1/30@l=-2, -13/60@l=-1, 47/60@l=0, 9/20@l=1, -1/20@l=2] over offsets l = -(Ng-1)..(Ng-1); the coefficients sum to 1 (constant-preserving) and reproduce the true face value to design order 5 on a smooth field (numerically verified: Ng=1,2,3 -> order 1,3,5). AXIS- AND DIRECTION-NEUTRAL scalar algebra: this atom knows nothing about x/y or which tile edge. The consumer places it at any of the four faces by binding the params to the appropriate neighbour gathers on the halo-EXTENDED field (grids/duo/rules/duo_extend), where the 1-D duo-grid alignment makes every interface – interior and tile-seam alike – a uniform interior stencil with no one-sided closure. EAST face of cell i: a_l <- q_{i+l}. WEST face of cell i uses the paper’s mirror gamma^W_l = gamma^E_{-l}: bind a_l <- q_{i-l} (params reversed). NORTH/SOUTH are the same two binding patterns along the y axis. Rational coefficients are emitted as exact integer divisions so every binding evaluates the identical IEEE double. No limiter (this work implements no monotonic filter); Nc = 5, stencil symmetric with reach Ng-1 = 2.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. (Section 3.2, Eqs 16-19 and Tables 1-2: fixed-coefficient polynomial reconstruction to cell-face midpoints.) doi:10.1029/2020MS002280
  • Chen, X., Andronova, N., Van Leer, B., Penner, J. E., Boyd, J. P., Jablonowski, C., & Lin, S.-J. (2018). Toward an unstaggered finite-volume dynamical core with a fast Riemann solver: 1-D linearized analysis of dissipation, dispersion, and noise control. Journal of Advances in Modeling Earth Systems (source of the reconstruction coefficient tables). doi:10.1029/2018MS001361

duo_spherical_angle

op:spherical_angle interior-only (match-less)

Source: grids/duo/stencils/duo_spherical_angle.esm

Parameters: pix, piy, piz, pjx, pjy, pjz, pkx, pky, pkz

acos(min(1, max(-1, (((pjy * piz - pjz * piy) * (pjy * pkz - pjz * pky) + (pjz * pix - pjx * piz) * (pjz * pkx - pjx * pkz) + (pjx * piy - pjy * pix) * (pjx * pky - pjy * pkx)) / (sqrt((pjy * piz - pjz * piy) * (pjy * piz - pjz * piy) + (pjz * pix - pjx * piz) * (pjz * pix - pjx * piz) + (pjx * piy - pjy * pix) * (pjx * piy - pjy * pix)) * sqrt((pjy * pkz - pjz * pky) * (pjy * pkz - pjz * pky) + (pjz * pkx - pjx * pkz) * (pjz * pkx - pjx * pkz) + (pjx * pky - pjy * pkx) * (pjx * pky - pjy * pkx)))))))

The interior angle of a spherical polygon at corner pj, subtended by its two neighbouring corners pi and pk (Chen 2021 B9): acos( (pj x pi).(pj x pk) / (|pj x pi| |pj x pk|) ), i.e. the dihedral angle between the planes of the two great-circle arcs meeting at pj. Nine scalar components in, one scalar out – it carries no axis, index-set or grid knowledge whatsoever, exactly like the axis-neutral scalar atoms under grids/latlon3d/stencils, so grids/duo/grid.esm applies it four times per cell to build the spherical-excess area. The acos argument is CLAMPED to [-1,1] with min/max: for a nearly-degenerate corner the quotient can round to 1+eps, and acos(1+eps) is NaN, which one bad cell would then propagate into every flux divergence downstream. The clamp is inactive wherever the quotient is already in range, i.e. everywhere but round-off – it is a domain guard, not a limiter.

References

duo_tangent_cos

op:metric interior-only (match-less)

Source: grids/duo/stencils/duo_tangent_cos.esm

Parameters: kax, kay, kaz, kbx, kby, kbz, kcx, kcy, kcz

(((kaz * kbx - kax * kbz) * kaz - (kax * kby - kay * kbx) * kay) * ((kaz * kcx - kax * kcz) * kaz - (kax * kcy - kay * kcx) * kay) + ((kax * kby - kay * kbx) * kax - (kay * kbz - kaz * kby) * kaz) * ((kax * kcy - kay * kcx) * kax - (kay * kcz - kaz * kcy) * kaz) + ((kay * kbz - kaz * kby) * kay - (kaz * kbx - kax * kbz) * kax) * ((kay * kcz - kaz * kcy) * kay - (kaz * kcx - kax * kcz) * kax)) / (sqrt(((kaz * kbx - kax * kbz) * kaz - (kax * kby - kay * kbx) * kay) * ((kaz * kbx - kax * kbz) * kaz - (kax * kby - kay * kbx) * kay) + ((kax * kby - kay * kbx) * kax - (kay * kbz - kaz * kby) * kaz) * ((kax * kby - kay * kbx) * kax - (kay * kbz - kaz * kby) * kaz) + ((kay * kbz - kaz * kby) * kay - (kaz * kbx - kax * kbz) * kax) * ((kay * kbz - kaz * kby) * kay - (kaz * kbx - kax * kbz) * kax)) * sqrt(((kaz * kcx - kax * kcz) * kaz - (kax * kcy - kay * kcx) * kay) * ((kaz * kcx - kax * kcz) * kaz - (kax * kcy - kay * kcx) * kay) + ((kax * kcy - kay * kcx) * kax - (kay * kcz - kaz * kcy) * kaz) * ((kax * kcy - kay * kcx) * kax - (kay * kcz - kaz * kcy) * kaz) + ((kay * kcz - kaz * kcy) * kay - (kaz * kcx - kax * kcz) * kax) * ((kay * kcz - kaz * kcy) * kay - (kaz * kcx - kax * kcz) * kax)))

cos of the angle between the two local coordinate directions at a grid point, from the unit-length covariant basis of Chen (2021) C13-C14: given the point ka and its two forward neighbours kb (along the first coordinate) and kc (along the second), e1 ~ (ka x kb) x ka and e2 ~ (ka x kc) x ka, and the result is e1.e2/(|e1||e2|), which is C17. The double cross product is the neighbour PROJECTED INTO THE TANGENT PLANE at ka – deliberately not the chord kb - ka, which is a different vector and yields a different angle (the two agree only to O(h^2): measured 2.9e-3 at N=16, 7.6e-4 at N=32, 1.9e-4 at N=64 on this grid). Because e1 and e2 are normalised, and because (ka x kb) x ka scales uniformly when all three inputs share one magnitude, the sphere radius cancels: any consistent radius may be passed. Nine scalar components in, one out – no axis, index-set or grid knowledge, like the axis-neutral atoms under grids/latlon3d/stencils.

References

duo_upwind

op:upwind order:1 interior-only (match-less)

Source: grids/duo/stencils/duo_upwind.esm

Parameters: ustar, qE, qW

ifelse(ustar > 0, qE, qW)

Chen (2021) Eqs 14-15 upwind donor selection at a cell interface: duo_upwind(ustar, qE, qW) = ifelse(ustar > 0, qE, qW). The LMARS normal velocity u* (duo_lmars_ustar) sets the flow direction; the transported quantity is taken from the UPWIND cell – the left cell’s EAST reconstruction qE when u* > 0, else the right cell’s WEST reconstruction qW. Used for the materially transported variables (depth h, the parallel velocity component, surface geopotential Phi_s); the pressure forcing Pi is NOT upwinded (it goes through the LMARS average+viscous solve instead). The u*=0 tie resolves to qW; it is a measure-zero case and both branches agree in the smooth limit. AXIS- AND DIRECTION-NEUTRAL: a y-interface binds the North/South states and v* verbatim.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

duo_wind_assy_13

op:wind_assy interior-only (match-less)

Source: grids/duo/stencils/duo_wind_assy_13.esm

Parameters: center, ua, va, p1, p2, p3, p4, p5, p6

duo_wind_contra_v<center=center, ua=ua, va=va> * duo_wind_assy_2<p1=p1, p11=center[gt, gi + 3, gj + 3, 3], p12=center[gt, gi + 3, gj + 4, 1], p13=center[gt, gi + 3, gj + 3, 1], p14=center[gt, gi + 3, gj + 4, 3], p15=center[gt, gi + 3, gj + 4, 2], p16=center[gt, gi + 3, gj + 3, 2], p2=p2, p3=p3, p4=p4, p6=p5, p7=p6>

Systematic assembly template of the duo staggered-wind remap, outlined from the generated wind rules by anti-unification (exact-tree verified against the original inline forms). Composes lower assembly levels of the great-circle tangent / cross-product geometry; the name is positional (assembly level 13), pending a semantic identification against Mouallem et al.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_assy_14

op:wind_assy interior-only (match-less)

Source: grids/duo/stencils/duo_wind_assy_14.esm

Parameters: center, ua, va, p1, p2, p3, p4, p5, p6

duo_wind_contra_u<center=center, ua=ua, va=va> * duo_wind_assy_2<p1=p1, p11=center[gt, gi + 3, gj + 3, 3], p12=center[gt, gi + 4, gj + 3, 1], p13=center[gt, gi + 3, gj + 3, 1], p14=center[gt, gi + 4, gj + 3, 3], p15=center[gt, gi + 4, gj + 3, 2], p16=center[gt, gi + 3, gj + 3, 2], p2=p2, p3=p3, p4=p4, p6=p5, p7=p6>

Systematic assembly template of the duo staggered-wind remap, outlined from the generated wind rules by anti-unification (exact-tree verified against the original inline forms). Composes lower assembly levels of the great-circle tangent / cross-product geometry; the name is positional (assembly level 14), pending a semantic identification against Mouallem et al.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_assy_2

op:wind_assy interior-only (match-less)

Source: grids/duo/stencils/duo_wind_assy_2.esm

Parameters: p1, p2, p3, p4, p6, p7, p11, p12, p13, p14, p15, p16

duo_cross_x<a2=p1 * p2 - p3 * p4, a3=p3 * p6 - p7 * p2, b2=p7, b3=p1> / duo_wind_tangent_norm<p1=p11, p2=p12, p3=p13, p4=p14, p5=p15, p6=p16>

Systematic assembly template of the duo staggered-wind remap, outlined from the generated wind rules by anti-unification (exact-tree verified against the original inline forms). Composes lower assembly levels of the great-circle tangent / cross-product geometry; the name is positional (assembly level 2), pending a semantic identification against Mouallem et al.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_assy_3

op:wind_assy interior-only (match-less)

Source: grids/duo/stencils/duo_wind_assy_3.esm

Parameters: center, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10

ifelse(p1 < N + 6, 1, -1) * duo_wind_assy_2<p1=p2, p11=center[gt, gi, gj, 3], p12=p8, p13=center[gt, gi, gj, 1], p14=p9, p15=p10, p16=center[gt, gi, gj, 2], p2=p3, p3=p4, p4=p5, p6=p6, p7=p7>

Systematic assembly template of the duo staggered-wind remap, outlined from the generated wind rules by anti-unification (exact-tree verified against the original inline forms). Composes lower assembly levels of the great-circle tangent / cross-product geometry; the name is positional (assembly level 3), pending a semantic identification against Mouallem et al.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_assy_4

op:wind_assy interior-only (match-less)

Source: grids/duo/stencils/duo_wind_assy_4.esm

Parameters: center, uz, vm, p1, p2, p3, p4

(uz[gt, gi, gj] * 0 + vm[gt, gi, gj] * cos(asin(center[gt, gi, gj, 3] / R_sphere))) * duo_wind_assy_3<center=center, p1=p1, p10=p3, p2=center[gt, gi, gj, 2], p3=p2, p4=center[gt, gi, gj, 3], p5=p3, p6=p4, p7=center[gt, gi, gj, 1], p8=p4, p9=p2>

Systematic assembly template of the duo staggered-wind remap, outlined from the generated wind rules by anti-unification (exact-tree verified against the original inline forms). Composes lower assembly levels of the great-circle tangent / cross-product geometry; the name is positional (assembly level 4), pending a semantic identification against Mouallem et al.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_assy_5

op:wind_assy interior-only (match-less)

Source: grids/duo/stencils/duo_wind_assy_5.esm

Parameters: center, uz, vm, p1, p2, p3, p4

duo_wind_cart_y<center=center, uz=uz, vm=vm> * duo_wind_assy_3<center=center, p1=p1, p10=p2, p2=center[gt, gi, gj, 1], p3=p2, p4=center[gt, gi, gj, 2], p5=p3, p6=p4, p7=center[gt, gi, gj, 3], p8=p3, p9=p4>

Systematic assembly template of the duo staggered-wind remap, outlined from the generated wind rules by anti-unification (exact-tree verified against the original inline forms). Composes lower assembly levels of the great-circle tangent / cross-product geometry; the name is positional (assembly level 5), pending a semantic identification against Mouallem et al.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_assy_6

op:wind_assy interior-only (match-less)

Source: grids/duo/stencils/duo_wind_assy_6.esm

Parameters: center, uz, vm, p1, p2, p3, p4

duo_wind_cart_x<center=center, uz=uz, vm=vm> * duo_wind_assy_3<center=center, p1=p1, p10=p4, p2=center[gt, gi, gj, 3], p3=p2, p4=center[gt, gi, gj, 1], p5=p3, p6=p4, p7=center[gt, gi, gj, 2], p8=p2, p9=p3>

Systematic assembly template of the duo staggered-wind remap, outlined from the generated wind rules by anti-unification (exact-tree verified against the original inline forms). Composes lower assembly levels of the great-circle tangent / cross-product geometry; the name is positional (assembly level 6), pending a semantic identification against Mouallem et al.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_assy_7

op:wind_assy interior-only (match-less)

Source: grids/duo/stencils/duo_wind_assy_7.esm

Parameters: center, p1, p2, p3, p4, p5, p6, p8, p10, p11

duo_wind_assy_2<p1=p1, p11=center[gt, gi + 3, gj + 3, 3], p12=center[gt, gi + 4, gj + 3, 1], p13=center[gt, gi + 3, gj + 3, 1], p14=center[gt, gi + 4, gj + 3, 3], p15=center[gt, gi + 4, gj + 3, 2], p16=center[gt, gi + 3, gj + 3, 2], p2=p2, p3=p3, p4=p4, p6=p5, p7=p6> * duo_wind_assy_2<p1=p1, p11=center[gt, gi + 3, gj + 3, 3], p12=center[gt, gi + 3, gj + 4, 1], p13=center[gt, gi + 3, gj + 3, 1], p14=center[gt, gi + 3, gj + 4, 3], p15=center[gt, gi + 3, gj + 4, 2], p16=center[gt, gi + 3, gj + 3, 2], p2=p8, p3=p3, p4=p10, p6=p11, p7=p6>

Systematic assembly template of the duo staggered-wind remap, outlined from the generated wind rules by anti-unification (exact-tree verified against the original inline forms). Composes lower assembly levels of the great-circle tangent / cross-product geometry; the name is positional (assembly level 7), pending a semantic identification against Mouallem et al.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_basis_cos

op:basis_cos interior-only (match-less)

Source: grids/duo/stencils/duo_wind_basis_cos.esm

Parameters: center

duo_wind_assy_7<center=center, p1=center[gt, gi + 3, gj + 3, 3], p10=center[gt, gi + 3, gj + 4, 3], p11=center[gt, gi + 3, gj + 4, 2], p2=center[gt, gi + 4, gj + 3, 1], p3=center[gt, gi + 3, gj + 3, 1], p4=center[gt, gi + 4, gj + 3, 3], p5=center[gt, gi + 4, gj + 3, 2], p6=center[gt, gi + 3, gj + 3, 2], p8=center[gt, gi + 3, gj + 4, 1]> + duo_wind_assy_7<center=center, p1=center[gt, gi + 3, gj + 3, 1], p10=center[gt, gi + 3, gj + 4, 1], p11=center[gt, gi + 3, gj + 4, 3], p2=center[gt, gi + 4, gj + 3, 2], p3=center[gt, gi + 3, gj + 3, 2], p4=center[gt, gi + 4, gj + 3, 1], p5=center[gt, gi + 4, gj + 3, 3], p6=center[gt, gi + 3, gj + 3, 3], p8=center[gt, gi + 3, gj + 4, 2]> + duo_wind_assy_7<center=center, p1=center[gt, gi + 3, gj + 3, 2], p10=center[gt, gi + 3, gj + 4, 2], p11=center[gt, gi + 3, gj + 4, 1], p2=center[gt, gi + 4, gj + 3, 3], p3=center[gt, gi + 3, gj + 3, 3], p4=center[gt, gi + 4, gj + 3, 2], p5=center[gt, gi + 4, gj + 3, 1], p6=center[gt, gi + 3, gj + 3, 1], p8=center[gt, gi + 3, gj + 4, 3]>

Cosine of the angle between the two coordinate-line unit tangents at a duo point (the non-orthogonality of the gnomonic basis), assembled from duo_wind_assy_7. Appears in the covariant<->contravariant wind solve.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_cart_x

op:wind_rotate interior-only (match-less)

Source: grids/duo/stencils/duo_wind_cart_x.esm

Parameters: center, uz, vm

uz[gt, gi, gj] * (-sin(atan2(center[gt, gi, gj, 2], center[gt, gi, gj, 1]))) + vm[gt, gi, gj] * (-sin(asin(center[gt, gi, gj, 3] / R_sphere)) * cos(atan2(center[gt, gi, gj, 2], center[gt, gi, gj, 1])))

Cartesian X component of the Earth wind (uz, vm) at a duo cell center: X = -uzsin(lambda) - vmsin(theta)*cos(lambda) with lambda = atan2(c2, c1), theta = asin(c3/R_sphere) from the center’s Cartesian coordinates. Zonal/meridional -> Cartesian rotation used by the duo staggered-wind rules.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_cart_y

op:wind_rotate interior-only (match-less)

Source: grids/duo/stencils/duo_wind_cart_y.esm

Parameters: center, uz, vm

uz[gt, gi, gj] * cos(atan2(center[gt, gi, gj, 2], center[gt, gi, gj, 1])) + vm[gt, gi, gj] * (-sin(asin(center[gt, gi, gj, 3] / R_sphere)) * sin(atan2(center[gt, gi, gj, 2], center[gt, gi, gj, 1])))

Cartesian Y component of the Earth wind (uz, vm) at a duo cell center: Y = uzcos(lambda) - vmsin(theta)*sin(lambda) with lambda = atan2(c2, c1), theta = asin(c3/R_sphere) from the center’s Cartesian coordinates. Zonal/meridional -> Cartesian rotation used by the duo staggered-wind rules.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_contra_u

op:wind_solve interior-only (match-less)

Source: grids/duo/stencils/duo_wind_contra_u.esm

Parameters: center, ua, va

duo_wind_cov_resid_u<center=center, ua=ua, va=va> / (1 - duo_wind_basis_cos<center=center> * duo_wind_basis_cos<center=center>)

Contravariant u wind at a duo point: duo_wind_cov_resid_u / (1 - c^2) with c = duo_wind_basis_cos. Output stage of the covariant->contravariant solve in the staggered-wind remap.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_contra_v

op:wind_solve interior-only (match-less)

Source: grids/duo/stencils/duo_wind_contra_v.esm

Parameters: center, ua, va

duo_wind_cov_resid_v<center=center, ua=ua, va=va> / (1 - duo_wind_basis_cos<center=center> * duo_wind_basis_cos<center=center>)

Contravariant v wind at a duo point: duo_wind_cov_resid_v / (1 - c^2) with c = duo_wind_basis_cos. Output stage of the covariant->contravariant solve in the staggered-wind remap.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_cov_resid_u

op:wind_solve interior-only (match-less)

Source: grids/duo/stencils/duo_wind_cov_resid_u.esm

Parameters: center, ua, va

ua[gt, gi, gj] - va[gt, gi, gj] * duo_wind_basis_cos<center=center>

Covariant-solve residual for the u component: (ua - va*c) with c = duo_wind_basis_cos. Intermediate of the duo covariant wind decomposition.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_cov_resid_v

op:wind_solve interior-only (match-less)

Source: grids/duo/stencils/duo_wind_cov_resid_v.esm

Parameters: center, ua, va

va[gt, gi, gj] - ua[gt, gi, gj] * duo_wind_basis_cos<center=center>

Covariant-solve residual for the v component: (va - ua*c) with c = duo_wind_basis_cos. Intermediate of the duo covariant wind decomposition.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_cross_sq

op:cross interior-only (match-less)

Source: grids/duo/stencils/duo_wind_cross_sq.esm

Parameters: p1, p2, p3, p4, p6, p7

duo_cross_x<a2=p1 * p2 - p3 * p4, a3=p3 * p6 - p7 * p2, b2=p7, b3=p1> * duo_cross_x<a2=p1 * p2 - p3 * p4, a3=p3 * p6 - p7 * p2, b2=p7, b3=p1>

Squared norm of the cross product of two node position vectors, assembled from three duo_cross_x components. Normalization factor of the great-circle tangent cross(cross(a,b),a) in the duo staggered-wind remap.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

duo_wind_tangent_norm

op:tangent interior-only (match-less)

Source: grids/duo/stencils/duo_wind_tangent_norm.esm

Parameters: p1, p2, p3, p4, p5, p6

sqrt(duo_wind_cross_sq<p1=p1, p2=p2, p3=p3, p4=p4, p6=p5, p7=p6> + duo_wind_cross_sq<p1=p3, p2=p5, p3=p6, p4=p2, p6=p4, p7=p1> + duo_wind_cross_sq<p1=p6, p2=p4, p3=p1, p4=p5, p6=p2, p7=p3>)

Norm of the great-circle tangent vector cross(cross(a,b),a) between two duo node positions, via duo_wind_cross_sq. Divides the tangent components to produce the unit coordinate-line direction at a face.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel duo-grid in GFDL’s FV3 dynamical core. Journal of Advances in Modeling Earth Systems, 15, e2023MS003712. doi:10.1029/2023MS003712

flux_divergence_duo_g1_interior

op:flux_divergence order:1 stencil width 1 interior-only (match-less)

Source: grids/duo/stencils/flux_divergence_duo_g1_interior.esm

Parameters: dp, ua, va, node, center, cosA, area

sum[gt, gi, gj] ((duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, qW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>> - duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>> * duo_arc_length<ax=node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>>> + (duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 4, gj + 3, 1], by=node[gt, gi + 4, gj + 3, 2], bz=node[gt, gi + 4, gj + 3, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, qW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>> - duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>>>)) / area[gt, gi + 3, gj + 3]) where {gi in x, gj in y, gt in tile}

Per-cell operator for flux_divergence_duo_g1 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule flux_divergence_duo_g1 is a thin makearray wrapper that applies this once. Original: Continuity (mass) tendency dh/dt for the duo gnomonic cubed-sphere shallow-water core, Ng=1 (Nc=1-point volume-mean reconstruction, design order 1). Discretises Chen (2021) Eqs 3-6 exactly as the Zenodo reference sw_full: dp/dt = (fx(i)-fx(i+1)+fy(j)-fy(j+1))/A with the LMARS face mass flux fx = u* * Lx * dp_upwind. u* is the LMARS normal velocity Eq 11 with the wave speed a=1/2(sqrt(dp_L)+sqrt(dp_R)) from CELL depth (the paper’s build default, no inline_cs); the interface states come from raise-then-reconstruct: the contravariant u^1=(ua-cosA va)/sin^2 a (and v^2 on y-faces) is volume-mean reconstructed to the face and multiplied by the face sin(alpha), and dp is reconstructed and upwinded on sign(u*) (Eqs 14-15). Lx/Ly are the great-circle face lengths (duo_arc_length on the corner nodes); A is duo_cell_area; cosA at cells is duo_cos_alpha (node-sourced, spanning the N+6 halo the Ng=3 stencil reaches); face sin(alpha) is duo_tangent_cos at the face. Operates on the halo-EXTENDED prognostic fields (duo_extend output), so a single interior region [tile,x,y] tiles the whole tendency with no boundary stencil. Applied by name from the duo SWE problem. Method-of-lines: this is the pure spatial RHS (no rk2/rk3, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

flux_divergence_duo_g2_interior

op:flux_divergence order:3 stencil width 3 interior-only (match-less)

Source: grids/duo/stencils/flux_divergence_duo_g2_interior.esm

Parameters: dp, ua, va, node, center, cosA, area

sum[gt, gi, gj] ((duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>> - duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>> * duo_arc_length<ax=node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, qW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>> + (duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 4, gj + 3, 1], by=node[gt, gi + 4, gj + 3, 2], bz=node[gt, gi + 4, gj + 3, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>> - duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, qW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>>)) / area[gt, gi + 3, gj + 3]) where {gi in x, gj in y, gt in tile}

Per-cell operator for flux_divergence_duo_g2 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule flux_divergence_duo_g2 is a thin makearray wrapper that applies this once. Original: Continuity (mass) tendency dh/dt for the duo gnomonic cubed-sphere shallow-water core, Ng=2 (Nc=3-point volume-mean reconstruction, design order 3). Discretises Chen (2021) Eqs 3-6 exactly as the Zenodo reference sw_full: dp/dt = (fx(i)-fx(i+1)+fy(j)-fy(j+1))/A with the LMARS face mass flux fx = u* * Lx * dp_upwind. u* is the LMARS normal velocity Eq 11 with the wave speed a=1/2(sqrt(dp_L)+sqrt(dp_R)) from CELL depth (the paper’s build default, no inline_cs); the interface states come from raise-then-reconstruct: the contravariant u^1=(ua-cosA va)/sin^2 a (and v^2 on y-faces) is volume-mean reconstructed to the face and multiplied by the face sin(alpha), and dp is reconstructed and upwinded on sign(u*) (Eqs 14-15). Lx/Ly are the great-circle face lengths (duo_arc_length on the corner nodes); A is duo_cell_area; cosA at cells is duo_cos_alpha (node-sourced, spanning the N+6 halo the Ng=3 stencil reaches); face sin(alpha) is duo_tangent_cos at the face. Operates on the halo-EXTENDED prognostic fields (duo_extend output), so a single interior region [tile,x,y] tiles the whole tendency with no boundary stencil. Applied by name from the duo SWE problem. Method-of-lines: this is the pure spatial RHS (no rk2/rk3, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

flux_divergence_duo_g3_interior

op:flux_divergence order:5 stencil width 5 interior-only (match-less)

Source: grids/duo/stencils/flux_divergence_duo_g3_interior.esm

Parameters: dp, ua, va, node, center, cosA, area

sum[gt, gi, gj] ((duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi, gj + 3], u=ua[gt, gi, gj + 3], v=va[gt, gi, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, qW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi, gj + 3], u=ua[gt, gi, gj + 3], v=va[gt, gi, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>>>> - duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 6, gj + 3], u=ua[gt, gi + 6, gj + 3], v=va[gt, gi + 6, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>> * duo_arc_length<ax=node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, qW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 6, gj + 3], u=ua[gt, gi + 6, gj + 3], v=va[gt, gi + 6, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>> + (duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj], u=va[gt, gi + 3, gj], v=ua[gt, gi + 3, gj]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 4, gj + 3, 1], by=node[gt, gi + 4, gj + 3, 2], bz=node[gt, gi + 4, gj + 3, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, qW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj], u=va[gt, gi + 3, gj], v=ua[gt, gi + 3, gj]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>>>> - duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 6], u=va[gt, gi + 3, gj + 6], v=ua[gt, gi + 3, gj + 6]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * duo_upwind<qE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, qW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 6], u=va[gt, gi + 3, gj + 6], v=ua[gt, gi + 3, gj + 6]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>>)) / area[gt, gi + 3, gj + 3]) where {gi in x, gj in y, gt in tile}

Per-cell operator for flux_divergence_duo_g3 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule flux_divergence_duo_g3 is a thin makearray wrapper that applies this once. Original: Continuity (mass) tendency dh/dt for the duo gnomonic cubed-sphere shallow-water core, Ng=3 (Nc=5-point volume-mean reconstruction, design order 5). Discretises Chen (2021) Eqs 3-6 exactly as the Zenodo reference sw_full: dp/dt = (fx(i)-fx(i+1)+fy(j)-fy(j+1))/A with the LMARS face mass flux fx = u* * Lx * dp_upwind. u* is the LMARS normal velocity Eq 11 with the wave speed a=1/2(sqrt(dp_L)+sqrt(dp_R)) from CELL depth (the paper’s build default, no inline_cs); the interface states come from raise-then-reconstruct: the contravariant u^1=(ua-cosA va)/sin^2 a (and v^2 on y-faces) is volume-mean reconstructed to the face and multiplied by the face sin(alpha), and dp is reconstructed and upwinded on sign(u*) (Eqs 14-15). Lx/Ly are the great-circle face lengths (duo_arc_length on the corner nodes); A is duo_cell_area; cosA at cells is duo_cos_alpha (node-sourced, spanning the N+6 halo the Ng=3 stencil reaches); face sin(alpha) is duo_tangent_cos at the face. Operates on the halo-EXTENDED prognostic fields (duo_extend output), so a single interior region [tile,x,y] tiles the whole tendency with no boundary stencil. Applied by name from the duo SWE problem. Method-of-lines: this is the pure spatial RHS (no rk2/rk3, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

momentum_u_duo_g1_interior

op:momentum_u order:1 interior-only (match-less)

Source: grids/duo/stencils/momentum_u_duo_g1_interior.esm

Parameters: dp, ua, va, node, center, cosA, area, f

sum[gt, gi, gj] (duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]> * sqrt(1 - cosA[gt, gi + 3, gj + 3] * cosA[gt, gi + 3, gj + 3]) * ((duo_upwind<qE=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 2]>, qW=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 4, gj + 3, 1], by=node[gt, gi + 4, gj + 3, 2], bz=node[gt, gi + 4, gj + 3, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g1<a0=va[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g1<a0=va[gt, gi + 4, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> - (duo_upwind<qE=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 4]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g1<a0=va[gt, gi + 2, gj + 3]>, qW=duo_recon_vm_g1<a0=va[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3], radius=R_sphere>)) / area[gt, gi + 3, gj + 3] + f[gt, gi, gj]) + (duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g1<a0=va[gt, gi + 2, gj + 3]>, qW=duo_recon_vm_g1<a0=va[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>> - duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g1<a0=va[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g1<a0=va[gt, gi + 4, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>>>) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for momentum_u_duo_g1 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule momentum_u_duo_g1 is a thin makearray wrapper that applies this once. Original: Vector-invariant momentum tendency for the covariant u-wind, duo gnomonic cubed-sphere SWE core, Ng=1, WITHOUT the pressure gradient (added by a separate pgrad__u rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: du/dt = +(v^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dx. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dx is the great-circle arc between the two x-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

momentum_u_duo_g2_interior

op:momentum_u order:3 interior-only (match-less)

Source: grids/duo/stencils/momentum_u_duo_g2_interior.esm

Parameters: dp, ua, va, node, center, cosA, area, f

sum[gt, gi, gj] (duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]> * sqrt(1 - cosA[gt, gi + 3, gj + 3] * cosA[gt, gi + 3, gj + 3]) * ((duo_upwind<qE=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 2], am1=ua[gt, gi + 3, gj + 1], ap1=ua[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 4], ap1=ua[gt, gi + 3, gj + 2]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 4, gj + 3, 1], by=node[gt, gi + 4, gj + 3, 2], bz=node[gt, gi + 4, gj + 3, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g2<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 2, gj + 3], ap1=va[gt, gi + 4, gj + 3]>, qW=duo_recon_vm_g2<a0=va[gt, gi + 4, gj + 3], am1=va[gt, gi + 5, gj + 3], ap1=va[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> - (duo_upwind<qE=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 2], ap1=ua[gt, gi + 3, gj + 4]>, qW=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 4], am1=ua[gt, gi + 3, gj + 5], ap1=ua[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g2<a0=va[gt, gi + 2, gj + 3], am1=va[gt, gi + 1, gj + 3], ap1=va[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g2<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 4, gj + 3], ap1=va[gt, gi + 2, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3], radius=R_sphere>)) / area[gt, gi + 3, gj + 3] + f[gt, gi, gj]) + (duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g2<a0=va[gt, gi + 2, gj + 3], am1=va[gt, gi + 1, gj + 3], ap1=va[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g2<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 4, gj + 3], ap1=va[gt, gi + 2, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>> - duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g2<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 2, gj + 3], ap1=va[gt, gi + 4, gj + 3]>, qW=duo_recon_vm_g2<a0=va[gt, gi + 4, gj + 3], am1=va[gt, gi + 5, gj + 3], ap1=va[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>>) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for momentum_u_duo_g2 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule momentum_u_duo_g2 is a thin makearray wrapper that applies this once. Original: Vector-invariant momentum tendency for the covariant u-wind, duo gnomonic cubed-sphere SWE core, Ng=2, WITHOUT the pressure gradient (added by a separate pgrad__u rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: du/dt = +(v^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dx. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dx is the great-circle arc between the two x-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

momentum_u_duo_g3_interior

op:momentum_u order:5 interior-only (match-less)

Source: grids/duo/stencils/momentum_u_duo_g3_interior.esm

Parameters: dp, ua, va, node, center, cosA, area, f

sum[gt, gi, gj] (duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]> * sqrt(1 - cosA[gt, gi + 3, gj + 3] * cosA[gt, gi + 3, gj + 3]) * ((duo_upwind<qE=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 2], am1=ua[gt, gi + 3, gj + 1], am2=ua[gt, gi + 3, gj], ap1=ua[gt, gi + 3, gj + 3], ap2=ua[gt, gi + 3, gj + 4]>, qW=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 4], am2=ua[gt, gi + 3, gj + 5], ap1=ua[gt, gi + 3, gj + 2], ap2=ua[gt, gi + 3, gj + 1]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj], u=va[gt, gi + 3, gj], v=ua[gt, gi + 3, gj]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 4, gj + 3, 1], by=node[gt, gi + 4, gj + 3, 2], bz=node[gt, gi + 4, gj + 3, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g3<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 2, gj + 3], am2=va[gt, gi + 1, gj + 3], ap1=va[gt, gi + 4, gj + 3], ap2=va[gt, gi + 5, gj + 3]>, qW=duo_recon_vm_g3<a0=va[gt, gi + 4, gj + 3], am1=va[gt, gi + 5, gj + 3], am2=va[gt, gi + 6, gj + 3], ap1=va[gt, gi + 3, gj + 3], ap2=va[gt, gi + 2, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 6, gj + 3], u=ua[gt, gi + 6, gj + 3], v=va[gt, gi + 6, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> - (duo_upwind<qE=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 2], am2=ua[gt, gi + 3, gj + 1], ap1=ua[gt, gi + 3, gj + 4], ap2=ua[gt, gi + 3, gj + 5]>, qW=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 4], am1=ua[gt, gi + 3, gj + 5], am2=ua[gt, gi + 3, gj + 6], ap1=ua[gt, gi + 3, gj + 3], ap2=ua[gt, gi + 3, gj + 2]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 6], u=va[gt, gi + 3, gj + 6], v=ua[gt, gi + 3, gj + 6]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g3<a0=va[gt, gi + 2, gj + 3], am1=va[gt, gi + 1, gj + 3], am2=va[gt, gi, gj + 3], ap1=va[gt, gi + 3, gj + 3], ap2=va[gt, gi + 4, gj + 3]>, qW=duo_recon_vm_g3<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 4, gj + 3], am2=va[gt, gi + 5, gj + 3], ap1=va[gt, gi + 2, gj + 3], ap2=va[gt, gi + 1, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi, gj + 3], u=ua[gt, gi, gj + 3], v=va[gt, gi, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3], radius=R_sphere>)) / area[gt, gi + 3, gj + 3] + f[gt, gi, gj]) + (duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g3<a0=va[gt, gi + 2, gj + 3], am1=va[gt, gi + 1, gj + 3], am2=va[gt, gi, gj + 3], ap1=va[gt, gi + 3, gj + 3], ap2=va[gt, gi + 4, gj + 3]>, qW=duo_recon_vm_g3<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 4, gj + 3], am2=va[gt, gi + 5, gj + 3], ap1=va[gt, gi + 2, gj + 3], ap2=va[gt, gi + 1, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi, gj + 3], u=ua[gt, gi, gj + 3], v=va[gt, gi, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi, gj + 3], u=ua[gt, gi, gj + 3], v=va[gt, gi, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>>>> - duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g3<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 2, gj + 3], am2=va[gt, gi + 1, gj + 3], ap1=va[gt, gi + 4, gj + 3], ap2=va[gt, gi + 5, gj + 3]>, qW=duo_recon_vm_g3<a0=va[gt, gi + 4, gj + 3], am1=va[gt, gi + 5, gj + 3], am2=va[gt, gi + 6, gj + 3], ap1=va[gt, gi + 3, gj + 3], ap2=va[gt, gi + 2, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 6, gj + 3], u=ua[gt, gi + 6, gj + 3], v=va[gt, gi + 6, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 6, gj + 3], u=ua[gt, gi + 6, gj + 3], v=va[gt, gi + 6, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>>) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for momentum_u_duo_g3 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule momentum_u_duo_g3 is a thin makearray wrapper that applies this once. Original: Vector-invariant momentum tendency for the covariant u-wind, duo gnomonic cubed-sphere SWE core, Ng=3, WITHOUT the pressure gradient (added by a separate pgrad__u rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: du/dt = +(v^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dx. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dx is the great-circle arc between the two x-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

momentum_v_duo_g1_interior

op:momentum_v order:1 interior-only (match-less)

Source: grids/duo/stencils/momentum_v_duo_g1_interior.esm

Parameters: dp, ua, va, node, center, cosA, area, f

sum[gt, gi, gj] (-1 * duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]> * sqrt(1 - cosA[gt, gi + 3, gj + 3] * cosA[gt, gi + 3, gj + 3]) * ((duo_upwind<qE=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 2]>, qW=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 4, gj + 3, 1], by=node[gt, gi + 4, gj + 3, 2], bz=node[gt, gi + 4, gj + 3, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g1<a0=va[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g1<a0=va[gt, gi + 4, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> - (duo_upwind<qE=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 4]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g1<a0=va[gt, gi + 2, gj + 3]>, qW=duo_recon_vm_g1<a0=va[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3], radius=R_sphere>)) / area[gt, gi + 3, gj + 3] + f[gt, gi, gj]) + (duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 2]>, qW=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>> - duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g1<a0=ua[gt, gi + 3, gj + 4]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>>>) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for momentum_v_duo_g1 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule momentum_v_duo_g1 is a thin makearray wrapper that applies this once. Original: Vector-invariant momentum tendency for the covariant v-wind, duo gnomonic cubed-sphere SWE core, Ng=1, WITHOUT the pressure gradient (added by a separate pgrad__v rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: dv/dt = -(u^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dy. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dy is the great-circle arc between the two y-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

momentum_v_duo_g2_interior

op:momentum_v order:3 interior-only (match-less)

Source: grids/duo/stencils/momentum_v_duo_g2_interior.esm

Parameters: dp, ua, va, node, center, cosA, area, f

sum[gt, gi, gj] (-1 * duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]> * sqrt(1 - cosA[gt, gi + 3, gj + 3] * cosA[gt, gi + 3, gj + 3]) * ((duo_upwind<qE=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 2], am1=ua[gt, gi + 3, gj + 1], ap1=ua[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 4], ap1=ua[gt, gi + 3, gj + 2]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 4, gj + 3, 1], by=node[gt, gi + 4, gj + 3, 2], bz=node[gt, gi + 4, gj + 3, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g2<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 2, gj + 3], ap1=va[gt, gi + 4, gj + 3]>, qW=duo_recon_vm_g2<a0=va[gt, gi + 4, gj + 3], am1=va[gt, gi + 5, gj + 3], ap1=va[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> - (duo_upwind<qE=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 2], ap1=ua[gt, gi + 3, gj + 4]>, qW=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 4], am1=ua[gt, gi + 3, gj + 5], ap1=ua[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g2<a0=va[gt, gi + 2, gj + 3], am1=va[gt, gi + 1, gj + 3], ap1=va[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g2<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 4, gj + 3], ap1=va[gt, gi + 2, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3], radius=R_sphere>)) / area[gt, gi + 3, gj + 3] + f[gt, gi, gj]) + (duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 2], am1=ua[gt, gi + 3, gj + 1], ap1=ua[gt, gi + 3, gj + 3]>, qW=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 4], ap1=ua[gt, gi + 3, gj + 2]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>> - duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 2], ap1=ua[gt, gi + 3, gj + 4]>, qW=duo_recon_vm_g2<a0=ua[gt, gi + 3, gj + 4], am1=ua[gt, gi + 3, gj + 5], ap1=ua[gt, gi + 3, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>>) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for momentum_v_duo_g2 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule momentum_v_duo_g2 is a thin makearray wrapper that applies this once. Original: Vector-invariant momentum tendency for the covariant v-wind, duo gnomonic cubed-sphere SWE core, Ng=2, WITHOUT the pressure gradient (added by a separate pgrad__v rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: dv/dt = -(u^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dy. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dy is the great-circle arc between the two y-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

momentum_v_duo_g3_interior

op:momentum_v order:5 interior-only (match-less)

Source: grids/duo/stencils/momentum_v_duo_g3_interior.esm

Parameters: dp, ua, va, node, center, cosA, area, f

sum[gt, gi, gj] (-1 * duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]> * sqrt(1 - cosA[gt, gi + 3, gj + 3] * cosA[gt, gi + 3, gj + 3]) * ((duo_upwind<qE=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 2], am1=ua[gt, gi + 3, gj + 1], am2=ua[gt, gi + 3, gj], ap1=ua[gt, gi + 3, gj + 3], ap2=ua[gt, gi + 3, gj + 4]>, qW=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 4], am2=ua[gt, gi + 3, gj + 5], ap1=ua[gt, gi + 3, gj + 2], ap2=ua[gt, gi + 3, gj + 1]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj], u=va[gt, gi + 3, gj], v=ua[gt, gi + 3, gj]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 4, gj + 3, 1], by=node[gt, gi + 4, gj + 3, 2], bz=node[gt, gi + 4, gj + 3, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g3<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 2, gj + 3], am2=va[gt, gi + 1, gj + 3], ap1=va[gt, gi + 4, gj + 3], ap2=va[gt, gi + 5, gj + 3]>, qW=duo_recon_vm_g3<a0=va[gt, gi + 4, gj + 3], am1=va[gt, gi + 5, gj + 3], am2=va[gt, gi + 6, gj + 3], ap1=va[gt, gi + 3, gj + 3], ap2=va[gt, gi + 2, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 6, gj + 3], u=ua[gt, gi + 6, gj + 3], v=va[gt, gi + 6, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> - (duo_upwind<qE=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 2], am2=ua[gt, gi + 3, gj + 1], ap1=ua[gt, gi + 3, gj + 4], ap2=ua[gt, gi + 3, gj + 5]>, qW=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 4], am1=ua[gt, gi + 3, gj + 5], am2=ua[gt, gi + 3, gj + 6], ap1=ua[gt, gi + 3, gj + 3], ap2=ua[gt, gi + 3, gj + 2]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 6], u=va[gt, gi + 3, gj + 6], v=ua[gt, gi + 3, gj + 6]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 4, 3], radius=R_sphere> + duo_upwind<qE=duo_recon_vm_g3<a0=va[gt, gi + 2, gj + 3], am1=va[gt, gi + 1, gj + 3], am2=va[gt, gi, gj + 3], ap1=va[gt, gi + 3, gj + 3], ap2=va[gt, gi + 4, gj + 3]>, qW=duo_recon_vm_g3<a0=va[gt, gi + 3, gj + 3], am1=va[gt, gi + 4, gj + 3], am2=va[gt, gi + 5, gj + 3], ap1=va[gt, gi + 2, gj + 3], ap2=va[gt, gi + 1, gj + 3]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi, gj + 3], u=ua[gt, gi, gj + 3], v=va[gt, gi, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>>>> * duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3], radius=R_sphere>)) / area[gt, gi + 3, gj + 3] + f[gt, gi, gj]) + (duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 2], am1=ua[gt, gi + 3, gj + 1], am2=ua[gt, gi + 3, gj], ap1=ua[gt, gi + 3, gj + 3], ap2=ua[gt, gi + 3, gj + 4]>, qW=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 4], am2=ua[gt, gi + 3, gj + 5], ap1=ua[gt, gi + 3, gj + 2], ap2=ua[gt, gi + 3, gj + 1]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj], u=va[gt, gi + 3, gj], v=ua[gt, gi + 3, gj]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj], u=va[gt, gi + 3, gj], v=ua[gt, gi + 3, gj]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>>>> - duo_ke_orthogonal<up=duo_upwind<qE=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 3], am1=ua[gt, gi + 3, gj + 2], am2=ua[gt, gi + 3, gj + 1], ap1=ua[gt, gi + 3, gj + 4], ap2=ua[gt, gi + 3, gj + 5]>, qW=duo_recon_vm_g3<a0=ua[gt, gi + 3, gj + 4], am1=ua[gt, gi + 3, gj + 5], am2=ua[gt, gi + 3, gj + 6], ap1=ua[gt, gi + 3, gj + 3], ap2=ua[gt, gi + 3, gj + 2]>, ustar=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 6], u=va[gt, gi + 3, gj + 6], v=ua[gt, gi + 3, gj + 6]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>>, ut=duo_lmars_ustar_a<a=duo_lmars_a<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4]>, piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>, uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 6], u=va[gt, gi + 3, gj + 6], v=ua[gt, gi + 3, gj + 6]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>>) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for momentum_v_duo_g3 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule momentum_v_duo_g3 is a thin makearray wrapper that applies this once. Original: Vector-invariant momentum tendency for the covariant v-wind, duo gnomonic cubed-sphere SWE core, Ng=3, WITHOUT the pressure gradient (added by a separate pgrad__v rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: dv/dt = -(u^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dy. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dy is the great-circle arc between the two y-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_direct_u_duo_g1_interior

op:pgrad_direct_u order:1 interior-only (match-less)

Source: grids/duo/stencils/pgrad_direct_u_duo_g1_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] ((duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>> + duo_lmars_pivis<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>> - (duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>> + duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 4, gj + 3]>>)) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_direct_u_duo_g1 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_direct_u_duo_g1 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=1. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g1 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_direct_u_duo_g2_interior

op:pgrad_direct_u order:3 interior-only (match-less)

Source: grids/duo/stencils/pgrad_direct_u_duo_g2_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] ((duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>> + duo_lmars_pivis<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 2, gj + 3], am1=phis[gt, gi + 1, gj + 3], ap1=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 4, gj + 3], ap1=phis[gt, gi + 2, gj + 3]>> - (duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>> + duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 2, gj + 3], ap1=phis[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 4, gj + 3], am1=phis[gt, gi + 5, gj + 3], ap1=phis[gt, gi + 3, gj + 3]>>)) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_direct_u_duo_g2 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_direct_u_duo_g2 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=2. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g2 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_direct_u_duo_g3_interior

op:pgrad_direct_u order:5 interior-only (match-less)

Source: grids/duo/stencils/pgrad_direct_u_duo_g3_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] ((duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>> + duo_lmars_pivis<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi, gj + 3], u=ua[gt, gi, gj + 3], v=va[gt, gi, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 2, gj + 3], am1=phis[gt, gi + 1, gj + 3], am2=phis[gt, gi, gj + 3], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 4, gj + 3], am2=phis[gt, gi + 5, gj + 3], ap1=phis[gt, gi + 2, gj + 3], ap2=phis[gt, gi + 1, gj + 3]>> - (duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>> + duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 6, gj + 3], u=ua[gt, gi + 6, gj + 3], v=va[gt, gi + 6, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 2, gj + 3], am2=phis[gt, gi + 1, gj + 3], ap1=phis[gt, gi + 4, gj + 3], ap2=phis[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 4, gj + 3], am1=phis[gt, gi + 5, gj + 3], am2=phis[gt, gi + 6, gj + 3], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 2, gj + 3]>>)) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_direct_u_duo_g3 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_direct_u_duo_g3 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=3. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g3 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_direct_v_duo_g1_interior

op:pgrad_direct_v order:1 interior-only (match-less)

Source: grids/duo/stencils/pgrad_direct_v_duo_g1_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] ((duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>> + duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>> - (duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>> + duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 4]>>)) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_direct_v_duo_g1 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_direct_v_duo_g1 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=1. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g1 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_direct_v_duo_g2_interior

op:pgrad_direct_v order:3 interior-only (match-less)

Source: grids/duo/stencils/pgrad_direct_v_duo_g2_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] ((duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>> + duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 2], am1=phis[gt, gi + 3, gj + 1], ap1=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 4], ap1=phis[gt, gi + 3, gj + 2]>> - (duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>> + duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 2], ap1=phis[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 4], am1=phis[gt, gi + 3, gj + 5], ap1=phis[gt, gi + 3, gj + 3]>>)) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_direct_v_duo_g2 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_direct_v_duo_g2 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=2. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g2 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_direct_v_duo_g3_interior

op:pgrad_direct_v order:5 interior-only (match-less)

Source: grids/duo/stencils/pgrad_direct_v_duo_g3_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] ((duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>> + duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj], u=va[gt, gi + 3, gj], v=ua[gt, gi + 3, gj]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 2], am1=phis[gt, gi + 3, gj + 1], am2=phis[gt, gi + 3, gj], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 4], am2=phis[gt, gi + 3, gj + 5], ap1=phis[gt, gi + 3, gj + 2], ap2=phis[gt, gi + 3, gj + 1]>> - (duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>> + duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 6], u=va[gt, gi + 3, gj + 6], v=ua[gt, gi + 3, gj + 6]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 2], am2=phis[gt, gi + 3, gj + 1], ap1=phis[gt, gi + 3, gj + 4], ap2=phis[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 4], am1=phis[gt, gi + 3, gj + 5], am2=phis[gt, gi + 3, gj + 6], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 3, gj + 2]>>)) * (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere>)) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_direct_v_duo_g3 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_direct_v_duo_g3 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=3. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g3 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_l97_u_duo_g1_interior

op:pgrad_l97_u order:1 interior-only (match-less)

Source: grids/duo/stencils/pgrad_l97_u_duo_g1_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * (((duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>> - (duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 4, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>>)) * duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>> + (duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>> - duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 4, gj + 3]>>) * duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>>) / (duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>>)) + 1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * ((duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 2, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>> * duo_lmars_pivis<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>> - duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 4, gj + 3]>> * duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>>) / dp[gt, gi + 3, gj + 3])) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_l97_u_duo_g1 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_l97_u_duo_g1 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=1. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g1 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_l97_u_duo_g2_interior

op:pgrad_l97_u order:3 interior-only (match-less)

Source: grids/duo/stencils/pgrad_l97_u_duo_g2_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * (((duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 2, gj + 3], am1=phis[gt, gi + 1, gj + 3], ap1=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 4, gj + 3], ap1=phis[gt, gi + 2, gj + 3]>> - (duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 2, gj + 3], ap1=phis[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 4, gj + 3], am1=phis[gt, gi + 5, gj + 3], ap1=phis[gt, gi + 3, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>>)) * duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>> + (duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 2, gj + 3], am1=phis[gt, gi + 1, gj + 3], ap1=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 4, gj + 3], ap1=phis[gt, gi + 2, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>> - duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 2, gj + 3], ap1=phis[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 4, gj + 3], am1=phis[gt, gi + 5, gj + 3], ap1=phis[gt, gi + 3, gj + 3]>>) * duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>>) / (duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>>)) + 1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * ((duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], ap1=dp[gt, gi + 2, gj + 3]>> * duo_lmars_pivis<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>> - duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], ap1=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 3, gj + 3]>> * duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>>>) / dp[gt, gi + 3, gj + 3])) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_l97_u_duo_g2 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_l97_u_duo_g2 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=2. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g2 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_l97_u_duo_g3_interior

op:pgrad_l97_u order:5 interior-only (match-less)

Source: grids/duo/stencils/pgrad_l97_u_duo_g3_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * (((duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 2, gj + 3], am1=phis[gt, gi + 1, gj + 3], am2=phis[gt, gi, gj + 3], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 4, gj + 3], am2=phis[gt, gi + 5, gj + 3], ap1=phis[gt, gi + 2, gj + 3], ap2=phis[gt, gi + 1, gj + 3]>> - (duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 2, gj + 3], am2=phis[gt, gi + 1, gj + 3], ap1=phis[gt, gi + 4, gj + 3], ap2=phis[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 4, gj + 3], am1=phis[gt, gi + 5, gj + 3], am2=phis[gt, gi + 6, gj + 3], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 2, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>>)) * duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>> + (duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 2, gj + 3], am1=phis[gt, gi + 1, gj + 3], am2=phis[gt, gi, gj + 3], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 4, gj + 3], am2=phis[gt, gi + 5, gj + 3], ap1=phis[gt, gi + 2, gj + 3], ap2=phis[gt, gi + 1, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>> - duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 2, gj + 3], am2=phis[gt, gi + 1, gj + 3], ap1=phis[gt, gi + 4, gj + 3], ap2=phis[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 4, gj + 3], am1=phis[gt, gi + 5, gj + 3], am2=phis[gt, gi + 6, gj + 3], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 2, gj + 3]>>) * duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>>) / (duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>>)) + 1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], bx=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * ((duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 2, gj + 3], am1=dp[gt, gi + 1, gj + 3], am2=dp[gt, gi, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 4, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 4, gj + 3], am2=dp[gt, gi + 5, gj + 3], ap1=dp[gt, gi + 2, gj + 3], ap2=dp[gt, gi + 1, gj + 3]>> * duo_lmars_pivis<piE=dp[gt, gi + 2, gj + 3], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi, gj + 3], u=ua[gt, gi, gj + 3], v=va[gt, gi, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 3, gj + 4, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 3, gj + 4, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 3, gj + 4, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 3, gj + 4, 1], kcy=node[gt, gi + 3, gj + 4, 2], kcz=node[gt, gi + 3, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>>> - duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 2, gj + 3], am2=dp[gt, gi + 1, gj + 3], ap1=dp[gt, gi + 4, gj + 3], ap2=dp[gt, gi + 5, gj + 3]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 4, gj + 3], am1=dp[gt, gi + 5, gj + 3], am2=dp[gt, gi + 6, gj + 3], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 2, gj + 3]>> * duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 4, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 1, gj + 3], u=ua[gt, gi + 1, gj + 3], v=va[gt, gi + 1, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 4, gj + 3, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 4, gj + 3, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 4, gj + 3, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 4, gj + 3, 1], kby=center[gt, gi + 4, gj + 3, 2], kbz=center[gt, gi + 4, gj + 3, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 4, gj + 3], u=ua[gt, gi + 4, gj + 3], v=va[gt, gi + 4, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 5, gj + 3], u=ua[gt, gi + 5, gj + 3], v=va[gt, gi + 5, gj + 3]>, am2=duo_contravariant<cosA=cosA[gt, gi + 6, gj + 3], u=ua[gt, gi + 6, gj + 3], v=va[gt, gi + 6, gj + 3]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=ua[gt, gi + 3, gj + 3], v=va[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 2, gj + 3], u=ua[gt, gi + 2, gj + 3], v=va[gt, gi + 2, gj + 3]>>>) / dp[gt, gi + 3, gj + 3])) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_l97_u_duo_g3 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_l97_u_duo_g3 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=3. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g3 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_l97_v_duo_g1_interior

op:pgrad_l97_v order:1 interior-only (match-less)

Source: grids/duo/stencils/pgrad_l97_v_duo_g1_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * (((duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>> - (duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 4]>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>>)) * duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>> + (duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>> - duo_lmars_pibar<piE=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=phis[gt, gi + 3, gj + 4]>>) * duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>>) / (duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>>)) + 1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * ((duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 2]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>> * duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>> - duo_lmars_pibar<piE=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g1<a0=dp[gt, gi + 3, gj + 4]>> * duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g1<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>>) / dp[gt, gi + 3, gj + 3])) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_l97_v_duo_g1 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_l97_v_duo_g1 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=1. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g1 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_l97_v_duo_g2_interior

op:pgrad_l97_v order:3 interior-only (match-less)

Source: grids/duo/stencils/pgrad_l97_v_duo_g2_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * (((duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 2], am1=phis[gt, gi + 3, gj + 1], ap1=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 4], ap1=phis[gt, gi + 3, gj + 2]>> - (duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 2], ap1=phis[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 4], am1=phis[gt, gi + 3, gj + 5], ap1=phis[gt, gi + 3, gj + 3]>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>>)) * duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>> + (duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 2], am1=phis[gt, gi + 3, gj + 1], ap1=phis[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 4], ap1=phis[gt, gi + 3, gj + 2]>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>> - duo_lmars_pibar<piE=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 2], ap1=phis[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=phis[gt, gi + 3, gj + 4], am1=phis[gt, gi + 3, gj + 5], ap1=phis[gt, gi + 3, gj + 3]>>) * duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>>) / (duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>> + duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>>)) + 1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * ((duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 3]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], ap1=dp[gt, gi + 3, gj + 2]>> * duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>> - duo_lmars_pibar<piE=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], ap1=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g2<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 3]>> * duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g2<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>>>) / dp[gt, gi + 3, gj + 3])) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_l97_v_duo_g2 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_l97_v_duo_g2 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=2. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g2 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

pgrad_l97_v_duo_g3_interior

op:pgrad_l97_v order:5 interior-only (match-less)

Source: grids/duo/stencils/pgrad_l97_v_duo_g3_interior.esm

Parameters: dp, ua, va, node, center, cosA, phis

sum[gt, gi, gj] (1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * (((duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 2], am1=phis[gt, gi + 3, gj + 1], am2=phis[gt, gi + 3, gj], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 4], am2=phis[gt, gi + 3, gj + 5], ap1=phis[gt, gi + 3, gj + 2], ap2=phis[gt, gi + 3, gj + 1]>> - (duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 2], am2=phis[gt, gi + 3, gj + 1], ap1=phis[gt, gi + 3, gj + 4], ap2=phis[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 4], am1=phis[gt, gi + 3, gj + 5], am2=phis[gt, gi + 3, gj + 6], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 3, gj + 2]>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>>)) * duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>> + (duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 2], am1=phis[gt, gi + 3, gj + 1], am2=phis[gt, gi + 3, gj], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 4], am2=phis[gt, gi + 3, gj + 5], ap1=phis[gt, gi + 3, gj + 2], ap2=phis[gt, gi + 3, gj + 1]>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>> - duo_lmars_pibar<piE=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 3], am1=phis[gt, gi + 3, gj + 2], am2=phis[gt, gi + 3, gj + 1], ap1=phis[gt, gi + 3, gj + 4], ap2=phis[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=phis[gt, gi + 3, gj + 4], am1=phis[gt, gi + 3, gj + 5], am2=phis[gt, gi + 3, gj + 6], ap1=phis[gt, gi + 3, gj + 3], ap2=phis[gt, gi + 3, gj + 2]>>) * duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>>) / (duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>> + duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>>)) + 1 / duo_arc_length<ax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], ay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], az=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], bx=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], by=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], bz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], radius=R_sphere> * ((duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 2], am1=dp[gt, gi + 3, gj + 1], am2=dp[gt, gi + 3, gj], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 4]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 4], am2=dp[gt, gi + 3, gj + 5], ap1=dp[gt, gi + 3, gj + 2], ap2=dp[gt, gi + 3, gj + 1]>> * duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 2], piW=dp[gt, gi + 3, gj + 3], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj], u=va[gt, gi + 3, gj], v=ua[gt, gi + 3, gj]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 3, 1] + node[gt, gi + 4, gj + 3, 1], kay=node[gt, gi + 3, gj + 3, 2] + node[gt, gi + 4, gj + 3, 2], kaz=node[gt, gi + 3, gj + 3, 3] + node[gt, gi + 4, gj + 3, 3], kbx=center[gt, gi + 3, gj + 3, 1], kby=center[gt, gi + 3, gj + 3, 2], kbz=center[gt, gi + 3, gj + 3, 3], kcx=node[gt, gi + 4, gj + 3, 1], kcy=node[gt, gi + 4, gj + 3, 2], kcz=node[gt, gi + 4, gj + 3, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>>> - duo_lmars_pibar<piE=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 3], am1=dp[gt, gi + 3, gj + 2], am2=dp[gt, gi + 3, gj + 1], ap1=dp[gt, gi + 3, gj + 4], ap2=dp[gt, gi + 3, gj + 5]>, piW=duo_recon_vm_g3<a0=dp[gt, gi + 3, gj + 4], am1=dp[gt, gi + 3, gj + 5], am2=dp[gt, gi + 3, gj + 6], ap1=dp[gt, gi + 3, gj + 3], ap2=dp[gt, gi + 3, gj + 2]>> * duo_lmars_pivis<piE=dp[gt, gi + 3, gj + 3], piW=dp[gt, gi + 3, gj + 4], uE=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 1], u=va[gt, gi + 3, gj + 1], v=ua[gt, gi + 3, gj + 1]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>>, uW=sqrt(1 - duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]> * duo_tangent_cos<kax=node[gt, gi + 3, gj + 4, 1] + node[gt, gi + 4, gj + 4, 1], kay=node[gt, gi + 3, gj + 4, 2] + node[gt, gi + 4, gj + 4, 2], kaz=node[gt, gi + 3, gj + 4, 3] + node[gt, gi + 4, gj + 4, 3], kbx=center[gt, gi + 3, gj + 4, 1], kby=center[gt, gi + 3, gj + 4, 2], kbz=center[gt, gi + 3, gj + 4, 3], kcx=node[gt, gi + 4, gj + 4, 1], kcy=node[gt, gi + 4, gj + 4, 2], kcz=node[gt, gi + 4, gj + 4, 3]>) * duo_recon_vm_g3<a0=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 4], u=va[gt, gi + 3, gj + 4], v=ua[gt, gi + 3, gj + 4]>, am1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 5], u=va[gt, gi + 3, gj + 5], v=ua[gt, gi + 3, gj + 5]>, am2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 6], u=va[gt, gi + 3, gj + 6], v=ua[gt, gi + 3, gj + 6]>, ap1=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 3], u=va[gt, gi + 3, gj + 3], v=ua[gt, gi + 3, gj + 3]>, ap2=duo_contravariant<cosA=cosA[gt, gi + 3, gj + 2], u=va[gt, gi + 3, gj + 2], v=ua[gt, gi + 3, gj + 2]>>>) / dp[gt, gi + 3, gj + 3])) where {gi in x, gj in y, gt in tile}

Per-cell operator for pgrad_l97_v_duo_g3 as a match-less named stencil (body = aggregate over the tile/x/y loop indices gt/gi/gj, indexing prognostics relative to those loop vars with the +3 donor-cube halo offset). The rule pgrad_l97_v_duo_g3 is a thin makearray wrapper that applies this once. Original: Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=3. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g3 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Rules

Complete auto-applied rewrite rules on spatial D: imported stencil + boundary conditions in one makearray (esm-spec §9.6.8). Import a rule and every matching derivative in your model lowers through it.

duo_corner_diag

op:corner_fill order:4 bc:duo axes:tile,x_cell_ext,y_cell_ext

Source: grids/duo/rules/duo_corner_diag.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N + 6, 1:N + 6] = sum[gt, gi, gj] (q[gt, gi, gj]) where {gi in x_cell_ext, gj in y_cell_ext, gt in tile}, [1:6, N + 4:N + 6, N + 4:N + 6] = sum[gt, gi, gj] (duo_corner_sel_1<center=center, p1=center[gt, N + 1, gj, 1], p10=center[gt, N + 3, gj, 1], p11=center[gt, N + 3, gj, 2], p12=center[gt, N + 3, gj, 3], p13=q[gt, N, gj], p14=q[gt, N + 1, gj], p15=q[gt, N + 2, gj], p16=q[gt, N + 3, gj], p17=center[gt, gi, N + 1, 1], p18=center[gt, gi, N + 1, 2], p19=center[gt, gi, N + 1, 3], p2=center[gt, N + 1, gj, 2], p20=center[gt, gi, N, 1], p21=center[gt, gi, N, 2], p22=center[gt, gi, N, 3], p23=center[gt, gi, N + 2, 1], p24=center[gt, gi, N + 2, 2], p25=center[gt, gi, N + 2, 3], p26=center[gt, gi, N + 3, 1], p27=center[gt, gi, N + 3, 2], p28=center[gt, gi, N + 3, 3], p29=q[gt, gi, N], p3=center[gt, N + 1, gj, 3], p30=q[gt, gi, N + 1], p31=q[gt, gi, N + 2], p32=q[gt, gi, N + 3], p4=center[gt, N, gj, 1], p5=center[gt, N, gj, 2], p6=center[gt, N, gj, 3], p7=center[gt, N + 2, gj, 1], p8=center[gt, N + 2, gj, 2], p9=center[gt, N + 2, gj, 3], q=q>) where {gi in N + 4:N + 6, gj in N + 4:N + 6, gt in tile}, [1:6, 1:3, 1:3] = sum[gt, gi, gj] (duo_corner_sel_1<center=center, p1=center[gt, 5, gj, 1], p10=center[gt, 7, gj, 1], p11=center[gt, 7, gj, 2], p12=center[gt, 7, gj, 3], p13=q[gt, 4, gj], p14=q[gt, 5, gj], p15=q[gt, 6, gj], p16=q[gt, 7, gj], p17=center[gt, gi, 5, 1], p18=center[gt, gi, 5, 2], p19=center[gt, gi, 5, 3], p2=center[gt, 5, gj, 2], p20=center[gt, gi, 4, 1], p21=center[gt, gi, 4, 2], p22=center[gt, gi, 4, 3], p23=center[gt, gi, 6, 1], p24=center[gt, gi, 6, 2], p25=center[gt, gi, 6, 3], p26=center[gt, gi, 7, 1], p27=center[gt, gi, 7, 2], p28=center[gt, gi, 7, 3], p29=q[gt, gi, 4], p3=center[gt, 5, gj, 3], p30=q[gt, gi, 5], p31=q[gt, gi, 6], p32=q[gt, gi, 7], p4=center[gt, 4, gj, 1], p5=center[gt, 4, gj, 2], p6=center[gt, 4, gj, 3], p7=center[gt, 6, gj, 1], p8=center[gt, 6, gj, 2], p9=center[gt, 6, gj, 3], q=q>) where {gi in 1:3, gj in 1:3, gt in tile}, [1:6, 1:3, N + 4:N + 6] = sum[gt, gi, gj] (ifelse((gi + (gj - (N + 3)) - 4) * (gi + (gj - (N + 3)) - 4) < 0.5, 0.5 * (duo_corner_assy_3<center=center, p1=center[gt, 5, gj, 1], p10=center[gt, 7, gj, 1], p11=center[gt, 7, gj, 2], p12=center[gt, 7, gj, 3], p13=q[gt, 4, gj], p2=center[gt, 5, gj, 2], p26=q[gt, 5, gj], p3=center[gt, 5, gj, 3], p39=q[gt, 6, gj], p4=center[gt, 4, gj, 1], p5=center[gt, 4, gj, 2], p52=q[gt, 7, gj], p6=center[gt, 4, gj, 3], p7=center[gt, 6, gj, 1], p8=center[gt, 6, gj, 2], p9=center[gt, 6, gj, 3]> + duo_corner_assy_3<center=center, p1=center[gt, gi, N + 1, 1], p10=center[gt, gi, N + 3, 1], p11=center[gt, gi, N + 3, 2], p12=center[gt, gi, N + 3, 3], p13=q[gt, gi, N], p2=center[gt, gi, N + 1, 2], p26=q[gt, gi, N + 1], p3=center[gt, gi, N + 1, 3], p39=q[gt, gi, N + 2], p4=center[gt, gi, N, 1], p5=center[gt, gi, N, 2], p52=q[gt, gi, N + 3], p6=center[gt, gi, N, 3], p7=center[gt, gi, N + 2, 1], p8=center[gt, gi, N + 2, 2], p9=center[gt, gi, N + 2, 3]>), q[gt, gi, gj])) where {gi in 1:3, gj in N + 4:N + 6, gt in tile}, [1:6, N + 4:N + 6, 1:3] = sum[gt, gi, gj] (ifelse((gi - (N + 3) + gj - 4) * (gi - (N + 3) + gj - 4) < 0.5, 0.5 * (duo_corner_assy_3<center=center, p1=center[gt, N + 1, gj, 1], p10=center[gt, N + 3, gj, 1], p11=center[gt, N + 3, gj, 2], p12=center[gt, N + 3, gj, 3], p13=q[gt, N, gj], p2=center[gt, N + 1, gj, 2], p26=q[gt, N + 1, gj], p3=center[gt, N + 1, gj, 3], p39=q[gt, N + 2, gj], p4=center[gt, N, gj, 1], p5=center[gt, N, gj, 2], p52=q[gt, N + 3, gj], p6=center[gt, N, gj, 3], p7=center[gt, N + 2, gj, 1], p8=center[gt, N + 2, gj, 2], p9=center[gt, N + 2, gj, 3]> + duo_corner_assy_3<center=center, p1=center[gt, gi, 5, 1], p10=center[gt, gi, 7, 1], p11=center[gt, gi, 7, 2], p12=center[gt, gi, 7, 3], p13=q[gt, gi, 4], p2=center[gt, gi, 5, 2], p26=q[gt, gi, 5], p3=center[gt, gi, 5, 3], p39=q[gt, gi, 6], p4=center[gt, gi, 4, 1], p5=center[gt, gi, 4, 2], p52=q[gt, gi, 7], p6=center[gt, gi, 4, 3], p7=center[gt, gi, 6, 1], p8=center[gt, gi, 6, 2], p9=center[gt, gi, 6, 3]>), q[gt, gi, gj])) where {gi in N + 4:N + 6, gj in 1:3, gt in tile})

PASS 2 of the duo corner fill: overwrite the 3 DIAGONAL points of each corner by 0.5*(X-interp + Y-interp) over the off-diagonal-filled field (Zerroukat eq 10). Bind q to the duo_corner_offdiag output. Duo-grid CUBE-CORNER halo fill (Zerroukat & Allen 2021 QJRMS 10.1002/qj.4230; Mouallem 2023 fv_duogrid.F90 fill_corner_region_2d) for a cell-centred A-grid field, to cubic (order-4) accuracy, needed by TRULY 2-D (non-split) stencils – the direction-split LMARS reconstructions never read the corner blocks, so duo_extend leaves them unfilled. Projection-agnostic: barycentric-Lagrange weights from GREAT-CIRCLE distances between cell centres (via the shared duo_arc_length atom), so equidistance/equiangular/equi-edge alike. Each corner’s 3x3 halo block is one aggregate with an ifelse selecting the interpolation direction on the two off-diagonal triangles. TWO passes because the diagonal reads the just-filled off-diagonal. Bind center to duo_cell_center; R_sphere is a consumer free name. Verified bit-identical to a numeric reimplementation of the Fortran over all 4 corners; converges at ~4th order.

References

  • Zerroukat, M., & Allen, T. (2022). On the corners of the cubed-sphere grid. QJRMS, 148(743), 778-783.
  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel Duo-Grid in GFDL’s FV3. JAMES, 15, e2023MS003712.

Conformance fixtures

duo_corner_offdiag

op:corner_fill order:4 bc:duo axes:tile,x_cell_ext,y_cell_ext

Source: grids/duo/rules/duo_corner_offdiag.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N + 6, 1:N + 6] = sum[gt, gi, gj] (q[gt, gi, gj]) where {gi in x_cell_ext, gj in y_cell_ext, gt in tile}, [1:6, N + 4:N + 6, N + 4:N + 6] = sum[gt, gi, gj] (ifelse(gi < gj, duo_corner_assy_3<center=center, p1=center[gt, N + 1, gj, 1], p10=center[gt, N + 3, gj, 1], p11=center[gt, N + 3, gj, 2], p12=center[gt, N + 3, gj, 3], p13=q[gt, N, gj], p2=center[gt, N + 1, gj, 2], p26=q[gt, N + 1, gj], p3=center[gt, N + 1, gj, 3], p39=q[gt, N + 2, gj], p4=center[gt, N, gj, 1], p5=center[gt, N, gj, 2], p52=q[gt, N + 3, gj], p6=center[gt, N, gj, 3], p7=center[gt, N + 2, gj, 1], p8=center[gt, N + 2, gj, 2], p9=center[gt, N + 2, gj, 3]>, ifelse(gi > gj, duo_corner_assy_3<center=center, p1=center[gt, gi, N + 1, 1], p10=center[gt, gi, N + 3, 1], p11=center[gt, gi, N + 3, 2], p12=center[gt, gi, N + 3, 3], p13=q[gt, gi, N], p2=center[gt, gi, N + 1, 2], p26=q[gt, gi, N + 1], p3=center[gt, gi, N + 1, 3], p39=q[gt, gi, N + 2], p4=center[gt, gi, N, 1], p5=center[gt, gi, N, 2], p52=q[gt, gi, N + 3], p6=center[gt, gi, N, 3], p7=center[gt, gi, N + 2, 1], p8=center[gt, gi, N + 2, 2], p9=center[gt, gi, N + 2, 3]>, q[gt, gi, gj]))) where {gi in N + 4:N + 6, gj in N + 4:N + 6, gt in tile}, [1:6, 1:3, 1:3] = sum[gt, gi, gj] (ifelse(gi > gj, duo_corner_assy_3<center=center, p1=center[gt, 5, gj, 1], p10=center[gt, 7, gj, 1], p11=center[gt, 7, gj, 2], p12=center[gt, 7, gj, 3], p13=q[gt, 4, gj], p2=center[gt, 5, gj, 2], p26=q[gt, 5, gj], p3=center[gt, 5, gj, 3], p39=q[gt, 6, gj], p4=center[gt, 4, gj, 1], p5=center[gt, 4, gj, 2], p52=q[gt, 7, gj], p6=center[gt, 4, gj, 3], p7=center[gt, 6, gj, 1], p8=center[gt, 6, gj, 2], p9=center[gt, 6, gj, 3]>, ifelse(gi < gj, duo_corner_assy_3<center=center, p1=center[gt, gi, 5, 1], p10=center[gt, gi, 7, 1], p11=center[gt, gi, 7, 2], p12=center[gt, gi, 7, 3], p13=q[gt, gi, 4], p2=center[gt, gi, 5, 2], p26=q[gt, gi, 5], p3=center[gt, gi, 5, 3], p39=q[gt, gi, 6], p4=center[gt, gi, 4, 1], p5=center[gt, gi, 4, 2], p52=q[gt, gi, 7], p6=center[gt, gi, 4, 3], p7=center[gt, gi, 6, 1], p8=center[gt, gi, 6, 2], p9=center[gt, gi, 6, 3]>, q[gt, gi, gj]))) where {gi in 1:3, gj in 1:3, gt in tile}, [1:6, 1:3, N + 4:N + 6] = sum[gt, gi, gj] (ifelse(gi + (gj - (N + 3)) > 4, duo_corner_assy_3<center=center, p1=center[gt, 5, gj, 1], p10=center[gt, 7, gj, 1], p11=center[gt, 7, gj, 2], p12=center[gt, 7, gj, 3], p13=q[gt, 4, gj], p2=center[gt, 5, gj, 2], p26=q[gt, 5, gj], p3=center[gt, 5, gj, 3], p39=q[gt, 6, gj], p4=center[gt, 4, gj, 1], p5=center[gt, 4, gj, 2], p52=q[gt, 7, gj], p6=center[gt, 4, gj, 3], p7=center[gt, 6, gj, 1], p8=center[gt, 6, gj, 2], p9=center[gt, 6, gj, 3]>, ifelse(gi + (gj - (N + 3)) < 4, duo_corner_assy_3<center=center, p1=center[gt, gi, N + 1, 1], p10=center[gt, gi, N + 3, 1], p11=center[gt, gi, N + 3, 2], p12=center[gt, gi, N + 3, 3], p13=q[gt, gi, N], p2=center[gt, gi, N + 1, 2], p26=q[gt, gi, N + 1], p3=center[gt, gi, N + 1, 3], p39=q[gt, gi, N + 2], p4=center[gt, gi, N, 1], p5=center[gt, gi, N, 2], p52=q[gt, gi, N + 3], p6=center[gt, gi, N, 3], p7=center[gt, gi, N + 2, 1], p8=center[gt, gi, N + 2, 2], p9=center[gt, gi, N + 2, 3]>, q[gt, gi, gj]))) where {gi in 1:3, gj in N + 4:N + 6, gt in tile}, [1:6, N + 4:N + 6, 1:3] = sum[gt, gi, gj] (ifelse(gi - (N + 3) + gj < 4, duo_corner_assy_3<center=center, p1=center[gt, N + 1, gj, 1], p10=center[gt, N + 3, gj, 1], p11=center[gt, N + 3, gj, 2], p12=center[gt, N + 3, gj, 3], p13=q[gt, N, gj], p2=center[gt, N + 1, gj, 2], p26=q[gt, N + 1, gj], p3=center[gt, N + 1, gj, 3], p39=q[gt, N + 2, gj], p4=center[gt, N, gj, 1], p5=center[gt, N, gj, 2], p52=q[gt, N + 3, gj], p6=center[gt, N, gj, 3], p7=center[gt, N + 2, gj, 1], p8=center[gt, N + 2, gj, 2], p9=center[gt, N + 2, gj, 3]>, ifelse(gi - (N + 3) + gj > 4, duo_corner_assy_3<center=center, p1=center[gt, gi, 5, 1], p10=center[gt, gi, 7, 1], p11=center[gt, gi, 7, 2], p12=center[gt, gi, 7, 3], p13=q[gt, gi, 4], p2=center[gt, gi, 5, 2], p26=q[gt, gi, 5], p3=center[gt, gi, 5, 3], p39=q[gt, gi, 6], p4=center[gt, gi, 4, 1], p5=center[gt, gi, 4, 2], p52=q[gt, gi, 7], p6=center[gt, gi, 4, 3], p7=center[gt, gi, 6, 1], p8=center[gt, gi, 6, 2], p9=center[gt, gi, 6, 3]>, q[gt, gi, gj]))) where {gi in N + 4:N + 6, gj in 1:3, gt in tile})

PASS 1 of the duo corner fill: overwrite the 6 OFF-DIAGONAL points of each of the 4 corners by 1-D Lagrange extension of the adjacent edge lines (Zerroukat eqs 8-9). Bind q to the edge-filled halo (duo_extend output). Duo-grid CUBE-CORNER halo fill (Zerroukat & Allen 2021 QJRMS 10.1002/qj.4230; Mouallem 2023 fv_duogrid.F90 fill_corner_region_2d) for a cell-centred A-grid field, to cubic (order-4) accuracy, needed by TRULY 2-D (non-split) stencils – the direction-split LMARS reconstructions never read the corner blocks, so duo_extend leaves them unfilled. Projection-agnostic: barycentric-Lagrange weights from GREAT-CIRCLE distances between cell centres (via the shared duo_arc_length atom), so equidistance/equiangular/equi-edge alike. Each corner’s 3x3 halo block is one aggregate with an ifelse selecting the interpolation direction on the two off-diagonal triangles. TWO passes because the diagonal reads the just-filled off-diagonal. Bind center to duo_cell_center; R_sphere is a consumer free name. Verified bit-identical to a numeric reimplementation of the Fortran over all 4 corners; converges at ~4th order.

References

  • Zerroukat, M., & Allen, T. (2022). On the corners of the cubed-sphere grid. QJRMS, 148(743), 778-783.
  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel Duo-Grid in GFDL’s FV3. JAMES, 15, e2023MS003712.

Conformance fixtures

duo_extend

op:halo_extend order:2 bc:duo axes:tile,x_cell_ext,y_cell_ext

Source: grids/duo/rules/duo_extend.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N + 6, 1:N + 6] = sum[gt, gi, gj] (q[gt, max(1, min(N, (gi - 3))), max(1, min(N, (gj - 3)))]) where {gi in x_cell_ext, gj in y_cell_ext, gt in tile}, [1:1, 1:3, 4:N + 3] = duo_extend_strip_w<X=(-center[1, gi, gj, 3]) / (-center[1, gi, gj, 2]), Y=center[1, gi, gj, 1] / (-center[1, gi, gj, 2]), center=center, dt=5, q=q, refx=refx, refy=refy>, [1:1, N + 4:N + 6, 4:N + 3] = duo_extend_strip_e<X=(-center[1, gi, gj, 1]) / center[1, gi, gj, 2], Y=center[1, gi, gj, 3] / center[1, gi, gj, 2], center=center, dt=2, q=q, refx=refx, refy=refy>, [1:1, 4:N + 3, 1:3] = duo_extend_strip_s<X=center[1, gi, gj, 2] / (-center[1, gi, gj, 3]), Y=center[1, gi, gj, 1] / (-center[1, gi, gj, 3]), center=center, dt=6, q=q, refx=refx, refy=refy>, [1:1, 4:N + 3, N + 4:N + 6] = duo_extend_strip_n<X=(-center[1, gi, gj, 1]) / center[1, gi, gj, 3], Y=(-center[1, gi, gj, 2]) / center[1, gi, gj, 3], center=center, dt=3, q=q, refx=refx, refy=refy>, [2:2, 1:3, 4:N + 3] = duo_extend_strip_w<X=center[2, gi, gj, 2] / center[2, gi, gj, 1], Y=center[2, gi, gj, 3] / center[2, gi, gj, 1], center=center, dt=1, q=q, refx=refx, refy=refy>, [2:2, N + 4:N + 6, 4:N + 3] = duo_extend_strip_e<X=(-center[2, gi, gj, 3]) / (-center[2, gi, gj, 1]), Y=(-center[2, gi, gj, 2]) / (-center[2, gi, gj, 1]), center=center, dt=4, q=q, refx=refx, refy=refy>, [2:2, 4:N + 3, 1:3] = duo_extend_strip_s<X=center[2, gi, gj, 2] / (-center[2, gi, gj, 3]), Y=center[2, gi, gj, 1] / (-center[2, gi, gj, 3]), center=center, dt=6, q=q, refx=refx, refy=refy>, [2:2, 4:N + 3, N + 4:N + 6] = duo_extend_strip_n<X=(-center[2, gi, gj, 1]) / center[2, gi, gj, 3], Y=(-center[2, gi, gj, 2]) / center[2, gi, gj, 3], center=center, dt=3, q=q, refx=refx, refy=refy>, [3:3, 1:3, 4:N + 3] = duo_extend_strip_w<X=center[3, gi, gj, 2] / center[3, gi, gj, 1], Y=center[3, gi, gj, 3] / center[3, gi, gj, 1], center=center, dt=1, q=q, refx=refx, refy=refy>, [3:3, N + 4:N + 6, 4:N + 3] = duo_extend_strip_e<X=(-center[3, gi, gj, 3]) / (-center[3, gi, gj, 1]), Y=(-center[3, gi, gj, 2]) / (-center[3, gi, gj, 1]), center=center, dt=4, q=q, refx=refx, refy=refy>, [3:3, 4:N + 3, 1:3] = duo_extend_strip_s<X=(-center[3, gi, gj, 1]) / center[3, gi, gj, 2], Y=center[3, gi, gj, 3] / center[3, gi, gj, 2], center=center, dt=2, q=q, refx=refx, refy=refy>, [3:3, 4:N + 3, N + 4:N + 6] = duo_extend_strip_n<X=(-center[3, gi, gj, 3]) / (-center[3, gi, gj, 2]), Y=center[3, gi, gj, 1] / (-center[3, gi, gj, 2]), center=center, dt=5, q=q, refx=refx, refy=refy>, [4:4, 1:3, 4:N + 3] = duo_extend_strip_w<X=(-center[4, gi, gj, 1]) / center[4, gi, gj, 3], Y=(-center[4, gi, gj, 2]) / center[4, gi, gj, 3], center=center, dt=3, q=q, refx=refx, refy=refy>, [4:4, N + 4:N + 6, 4:N + 3] = duo_extend_strip_e<X=center[4, gi, gj, 2] / (-center[4, gi, gj, 3]), Y=center[4, gi, gj, 1] / (-center[4, gi, gj, 3]), center=center, dt=6, q=q, refx=refx, refy=refy>, [4:4, 4:N + 3, 1:3] = duo_extend_strip_s<X=(-center[4, gi, gj, 1]) / center[4, gi, gj, 2], Y=center[4, gi, gj, 3] / center[4, gi, gj, 2], center=center, dt=2, q=q, refx=refx, refy=refy>, [4:4, 4:N + 3, N + 4:N + 6] = duo_extend_strip_n<X=(-center[4, gi, gj, 3]) / (-center[4, gi, gj, 2]), Y=center[4, gi, gj, 1] / (-center[4, gi, gj, 2]), center=center, dt=5, q=q, refx=refx, refy=refy>, [5:5, 1:3, 4:N + 3] = duo_extend_strip_w<X=(-center[5, gi, gj, 1]) / center[5, gi, gj, 3], Y=(-center[5, gi, gj, 2]) / center[5, gi, gj, 3], center=center, dt=3, q=q, refx=refx, refy=refy>, [5:5, N + 4:N + 6, 4:N + 3] = duo_extend_strip_e<X=center[5, gi, gj, 2] / (-center[5, gi, gj, 3]), Y=center[5, gi, gj, 1] / (-center[5, gi, gj, 3]), center=center, dt=6, q=q, refx=refx, refy=refy>, [5:5, 4:N + 3, 1:3] = duo_extend_strip_s<X=(-center[5, gi, gj, 3]) / (-center[5, gi, gj, 1]), Y=(-center[5, gi, gj, 2]) / (-center[5, gi, gj, 1]), center=center, dt=4, q=q, refx=refx, refy=refy>, [5:5, 4:N + 3, N + 4:N + 6] = duo_extend_strip_n<X=center[5, gi, gj, 2] / center[5, gi, gj, 1], Y=center[5, gi, gj, 3] / center[5, gi, gj, 1], center=center, dt=1, q=q, refx=refx, refy=refy>, [6:6, 1:3, 4:N + 3] = duo_extend_strip_w<X=(-center[6, gi, gj, 3]) / (-center[6, gi, gj, 2]), Y=center[6, gi, gj, 1] / (-center[6, gi, gj, 2]), center=center, dt=5, q=q, refx=refx, refy=refy>, [6:6, N + 4:N + 6, 4:N + 3] = duo_extend_strip_e<X=(-center[6, gi, gj, 1]) / center[6, gi, gj, 2], Y=center[6, gi, gj, 3] / center[6, gi, gj, 2], center=center, dt=2, q=q, refx=refx, refy=refy>, [6:6, 4:N + 3, 1:3] = duo_extend_strip_s<X=(-center[6, gi, gj, 3]) / (-center[6, gi, gj, 1]), Y=(-center[6, gi, gj, 2]) / (-center[6, gi, gj, 1]), center=center, dt=4, q=q, refx=refx, refy=refy>, [6:6, 4:N + 3, N + 4:N + 6] = duo_extend_strip_n<X=center[6, gi, gj, 2] / center[6, gi, gj, 1], Y=center[6, gi, gj, 3] / center[6, gi, gj, 1], center=center, dt=1, q=q, refx=refx, refy=refy>)

Halo extension of a cell field into the 3-layer donor-cube halo (Mouallem et al. duo-grid). The interior copy is region 0; each of the 24 tile-edge strips applies a shared per-edge remap template (duo_extend_strip_{w,e,s,n}): a tent-basis (bilinear) interpolation in the donor tile’s gnomonic coordinates X, Y with one-sided linear extrapolation past the donor edge. X and Y are bound per strip as the signed face-rotation of the halo cell’s Cartesian center into the donor frame; dt is the donor tile.

References

Conformance fixtures

duo_wind_cov_u

op:wind_rotate order:0 bc:duo axes:tile,x_cell_ext,y_cell_ext

Source: grids/duo/rules/duo_wind_cov_u.esm

Definition:

sum[gt, gi, gj] (duo_wind_assy_6<center=center, p1=gi, p2=center[gt, ifelse(gi < N + 6, gi + 1, gi - 1), gj, 1], p3=center[gt, ifelse(gi < N + 6, gi + 1, gi - 1), gj, 3], p4=center[gt, ifelse(gi < N + 6, gi + 1, gi - 1), gj, 2], uz=uz, vm=vm> + duo_wind_assy_5<center=center, p1=gi, p2=center[gt, ifelse(gi < N + 6, gi + 1, gi - 1), gj, 2], p3=center[gt, ifelse(gi < N + 6, gi + 1, gi - 1), gj, 1], p4=center[gt, ifelse(gi < N + 6, gi + 1, gi - 1), gj, 3], uz=uz, vm=vm> + duo_wind_assy_4<center=center, p1=gi, p2=center[gt, ifelse(gi < N + 6, gi + 1, gi - 1), gj, 3], p3=center[gt, ifelse(gi < N + 6, gi + 1, gi - 1), gj, 2], p4=center[gt, ifelse(gi < N + 6, gi + 1, gi - 1), gj, 1], uz=uz, vm=vm>) where {gi in x_cell_ext, gj in y_cell_ext, gt in tile}

Rotate EARTH-RELATIVE halo winds (uz,vm) back to A-grid COVARIANT (ua tile-x covariant) at each halo cell – step 4 of the Mouallem 2023 vector halo remap, after scalar duo_extend fills the earth-relative components across seams. V=uzelon+vmelat then dotted with the node-tangent basis (from duo_cell_center); the tangent x/y neighbour is the +1 cell, or -1 with a sign flip at the outermost halo cell gi/gj=N+6. Params [uz,vm,center]; bind center=duo_cell_center; R_sphere free name.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel Duo-Grid in GFDL’s FV3. JAMES, 15, e2023MS003712.

Conformance fixtures

duo_wind_cov_v

op:wind_rotate order:0 bc:duo axes:tile,x_cell_ext,y_cell_ext

Source: grids/duo/rules/duo_wind_cov_v.esm

Definition:

sum[gt, gi, gj] (duo_wind_assy_6<center=center, p1=gj, p2=center[gt, gi, ifelse(gj < N + 6, gj + 1, gj - 1), 1], p3=center[gt, gi, ifelse(gj < N + 6, gj + 1, gj - 1), 3], p4=center[gt, gi, ifelse(gj < N + 6, gj + 1, gj - 1), 2], uz=uz, vm=vm> + duo_wind_assy_5<center=center, p1=gj, p2=center[gt, gi, ifelse(gj < N + 6, gj + 1, gj - 1), 2], p3=center[gt, gi, ifelse(gj < N + 6, gj + 1, gj - 1), 1], p4=center[gt, gi, ifelse(gj < N + 6, gj + 1, gj - 1), 3], uz=uz, vm=vm> + duo_wind_assy_4<center=center, p1=gj, p2=center[gt, gi, ifelse(gj < N + 6, gj + 1, gj - 1), 3], p3=center[gt, gi, ifelse(gj < N + 6, gj + 1, gj - 1), 2], p4=center[gt, gi, ifelse(gj < N + 6, gj + 1, gj - 1), 1], uz=uz, vm=vm>) where {gi in x_cell_ext, gj in y_cell_ext, gt in tile}

Rotate EARTH-RELATIVE halo winds (uz,vm) back to A-grid COVARIANT (va tile-y covariant) at each halo cell – step 4 of the Mouallem 2023 vector halo remap, after scalar duo_extend fills the earth-relative components across seams. V=uzelon+vmelat then dotted with the node-tangent basis (from duo_cell_center); the tangent x/y neighbour is the +1 cell, or -1 with a sign flip at the outermost halo cell gi/gj=N+6. Params [uz,vm,center]; bind center=duo_cell_center; R_sphere free name.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel Duo-Grid in GFDL’s FV3. JAMES, 15, e2023MS003712.

Conformance fixtures

duo_wind_earth_u

op:wind_rotate order:0 bc:duo axes:tile,x,y

Source: grids/duo/rules/duo_wind_earth_u.esm

Definition:

sum[gt, gi, gj] ((duo_wind_assy_14<center=center, p1=center[gt, gi + 3, gj + 3, 3], p2=center[gt, gi + 4, gj + 3, 1], p3=center[gt, gi + 3, gj + 3, 1], p4=center[gt, gi + 4, gj + 3, 3], p5=center[gt, gi + 4, gj + 3, 2], p6=center[gt, gi + 3, gj + 3, 2], ua=ua, va=va> + duo_wind_assy_13<center=center, p1=center[gt, gi + 3, gj + 3, 3], p2=center[gt, gi + 3, gj + 4, 1], p3=center[gt, gi + 3, gj + 3, 1], p4=center[gt, gi + 3, gj + 4, 3], p5=center[gt, gi + 3, gj + 4, 2], p6=center[gt, gi + 3, gj + 3, 2], ua=ua, va=va>) * (-sin(atan2(center[gt, gi + 3, gj + 3, 2], center[gt, gi + 3, gj + 3, 1]))) + (duo_wind_assy_14<center=center, p1=center[gt, gi + 3, gj + 3, 1], p2=center[gt, gi + 4, gj + 3, 2], p3=center[gt, gi + 3, gj + 3, 2], p4=center[gt, gi + 4, gj + 3, 1], p5=center[gt, gi + 4, gj + 3, 3], p6=center[gt, gi + 3, gj + 3, 3], ua=ua, va=va> + duo_wind_assy_13<center=center, p1=center[gt, gi + 3, gj + 3, 1], p2=center[gt, gi + 3, gj + 4, 2], p3=center[gt, gi + 3, gj + 3, 2], p4=center[gt, gi + 3, gj + 4, 1], p5=center[gt, gi + 3, gj + 4, 3], p6=center[gt, gi + 3, gj + 3, 3], ua=ua, va=va>) * cos(atan2(center[gt, gi + 3, gj + 3, 2], center[gt, gi + 3, gj + 3, 1])) + (duo_wind_assy_14<center=center, p1=center[gt, gi + 3, gj + 3, 2], p2=center[gt, gi + 4, gj + 3, 3], p3=center[gt, gi + 3, gj + 3, 3], p4=center[gt, gi + 4, gj + 3, 2], p5=center[gt, gi + 4, gj + 3, 1], p6=center[gt, gi + 3, gj + 3, 1], ua=ua, va=va> + duo_wind_assy_13<center=center, p1=center[gt, gi + 3, gj + 3, 2], p2=center[gt, gi + 3, gj + 4, 3], p3=center[gt, gi + 3, gj + 3, 3], p4=center[gt, gi + 3, gj + 4, 2], p5=center[gt, gi + 3, gj + 4, 1], p6=center[gt, gi + 3, gj + 3, 1], ua=ua, va=va>) * 0) where {gi in x, gj in y, gt in tile}

Rotate A-grid COVARIANT winds (ua,va) to EARTH-RELATIVE (zonal component) at each cell centre – step 2 of the Mouallem 2023 vector halo remap. Physical velocity from the covariant components via the metric raise g^ij=(1/sin2A)[[1,-cosA],[-cosA,1]] with the node-tangent basis e1,e2 (e_i=normalize(cross(cross(ka,kother),ka)) from duo_cell_center), then dotted with the local zonal (elon) unit vector (elon=(-sinL,cosL,0) / elat=(-sinP cosL,-sinP sinL,cosP), lon=atan2, lat=asin from the cell centre). Earth-relative winds are globally continuous, so the halo is then filled by the scalar duo_extend and rotated back by duo_wind_cov_u. Params [ua,va,center]; bind center=duo_cell_center; R_sphere free name. Verified to ~3e-16 vs a direct reimplementation.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel Duo-Grid in GFDL’s FV3. JAMES, 15, e2023MS003712.

Conformance fixtures

duo_wind_earth_v

op:wind_rotate order:0 bc:duo axes:tile,x,y

Source: grids/duo/rules/duo_wind_earth_v.esm

Definition:

sum[gt, gi, gj] ((duo_wind_assy_14<center=center, p1=center[gt, gi + 3, gj + 3, 3], p2=center[gt, gi + 4, gj + 3, 1], p3=center[gt, gi + 3, gj + 3, 1], p4=center[gt, gi + 4, gj + 3, 3], p5=center[gt, gi + 4, gj + 3, 2], p6=center[gt, gi + 3, gj + 3, 2], ua=ua, va=va> + duo_wind_assy_13<center=center, p1=center[gt, gi + 3, gj + 3, 3], p2=center[gt, gi + 3, gj + 4, 1], p3=center[gt, gi + 3, gj + 3, 1], p4=center[gt, gi + 3, gj + 4, 3], p5=center[gt, gi + 3, gj + 4, 2], p6=center[gt, gi + 3, gj + 3, 2], ua=ua, va=va>) * (-sin(asin(center[gt, gi + 3, gj + 3, 3] / R_sphere)) * cos(atan2(center[gt, gi + 3, gj + 3, 2], center[gt, gi + 3, gj + 3, 1]))) + (duo_wind_assy_14<center=center, p1=center[gt, gi + 3, gj + 3, 1], p2=center[gt, gi + 4, gj + 3, 2], p3=center[gt, gi + 3, gj + 3, 2], p4=center[gt, gi + 4, gj + 3, 1], p5=center[gt, gi + 4, gj + 3, 3], p6=center[gt, gi + 3, gj + 3, 3], ua=ua, va=va> + duo_wind_assy_13<center=center, p1=center[gt, gi + 3, gj + 3, 1], p2=center[gt, gi + 3, gj + 4, 2], p3=center[gt, gi + 3, gj + 3, 2], p4=center[gt, gi + 3, gj + 4, 1], p5=center[gt, gi + 3, gj + 4, 3], p6=center[gt, gi + 3, gj + 3, 3], ua=ua, va=va>) * (-sin(asin(center[gt, gi + 3, gj + 3, 3] / R_sphere)) * sin(atan2(center[gt, gi + 3, gj + 3, 2], center[gt, gi + 3, gj + 3, 1]))) + (duo_wind_assy_14<center=center, p1=center[gt, gi + 3, gj + 3, 2], p2=center[gt, gi + 4, gj + 3, 3], p3=center[gt, gi + 3, gj + 3, 3], p4=center[gt, gi + 4, gj + 3, 2], p5=center[gt, gi + 4, gj + 3, 1], p6=center[gt, gi + 3, gj + 3, 1], ua=ua, va=va> + duo_wind_assy_13<center=center, p1=center[gt, gi + 3, gj + 3, 2], p2=center[gt, gi + 3, gj + 4, 3], p3=center[gt, gi + 3, gj + 3, 3], p4=center[gt, gi + 3, gj + 4, 2], p5=center[gt, gi + 3, gj + 4, 1], p6=center[gt, gi + 3, gj + 3, 1], ua=ua, va=va>) * cos(asin(center[gt, gi + 3, gj + 3, 3] / R_sphere))) where {gi in x, gj in y, gt in tile}

Rotate A-grid COVARIANT winds (ua,va) to EARTH-RELATIVE (meridional component) at each cell centre – step 2 of the Mouallem 2023 vector halo remap. Physical velocity from the covariant components via the metric raise g^ij=(1/sin2A)[[1,-cosA],[-cosA,1]] with the node-tangent basis e1,e2 (e_i=normalize(cross(cross(ka,kother),ka)) from duo_cell_center), then dotted with the local meridional (elat) unit vector (elon=(-sinL,cosL,0) / elat=(-sinP cosL,-sinP sinL,cosP), lon=atan2, lat=asin from the cell centre). Earth-relative winds are globally continuous, so the halo is then filled by the scalar duo_extend and rotated back by duo_wind_cov_v. Params [ua,va,center]; bind center=duo_cell_center; R_sphere free name. Verified to ~3e-16 vs a direct reimplementation.

References

  • Mouallem, J., Harris, L., & Chen, X. (2023). Implementation of the novel Duo-Grid in GFDL’s FV3. JAMES, 15, e2023MS003712.

Conformance fixtures

flux_divergence_duo_g1

op:flux_divergence order:1 bc:duo axes:tile,x,y stencil width 1

Source: grids/duo/rules/flux_divergence_duo_g1.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = flux_divergence_duo_g1_interior<area=area, center=center, cosA=cosA, dp=dp, node=node, ua=ua, va=va>)

Continuity (mass) tendency dh/dt for the duo gnomonic cubed-sphere shallow-water core, Ng=1 (Nc=1-point volume-mean reconstruction, design order 1). Discretises Chen (2021) Eqs 3-6 exactly as the Zenodo reference sw_full: dp/dt = (fx(i)-fx(i+1)+fy(j)-fy(j+1))/A with the LMARS face mass flux fx = u* * Lx * dp_upwind. u* is the LMARS normal velocity Eq 11 with the wave speed a=1/2(sqrt(dp_L)+sqrt(dp_R)) from CELL depth (the paper’s build default, no inline_cs); the interface states come from raise-then-reconstruct: the contravariant u^1=(ua-cosA va)/sin^2 a (and v^2 on y-faces) is volume-mean reconstructed to the face and multiplied by the face sin(alpha), and dp is reconstructed and upwinded on sign(u*) (Eqs 14-15). Lx/Ly are the great-circle face lengths (duo_arc_length on the corner nodes); A is duo_cell_area; cosA at cells is duo_cos_alpha (node-sourced, spanning the N+6 halo the Ng=3 stencil reaches); face sin(alpha) is duo_tangent_cos at the face. Operates on the halo-EXTENDED prognostic fields (duo_extend output), so a single interior region [tile,x,y] tiles the whole tendency with no boundary stencil. Applied by name from the duo SWE problem. Method-of-lines: this is the pure spatial RHS (no rk2/rk3, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

flux_divergence_duo_g2

op:flux_divergence order:3 bc:duo axes:tile,x,y stencil width 3

Source: grids/duo/rules/flux_divergence_duo_g2.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = flux_divergence_duo_g2_interior<area=area, center=center, cosA=cosA, dp=dp, node=node, ua=ua, va=va>)

Continuity (mass) tendency dh/dt for the duo gnomonic cubed-sphere shallow-water core, Ng=2 (Nc=3-point volume-mean reconstruction, design order 3). Discretises Chen (2021) Eqs 3-6 exactly as the Zenodo reference sw_full: dp/dt = (fx(i)-fx(i+1)+fy(j)-fy(j+1))/A with the LMARS face mass flux fx = u* * Lx * dp_upwind. u* is the LMARS normal velocity Eq 11 with the wave speed a=1/2(sqrt(dp_L)+sqrt(dp_R)) from CELL depth (the paper’s build default, no inline_cs); the interface states come from raise-then-reconstruct: the contravariant u^1=(ua-cosA va)/sin^2 a (and v^2 on y-faces) is volume-mean reconstructed to the face and multiplied by the face sin(alpha), and dp is reconstructed and upwinded on sign(u*) (Eqs 14-15). Lx/Ly are the great-circle face lengths (duo_arc_length on the corner nodes); A is duo_cell_area; cosA at cells is duo_cos_alpha (node-sourced, spanning the N+6 halo the Ng=3 stencil reaches); face sin(alpha) is duo_tangent_cos at the face. Operates on the halo-EXTENDED prognostic fields (duo_extend output), so a single interior region [tile,x,y] tiles the whole tendency with no boundary stencil. Applied by name from the duo SWE problem. Method-of-lines: this is the pure spatial RHS (no rk2/rk3, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

flux_divergence_duo_g3

op:flux_divergence order:5 bc:duo axes:tile,x,y stencil width 5

Source: grids/duo/rules/flux_divergence_duo_g3.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = flux_divergence_duo_g3_interior<area=area, center=center, cosA=cosA, dp=dp, node=node, ua=ua, va=va>)

Continuity (mass) tendency dh/dt for the duo gnomonic cubed-sphere shallow-water core, Ng=3 (Nc=5-point volume-mean reconstruction, design order 5). Discretises Chen (2021) Eqs 3-6 exactly as the Zenodo reference sw_full: dp/dt = (fx(i)-fx(i+1)+fy(j)-fy(j+1))/A with the LMARS face mass flux fx = u* * Lx * dp_upwind. u* is the LMARS normal velocity Eq 11 with the wave speed a=1/2(sqrt(dp_L)+sqrt(dp_R)) from CELL depth (the paper’s build default, no inline_cs); the interface states come from raise-then-reconstruct: the contravariant u^1=(ua-cosA va)/sin^2 a (and v^2 on y-faces) is volume-mean reconstructed to the face and multiplied by the face sin(alpha), and dp is reconstructed and upwinded on sign(u*) (Eqs 14-15). Lx/Ly are the great-circle face lengths (duo_arc_length on the corner nodes); A is duo_cell_area; cosA at cells is duo_cos_alpha (node-sourced, spanning the N+6 halo the Ng=3 stencil reaches); face sin(alpha) is duo_tangent_cos at the face. Operates on the halo-EXTENDED prognostic fields (duo_extend output), so a single interior region [tile,x,y] tiles the whole tendency with no boundary stencil. Applied by name from the duo SWE problem. Method-of-lines: this is the pure spatial RHS (no rk2/rk3, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. Journal of Advances in Modeling Earth Systems, 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

momentum_u_duo_g1

op:momentum_u order:1 bc:duo axes:tile,x,y

Source: grids/duo/rules/momentum_u_duo_g1.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = momentum_u_duo_g1_interior<area=area, center=center, cosA=cosA, dp=dp, f=f, node=node, ua=ua, va=va>)

Vector-invariant momentum tendency for the covariant u-wind, duo gnomonic cubed-sphere SWE core, Ng=1, WITHOUT the pressure gradient (added by a separate pgrad__u rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: du/dt = +(v^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dx. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dx is the great-circle arc between the two x-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

momentum_u_duo_g2

op:momentum_u order:3 bc:duo axes:tile,x,y

Source: grids/duo/rules/momentum_u_duo_g2.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = momentum_u_duo_g2_interior<area=area, center=center, cosA=cosA, dp=dp, f=f, node=node, ua=ua, va=va>)

Vector-invariant momentum tendency for the covariant u-wind, duo gnomonic cubed-sphere SWE core, Ng=2, WITHOUT the pressure gradient (added by a separate pgrad__u rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: du/dt = +(v^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dx. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dx is the great-circle arc between the two x-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

momentum_u_duo_g3

op:momentum_u order:5 bc:duo axes:tile,x,y

Source: grids/duo/rules/momentum_u_duo_g3.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = momentum_u_duo_g3_interior<area=area, center=center, cosA=cosA, dp=dp, f=f, node=node, ua=ua, va=va>)

Vector-invariant momentum tendency for the covariant u-wind, duo gnomonic cubed-sphere SWE core, Ng=3, WITHOUT the pressure gradient (added by a separate pgrad__u rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: du/dt = +(v^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dx. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dx is the great-circle arc between the two x-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

momentum_v_duo_g1

op:momentum_v order:1 bc:duo axes:tile,x,y

Source: grids/duo/rules/momentum_v_duo_g1.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = momentum_v_duo_g1_interior<area=area, center=center, cosA=cosA, dp=dp, f=f, node=node, ua=ua, va=va>)

Vector-invariant momentum tendency for the covariant v-wind, duo gnomonic cubed-sphere SWE core, Ng=1, WITHOUT the pressure gradient (added by a separate pgrad__v rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: dv/dt = -(u^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dy. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dy is the great-circle arc between the two y-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

momentum_v_duo_g2

op:momentum_v order:3 bc:duo axes:tile,x,y

Source: grids/duo/rules/momentum_v_duo_g2.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = momentum_v_duo_g2_interior<area=area, center=center, cosA=cosA, dp=dp, f=f, node=node, ua=ua, va=va>)

Vector-invariant momentum tendency for the covariant v-wind, duo gnomonic cubed-sphere SWE core, Ng=2, WITHOUT the pressure gradient (added by a separate pgrad__v rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: dv/dt = -(u^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dy. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dy is the great-circle arc between the two y-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

momentum_v_duo_g3

op:momentum_v order:5 bc:duo axes:tile,x,y

Source: grids/duo/rules/momentum_v_duo_g3.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = momentum_v_duo_g3_interior<area=area, center=center, cosA=cosA, dp=dp, f=f, node=node, ua=ua, va=va>)

Vector-invariant momentum tendency for the covariant v-wind, duo gnomonic cubed-sphere SWE core, Ng=3, WITHOUT the pressure gradient (added by a separate pgrad__v rule so both L97 and direct forms are drop-in). Chen (2021) C36/C37 as the Zenodo sw_full: dv/dt = -(u^contra)sin(alpha)(f+zeta) + (ke(i)-ke(i+1))/Dy. The absolute vorticity f+zeta is the circulation [dx(vpLx)-dy(upLy)]/A + f with up,vp the UPWINDED parallel velocities reused from the LMARS solve (Eq 9/C38); the interface kinetic energy is 1/2(u^2 + up^2) in the local orthogonal frame (Eq 10); (f+zeta) multiplies the contravariant cross-velocity times sin(alpha)=sqrt(g) (C36/C37); Dy is the great-circle arc between the two y-face midpoints. Operates on halo-extended dp,ua,va; f is the problem-supplied Coriolis parameter 2 Omega sin(theta) on [tile,x,y]. Method-of-lines spatial RHS.

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_direct_u_duo_g1

op:pgrad_direct_u order:1 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_direct_u_duo_g1.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_direct_u_duo_g1_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=1. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g1 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_direct_u_duo_g2

op:pgrad_direct_u order:3 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_direct_u_duo_g2.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_direct_u_duo_g2_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=2. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g2 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_direct_u_duo_g3

op:pgrad_direct_u order:5 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_direct_u_duo_g3.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_direct_u_duo_g3_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=3. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g3 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_direct_v_duo_g1

op:pgrad_direct_v order:1 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_direct_v_duo_g1.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_direct_v_duo_g1_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=1. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g1 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_direct_v_duo_g2

op:pgrad_direct_v order:3 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_direct_v_duo_g2.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_direct_v_duo_g2_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=2. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g2 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_direct_v_duo_g3

op:pgrad_direct_v order:5 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_direct_v_duo_g3.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_direct_v_duo_g3_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=3. Direct LMARS-Pi* pressure gradient -dx(Pibar + Pivis + Phi_s)/Dx, mathematically equivalent to the L97 four-corner form for SW (paper) but written as a plain interface-pressure difference. Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g3 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_l97_u_duo_g1

op:pgrad_l97_u order:1 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_l97_u_duo_g1.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_l97_u_duo_g1_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=1. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g1 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_l97_u_duo_g2

op:pgrad_l97_u order:3 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_l97_u_duo_g2.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_l97_u_duo_g2_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=2. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g2 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_l97_u_duo_g3

op:pgrad_l97_u order:5 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_l97_u_duo_g3.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_l97_u_duo_g3_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant u-wind, duo SWE core, Ng=3. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dx the arc between x-face midpoints. Add to momentum_u_duo_g3 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_l97_v_duo_g1

op:pgrad_l97_v order:1 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_l97_v_duo_g1.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_l97_v_duo_g1_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=1. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g1 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_l97_v_duo_g2

op:pgrad_l97_v order:3 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_l97_v_duo_g2.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_l97_v_duo_g2_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=2. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g2 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures

pgrad_l97_v_duo_g3

op:pgrad_l97_v order:5 bc:duo axes:tile,x,y

Source: grids/duo/rules/pgrad_l97_v_duo_g3.esm

Discretization — one makearray tiling the output axes; boundary conditions live in the face regions of this same rule (esm-spec §9.6.8; later regions overwrite earlier, §4.3.2). Imported stencils appear as template applications name<param=value, ...>, defined in the Stencils section of this page:

makearray([1:6, 1:N, 1:N] = pgrad_l97_v_duo_g3_interior<center=center, cosA=cosA, dp=dp, node=node, phis=phis, ua=ua, va=va>)

Pressure-gradient tendency for the covariant v-wind, duo SWE core, Ng=3. L97 four-corner geometric pressure-gradient (Lin 1997) plus the LMARS viscous term, the Zenodo sw_full DEFAULT (Eqs 20-26; akap=1, ptop=0 for SW so pk=pe, gz=Phi_s+Pi and the four-corner du_hydro reduces to the geometric -dx(avg(Phi_s+Pi))/Dx, with the viscous du_pp = rdx/dp*(Pibar_iPivis_i - Pibar_i+1Pivis_i+1)). Pibar = 1/2(dpe+dpw) is the symmetric M**vm face average of the depth pressure (= 1/2 of the two reconstructed interface pressures); Sbar the same for the surface geopotential Phi_s (problem-supplied, 0 for no topography); Pivis = a/2(uE-uW) the LMARS viscous pressure; Dy the arc between y-face midpoints. Add to momentum_v_duo_g3 for the full tendency. Method-of-lines spatial RHS (beta=1, no forward-backward).

References

  • Chen, X. (2021). The LMARS based shallow-water dynamical core on generic gnomonic cubed-sphere geometry. JAMES 13(1), e2020MS002280. doi:10.1029/2020MS002280

Conformance fixtures