Index: /issm/trunk-jpl/src/c/Makefile.am
===================================================================
--- /issm/trunk-jpl/src/c/Makefile.am	(revision 16112)
+++ /issm/trunk-jpl/src/c/Makefile.am	(revision 16113)
@@ -164,4 +164,5 @@
 					./shared/shared.h\
 					./shared/MemOps/MemOps.h\
+					./shared/MemOps/MemOps.cpp\
 					./shared/Matrix/matrix.h\
 					./shared/Matrix/MatrixUtils.cpp\
Index: /issm/trunk-jpl/src/c/shared/MemOps/MemOps.cpp
===================================================================
--- /issm/trunk-jpl/src/c/shared/MemOps/MemOps.cpp	(revision 16113)
+++ /issm/trunk-jpl/src/c/shared/MemOps/MemOps.cpp	(revision 16113)
@@ -0,0 +1,24 @@
+/*
+ * MemOps.cpp
+ *
+ *  Created on: Sep 10, 2013
+ *      Author: utke
+ */
+
+
+#ifdef HAVE_CONFIG_H
+   #include <config.h>
+#else
+#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
+#endif
+
+#include "MemOps.h"
+
+#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+template <> adouble*  xNew(unsigned int size) {
+	ensureContiguousLocations(size);
+	adouble* aT_p=new adouble[size];
+	assert(aT_p);
+	return aT_p;
+}
+#endif
Index: /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h
===================================================================
--- /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 16112)
+++ /issm/trunk-jpl/src/c/shared/MemOps/MemOps.h	(revision 16113)
@@ -29,6 +29,5 @@
 template <class T> T** xNew(unsigned int dim1, unsigned int dim2) { /*{{{*/
 #ifdef USE_CXX_MEMORY_MANAGMENT_FOR_NON_POD_TYPES
-  T* buf=new T[dim1*dim2];
-  assert(buf );
+  T* buf=xNew<T>(dim1*dim2);
   T** aT_pp =new T*[dim1];
   assert(aT_pp );
@@ -143,3 +142,8 @@
 /*}}}*/
 
+#if defined(_HAVE_ADOLC_) && !defined(_WRAPPERS_)
+#include "../Numerics/types.h"
+template <> adouble*  xNew(unsigned int size);
 #endif
+
+#endif
