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

Removes remap_via_sub_cells(), moving code into remapping_core_h() #693

Merged

Conversation

adcroft
Copy link
Member

@adcroft adcroft commented Jul 25, 2024

This PR addresses a \todo added in #662, namely that the functions remap_via_sub_cells() and remap_via_sub_cells_om4() could, and should, be moved up into remapping_core_h(), as well as into the obsolete remapping_core_w().

In that PR, the function remap_via_sub_cells() had been modularized into three other functions, and the near-duplicate remap_via_sub_cells_om4(), called two of the same functions as well as an out-of-date version of the third function.

Since the remapping_core_h() function calls is already brief, calling one function in addition to remap_via_sub_cells(), and since remap_via_sub_cells() is only called from remapping_core_*(), we can remove a level of call-tree depth depth by copying remap_via_sub_grid() into reampping_core_h() and removing the unused function(s).

@adcroft adcroft added the refactor Code cleanup with no changes in functionality or results label Jul 25, 2024
Copy link
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

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

These changes seem very sensible to me.

…_h()

This commit addresses a `\todo` added in NOAA-GFDL#662, namely that
the functions remap_via_sub_cells() and remap_via_sub_cells_om4() could,
and should, be moved up into remapping_core_h(), as well as into the
obsolete remapping_core_w().

In that PR, the function remap_via_sub_cells() had been modularized into
three other functions, and the near-duplicatem remap_via_sub_cells_om4(),
called the two of the same functions as well as an out-of-date version of
the third function.

Since the reampping_core_h() function calls is already brief, calling one
function in addition to remap_via_sub_cells(), and since
remap_via_sub_cells() is only called from remapping_core_*(), we can remove
a level of call-tree depth depth by copying remap_via_sub_grid() into
reampping_core_h() and removing the unused function(s).
@Hallberg-NOAA Hallberg-NOAA force-pushed the inline-remove-remaap-via-sub-cells branch from eb7a5c9 to 3069058 Compare August 1, 2024 07:52
@Hallberg-NOAA
Copy link
Member

This has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/24326.

@Hallberg-NOAA Hallberg-NOAA merged commit 87a0c61 into NOAA-GFDL:dev/gfdl Aug 1, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code cleanup with no changes in functionality or results
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants