IBM - Invalid memory access in special cases (iibm=3)
The present issue is specific to IBM simulations with spline reconstruction (iibm=3). The variable ipol can be used without being defined. This issue can lead to undefined behavior and out of bounds memory access.
https://github.com/xcompact3d/Incompact3d/blob/46e874e236265c2f2671f254a9e3f4415d1e40d0/src/ibm.f90#L524
The situation is similar for the variable jpol :
https://github.com/xcompact3d/Incompact3d/blob/46e874e236265c2f2671f254a9e3f4415d1e40d0/src/ibm.f90#L691
The situation is similar for the variable kpol but for some unknown reason the code is commented :
https://github.com/xcompact3d/Incompact3d/blob/46e874e236265c2f2671f254a9e3f4415d1e40d0/src/ibm.f90#L842
Some deep review of the iibm=3 code capability is needed. As a temporary workaround, I suggest the following :
- Print a warning for all simulations with
iibm=3to describe the option as experimental - When the code is reaching the special case leading to undefined behavior, abort the simulation with an error message