Please consider the following small Modelica model and function:
model VectorizeDemo
parameter Integer na=5;
final parameter Integer nb=2*na;
final par
IIRC, some parts of the Modelica specification are written in a way that requires scalarization of all variables. That is not necessary for many cases, but simpler for some common cases in index reduction. It seems particularly unnecessary for some cases of discretized PDE.
By default all Modelica Compilers will expand all arrays (there are some exceptions like arrays in records in functions) into scalars. OpenModelica started some work on non-expanding arrays in the front-end and back-end. See: http://www.ep.liu.se/ecp/157/071/ecp19157071.pdf
Yes, at least the compilation issue can preliminarily be avoided as follows in Dymola 2020 (and possibly earlier versions):
Real d[na,nb] annotation(__Dymola_HideArray=true);
However, there might be other possibilities as well - and the example doesn't fully clarify how it is intended be used. In particular I noted that 'd' can be evaluated and isn't used at all.