Index: XIOS3/trunk/extern/remap/src/meshutil.cpp
===================================================================
--- XIOS3/trunk/extern/remap/src/meshutil.cpp	(revision 2471)
+++ XIOS3/trunk/extern/remap/src/meshutil.cpp	(revision 2534)
@@ -11,5 +11,5 @@
 using namespace std;
 
-double computePolygoneArea(Elt& a, const Coord &pole)
+void computePolygonGeometry(Elt& a, const Coord &pole, double& area, Coord& bary)
 {
   using N = uint32_t;
@@ -49,5 +49,5 @@
   vector<N> indices_a_gno = mapbox::earcut<N>(polyline);
   
-  double area_a_gno=0 ;
+  area=0 ;
   for(int i=0;i<indices_a_gno.size()/3;++i)
     {
@@ -55,12 +55,23 @@
       Coord x1 = Ox * polyline[0][indices_a_gno[3*i+1]][0] + Oy* polyline[0][indices_a_gno[3*i+1]][1] + Oz ;
       Coord x2 = Ox * polyline[0][indices_a_gno[3*i+2]][0] + Oy* polyline[0][indices_a_gno[3*i+2]][1] + Oz ;
-      area_a_gno+=triarea(x0 * (1./norm(x0)),x1* (1./norm(x1)), x2* (1./norm(x2))) ;
-    }
-
+      area+=triarea(x0 * (1./norm(x0)),x1* (1./norm(x1)), x2* (1./norm(x2))) ;
+    }
+
+
+  bary = exact_barycentre(dstPolygon.data(),na) ;
+  
+  // check signed area of polygons on gnomonic plan => if <0 then switch barycenter and invert vertex numbering 
+  double signedArea = 0 ;
+  for(int n=0; n<na;n++) signedArea+= a_gno[n].x*a_gno[(n+1)%na].y-a_gno[(n+1)%na].x*a_gno[n].y ;
+  if (signedArea<0) 
+  {
+    bary = bary * (-1.) ;
+    switchOrientation(a.n, a.vertex,a.edge,a.d) ;
+  }
+  
   vect_points.clear();
   polyline.clear();
   indices_a_gno.clear();
   delete [] a_gno ;
-  return area_a_gno ;
 }
 
@@ -68,12 +79,14 @@
 void cptEltGeom(Elt& elt, const Coord &pole)
 {
-  orient(elt.n, elt.vertex, elt.edge, elt.d, elt.x);
-  normals(elt, pole);
-  Coord gg;
-  elt.area = airbar(elt.n, elt.vertex, elt.edge, elt.d, pole, gg);
-  elt.x = gg;
+   orient(elt.n, elt.vertex, elt.edge, elt.d, elt.x);
+   normals(elt, pole);
+//  Coord gg;
+//  elt.area = airbar(elt.n, elt.vertex, elt.edge, elt.d, pole, gg);
+//  elt.x = gg;
 // overwrite area computation 
 
-  elt.area =  computePolygoneArea(elt, pole) ;
+   computePolygonGeometry(elt, pole, elt.area, elt.x) ;
+   normals(elt, pole);
+
 }
 
Index: XIOS3/trunk/extern/remap/src/node.cpp
===================================================================
--- XIOS3/trunk/extern/remap/src/node.cpp	(revision 2471)
+++ XIOS3/trunk/extern/remap/src/node.cpp	(revision 2534)
@@ -760,3 +760,9 @@
 }
 
-}
+
+NodePtr Node::create()
+{
+    return make_shared<Node>();
+}
+
+}
Index: XIOS3/trunk/extern/remap/src/node.hpp
===================================================================
--- XIOS3/trunk/extern/remap/src/node.hpp	(revision 2471)
+++ XIOS3/trunk/extern/remap/src/node.hpp	(revision 2534)
@@ -206,4 +206,5 @@
   bool removeDeletedNodes(int assignLevel) ;
   void free_descendants();
+  NodePtr create();
 };
 
Index: XIOS3/trunk/extern/remap/src/parallel_tree.cpp
===================================================================
--- XIOS3/trunk/extern/remap/src/parallel_tree.cpp	(revision 2471)
+++ XIOS3/trunk/extern/remap/src/parallel_tree.cpp	(revision 2534)
@@ -101,4 +101,8 @@
 	int nRecv = MPIRoute.getTotalSourceElement();
 	nodeRecv.resize(nRecv);
