*/
public ArrayDouble.D3 getCoordinateArray(int timeIndex)
throws IOException {
ArrayDouble.D3 array;
Array pertArray = getTimeSlice(pertVar, timeIndex);
Array baseArray = getTimeSlice(baseVar, timeIndex);
//ADD: use MAMath?
//ADD: use IndexIterator from getIndexIteratorFast?
int[] shape = pertArray.getShape();
//ADD: assert that rank = 3
//ADD: assert that both arrays are same shape
int ni = shape[0];
int nj = shape[1];
int nk = shape[2];
array = new ArrayDouble.D3(ni, nj, nk);
Index index = array.getIndex();
for (int i = 0; i < ni; i++) {
for (int j = 0; j < nj; j++) {
for (int k = 0; k < nk; k++) {
index.set(i, j, k);
double d = pertArray.getDouble(index)
+ baseArray.getDouble(index);
if (isZStag) {
d = d / 9.81; //convert geopotential to height
}
array.setDouble(index, d);
}