Skip to content

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

Merged
Hallberg-NOAA merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
adcroft:inline-remove-remaap-via-sub-cells
Aug 1, 2024
Merged

Removes remap_via_sub_cells(), moving code into remapping_core_h()#693
Hallberg-NOAA merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
adcroft:inline-remove-remaap-via-sub-cells

Conversation

@adcroft
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@adcroft adcroft deleted the inline-remove-remaap-via-sub-cells branch October 24, 2024 13:27
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