There are 3 sets of IDL procedures, one for each method and each has two variants a) to process GHCN V3C and b) to process Hadcrut4.5 using Crutem4 station files, both using Hadsst3 Ocean temperature data. You can download each one as follows
  1. 2-D triangulation
    1. V3-2D-tri-average.pro
    2. Had4-2D-tri-average.pro
  2. 3-D triangulation
    1. V3-tri-sphere-average.pro
    2. H4-tri-sphere-average.pro
  3. Icosahedron Binning
    1. V3-Isoc.pro
    2. H4-Isoc.pro
The Icosahedral binning uses the following routines which can be placed at the end of the above procedures or in your IDL library. In addition you may need this routine nint.pro which just calculates the nearest integer.

It should not be too difficult to adapt them to other programming languages.