```E :: (real(- infinity .. infinity) ~ " m^2 s^-2" field ( x(grid)                                                       , y(grid)                                                       , z(half)                                                       ) on      (i = 1 .. nlon + 1 by       j = 1 .. nlat + 1 by       k = 1 .. nlev      )     )

Scalar Form

E := ( 1 / 2     * ( 1 / h_y * ave(h_y * u ^ 2, x)       + 1 / h_x * ave(h_x * v ^ 2, y)       )     )
Dimensioned

E := ( 1 / 2     * ( 1 / h_y * ave(h_y * u ^ 2, x)       + 1 / h_x * ave(h_x * v ^ 2, y)       )     )
Discretized

E := ( 1 / 2     * ( 1 / hyt * ave_h(hyu * u ^ 2, x)       + 1 / hxt * ave_h(hxv * v ^ 2, y)       )     )
CSE Eliminated

E := ( 1 / 4     * ( ( ( varidx(v, [i, j, k]) ^ 2 * varidx(hxv, [i, j])           + varidx(v, [i, j - 1, k]) ^ 2 * varidx(hxv, [i, j - 1])           )         / varidx(hxt, [i, j])         )       + ( ( varidx(u, [i, j, k]) ^ 2 * varidx(hyu, [i, j])           + varidx(u, [i - 1, j, k]) ^ 2 * varidx(hyu, [i - 1, j])           )         / varidx(hyt, [i, j])         )       )     )```