Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/circle.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/circle.cpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/circle.cpp	(revision 2269)
@@ -35,8 +35,8 @@
   }
   
-  void setCirclesAndLinks(Elt *elts, vector<Node>& nodes)
+  void setCirclesAndLinks(Elt *elts, vector<NodePtr>& nodes)
   {
   	for (int i = 0; i < nodes.size(); i++)
-	  	setCircleAndLink(elts[i], nodes[i]);
+	  	setCircleAndLink(elts[i], *nodes[i]);
   }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/circle.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/circle.hpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/circle.hpp	(revision 2269)
@@ -15,5 +15,5 @@
    At this point the node is a leaf and contains only one element.
 */
-void setCirclesAndLinks(Elt *elts, vector<Node>& leaf);
+void setCirclesAndLinks(Elt *elts, vector<NodePtr>& leaf);
 
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/intersection_ym.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/intersection_ym.cpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/intersection_ym.cpp	(revision 2269)
@@ -186,14 +186,10 @@
        if (dx*dx+dy*dy>fusion_vertex*fusion_vertex)
        {
-          intersectPolygon[nv]=intersectPolygon[n] ;
-
-	  vect_points.push_back( array<double, 2>() );
-          vect_points[nv][0] = intersectPolygon[n].x;
-	  vect_points[nv][1] = intersectPolygon[n].y;
-
-	  nv++ ;
+         intersectPolygon[nv]=intersectPolygon[n] ;
+         vect_points.push_back( array<double, 2>() );
+         vect_points[nv][0] = intersectPolygon[n].x;
+         vect_points[nv][1] = intersectPolygon[n].y;
+         nv++ ;
        }
-      
-
     }
 
@@ -209,8 +205,8 @@
       for(int i=0;i<indices.size()/3;++i)
       {
-	  Coord x0 = Ox * polyline[0][indices[3*i]][0] + Oy* polyline[0][indices[3*i]][1] + Oz ;
-	  Coord x1 = Ox * polyline[0][indices[3*i+1]][0] + Oy* polyline[0][indices[3*i+1]][1] + Oz ;
-	  Coord x2 = Ox * polyline[0][indices[3*i+2]][0] + Oy* polyline[0][indices[3*i+2]][1] + Oz ;
-	  area2+=triarea(x0 * (1./norm(x0)),x1* (1./norm(x1)), x2* (1./norm(x2))) ;
+        Coord x0 = Ox * polyline[0][indices[3*i]][0] + Oy* polyline[0][indices[3*i]][1] + Oz ;
+        Coord x1 = Ox * polyline[0][indices[3*i+1]][0] + Oy* polyline[0][indices[3*i+1]][1] + Oz ;
+        Coord x2 = Ox * polyline[0][indices[3*i+2]][0] + Oy* polyline[0][indices[3*i+2]][1] + Oz ;
+        area2+=triarea(x0 * (1./norm(x0)),x1* (1./norm(x1)), x2* (1./norm(x2))) ;
       }
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/mapper.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/mapper.cpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/mapper.cpp	(revision 2269)
@@ -11,5 +11,13 @@
 #include "gridRemap.hpp"
 
+#include <fstream>
+#include "client.hpp"
+
 #include "mapper.hpp"
+
+namespace MemTrack
+{ 
+  void TrackDumpBlocks(std::ofstream& memReport, size_t memtrack_blocks, size_t memtrack_size);
+}
 
 namespace sphereRemap {
@@ -57,5 +65,5 @@
     elt.src_id.globalId = sourceGlobalId[i];
     sourceElements.push_back(elt);
-    sourceMesh.push_back(Node(elt.x, cptRadius(elt), &sourceElements.back()));
+    sourceMesh.push_back(make_shared<Node>(elt.x, cptRadius(elt), &sourceElements.back()));
     cptEltGeom(sourceElements[i], Coord(pole[0], pole[1], pole[2]));
     if (area!=NULL) sourceElements[i].given_area=area[i] ;
@@ -92,5 +100,5 @@
     Elt elt(boundsLon + offs, boundsLat + offs, nVertex);
     targetElements.push_back(elt);
-    targetMesh.push_back(Node(elt.x, cptRadius(elt), &sourceElements.back()));
+    targetMesh.push_back(make_shared<Node>(elt.x, cptRadius(elt), &sourceElements.back()));
     cptEltGeom(targetElements[i], Coord(pole[0], pole[1], pole[2]));
     if (area!=NULL) targetElements[i].given_area=area[i] ;
@@ -121,4 +129,5 @@
 
   this->buildSSTree(sourceMesh, targetMesh);
+  
 
   if (mpiRank == 0 && verbose) cout << "Computing intersections ..." << endl;
@@ -460,5 +469,9 @@
   delete[] recvElement;
   delete[] sendValue;
+  delete[] sendArea ;
+  delete[] sendGivenArea ;
   delete[] recvValue;
+  delete[] recvArea ;
+  delete[] recvGivenArea ;
   delete[] sendGrad;
   delete[] recvGrad;
@@ -490,5 +503,5 @@
   MPI_Comm_rank(communicator, &mpiRank);
 
-  vector<Node> *routingList = new vector<Node>[mpiSize];
+  vector<NodePtr> *routingList = new vector<NodePtr>[mpiSize];
   vector<vector<int> > routes(sstree.localTree.leafs.size());
 
@@ -517,5 +530,5 @@
     for (size_t j = 0; j < routingList[rank].size(); j++)
     {
-      Elt *elt = (Elt *) (routingList[rank][j].data);
+      Elt *elt = (Elt *) (routingList[rank][j]->data);
       sendMessageSize[rank] += packedPolygonSize(*elt);
     }
@@ -540,5 +553,5 @@
     for (size_t j = 0; j < routingList[rank].size(); j++)
     {
-      Elt *elt = (Elt *) (routingList[rank][j].data);
+      Elt *elt = (Elt *) (routingList[rank][j]->data);
       packPolygon(*elt, sendBuffer[rank], pos[rank]);
     }
@@ -590,6 +603,6 @@
         Elt elt;
         unpackPolygon(elt, recvBuffer[rank], pos[rank]);
-        Node node(elt.x, cptRadius(elt), &elt);
-        findNeighbour(sstree.localTree.root, &node, neighbourList);
+        NodePtr node=make_shared<Node>(elt.x, cptRadius(elt), &elt);
+        findNeighbour(sstree.localTree.root, node, neighbourList);
       }
       nbSendNode[rank] = neighbourList.size();
@@ -678,4 +691,5 @@
   /* re-compute on received elements to avoid having to send this information */
   neighbourNodes.resize(nbNeighbourNodes);
+  for(int i=0;i<neighbourNodes.size();i++) neighbourNodes[i]=make_shared<Node>() ;
   setCirclesAndLinks(neighbourElements, neighbourNodes);
   cptAllEltsGeom(neighbourElements, nbNeighbourNodes, srcGrid.pole);
@@ -692,10 +706,10 @@
   for (int j = 0; j < sstree.localTree.leafs.size(); j++)
   {
-    Node& node = sstree.localTree.leafs[j];
+    NodePtr node = sstree.localTree.leafs[j];
 
     /* find all leafs whoes circles that intersect node's circle and save into node->intersectors */
-    node.search(sstree.localTree.root);
-
-    Elt *elt = (Elt *)(node.data);
+    node->search(sstree.localTree.root);
+
+    Elt *elt = (Elt *)(node->data);
 
     for (int i = 0; i < elt->n; i++) elt->neighbour[i] = NOT_FOUND;
@@ -705,5 +719,5 @@
                    and check if they are neighbours in the sense that the two elements share an edge.
                    If they do, save this information for elt */
-    for (list<NodePtr>::iterator it = (node.intersectors).begin(); it != (node.intersectors).end(); ++it)
+    for (list<NodePtr>::iterator it = (node->intersectors).begin(); it != (node->intersectors).end(); ++it)
     {
       Elt *elt2 = (Elt *)((*it)->data);
@@ -730,12 +744,12 @@
   MPI_Barrier(communicator);
 
-  vector<Node> *routingList = new vector<Node>[mpiSize];
-
-  vector<Node> routeNodes;  routeNodes.reserve(nbElements);
+  vector<NodePtr> *routingList = new vector<NodePtr>[mpiSize];
+
+  vector<NodePtr> routeNodes;  routeNodes.reserve(nbElements);
   for (int j = 0; j < nbElements; j++)
   {
     elements[j].id.ind = j;
     elements[j].id.rank = mpiRank;
-    routeNodes.push_back(Node(elements[j].x, cptRadius(elements[j]), &elements[j]));
+    routeNodes.push_back(make_shared<Node>(elements[j].x, cptRadius(elements[j]), &elements[j]));
   }
 
@@ -766,5 +780,5 @@
     for (size_t j = 0; j < routingList[rank].size(); j++)
     {
-      Elt *elt = (Elt *) (routingList[rank][j].data);
+      Elt *elt = (Elt *) (routingList[rank][j]->data);
       sentMessageSize[rank] += packedPolygonSize(*elt);
     }
@@ -797,5 +811,5 @@
     for (size_t j = 0; j < routingList[rank].size(); j++)
     {
-      Elt* elt = (Elt *) (routingList[rank][j].data);
+      Elt* elt = (Elt *) (routingList[rank][j]->data);
       packPolygon(*elt, sendBuffer[rank], pos[rank]);
     }
@@ -841,8 +855,8 @@
         unpackPolygon(recvElt[j], recvBuffer[rank], pos[rank]);
         cptEltGeom(recvElt[j], tgtGrid.pole);
-        Node recvNode(recvElt[j].x, cptRadius(recvElt[j]), &recvElt[j]);
-        recvNode.search(sstree.localTree.root);
+        NodePtr recvNode = make_shared<Node>(recvElt[j].x, cptRadius(recvElt[j]), &recvElt[j]);
+        recvNode->search(sstree.localTree.root);
         /* for a node holding an element of the target, loop throught candidates for intersecting source */
-        for (list<NodePtr>::iterator it = (recvNode.intersectors).begin(); it != (recvNode.intersectors).end(); ++it)
+        for (list<NodePtr>::iterator it = (recvNode->intersectors).begin(); it != (recvNode->intersectors).end(); ++it)
         {
           Elt *elt2 = (Elt *) ((*it)->data);
@@ -869,4 +883,7 @@
         }
       }
+      
+      for (int j = 0; j < nbRecvNode[rank]; j++) recvElt[j].delete_intersections();
+            
       delete [] recvElt;
 
@@ -943,6 +960,9 @@
   delete [] srcRank;
   delete [] dstAddress;
+  delete [] sourceWeightId ;
+  delete [] targetWeightId ;
   if (neighbourElements) delete [] neighbourElements;
-}
-
-}
+  CTimer::release() ;
+ }
+
+}
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/mapper.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/mapper.hpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/mapper.hpp	(revision 2269)
@@ -3,4 +3,5 @@
 #include "parallel_tree.hpp"
 #include "mpi.hpp"
