+Add the optional argument old_name to get_param()#796
Merged
Hallberg-NOAA merged 1 commit intoNOAA-GFDL:dev/gfdlfrom Jan 15, 2025
Merged
+Add the optional argument old_name to get_param()#796Hallberg-NOAA merged 1 commit intoNOAA-GFDL:dev/gfdlfrom
Hallberg-NOAA merged 1 commit intoNOAA-GFDL:dev/gfdlfrom
Conversation
Merged
herrwang0
reviewed
Jan 15, 2025
herrwang0
left a comment
There was a problem hiding this comment.
This PR looks correct to me.
I only have two very minor comments:
- See the comment in subroutine
get_param_*. - It looks like none of the individual
obsolete_*subroutines are used outside ofMOM_obsolete_params, so thepublicdeclaration in line 15 seems unnecessary. But this issue may not be pertinent to this PR.
herrwang0
reviewed
Jan 15, 2025
Added the new optional argument old_name to the 8 get_param() routines. This new capability allows for an archaic parameter name to be specified and for appropriate warnings encouraging the user to migrate to using the new name while still setting the parameter as intended, or error messages in the case of inconsistent setting via the archaic name and the correct name. The logging inside of the MOM_parameter_doc files only uses the correct parameter name. Also added the new optional argument set to the 8 read_param routines, to indicate whether a parameter has been found and successfully set. The new set argument is now being used in read_param() calls in obsolete_int(), obsolete_real(), obsolete_char() and obsolete_logical(). Obsolete_logical() in particular was substantially simplified by the use of this new argument, and is now only about half as long as it was. The read_param() set argument is also used in all of the get_param() routines when they are given an old_name argument. The new old_name argument to get_param() is not yet being used in the version of the MOM6 code that is being checked in, but it has been tested extensively by adding or modifying get_param calls in a variant of the initialization code, and it will be used in an updated version of github.com/NOAA-GFDL/pull/725 to gracefully handle the deprecation of 4 parameter names. All answers are bitwise identical, but there are new optional arguments to two widely used interfaces.
b485edc to
3fb5718
Compare
herrwang0
approved these changes
Jan 15, 2025
marshallward
approved these changes
Jan 15, 2025
Member
Author
|
This PR has passed pipeline testing at https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/26069. |
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.
Added the new optional argument
old_nameto the 8get_param()routines. This new capability allows for an archaic parameter name to be specified and for appropriate warnings encouraging the user to migrate to using the new name while still setting the parameter as intended, or error messages in the case of inconsistent setting via the archaic name and the correct name. The logging inside of theMOM_parameter_docfiles only uses the correct parameter name.Also added the new optional argument set to the 8
read_param()routines, to indicate whether a parameter has been found and successfully set. The new set argument is now being used inread_param()calls inobsolete_int(),obsolete_real(),obsolete_char()andobsolete_logical().Obsolete_logical()in particular was substantially simplified by the use of this new argument, and is now only about half as long as it was. Theread_param()set argument is also used in all of theget_param()routines when they are given anold_nameargument.The new
old_nameargument toget_param()is not yet being used in the version of the MOM6 code that is being checked in, but it has been tested extensively by adding or modifyingget_param()calls in a variant of the initialization code, and it will be used in an updated version of github.com//pull/725 to gracefully handle the deprecation of 4 parameter names.All answers are bitwise identical, but there are new optional arguments to two widely used interfaces.