Index: /issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp
===================================================================
--- /issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp	(revision 21624)
+++ /issm/trunk-jpl/src/c/bamg/BamgQuadtree.cpp	(revision 21625)
@@ -8,4 +8,5 @@
 namespace bamg {
 #define ABS(i) ((i)<0 ?-(i) :(i))
+#define MAXDEPTH 30
 	/*DOCUMENTATION What is a BamgQuadtree? {{{
 	 * A Quadtree is a very simple way to group vertices according
@@ -60,5 +61,4 @@
 
 		/*Initialize fields*/
-		this->MaxDepth      = 30;
 		this->MaxISize      = 1073741824; //2^30
 		this->MaxICoord     = 1073741823; //2^30 - 1
@@ -76,5 +76,4 @@
 
 		/*Initialize fields*/
-		this->MaxDepth      = 30;
 		this->MaxISize      = 1073741824; //2^30
 		this->MaxICoord     = 1073741823; //2^30 - 1
@@ -142,5 +141,5 @@
 		}
 
-		/*check that l is not 0 (this should not happen as MaxDepth = 30)*/
+		/*check that l is not 0 (this should not happen as MAXDEPTH = 30)*/
 		_assert_(level>0);
 
@@ -249,5 +248,5 @@
 
 		/*Initialize level and sizes for largest box*/
-		int levelbin = (1L<<this->MaxDepth);// = 2^30
+		int levelbin = (1L<<MAXDEPTH);// = 2^30
 		int        h = this->MaxISize;
 		int       hb = this->MaxISize;
@@ -303,8 +302,8 @@
 
 		/*Initialize search variables*/
-		BamgQuadtreeBox **pb = xNew<BamgQuadtreeBox*>(this->MaxDepth);
-		int* pi = xNew<int>(this->MaxDepth);
-		int* ii = xNew<int>(this->MaxDepth);
-		int* jj = xNew<int>(this->MaxDepth);
+		BamgQuadtreeBox* pb[MAXDEPTH];
+		int pi[MAXDEPTH];
+		int ii[MAXDEPTH];
+		int jj[MAXDEPTH];
 		pb[0]=b;                             //pointer toward the box b
 		pi[0]=b->nbitems>0?(int)b->nbitems:4;//number of boxes in b
@@ -382,8 +381,4 @@
 
 		/*return nearest vertex pointer*/
-		xDelete<BamgQuadtreeBox*>(pb);
-		xDelete<int>(pi);
-		xDelete<int>(ii);
-		xDelete<int>(jj);
 		return nearest_v;
 	}
@@ -439,7 +434,7 @@
 		Metric* Mx = new Metric(v->m);
 
-		BamgQuadtreeBox *pb[MaxDepth];
-		int  pi[MaxDepth];
-		int  ii[MaxDepth], jj[MaxDepth];
+		BamgQuadtreeBox *pb[MAXDEPTH];
+		int  pi[MAXDEPTH];
+		int  ii[MAXDEPTH], jj[MAXDEPTH];
 		int l=0; // level
 		BamgQuadtreeBox* b;
Index: /issm/trunk-jpl/src/c/bamg/BamgQuadtree.h
===================================================================
--- /issm/trunk-jpl/src/c/bamg/BamgQuadtree.h	(revision 21624)
+++ /issm/trunk-jpl/src/c/bamg/BamgQuadtree.h	(revision 21625)
@@ -37,5 +37,4 @@
 
 			/*BamgQuadtree public Fields*/
-			int              MaxDepth;        // maximum number of subdivision
 			int              MaxICoord;       // maximum integer coordinate 2^MaxDepth -1
 			int              MaxISize;        // maximum integer coordinate 2^MaxDepth
