Index: /issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp	(revision 28007)
+++ /issm/trunk-jpl/src/wrappers/javascript/io/FetchJavascriptData.cpp	(revision 28008)
@@ -1,3 +1,3 @@
-/*\file FetchData.cpp:
+/* \file FetchJavascriptData.cpp:
  * \brief: general I/O interface to fetch data in javascript
  */
@@ -22,4 +22,9 @@
 }
 /*}}}*/
+/*FUNCTION FetchData(double* pscalar, double scalar){{{*/
+void FetchData(double* pscalar, double scalar){
+	*pscalar=scalar;
+}
+/*}}}*/
 /*FUNCTION FetchData(int* pinteger, int integer){{{*/
 void FetchData(int* pinteger, int integer){
@@ -27,9 +32,4 @@
 }
 /*}}}*/
-/*FUNCTION FetchData(double* pscalar, double scalar){{{*/
-void FetchData(double* pscalar, double scalar){
-	*pscalar=scalar;
-}
-/*}}}*/
 /*FUNCTION FetchData(double **pvector, double* vectorin, int nods){{{*/
 void FetchData(double** pvector, double* vectorin, int nods){
@@ -49,4 +49,25 @@
 	*pvector=vector;
 	*pnods=nods;
+}
+/*}}}*/
+/*FUNCTION FetchData(double **pmatrix, int* pM, int* matrix, int M, int N){{{*/
+void FetchData(double **pmatrix, int* pM, int* matrixin, int M, int N){
+	double*  outmatrix=NULL;
+	int      outmatrix_rows;
+
+	if(M == 0 || N == 0){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		outmatrix_rows=0;
+		outmatrix=NULL;
+	}
+	else if (pmatrix && matrixin){
+		outmatrix_rows=M;
+		outmatrix=xNew<IssmPDouble>(M*N);
+		for(int i=0;i<M*N;i++){outmatrix[i]=(IssmPDouble)matrixin[i];}
+	}
+
+	/*Assign output pointers:*/
+	*pmatrix=outmatrix;
+	if (pM){*pM=outmatrix_rows;}
 }
 /*}}}*/
@@ -62,5 +83,5 @@
 		outmatrix=NULL;
 	}
-    else if (pmatrix && matrixin){
+	else if (pmatrix && matrixin){
 		outmatrix_rows=M;
 		outmatrix_cols=N;
@@ -73,4 +94,24 @@
 	if (pM){*pM=outmatrix_rows;}
 	if (pN){*pN=outmatrix_cols;}
+}
+/*}}}*/
+/*FUNCTION FetchData(double **pmatrix, int* pM, double* matrix, int M, int N){{{*/
+void FetchData(double **pmatrix, int* pM, double* matrixin, int M, int N){
+	double*  outmatrix=NULL;
+	int      outmatrix_rows;
+
+	if(M == 0 || N == 0){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		outmatrix_rows=0;
+		outmatrix=NULL;
+	}
+	else if (pmatrix && matrixin){
+		outmatrix_rows=M;
+		outmatrix=xNew<IssmPDouble>(M*N); xMemCpy<IssmPDouble>(outmatrix,matrixin,M*N);
+	}
+
+	/*Assign output pointers:*/
+	*pmatrix=outmatrix;
+	if (pM){*pM=outmatrix_rows;}
 }
 /*}}}*/
@@ -86,5 +127,5 @@
 		outmatrix=NULL;
 	}
-    else if (pmatrix && matrixin){
+	else if (pmatrix && matrixin){
 		outmatrix_rows=M;
 		outmatrix_cols=N;
@@ -96,4 +137,24 @@
 	if (pM){*pM=outmatrix_rows;}
 	if (pN){*pN=outmatrix_cols;}
+}
+/*}}}*/
+/*FUNCTION FetchData(int **pmatrix, int* pM, int* matrix, int M, int N){{{*/
+void FetchData(int **pmatrix, int* pM, int* matrixin, int M, int N){
+	int*     outmatrix=NULL;
+	int      outmatrix_rows;
+
+	if(M == 0 || N == 0){
+		/*Nothing to pick up. Just initialize matrix pointer to NULL: */
+		outmatrix_rows=0;
+		outmatrix=NULL;
+	}
+	else if (pmatrix && matrixin){
+		outmatrix_rows=M;
+		outmatrix=xNew<int>(M*N); xMemCpy<int>(outmatrix,matrixin,M*N);
+	}
+
+	/*Assign output pointers:*/
+	*pmatrix=outmatrix;
+	if (pM){*pM=outmatrix_rows;}
 }
 /*}}}*/
@@ -109,5 +170,5 @@
 		outmatrix=NULL;
 	}
