MPAS-Dev / MPAS-Model

Repository for MPAS models and shared framework releases.
235 stars 312 forks source link

Avoid modifying inactive indexing fields after reading input streams #1117

Closed mgduda closed 10 months ago

mgduda commented 11 months ago

This PR addresses two sources of incorrect behavior when indexing fields (e.g., cellsOnCell) are deactivated in input streams through packages.

Firstly, indexing fields that were not read because they contained no active packages (i.e., they were deactivated) should not undergo global-to-local index translation after their stream is read; doing so would apply the index translation to either the default value for the indexing field in cases where the field had never been set, or it would apply the index translation to what are already local indices.

Secondly, indexing fields that were not read should not have their halos exchanged, since doing so would populate halo elements with local indices from another block. More generally, there is no need to exchange halos after an input stream is read for any fields that were deactivated in the input stream and therefore not read.