+	for (int i=0;i<nRecv;i++)
+	{
+	  nodeRecv[i] = nodeRecv[i]->create();
+	}
 	MPIRoute.transferToTarget(&nodeSend[0], &nodeRecv[0], packNode, unpackNode);
 }
@@ -110,4 +114,8 @@
 	int nRecv = MPIRoute.getTotalSourceElement();
 	nodeRecv.resize(nRecv);
+	for (int i=0;i<nRecv;i++)
+	{
+	  nodeRecv[i] = nodeRecv[i]->create();
+	}
 	MPIRoute.transferToTarget((NodePtr*) &nodeSend[0], &nodeRecv[0], packNode, unpackNode);
 //cout << MPIRoute.mpiRank << " ROUTE " << nRecv << ": " << nodeSend.size() << " " << nodeRecv.size() << "    ";
Index: XIOS3/trunk/extern/remap/src/polyg.cpp
===================================================================
--- XIOS3/trunk/extern/remap/src/polyg.cpp	(revision 2471)
+++ XIOS3/trunk/extern/remap/src/polyg.cpp	(revision 2534)
@@ -18,4 +18,5 @@
   (because computing intersection area requires both polygons to have same orientation)
 */
+
 void orient(int N, Coord *vertex, Coord *edge, double *d, const Coord &g)
 {
@@ -24,16 +25,19 @@
   Coord vertical = crossprod(ga, gb);
   if (N > 2 && scalarprod(g, vertical) < 0)  // (GAxGB).G
-  {
-    for (int i = 0; i < N/2; i++)
-      swap(vertex[i], vertex[N-1-i]);
-
-    for (int i = 0; i < (N-1)/2; i++)
-    {
-      swap(edge[N-2-i], edge[i]);
-      swap(d[i], d[N-2-i]);
-    }
-  }
-}
-
+    switchOrientation(N, vertex, edge, d) ;
+  
+}
+
+void switchOrientation(int N, Coord *vertex, Coord *edge, double *d)
+{
+  for (int i = 0; i < N/2; i++) swap(vertex[i], vertex[N-1-i]);
+
+  for (int i = 0; i < (N-1)/2; i++)
+  {
+    swap(edge[N-2-i], edge[i]);
+    swap(d[i], d[N-2-i]);
+  }
+  
+}
 
 void normals(Coord *x, int n, Coord *a)
@@ -94,4 +98,5 @@
   {
     return  proj(gc_normalintegral(x, n));
+    //return new_barycentre(x,n) ;
   }
   else if (n == 0) return ORIGIN;
@@ -102,4 +107,27 @@
   return ORIGIN;
 }
+
+/* other methode to compute barycenter of spherical polygon
+   for a spherical polygon, the moment is half the sum of (a x b) / ||a x b|| * (angle between a and b) 
+   for each pair of consecutive vertices a,b.
+*/ 
+
+Coord new_barycentre(const Coord *x, int n)
+{
+  if (n >= 3)
+  {
+    Coord sum=ORIGIN ;
+    for (int i = 0; i < n; i++)
+    { 
+      sum=sum+crossprod(x[i],x[(i+1)%n])*(1./norm(crossprod(x[i],x[(i+1)%n]))*2.*atan2(norm(x[i]-x[(i+1)%n]),norm(x[i]+x[(i+1)%n]))) ; 
+    }
+    return proj(sum) ; 
+  }
+  else if (n == 0) return ORIGIN;
+  else if (n == 2) return midpoint(x[0], x[1]);
+  else if (n == 1) return x[0];
+}
+
+
 
 Coord sc_gc_moon_normalintegral(Coord a, Coord b, Coord pole)
Index: XIOS3/trunk/extern/remap/src/polyg.hpp
===================================================================
--- XIOS3/trunk/extern/remap/src/polyg.hpp	(revision 2471)
+++ XIOS3/trunk/extern/remap/src/polyg.hpp	(revision 2534)
@@ -7,5 +7,5 @@
 
 void orient(int n, Coord *vertex, Coord *edge, double *d, const Coord &g);
-
+void switchOrientation(int N, Coord *vertex, Coord *edge, double *d) ;
 void normals(Coord *x, int n, Coord *a);
 
@@ -16,4 +16,5 @@
 double polygonarea(Coord *x, int n);
 Coord exact_barycentre(const Coord *x, int n) ;
+Coord new_barycentre(const Coord *x, int n) ;
 
 int packedPolygonSize(const Elt& e);