-    else if (pmatrix && matrixin){
+	else if (pmatrix && matrixin){
 		outmatrix_rows=M;
 		outmatrix_cols=N;
@@ -187,28 +248,28 @@
 	BamgOpts *bamgopts      = new BamgOpts();
 
-    /*Parameters*/
-    bamgopts->anisomax	    = anisomax;
-    bamgopts->coeff	        = coeff;
-    bamgopts->cutoff    	= cutoff;
-    bamgopts->errg	        = errg;
-    bamgopts->gradation	    = gradation;
-    bamgopts->Hessiantype	= Hessiantype;
-    bamgopts->maxnbv	    = maxnbv;
-    bamgopts->maxsubdiv	    = maxsubdiv;
-    bamgopts->Metrictype	= Metrictype;
-    bamgopts->nbjacobi	    = nbjacobi;
-    bamgopts->nbsmooth	    = nbsmooth;
-    bamgopts->omega	        = omega;
-    bamgopts->power	        = power;
-    bamgopts->verbose	    = verbose;
-
-    /*Flags*/
-    bamgopts->Crack	        = Crack;
-    bamgopts->KeepVertices	= KeepVertices;
-    bamgopts->splitcorners	= splitcorners;
-
-    /*Metric related*/
-    bamgopts->hmin	        = hmin;
-    bamgopts->hmax       	= hmax;
+	/*Parameters*/
+	bamgopts->anisomax	    = anisomax;
+	bamgopts->coeff	        = coeff;
+	bamgopts->cutoff    	= cutoff;
+	bamgopts->errg	        = errg;
+	bamgopts->gradation	    = gradation;
+	bamgopts->Hessiantype	= Hessiantype;
+	bamgopts->maxnbv	    = maxnbv;
+	bamgopts->maxsubdiv	    = maxsubdiv;
+	bamgopts->Metrictype	= Metrictype;
+	bamgopts->nbjacobi	    = nbjacobi;
+	bamgopts->nbsmooth	    = nbsmooth;
+	bamgopts->omega	        = omega;
+	bamgopts->power	        = power;
+	bamgopts->verbose	    = verbose;
+
+	/*Flags*/
+	bamgopts->Crack	        = Crack;
+	bamgopts->KeepVertices	= KeepVertices;
+	bamgopts->splitcorners	= splitcorners;
+
+	/*Metric related*/
+	bamgopts->hmin	        = hmin;
+	bamgopts->hmax       	= hmax;
 	FetchData(&bamgopts->hminVertices, &bamgopts->hminVerticesSize[0], &bamgopts->hminVerticesSize[1], hminVertices, hminVerticesSize[0], hminVerticesSize[1]);
 	FetchData(&bamgopts->hmaxVertices, &bamgopts->hmaxVerticesSize[0], &bamgopts->hmaxVerticesSize[1], hmaxVertices, hmaxVerticesSize[0], hmaxVerticesSize[1]);
Index: /issm/trunk-jpl/src/wrappers/javascript/io/WriteJavascriptData.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/javascript/io/WriteJavascriptData.cpp	(revision 28007)
+++ /issm/trunk-jpl/src/wrappers/javascript/io/WriteJavascriptData.cpp	(revision 28008)
@@ -1,4 +1,4 @@
-/* \file WriteData.c:
- * \brief: general interface for writing data
+/* \file WriteJavascriptData.cpp:
+ * \brief: general I/O interface to fetch data in javascript
  */
 
Index: /issm/trunk-jpl/src/wrappers/javascript/io/javascriptio.h
===================================================================
--- /issm/trunk-jpl/src/wrappers/javascript/io/javascriptio.h	(revision 28007)
+++ /issm/trunk-jpl/src/wrappers/javascript/io/javascriptio.h	(revision 28008)
@@ -1,4 +1,4 @@
-/*\file matlabio.h
- *\brief: I/O for ISSM in matlab mode
+/*\file javascriptio.h
+ *s\brief: I/O for ISSM in javascript mode
  */
 
@@ -32,11 +32,14 @@
 
 void FetchData(char** pstring, char* stringin);
-void FetchData(double* pscalar,double scalar);
+void FetchData(double* pscalar, double scalar);
 void FetchData(int* pinteger,int integer);
 void FetchData(double** pvector, double* vectorin, int nods);
 void FetchData(double** pvector, int* pnods, double* vectorin, int nods);
-void FetchData(double **pmatrix, int* pM, int* pN, int* matrixin, int M, int N);
-void FetchData(double **pmatrix, int* pM, int* pN, double* matrixin, int M, int N);
-void FetchData(int **pmatrix, int* pM, int* pN, int* matrixin, int M, int N);
+void FetchData(double** pmatrix, int* pM, int* matrixin, int M, int N);
+void FetchData(double** pmatrix, int* pM, int* pN, int* matrixin, int M, int N);
+void FetchData(double** pmatrix, int* pM, double* matrixin, int M, int N);
+void FetchData(double** pmatrix, int* pM, int* pN, double* matrixin, int M, int N);
+void FetchData(int** pmatrix, int* pM, int* matrixin, int M, int N);
+void FetchData(int** pmatrix, int* pM, int* pN, int* matrixin, int M, int N);
 void FetchData(Contours** pcontours,double* x, double* y, int nods);
 void FetchData(BamgGeom** pbamggeom, int* VerticesSize, double* Vertices, int* EdgesSize, double* Edges, int* CornersSize, double* Corners, int* RequiredVerticesSize, double* RequiredVertices, int* RequiredEdgesSize, double* RequiredEdges, int* CrackedEdgesSize, double* CrackedEdges, int* SubDomainsSize, double* SubDomains);
Index: /issm/trunk-jpl/src/wrappers/matlab/io/FetchMatlabData.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/matlab/io/FetchMatlabData.cpp	(revision 28007)
+++ /issm/trunk-jpl/src/wrappers/matlab/io/FetchMatlabData.cpp	(revision 28008)
@@ -1,4 +1,4 @@
-/*\file FetchData.cpp:
- * \brief: general I/O interface to fetch data in matlab
+/*\file FetchMatlabData.cpp:
+ *\brief: general I/O interface to fetch data in matlab
  */
 
Index: /issm/trunk-jpl/src/wrappers/matlab/io/WriteMatlabData.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/matlab/io/WriteMatlabData.cpp	(revision 28007)
+++ /issm/trunk-jpl/src/wrappers/matlab/io/WriteMatlabData.cpp	(revision 28008)
@@ -1,4 +1,4 @@
-/* \file WriteData.c:
- * \brief: general interface for writing data
+/*\file WriteMatlabData.c:
+ *\brief: general I/O interface to write data in matlab
  */
 
Index: /issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp	(revision 28007)
+++ /issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp	(revision 28008)
@@ -1,4 +1,4 @@
-/*\file FetchData.cpp:
- * \brief: general I/O interface to fetch data in python
+/*\file FetchPythonData.cpp:
+ *\brief: general I/O interface to fetch data in python
  */
 
Index: /issm/trunk-jpl/src/wrappers/python/io/WritePythonData.cpp
===================================================================
--- /issm/trunk-jpl/src/wrappers/python/io/WritePythonData.cpp	(revision 28007)
+++ /issm/trunk-jpl/src/wrappers/python/io/WritePythonData.cpp	(revision 28008)
@@ -1,4 +1,4 @@
-/* \file WriteData.c:
- * \brief: general interface for writing data
+/*\file WritePythonData.cpp:
+ *\brief: general I/O interface to write data in matlab
  */
 
