+Add and use the new interface field_checksum#841
Merged
Hallberg-NOAA merged 3 commits intoFeb 24, 2025
Conversation
Added the new publicly visible interface field_checksum to return the checksum that is used to verify the arrays that are written to or read from files, while handling both the unscaling and rotation of the arrays. The 5 internal rotated_field_chksum_real_... functions were renamed to field_checksum_real_... to reflect their slightly broadened purpose and now have new optional unscale arguments. The previous rotated_field_chksum interface has been retained because it is still being used in SIS2, but this may change in the future. All answers are bitwise identical, but there is a new public function interface and a new optional argument to a preexisting one.
Use field_checksum in get_depth_list_checksum to relocate two rescaling factors into unscale arguments and work in scaled internal variables in that routine. All answers are bitwise identical.
Use field_checksum and its unscale argument in save_restart and restore_state to avoid 10 instances of array-syntax math which are unnecessary in most cases because the conversion factor is 1. All answers are bitwise identical.
marshallward
approved these changes
Feb 23, 2025
Member
marshallward
left a comment
There was a problem hiding this comment.
Renaming rotated_field_chksum to the more general field_checksum looks good to me. And fewer scaling parameters in the equations is always a win. I approve this.
There may be some confusion now that the MOM6 field_checksum alongside the framework's field_chksum. It might be helpful to rename field_chksum to fms_field_chksum in files where both are present.
Member
Author
|
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26494. |
This was referenced Apr 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR consists of three commits that first add the new publicly visible interface
field_checksum()to return the checksums that are used to verify that the arrays that written to or read from files are correct, and then uses this new interface inget_depth_list_checksum(),save_restart()andrestore state().The new
field_checksum()interface includes the options to handle both the unscaling and rotation of the arrays. The 5 internalrotated_field_chksum_real_...()functions were renamed tofield_checksum_real_...()to reflect their slightly broadened purpose and now have new optionalunscalearguments. The previousrotated_field_chksum()interface has been retained because it is still being used in SIS2, but this may change in the future.The refactoring of
get_depth_list_checksum()allows it to work in scaled units for dimensional consistency verification. The changes insave_restart()andrestore_state()eliminate a total of 10 instances of array-syntax math which are unnecessary in most cases because the conversion factor is 1.All answers and output are bitwise identical, but there is a new publicly visible interface,
field_checksum(). The specific commits in this PR include: