Skip to content

Fix ESMF read casting elementConn before checking for padding #1747

Description

@cmdupuis3

_read_esmf casts elementConn to INT_DTYPE and only then compares against INT_FILL_VALUE, so the padding is recognized in neither of the two ways xarray can hand it over. With CF decoding on (mask_and_scale=True, the default), xarray replaces ESMF's -1 with NaN and promotes the array to float; casting NaN to an integer dtype is platform-dependent, and on arm64 it yields 0, so the padding decodes to -1. With decoding off, the raw -1 survives the cast and decodes to -2. Both are negative indices that silently wrap to the end of the coordinate arrays instead of being treated as fill.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions