+Add a vector of defaults to get_param_array_int()#791
Merged
marshallward merged 2 commits intoNOAA-GFDL:dev/gfdlfrom Jan 2, 2025
Merged
Conversation
The `default=` optional argument to get_param() only provides a uniform value to initialize an array of integers. This commit adds an optional `defaults=` argument to get_param_int_array(), doc_param_int_array() and log_param_int_array() to allow for the specification of an array of default values. These additions are analogous to what had previously been added for real arrays in github.com/NOAA-GFDL/pull/760. This commit also adds the new internal function int_array_string(), analogous to real_array_string(), in MOM_document. This differs slightly from its real array counterpart in that it only uses the syntax like `3*75` for lists of integers that are longer than we would use to specify dates and times or pairs of layout parameters, because "(0, 0)" seems more readily interpretable than "(2*0)". The new defaults argument is now used in the get_param calls for LAYOUT and IO_LAYOUT, and in setting the tidal reference dates. Several spelling errors in comments were also corrected in the files that were being edited. All answers are bitwise identical, but there are minor changes in many MOM_parameter_doc.layout files and some MOM_parameter_doc.all files.
Merged
marshallward
approved these changes
Jan 2, 2025
Member
marshallward
left a comment
There was a problem hiding this comment.
I approve this, legacy (/ array /) syntax and all.
Member
|
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/mom6ci/MOM6/-/pipelines/25920 ✔️ 🟡 Expected parameter diffs; full arrays are now reported under default: |
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.
The
default=optional argument toget_param()only provides a uniform value to initialize an array of integers. This commit adds an optionaldefaults=argument toget_param_int_array(),doc_param_int_array()andlog_param_int_array()to allow for the specification of an array of default values. These additions are analogous to what had previously been added for real arrays in /pull/760.This commit also adds the new internal function
int_array_string(), analogous toreal_array_string(), inMOM_document. This differs slightly from its real array counterpart in that it only uses the syntax like3*75for lists of integers that are longer than we would use to specify dates and times or pairs of layout parameters, because "(0, 0)" seems more readily interpretable than "(2*0)".The new defaults argument is now used in the
get_param()calls forLAYOUTandIO_LAYOUT, and in setting the tidal reference dates.Several spelling errors in comments were also corrected in the files that were being edited.
All answers are bitwise identical, but there are minor changes in many
MOM_parameter_doc.layoutfiles and someMOM_parameter_doc.allfiles.