Index: /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp
===================================================================
--- /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 12396)
+++ /issm/trunk-jpl/src/c/matlab/io/FetchMatlabData.cpp	(revision 12397)
@@ -27,5 +27,5 @@
 		outmatrix=NULL;
 	}
-	else if(mxIsClass(dataref,"double") || mxIsClass(dataref,"single")){
+	else if(mxIsClass(dataref,"double") || mxIsClass(dataref,"single") || mxIsClass(dataref,"int16")){
 		/*Check dataref is not pointing to NaN: */
 		if ( mxIsNaN(*(mxGetPr(dataref))) && (mxGetM(dataref)==1) && (mxGetN(dataref)==1) ){
@@ -35,4 +35,7 @@
 		}
 		else{
+			if(!mxIsClass(dataref,"double") && !mxIsClass(dataref,"single")){
+				printf("Warning: converting matlab data from '%s' to 'double'\n",mxGetClassName(dataref));
+			}
 			/*Convert matlab matrix to double* matrix: */
 			MatlabMatrixToDoubleMatrix(&outmatrix,&outmatrix_rows,&outmatrix_cols,dataref);
Index: /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp
===================================================================
--- /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 12396)
+++ /issm/trunk-jpl/src/c/matlab/io/MatlabMatrixToDoubleMatrix.cpp	(revision 12397)
@@ -18,7 +18,8 @@
 int MatlabMatrixToDoubleMatrix(double** pmatrix,int* pmatrix_rows,int* pmatrix_cols,const mxArray* mxmatrix){
 
-	int     i,j,count,rows,cols;
-	double *pmxdoublematrix = NULL;
-	float  *pmxsinglematrix = NULL;
+	int        i,j,count,rows,cols;
+	double    *pmxdoublematrix = NULL;
+	float     *pmxsinglematrix = NULL;
+	short int *pmxint16matrix  = NULL;
 
 	/*output: */
@@ -89,4 +90,21 @@
 		}
 	}
+	else if(mxIsClass(mxmatrix,"int16")){
+		/*Dealing with dense matrix: recover pointer and size: */
+		pmxint16matrix=(short*)mxGetPr(mxmatrix);
+		rows=mxGetM(mxmatrix);
+		cols=mxGetN(mxmatrix);
+
+		/*Create serial matrix: */
+		if(rows*cols){
+			matrix=(double*)xcalloc(rows*cols,sizeof(double));
+
+			for(i=0;i<rows;i++){
+				for(j=0;j<cols;j++){
+					matrix[cols*i+j]=(double)pmxint16matrix[rows*j+i];
+				}
+			}
+		}
+	}
 	else{
 		_error_("Matlab matrix type Not implemented yet");
