Index: /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 21109)
+++ /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.cpp	(revision 21110)
@@ -3,5 +3,4 @@
  */ 
 
-/*Include {{{*/
 #ifdef HAVE_CONFIG_H
 	#include <config.h>
@@ -10,11 +9,11 @@
 #endif
 
+#include <cstring>
 #include "./InterpFromGridToMeshx.h"
 #include "../../shared/shared.h"
 #include "../../shared/io/io.h"
-/*}}}*/
 
 /*InterpFromGridToMeshx{{{*/
-int InterpFromGridToMeshx(IssmSeqVec<IssmPDouble>** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value, int interpenum){
+int InterpFromGridToMeshx(IssmSeqVec<IssmPDouble>** pdata_mesh,double* x_in, int x_rows, double* y_in, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods,double default_value,const char* interptype){
 
 	/*output: */
@@ -75,5 +74,5 @@
 	gate.data          = data;
 	gate.default_value = default_value;
-	gate.interp        = interpenum;
+	gate.interp        = interptype;
 	gate.M             = M;
 	gate.N             = N;
@@ -123,5 +122,5 @@
 	double *data                  = gate->data;
 	double  default_value         = gate->default_value;
-	int     interpenum            = gate->interp;
+	const char* interptype        = gate->interp;
 	int     M                     = gate->M;
 	int     N                     = gate->N;
@@ -159,17 +158,16 @@
 			Q22=data[(m+1)*N+n+1];
 
-			switch(interpenum){
-				case TriangleInterpEnum:
-					data_value=triangleinterp(x1,x2,y1,y2,Q11,Q12,Q21,Q22,x_grid,y_grid);
-					break;
-				case BilinearInterpEnum:
-					data_value=bilinearinterp(x1,x2,y1,y2,Q11,Q12,Q21,Q22,x_grid,y_grid);
-					break;
-				case NearestInterpEnum:
-					data_value=nearestinterp(x1,x2,y1,y2, Q11,Q12,Q21,Q22,x_grid,y_grid);
-					break;
-				default:
-					_printf_("Interpolation " << EnumToStringx(interpenum) << " not supported yet\n");
-					return NULL; /*WARNING: no error because it would blow up the multithreading!*/
+			if(strcmp(interptype,"triangle")==0){
+				data_value=triangleinterp(x1,x2,y1,y2,Q11,Q12,Q21,Q22,x_grid,y_grid);
+			}
+			else if(strcmp(interptype,"bilinear")==0){
+				data_value=bilinearinterp(x1,x2,y1,y2,Q11,Q12,Q21,Q22,x_grid,y_grid);
+			}
+			else if(strcmp(interptype,"nearest")==0){
+				data_value=nearestinterp(x1,x2,y1,y2, Q11,Q12,Q21,Q22,x_grid,y_grid);
+			}
+			else{
+				_printf_("Interpolation " << interptype << " not supported yet (supported intepolations are: triangle, bilinear and nearest)\n");
+				return NULL; /*WARNING: no error because it would blow up the multithreading!*/
 			}
 			if(xIsNan<IssmPDouble>(data_value)) data_value=default_value;
Index: /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h
===================================================================
--- /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 21109)
+++ /issm/trunk-jpl/src/c/modules/InterpFromGridToMeshx/InterpFromGridToMeshx.h	(revision 21110)
@@ -18,5 +18,5 @@
 	double*             data;
 	double              default_value;
-	int                 interp;
+	const char*         interp;
 	int                 M;
 	int                 N;
@@ -27,5 +27,5 @@
 } InterpFromGridToMeshxThreadStruct;
 
-int    InterpFromGridToMeshx(IssmSeqVec<IssmPDouble>** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, int interpenum=BilinearInterpEnum);
+int    InterpFromGridToMeshx(IssmSeqVec<IssmPDouble>** pdata_mesh,double* x, int x_rows, double* y, int y_rows, double* data, int M, int N, double* x_mesh, double* y_mesh, int nods, double default_value, const char* interptype);
 void*  InterpFromGridToMeshxt(void* vInterpFromGridToMeshxThreadStruct);
 bool   findindices(int* pn,int* pm,double* x,int x_rows, double* y,int y_rows, double xgrid,double ygrid);
Index: /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 21109)
+++ /issm/trunk-jpl/src/wrappers/InterpFromGridToMesh/InterpFromGridToMesh.cpp	(revision 21110)
@@ -39,5 +39,5 @@
 	int     x_mesh_rows,y_mesh_rows;
 	double  default_value;
-	int     interpolationenum;
+	char*   interpolationtype = NULL;
 
 	/* output: */
@@ -63,9 +63,10 @@
 	/* Run core computations: */
 	if(nrhs==7){
-		FetchData(&interpolationenum,INTERPENUM);
-		InterpFromGridToMeshx(&data_mesh, x, x_rows,  y, y_rows, data, data_rows,data_cols, x_mesh, y_mesh, x_mesh_rows,default_value,interpolationenum);
+		FetchData(&interpolationtype,INTERPENUM);
+		InterpFromGridToMeshx(&data_mesh, x, x_rows,  y, y_rows, data, data_rows,data_cols, x_mesh, y_mesh, x_mesh_rows,default_value,interpolationtype);
+		xDelete<char>(interpolationtype);
 	}
 	else{
-		InterpFromGridToMeshx(&data_mesh, x, x_rows,  y, y_rows, data, data_rows,data_cols, x_mesh, y_mesh, x_mesh_rows,default_value);
+		InterpFromGridToMeshx(&data_mesh, x, x_rows,  y, y_rows, data, data_rows,data_cols, x_mesh, y_mesh, x_mesh_rows,default_value,"bilinear");
 	}
 
