Index: /issm/trunk-jpl/src/modules/Kriging/Kriging.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 12218)
+++ /issm/trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 12219)
@@ -14,5 +14,5 @@
 	double  *predictions  = NULL;
 	Options *options      = NULL;
-	int      n_interp,n,n_obs;
+	int      N_interp,M_interp,M,N,n_obs;
 
 	/*Boot module: */
@@ -26,15 +26,15 @@
 	/*Fetch inputs: */
 	FetchData(&x,&n_obs,X);
-	FetchData(&y,&n,Y);                       if(n_obs!=n) _error_("x and y should have the same size");
-	FetchData(&observations,&n,OBSERVATIONS); if(n_obs!=n) _error_("x and observations should have the same size");
-	FetchData(&x_interp,&n_interp,XINTERP);
-	FetchData(&y_interp,&n,YINTERP);          if(n_interp!=n) _error_("x_interp and y_interp should have the same size");
+	FetchData(&y,&N,Y);                       if(n_obs!=N) _error_("x and y should have the same size");
+	FetchData(&observations,&N,OBSERVATIONS); if(n_obs!=N) _error_("x and observations should have the same size");
+	FetchData(&x_interp,&M_interp,&N_interp,XINTERP);
+	FetchData(&y_interp,&M,&N,YINTERP);       if(N!=N_interp || M!=M_interp) _error_("x_interp and y_interp should have the same size");
 	FetchData(&options,NRHS,nrhs,prhs);
 
 	/*Call x layer*/
-	Krigingx(&predictions,x,y,observations,n_obs,x_interp,y_interp,n_interp,options);
+	Krigingx(&predictions,x,y,observations,n_obs,x_interp,y_interp,M_interp*N_interp,options);
 
 	/*Generate output Matlab Structures*/
-	WriteData(PREDICTIONS,predictions,n_interp);
+	WriteData(PREDICTIONS,predictions,M_interp,N_interp);
 
 	/*Free ressources: */
