Tuesday, September 26, 2017

The best grid for Earth temperature calculation.

Earlier this month, I wrote about the general ideas of gridding, and how the conventional latitude/longitude grids were much inferior to grids that could be derived from various platonic solids. The uses of gridding in calculating temperature (or other field variables) on a sphere are
  1. To gather like information into cells of known area
  2. To form an area weighted sum or average, representative of the whole sphere
  3. a necessary requirement is that it is feasible to work out in which cell an arbitrary location belongs
So a good grid must have cells small enough that variation within them has little effect on the result ("like"), but large enough that they do significant gathering. It is not much use having a grid where most cells are empty of data. This leads to two criteria for cells that balance these needs:
  • The cells should be of approximately equal area.
  • The cells should be compact, so that cells of a given area can maximise "likeness".
Lat/lon fails because:
  • cells near poles are much smaller
  • the cells become long and thin, with poor compactness
I showed platonic solid meshes with triangles and squares that are much less distorted, and with more even area distribution, Clive Best, too, has been looking at icosahedra. I have also been looking at ways of improving area uniformity. But I haven't been thinking much about compactness. The ideal there is a circle. Triangles deviate most; rectangles are better, if nearly square. But better still are regular hexagons, and that is my topic here.

With possibly complex grids, practical usability is important. You don't want to keep having to deal with complicated geometry. With the cubed sphere, I posted  here a set of data which enables routine use with just lookup. It includes a set of meshes with resolution increasing by factors of 2. The nodes have been remapped to optimise area uniformity. There is a lookup process so that arbitrary points can be celled. But there is also a list showing in which cell the stations of the inventory that I use are found. So although the stations that report vary each month, there is a simple geometry-free grid average process
  • For each month, sort the stations by cell label
  • Work out cell averages, then look up cell areas for weighted sum.
I want to do that here for what I think is an optimal grid.

The optimal grid is derived from the triangle grid for icosahedra, although it can also be derived from the dual dodecahedron. If the division allows, the triangles can be gathered into hexagons, except near vertices of the icosahedron, where pentagons will emerge. This works provided the triangles faces are initially trisected, and then further divided. There will be 12 pentagons, and the rest hexagons. I'll describe the mapping for uniform sphere surface area in an appendix.

Lookup

I have realised that the cell finding process can be done simply and generally. Most regular or near-regular meshes are also Voronoi nets relative to their centres. Thatis, a cell includes the points closest to its centre, and not those closer to any other centre. So you can find the cell for a point by simply looking for the closest cell center. For a sphere that is even easier; it is the centre for which the scalar product (cos angle) of 3D coordinates is greatest.

If you have a lot of points to locate, this can still be time-consuming, if mechanical. But it can be sped up. You can look first for the closest face centre (of the icosahedron). Then you can just check the cells within that face. That reduces the time by a factor of about 20.

The grids

Here is a WebGL depiction of the results. I'm using the WebGL facility, V2.1. The sphere is a trackball. You can choose the degree of resolution with the radio buttons on the right; hex122, for example, means a total of 122 cells. They progress with factors of approx 2. The checkboxes at the top let you hide various objects. There are separate objects for red, yellow and green, but if you hide them all, you see just the mesh. The colors are designed to help see the icosahedral pattern. Pentagons are red, surrounded by a ring of yellow.



The grid imperfections now are just a bit of distortion near the pentagons. This is partly because I have forced them to expand to have simiar area to the hexagons. For grid use, the penalty is just a small loss of compactness.

Data

The data is in the form of a R save file, for which I use the suffix .sav. There are two. One here is a minimal set for use. It includes the cell centre locations, areas, and a listing of the cells within each face, for faster search. That is all you need for routine use. There is a data-frame with this information for each of about 8 levels of resolution, with maximum 7682 cells (hex7682). There is a doc string.

The longer data set is here. This has the same levels, but for each there are dataframes for cells, nodes, and the underlying triangular mesh. A dataframe is just R for a matrix that can have columns of various types, suitably labelled. It gives all the nodes of the triangular mesh, with various details. There are pointers from one set to another. there is also a doc string with details.

