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

+Add the optional argument old_name to get_param() #796

Open
wants to merge 1 commit into
base: dev/gfdl
Choose a base branch
from

Conversation

Hallberg-NOAA
Copy link
Member

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//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.

  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.
@Hallberg-NOAA Hallberg-NOAA added the enhancement New feature or request label Jan 5, 2025
@Hallberg-NOAA Hallberg-NOAA mentioned this pull request Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants