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

+Refactor homogenize_field and revise its interface #777

Merged

Conversation

Hallberg-NOAA
Copy link
Member

Refactored the homogenize_field() routine in MOM_horizontal_regridding to make use of the unscale argument to reproducing_sum(), and revised its interface to make it more nearly consistent with the interface to homogenize_field_t() in MOM_forcing_type.

The interface changes include revising the order of the arguments, making the weight argument options, replacing the scale argument with an optional tmp_scale argument that is the inverse of the previous scale, and making the default for the use of reproducing sums to be true when the answer_date argument is absent. The two homogenize_field routines now give equivalent behavior when none of the optional arguments to homogenize_field() are absent. The homogenize_field() calls in MOM_temp_salt_initialize_from_Z() and the horiz_interp_and_extrap_tracer() routines have been modified in accordance with the interface changes.

All answers are bitwise identical, but the interface to a publicly visible routine has been substantially changed to the point where any calls using the previous interface will not compile.

@Hallberg-NOAA Hallberg-NOAA added the refactor Code cleanup with no changes in functionality or results label Dec 12, 2024
Copy link

@MJHarrison-GFDL MJHarrison-GFDL left a comment

Choose a reason for hiding this comment

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

It is unlikely that the public interface is being used with the optional arguments outside of the MOM6 repository, so it is safe to make the change.

  Refactored the homogenize_field routine in MOM_horizontal_regridding to make
use of the unscale argument to reproducing_sum(), and revised its interface to
make it more nearly consistent with the interface to homogenize_field_t() in
MOM_forcing_type.

  The interface changes include revising the order of the arguments, making the weight
argument options, replacing the scale argument with an optional tmp_scale
argument that is the inverse of the previous scale, and making the default for
the use of reproducing sums to be true when the answer_date argument is absent.
The two homogenize_field routines now give equivalent behavior when none of the
optional arguments to homogenize_field() are absent.  The homogenize_field calls
in MOM_temp_salt_initialize_from_Z() and the horiz_interp_and_extrap_tracer()
routines have been modified in accordance with the interface changes.

  All answers are bitwise identical, but the interface to a publicly visible
routine has been substantially changed to the point where any calls using the
previous interface will not compile.
@Hallberg-NOAA Hallberg-NOAA force-pushed the refactor_homogenize_field branch from 3babe99 to 7e7d994 Compare January 7, 2025 23:23
@Hallberg-NOAA
Copy link
Member Author

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

@Hallberg-NOAA Hallberg-NOAA merged commit db94db8 into NOAA-GFDL:dev/gfdl Jan 8, 2025
10 checks passed
@Hallberg-NOAA Hallberg-NOAA deleted the refactor_homogenize_field branch January 14, 2025 18:55
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.

3 participants