I asked a very similar question recently here. What worked for me was to declare something like
row_vector[2] X[N];
with x and y coordinates effectively declared separately as real[N]. The assignment to the row vectors is not intuitively obvious.