+#include "timerRemap.hpp"
 
 namespace sphereRemap {
@@ -27,5 +28,5 @@
        void getTargetValue(double* val) ;
 
-       void buildSSTree(vector<Node>& srcMsh, vector<Node>& trgMsh)
+       void buildSSTree(vector<NodePtr>& srcMsh, vector<NodePtr>& trgMsh)
        {
          sstree.build(srcMsh, trgMsh);
@@ -61,5 +62,5 @@
        /** Holds adaptional leaf nodes as ghost cells for gradient computations (hold neighbour elements from other ranks).
            They will be inserted to the local trees but not saved in its leaf array */
-       vector<Node> neighbourNodes;
+       vector<NodePtr> neighbourNodes;
 
        int nbNeighbourElements;
@@ -69,7 +70,7 @@
        MPI_Comm communicator ;
        std::vector<Elt>  sourceElements ;
-       std::vector<Node> sourceMesh ;
+       std::vector<NodePtr> sourceMesh ;
        std::vector<Elt>  targetElements ;
-       std::vector<Node> targetMesh ;
+       std::vector<NodePtr> targetMesh ;
        std::vector<long> sourceGlobalId ;
        std::vector<long> targetGlobalId ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/meshutil.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/meshutil.cpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/meshutil.cpp	(revision 2269)
@@ -60,4 +60,5 @@
   polyline.clear();
   indices_a_gno.clear();
+  delete [] a_gno ;
   return area_a_gno ;
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/mpi_routing.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/mpi_routing.cpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/mpi_routing.cpp	(revision 2269)
@@ -235,4 +235,5 @@
 	delete[]  toSend;
 	delete[]  recvCount;
+	delete[]  targetRankToIndex;
 	delete[]  request;
 	delete[]  status;
@@ -598,5 +599,5 @@
 template void CMPIRouting::transferFromSource(int *targetElements, int *sourceElements, void (*pack)(int&, char*, int&), void (* unpack)(int&, char *, int&));
 
-template void CMPIRouting::transferToTarget(Node* targetElements, Node* sourceElements, void (*pack)(Node&, char*, int&), void (* unpack)(Node&, char *, int&));
+template void CMPIRouting::transferToTarget(NodePtr* targetElements, NodePtr* sourceElements, void (*pack)(NodePtr, char*, int&), void (* unpack)(NodePtr, char *, int&));
 template void CMPIRouting::transferToTarget(Elt **targetElements, Elt **sourceElements, void (*pack)(Elt *, char*, int&), void (* unpack)(Elt *, char *, int&));
 template void CMPIRouting::transferFromSource(std::vector<int> *targetElements, std::vector<int> *sourceElements, void (*pack)(const std::vector<int>&, char*, int&), void (* unpack)(std::vector<int>&, const char *, int&));
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/node.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/node.cpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/node.cpp	(revision 2269)
@@ -79,5 +79,5 @@
 /* On level `level` find the node in our subtree that is closest to `src` and return through argument `closest`.
    The return value is just for recursive calling */
-void Node::findClosest(int level, NodePtr src, double& minDist2, NodePtr &closest)
+void Node::findClosest(int level, NodePtr src, double& minDist2, NodePtr& closest)
 {
 	double r2;
@@ -89,5 +89,5 @@
 		{
 			minDist2 = r2;
-			closest = this;
+			closest = shared_from_this();
 		}
 	}
@@ -221,13 +221,13 @@
 }*/
 
-bool find_in_tree1(Node* node)
+bool find_in_tree1(NodePtr node)
 {
 	if (node == node->tree->root) return true;
-	if (node->parent == NULL)
+	if (node->parent.lock() == NULL)
 	{
 		cerr << "Cannot find!" << endl;
 		return false;
 	}
-	return find_in_tree1(node->parent);
+	return find_in_tree1(node->parent.lock());
 }
 
@@ -264,7 +264,7 @@
 	{
     node->child.push_back(thIs);
-		thIs->parent = node;
+		thIs->parent = node ;
 		if (node->child.size() > MAX_NODE_SZ &&  node->tree->canSplit() ) // with us as additional child `node` is now too large :(
-			return (node->reinserted || node->parent == NULL) ? split(node) : reinsert(node);
+			return (node->reinserted || node->parent.lock() == NULL) ? split(node) : reinsert(node);
 	}
 	else // la < lb - 1
@@ -299,5 +299,5 @@
   
 	/* transfere out children from us to a new node q which will be returned */
-	NodePtr q = new Node;
+	NodePtr q = make_shared<Node>();
 	q->tree = thIs->tree;
 	q->child.resize(out);
@@ -462,9 +462,10 @@
 {
 	thIs->tree->increaseLevelSize(thIs->level);
-	NodePtr p = new Node;
-	NodePtr q = new Node;
+	NodePtr p = make_shared<Node>();
+	NodePtr q = make_shared<Node>();
 	p->level = q->level = thIs->level;
 	p->reinserted = q->reinserted = false;
-	p->parent = q->parent = thIs->parent;
+	p->parent = thIs->parent;
+	q->parent = thIs->parent;
 	p->tree = q->tree = thIs->tree;
 
@@ -476,5 +477,5 @@
 	std::sort(thIs->child.begin(), thIs->child.end(), compareDist);
 	for (int i = 0; i < MAX_NODE_SZ+1; i++)
-		assert(thIs->child[i]->parent == thIs);
+		assert(thIs->child[i]->parent.lock() == thIs);
 	for (int i = 0; i < MAX_NODE_SZ/2 + 1; i++)
 		q->child[i] = thIs->child[i];
@@ -496,5 +497,5 @@
 	thIs->reinserted = p->reinserted;
 	thIs->update();
-	delete p;
+	p.reset();
 
 	if (thIs == thIs->tree->root) // root split
@@ -593,5 +594,5 @@
   
   for (int i = 0; i < childSize; i++)
-		assert(child[i]->parent == this);
+		assert(child[i]->parent.lock() == shared_from_this());
 
   if (level>0) for (int i = 0; i < childSize; i++) child[i]->checkParent() ;
@@ -602,5 +603,5 @@
 	cout << "level " << this->level << ", centre ";
 	cout << "level " << this->level << ", centre " << this->centre << "\t r = " << this->radius << endl;
-	cout << this << " p: " << this->parent << endl;
+	cout << this << " p: " << this->parent.lock() << endl;
 	int n = this->child.size();
 	for (int i=0; i<n; i++)
@@ -656,8 +657,8 @@
 	double distMin2 = 0; // squared distance
 	closest = NULL;
-	if (tree->root == this)
+	if (tree->root == shared_from_this())
 		findClosest(level, node, distMin2, closest);
 
-	if (closest != NULL && tree->root == this)
+	if (closest != NULL && tree->root == shared_from_this())
 		/* When is this point reached?
 		   if the preceeding findClosest was called and succesed to set closest
@@ -690,10 +691,10 @@
 }
 
-void Node::routingIntersecting(vector<Node> *routingList, NodePtr node)
+void Node::routingIntersecting(vector<NodePtr> *routingList, NodePtr node)
 {
 	if (level==0)
 	{
 		int rank = route;
-		routingList[rank].push_back(*node);
+		routingList[rank].push_back(node);
 	}
 	else
@@ -712,5 +713,5 @@
 		child[i]->free_descendants();
 		if (child[i]->level) // do not attempt to delete leafs, they are delete through leafs vector
-			delete child[i];
+			child[i].reset();
 	}
 }
@@ -718,5 +719,5 @@
 void Node::getNodeLevel(int assignLevel, std::list<NodePtr>& NodeList)
 {
-  if (level==assignLevel) NodeList.push_back(this) ;
+  if (level==assignLevel) NodeList.push_back(shared_from_this()) ;
   else if (level>0) for (int i = 0; i < child.size(); i++) child[i]->getNodeLevel(assignLevel,NodeList) ;
   return ;
@@ -737,5 +738,5 @@
         for (int j = 0; j < child[i]->child.size(); j++) tree->push_back(child[i]->child[j]) ;
         tree->decreaseLevelSize(assignLevel) ;
-        delete child[i] ;
+        child[i].reset() ;
       }
       else newChild.push_back(child[i]) ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/node.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/node.hpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/node.hpp	(revision 2269)
@@ -10,4 +10,5 @@
 
 #include "triple.hpp"
+#include <memory>
 
 namespace sphereRemap {
@@ -112,7 +113,8 @@
 //#endif
 
-typedef Node* NodePtr;
-
-struct Node
+//typedef Node* NodePtr;
+typedef std::shared_ptr<Node> NodePtr;
+
+struct Node : public std::enable_shared_from_this<Node>
 {
 	int level; /* FIXME leafs are 0 and root is max level? */
@@ -120,5 +122,6 @@
 	Coord centre;
 	double radius;
-	NodePtr parent, ref;
+	std::weak_ptr<Node> parent ;
+	NodePtr ref;
 	std::vector<NodePtr> child;
 	std::list<NodePtr> intersectors;
@@ -198,5 +201,5 @@
 	void printLevel(int level);
 	void routeNode(NodePtr node, int level);
-	void routingIntersecting(std::vector<Node>* routingList, NodePtr node);
+	void routingIntersecting(std::vector<NodePtr>* routingList, NodePtr node);
 	void routeIntersection(std::vector<int>& routes, NodePtr node);
   void getNodeLevel(int level,std::list<NodePtr>& NodeList) ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/parallel_tree.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/parallel_tree.cpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/parallel_tree.cpp	(revision 2269)
@@ -18,5 +18,5 @@
 
 // only the circle is packed, rest of node will be initialized on unpacking
-static void packNode(Node& node, char *buffer, int& index)
+static void packNode(NodePtr node, char *buffer, int& index)
 {
 	if (buffer == NULL) // compute size only
@@ -24,13 +24,13 @@
 	else
 	{
-		*(Coord *)(&buffer[index]) = node.centre;
+		*(Coord *)(&buffer[index]) = node->centre;
 		index += sizeof(Coord);
 
-		*(double *)(&buffer[index]) = node.radius;
+		*(double *)(&buffer[index]) = node->radius;
 		index += sizeof(double);
 	}
 }
 
-static void unpackNode(Node& node, char *buffer, int& index)
+static void unpackNode(NodePtr node, char *buffer, int& index)
 {
 	Coord centre;
@@ -43,6 +43,6 @@
 	index += sizeof(double);
 
-	node.centre = centre;
-	node.radius = r;
+	node->centre = centre;
+	node->radius = r;
 }
 
@@ -95,5 +95,5 @@
 }
 
-static void transferRoutedNodes(CMPIRouting& MPIRoute, /*const*/ vector<Node>& nodeSend, const vector<int>& route, vector<Node>& nodeRecv)
+static void transferRoutedNodes(CMPIRouting& MPIRoute, /*const*/ vector<NodePtr>& nodeSend, const vector<int>& route, vector<NodePtr>& nodeRecv)
 {
 	/* `route` knows what goes where */
@@ -104,5 +104,5 @@
 }
 
-static void transferRoutedIntersections(CMPIRouting& MPIRoute, const vector<Node>& nodeSend, const vector<vector<int> >& route, vector<Node>& nodeRecv)
+static void transferRoutedIntersections(CMPIRouting& MPIRoute, const vector<NodePtr>& nodeSend, const vector<vector<int> >& route, vector<NodePtr>& nodeRecv)
 {
 	// `route` knows what goes where
@@ -110,5 +110,5 @@
 	int nRecv = MPIRoute.getTotalSourceElement();
 	nodeRecv.resize(nRecv);
-	MPIRoute.transferToTarget((Node * /*mpi wants non-const*/) &nodeSend[0], &nodeRecv[0], packNode, unpackNode);
+	MPIRoute.transferToTarget((NodePtr*) &nodeSend[0], &nodeRecv[0], packNode, unpackNode);
 //cout << MPIRoute.mpiRank << " ROUTE " << nRecv << ": " << nodeSend.size() << " " << nodeRecv.size() << "    ";
 }
@@ -122,5 +122,5 @@
 }
 
-void CParallelTree::buildSampleTreeCascade(vector<Node>& sampleNodes /*route field will be modified*/, int level)
+void CParallelTree::buildSampleTreeCascade(vector<NodePtr>& sampleNodes /*route field will be modified*/, int level)
 {
 	buildSampleTree(treeCascade[level], sampleNodes, cascade.level[level]);
@@ -132,5 +132,5 @@
 		treeCascade[level].routeNodes(route, sampleNodes, assignLevel);
 
-		vector<Node> routedNodes;
+		vector<NodePtr> routedNodes;
 		CMPIRouting mpiRoute(cascade.level[level].pg_comm);
 		transferRoutedNodes(mpiRoute, sampleNodes, route, routedNodes);
@@ -139,5 +139,5 @@
 }
 
-void buildSampleTree(CSampleTree& tree, const vector<Node>& node, const CCascadeLevel& comm)
+void buildSampleTree(CSampleTree& tree, const vector<NodePtr>& node, const CCascadeLevel& comm)
 /*
 	In the beginning all the sample elements are distributed
@@ -175,5 +175,5 @@
 	for (int i = 0; i < nsend; i++)
 	{
-		const Node& no = node[randomArray[i]];
+		const Node& no = *node[randomArray[i]];
 		*((Coord *) (sendBuffer + index)) = no.centre;
 		index += sizeof(Coord)/sizeof(*sendBuffer);
@@ -210,4 +210,6 @@
 	randomizeArray(randomArray);
 	tree.leafs.resize(blocSize);
+	for(auto& it : tree.leafs) it=make_shared<Node>() ;
+
 	index = 0;
   
@@ -220,6 +222,6 @@
 		double radius = recvBuffer[index%s];
     index++ ;
-		tree.leafs[randomArray[i]].centre = x;
-		tree.leafs[randomArray[i]].radius = radius;
+		tree.leafs[randomArray[i]]->centre = x;
+		tree.leafs[randomArray[i]]->radius = radius;
 
 	}
@@ -233,5 +235,4 @@
 	CTimer::get("buildSampleTree(local)").suspend();
 	CTimer::get("buildSampleTree(local)").print();
-
 	/* End gracefully if sample tree could not be constructed with desired number of nodes on assignLevel */
 	int allok, ok = (tree.levelSize[assignLevel] == comm.group_size);
