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

test_horiz_interp: Don't over-allocate arrays #1607

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

J-Lentz
Copy link
Contributor

@J-Lentz J-Lentz commented Oct 28, 2024

Description
In the horiz_interp_type assignment 1x2d bicubic test, there are four allocatable arrays for which the number of elements allocated exceeds the number that get initialized:

  • lon_src_1d
  • lat_src_1d
  • lon_out_1d
  • lat_out_1d

This PR shortens the sizes of the arrays to match the number of elements that get initialized.

Fixes horiz_interp tests 23-24 with ifort using strict debug flags. It also fixes the tests with the Cray compiler. I'm requesting a careful review from @rem1776, because while this change does make the tests pass, I'm not sure whether or not the over-allocation may be a deliberate part of the test.

How Has This Been Tested?
horiz_interp tests build, run, and pass with CCE 18 on C5 and with ifort using the following debug flags:

-check all -fpe0 -fp-stack-check -fstack-security-check -ftrapuv -init=arrays,minus_huge,snan

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

In the horiz_interp_type assignment 1x2d bicubic test, there are four
allocatable arrays for which the number of elements allocated exceeds the number
that get initialized:

* `lon_src_1d`
* `lat_src_1d`
* `lon_out_1d`
* `lat_out_1d`

This PR shortens the sizes of the arrays to match the number of elements that
get initialized.
Copy link
Contributor

@rem1776 rem1776 left a comment

Choose a reason for hiding this comment

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

@J-Lentz Yeah this wasn't intentional, not sure why exactly they have one extra index. Thanks for the fix!

@rem1776 rem1776 merged commit 7a73eaa into NOAA-GFDL:main Oct 31, 2024
28 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