MeteoSwiss-APN/dawn

(Vertical) Index Fields can't be used with an offset

mroethlin opened this issue · 0 comments

In this dusk code

@stencil
def ambiguous_index_fields(
  edge_field: Field[Edge],
  sparse_ambiguous_field: Field[Edge > Cell > Edge],
  edge_index_field: IndexField[Edge]
):
  with levels_downwards:
    edge_field = sum_over(Edge > Cell > Edge, sparse_ambiguous_field[edge_index_field])

the access to sparse_ambiguous_field[edge_index_field] is ambiguous, it could either be sparse_ambiguous_field[Edge, edge_index_field] or sparse_ambiguous_field[Edge > Cell > Edge, edge_index_field]. (Dawn defaults to ``sparse_ambiguous_field[Edge, edge_index_field]`).

This is an oversight in the initial design of the Vertical Indirections, and needs to be added throughout the tool chain, including (de)serialization and dawn4py.