@@ -262,5 +263,5 @@
 
 
-void CParallelTree::buildLocalTree(const vector<Node>& node, const vector<int>& route)
+void CParallelTree::buildLocalTree(const vector<NodePtr>& node, const vector<int>& route)
 {
 	CMPIRouting MPIRoute(communicator);
@@ -276,5 +277,5 @@
 	vector<Elt*> ptElement(node.size());
 	for (int i = 0; i < node.size(); i++)
-		ptElement[i] = (Elt *) (node[i].data);
+		ptElement[i] = (Elt *) (node[i]->data);
 
 	vector<Elt*> ptLocalElement(nbLocalElements);
@@ -297,5 +298,5 @@
 		elt.id.ind = i;
 		elt.id.rank = mpiRank;
-		localTree.leafs.push_back(Node(elt.x, cptRadius(elt), &localElements[i]));
+		localTree.leafs.push_back(make_shared<Node>(elt.x, cptRadius(elt), &localElements[i]));
 	}
 	localTree.build(localTree.leafs);
@@ -306,5 +307,5 @@
 }
 
-void CParallelTree::build(vector<Node>& node, vector<Node>& node2)
+void CParallelTree::build(vector<NodePtr>& node, vector<NodePtr>& node2)
 {
 
@@ -332,5 +333,5 @@
 //	assert(node2.size() > nbSampleNodes);
 //	assert(node.size() + node2.size() > nbSampleNodes);
-	vector<Node> sampleNodes; sampleNodes.reserve(nbSampleNodes1+nbSampleNodes2);
+	vector<NodePtr> sampleNodes; sampleNodes.reserve(nbSampleNodes1+nbSampleNodes2);
 
 	vector<int> randomArray1(node.size());
@@ -358,6 +359,6 @@
         }
 */
