Index: /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 19562)
+++ /issm/trunk-jpl/src/c/shared/Matrix/MatrixUtils.cpp	(revision 19563)
@@ -9,8 +9,11 @@
 #include <math.h>
 #include <float.h>    /*  DBL_EPSILON  */
+#include <cstdarg>
+#include <iostream>
 
 #include "./matrix.h"
 #include "../Exceptions/exceptions.h"
 #include "../MemOps/MemOps.h"
+#include "../io/io.h"
 /*}}}*/
 
@@ -627,2 +630,28 @@
 	*pcell=newcell;
 } /*}}}*/
+void cellecho(int numcells, int m, ...) { /*{{{*/
+
+	va_list arguments;                     
+	IssmDouble** celllist= NULL;
+
+	/*allocate variable length array: */
+	celllist=xNew<IssmDouble*>(numcells); 
+
+	va_start(arguments,m);
+
+	for ( int x = 0; x < numcells; x++ ){
+		celllist[x]= va_arg ( arguments, IssmDouble*); 
+	}
+	va_end ( arguments );                  
+	
+	_printf_("Echo of cell: \n");
+	for(int i=0;i<m;i++){
+		_printf_(i << ": ");
+		for (int j=0;j<numcells;j++)_printf_(celllist[j][i] << " ");
+		_printf_("\n");
+	}
+
+	/*deallocate:*/
+	xDelete<IssmDouble*>(celllist);
+
+} /*}}}*/
Index: /issm/trunk-jpl/src/c/shared/Matrix/matrix.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/Matrix/matrix.h	(revision 19562)
+++ /issm/trunk-jpl/src/c/shared/Matrix/matrix.h	(revision 19563)
@@ -29,4 +29,5 @@
 IssmDouble  cellsum(IssmDouble* cell, int m);
 void celldelete(IssmDouble** pcell, int m, int* indices, int nind);
-void cellsplit(IssmDouble** pcell, int m, int i,IssmDouble scale) ;
+void cellsplit(IssmDouble** pcell, int m, int i,IssmDouble scale);
+void cellecho(int numcells, int m, ...);
 #endif //ifndef _MATRIXUTILS_H_
