-
Notifications
You must be signed in to change notification settings - Fork 64
Add diagnostic metadata property to constituents object; use existing diagnostic name metadata attribute #695
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
base: develop
Are you sure you want to change the base?
Conversation
…e default metadata field
dustinswales
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look fine to me.
At the moment I don't see a use case for them on the NOAA side, but the added functionality doesn't hurt.
gold2718
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to say about this. This seems mostly fine (see minor request) but I think you have implemented the diagnostic_name_fixed property. I think we need to just revisit these properties and decide what we will want in the future.
scripts/var_props.py
Outdated
| maxlen = 256 | ||
| diag_name = stdname[:maxlen] if len(stdname) > maxlen else stdname |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
From https://docs.python.org/3/library/stdtypes.html#text-sequence-type-str
"The slice of s from i to j is defined as the sequence of items with index k such that i <= k < j. If i or j is greater than len(s), use len(s)."
| maxlen = 256 | |
| diag_name = stdname[:maxlen] if len(stdname) > maxlen else stdname | |
| maxlen = 256 | |
| diag_name = stdname[:maxlen] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@peverwhee Do you have an answer to this question?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes sorry for the delay! I've pushed up @gold2718 's suggested change
|
@climbfuji This PR needs a review from the NEPTUNE side |
climbfuji
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know a lot about this part of the code but from what I understand it makes sense. Please address @gold2718's question/comment before merging.
|
@peverwhee Just checking in on the status of this PR. It'll need updating to the top of develop, and addressing Steve's latest question. |
|
thanks for the ping, @mkavulich ! I've re-requested @gold2718 's review |
Add
diagnostic_nameto the constituent properties object and enable setting via instantiate calls and metadata attributes.Includes:
src/ccpp_constituent_prop_mod.F90to add thevar_diag_nameproperty and set it via instantiate. Also includes methods to retrieve the diagnostic name for a given constituent.scripts/metadata.pyandscripts/var_props.pyto include a default diagnostic name (set to local name)User interface changes?: Yes - all calls to
%instantiate(dynamic, run-time constituents created during the register phase) must now include the diagnostic name in the argument list. This only impacts CAM-SIMA right now because that's the only host model using the dynamic constituents, to my knowledge.closes #635