Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 12163)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 12164)
@@ -820,4 +820,6 @@
 			./modules/HoleFillerx/HoleFillerx.cpp\
 			./modules/HoleFillerx/HoleFillerx.h\
+			./modules/Krigingx/Krigingx.cpp\
+			./modules/Krigingx/Krigingx.h\
 			./modules/AverageFilterx/AverageFilterx.cpp\
 			./modules/AverageFilterx/AverageFilterx.h\
Index: /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12164)
+++ /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.cpp	(revision 12164)
@@ -0,0 +1,22 @@
+/*!\file:  Kriging.cpp
+ * \brief  "c" core code for Kriging
+ */ 
+
+#include "./Krigingx.h"
+#include "../../shared/shared.h"
+#include "../../include/include.h"
+#include "../../toolkits/toolkits.h"
+#include "../../objects/objects.h"
+#include "../modules.h"
+
+int Krigingx(double** ppredictions,double* x, double* y, double* observations, int n_obs,double* x_interp,double* y_interp,int n_interp){
+
+	/*output*/
+	double *predictions = NULL;
+
+	/*Allocate output*/
+	predictions=(double*)xmalloc(n_interp*sizeof(double));
+
+	/*Assign output pointer*/
+	*ppredictions=predictions;
+}
Index: /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.h	(revision 12164)
+++ /issm/trunk-jpl/src/c/modules/Krigingx/Krigingx.h	(revision 12164)
@@ -0,0 +1,15 @@
+/*!\file Kriging.h
+ * \brief: header file for Kriging
+ */
+
+#ifndef _KRIGINGX_H
+#define _KRIGINGX_H
+
+#include "../../objects/objects.h"
+#include "../../toolkits/toolkits.h"
+
+
+int Krigingx(double** ppredictions,double* x, double* y, double* observations, int n_obs,double* x_interp,double* y_interp,int n_interp);
+
+#endif /* _KRIGINGX_H */
+
Index: /issm/trunk-jpl/src/c/modules/modules.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/modules.h	(revision 12163)
+++ /issm/trunk-jpl/src/c/modules/modules.h	(revision 12164)
@@ -62,4 +62,5 @@
 #include "./Exp2Kmlx/Exp2Kmlx.h"
 #include "./Kml2Expx/Kml2Expx.h"
+#include "./Krigingx/Krigingx.h"
 #include "./Shp2Kmlx/Shp2Kmlx.h"
 #include "./MassFluxx/MassFluxx.h"
Index: /issm/trunk-jpl/src/modules/Kriging/Kriging.cpp
===================================================================
--- /issm/trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 12164)
+++ /issm/trunk-jpl/src/modules/Kriging/Kriging.cpp	(revision 12164)
@@ -0,0 +1,52 @@
+/*\file Kriging.c
+ *\brief: best linear predictor
+ */
+#include "./Kriging.h"
+
+void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
+
+	/*Outputs*/
+	double *x            = NULL;
+	double *y            = NULL;
+	double *observations = NULL;
+	double *x_interp     = NULL;
+	double *y_interp     = NULL;
+	double *predictions  = NULL;
+	int     n_interp,n,n_obs;
+
+	/*Boot module: */
+	MODULEBOOT();
+
+	/*checks on arguments on the matlab side: */
+	CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&KrigingUsage);
+
+	/*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");
+
+	/*Call x layer*/
+	Krigingx(&predictions,x,y,observations,n_obs,x_interp,y_interp,n_interp);
+
+	/*Generate output Matlab Structures*/
+	WriteData(PREDICTIONS,predictions,n_interp);
+
+	/*Free ressources: */
+	xfree((void**)&x);
+	xfree((void**)&y);
+	xfree((void**)&observations);
+	xfree((void**)&x_interp);
+	xfree((void**)&y_interp);
+	xfree((void**)&predictions);
+
+	/*end module: */
+	MODULEEND();
+}
+
+void KrigingUsage(void){
+	_printf_(true,"\n");
+	_printf_(true,"   usage: predictions=%s(x,y,observations,x_interp,y_interp);\n",__FUNCT__);
+	_printf_(true,"\n");
+}
Index: /issm/trunk-jpl/src/modules/Kriging/Kriging.h
===================================================================
--- /issm/trunk-jpl/src/modules/Kriging/Kriging.h	(revision 12164)
+++ /issm/trunk-jpl/src/modules/Kriging/Kriging.h	(revision 12164)
@@ -0,0 +1,35 @@
+/*
+	KrigingUsage.h
+*/
+
+#ifndef _KRIGING_H_
+#define _KRIGING_H_
+
+/* local prototypes: */
+void KrigingUsage(void);
+
+#include "../../c/include/globals.h"
+#include "../../c/modules/modules.h"
+#include "../../c/shared/shared.h"
+#include "../../c/issm-binding.h"
+
+#undef __FUNCT__ 
+#define __FUNCT__  "Kriging"
+    
+/* serial input macros: */
+#define X            (mxArray *)prhs[0]
+#define Y            (mxArray *)prhs[1]
+#define OBSERVATIONS (mxArray *)prhs[2]
+#define XINTERP      (mxArray *)prhs[3]
+#define YINTERP      (mxArray *)prhs[4]
+
+/* serial output macros: */
+#define PREDICTIONS (mxArray**)&plhs[0]
+
+/* serial arg counts: */
+#undef NLHS
+#define NLHS  1
+#undef NRHS
+#define NRHS  5
+
+#endif  /* _KRIGING_H_ */
Index: /issm/trunk-jpl/src/modules/matlab/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/modules/matlab/Makefile.am	(revision 12163)
+++ /issm/trunk-jpl/src/modules/matlab/Makefile.am	(revision 12164)
@@ -24,4 +24,5 @@
 				KMLOverlay \
 				Kml2Exp \
+				Kriging \
 				Ll2xy \
 				NodeConnectivity \
@@ -128,4 +129,7 @@
 			  ../Kml2Exp/Kml2Exp.h
 
+Kriging_SOURCES = ../Kriging/Kriging.cpp\
+						../Kriging/Kriging.h
+
 MeshPartition_SOURCES = ../MeshPartition/MeshPartition.cpp\
 			  ../MeshPartition/MeshPartition.h
