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.
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
Constituent index lookup #622
base: develop
Are you sure you want to change the base?
Constituent index lookup #622
Changes from all commits
949afbc
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
General design question - what is the anticipated usage of these interfaces on the physics side?
As written, the code would return
int_unassigned
for the index if the provided constituent isn't present. So would it be expected that the physics would check forint_unassigned
after callingccpp_constituent_index
?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.
Great question. The benefit I see in returning
int_unassigned
is you can include logic for handling configurations that do not have all the constituents you might be looking for. On the other hand, it complicates just looking forerrcode
. Feedback @climbfuji, @dustinswales, everyone?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.
@gold2718 @peverwhee I haven't thought through how we would tackle implementing the constituents feature in the UFS, so I don't have a strong opinion. On the physics side, having to check that
index ne int_unassigned
before using index seems sensible to me. At least with my (limited) understanding.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 think this makes sense. Someone may want to iterate over constituents to see what is available and what not. That is, not every call to this scheme should result in errflg /= success.
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.
maybe a slightly clearer error message?
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.
would it be worthwhile to also test that calling
ccpp_constituent_indices
with a constituent that's NOT in the object doesn't produce an error?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.
Yep, will do, good call.