Wrap grid in an upscaling procedure

The grid will now be a two- instead of three-dimensional grid. Note that
the code compiles but no longer runs successfully after this change
because the other inputs still has references into the 3D indexing