Index: /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.h
===================================================================
--- /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 22672)
+++ /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.h	(revision 22673)
@@ -51,4 +51,18 @@
 #endif
 
+#ifdef _HAVE_JAVASCRIPT_MODULES_
+/* serial input macros: */
+#define XHANDLE       xIn,nodsIn,1
+#define YHANDLE       yIn,nodsIn,1
+#define DATAHANDLE    dataIn,nodsIn,1
+#define XMESHHANDLE   xMeshIn,nodsIn,1
+#define YMESHHANDLE   yMeshIn,nodsIn,1
+#define DEFAULTHANDLE defaultValueIn
+#define INTERPENUM    interpTypeIn
+/* serial output macros: */
+#define DATAMESH pdataMesh,NULL
+#define WRAPPER(modulename) extern "C" { int InterpFromGridToMeshModule(double** pdataMesh, double* xIn, double* yIn, double* dataIn, double* xMeshIn, double* yMeshIn, double defaultValue, int nodsIn, char* interpTypeIn)
+#endif
+
 /* serial arg counts: */
 #undef NLHS
Index: /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.js
===================================================================
--- /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.js	(revision 22672)
+++ /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.js	(revision 22673)
@@ -5,13 +5,14 @@
  *
  * Usage:
- *	var data_mesh=InterpFromGridToMesh(xIn,yIn,dataIn,xMeshIn,yMeshIn,defaultValue);\
+ *	var data_mesh=InterpFromGridToMesh(xIn,yIn,dataIn,xMeshIn,yMeshIn,defaultValue,interpType);\
  * 
  *	xIn,yIn						: coordinates of matrix data. (x and y must be in increasing order)
  *	dataIn						: matrix holding the data to be interpolated onto the mesh
  *	xMeshIn,yMeshIn				: coordinates of the points onto which we interpolate
- *	defaultValue (optional)		: default value if no data is found (holes)
+ *	defaultValue 				: default value if no data is found (holes)
+ *	interpType (optional) 		: interpolation type
  * 	dataMesh					: array of mesh interpolated data
  */
-function InterpFromGridToMesh(xIn,yIn,dataIn,xMeshIn,yMeshIn,defaultValueIn) {
+function InterpFromGridToMesh(xIn,yIn,dataIn,xMeshIn,yMeshIn,defaultValue) {
 	/*
 		Variables
@@ -24,5 +25,4 @@
 	var ddataHeap 		= {};
 	var ddataPtr 		= {};
-	var defaultValue 	= 0; // Default value for defaultValue :)
 	var dx				= {};
 	var dxHeap 			= {};
@@ -37,4 +37,5 @@
 	var dyMeshPtr 		= {};
 	var dyPtr 			= {};
+	var interpType 		= '';
 	var ndata			= {};
 	var nods 			= 0;
@@ -50,15 +51,5 @@
 	//}}}
 	
-	
-	/*
-		Retrieve default value
-	*/
-	//{{{
-	if (arguments.length === 6) {
-		var defaultValue = arguments[5];
-	}
-	//}}}
-	
-	
+
 	/*
 		Dynamic allocations
@@ -109,7 +100,18 @@
 	
 	/*
+		Retrieve interpolation type
+	*/
+	//{{{
+	if (arguments.length === 7) {
+		interpType = arguments[6];
+	} else {
+		interpType = 'bilinear';
+	}
+	//}}}
+	
+	/*
 		Output
 	*/
-	dataMeshPtr = Module._malloc(4);
+	pdataMesh = Module._malloc(4);
 	//}}}
 	
@@ -125,11 +127,13 @@
 		'number', 
 		[
-			'number', 
-			'number', 
-			'number', 
-			'number', 
-			'number', 
-			'number', 
-			'number'
+			'number', // output : pdataMesh
+			'number', // input	: x
+			'number', // input	: y
+			'number', // input 	: data
+			'number', // input 	: xMesh
+			'number', // input	: yMesh
+			'number', // input 	: defaultValue
+			'number', // input	: nods
+			'string', // input	: interpType
 		]
 	);
@@ -141,6 +145,6 @@
 	*/
 	//{{{
-	InterpFromGrid2MeshModule(
-		dataMeshPtr, 
+	InterpFromGridToMeshModule(
+		pdataMesh, 
 		x, 
 		y, 
@@ -148,6 +152,7 @@
 		xMesh, 
 		yMesh, 
-		nods, 
-		defaultValue
+		defaultValue, 
+		nods,
+		interpType
 	);
 	//}}}
