DART icon indicating copy to clipboard operation
DART copied to clipboard

Feature request: Barycentric interpolation module

Open johnsonbk opened this issue 1 year ago • 2 comments

Use case

A few types of grid topologies require barycentric interpolation in order to implement the model_interpolate subroutine in model_mod.F90:

  1. Unstructured triangular grids used in oceanographic models such as FVCOM
  2. The vertices of cube sphere grids in atmospheric models such as CAM-SE and Aether cube sphere
  3. The Voronoi cells in both atmospheric and oceanographic models such as MPAS-A and MPAS-O

Is your feature request related to a problem?

There are subroutines used to implement barycentric interpolation in the MPAS-A model_mod that are copied and pasted into the Aether cube sphere model mod. When implementing the FVCOM model_mod, these subroutines would be copied and pasted into a third model_mod.

Describe your preferred solution

Since these subroutines are so useful for so many models, they should be separated into their own barycentric utilities module in order to minimize code duplication.

Describe any alternatives you have considered

Keeping with the status quo and copying and pasting the same code into different model_mods.

johnsonbk avatar Nov 05 '24 17:11 johnsonbk

Ben do you have this code already with your FVCOM work? I'd like to set up some interpolation tests (with an eye on the future when the unstructured mesh/grid info is so big we can't have a copy of the grid info on each processor).

hkershaw-brown avatar Nov 05 '24 17:11 hkershaw-brown

I haven't copied the barycentric subroutines yet for FVCOM. I was going to implement the model_interpolate as one of the later subroutines. The PNNL folks seem to use FVCOM for a lot of things though, so I can ask them for a very high resolution grid if that would help.

johnsonbk avatar Nov 05 '24 18:11 johnsonbk