Index: XIOS/trunk/inputs/REMAP/iodef.xml
===================================================================
--- XIOS/trunk/inputs/REMAP/iodef.xml	(revision 688)
+++ XIOS/trunk/inputs/REMAP/iodef.xml	(revision 689)
@@ -9,4 +9,5 @@
      <field id="src_field"  operation="instant" grid_ref="src_grid"/>
      <field id="dst_field"  operation="instant" field_ref="src_field" grid_ref="dst_grid"/>
+     <field id="dst_field_regular"  operation="instant" field_ref="src_field" grid_ref="dst_grid_regular"/>
    </field_definition>
 
@@ -14,8 +15,11 @@
    <file_definition type="multiple_file" par_access="collective" output_freq="1ts" output_level="10" enabled=".TRUE.">
      <file id="output" name="output">
-<!--        <field field_ref="src_field" name="field" />-->
+        <field field_ref="src_field" name="field" />
      </file>
      <file id="output_dst" name="output_dst">
         <field field_ref="dst_field" name="field" />
+     </file>
+     <file id="output_dst_regular" name="output_dst_regular">
+        <field field_ref="dst_field_regular" name="field" />
      </file>
    </file_definition>
@@ -28,6 +32,9 @@
      <domain id="src_domain" />
      <domain id="dst_domain" domain_src="src_domain">
+       <interpolate_domain file="weight.nc"/>
+     </domain>
+     <domain id="dst_domain_regular" domain_src="src_domain">
        <generate_rectilinear_domain />
-       <interpolate_from_file_domain file="weight.nc" />
+       <interpolate_domain/>
      </domain>
    </domain_definition>
@@ -36,4 +43,7 @@
      <grid id="dst_grid">
        <domain domain_ref="dst_domain" />
+     </grid>
+     <grid id="dst_grid_regular">
+       <domain domain_ref="dst_domain_regular" />
      </grid>
      <grid id="src_grid">
Index: XIOS/trunk/src/config/interpolate_domain_attribute.conf
===================================================================
--- XIOS/trunk/src/config/interpolate_domain_attribute.conf	(revision 689)
+++ XIOS/trunk/src/config/interpolate_domain_attribute.conf	(revision 689)
@@ -0,0 +1,3 @@
+/* GLOBAL */
+DECLARE_ATTRIBUTE(StdString, file)
+DECLARE_ATTRIBUTE(int, order)
Index: XIOS/trunk/src/config/interpolate_from_file_domain_attribute.conf
===================================================================
--- XIOS/trunk/src/config/interpolate_from_file_domain_attribute.conf	(revision 688)
+++ 	(revision )
@@ -1,2 +1,0 @@
-/* GLOBAL */
-DECLARE_ATTRIBUTE(StdString, file)
Index: XIOS/trunk/src/config/node_type.conf
===================================================================
--- XIOS/trunk/src/config/node_type.conf	(revision 688)
+++ XIOS/trunk/src/config/node_type.conf	(revision 689)
@@ -47,7 +47,7 @@
 #endif //__XIOS_CZoomDomain__
 
-#ifdef __XIOS_CInterpolateFromFileDomain__
-   DECLARE_NODE(InterpolateFromFileDomain, interpolate_from_file_domain)
-#endif //__XIOS_CInterpolateFromFileDomain__
+#ifdef __XIOS_CInterpolateDomain__
+   DECLARE_NODE(InterpolateDomain, interpolate_domain)
+#endif //__XIOS_CInterpolateDomain__
 
 #ifdef __XIOS_CGenerateRectilinearDomain__
Index: XIOS/trunk/src/group_factory_decl.cpp
===================================================================
--- XIOS/trunk/src/group_factory_decl.cpp	(revision 688)
+++ XIOS/trunk/src/group_factory_decl.cpp	(revision 689)
@@ -29,5 +29,5 @@
   macro(CInterpolateAxisGroup)
   macro(CZoomDomainGroup)
-  macro(CInterpolateFromFileDomainGroup)
+  macro(CInterpolateDomainGroup)
   macro(CGenerateRectilinearDomainGroup)
 }
Index: XIOS/trunk/src/group_template_decl.cpp
===================================================================
--- XIOS/trunk/src/group_template_decl.cpp	(revision 688)
+++ XIOS/trunk/src/group_template_decl.cpp	(revision 689)
@@ -18,5 +18,5 @@
   macro(InterpolateAxis)
   macro(ZoomDomain)
-  macro(InterpolateFromFileDomain)
+  macro(InterpolateDomain)
   macro(GenerateRectilinearDomain)
 
Index: XIOS/trunk/src/node/domain.cpp
===================================================================
--- XIOS/trunk/src/node/domain.cpp	(revision 688)
+++ XIOS/trunk/src/node/domain.cpp	(revision 689)
@@ -19,5 +19,5 @@
 #include "client_server_mapping_distributed.hpp"
 #include "zoom_domain.hpp"
-#include "interpolate_from_file_domain.hpp"
+#include "interpolate_domain.hpp"
 #include "generate_rectilinear_domain.hpp"
 
@@ -1782,6 +1782,6 @@
       StdString zoomDomainDefRoot("zoom_domain_definition");
       StdString zoom("zoom_domain");
-      StdString interpFromFileDomainDefRoot("interpolate_from_file_domain_definition");
-      StdString interpFromFile("interpolate_from_file_domain");
+      StdString interpDomainDefRoot("interpolate_domain_definition");
+      StdString interpFromFile("interpolate_domain");
       StdString generateRectilinearDefRoot("generate_rectilinear_domain_definition");
       StdString generateRectilinear("generate_rectilinear_domain");
@@ -1795,7 +1795,7 @@
         else if (node.getElementName() == interpFromFile)
         {
-          CInterpolateFromFileDomain* tmp = (CInterpolateFromFileDomainGroup::get(interpFromFileDomainDefRoot))->createChild();
+          CInterpolateDomain* tmp = (CInterpolateDomainGroup::get(interpDomainDefRoot))->createChild();
           tmp->parse(node);
-          transformationMap_.push_back(std::make_pair(TRANS_INTERPOLATE_DOMAIN_FROM_FILE,tmp));
+          transformationMap_.push_back(std::make_pair(TRANS_INTERPOLATE_DOMAIN,tmp));
         }
         else if (node.getElementName() == generateRectilinear)
