AddAttributes in CarpetIOHDF5 takes an explicit argument
refinementlevel which is used to populate the "level" attribute of HDF5 datasets. However it also directly uses Carpet's global variable `reflevel}} to access some internal Carpet datastructures.
Right now this seems to only be able to cause an issue for grid arrays (not grid functions) that have a coordinate system attached to them (since the code is behind an if statement that depends on the result of
Coord_GroupSystem (cctkGH, groupname)). For such an array the
pos ivect would be computed use the baseextents appropriate for a grid function (which is wrong) on the current refinement level (which is also wrong since grid arrays currently exits on reflevel 0 only). Output for grid arrays and scalar happens in global mode, which during the time output happens coincides with the finest refinement level.