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

remove separate u/v mask used for prints #1073

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

travissluka
Copy link
Collaborator

@travissluka travissluka commented Sep 18, 2024

Description

In order to keep answers from changing when I did a massive C++ refactoring of fields, I added a hack where the U/V fields had a second mask (the true u/v mask) added to the atlas metadata (this was in addition to the interpolation mask, which was the T mask). So that @fmahebert can make progress with regard to having a single "mask" metadata that the generic algorithms can use, I have removed this second mask.

This only impacts the print statements for U/V fields, not any real results.

This is, again, a bit of a hack, U/V fields should not be using the cell center mask, but this will all get sorted out when u/v de-staggering is re-implemented in the variable changes.

Due to these changes, the convert state application should not be used to do a resolution change with uocn and vocn (or you could still use it, and make sure your results don't have missing values in them, the problem at this point is illegal floating point operations where the u/v and t masks don't line up... fix that some other day)

Testing

The reference values for u and v prints for all tests had to be updated

run-ci-on-draft=true
jedi-ci-test-select=clang

@travissluka travissluka self-assigned this Sep 18, 2024
@travissluka travissluka added the bug Something is not working label Sep 18, 2024
@travissluka travissluka marked this pull request as draft September 18, 2024 19:36
@travissluka travissluka marked this pull request as ready for review September 18, 2024 21:34
Copy link
Collaborator

@kbhargava kbhargava left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -142,9 +147,9 @@ void Fields::print(std::ostream & os) const {
const auto & vGhost = atlas::array::make_view<int, 1>(field.functionspace().ghost());
const auto & view = atlas::array::make_view<double, 2>(field);
std::unique_ptr<atlas::array::ArrayView<double, 2> > mask;
if (field.metadata().getBool("masked")) {
if (field.metadata().has(MASK_METADATA)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

There is similar logic at line ~108 above, in the norm method. Did you want to make the same change there? Or is there a reason I'm missing to treat norm differently from print...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, you're right, nice catch! My grep skills have seemingly diminished lately.

@travissluka travissluka marked this pull request as draft September 20, 2024 22:01
@travissluka travissluka marked this pull request as ready for review September 20, 2024 22:13
Copy link
Contributor

@fmahebert fmahebert left a comment

Choose a reason for hiding this comment

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

Not a soca expert review, but this matches what I would expect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get rid of the separate "mask" atlas metadata being used by soca
3 participants