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

Simplify argument lists of subroutines in get_grid_version_mod #1514

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

J-Lentz
Copy link
Contributor

@J-Lentz J-Lentz commented May 8, 2024

Description
Remove compute domain indices from the argument lists of get_grid_version_1 and get_grid_version_2. Query compute domain indices from mpp_domains_mod and check the lower bounds of lon(:,:) and lat(:,:) at runtime.

Fixes #1371

How Has This Been Tested?
Builds on the AMD box with Intel compiler version 2024.1.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 3 commits May 8, 2024 13:30
Remove compute domain indices from the argument lists of get_grid_version_1 and
get_grid_version_2. Query compute domain indices from mpp_domains_mod at runtime
and check the lower bounds of lon(:,:) and lat(:,:) arguments only if the _DEBUG
macro is defined.

if (lbound(lat,1).ne.isc .or. lbound(lat,2).ne.jsc) then
call mpp_error(FATAL, "get_grid_version_1: Incorrect lower-bound dimensions of lat(isc:,jsc:)")
endif
Copy link
Contributor

Choose a reason for hiding this comment

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

@J-Lentz I noticed this was failing the GNU CI and looked into it a bit since it was coming from a test I wrote in the coupler subdirectory.

I was confused at first why this check kept failing since the passed in array had the right bounds, but after a little digging I realized that when passed in the array bounds get reset from whatever it may be to 1:<size of the array>.

I thought it was a bug but apparently that's how fortans supposed to work(?). I think we can either leave the lower bounds in the argument declaration so it can be checked, or we could just check the size here instead.

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.

clean up get_grid_version routines for data_override
2 participants