External Issue: Design input for model state

17593, "JoyMonteiro", "Design input for model state", "2021-04-23T12:28:14Z"

Hello,

we are trying to design a data structure which would function as model state for a climate model.

We have an implementation in Python currently (https://sympl.readthedocs.io), but would like to shift to Chapel to take advantage of multi-locale execution.

The requirement is as follows:

  • Each model component takes a model state which is currently a dictionary with strings as keys and a labeled array container (DataArray) as value
  • DataArrays contain an array of arbitrary type (we could restrict it to int, real and string)
  • The component extracts arrays that are relevant to it (not all may be relevant) and uses these arrays to perform some computations
  • Components behave like functions which take model state as input and provide a similar state variable with tendencies or new model state

In Python, the model state is simply a dictionary and it works fine. However, a key-value store does not seem the ideal approach in Chapel because of typing issues (DataArray is a generic).

Just to give you an idea of the current design and how it is used, state is the model state here:

Is there some Chapel feature/ibrary that we are missing that could make this easy for us?

TIA,
Joy