Two suggestions
Firstly. As you have to type the number of modules into the array you may as well total them up and declare the array as normal.
Secondly. Move the calculation of the array size to the loop() function and declare the array there. Pass the array, or a pointer to it and its size, to any functions that use it.