Index: XIOS/trunk/src/node/interpolate_domain.cpp
===================================================================
--- XIOS/trunk/src/node/interpolate_domain.cpp	(revision 689)
+++ XIOS/trunk/src/node/interpolate_domain.cpp	(revision 689)
@@ -0,0 +1,38 @@
+#include "interpolate_domain.hpp"
+#include "type.hpp"
+
+namespace xios {
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CInterpolateDomain::CInterpolateDomain(void)
+    : CObjectTemplate<CInterpolateDomain>(), CInterpolateDomainAttributes(), CTransformation<CDomain>()
+  { /* Ne rien faire de plus */ }
+
+  CInterpolateDomain::CInterpolateDomain(const StdString & id)
+    : CObjectTemplate<CInterpolateDomain>(id), CInterpolateDomainAttributes(), CTransformation<CDomain>()
+  { /* Ne rien faire de plus */ }
+
+  CInterpolateDomain::~CInterpolateDomain(void)
+  {}
+
+  //----------------------------------------------------------------
+
+  StdString CInterpolateDomain::GetName(void)    { return StdString("interpolate_domain"); }
+  StdString CInterpolateDomain::GetDefName(void) { return StdString("interpolate_domain"); }
+  ENodeType CInterpolateDomain::GetType(void)    { return eInterpolateDomain; }
+
+  void CInterpolateDomain::checkValid(CDomain* domainSrc)
+  {
+    int order = 2;
+    if (!this->order.isEmpty()) order = this->order.getValue();
+    else this->order.setValue(order);
+    if (order < 1)
+    {
+       ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
+             << "Interpolation order is less than 1, it should be greater than 0."
+             << "Please define a correct one") ;
+    }
+  }
+
+}
Index: XIOS/trunk/src/node/interpolate_domain.hpp
===================================================================
--- XIOS/trunk/src/node/interpolate_domain.hpp	(revision 689)
+++ XIOS/trunk/src/node/interpolate_domain.hpp	(revision 689)
@@ -0,0 +1,65 @@
+#ifndef __XIOS_CInterpolateDomain__
+#define __XIOS_CInterpolateDomain__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+#include "domain.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CInterpolateDomainGroup;
+  class CInterpolateDomainAttributes;
+  class CInterpolateDomain;
+  class CDomain;
+
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CInterpolateDomain)
+#include "interpolate_domain_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CInterpolateDomain)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CInterpolateDomain
+    This class describes interpolate_from_file_domain in xml file.
+  */
+  class CInterpolateDomain
+    : public CObjectTemplate<CInterpolateDomain>
+    , public CInterpolateDomainAttributes
+    , public CTransformation<CDomain>
+  {
+    public :
+      typedef CObjectTemplate<CInterpolateDomain> SuperClass;
+      typedef CInterpolateDomainAttributes SuperClassAttribute;
+
+    public :
+      /// Constructeurs ///
+      CInterpolateDomain(void);
+      explicit CInterpolateDomain(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CInterpolateDomain(void);
+
+      virtual void checkValid(CDomain* axisDest);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+    private:
+
+  }; // class CInterpolateDomain
+
+  DECLARE_GROUP(CInterpolateDomain);
+} // namespace xios
+
+#endif // __XIOS_CInterpolateDomain__
Index: XIOS/trunk/src/node/interpolate_from_file_domain.cpp
===================================================================
--- XIOS/trunk/src/node/interpolate_from_file_domain.cpp	(revision 688)
+++ 	(revision )
@@ -1,29 +1,0 @@
-#include "interpolate_from_file_domain.hpp"
-#include "type.hpp"
-
-namespace xios {
-
-  /// ////////////////////// DÃ©finitions ////////////////////// ///
-
-  CInterpolateFromFileDomain::CInterpolateFromFileDomain(void)
-    : CObjectTemplate<CInterpolateFromFileDomain>(), CInterpolateFromFileDomainAttributes(), CTransformation<CDomain>()
-  { /* Ne rien faire de plus */ }
-
-  CInterpolateFromFileDomain::CInterpolateFromFileDomain(const StdString & id)
-    : CObjectTemplate<CInterpolateFromFileDomain>(id), CInterpolateFromFileDomainAttributes(), CTransformation<CDomain>()
-  { /* Ne rien faire de plus */ }
-
-  CInterpolateFromFileDomain::~CInterpolateFromFileDomain(void)
-  {}
-
-  //----------------------------------------------------------------
-
-  StdString CInterpolateFromFileDomain::GetName(void)    { return StdString("interpolate_from_file_domain"); }
-  StdString CInterpolateFromFileDomain::GetDefName(void) { return StdString("interpolate_from_file_domain"); }
-  ENodeType CInterpolateFromFileDomain::GetType(void)    { return eInterpolateFromFileDomain; }
-
-  void CInterpolateFromFileDomain::checkValid(CDomain* domainSrc)
-  {
-  }
-
-}
Index: XIOS/trunk/src/node/interpolate_from_file_domain.hpp
===================================================================
--- XIOS/trunk/src/node/interpolate_from_file_domain.hpp	(revision 688)
+++ 	(revision )
@@ -1,65 +1,0 @@
-#ifndef __XIOS_CInterpolateFromFileDomain__
-#define __XIOS_CInterpolateFromFileDomain__
-
-/// xios headers ///
-#include "xios_spl.hpp"
-#include "attribute_enum.hpp"
-#include "attribute_enum_impl.hpp"
-#include "attribute_array.hpp"
-#include "declare_attribute.hpp"
-#include "object_template.hpp"
-#include "group_factory.hpp"
-#include "declare_group.hpp"
-#include "transformation.hpp"
-#include "domain.hpp"
-
-namespace xios {
-  /// ////////////////////// DÃ©clarations ////////////////////// ///
-  class CInterpolateFromFileDomainGroup;
-  class CInterpolateFromFileDomainAttributes;
-  class CInterpolateFromFileDomain;
-  class CDomain;
-
-  ///--------------------------------------------------------------
-
-  // Declare/Define CFileAttribute
-  BEGIN_DECLARE_ATTRIBUTE_MAP(CInterpolateFromFileDomain)
-#include "interpolate_from_file_domain_attribute.conf"
-  END_DECLARE_ATTRIBUTE_MAP(CInterpolateFromFileDomain)
-
-  ///--------------------------------------------------------------
-  /*!
-    \class CInterpolateFromFileDomain
-    This class describes interpolate_from_file_domain in xml file.
-  */
-  class CInterpolateFromFileDomain
-    : public CObjectTemplate<CInterpolateFromFileDomain>
-    , public CInterpolateFromFileDomainAttributes
-    , public CTransformation<CDomain>
-  {
-    public :
-      typedef CObjectTemplate<CInterpolateFromFileDomain> SuperClass;
-      typedef CInterpolateFromFileDomainAttributes SuperClassAttribute;
-
-    public :
-      /// Constructeurs ///
-      CInterpolateFromFileDomain(void);
-      explicit CInterpolateFromFileDomain(const StdString& id);
-
-      /// Destructeur ///
-      virtual ~CInterpolateFromFileDomain(void);
-
-      virtual void checkValid(CDomain* axisDest);
-
-      /// Accesseurs statiques ///
-      static StdString GetName(void);
-      static StdString GetDefName(void);
-      static ENodeType GetType(void);
-    private:
-
-  }; // class CInterpolateFromFileDomain
-
-  DECLARE_GROUP(CInterpolateFromFileDomain);
-} // namespace xios
-
-#endif // __XIOS_CInterpolateFromFileDomain__
Index: XIOS/trunk/src/node/node_enum.hpp
===================================================================
--- XIOS/trunk/src/node/node_enum.hpp	(revision 688)
+++ XIOS/trunk/src/node/node_enum.hpp	(revision 689)
@@ -24,5 +24,5 @@
          eInterpolateAxis,
          eZoomDomain,
-         eInterpolateFromFileDomain,
+         eInterpolateDomain,
          eGenerateRectilinearDomain
 
Index: XIOS/trunk/src/node/node_type.hpp
===================================================================
--- XIOS/trunk/src/node/node_type.hpp	(revision 688)
+++ XIOS/trunk/src/node/node_type.hpp	(revision 689)
@@ -14,5 +14,5 @@
 #include "interpolate_axis.hpp"
 #include "zoom_domain.hpp"
-#include "interpolate_from_file_domain.hpp"
+#include "interpolate_domain.hpp"
 #include "generate_rectilinear_domain.hpp"
 
Index: XIOS/trunk/src/node/transformation_enum.hpp
===================================================================
--- XIOS/trunk/src/node/transformation_enum.hpp	(revision 688)
+++ XIOS/trunk/src/node/transformation_enum.hpp	(revision 689)
@@ -11,5 +11,5 @@
         TRANS_INTERPOLATE_AXIS,
         TRANS_ZOOM_DOMAIN,
-        TRANS_INTERPOLATE_DOMAIN_FROM_FILE,
+        TRANS_INTERPOLATE_DOMAIN,
         TRANS_GENERATE_RECTILINEAR_DOMAIN
       } ETranformationType;
Index: XIOS/trunk/src/object_factory_decl.cpp
===================================================================
--- XIOS/trunk/src/object_factory_decl.cpp	(revision 688)
+++ XIOS/trunk/src/object_factory_decl.cpp	(revision 689)
@@ -28,5 +28,5 @@
   macro(CInterpolateAxis)
   macro(CZoomDomain)
-  macro(CInterpolateFromFileDomain)
+  macro(CInterpolateDomain)
   macro(CGenerateRectilinearDomain)
 
@@ -42,5 +42,5 @@
   macro(CInterpolateAxisGroup)
   macro(CZoomDomainGroup)
-  macro(CInterpolateFromFileDomainGroup)
+  macro(CInterpolateDomainGroup)
   macro(CGenerateRectilinearDomainGroup)
 }
Index: XIOS/trunk/src/object_template_decl.cpp
===================================================================
--- XIOS/trunk/src/object_template_decl.cpp	(revision 688)
+++ XIOS/trunk/src/object_template_decl.cpp	(revision 689)
@@ -17,5 +17,5 @@
   template class CObjectTemplate<CInterpolateAxis>;
   template class CObjectTemplate<CZoomDomain>;
-  template class CObjectTemplate<CInterpolateFromFileDomain>;
+  template class CObjectTemplate<CInterpolateDomain>;
   template class CObjectTemplate<CGenerateRectilinearDomain>;
 
@@ -31,5 +31,5 @@
   template class CObjectTemplate<CInterpolateAxisGroup>;
   template class CObjectTemplate<CZoomDomainGroup>;
-  template class CObjectTemplate<CInterpolateFromFileDomainGroup>;
+  template class CObjectTemplate<CInterpolateDomainGroup>;
   template class CObjectTemplate<CGenerateRectilinearDomainGroup>;
 }
Index: XIOS/trunk/src/test/test_remap.f90
===================================================================
--- XIOS/trunk/src/test/test_remap.f90	(revision 688)
+++ XIOS/trunk/src/test/test_remap.f90	(revision 689)
@@ -115,8 +115,9 @@
                             bounds_lon_1D=src_boundslon, bounds_lat_1D=src_boundslat, nvertex=src_nvertex)
 
-!  CALL xios_set_domain_attr("dst_domain", ni_glo=dst_ni_glo, ibegin=dst_ibegin, ni=dst_ni, type="unstructured")
+  CALL xios_set_domain_attr("dst_domain", ni_glo=dst_ni_glo, ibegin=dst_ibegin, ni=dst_ni, type="unstructured")
   CALL xios_set_domain_attr("dst_domain", lonvalue_1D=dst_lon, latvalue_1D=dst_lat, &
                             bounds_lon_1D=dst_boundslon, bounds_lat_1D=dst_boundslat, nvertex=dst_nvertex)
 
+  CALL xios_set_domain_attr("dst_domain_regular", ni_glo=180, nj_glo=90, type="rectilinear")
 
   dtime%second = 3600
Index: XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp
===================================================================
--- XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp	(revision 689)
+++ XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp	(revision 689)
@@ -0,0 +1,373 @@
+/*!
+   \file domain_algorithm_interpolate_from_file.cpp
+   \author Ha NGUYEN
+   \since 09 Jul 2015
+   \date 15 Sep 2015
+
+   \brief Algorithm for interpolation on a domain.
+ */
+#include "domain_algorithm_interpolate.hpp"
+#include <boost/unordered_map.hpp>
+#include "context.hpp"
+#include "context_client.hpp"
+#include "distribution_client.hpp"
+#include "client_server_mapping_distributed.hpp"
+#include "netcdf.hpp"
+#include "mapper.hpp"
+
+namespace xios {
+
+CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain)
+: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain)
+{
+  interpDomain_->checkValid(domainSource);
+  computeIndexSourceMapping();
+}
+
+/*!
+  Compute remap with integrated remap calculation module
+*/
+void CDomainAlgorithmInterpolate::computeRemap()
+{
+  using namespace sphereRemap;
+
+  CContext* context = CContext::getCurrent();
+  CContextClient* client=context->client;
+  int clientRank = client->clientRank;
+  int i, j, k, idx;
+  std::vector<double> srcPole(3,0), dstPole(3,0);
+	int orderInterp = interpDomain_->order.getValue();
+
+  int constNVertex = 4; // Value by default number of vertex for rectangular domain
+  int nVertexSrc, nVertexDest;
+  nVertexSrc = nVertexDest = constNVertex;
+
+  // First of all, try to retrieve the boundary values of domain source and domain destination
+  int localDomainSrcSize = domainSrc_->i_index.numElements();
+  int niSrc = domainSrc_->ni.getValue(), njSrc = domainSrc_->nj.getValue();
+  bool hasBoundSrc = domainSrc_->hasBounds;
+  if (hasBoundSrc) nVertexSrc = domainSrc_->nvertex.getValue();
+  CArray<double,2> boundsLonSrc(nVertexSrc,localDomainSrcSize);
+  CArray<double,2> boundsLatSrc(nVertexSrc,localDomainSrcSize);
+
+  if (CDomain::type_attr::rectilinear == domainSrc_->type) srcPole[2] = 1;
+  if (hasBoundSrc)  // Suppose that domain source is curvilinear or unstructured
+  {
+    if (!domainSrc_->bounds_lon_2d.isEmpty())
+    {
+      for (j = 0; j < njSrc; ++j)
+        for (i = 0; i < niSrc; ++i)
+        {
+          k=j*niSrc+i;
+          for(int n=0;n<nVertexSrc;++n)
+          {
+            boundsLonSrc(n,k) = domainSrc_->bounds_lon_2d(n,i,j);
+            boundsLatSrc(n,k) = domainSrc_->bounds_lat_2d(n,i,j);
+          }
+        }
+    }
+    else
+    {
+      boundsLonSrc = domainSrc_->bounds_lon_1d;
+      boundsLatSrc = domainSrc_->bounds_lat_1d;
+    }
+  }
+  else // if domain source is rectilinear, not do anything now
+  {
+    nVertexSrc = constNVertex;
+  }
+
+  int localDomainDestSize = domainDest_->i_index.numElements();
+  int niDest = domainDest_->ni.getValue(), njDest = domainDest_->nj.getValue();
+  bool hasBoundDest = domainDest_->hasBounds;
+  if (hasBoundDest) nVertexDest = domainDest_->nvertex.getValue();
+  CArray<double,2> boundsLonDest(nVertexDest,localDomainDestSize);
+  CArray<double,2> boundsLatDest(nVertexDest,localDomainDestSize);
+
+  if (CDomain::type_attr::rectilinear == domainDest_->type) dstPole[2] = 1;
+  if (hasBoundDest)
+  {
+    if (!domainDest_->bounds_lon_2d.isEmpty())
+    {
+      for (j = 0; j < njDest; ++j)
+        for (i = 0; i < niDest; ++i)
+        {
+          k=j*niDest+i;
+          for(int n=0;n<nVertexDest;++n)
+          {
+            boundsLonDest(n,k) = domainDest_->bounds_lon_2d(n,i,j);
+            boundsLatDest(n,k) = domainDest_->bounds_lat_2d(n,i,j);
+          }
+        }
+    }
+    else
+    {
+      boundsLonDest = domainDest_->bounds_lon_1d;
+      boundsLatDest = domainDest_->bounds_lat_1d;
+    }
+  }
+  else
+  {
+    // Ok, fill in boundary values for rectangular domain
+    domainDest_->fillInRectilinearBoundLonLat(boundsLonDest, boundsLatDest);
+    nVertexDest = constNVertex;
+  }
+
+  // Ok, now use mapper to calculate
+  int nSrcLocal = domainSrc_->i_index.numElements();
+  int nDstLocal = domainDest_->i_index.numElements();
+  Mapper mapper(client->intraComm);
+  mapper.setVerbosity(PROGRESS) ;
+  mapper.setSourceMesh(boundsLonSrc.dataFirst(), boundsLatSrc.dataFirst(), nVertexSrc, nSrcLocal, &srcPole[0]);
+  mapper.setTargetMesh(boundsLonDest.dataFirst(), boundsLatDest.dataFirst(), nVertexDest, nDstLocal, &dstPole[0]);
+  std::vector<double> timings = mapper.computeWeights(orderInterp);
+
+  for (int idx = 0;  idx < mapper.nWeights; ++idx)
+  {
+    transformationMapping_[mapper.targetWeightId[idx]].push_back(mapper.sourceWeightId[idx]);
+    transformationWeight_[mapper.targetWeightId[idx]].push_back(mapper.remapMatrix[idx]);
+  }
+}
+
+/*!
+  Compute the index mapping between domain on grid source and one on grid destination
+*/
+void CDomainAlgorithmInterpolate::computeIndexSourceMapping()
+{
+  if (!interpDomain_->file.isEmpty())
+    readRemapInfo();
+  else
+    computeRemap();
+}
+
+/*!
+  Read remap information from file then distribute it among clients
+*/
+void CDomainAlgorithmInterpolate::readRemapInfo()
+{
+  CContext* context = CContext::getCurrent();
+  CContextClient* client=context->client;
+  int clientRank = client->clientRank;
+
+  std::string filename = interpDomain_->file.getValue();
+  std::map<int,std::vector<std::pair<int,double> > > interpMapValue;
+  readInterpolationInfo(filename, interpMapValue);
+
+  boost::unordered_map<size_t,int> globalIndexOfDomainDest;
+  int ni = domainDest_->ni.getValue();
+  int nj = domainDest_->nj.getValue();
+  int ni_glo = domainDest_->ni_glo.getValue();
+  size_t globalIndex;
+  int nIndexSize = domainDest_->i_index.numElements(), i_ind, j_ind;
+  for (int idx = 0; idx < nIndexSize; ++idx)
+  {
+    i_ind=domainDest_->i_index(idx) ;
+    j_ind=domainDest_->j_index(idx) ;
+
+    globalIndex = i_ind + j_ind * ni_glo;
+    globalIndexOfDomainDest[globalIndex] = clientRank;
+  }
+
+  CClientServerMappingDistributed domainIndexClientClientMapping(globalIndexOfDomainDest,
+                                                                 client->intraComm,
+                                                                 true);
+  CArray<size_t,1> globalIndexInterp(interpMapValue.size());
+  std::map<int,std::vector<std::pair<int,double> > >::const_iterator itb = interpMapValue.begin(), it,
+                                                                     ite = interpMapValue.end();
+  size_t globalIndexCount = 0;
+  for (it = itb; it != ite; ++it)
+  {
+    globalIndexInterp(globalIndexCount) = it->first;
+    ++globalIndexCount;
+  }
+
+  domainIndexClientClientMapping.computeServerIndexMapping(globalIndexInterp);
+  const std::map<int, std::vector<size_t> >& globalIndexInterpSendToClient = domainIndexClientClientMapping.getGlobalIndexOnServer();
+
+  //Inform each client number of index they will receive
+  int nbClient = client->clientSize;
+  int* sendBuff = new int[nbClient];
+  int* recvBuff = new int[nbClient];
+  for (int i = 0; i < nbClient; ++i) sendBuff[i] = 0;
+  int sendBuffSize = 0;
+  std::map<int, std::vector<size_t> >::const_iterator itbMap = globalIndexInterpSendToClient.begin(), itMap,
+                                                      iteMap = globalIndexInterpSendToClient.end();
+  for (itMap = itbMap; itMap != iteMap; ++itMap)
+  {
+    int sizeIndex = 0, mapSize = (itMap->second).size();
+    for (int idx = 0; idx < mapSize; ++idx)
+    {
+      sizeIndex += interpMapValue[(itMap->second)[idx]].size();
+    }
+    sendBuff[itMap->first] = sizeIndex;
+    sendBuffSize += sizeIndex;
+  }
+
+  MPI_Allreduce(sendBuff, recvBuff, nbClient, MPI_INT, MPI_SUM, client->intraComm);
+
+  int* sendIndexDestBuff = new int [sendBuffSize];
+  int* sendIndexSrcBuff  = new int [sendBuffSize];
+  double* sendWeightBuff = new double [sendBuffSize];
+
+  std::vector<MPI_Request> sendRequest;
+  // Now send index and weight
+  int sendOffSet = 0;
+  for (itMap = itbMap; itMap != iteMap; ++itMap)
+  {
+    int k = 0;
+    int mapSize = (itMap->second).size();
+
+    for (int idx = 0; idx < mapSize; ++idx)
+    {
+      std::vector<std::pair<int,double> >& interpMap = interpMapValue[(itMap->second)[idx]];
+      for (int i = 0; i < interpMap.size(); ++i)
+      {
+        sendIndexDestBuff[k] = (itMap->second)[idx];
+        sendIndexSrcBuff[k]  = interpMap[i].first;
+        sendWeightBuff[k]    = interpMap[i].second;
+        ++k;
+      }
+    }
+
+    sendRequest.push_back(MPI_Request());
+    MPI_Isend(sendIndexDestBuff + sendOffSet,
+             k,
+             MPI_INT,
+             itMap->first,
+             7,
+             client->intraComm,
+             &sendRequest.back());
+    sendRequest.push_back(MPI_Request());
+    MPI_Isend(sendIndexSrcBuff + sendOffSet,
+             k,
+             MPI_INT,
+             itMap->first,
+             8,
+             client->intraComm,
+             &sendRequest.back());
+    sendRequest.push_back(MPI_Request());
+    MPI_Isend(sendWeightBuff + sendOffSet,
+             k,
+             MPI_DOUBLE,
+             itMap->first,
+             9,
+             client->intraComm,
+             &sendRequest.back());
+    sendOffSet += k;
+  }
+
+  int recvBuffSize = recvBuff[clientRank];
+  int* recvIndexDestBuff = new int [recvBuffSize];
+  int* recvIndexSrcBuff  = new int [recvBuffSize];
+  double* recvWeightBuff = new double [recvBuffSize];
+  int receivedSize = 0;
+  int clientSrcRank;
+  while (receivedSize < recvBuffSize)
+  {
+    MPI_Status recvStatus;
+    MPI_Recv((recvIndexDestBuff + receivedSize),
+             recvBuffSize,
+             MPI_INT,
+             MPI_ANY_SOURCE,
+             7,
+             client->intraComm,
+             &recvStatus);
+
+    int countBuff = 0;
+    MPI_Get_count(&recvStatus, MPI_INT, &countBuff);
+    clientSrcRank = recvStatus.MPI_SOURCE;
+
+    MPI_Recv((recvIndexSrcBuff + receivedSize),
+             recvBuffSize,
+             MPI_INT,
+             clientSrcRank,
+             8,
+             client->intraComm,
+             &recvStatus);
+
+    MPI_Recv((recvWeightBuff + receivedSize),
+             recvBuffSize,
+             MPI_DOUBLE,
+             clientSrcRank,
+             9,
+             client->intraComm,
+             &recvStatus);
+
+    for (int idx = 0; idx < countBuff; ++idx)
+    {
+      transformationMapping_[*(recvIndexDestBuff + receivedSize + idx)].push_back(*(recvIndexSrcBuff + receivedSize + idx));
+      transformationWeight_[*(recvIndexDestBuff + receivedSize + idx)].push_back(*(recvWeightBuff + receivedSize + idx));
+    }
+    receivedSize += countBuff;
+  }
+
+  std::vector<MPI_Status> requestStatus(sendRequest.size());
+  MPI_Wait(&sendRequest[0], &requestStatus[0]);
+
+  delete [] sendIndexDestBuff;
+  delete [] sendIndexSrcBuff;
+  delete [] sendWeightBuff;
+  delete [] recvIndexDestBuff;
+  delete [] recvIndexSrcBuff;
+  delete [] recvWeightBuff;
+  delete [] sendBuff;
+  delete [] recvBuff;
+}
+
+/*!
+  Read interpolation information from a file
+  \param [in] filename interpolation file
+  \param [in/out] interpMapValue Mapping between (global) index of domain on grid destination and
+         corresponding global index of domain and associated weight value on grid source
+*/
+void CDomainAlgorithmInterpolate::readInterpolationInfo(std::string& filename,
+                                                                std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
+{
+  int ncid ;
+  int weightDimId ;
+  size_t nbWeightGlo ;
+
+  CContext* context = CContext::getCurrent();
+  CContextClient* client=context->client;
+  int clientRank = client->clientRank;
+  int clientSize = client->clientSize;
+
+  nc_open(filename.c_str(),NC_NOWRITE, &ncid) ;
+  nc_inq_dimid(ncid,"n_weight",&weightDimId) ;
+  nc_inq_dimlen(ncid,weightDimId,&nbWeightGlo) ;
+
+  size_t nbWeight ;
+  size_t start ;
+  size_t div = nbWeightGlo/clientSize ;
+  size_t mod = nbWeightGlo%clientSize ;
+  if (clientRank < mod)
+  {
+    nbWeight=div+1 ;
+    start=clientRank*(div+1) ;
+  }
+  else
+  {
+    nbWeight=div ;
+    start= mod * (div+1) + (clientRank-mod) * div ;
+  }
+
+  double* weight=new double[nbWeight] ;
+  int weightId ;
+  nc_inq_varid (ncid, "weight", &weightId) ;
+  nc_get_vara_double(ncid, weightId, &start, &nbWeight, weight) ;
+
+  long* srcIndex=new long[nbWeight] ;
+  int srcIndexId ;
+  nc_inq_varid (ncid, "src_idx", &srcIndexId) ;
+  nc_get_vara_long(ncid, srcIndexId, &start, &nbWeight, srcIndex) ;
+
+  long* dstIndex=new long[nbWeight] ;
+  int dstIndexId ;
+  nc_inq_varid (ncid, "dst_idx", &dstIndexId) ;
+  nc_get_vara_long(ncid, dstIndexId, &start, &nbWeight, dstIndex) ;
+
+  for(size_t ind=0; ind<nbWeight;++ind)
+    interpMapValue[dstIndex[ind]-1].push_back(make_pair(srcIndex[ind]-1,weight[ind]));
+}
+
+}
Index: XIOS/trunk/src/transformation/domain_algorithm_interpolate.hpp
===================================================================
--- XIOS/trunk/src/transformation/domain_algorithm_interpolate.hpp	(revision 689)
+++ XIOS/trunk/src/transformation/domain_algorithm_interpolate.hpp	(revision 689)
@@ -0,0 +1,41 @@
+/*!
+   \file domain_algorithm_interpolate_from_file.hpp
+   \author Ha NGUYEN
+   \since 09 July 2015
+   \date 09 Sep 2015
+
+   \brief Algorithm for interpolation on a domain.
+ */
+#ifndef __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__
+#define __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__
+
+#include "domain_algorithm_transformation.hpp"
+#include "domain.hpp"
+#include "interpolate_domain.hpp"
+
+namespace xios {
+/*!
+  \class CDomainAlgorithmInterpolate
+  Reading interpolation from file then apply on a domain
+*/
+class CDomainAlgorithmInterpolate : public CDomainAlgorithmTransformation
+{
+public:
+  CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain);
+
+  virtual ~CDomainAlgorithmInterpolate() {}
+
+  virtual void computeIndexSourceMapping();
+
+private:
+  void readInterpolationInfo(std::string& filename, std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
+  void computeRemap();
+  void readRemapInfo();
+
+private:
+  CInterpolateDomain* interpDomain_;
+
+};
+
+}
+#endif // __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_HPP__
Index: XIOS/trunk/src/transformation/domain_algorithm_interpolate_from_file.cpp
===================================================================
--- XIOS/trunk/src/transformation/domain_algorithm_interpolate_from_file.cpp	(revision 688)
+++ 	(revision )
@@ -1,364 +1,0 @@
-/*!
-   \file domain_algorithm_interpolate_from_file.cpp
-   \author Ha NGUYEN
-   \since 09 Jul 2015
-   \date 11 Sep 2015
-
-   \brief Algorithm for interpolation on a domain.
- */
-#include "domain_algorithm_interpolate_from_file.hpp"
-#include <boost/unordered_map.hpp>
-#include "context.hpp"
-#include "context_client.hpp"
-#include "distribution_client.hpp"
-#include "client_server_mapping_distributed.hpp"
-#include "netcdf.hpp"
-#include "mapper.hpp"
-
-namespace xios {
-
-CDomainAlgorithmInterpolateFromFile::CDomainAlgorithmInterpolateFromFile(CDomain* domainDestination, CDomain* domainSource, CInterpolateFromFileDomain* interpDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain)
-{
-  interpDomain_->checkValid(domainSource);
-  computeIndexSourceMapping();
-}
-
-void CDomainAlgorithmInterpolateFromFile::computeRemap()
-{
-  using namespace sphereRemap;
-
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int i, j, k, idx;
-	double srcPole[] = {0, 0, 0};
-	double dstPole[] = {0, 0, 1};
-	int orderInterp = 2;
-
-  int constNVertex = 4; // Value by default number of vertex for rectangular domain
-  int nVertexSrc, nVertexDest;
-  nVertexSrc = nVertexDest = constNVertex;
-
-  // First of all, try to retrieve the boundary values of domain source and domain destination
-  int localDomainSrcSize = domainSrc_->i_index.numElements();
-  int niSrc = domainSrc_->ni.getValue(), njSrc = domainSrc_->nj.getValue();
-  bool hasBoundSrc = domainSrc_->hasBounds;
-  if (hasBoundSrc) nVertexSrc = domainSrc_->nvertex.getValue();
-  CArray<double,2> boundsLonSrc(nVertexSrc,localDomainSrcSize);
-  CArray<double,2> boundsLatSrc(nVertexSrc,localDomainSrcSize);
-
-  if (hasBoundSrc)  // Suppose that domain source is curvilinear or unstructured
-  {
-    if (!domainSrc_->bounds_lon_2d.isEmpty())
-    {
-      for (j = 0; j < njSrc; ++j)
-        for (i = 0; i < niSrc; ++i)
-        {
-          k=j*niSrc+i;
-          for(int n=0;n<nVertexSrc;++n)
-          {
-            boundsLonSrc(n,k) = domainSrc_->bounds_lon_2d(n,i,j);
-            boundsLatSrc(n,k) = domainSrc_->bounds_lat_2d(n,i,j);
-          }
-        }
-    }
-    else
-    {
-      boundsLonSrc = domainSrc_->bounds_lon_1d;
-      boundsLatSrc = domainSrc_->bounds_lat_1d;
-    }
-  }
-  else // if domain source is rectilinear, not do anything now
-  {
-    nVertexSrc = constNVertex;
-  }
-
-  int localDomainDestSize = domainDest_->i_index.numElements();
-  int niDest = domainDest_->ni.getValue(), njDest = domainDest_->nj.getValue();
-  bool hasBoundDest = domainDest_->hasBounds;
-  if (hasBoundDest) nVertexDest = domainDest_->nvertex.getValue();
-  CArray<double,2> boundsLonDest(nVertexDest,localDomainDestSize);
-  CArray<double,2> boundsLatDest(nVertexDest,localDomainDestSize);
-
-  if (hasBoundDest)
-  {
-    if (!domainDest_->bounds_lon_2d.isEmpty())
-    {
-      for (j = 0; j < njDest; ++j)
-        for (i = 0; i < niDest; ++i)
-        {
-          k=j*niDest+i;
-          for(int n=0;n<nVertexDest;++n)
-          {
-            boundsLonDest(n,k) = domainDest_->bounds_lon_2d(n,i,j);
-            boundsLatDest(n,k) = domainDest_->bounds_lat_2d(n,i,j);
-          }
-        }
-    }
-    else
-    {
-      boundsLonDest = domainDest_->bounds_lon_1d;
-      boundsLatDest = domainDest_->bounds_lat_1d;
-    }
-  }
-  else
-  {
-    // Ok, fill in boundary values for rectangular domain
-    domainDest_->fillInRectilinearBoundLonLat(boundsLonDest, boundsLatDest);
-    nVertexDest = 4;
-  }
-
-  // Ok, now use mapper to calculate
-  int nSrcLocal = domainSrc_->i_index.numElements();
-  int nDstLocal = domainDest_->i_index.numElements();
-  Mapper mapper(client->intraComm);
-  mapper.setVerbosity(PROGRESS) ;
-  mapper.setSourceMesh(boundsLonSrc.dataFirst(), boundsLatSrc.dataFirst(), nVertexSrc, nSrcLocal, srcPole);
-  mapper.setTargetMesh(boundsLonDest.dataFirst(), boundsLatDest.dataFirst(), nVertexDest, nDstLocal, dstPole);
-  std::vector<double> timings = mapper.computeWeights(orderInterp);
-
-  for (int idx = 0;  idx < mapper.nWeights; ++idx)
-  {
-    transformationMapping_[mapper.targetWeightId[idx]].push_back(mapper.sourceWeightId[idx]);
-    transformationWeight_[mapper.targetWeightId[idx]].push_back(mapper.remapMatrix[idx]);
-  }
-}
-
-void CDomainAlgorithmInterpolateFromFile::computeIndexSourceMapping()
-{
-  computeRemap();
-}
-
-
-/*!
-  Compute the index mapping between domain on grid source and one on grid destination
-*/
-void CDomainAlgorithmInterpolateFromFile::readRemapInfo()
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-
-  std::string filename = interpDomain_->file.getValue();
-  std::map<int,std::vector<std::pair<int,double> > > interpMapValue;
-  readInterpolationInfo(filename, interpMapValue);
-
-  boost::unordered_map<size_t,int> globalIndexOfDomainDest;
-  int ni = domainDest_->ni.getValue();
-  int nj = domainDest_->nj.getValue();
-  int ni_glo = domainDest_->ni_glo.getValue();
-  size_t globalIndex;
-  int nIndexSize = domainDest_->i_index.numElements(), i_ind, j_ind;
-  for (int idx = 0; idx < nIndexSize; ++idx)
-  {
-    i_ind=domainDest_->i_index(idx) ;
-    j_ind=domainDest_->j_index(idx) ;
-
-    globalIndex = i_ind + j_ind * ni_glo;
-    globalIndexOfDomainDest[globalIndex] = clientRank;
-  }
-
-  CClientServerMappingDistributed domainIndexClientClientMapping(globalIndexOfDomainDest,
-                                                                 client->intraComm,
-                                                                 true);
-  CArray<size_t,1> globalIndexInterp(interpMapValue.size());
-  std::map<int,std::vector<std::pair<int,double> > >::const_iterator itb = interpMapValue.begin(), it,
-                                                                     ite = interpMapValue.end();
-  size_t globalIndexCount = 0;
-  for (it = itb; it != ite; ++it)
-  {
-    globalIndexInterp(globalIndexCount) = it->first;
-    ++globalIndexCount;
-  }
-
-  domainIndexClientClientMapping.computeServerIndexMapping(globalIndexInterp);
-  const std::map<int, std::vector<size_t> >& globalIndexInterpSendToClient = domainIndexClientClientMapping.getGlobalIndexOnServer();
-
-  //Inform each client number of index they will receive
-  int nbClient = client->clientSize;
-  int* sendBuff = new int[nbClient];
-  int* recvBuff = new int[nbClient];
-  for (int i = 0; i < nbClient; ++i) sendBuff[i] = 0;
-  int sendBuffSize = 0;
-  std::map<int, std::vector<size_t> >::const_iterator itbMap = globalIndexInterpSendToClient.begin(), itMap,
-                                                      iteMap = globalIndexInterpSendToClient.end();
-  for (itMap = itbMap; itMap != iteMap; ++itMap)
-  {
-    int sizeIndex = 0, mapSize = (itMap->second).size();
-    for (int idx = 0; idx < mapSize; ++idx)
-    {
-      sizeIndex += interpMapValue[(itMap->second)[idx]].size();
-    }
-    sendBuff[itMap->first] = sizeIndex;
-    sendBuffSize += sizeIndex;
-  }
-
-  MPI_Allreduce(sendBuff, recvBuff, nbClient, MPI_INT, MPI_SUM, client->intraComm);
-
-  int* sendIndexDestBuff = new int [sendBuffSize];
-  int* sendIndexSrcBuff  = new int [sendBuffSize];
-  double* sendWeightBuff = new double [sendBuffSize];
-
-  std::vector<MPI_Request> sendRequest;
-  // Now send index and weight
-  int sendOffSet = 0;
-  for (itMap = itbMap; itMap != iteMap; ++itMap)
-  {
-    int k = 0;
-    int mapSize = (itMap->second).size();
-
-    for (int idx = 0; idx < mapSize; ++idx)
-    {
-      std::vector<std::pair<int,double> >& interpMap = interpMapValue[(itMap->second)[idx]];
-      for (int i = 0; i < interpMap.size(); ++i)
-      {
-        sendIndexDestBuff[k] = (itMap->second)[idx];
-        sendIndexSrcBuff[k]  = interpMap[i].first;
-        sendWeightBuff[k]    = interpMap[i].second;
-        ++k;
-      }
-    }
-
-    sendRequest.push_back(MPI_Request());
-    MPI_Isend(sendIndexDestBuff + sendOffSet,
-             k,
-             MPI_INT,
-             itMap->first,
-             7,
-             client->intraComm,
-             &sendRequest.back());
-    sendRequest.push_back(MPI_Request());
-    MPI_Isend(sendIndexSrcBuff + sendOffSet,
-             k,
-             MPI_INT,
-             itMap->first,
-             8,
-             client->intraComm,
-             &sendRequest.back());
-    sendRequest.push_back(MPI_Request());
-    MPI_Isend(sendWeightBuff + sendOffSet,
-             k,
-             MPI_DOUBLE,
-             itMap->first,
-             9,
-             client->intraComm,
-             &sendRequest.back());
-    sendOffSet += k;
-  }
-
-  int recvBuffSize = recvBuff[clientRank];
-  int* recvIndexDestBuff = new int [recvBuffSize];
-  int* recvIndexSrcBuff  = new int [recvBuffSize];
-  double* recvWeightBuff = new double [recvBuffSize];
-  int receivedSize = 0;
-  int clientSrcRank;
-  while (receivedSize < recvBuffSize)
-  {
-    MPI_Status recvStatus;
-    MPI_Recv((recvIndexDestBuff + receivedSize),
-             recvBuffSize,
-             MPI_INT,
-             MPI_ANY_SOURCE,
-             7,
-             client->intraComm,
-             &recvStatus);
-
-    int countBuff = 0;
-    MPI_Get_count(&recvStatus, MPI_INT, &countBuff);
-    clientSrcRank = recvStatus.MPI_SOURCE;
-
-    MPI_Recv((recvIndexSrcBuff + receivedSize),
-             recvBuffSize,
-             MPI_INT,
-             clientSrcRank,
-             8,
-             client->intraComm,
-             &recvStatus);
-
-    MPI_Recv((recvWeightBuff + receivedSize),
-             recvBuffSize,
-             MPI_DOUBLE,
-             clientSrcRank,
-             9,
-             client->intraComm,
-             &recvStatus);
-
-    for (int idx = 0; idx < countBuff; ++idx)
-    {
-      transformationMapping_[*(recvIndexDestBuff + receivedSize + idx)].push_back(*(recvIndexSrcBuff + receivedSize + idx));
-      transformationWeight_[*(recvIndexDestBuff + receivedSize + idx)].push_back(*(recvWeightBuff + receivedSize + idx));
-    }
-    receivedSize += countBuff;
-  }
-
-  std::vector<MPI_Status> requestStatus(sendRequest.size());
-  MPI_Wait(&sendRequest[0], &requestStatus[0]);
-
-  delete [] sendIndexDestBuff;
-  delete [] sendIndexSrcBuff;
-  delete [] sendWeightBuff;
-  delete [] recvIndexDestBuff;
-  delete [] recvIndexSrcBuff;
-  delete [] recvWeightBuff;
-  delete [] sendBuff;
-  delete [] recvBuff;
-}
-
-/*!
-  Read interpolation information from a file
-  \param [in] filename interpolation file
-  \param [in/out] interpMapValue Mapping between (global) index of domain on grid destination and
-         corresponding global index of domain and associated weight value on grid source
-*/
-void CDomainAlgorithmInterpolateFromFile::readInterpolationInfo(std::string& filename,
-                                                                std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
-{
-  int ncid ;
-  int weightDimId ;
-  size_t nbWeightGlo ;
-
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-  int clientSize = client->clientSize;
-
-  nc_open(filename.c_str(),NC_NOWRITE, &ncid) ;
-  nc_inq_dimid(ncid,"n_weight",&weightDimId) ;
-  nc_inq_dimlen(ncid,weightDimId,&nbWeightGlo) ;
-
-  size_t nbWeight ;
-  size_t start ;
-  size_t div = nbWeightGlo/clientSize ;
-  size_t mod = nbWeightGlo%clientSize ;
-  if (clientRank < mod)
-  {
-    nbWeight=div+1 ;
-    start=clientRank*(div+1) ;
-  }
-  else
-  {
-    nbWeight=div ;
-    start= mod * (div+1) + (clientRank-mod) * div ;
-  }
-
-  double* weight=new double[nbWeight] ;
-  int weightId ;
-  nc_inq_varid (ncid, "weight", &weightId) ;
-  nc_get_vara_double(ncid, weightId, &start, &nbWeight, weight) ;
-
-  long* srcIndex=new long[nbWeight] ;
-  int srcIndexId ;
-  nc_inq_varid (ncid, "src_idx", &srcIndexId) ;
-  nc_get_vara_long(ncid, srcIndexId, &start, &nbWeight, srcIndex) ;
-
-  long* dstIndex=new long[nbWeight] ;
-  int dstIndexId ;
-  nc_inq_varid (ncid, "dst_idx", &dstIndexId) ;
-  nc_get_vara_long(ncid, dstIndexId, &start, &nbWeight, dstIndex) ;
-
-  for(size_t ind=0; ind<nbWeight;++ind)
-    interpMapValue[dstIndex[ind]-1].push_back(make_pair(srcIndex[ind]-1,weight[ind]));
-}
-
-}
Index: XIOS/trunk/src/transformation/domain_algorithm_interpolate_from_file.hpp
===================================================================
--- XIOS/trunk/src/transformation/domain_algorithm_interpolate_from_file.hpp	(revision 688)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/*!
-   \file domain_algorithm_interpolate_from_file.hpp
-   \author Ha NGUYEN
-   \since 09 July 2015
-   \date 09 Sep 2015
-
-   \brief Algorithm for interpolation on a domain.
- */
-#ifndef __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_FROM_FILE_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_FROM_FILE_HPP__
-
-#include "domain_algorithm_transformation.hpp"
-#include "domain.hpp"
-#include "interpolate_from_file_domain.hpp"
-
-namespace xios {
-/*!
-  \class CDomainAlgorithmInterpolateFromFile
-  Reading interpolation from file then apply on a domain
-*/
-class CDomainAlgorithmInterpolateFromFile : public CDomainAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmInterpolateFromFile(CDomain* domainDestination, CDomain* domainSource, CInterpolateFromFileDomain* interpDomain);
-
-  virtual ~CDomainAlgorithmInterpolateFromFile() {}
-
-  virtual void computeIndexSourceMapping();
-
-private:
-  void readInterpolationInfo(std::string& filename, std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
-  void computeRemap();
-  void readRemapInfo();
-
-private:
-  CInterpolateFromFileDomain* interpDomain_;
-
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_INTERPOLATE_FROM_FILE_HPP__
Index: XIOS/trunk/src/transformation/grid_transformation.cpp
===================================================================
--- XIOS/trunk/src/transformation/grid_transformation.cpp	(revision 688)
+++ XIOS/trunk/src/transformation/grid_transformation.cpp	(revision 689)
@@ -12,5 +12,5 @@
 #include "axis_algorithm_interpolate.hpp"
 #include "domain_algorithm_zoom.hpp"
-#include "domain_algorithm_interpolate_from_file.hpp"
+#include "domain_algorithm_interpolate.hpp"
 #include "context.hpp"
 #include "context_client.hpp"
@@ -276,11 +276,11 @@
 
   CZoomDomain* zoomDomain = 0;
-  CInterpolateFromFileDomain* interpFileDomain = 0;
+  CInterpolateDomain* interpFileDomain = 0;
   CGenericAlgorithmTransformation* algo = 0;
   switch (transType)
   {
-    case TRANS_INTERPOLATE_DOMAIN_FROM_FILE:
-      interpFileDomain = dynamic_cast<CInterpolateFromFileDomain*> (it->second);
-      algo = new CDomainAlgorithmInterpolateFromFile(domainListDestP[domainIndex], domainListSrcP[domainIndex],interpFileDomain);
+    case TRANS_INTERPOLATE_DOMAIN:
+      interpFileDomain = dynamic_cast<CInterpolateDomain*> (it->second);
+      algo = new CDomainAlgorithmInterpolate(domainListDestP[domainIndex], domainListSrcP[domainIndex],interpFileDomain);
       break;
     case TRANS_ZOOM_DOMAIN:
@@ -312,5 +312,5 @@
   switch (transType)
   {
-    case TRANS_INTERPOLATE_DOMAIN_FROM_FILE:
+    case TRANS_INTERPOLATE_DOMAIN:
     case TRANS_ZOOM_DOMAIN:
       domainIndex = elementPosition2DomainPositionInGrid_[elementPositionInGrid];
@@ -494,6 +494,5 @@
      if (searchCurrentSrc.search(itbIndex, iteIndex, globalIndexOfCurrentGridSourceToSend[idx], itIndex))
      {
-//       int index = std::distance(itbArr, itArr);
-       sendBuff[idx+currentBuffPosition] = globalIndexOfOriginalGridSource_[*itIndex]; //[index];
+       sendBuff[idx+currentBuffPosition] = globalIndexOfOriginalGridSource_[*itIndex];
      }
    }
Index: XIOS/trunk/src/type/type_util.hpp
===================================================================
--- XIOS/trunk/src/type/type_util.hpp	(revision 688)
+++ XIOS/trunk/src/type/type_util.hpp	(revision 689)
@@ -28,6 +28,6 @@
     class CZoomDomain;
     class CZoomDomainGroup;
-    class CInterpolateFromFileDomain;
-    class CInterpolateFromFileDomainGroup;
+    class CInterpolateDomain;
+    class CInterpolateDomainGroup;
     class CGenerateRectilinearDomain;
     class CGenerateRectilinearDomainGroup;
@@ -76,6 +76,6 @@
   macro(CZoomDomain)
   macro(CZoomDomainGroup)
-  macro(CInterpolateFromFileDomain)
-  macro(CInterpolateFromFileDomainGroup)
+  macro(CInterpolateDomain)
+  macro(CInterpolateDomainGroup)
   macro(CGenerateRectilinearDomain)
   macro(CGenerateRectilinearDomainGroup)
Index: XIOS/trunk/src/xml_parser_decl.cpp
===================================================================
--- XIOS/trunk/src/xml_parser_decl.cpp	(revision 688)
+++ XIOS/trunk/src/xml_parser_decl.cpp	(revision 689)
@@ -23,5 +23,5 @@
     macro( InterpolateAxis )
     macro( ZoomDomain )
-    macro( InterpolateFromFileDomain )
+    macro( InterpolateDomain )
     macro( GenerateRectilinearDomain )
   }
