Index: /issm/trunk/src/c/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
===================================================================
--- /issm/trunk/src/c/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 2577)
+++ /issm/trunk/src/c/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 2578)
@@ -40,4 +40,10 @@
 	if ((M<=2) || (N<=2) || (nods<=0)){
 		throw ErrorException(__FUNCT__,"nothing to be done according to the dimensions of input matrices and vectors.");
+	}
+	if (x_in[1]-x_in[0]<0){
+		throw ErrorException(__FUNCT__,"x coordinate vectore should be increasing.\n   use Matlab's command x=flipud(x), also flip the data matrix data=fliplr(data)");
+	}
+	if (y_in[1]-y_in[0]<0){
+		throw ErrorException(__FUNCT__,"y coordinate vectore should be increasing.\n   use Matlab's command y=flipud(y), also flip the data matrix data=flipud(data)");
 	}
 
