Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Barycentric interpolation module #764

Open
johnsonbk opened this issue Nov 5, 2024 · 2 comments
Open

Feature request: Barycentric interpolation module #764

johnsonbk opened this issue Nov 5, 2024 · 2 comments

Comments

@johnsonbk
Copy link
Collaborator

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.

@hkershaw-brown
Copy link
Member

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).

@johnsonbk
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants