|
7 | 7 | "tags": [] |
8 | 8 | }, |
9 | 9 | "source": [ |
10 | | - "*Contributors*: [Ian Fenty](https://github.com/ifenty), [Andrew Delman](https://github.com/andrewdelman).\n", |
| 10 | + "# Calculating gradients and curl on the ECCO native grid\n", |
| 11 | + "\n", |
| 12 | + "*Contributors*: [Ian Fenty](https://github.com/ifenty), [Andrew Delman](https://github.com/andrewdelman) (ed.).\n", |
11 | 13 | "\n", |
12 | 14 | "## Objectives\n", |
13 | 15 | "\n", |
|
35 | 37 | "\n", |
36 | 38 | "We first demonstrate how to calculate zonal/meridional gradients of scalar fields, then gradients of vector fields provided at model 'u' and 'v' points, and finally gradients of vector fields provided at model tracer points (using atmosphere surface winds)\n", |
37 | 39 | "\n", |
38 | | - "## Preliminaries:\n", |
| 40 | + "## Preliminaries\n", |
39 | 41 | "\n", |
40 | | - "### Preliminaries: Prepare the working enviornment" |
| 42 | + "### Prepare the working enviornment" |
41 | 43 | ] |
42 | 44 | }, |
43 | 45 | { |
|
140 | 142 | "id": "ee0e86f2-eb56-4914-bc3d-8ee4f55e968d", |
141 | 143 | "metadata": {}, |
142 | 144 | "source": [ |
143 | | - "### Preliminaries: Load ECCO Geometry\n", |
| 145 | + "### Load ECCO Geometry\n", |
144 | 146 | "\n", |
145 | 147 | "First, load the llc model grid geometry." |
146 | 148 | ] |
|
190 | 192 | "id": "d02addec-8607-432c-a23b-dd28ad884460", |
191 | 193 | "metadata": {}, |
192 | 194 | "source": [ |
193 | | - "### Preliminaries: Rotating between the model's vector basis and vector basis of parallels ($\\lambda$) and meridians ($\\phi$)" |
| 195 | + "### Rotating between the model's vector basis and vector basis of parallels ($\\lambda$) and meridians ($\\phi$)" |
194 | 196 | ] |
195 | 197 | }, |
196 | 198 | { |
|
416 | 418 | "tags": [] |
417 | 419 | }, |
418 | 420 | "source": [ |
419 | | - "### Preliminaries: The logical connection between geographically adjacent tile edges\n", |
| 421 | + "### The logical connection between geographically adjacent tile edges\n", |
420 | 422 | "\n", |
421 | 423 | "To calculate gradients for grid cells on the edges of model tiles we will need information from from logically adjacent tiles. For example, to calculate zonal gradients along the eastern edge of Tile 1 we need information found along the western edge of Tile 4 (i.e., we need to difference the field in the last column of Tile 1 and the first column of Tile 4) and gradients across the western edge of Tile 4 need information found along the eastern edge of Tile 8 (i.e., we need to difference the field in the last column of Tile 4 and the reversed first row of Tile 8). Managing these connections requires careful bookkeeping. Fortunately the 'xgcm' Python library (https://xgcm.readthedocs.io/en/latest/) allows us to construct a logical map that specifies the logical relation between tiles. *So useful!*. \n", |
422 | 424 | "\n", |
|
1580 | 1582 | "tags": [] |
1581 | 1583 | }, |
1582 | 1584 | "source": [ |
1583 | | - "## Calculating zonal and meridional gradients of **vector** ECCO fields located on the 'u' and 'v' points\n", |
| 1585 | + "## Calculating gradients of vector fields located on the 'u' and 'v' points (vorticity/divergence)\n", |
1584 | 1586 | "\n", |
1585 | 1587 | "The ECCO model uses the Arakawa-C grid where velocities and horizontal fluxes are located at the grid cell edges (i.e., the 'u' and 'v' points), unlike scalar fields which are located at the grid cell centers (tracer points).\n", |
1586 | 1588 | "\n", |
1587 | | - "Gradients of vector fields located at 'u' and 'v' points are themselves located at tracer points, \"halfway\" between adjacent grid cell edges. The meridional and zonal gradients of vector fields, e.g., horizontal ocean velocity, yield four vectors:\n", |
1588 | | - "1. Zonal gradient of the **zonal component** of the vector \n", |
1589 | | - "1. Zonal gradient of the **meridional component** of the vector \n", |
1590 | | - "1. Meridional gradient of the **meridional component** of the vector \n", |
1591 | | - "1. Meridional gradient of the **zonal component** of the vector \n", |
| 1589 | + "Gradients of vector fields located at 'u' and 'v' points are themselves located at tracer points, \"halfway\" between adjacent grid cell edges. The meridional and zonal gradients of vector fields, e.g., horizontal ocean velocity, yield four gradient components:\n", |
| 1590 | + "\n", |
| 1591 | + "1. Zonal gradient of the **zonal component** of the vector ($\\partial{u_\\lambda}/\\partial{\\lambda}$)\n", |
| 1592 | + "\n", |
| 1593 | + "1. Zonal gradient of the **meridional component** of the vector ($\\partial{v_\\phi}/\\partial{\\lambda}$)\n", |
| 1594 | + "\n", |
| 1595 | + "1. Meridional gradient of the **meridional component** of the vector ($\\partial{v_\\phi}/\\partial{\\phi}$)\n", |
| 1596 | + "\n", |
| 1597 | + "1. Meridional gradient of the **zonal component** of the vector ($\\partial{u_\\lambda}/\\partial{\\phi}$)\n", |
| 1598 | + "\n", |
| 1599 | + "Two of these gradients $\\partial{v_\\phi}/\\partial{\\lambda} - \\partial{u_\\lambda}/\\partial{\\phi}$ comprise the vorticity or curl of the flow field, while the other two $\\partial{u_\\lambda}/\\partial{\\lambda} + \\partial{v_\\phi}/\\partial{\\phi}$ comprise the divergence of the flow field.\n", |
1592 | 1600 | "\n", |
1593 | 1601 | "\n", |
1594 | 1602 | "The recipe is as follows:\n", |
| 1603 | + "\n", |
1595 | 1604 | "1. interpolate the 'x' and 'y' components of the flow field, u_x and v_y respectively, to the grid cell centers\n", |
1596 | | - "1. rotate the u_x and v_y vectors from the orthogonal 'x-y' basis to the orthogonal *lambda-phi* basis, the basis of parallels and meridians to make the u_lambda and v_phi vectors. \n", |
| 1605 | + "\n", |
| 1606 | + "1. rotate the u_x and v_y vectors from the orthogonal 'x-y' basis to the orthogonal *lambda-phi* basis, the basis of parallels and meridians to make the u_lambda and v_phi vectors.\n", |
| 1607 | + "\n", |
1597 | 1608 | "1. calculate the gradients of 'u_lambda' and 'v_phi' with respect to the model's 'x' direction to make *du_lambda_dx* and *dv_phi_dx* vectors\n", |
| 1609 | + "\n", |
1598 | 1610 | "1. calculate the gradients of 'u_lambda' and 'v_phi' with respect to the model's 'y' direction to make *du_lambda_dy* and *dv_phi_dy* vectors\n", |
| 1611 | + "\n", |
1599 | 1612 | "1. interpolate the four gradients to the tracer points\n", |
1600 | | - "1. rotate the four gradients of the zonal flow with respect to 'x' and 'y' to the zonal and meridional directions to make the *du_lambda_dphi* and *du_lambda_dlambda* vectors \n", |
1601 | | - "1. rotate the gradients of the meridional flow with respect to 'x' and 'y' to the zonal and meridional directions to make the *dv_phi_dphi* and *dv_phi_dlambda* vectors \n", |
| 1613 | + "\n", |
| 1614 | + "1. rotate the four gradients of the zonal flow with respect to 'x' and 'y' to the zonal and meridional directions to make the *du_lambda_dphi* and *du_lambda_dlambda* vectors\n", |
| 1615 | + "\n", |
| 1616 | + "1. rotate the gradients of the meridional flow with respect to 'x' and 'y' to the zonal and meridional directions to make the *dv_phi_dphi* and *dv_phi_dlambda* vectors\n", |
| 1617 | + "\n", |
1602 | 1618 | "\n", |
1603 | 1619 | "Note: for vorticity calculations we could use 1) *dv_phi_dlambda* and *du_lambda_dphi* or 2) *dv_y_dx* and *du_x_dy*. Vorticity calculated using *dv_phi_dlambda* and *du_lambda_dphi* is calculated at tracer points while vorticity calculated using *dv_y_dx* and *du_x_dy* are calculated at the so-called zeta points (the grid cell corners of tracer cells). Vorticity calculated at zeta points may be more accurate than those calculated at tracer points because fewer interpolations are required. The calculation of vorticity on the zeta points is the subject of a different tutorial.\n", |
1604 | 1620 | "\n", |
|
2371 | 2387 | "tags": [] |
2372 | 2388 | }, |
2373 | 2389 | "source": [ |
2374 | | - "## Calculating zonal and meridional gradients of vector ECCO fields located on the grid cell centers\n", |
| 2390 | + "## Calculating gradients of vector fields located on the grid cell centers (wind stress curl)\n", |
2375 | 2391 | "\n", |
2376 | 2392 | "In ECCO llc state estimates the atmosphere forcing vector fields (surface winds/wind stress) are located at the grid cell centers (i.e., the tracer points). It is important to note that, in contrast, horizontal vector fields generated by the model like horizontal velocity (UVEL,VVEL) and horizontal advective and diffusive fluxes are located at the grid cell edges ('u' and 'v' points). \n", |
2377 | 2393 | "\n", |
2378 | | - "The meridional and zonal gradients of these vector fields are comprised of four vectors:\n", |
2379 | | - "1. Zonal gradient of the **zonal component** of the vector \n", |
2380 | | - "1. Zonal gradient of the **meridional component** of the vector \n", |
2381 | | - "1. Meridional gradient of the **meridional component** of the vector \n", |
2382 | | - "1. Meridional gradient of the **zonal component** of the vector \n", |
| 2394 | + "The meridional and zonal gradients of these vector fields yield four gradient components:\n", |
| 2395 | + "\n", |
| 2396 | + "1. Zonal gradient of the **zonal component** of the vector\n", |
| 2397 | + "\n", |
| 2398 | + "1. Zonal gradient of the **meridional component** of the vector\n", |
| 2399 | + "\n", |
| 2400 | + "1. Meridional gradient of the **meridional component** of the vector\n", |
| 2401 | + "\n", |
| 2402 | + "1. Meridional gradient of the **zonal component** of the vector\n", |
| 2403 | + "\n", |
2383 | 2404 | "\n", |
2384 | 2405 | "\n", |
2385 | 2406 | "The recipe is as follows. It is the same as the recipe for the vector fields located on grid cell edges, except with the first interpolation step omitted:\n", |
2386 | | - "1. rotate the u_x and v_y vectors from the orthogonal 'x-y' basis to the orthogonal *lambda-phi* basis, the basis of parallels and meridians to make the u_lambda and v_phi vectors. \n", |
| 2407 | + "\n", |
| 2408 | + "1. rotate the u_x and v_y vectors from the orthogonal 'x-y' basis to the orthogonal *lambda-phi* basis, the basis of parallels and meridians to make the u_lambda and v_phi vectors.\n", |
| 2409 | + "\n", |
2387 | 2410 | "1. calculate the gradients of 'u_lambda' and 'v_phi' with respect to the model's 'x' direction to make *du_lambda_dx* and *dv_phi_dx* vectors\n", |
| 2411 | + "\n", |
2388 | 2412 | "1. calculate the gradients of 'u_lambda' and 'v_phi' with respect to the model's 'y' direction to make *du_lambda_dy* and *dv_phi_dy* vectors\n", |
| 2413 | + "\n", |
2389 | 2414 | "1. interpolate the four gradients to the tracer points\n", |
2390 | | - "1. rotate the four gradients of the zonal flow with respect to 'x' and 'y' to the zonal and meridional directions to make the *du_lambda_dphi* and *du_lambda_dlambda* vectors \n", |
2391 | | - "1. rotate the gradients of the meridional flow with respect to 'x' and 'y' to the zonal and meridional directions to make the *dv_phi_dphi* and *dv_phi_dlambda* vectors \n", |
| 2415 | + "\n", |
| 2416 | + "1. rotate the four gradients of the zonal flow with respect to 'x' and 'y' to the zonal and meridional directions to make the *du_lambda_dphi* and *du_lambda_dlambda* vectors\n", |
| 2417 | + "\n", |
| 2418 | + "1. rotate the gradients of the meridional flow with respect to 'x' and 'y' to the zonal and meridional directions to make the *dv_phi_dphi* and *dv_phi_dlambda* vectors\n", |
| 2419 | + "\n", |
2392 | 2420 | "\n", |
2393 | 2421 | "### Preliminaries: Load fields" |
2394 | 2422 | ] |
|
0 commit comments