-        for (int i = 0; i <nbSampleNodes1; i++) sampleNodes.push_back(Node(node[randomArray1[i%nb1]].centre,  node[randomArray1[i%nb1]].radius, NULL));
-        for (int i = 0; i <nbSampleNodes2; i++) sampleNodes.push_back(Node(node2[randomArray2[i%nb2]].centre, node2[randomArray2[i%nb2]].radius, NULL));
+        for (int i = 0; i <nbSampleNodes1; i++) sampleNodes.push_back(make_shared<Node>(node[randomArray1[i%nb1]]->centre,  node[randomArray1[i%nb1]]->radius, nullptr));
+        for (int i = 0; i <nbSampleNodes2; i++) sampleNodes.push_back(make_shared<Node>(node2[randomArray2[i%nb2]]->centre, node2[randomArray2[i%nb2]]->radius, nullptr));
 
 /*          
@@ -393,5 +394,5 @@
 }
 
-void CParallelTree::routeNodes(vector<int>& route, vector<Node>& nodes /*route field used*/, int level)
+void CParallelTree::routeNodes(vector<int>& route, vector<NodePtr>& nodes /*route field used*/, int level)
 {
 	treeCascade[level].routeNodes(route /*assign*/, nodes, assignLevel);
@@ -399,5 +400,5 @@
 	if (level+1 < cascade.num_levels)
 	{
-		vector<Node> routedNodes;
+		vector<NodePtr> routedNodes;
 		CMPIRouting MPIRoute(cascade.level[level].pg_comm);
 		transferRoutedNodes(MPIRoute, nodes, route /*use*/, routedNodes);
@@ -438,5 +439,5 @@
 }
 
-void CParallelTree::routeIntersections(vector<vector<int> >& routes, vector<Node>& nodes, int level)
+void CParallelTree::routeIntersections(vector<vector<int> >& routes, vector<NodePtr>& nodes, int level)
 {
 	treeCascade[level].routeIntersections(routes /*assign*/, nodes);
@@ -444,14 +445,17 @@
 	if (level+1 < cascade.num_levels)
 	{
-		vector<Node> routedNodes;
+		vector<NodePtr> routedNodes;
 		CMPIRouting MPIRoute(cascade.level[level].pg_comm);
 
 		vector<int> flattenedRoutes1;
 		linearize(routes, flattenedRoutes1);
-		vector<Node> double_nodes(flattenedRoutes1.size());
+		vector<NodePtr> double_nodes(flattenedRoutes1.size());
 		int j = 0;
 		for (int i = 0; i < routes.size(); ++i)
 			for (int k = 0; k < routes[i].size(); ++k, ++j)
-				double_nodes[j] = nodes[i];
+			{
+				double_nodes[j] = make_shared<Node>() ;
+				*double_nodes[j] = *nodes[i];
+			}
 		transferRoutedNodes(MPIRoute, double_nodes, flattenedRoutes1 /*use*/, routedNodes);
 		vector<vector<int> > globalRanks(routedNodes.size());
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/parallel_tree.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/parallel_tree.hpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/parallel_tree.hpp	(revision 2269)
@@ -15,8 +15,8 @@
 	~CParallelTree();
 
-	void build(vector<Node>& node, vector<Node>& node2);
+	void build(vector<NodePtr>& node, vector<NodePtr>& node2);
 
-	void routeNodes(vector<int>& route, vector<Node>& nodes, int level = 0);
-	void routeIntersections(vector<vector<int> >& route, vector<Node>& nodes, int level = 0);
+	void routeNodes(vector<int>& route, vector<NodePtr>& nodes, int level = 0);
+	void routeIntersections(vector<vector<int> >& route, vector<NodePtr>& nodes, int level = 0);
 
 	int nbLocalElements;
@@ -27,6 +27,6 @@
 private:
 	void updateCirclesForRouting(Coord rootCentre, double rootRadius, int level = 0);
-	void buildSampleTreeCascade(vector<Node>& sampleNodes, int level = 0);
-	void buildLocalTree(const vector<Node>& node, const vector<int>& route);
+	void buildSampleTreeCascade(vector<NodePtr>& sampleNodes, int level = 0);
+	void buildLocalTree(const vector<NodePtr>& node, const vector<int>& route);
 	void buildRouteTree();
 
@@ -38,5 +38,5 @@
 };
 
-void buildSampleTree(CSampleTree& tree, const vector<Node>& node, const CCascadeLevel& comm);
+void buildSampleTree(CSampleTree& tree, const vector<NodePtr>& node, const CCascadeLevel& comm);
 
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/timerRemap.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/timerRemap.cpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/timerRemap.cpp	(revision 2269)
@@ -60,3 +60,10 @@
 	return *(it->second);
 }
+
+void CTimer::release(void)
+{
+  for(auto & it : allTimer) delete it.second ;
+  allTimer.clear() ;	
 }
+
+}
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/timerRemap.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/timerRemap.hpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/timerRemap.hpp	(revision 2269)
@@ -1,4 +1,4 @@
-#ifndef __TIMER_HPP__
-#define __TIMER_HPP__
+#ifndef __TIMER_REMAP_HPP__
+#define __TIMER_REMAP_HPP__
 
 #include "mpi.hpp"
