Array and bitWrite

int16_t        array[4][4][128];

128 * 4 * 4 * 2 = 4096 bytes. Which Arduino are you using?

                bitWrite(array[i][j], flow, 0);

So, you want to write bits 0 to 127 of this array of 128 ints? Not going to happen.