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

Fix index conversion int32 vs int64 #555

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion model/common/src/icon4py/model/common/grid/vertical.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def index(self, domain: Domain) -> gtx.int32:
assert (
0 <= index <= self._bottom_level(domain)
), f"vertical index {index} outside of grid levels for {domain.dim}"
return index
return gtx.int32(index)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The problem is 4 lines up, when we do index += domain.offset, and the default initialization to 0 of offset in Domain.
This file seems to require more cleanup and a strategy for doing this as there are sprinkled many gtx.int32 inconsistently...


def _bottom_level(self, domain: Domain) -> gtx.int32:
return gtx.int32(self.size(domain.dim))
Expand Down
Loading