@@ -29,7 +29,6 @@
     static double getTime(void);
     static CTimer& get(string name);
-  };
-
-
+    static void release(void) ;
+  } ;
 
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/tree.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/tree.cpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/tree.cpp	(revision 2269)
@@ -27,20 +27,20 @@
 */
 
-void CBasicTree::routeNodes(vector<int>& route, vector<Node>& nodes, int assignLevel)
+void CBasicTree::routeNodes(vector<int>& route, vector<NodePtr>& nodes, int assignLevel)
 {
 	for (int i = 0; i < nodes.size(); i++)
 	{
-		root->routeNode(&nodes[i], assignLevel);
-		route[i] = nodes[i].route;
-	}
-}
-
-void CBasicTree::routeIntersections(vector<vector<int> >& routes, vector<Node>& nodes)
+		root->routeNode(nodes[i], assignLevel);
+		route[i] = nodes[i]->route;
+	}
+}
+
+void CBasicTree::routeIntersections(vector<vector<int> >& routes, vector<NodePtr>& nodes)
 {
 	for (int i = 0; i < nodes.size(); i++)
-		root->routeIntersection(routes[i], &nodes[i]);
-}
-
-void CBasicTree::build(vector<Node>& nodes)
+		root->routeIntersection(routes[i], nodes[i]);
+}
+
+void CBasicTree::build(vector<NodePtr>& nodes)
 {
 	newRoot(1);
@@ -80,5 +80,5 @@
 	push_back(node);
 
-	NodePtr q;
+	NodePtr q=make_shared<Node>();
 	while (pool.size())
 	{
@@ -88,5 +88,5 @@
 		if (ri)
 		{
-			delete q;
+			q.reset();
 			ri = 0;
 		}
@@ -103,5 +103,5 @@
 		if (ri)
 		{
-			delete q;
+			q.reset();
 			ri = 0;
 		}
@@ -137,8 +137,8 @@
 void CBasicTree::newRoot(int level)  // newroot <- root
 {
-	root = new Node;
+	root = make_shared<Node>();
 	// if (level > 1) cout << " newRoot level " << level << endl;
 	root->level = level;
-	root->parent = 0;
+	root->parent.reset() ;
 	root->leafCount = 0;
 // initialize root node on the sphere
@@ -155,8 +155,8 @@
 	//FIXME uncomment the next line and figure out why it segfault sometimes
 	//root->free_descendants(); // recursively deletes all nodes in the tree
-	if (root) delete root;
-}
-
-void CTree::insertNodes(vector<Node>& nodes)
+	if (root) root.reset();
+}
+
+void CTree::insertNodes(vector<NodePtr>& nodes)
 {
 	int stepSlim = MAX_NODE_SZ*MAX_NODE_SZ*2;
@@ -164,5 +164,5 @@
 	for (int i = 0; i < nodes.size(); i++)
 	{
-		insertNode(&nodes[i]);
+		insertNode(nodes[i]);
 
 		if (root->leafCount > stepSlim) // time for slim down
@@ -175,5 +175,5 @@
 
 
-void CSampleTree::insertNodes(vector<Node>& nodes)
+void CSampleTree::insertNodes(vector<NodePtr>& nodes)
 {
 	bool first1 = true;
@@ -184,8 +184,7 @@
   int i ;
   
-//  cout<<"CSampleTree::insertNodes  : nb node to be inserted : "<<nodes.size()<<endl ;
   for (i = 0; i < nodes.size(); i++)
 	{
-    insertNode(&nodes[i]);
+    insertNode(nodes[i]);
 
 		if (root->leafCount > stepSlim && levelSize[assignLevel] < keepNodes-2) // time for slim down
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/tree.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/tree.hpp	(revision 2268)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/extern/remap/src/tree.hpp	(revision 2269)
@@ -20,14 +20,14 @@
 	int ri; /** this is set to one by a node in case of reinsertion */
 	vector<int> levelSize; /** e.g. levelSize[0] == leafs.size() */
-	vector<Node> leafs; /** leafs are stored in vector for easy access and rest of the tree nodes as separate allocations, only reachable through tree traversal */
+	vector<NodePtr> leafs; /** leafs are stored in vector for easy access and rest of the tree nodes as separate allocations, only reachable through tree traversal */
 
 	CBasicTree() : ri(0), levelSize(MAX_LEVEL_SIZE), root(NULL), isAssignedLevel(false), okSplit(true), isActiveOkSplit(false) {} 
 	~CBasicTree(); 
-	void build(vector<Node>& nodes);
+	void build(vector<NodePtr>& nodes);
 	void slim(int nbIts = 1);
-	virtual void insertNodes(vector<Node>& node) = 0;
+	virtual void insertNodes(vector<NodePtr>& node) = 0;
 
-	void routeNodes(vector<int>& route, vector<Node>& nodes, int assignLevel);
-	void routeIntersections(vector<vector<int> >& route, vector<Node>& nodes);
+	void routeNodes(vector<int>& route, vector<NodePtr>& nodes, int assignLevel);
+	void routeIntersections(vector<vector<int> >& route, vector<NodePtr>& nodes);
 
 	void push_back(NodePtr node);
@@ -63,5 +63,5 @@
 {
 public:
-	void insertNodes(vector<Node>& nodes);
+	void insertNodes(vector<NodePtr>& nodes);
 };
 
@@ -73,5 +73,5 @@
   void slimAssignedLevel() ;
   void removeExtraNode(void) ;
-	void insertNodes(vector<Node>& nodes);
+	void insertNodes(vector<NodePtr>& nodes);
 };
 
