Fix a bug when write to VArray

the index of input data is a little bit tricky to find
Add rnormcrossmap test script