Appendix - equalising area

As I've occasionally mentioned, I've spent a lot of time on this interesting math problem. The basic mapping from platonic solid to sphere is radial projection. But that distorts areas that were uniform on the solid. Areas near the face centres are projected further (thinking of the solid as within the sphere) and grow. There is also, near the edges, an effect due to the face plane slanting differently to the sphere (like your shadow gets smaller when the sun is high). These distortions get worse when the solid is further from spherical.

I counter this with a mapping which moves the mesh on the face towards the face centre. I initially used various polynomials. But now I find it best to group the nodes by symmetry - subsets that have to move in step. Each has one (if on edge) or two degrees of freedom. Then the areas are also constrained by symmetry, and can be grouped. I use a Newton-Raphson method (actually secant) to move the nodes so that the triangles have area closest to the ideal, which is the appropriate fraction of the sphere. There are fewer degrees of freedom than areas, so it is a kind of regression calculation. It is best least squares, not exact. You can check the variation in areas; it gets down to a few percent.



















12 comments:

  1. It looks like a Callaway golf ball.

    ReplyDelete
    Replies
    1. to 99% of the world's population, it's a soccer ball pattern

      "The buckyball, or "buckminster" ball, is the name given to the most common type of soccer ball today. It's official shape name is a spherical polyhedron but it is affectionately known as the buckyball after Richard Buckminster Fuller, an architect who was trying to find a way to construct buildings with minimum materials, according to Soccer Ball World Website."

      also C60 to us material scientists

      https://en.wikipedia.org/wiki/Richard_Smalley




      Delete
  2. I agree, that's a classical football pattern, equilateral pentagons surrounded by equilateral hexagons, 12 plus 20 in total. With the leathers natural flexibility it becomes a perfect sphere..

    ReplyDelete
  3. Most of the secrets of climate are encoded in the specifics of the earth's rotation.
    One of the recent big mysteries is what causes the 6 year period in the variation of the earth's rotation speed. The source of the variation is more obvious than scientists currently believe:

    http://contextearth.com/2017/09/25/the-6-year-oscillation-in-length-of-day/


    ReplyDelete
    Replies
    1. This is Part II on the earth's rotation. The forcing used for the ENSO model is a 4th harmonic set of long period tidal constituent factors. This is the the out-of-band validation for that forcing against the LOD deviation cross-spectrum:

      http://contextearth.com/2017/09/27/enso-tidal-forcing-validated-by-lod-data/

      Delete
    2. Web/others - found this PDO paper today. To me it's intriguing.

      Delete
    3. JCH,

      First sentence starts: "Unforced climate variability on decadal and longer time scales has garnered much attention, both because of its potential predictability and because it often masks the influence of externally forced climate change. ..."

      The question I have is who decided that this variability is unforced? Is the premise even correct?

      Delete

    4. jch1952September 29, 2017 at 7:53 AM
      Web/others - found this PDO paper today. To me it's intriguing.

      jch1952September 29, 2017 at 8:02 AM
      Disentangling global warming, multi-decadal variability, and El Niño in Pacific temperatures



      Multidecadal variability via modeling of AMO

      http://contextearth.com/2017/10/03/amo/

      Uses the same tidal model as ENSO but relative forcing amplitudes differ.

      Delete
    5. And found the common-mode mechanism linking PDO to AMO

      http://contextearth.com/2017/10/05/pdo/

      Of course its the lunar forcing.

      Delete
  4. Nice work Nick. I like the soccer ball approach. Of course the earth is not quite a sphere, but fairly close. NOAA has been working on this approach for while: FIM Global Model, as you probably know. Like any approach, this one also has to deal with data sparse cells.

    ReplyDelete
    Replies
    1. Thanks, Bryan. I wasn't aware of that FIM use. I had followed GFDL using cubed aphere for GCMs, but not the icosahedra (for FIM). I looked up the paper by Wang and Lee. It's quite good, though I think their optimisation is a bit primitive. maybe it has improved since 2011.

      Delete