rep_array_dim function

Repeat an array over a given dimension.