Using module variables as dimensions in function arguments

The point is that if no threading or concurent access is needed at this level, the solution with module variables is valid and reasonnable. I would write things differently if threading/concurrent access was needed.

Sometimes, KISS is good.