Skip to content

Generalized indices: interpolator_mod#1878

Merged
vithikashah001 merged 4 commits into
NOAA-GFDL:mainfrom
J-Lentz:generalized_indices_interpolator
Jun 1, 2026
Merged

Generalized indices: interpolator_mod#1878
vithikashah001 merged 4 commits into
NOAA-GFDL:mainfrom
J-Lentz:generalized_indices_interpolator

Conversation

@J-Lentz
Copy link
Copy Markdown
Contributor

@J-Lentz J-Lentz commented May 28, 2026

Description
Add generalized indices support to interpolator_mod via a new dim_order argument, which has been added to the 2D, 3D, and 4D variants of the interpolator subroutine.

How Has This Been Tested?
Builds on the AMD box and tests pass using ifx 2025.2.0 and GCC 15.2.0.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • New check tests, if applicable, are included
  • make distcheck passes

Jesse Lentz added 2 commits May 28, 2026 05:36
Add generalized indices support to interpolator_mod and enable the unit tests.
Copy link
Copy Markdown
Contributor

@uramirez8707 uramirez8707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment, but it looks good otherwise.

Comment thread interpolator/include/interpolator.inc Outdated
end select
end do

interp_data = reshape(interp_buf, shape(interp_data), order=dim_map)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this so that it only happens if the dim_map is not the default [1, 2, 3, 4]? Not sure if there is a performance penalty for doing this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2b309ec avoids the temporary buffer unless it's actually needed, and prints a NOTE when it's used. Only applicable to the 3D and 4D cases, since the reshape operation just replaces a copy operation in the 2D case, and therefore doesn't add an additional unnecessary copy.

@vithikashah001 vithikashah001 merged commit 361511c into NOAA-GFDL:main Jun 1, 2026
18 of 19 checks passed
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

Successfully merging this pull request may close these issues.

3 participants