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 units to index_for_diagnostic_printout metadata to avoid ccpp_prebuild.py error #517

Closed
wants to merge 1 commit into from

Conversation

grantfirl
Copy link
Collaborator

A one line change that avoids an error in ccpp_prebuild.py.

(Note that ccpp_prebuild.py errors out ungracefully during units checking if one of the units is empty.)

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to fix the ccpp-framework behavior?

@grantfirl
Copy link
Collaborator Author

Do we need to fix the ccpp-framework behavior?

Not on my account. When this happens, I just go into ccpp_prebuild.py and add some output to find out which variable is causing the problem. I don't know if this is the same as capgen's behavior or not, but perhaps @JulieSchramm already has a test for this (what happens when one of the units attributes are empty)?

@grantfirl
Copy link
Collaborator Author

Shall I go ahead and merge this or wait for further approvals?

FOR OTHER REPO WATCHERS, THIS AFFECTS THE SCM ONLY. THERE WAS NO ERROR PRESENT FOR FV3/UFS.

@climbfuji
Copy link
Collaborator

Argh, I forgot the UFS part. @dustinswales can you pull this SCM-only change into your RRTMGP PR? I know it requires updating the cascade of submodule pointers one more time, but if you don't mind ... If not, no problem. Thanks!

@dustinswales
Copy link
Collaborator

@climbfuji
Not a problem. Done

@climbfuji
Copy link
Collaborator

@climbfuji
Not a problem. Done

Thanks a lot!

@climbfuji
Copy link
Collaborator

This PR has been pulled into #514 and will be merged as part of it - do not merge manually.

@grantfirl
Copy link
Collaborator Author

@climbfuji
Not a problem. Done

Yes, thanks @dustinswales .

@grantfirl
Copy link
Collaborator Author

This PR has been pulled into #514 and will be merged as part of it - do not merge manually.

OK, since NCAR/ccpp-scm#213 requires this to work, I'll wait to merge that too.

@climbfuji
Copy link
Collaborator

This PR has been pulled into #514 and will be merged as part of it - do not merge manually.

OK, since NCAR/gmtb-scm#213 requires this to work, I'll wait to merge that too.

Should be done on Thursday (tomorrow is a federal holiday).

@JulieSchramm
Copy link

capgen will catch a missing "units" attribute (the whole units line is missing)
capgen will not catch a units = (blank units attribute)
capgen will not catch a bogus units = banana

So type carefully!

@grantfirl
Copy link
Collaborator Author

capgen will catch a missing "units" attribute (the whole units line is missing)
capgen will not catch a units = (blank units attribute)
capgen will not catch a bogus units = banana

So type carefully!

Thanks, @JulieSchramm . IMO, it's less about "us" typing carefully and more about what to accept/reject when reviewing others contributions. Since capgen doesn't catch a (units = [blank]) attribute, does it also error out ungracefully when trying to compare a non-empty string to an empty one? If so, depending on what kind of status updates or logging verbosity is set, maybe capgen will provide enough information for a user to find the issue without too much trouble. With ccpp_prebuild, my problem was that it errored out telling me that it couldn't compare an empty string, but you had no idea which variable amongst the thousands was causing the error using the default (no/low) logging. I think that if you turned on DEBUG level of logging that it would have let you know which variable caused the problem, though, so it wasn't that big of a deal.

@gold2718
Copy link

Is units = really valid? Perhaps capgen should generate an error for this condition (in which case, please open an issue there).
And who says banana is not a valid unit?

@climbfuji
Copy link
Collaborator

climbfuji commented Nov 12, 2020

Is units = really valid? Perhaps capgen should generate an error for this condition (in which case, please open an issue there).
And who says banana is not a valid unit?

See NCAR/ccpp-framework#336

banana is for sure a valid unit! In human history, a lot of bananas have been sold or traded per piece and not per weight) I suppose ;-)

@climbfuji
Copy link
Collaborator

This bugfix was merged as part of #514.

@climbfuji climbfuji closed this Nov 13, 2020
HelinWei-NOAA pushed a commit to HelinWei-NOAA/ccpp-physics that referenced this pull request Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants