Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/gatherer_connector.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/gatherer_connector.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/gatherer_connector.hpp	(revision 2011)
@@ -110,4 +110,41 @@
       }
 
+      // hook for transfering mask in grid connector, maybe find an other way to doing that...
+      void transfer_or(int rank,  CGathererConnector** connectors, int nConnectors, const bool* input, bool* output)
+      {
+        auto& connector = connector_[rank] ; // probably costly, find a better way to avoid the map
+        auto& mask = mask_[rank] ; 
+        int srcSize = mask.size() ;
+      
+        if (nConnectors==0)
+        {
+          for(int i=0, j=0; i<srcSize; i++)
+            if (mask[i]) 
+            {
+              *(output+connector[j]) |= *(input + i) ;
+              j++ ;
+            }
+
+        }
+        else
+       {
+          int srcSliceSize = (*(connectors-1))->getSrcSliceSize(rank, connectors-1, nConnectors-1) ;
+          int dstSliceSize = (*(connectors-1))->getDstSliceSize(connectors-1, nConnectors-1) ;
+
+          const bool* in = input ; 
+          for(int i=0,j=0;i<srcSize;i++) 
+          {
+            if (mask[i]) 
+            {
+              (*(connectors-1))->transfer_or(rank, connectors-1, nConnectors-1, in, output+connector[j]*dstSliceSize) ; // the multiplication must be avoid in further optimization
+              j++ ;
+            }
+            in += srcSliceSize ;
+          }
+        }
+
+      }
+
+
 
       template<typename T>
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_gatherer_connector.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_gatherer_connector.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_gatherer_connector.hpp	(revision 2011)
@@ -65,5 +65,17 @@
         transfer(dataIn, dataOut) ;
       }
- 
+      
+
+      void transfer_or(CEventServer& event, CArray<bool,1>& dataOut)
+      {
+        map<int, CArray<bool,1>> dataIn ;
+        for (auto& subEvent : event.subEvents) 
+        {
+          auto& data = dataIn[subEvent.rank]; 
+          (*subEvent.buffer) >> data ;
+        }
+        transfer_or(dataIn, dataOut) ;
+      }
+
       template<typename T>
       void transfer(CEventServer& event, CArray<T,1>& dataOut, T missingValue)
@@ -78,4 +90,16 @@
       }
 
+      void transfer_or(const map<int, CArray<bool,1>>& input, CArray<bool,1>& output)
+      {
+        int n = elementsConnector_.size()-1 ;
+        CGathererConnector** connector = elementsConnector_.data() + n ;
+        output.resize(dstSize_) ;
+        output = false ;
+        for(auto& rankDataIn : input) 
+        {
+          elementsConnector_[n]->transfer_or(rankDataIn.first, connector, n, rankDataIn.second.dataFirst(), output.dataFirst()) ;
+        }
+      } 
+
   };
 }
Index: OS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.cpp	(revision 2010)
+++ 	(revision )
@@ -1,345 +1,0 @@
-#include "spatial_transform_filter.hpp"
-#include "grid_transformation.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "timer.hpp"
-
-namespace xios
-{
-  CSpatialTransformFilter::CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, double outputValue, size_t inputSlotsCount)
-    : CFilter(gc, inputSlotsCount, engine), outputDefaultValue(outputValue)
-  { /* Nothing to do */ }
-
-  std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> >
-  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue)
-  {
-    if (!srcGrid || !destGrid)
-      ERROR("std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> >"
-            "buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid)",
-            "Impossible to build the filter graph if either the source or the destination grid are null.");
-
-    std::shared_ptr<CSpatialTransformFilter> firstFilter, lastFilter;
-    // Note that this loop goes from the last transformation to the first transformation
-    do
-    {
-      CGridTransformation* gridTransformation = destGrid->getTransformations();
-      CSpatialTransformFilterEngine* engine = CSpatialTransformFilterEngine::get(destGrid->getTransformations());
-      const std::vector<StdString>& auxInputs = gridTransformation->getAuxInputs();
-      size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size());
-      double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : 0.0;
-
-
-      const CGridTransformationSelector::ListAlgoType& algoList = gridTransformation->getAlgoList() ;
-      CGridTransformationSelector::ListAlgoType::const_iterator it  ;
-
-      bool isSpatialTemporal=false ;
-      for (it=algoList.begin();it!=algoList.end();++it)  if (it->second.first == TRANS_TEMPORAL_SPLITTING) isSpatialTemporal=true ;
-
-      std::shared_ptr<CSpatialTransformFilter> filter ;
-      if( isSpatialTemporal) filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTemporalFilter(gc, engine, gridTransformation, defaultValue, inputCount));
-      else filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount));
-
-      
-      if (!lastFilter)
-        lastFilter = filter;
-      else
-        filter->connectOutput(firstFilter, 0);
-
-      firstFilter = filter;
-      for (size_t idx = 0; idx < auxInputs.size(); ++idx)
-      {
-        CField* fieldAuxInput = CField::get(auxInputs[idx]);
-       //ym fieldAuxInput->buildFilterGraph(gc, false);
-        fieldAuxInput->getInstantDataFilter()->connectOutput(firstFilter,idx+1);
-      }
-
-      destGrid = gridTransformation->getGridSource();
-    }
-    while (destGrid != srcGrid);
-
-    return std::make_pair(firstFilter, lastFilter);
-  }
-
-  void CSpatialTransformFilter::onInputReady(std::vector<CDataPacketPtr> data)
-  {
-    CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine);
-    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue);
-    if (outputPacket)
-      onOutputReady(outputPacket);
-  }
-
-  CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount)
-    : CSpatialTransformFilter(gc, engine, outputValue, inputSlotsCount), record(0)
-  {
-      const CGridTransformationSelector::ListAlgoType& algoList = gridTransformation->getAlgoList() ;
-      CGridTransformationSelector::ListAlgoType::const_iterator it  ;
-
-      int pos ;
-      for (it=algoList.begin();it!=algoList.end();++it) 
-        if (it->second.first == TRANS_TEMPORAL_SPLITTING)
-        {
-          pos=it->first ;
-          if (pos < algoList.size()-1)
-            ERROR("SpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount))",
-                  "temporal splitting operation must be the last of whole transformation on same grid") ;
-        }
-          
-      CGrid* grid=gridTransformation->getGridDestination() ;
-
-      CAxis* axis = grid->getAxis(gridTransformation->getElementPositionInGridDst2AxisPosition().find(pos)->second) ;
-
-      nrecords = axis->index.numElements() ;
-  }
-
-
-  void CSpatialTemporalFilter::onInputReady(std::vector<CDataPacketPtr> data)
-  {
-    CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine);
-    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue);
-
-    if (outputPacket)
-    {
-      size_t nelements=outputPacket->data.numElements() ;
-      if (!tmpData.numElements())
-      {
-        tmpData.resize(nelements);
-        tmpData=outputDefaultValue ;
-      }
-
-      nelements/=nrecords ;
-      size_t offset=nelements*record ;
-      for(size_t i=0;i<nelements;++i)  tmpData(i+offset) = outputPacket->data(i) ;
-    
-      record ++ ;
-      if (record==nrecords)
-      {
-        record=0 ;
-        CDataPacketPtr packet = CDataPacketPtr(new CDataPacket);
-        packet->date = data[0]->date;
-        packet->timestamp = data[0]->timestamp;
-        packet->status = data[0]->status;
-        packet->data.resize(tmpData.numElements());
-        packet->data = tmpData;
-        onOutputReady(packet);
-        tmpData.resize(0) ;
-      }
-    }
-  }
-
-
-  CSpatialTransformFilterEngine::CSpatialTransformFilterEngine(CGridTransformation* gridTransformation)
-    : gridTransformation(gridTransformation)
-  {
-    if (!gridTransformation)
-      ERROR("CSpatialTransformFilterEngine::CSpatialTransformFilterEngine(CGridTransformation* gridTransformation)",
-            "Impossible to construct a spatial transform filter engine without a valid grid transformation.");
-  }
-
-  std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> > CSpatialTransformFilterEngine::engines;
-
-  CSpatialTransformFilterEngine* CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation)
-  {
-    if (!gridTransformation)
-      ERROR("CSpatialTransformFilterEngine& CSpatialTransformFilterEngine::get(CGridTransformation* gridTransformation)",
-            "Impossible to get the requested engine, the grid transformation is invalid.");
-
-    std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> >::iterator it = engines.find(gridTransformation);
-    if (it == engines.end())
-    {
-      std::shared_ptr<CSpatialTransformFilterEngine> engine(new CSpatialTransformFilterEngine(gridTransformation));
-      it = engines.insert(std::make_pair(gridTransformation, engine)).first;
-    }
-
-    return it->second.get();
-  }
-
-  CDataPacketPtr CSpatialTransformFilterEngine::apply(std::vector<CDataPacketPtr> data)
-  {
-    /* Nothing to do */
-  }
-
-  CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue)
-  {
-    CDataPacketPtr packet(new CDataPacket);
-    packet->date = data[0]->date;
-    packet->timestamp = data[0]->timestamp;
-    packet->status = data[0]->status;
-
-    if (packet->status == CDataPacket::NO_ERROR)
-    {
-      if (1 < data.size())  // Dynamical transformations
-      {
-        std::vector<CArray<double,1>* > dataAuxInputs(data.size()-1);
-        for (size_t idx = 0; idx < dataAuxInputs.size(); ++idx) dataAuxInputs[idx] = &(data[idx+1]->data);
-        gridTransformation->computeAll(dataAuxInputs, packet->timestamp);
-      }
-      packet->data.resize(gridTransformation->getGridDestination()->getLocalDataSize());
-      if (0 != packet->data.numElements())
-        (packet->data)(0) = defaultValue;
-      apply(data[0]->data, packet->data);
-    }
-
-    return packet;
-  }
-
-  void CSpatialTransformFilterEngine::apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest)
-  {
-    CTimer::get("CSpatialTransformFilterEngine::apply").resume(); 
-    
-    CContext* context = CContext::getCurrent();
-    int rank;
-    MPI_Comm_rank (context->intraComm_, &rank);
-
-    // Get default value for output data
-    bool ignoreMissingValue = false; 
-    double defaultValue = std::numeric_limits<double>::quiet_NaN();
-    if (0 != dataDest.numElements()) ignoreMissingValue = NumTraits<double>::isNan(dataDest(0));
-
-    const std::list<CGridTransformation::SendingIndexGridSourceMap>& listLocalIndexSend = gridTransformation->getLocalIndexToSendFromGridSource();
-    const std::list<CGridTransformation::RecvIndexGridDestinationMap>& listLocalIndexToReceive = gridTransformation->getLocalIndexToReceiveOnGridDest();
-    const std::list<size_t>& listNbLocalIndexToReceive = gridTransformation->getNbLocalIndexToReceiveOnGridDest();
-    const std::vector<CGenericAlgorithmTransformation*>& listAlgos = gridTransformation->getAlgos();
-
-    CArray<double,1> dataCurrentDest(dataSrc.copy());
-
-    std::list<CGridTransformation::SendingIndexGridSourceMap>::const_iterator itListSend  = listLocalIndexSend.begin(),
-                                                                              iteListSend = listLocalIndexSend.end();
-    std::list<CGridTransformation::RecvIndexGridDestinationMap>::const_iterator itListRecv = listLocalIndexToReceive.begin();
-    std::list<size_t>::const_iterator itNbListRecv = listNbLocalIndexToReceive.begin();
-    std::vector<CGenericAlgorithmTransformation*>::const_iterator itAlgo = listAlgos.begin();
-
-    for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++itAlgo)
-    {
-      CArray<double,1> dataCurrentSrc(dataCurrentDest);
-      const CGridTransformation::SendingIndexGridSourceMap& localIndexToSend = *itListSend;
-
-      // Sending data from field sources to do transformations
-      std::map<int, CArray<int,1> >::const_iterator itbSend = localIndexToSend.begin(), itSend,
-                                                    iteSend = localIndexToSend.end();
-      int idxSendBuff = 0;
-      std::vector<double*> sendBuff(localIndexToSend.size());
-      double* sendBuffRank;
-      for (itSend = itbSend; itSend != iteSend; ++itSend, ++idxSendBuff)
-      {
-        int destRank = itSend->first;
-        if (0 != itSend->second.numElements())
-        {
-          if (rank != itSend->first)
-            sendBuff[idxSendBuff] = new double[itSend->second.numElements()];
-          else
-            sendBuffRank = new double[itSend->second.numElements()];
-        }
-      }
-
-      idxSendBuff = 0;
-      std::vector<MPI_Request> sendRecvRequest;
-      for (itSend = itbSend; itSend != iteSend; ++itSend, ++idxSendBuff)
-      {
-        int destRank = itSend->first;
-        const CArray<int,1>& localIndex_p = itSend->second;
-        int countSize = localIndex_p.numElements();
-        if (destRank != rank)
-        {
-          for (int idx = 0; idx < countSize; ++idx)
-          {
-            sendBuff[idxSendBuff][idx] = dataCurrentSrc(localIndex_p(idx));
-          }
-          sendRecvRequest.push_back(MPI_Request());
-          MPI_Isend(sendBuff[idxSendBuff], countSize, MPI_DOUBLE, destRank, 12, context->intraComm_, &sendRecvRequest.back());
-        }
-        else
-        {
-          for (int idx = 0; idx < countSize; ++idx)
-          {
-            sendBuffRank[idx] = dataCurrentSrc(localIndex_p(idx));
-          }
-        }
-      }
-
-      // Receiving data on destination fields
-      const CGridTransformation::RecvIndexGridDestinationMap& localIndexToReceive = *itListRecv;
-      CGridTransformation::RecvIndexGridDestinationMap::const_iterator itbRecv = localIndexToReceive.begin(), itRecv,
-                                                                       iteRecv = localIndexToReceive.end();
-      int recvBuffSize = 0;
-      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv)
-      {
-        if (itRecv->first != rank )
-          recvBuffSize += itRecv->second.size();
-      }
-      //(recvBuffSize < itRecv->second.size()) ? itRecv->second.size() : recvBuffSize;
-      double* recvBuff;
-
-      if (0 != recvBuffSize) recvBuff = new double[recvBuffSize];
-      int currentBuff = 0;
-      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv)
-      {
-        int srcRank = itRecv->first;
-        if (srcRank != rank)
-        {
-          int countSize = itRecv->second.size();
-          sendRecvRequest.push_back(MPI_Request());
-          MPI_Irecv(recvBuff + currentBuff, countSize, MPI_DOUBLE, srcRank, 12, context->intraComm_, &sendRecvRequest.back());
-          currentBuff += countSize;
-        }
-      }
-      std::vector<MPI_Status> status(sendRecvRequest.size());
-      MPI_Waitall(sendRecvRequest.size(), &sendRecvRequest[0], &status[0]);
-
-      dataCurrentDest.resize(*itNbListRecv);
-      dataCurrentDest = 0.0;
-
-      std::vector<bool> localInitFlag(dataCurrentDest.numElements(), true);
-      currentBuff = 0;
-      bool firstPass=true; 
-      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv)
-      {
-        const std::vector<std::pair<int,double> >& localIndex_p = itRecv->second;
-        int srcRank = itRecv->first;
-        if (srcRank != rank)
-        {
-          int countSize = itRecv->second.size();
-          (*itAlgo)->apply(localIndex_p,
-                           recvBuff+currentBuff,
-                           dataCurrentDest,
-                           localInitFlag,
-                           ignoreMissingValue,firstPass);
-          currentBuff += countSize;
-        }
-        else
-        {
-          (*itAlgo)->apply(localIndex_p,
-                           sendBuffRank,
-                           dataCurrentDest,
-                           localInitFlag,
-                           ignoreMissingValue,firstPass);
-        }
-
-        firstPass=false ;
-      }
-
-      (*itAlgo)->updateData(dataCurrentDest);
-
-      idxSendBuff = 0;
-      for (itSend = itbSend; itSend != iteSend; ++itSend, ++idxSendBuff)
-      {
-        if (0 != itSend->second.numElements())
-        {
-          if (rank != itSend->first)
-            delete [] sendBuff[idxSendBuff];
-          else
-            delete [] sendBuffRank;
-        }
-      }
-      if (0 != recvBuffSize) delete [] recvBuff;
-    }
-    if (dataCurrentDest.numElements() != dataDest.numElements())
-    ERROR("CSpatialTransformFilterEngine::apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest)",
-          "Incoherent between the received size and expected size. " << std::endl 
-          << "Expected size: " << dataDest.numElements() << std::endl 
-          << "Received size: " << dataCurrentDest.numElements());
-
-    dataDest = dataCurrentDest;
-
-    CTimer::get("CSpatialTransformFilterEngine::apply").suspend() ;
-  }
-} // namespace xios
Index: OS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/spatial_transform_filter.hpp	(revision 2010)
+++ 	(revision )
@@ -1,147 +1,0 @@
-#ifndef __XIOS_CSpatialTransformFilter__
-#define __XIOS_CSpatialTransformFilter__
-
-#include "filter.hpp"
-
-namespace xios
-{
-  class CGrid;
-  class CGridTransformation;
-  class CSpatialTransformFilterEngine;
-
-  /*!
-   * A generic filter with multiple input slots wrapping any type of spatial transformations.
-   */
-  class CSpatialTransformFilter : public CFilter
-  {
-    public:
-      /*!
-       * Constructs a filter wrapping the specified spatial transformation.
-       *
-       * \param gc the associated garbage collector
-       * \param engine the engine defining the spatial transformation
-       * \param outputValue default value of output pin
-       * \param [in] inputSlotsCount number of input, by default there is only one for field src
-       */
-      CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, double outputValue, size_t inputSlotsCount = 1);
-
-      /*!
-       * Builds the filter graph needed to transform the specified source grid into the specified destination grid.
-       *
-       * \param gc the associated garbage collector
-       * \param srcGrid the source grid
-       * \param destGrid the destination grid
-       * \param hasMissingValue whether field source has missing value
-       * \param defaultValue default value
-       * \return the first and the last filters of the filter graph
-       */
-      static std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> >
-      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue);
-
-    protected:
-      /*!
-        Overriding this function to process transformations with auxillary inputs
-      */
-      void virtual onInputReady(std::vector<CDataPacketPtr> data);
-
-    protected:
-      //! Default value of output pin
-      double outputDefaultValue;
-  }; // class CSpatialTransformFilter
-
-
- /*!
-   * A specific spatial filter for the temporal_splitting transformation scalar -> axis. An incoming flux will be stored in an aditional dimension given by the destination axis.
-   * At each flux received, the storing index (record) is increased. When it reach the size of the axis (nrecords) a new flux is generated and the record is reset to 0
-   */
-
- class CSpatialTemporalFilter : public CSpatialTransformFilter
-  {
-    public:
-      /*!
-       * Constructs a filter wrapping the specified spatial transformation.
-       *
-       * \param gc the associated garbage collector
-       * \param engine the engine defining the spatial transformation
-       * \param [in] gridTransformation the associated transformations
-       * \param outputValue default value of output pin
-       * \param [in] inputSlotsCount number of input, by default there is only one for field src
-       */
-      CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount = 1);
-
-
-    protected:
-      /*!
-        Overriding this function to process transformations with auxillary inputs
-      */
-      void virtual onInputReady(std::vector<CDataPacketPtr> data);
-      //! Current record in the filter
-      int record ;
-      //! Maximum number of records
-      int nrecords;
-      //! Temporary storage for output flux
-      CArray<double, 1> tmpData; 
-
-
-  }; // class CSpatialTemporalFilter
-
-
-  /*!
-   * A generic filter engine wrapping a grid transformation.
-   */
-  class CSpatialTransformFilterEngine : public IFilterEngine
-  {
-    public:
-      /*!
-       * Returns the engine wrapping the specified grid transformation.
-       * If the engine already exists it is reused, otherwise it is created.
-       *
-       * \param gridTransformation the grid transformation the engine will use
-       * \return the engine wrapping the specified grid transformation
-       */
-      static CSpatialTransformFilterEngine* get(CGridTransformation* gridTransformation);
-
-      /*!
-       * Applies the grid transformation to the input data and returns the result.
-       *
-       * \param data a vector of packets corresponding to each slot (one in this case)
-       * \param [in] defaultValue default value of output data
-       * \return the result of the grid transformation
-       */
-      CDataPacketPtr applyFilter(std::vector<CDataPacketPtr> data, double defaultValue = 0);
-
-       /*!
-       * Applies the grid transformation to the input data and returns the result.
-       *
-       * \param data a vector of packets corresponding to each slot (one in this case)
-       * \return the result of the grid transformation
-       */
-      CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data);
-
-
-
-    protected:
-      /*!
-       * Constructs a filter engine wrapping the specified grid transformation.
-       *
-       * \param gridTransformation the grid transformation the engine will use
-       */
-      CSpatialTransformFilterEngine(CGridTransformation* gridTransformation);
-
-      /*!
-       * Applies the grid transformation to the input data and returns the result.
-       * This helper function handles all the communications.
-       *
-       * \param dataSrc the source data
-       * \param dataDest the resulting transformed data
-       */
-      void apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest);
-
-      CGridTransformation* gridTransformation; //!< The grid transformation used by the engine
-
-      //! The allocated engines
-      static std::map<CGridTransformation*, std::shared_ptr<CSpatialTransformFilterEngine> > engines;
-  }; // class CSpatialTransformFilterEngine
-} // namespace xios
-
-#endif //__XIOS_CSpatialTransformFilter__
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/temporal_transform_filter.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/temporal_transform_filter.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/temporal_transform_filter.cpp	(revision 2011)
@@ -4,6 +4,6 @@
 {
 
-  CTemporalTransformFilter::CTemporalTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, int nrecords, bool detectMissingValues, double defaultValue)
-  : CTransformFilter(gc, algo, detectMissingValues, defaultValue), nrecords_(nrecords)
+  CTemporalTransformFilter::CTemporalTransformFilter(CGarbageCollector& gc, int slots, CGridAlgorithm* algo, int nrecords, bool detectMissingValues, double defaultValue)
+  : CTransformFilter(gc, slots, algo, detectMissingValues, defaultValue), nrecords_(nrecords)
   {
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/temporal_transform_filter.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/temporal_transform_filter.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/temporal_transform_filter.hpp	(revision 2011)
@@ -14,5 +14,5 @@
     public:
 
-      CTemporalTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, int nrecords, bool detectMissingValues, double defaultValue) ;
+      CTemporalTransformFilter(CGarbageCollector& gc, int slots, CGridAlgorithm* algo, int nrecords, bool detectMissingValues, double defaultValue) ;
 
     protected:
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/transform_filter.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/transform_filter.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/transform_filter.cpp	(revision 2011)
@@ -5,6 +5,6 @@
 {
   
-  CTransformFilter::CTransformFilter( CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) 
-                                    : CFilter(gc, 1, this), algorithm_(algo), 
+  CTransformFilter::CTransformFilter( CGarbageCollector& gc, int slots, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) 
+                                    : CFilter(gc, slots, this), algorithm_(algo), 
                                       detectMissingValues_(detectMissingValues), defaultValue_(defaultValue)
   {
@@ -20,5 +20,14 @@
     packet->status = data[0]->status;
 
-    if (packet->status == CDataPacket::NO_ERROR) algorithm_->apply(data[0]->data, packet->data);
+    if (packet->status == CDataPacket::NO_ERROR) 
+    {
+      if (data.size()>1)
+      {
+        vector<CArray<double,1>> auxData(data.size()-1); 
+        for(int i=0;i<data.size()-1 ;i++) auxData[i].reference(data[i+1]->data) ;
+        algorithm_->apply(data[0]->data, auxData, packet->data);
+      }
+      else algorithm_->apply(data[0]->data, packet->data);
+    }
     return packet;
   }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/transform_filter.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/transform_filter.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/filter/transform_filter.hpp	(revision 2011)
@@ -15,5 +15,5 @@
     public:
 
-      CTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) ;
+      CTransformFilter(CGarbageCollector& gc, int slots, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) ;
 
     protected:
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/compute_connectivity_domain.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/compute_connectivity_domain.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/compute_connectivity_domain.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "compute_connectivity_domain.hpp"
+#include "domain_algorithm_compute_connectivity.hpp"
 #include "type.hpp"
 
@@ -51,3 +52,17 @@
   }
 
+  CGenericAlgorithmTransformation* CComputeConnectivityDomain::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CDomainAlgorithmComputeConnectivity::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition) ;
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/compute_connectivity_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/compute_connectivity_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/compute_connectivity_domain.hpp	(revision 2011)
@@ -20,4 +20,6 @@
   class CComputeConnectivityDomain;
   class CDomain;
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
 
   ///--------------------------------------------------------------
@@ -62,4 +64,13 @@
       static CTransformation<CDomain>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/duplicate_scalar_to_axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/duplicate_scalar_to_axis.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/duplicate_scalar_to_axis.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "duplicate_scalar_to_axis.hpp"
+#include "axis_algorithm_duplicate_scalar.hpp"
 #include "type.hpp"
 #include "axis.hpp"
@@ -43,4 +44,18 @@
    
   }
-
+  
+  CGenericAlgorithmTransformation* CDuplicateScalarToAxis::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                         std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CAxisAlgorithmDuplicateScalar::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid, 
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition) ;
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/duplicate_scalar_to_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/duplicate_scalar_to_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/duplicate_scalar_to_axis.hpp	(revision 2011)
@@ -20,4 +20,6 @@
   class CAxis;
   class CScalar;
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
 
   ///--------------------------------------------------------------
@@ -62,4 +64,13 @@
       static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/expand_domain.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/expand_domain.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/expand_domain.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "expand_domain.hpp"
+#include "domain_algorithm_expand.hpp"
 #include "type.hpp"
 
@@ -47,4 +48,18 @@
     if (this->type.isEmpty()) this->type.setValue(CExpandDomain::type_attr::edge);
   }
-
+  
+  CGenericAlgorithmTransformation* CExpandDomain::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CDomainAlgorithmExpand::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition) ;
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/expand_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/expand_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/expand_domain.hpp	(revision 2011)
@@ -20,4 +20,6 @@
   class CExpandDomain;
   class CDomain;
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
 
   ///--------------------------------------------------------------
@@ -62,4 +64,13 @@
       static CTransformation<CDomain>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "extract_axis.hpp"
+#include "axis_algorithm_extract.hpp"
 #include "type.hpp"
 
@@ -77,3 +78,17 @@
   }
 
+  CGenericAlgorithmTransformation* CExtractAxis::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CAxisAlgorithmExtract::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid, 
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CExtractAxis;
   class CAxis;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis_to_scalar.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis_to_scalar.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis_to_scalar.cpp	(revision 2011)
@@ -1,3 +1,5 @@
 #include "extract_axis_to_scalar.hpp"
+#include "scalar_algorithm_extract_axis.hpp"
+
 #include "type.hpp"
 #include "axis.hpp"
@@ -57,3 +59,17 @@
   }
 
+  CGenericAlgorithmTransformation* CExtractAxisToScalar::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CScalarAlgorithmExtractAxis::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition) ;
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis_to_scalar.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis_to_scalar.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_axis_to_scalar.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CAxis;
   class CScalar;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CScalar>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "extract_domain.hpp"
+#include "domain_algorithm_extract.hpp"
 #include "type.hpp"
 
@@ -72,3 +73,17 @@
   }
 
+  CGenericAlgorithmTransformation* CExtractDomain::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CDomainAlgorithmExtract::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CExtractDomain;
   class CDomain;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CDomain>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
      private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain_to_axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain_to_axis.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain_to_axis.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "extract_domain_to_axis.hpp"
+#include "axis_algorithm_extract_domain.hpp"
 #include "type.hpp"
 #include "axis.hpp"
@@ -98,3 +99,17 @@
   }
 
+  CGenericAlgorithmTransformation* CExtractDomainToAxis::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CAxisAlgorithmExtractDomain::create(isSource, gridDst, gridSrc, this, elementPositionInGrid, 
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain_to_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain_to_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/extract_domain_to_axis.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CAxis;
   class CDomain;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.cpp	(revision 2011)
@@ -383,13 +383,5 @@
   CATCH_DUMP_ATTR
 
-  //----------------------------------------------------------------
-
-  std::shared_ptr<COutputPin> CField::getInstantDataFilter()
-  TRY
-  {
-    return instantDataFilter;
-  }
-  CATCH_DUMP_ATTR
-
+  
   //----------------------------------------------------------------
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/field.hpp	(revision 2011)
@@ -107,6 +107,4 @@
          template <int N> void getData(CArray<double, N>& _data) const;
 
-         std::shared_ptr<COutputPin> getInstantDataFilter();
-
          std::map<int, StdSize> getGridAttributesBufferSize(CContextClient* client, bool bufferForWriting = false);
          // Grid data buffer size for each connection of contextclient
@@ -352,5 +350,9 @@
          //! The output pin of the filter providing the instant data for the field
          std::shared_ptr<COutputPin> instantDataFilter;
-         
+      public:
+          std::shared_ptr<COutputPin> getInstantDataFilter(void) { return instantDataFilter;}
+
+      private:
+
          //! The output pin of the filters providing the result of the field's temporal operation
          std::map<CDuration, std::shared_ptr<COutputPin>, DurationFakeLessComparator> temporalDataFilters;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/generate_rectilinear_domain.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/generate_rectilinear_domain.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/generate_rectilinear_domain.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "generate_rectilinear_domain.hpp"
+#include "domain_algorithm_generate_rectilinear.hpp"
 #include "type.hpp"
 
@@ -138,3 +139,17 @@
   }
 
+  CGenericAlgorithmTransformation* CGenerateRectilinearDomain::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CDomainAlgorithmGenerateRectilinear::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/generate_rectilinear_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/generate_rectilinear_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/generate_rectilinear_domain.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CGenerateRectilinearDomain;
   class CDomain;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CDomain>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.cpp	(revision 2011)
@@ -16,5 +16,4 @@
 #include "client_server_mapping_distributed.hpp"
 #include "distribution_client.hpp"
-#include "grid_transformation.hpp"
 #include "server.hpp"
 #include "distribution_type.hpp"
@@ -46,7 +45,6 @@
       , connectedDataSize_(), connectedServerRank_(), connectedServerRankRead_(), connectedDataSizeRead_()
 	    , isCompressible_(false)
-      , transformations_(0), isTransformed_(false)
       , axisPositionInGrid_(), hasDomainAxisBaseRef_(false)
-      , gridSrc_(), hasTransform_(false), order_()
+      , gridSrc_(), order_()
       , clients()
    {
@@ -65,7 +63,6 @@
       , connectedDataSize_(), connectedServerRank_(), connectedServerRankRead_(), connectedDataSizeRead_()
 	    , isCompressible_(false)
-      , transformations_(0), isTransformed_(false)
       , axisPositionInGrid_(), hasDomainAxisBaseRef_(false)
-      , gridSrc_(), hasTransform_(false), order_()
+      , gridSrc_(), order_()
       , clients()
    {
@@ -78,5 +75,4 @@
    {
     if (0 != clientDistribution_) delete clientDistribution_;
-    if (0 != transformations_) delete transformations_;
    }
 
@@ -1363,5 +1359,5 @@
 
     CArray<bool,1> maskOut ;
-    gridGathererConnector.transfer(event,maskOut,false) ;
+    gridGathererConnector.transfer_or(event,maskOut) ;
     gridMaskConnector.computeConnector(maskOut) ;
 
@@ -1688,13 +1684,4 @@
   CATCH_DUMP_ATTR
 
-  
-
-  vector<std::string> CGrid::getAuxInputTransformGrid(void)
-  TRY
-  {
-    if (transformations_ != nullptr) return transformations_->getAuxInputs() ;
-  }
-  CATCH_DUMP_ATTR
-
 
 
@@ -1710,5 +1697,5 @@
                                         // big mystery why it doesn't work witout that...
                                         // problem with the linker ?? 
-    
+
     std::shared_ptr<CFilter> inputFilter = std::shared_ptr<CPassThroughFilter>(new CPassThroughFilter(gc));
     std::shared_ptr<CFilter> outputFilter = inputFilter ;
@@ -1792,9 +1779,13 @@
             tmpGridDst->addDomain(dstDomain->getId()) ;
 
+            algo = transformation -> createAlgorithm(false, tmpGridDst, tmpGridSrc, 0, 
+                                                     posInGrid,posInGrid,posInGrid,
+                                                     posInGrid,posInGrid,posInGrid );
             //reuse existing algorithm interface for, now
-            algo = CGridTransformationFactory<CDomain>::createTransformation(transType, false, tmpGridDst, tmpGridSrc,
+         /*   algo = CGridTransformationFactory<CDomain>::createTransformation(transType, false, tmpGridDst, tmpGridSrc,
                                                                              transformation, 0, 
                                                                              posInGrid,posInGrid,posInGrid,
                                                                              posInGrid,posInGrid,posInGrid );
+           */
             dstDomain->setTransformationAlgorithm(algo) ;
             transformationPath.removeNextTransform() ;
@@ -1819,9 +1810,13 @@
             tmpGridDst->addAxis(dstAxis->getId()) ;
 
+             algo = transformation -> createAlgorithm(false, tmpGridDst, tmpGridSrc, 0, 
+                                                     posInGrid,posInGrid,posInGrid,
+                                                     posInGrid,posInGrid,posInGrid );
+
             //reuse existing algorithm interface for, now
-            algo = CGridTransformationFactory<CAxis>::createTransformation(transType, false, tmpGridDst, tmpGridSrc,
+           /* algo = CGridTransformationFactory<CAxis>::createTransformation(transType, false, tmpGridDst, tmpGridSrc,
                                                                            transformation, 0, 
                                                                            posInGrid,posInGrid,posInGrid,
-                                                                           posInGrid,posInGrid,posInGrid );
+                                                                           posInGrid,posInGrid,posInGrid );*/
             dstAxis->setTransformationAlgorithm(algo) ;
             transformationPath.removeNextTransform() ;
@@ -1846,9 +1841,12 @@
             tmpGridDst->addScalar(dstScalar->getId()) ;
 
+            algo = transformation -> createAlgorithm(false, tmpGridDst, tmpGridSrc, 0, 
+                                                     posInGrid,posInGrid,posInGrid,
+                                                     posInGrid,posInGrid,posInGrid );
             //reuse existing algorithm interface for, now
-            algo = CGridTransformationFactory<CScalar>::createTransformation(transType, false, tmpGridDst, tmpGridSrc,
+           /* algo = CGridTransformationFactory<CScalar>::createTransformation(transType, false, tmpGridDst, tmpGridSrc,
                                                                              transformation, 0, 
                                                                              posInGrid,posInGrid,posInGrid,
-                                                                             posInGrid,posInGrid,posInGrid );
+                                                                             posInGrid,posInGrid,posInGrid );*/
             dstScalar->setTransformationAlgorithm(algo) ;
             transformationPath.removeNextTransform() ;
@@ -1917,4 +1915,5 @@
     if (hadTransform)
     {
+      
       if (!isSource)
       {
@@ -1929,4 +1928,13 @@
         shared_ptr<CTransformFilter> transformFilter = shared_ptr<CTransformFilter>(gridAlgorithm->createTransformFilter(gc, detectMissingValues, defaultValue)) ;
         outputFilter->connectOutput(transformFilter,0) ;
+        vector<string> auxFieldId = algo->getAuxFieldId() ; // better to do that at transformation not algo ??
+        int i=1; 
+        for (auto& it : auxFieldId)
+        {
+          CField* auxField = CField::get(it) ;
+          auxField->buildWorkflowGraph(gc) ;
+          auxField->getInstantDataFilter()->connectOutput(transformFilter,i) ;
+          i++ ;
+        }
         outputFilter = transformFilter ;
       }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/grid.hpp	(revision 2011)
@@ -39,6 +39,5 @@
    class CServerDistributionDescription;
    class CClientServerMapping;
-   class CGridTransformation;
-
+  
    ///--------------------------------------------------------------
 
@@ -215,8 +214,4 @@
          ///////////////////////////////////////////
       public:
-         CGridTransformation* getTransformations();
-
-         std::vector<std::string> getAuxInputTransformGrid(void) ; 
-         void setTransformationAlgorithms();
          pair<shared_ptr<CFilter>, shared_ptr<CFilter> > buildTransformationGraph(CGarbageCollector& gc, bool isSource, CGrid* gridSrc, double detectMissingValues,
                                                                                   double defaultValue, CGrid*& newGrid) ;
@@ -226,8 +221,4 @@
         void setGridAlgorithm(CGridAlgorithm* gridAlgorithm) {gridAlgorithm_ = gridAlgorithm;}
         CGridAlgorithm* getGridAlgorithm(void) { return gridAlgorithm_ ;}
-      private:
-         bool isTransformed_;
-         CGridTransformation* transformations_;
-         bool hasTransform_;
        
         ///////////////////////////////////////////
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_axis.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_axis.cpp	(revision 2011)
@@ -1,3 +1,5 @@
 #include "interpolate_axis.hpp"
+#include "axis_algorithm_interpolate_coordinate.hpp"
+#include "axis_algorithm_interpolate.hpp"
 #include "type.hpp"
 #include "field.hpp"
@@ -84,3 +86,21 @@
     return auxInputs;
   }
+
+  CGenericAlgorithmTransformation* CInterpolateAxis::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    if (!coordinate.isEmpty())  return CAxisAlgorithmInterpolateCoordinate::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid, 
+                                      elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                                      elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+    else return CAxisAlgorithmInterpolate::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid, 
+                elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_axis.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CInterpolateAxis;
   class CAxis;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -64,4 +65,13 @@
       static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_domain.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_domain.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_domain.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "interpolate_domain.hpp"
+#include "domain_algorithm_interpolate.hpp"
 #include "type.hpp"
 
@@ -68,3 +69,17 @@
   }
 
+  CGenericAlgorithmTransformation* CInterpolateDomain::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CDomainAlgorithmInterpolate::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/interpolate_domain.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CInterpolateDomain;
   class CDomain;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CDomain>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/inverse_axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/inverse_axis.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/inverse_axis.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "inverse_axis.hpp"
+#include "axis_algorithm_inverse.hpp"
 #include "type.hpp"
 
@@ -39,3 +40,17 @@
   {}
 
+  CGenericAlgorithmTransformation* CInverseAxis::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CAxisAlgorithmInverse::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition) ;
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/inverse_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/inverse_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/inverse_axis.hpp	(revision 2011)
@@ -19,4 +19,6 @@
   class CInverseAxis;
   class CAxis;
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -60,4 +62,13 @@
       static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_axis.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_axis.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "reduce_axis_to_axis.hpp"
+#include "axis_algorithm_reduce_axis.hpp"
 #include "type.hpp"
 #include "axis.hpp"
@@ -56,3 +57,17 @@
   }
 
+  CGenericAlgorithmTransformation* CReduceAxisToAxis::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CAxisAlgorithmReduceAxis::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_axis.hpp	(revision 2011)
@@ -19,5 +19,6 @@
   class CReduceAxisToAxis;
   class CAxis;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -61,5 +62,14 @@
       static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
-    private:
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
+   private:
       static bool registerTrans();
       static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_scalar.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_scalar.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_scalar.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "reduce_axis_to_scalar.hpp"
+#include "scalar_algorithm_reduce_axis.hpp"
 #include "type.hpp"
 
@@ -41,3 +42,17 @@
   }
 
+  CGenericAlgorithmTransformation* CReduceAxisToScalar::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CScalarAlgorithmReduceAxis::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_scalar.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_scalar.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_axis_to_scalar.hpp	(revision 2011)
@@ -19,5 +19,6 @@
   class CReduceAxisToScalar;
   class CScalar;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -61,4 +62,13 @@
       static CTransformation<CScalar>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_axis.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_axis.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "reduce_domain_to_axis.hpp"
+#include "axis_algorithm_reduce_domain.hpp"
 #include "type.hpp"
 #include "axis.hpp"
@@ -87,3 +88,17 @@
   }
 
+  CGenericAlgorithmTransformation* CReduceDomainToAxis::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CAxisAlgorithmReduceDomain::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition) ;
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_axis.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CAxis;
   class CDomain;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
      private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_scalar.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_scalar.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_scalar.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "reduce_domain_to_scalar.hpp"
+#include "scalar_algorithm_reduce_domain.hpp"
 #include "type.hpp"
 
@@ -42,3 +43,17 @@
   }
 
+  CGenericAlgorithmTransformation* CReduceDomainToScalar::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CScalarAlgorithmReduceDomain::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition) ;
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_scalar.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_scalar.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_domain_to_scalar.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CDomain;
   class CScalar;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CScalar>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_scalar_to_scalar.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_scalar_to_scalar.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_scalar_to_scalar.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "reduce_scalar_to_scalar.hpp"
+#include "scalar_algorithm_reduce_scalar.hpp"
 #include "type.hpp"
 
@@ -41,3 +42,17 @@
   }
 
+  CGenericAlgorithmTransformation* CReduceScalarToScalar::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CScalarAlgorithmReduceScalar::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_scalar_to_scalar.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_scalar_to_scalar.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reduce_scalar_to_scalar.hpp	(revision 2011)
@@ -19,5 +19,6 @@
   class CReduceScalarToScalar;
   class CScalar;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -61,4 +62,13 @@
       static CTransformation<CScalar>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reorder_domain.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reorder_domain.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reorder_domain.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "reorder_domain.hpp"
+#include "domain_algorithm_reorder.hpp"
 #include "type.hpp"
 
@@ -41,3 +42,17 @@
   }
 
+  CGenericAlgorithmTransformation* CReorderDomain::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CDomainAlgorithmReorder::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reorder_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reorder_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/reorder_domain.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CReorderDomain;
   class CDomain;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CDomain>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
      private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/temporal_splitting.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/temporal_splitting.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/temporal_splitting.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "temporal_splitting.hpp"
+#include "axis_algorithm_temporal_splitting.hpp"
 #include "type.hpp"
 #include "axis.hpp"
@@ -45,3 +46,17 @@
   }
 
+  CGenericAlgorithmTransformation* CTemporalSplitting::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CAxisAlgorithmTemporalSplitting::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/temporal_splitting.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/temporal_splitting.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/temporal_splitting.hpp	(revision 2011)
@@ -20,4 +20,6 @@
   class CAxis;
   class CScalar;
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -61,4 +63,13 @@
       static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_axis.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_axis.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_axis.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "zoom_axis.hpp"
+#include "axis_algorithm_zoom.hpp"
 #include "type.hpp"
 
@@ -77,3 +78,17 @@
   }
 
+  CGenericAlgorithmTransformation* CZoomAxis::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CAxisAlgorithmZoom::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_axis.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CZoomAxis;
   class CAxis;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_domain.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_domain.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_domain.cpp	(revision 2011)
@@ -1,3 +1,4 @@
 #include "zoom_domain.hpp"
+#include "domain_algorithm_zoom.hpp"
 #include "type.hpp"
 
@@ -72,3 +73,17 @@
   }
 
+  CGenericAlgorithmTransformation* CZoomDomain::createAlgorithm(bool isSource,
+                                                        CGrid* gridDst, CGrid* gridSrc,
+                                                        int elementPositionInGrid,
+                                                        std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                        std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  {
+    return CDomainAlgorithmZoom::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid,
+                       elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                       elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/node/zoom_domain.hpp	(revision 2011)
@@ -20,5 +20,6 @@
   class CZoomDomain;
   class CDomain;
-
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
   ///--------------------------------------------------------------
 
@@ -62,4 +63,13 @@
       virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
       static CTransformation<CDomain>* getTransformation(const StdString& id) { return SuperClass::get(id);}
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition)  ;
     private:
       static bool registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algo_types.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algo_types.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algo_types.cpp	(revision 2011)
@@ -20,4 +20,5 @@
       ret=CAxisAlgorithmExtractDomain::registerTrans();
       ret=CAxisAlgorithmInterpolate::registerTrans();
+      ret=CAxisAlgorithmInterpolateCoordinate::registerTrans();
       ret=CAxisAlgorithmExtract::registerTrans();
       ret=CAxisAlgorithmInverse::registerTrans();
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algo_types.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algo_types.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/algo_types.hpp	(revision 2011)
@@ -13,8 +13,10 @@
 #include "scalar_algorithm_extract_axis.hpp"
 #include "scalar_algorithm_reduce_domain.hpp"
+#include "scalar_algorithm_reduce_scalar.hpp"
 
 #include "axis_algorithm_inverse.hpp"
 #include "axis_algorithm_zoom.hpp"
 #include "axis_algorithm_interpolate.hpp"
+#include "axis_algorithm_interpolate_coordinate.hpp"
 #include "axis_algorithm_extract.hpp"
 #include "axis_algorithm_reduce_domain.hpp"
@@ -23,4 +25,6 @@
 #include "axis_algorithm_extract_domain.hpp"
 #include "axis_algorithm_temporal_splitting.hpp"
+#include "axis_algorithm_duplicate_scalar.hpp"
+
 
 #include "domain_algorithm_zoom.hpp"
@@ -29,6 +33,4 @@
 #include "domain_algorithm_compute_connectivity.hpp"
 #include "domain_algorithm_expand.hpp"
-#include "axis_algorithm_duplicate_scalar.hpp"
-#include "scalar_algorithm_reduce_scalar.hpp"
 #include "domain_algorithm_reorder.hpp"
 #include "domain_algorithm_extract.hpp"
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_duplicate_scalar.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_duplicate_scalar.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_duplicate_scalar.hpp	(revision 2011)
@@ -33,7 +33,4 @@
   static bool registerTrans();
 
-
-private:
-
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CAxis>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract.hpp	(revision 2011)
@@ -45,4 +45,6 @@
   CAxis* axisSrc_;
   CAxis* axisDest_;
+
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CAxis>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_extract_domain.hpp	(revision 2011)
@@ -46,4 +46,6 @@
   CDomain* domainSrc_;
   CAxis* axisDest_ ;
+
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CAxis>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate.cpp	(revision 2011)
@@ -46,5 +46,6 @@
 TRY
 {
-  return CGridTransformationFactory<CAxis>::registerTransformation(TRANS_INTERPOLATE_AXIS, create);
+  /// descativate for now
+  // return CGridTransformationFactory<CAxis>::registerTransformation(TRANS_INTERPOLATE_AXIS, create);
 }
 CATCH
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate.hpp	(revision 2011)
@@ -49,6 +49,6 @@
   CAxis* axisSrc_=nullptr ;
   CAxis* axisDest_=nullptr;
-private:
 
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CAxis>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate_coordinate.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate_coordinate.cpp	(revision 2011)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate_coordinate.cpp	(revision 2011)
@@ -0,0 +1,234 @@
+/*!
+   \file axis_algorithm_interpolate.cpp
+   \author Ha NGUYEN
+   \since 23 June 2015
+   \date 02 Jul 2015
+
+   \brief Algorithm for interpolation on an axis.
+ */
+#include "axis_algorithm_interpolate_coordinate.hpp"
+#include "axis.hpp"
+#include "interpolate_axis.hpp"
+#include <algorithm>
+#include <numeric>
+#include "context.hpp"
+#include "context_client.hpp"
+#include "utils.hpp"
+#include "grid.hpp"
+#include "grid_transformation_factory_impl.hpp"
+#include "distribution_client.hpp"
+#include "transform_filter.hpp"
+#include "timer.hpp"
+
+namespace xios
+{
+  CGenericAlgorithmTransformation* CAxisAlgorithmInterpolateCoordinate::create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
+                                                                     CTransformation<CAxis>* transformation,
+                                                                     int elementPositionInGrid,
+                                                                     std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                                     std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                                     std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                                     std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition)
+  TRY
+  {
+    std::vector<CAxis*> axisListDestP = gridDst->getAxis();
+    std::vector<CAxis*> axisListSrcP  = gridSrc->getAxis();
+
+    CInterpolateAxis* interpolateAxis = dynamic_cast<CInterpolateAxis*> (transformation);
+    int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
+    int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
+
+    return (new CAxisAlgorithmInterpolateCoordinate(isSource, axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], interpolateAxis));
+  }
+  CATCH
+
+  bool CAxisAlgorithmInterpolateCoordinate::dummyRegistered_ = CAxisAlgorithmInterpolateCoordinate::registerTrans();
+  bool CAxisAlgorithmInterpolateCoordinate::registerTrans()
+  TRY
+  {
+    return CGridTransformationFactory<CAxis>::registerTransformation(TRANS_INTERPOLATE_AXIS, create);
+  }
+  CATCH
+
+  vector<string> CAxisAlgorithmInterpolateCoordinate::getAuxFieldId(void)
+  {
+    if (hasCoordinate_) return vector<string>(1,coordinate_) ;
+    else return vector<string>() ;
+  }
+
+  CAxisAlgorithmInterpolateCoordinate::CAxisAlgorithmInterpolateCoordinate(bool isSource, CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis)
+  : CAlgorithmTransformationTransfer(isSource), axisSrc_(axisSource), axisDest_(axisDestination)
+  TRY 
+  {
+    interpAxis->checkValid(axisSource);
+    axisDestination->checkAttributes() ;
+
+    order_ = interpAxis->order.getValue();
+    if (!interpAxis->coordinate.isEmpty())
+    {
+      coordinate_ = interpAxis->coordinate.getValue();
+      hasCoordinate_=true ;
+    }
+  
+    ngloSrc_=axisSource->n_glo ;
+    nDest_ =  axisDest_-> getLocalView(CElementView::WORKFLOW)->getSize() ;
+    CArray<double,1> coord ;
+    CLocalConnector destConnector(axisDest_->getLocalView(CElementView::FULL), axisDest_->getLocalView(CElementView::WORKFLOW)) ;
+    destConnector.computeConnector() ;
+    destConnector.transfer(axisDest_->value, coord) ;
+    destCoordinate_ = vector<double>(coord.dataFirst(), coord.dataFirst()+nDest_) ;
+    
+    CArray<size_t,1> globalIndex(ngloSrc_) ;
+    for(int i=0;i<ngloSrc_;i++) 
+    {
+      transformationMapping_[i] = i ;
+      globalIndex(i) = i ;
+    }
+    
+
+    CLocalElement axisSourceGlo(CContext::getCurrent()->getIntraCommRank(), ngloSrc_, globalIndex) ;
+    axisSourceGlo.addFullView() ; 
+
+    this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), axisSourceGlo.getView(CElementView::FULL)) ;
+  }
+  CATCH
+
+  CTransformFilter* CAxisAlgorithmInterpolateCoordinate::createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue)
+  {
+    return new CTransformFilter(gc, 2, algo, detectMissingValues, defaultValue) ;  
+  }
+
+  void CAxisAlgorithmInterpolateCoordinate::apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, 
+                                                   const vector<CArray<double,1>>& auxDataIn, CArray<double,1>& dataOut)
+  {
+    CArray<double,1> dataInTmp;
+    CArray<double,1> auxDataInTmp ;
+    transferTransformConnector_ -> transfer(dimBefore, dimAfter, dataIn, dataInTmp) ;
+    transferTransformConnector_ -> transfer(dimBefore, dimAfter, auxDataIn[0], auxDataInTmp) ;
+  
+    dataOut.resize(dimBefore*dimAfter*nDest_) ;
+    const double* pressure = auxDataInTmp.dataFirst() ;
+    const double* in = dataInTmp.dataFirst() ;
+    double* out = dataOut.dataFirst() ;
+
+    size_t sliceSrc = dimAfter*ngloSrc_ ;
+    size_t sliceDest = dimAfter*nDest_ ;
+    vector<double> srcCoordinate(ngloSrc_) ;
+    vector<double> destCoordinate(nDest_) ;
+    std::vector<int> srcIndex(ngloSrc_);
+    vector<double> srcValue(ngloSrc_) ;
+    vector<double> destValue(nDest_) ;
+    std::vector<int> destIndex(nDest_);
+
+    size_t nsrc ;
+    for(size_t j=0, posJsrc=0, posJdest=0 ;  j<dimBefore ; j++, posJsrc+=sliceSrc, posJdest+=sliceDest )
+      for(size_t k=0, posKsrc=posJsrc, posKdest=posJdest ; k<dimAfter ; k++, posKsrc++,posKdest++)
+      {
+        nsrc=0 ;
+        for(size_t i=0, posIsrc=posKsrc, posIdest=posKdest ; i<ngloSrc_ ; i++, posIsrc+=dimAfter, posIdest+=dimAfter)
+        {
+          if ( !( std::isnan(pressure[posIsrc]) || std::isnan(in[posIsrc]) ) )
+          {
+            srcCoordinate[nsrc]=pressure[posIsrc] ;
+            srcValue[nsrc] = in[posIsrc] ;
+            nsrc++ ;
+          }
+        }
+        destCoordinate = destCoordinate_ ;    
+        computeInterp(nsrc, srcCoordinate, srcValue, srcIndex, nDest_, destCoordinate, destValue, destIndex) ;
+
+        for(size_t i=0, posIdest=posKdest ; i<nDest_ ; i++, posIdest+=dimAfter)  out[posIdest] = destValue[i] ;
+      }
+
+  }
+
+  void CAxisAlgorithmInterpolateCoordinate::computeInterp(int nsrc, vector<double>& srcCoordinate, vector<double>& srcValue, vector<int>& srcIndex,
+                                                          int ndst, vector<double>& dstCoordinate, vector<double>& dstValue, vector<int>& dstIndex)
+  {
+    double x,y ;
+    double d ;
+  
+    iota(srcIndex.data(), srcIndex.data()+nsrc, 0); // sort array and retrive sorted index
+    stable_sort(srcIndex.data(), srcIndex.data()+nsrc, [&srcCoordinate](size_t i1, size_t i2) {return srcCoordinate[i1] < srcCoordinate[i2];});
+
+    iota(dstIndex.data(), dstIndex.data()+ndst, 0);
+    stable_sort(dstIndex.data(), dstIndex.data()+ndst, [&dstCoordinate](size_t i1, size_t i2) {return dstCoordinate[i1] < dstCoordinate[i2];});
+
+    if (order_==1 || nsrc<=2)
+    {
+      if (nsrc<=1) dstValue.assign(ndst,std::numeric_limits<double>::quiet_NaN());
+      else
+      {
+
+        double x0,x1 ;
+        double y0,y1 ;
+        int lastj=0;
+      
+        for(int i=0; i < ndst;i++)
+        {
+          x=dstCoordinate[dstIndex[i]] ;
+          if ( x<=srcCoordinate[srcIndex[0]]) lastj=0 ;
+          else if (x>=srcCoordinate[srcIndex[nsrc-1]]) lastj=nsrc-2 ;
+          else
+          {
+            for(int j=lastj; j<nsrc; j++)
+            { 
+              if (x >= srcCoordinate[srcIndex[j]] && x<srcCoordinate[srcIndex[j+1]]) ;
+              lastj=j ;
+              break ;
+            }  
+          }
+          x0=srcCoordinate[srcIndex[lastj]] ;
+          x1=srcCoordinate[srcIndex[lastj+1]] ;
+          y0=srcValue[srcIndex[lastj]] ;
+          y1=srcValue[srcIndex[lastj+1]] ;
+          y=((x-x1)*y0-(x-x0)*y1)/(x0-x1) ;
+          dstValue[dstIndex[i]]=y ;
+        }
+      }
+    }
+    else if (order_==2)
+    {
+      double x0,x1,x2 ;
+      double y0,y1,y2 ;
+      int lastj=0, cj ;
+      
+      for(int i=0; i < ndst;i++)
+      {
+        x=dstCoordinate[dstIndex[i]] ;
+        if ( x<=srcCoordinate[srcIndex[0]]) lastj=0 ;
+        else if (x>=srcCoordinate[srcIndex[nsrc-1]]) lastj=nsrc-2 ;
+        else
+        {
+          for(int j=lastj; j<nsrc; j++)
+          { 
+            if (x >= srcCoordinate[srcIndex[j]] && x<srcCoordinate[srcIndex[j+1]]) ;
+            
+            lastj=j ;
+            break ;
+          }  
+        }
+       
+        if (lastj==0) cj=1 ;
+        else if (lastj>=nsrc-2) cj=nsrc-2 ;
+        else
+        {
+          if ( (x-srcCoordinate[srcIndex[lastj-1]]) > (srcCoordinate[srcIndex[lastj+2]]-x) ) cj=lastj ;
+          else cj=lastj+1 ;
+        } 
+        x0=srcCoordinate[srcIndex[cj-1]] ;
+        x1=srcCoordinate[srcIndex[cj]] ;
+        x2=srcCoordinate[srcIndex[cj+1]] ;
+        y0=srcValue[srcIndex[cj-1]] ;
+        y1=srcValue[srcIndex[cj]] ;
+        y2=srcValue[srcIndex[cj+1]] ;
+            
+        y=y0*(x-x1)*(x-x2)/((x0-x1)*(x0-x2)) + y1*(x-x0)*(x-x2)/((x1-x0)*(x1-x2)) + y2*(x-x0)*(x-x1)/((x2-x0)*(x2-x1))  ;
+        dstValue[dstIndex[i]]=y ;
+      }
+    }
+  }  
+
+}
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate_coordinate.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate_coordinate.hpp	(revision 2011)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_interpolate_coordinate.hpp	(revision 2011)
@@ -0,0 +1,69 @@
+/*!
+   \file axis_algorithm_interpolate.hpp
+   \author Ha NGUYEN
+   \since 23 June 2015
+   \date 23 June 2015
+
+   \brief Algorithm for interpolation on an axis.
+ */
+#ifndef __XIOS_AXIS_ALGORITHM_INTERPOLATE_COORDINATE_HPP__
+#define __XIOS_AXIS_ALGORITHM_INTERPOLATE_COORDINATE_HPP__
+
+#include "algorithm_transformation_transfer.hpp"
+#include "transformation.hpp"
+
+namespace xios {
+
+class CAxis;
+class CGrid;
+class CInterpolateAxis;
+class CTransformFilter;
+
+/*!
+  \class CAxisAlgorithmInterpolateCoordinate
+  Implementing interpolation on axis
+  The values on axis source are assumed monotonic
+*/
+class CAxisAlgorithmInterpolateCoordinate : public CAlgorithmTransformationTransfer
+{
+public:
+  CAxisAlgorithmInterpolateCoordinate(bool isSource, CAxis* axisDestination, CAxis* axisSource, CInterpolateAxis* interpAxis);
+
+  virtual ~CAxisAlgorithmInterpolateCoordinate() {}
+  virtual vector<string> getAuxFieldId(void)  ;
+  virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, 
+                     const vector<CArray<double,1>>& auxDataIn, CArray<double,1>& dataOut) ;
+  static bool registerTrans();
+  virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) ;
+  
+private:
+  void computeInterp(int nsrc, vector<double>& srcCoordinate, vector<double>& srcValue, vector<int>& srcIndex,
+                     int ndst, vector<double>& dstCoordinate, vector<double>& dstValue, vector<int>& dstIndex) ;
+
+  // Interpolation order
+  int order_;
+  StdString coordinate_;
+  bool hasCoordinate_=false ;
+
+  CAxis* axisSrc_=nullptr ;
+  CAxis* axisDest_=nullptr;
+  size_t ngloSrc_ ;
+  size_t nDest_ ;
+  vector<double> destCoordinate_ ;
+
+public:
+  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
+                                                CTransformation<CAxis>* transformation,
+                                                int elementPositionInGrid,
+                                                std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                std::map<int, int>& elementPositionInGridDst2DomainPosition);
+  static bool dummyRegistered_;
+};
+
+}
+
+#endif // __XIOS_AXIS_ALGORITHM_INTERPOLATE_HPP__
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_inverse.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_inverse.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_inverse.hpp	(revision 2011)
@@ -37,6 +37,6 @@
   void updateAxisValue();
 
-private:
-  static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
+public:
+ static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CAxis>* transformation,
                                                 int elementPositionInGrid,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_reduce_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_reduce_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_reduce_axis.hpp	(revision 2011)
@@ -32,6 +32,6 @@
 
   static bool registerTrans();
-  
-private:
+
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CAxis>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_reduce_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_reduce_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_reduce_domain.hpp	(revision 2011)
@@ -45,5 +45,5 @@
   CAxis* axisDest_ ;
 
-private:
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CAxis>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_temporal_splitting.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_temporal_splitting.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_temporal_splitting.cpp	(revision 2011)
@@ -51,5 +51,5 @@
 CTransformFilter* CAxisAlgorithmTemporalSplitting::createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue)
 {
-  return new CTemporalTransformFilter(gc, algo, nrecords_, detectMissingValues, defaultValue) ;
+  return new CTemporalTransformFilter(gc, 1, algo, nrecords_, detectMissingValues, defaultValue) ;
 }
 
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_temporal_splitting.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_temporal_splitting.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_temporal_splitting.hpp	(revision 2011)
@@ -30,6 +30,5 @@
       static bool registerTrans();
       virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) ;
-    
-    private:
+
       static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                      CTransformation<CAxis>* transformation,
@@ -41,4 +40,5 @@
                                                      std::map<int, int>& elementPositionInGridDst2AxisPosition,
                                                      std::map<int, int>& elementPositionInGridDst2DomainPosition);
+    private:
     int nrecords_;
     static bool dummyRegistered_;
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_transformation.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_transformation.cpp	(revision 2010)
+++ 	(revision )
@@ -1,135 +1,0 @@
-/*!
-   \file axis_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 29 June 2015
-
-   \brief Interface for all axis transformation algorithms.
- */
-
-#include "axis_algorithm_transformation.hpp"
-#include "axis_algorithm_inverse.hpp"
-#include "axis_algorithm_zoom.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "client_client_dht_template.hpp"
-#include "axis.hpp"
-
-namespace xios {
-
-CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(bool isSource, CAxis* axisDestination, CAxis* axisSource)
- : CGenericAlgorithmTransformation(isSource), axisDest_(axisDestination), axisSrc_(axisSource), domainSrc_(0),scalarSrc_(0)
-TRY
-{
-  axisDestGlobalSize_ = axisDestination->n_glo.getValue();
-  int niDest = axisDestination->n.getValue();
-  int ibeginDest = axisDestination->begin.getValue();
-
-  for (int idx = 0; idx < niDest; ++idx)
-    if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx);
-}
-CATCH
-
-CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(bool isSource, CAxis* axisDestination, CDomain* domainSource)
- : CGenericAlgorithmTransformation(isSource), axisDest_(axisDestination), axisSrc_(0), domainSrc_(domainSource),scalarSrc_(0)
-TRY
-{
-  axisDestGlobalSize_ = axisDestination->n_glo.getValue();
-  int niDest = axisDestination->n.getValue();
-  int ibeginDest = axisDestination->begin.getValue();
-
-  for (int idx = 0; idx < niDest; ++idx)
-    if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx);
-}
-CATCH
-
-CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(bool isSource, CAxis* axisDestination, CScalar* scalarSource)
- : CGenericAlgorithmTransformation(isSource), axisDest_(axisDestination), axisSrc_(0), domainSrc_(0), scalarSrc_(scalarSource)
-TRY
-{
-  axisDestGlobalSize_ = axisDestination->n_glo.getValue();
-  int niDest = axisDestination->n.getValue();
-  int ibeginDest = axisDestination->begin.getValue();
-
-  for (int idx = 0; idx < niDest; ++idx)
-    if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx);
-}
-CATCH
-
-CAxisAlgorithmTransformation::~CAxisAlgorithmTransformation()
-{
-}
-
-void CAxisAlgorithmTransformation::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-/*!
-  Compute global index of axis on different processes
-  \param [in] globalAxisIndex global index of axis source
-  \param [out] globalAxisIndexOnProc processes which contain the corresponding global index of axis source
-*/
-void CAxisAlgorithmTransformation::computeExchangeGlobalIndex(const CArray<size_t,1>& globalAxisIndex,
-                                                              int elementType,
-                                                              CClientClientDHTInt::Index2VectorInfoTypeMap& globalAxisIndexOnProc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  int clientRank = context->intraCommRank_;
-  int clientSize = context->intraCommSize_;
-
-  size_t globalIndex;
-  int nIndexSize = 0;
-  CArray<bool,1>* ptLocalMask ;
-  CArray<bool,1> scalarMask(1) ;
-  scalarMask=true ;
-  
-  if (2 == elementType) 
-  {
-    nIndexSize = domainSrc_->i_index.numElements();
-    ptLocalMask=&(domainSrc_->localMask) ;
-  }
-  else if (1 == elementType)
-  {
-     nIndexSize = axisSrc_->index.numElements();
-     ptLocalMask=&(axisSrc_->mask) ;
-  }
-  else
-  {
-     nIndexSize=1  ; //  scalar
-     ptLocalMask=&scalarMask ;
-  }
-  CArray<bool,1>& localMask=*ptLocalMask ;
-  
-  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-  globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-  for (int idx = 0; idx < nIndexSize; ++idx)
-  {
-    if (localMask(idx))
-    {
-      if (2 == elementType) // domain
-      {
-       globalIndex = domainSrc_->i_index(idx) + domainSrc_->j_index(idx) * domainSrc_->ni_glo;
-      }
-      else if (1 == elementType) // axis
-      {
-        globalIndex = axisSrc_->index(idx);
-      }
-      else // scalar
-      {
-        globalIndex = 0;
-      }
-     
-      globalIndex2ProcRank[globalIndex].resize(1);
-      globalIndex2ProcRank[globalIndex][0] = clientRank;
-    }
-  }
-
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
-  dhtIndexProcRank.computeIndexInfoMapping(globalAxisIndex);
-
-  globalAxisIndexOnProc = dhtIndexProcRank.getInfoIndexMap();
-}
-CATCH
-
-}
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_transformation.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_transformation.hpp	(revision 2010)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*!
-   \file axis_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 29 June 2015
-
-   \brief Interface for all axis transformation algorithms.
- */
-#ifndef __XIOS_AXIS_ALGORITHM_TRANSFORMATION_HPP__
-#define __XIOS_AXIS_ALGORITHM_TRANSFORMATION_HPP__
-
-#include "generic_algorithm_transformation.hpp"
-#include "grid_transformation_factory_impl.hpp"
-
-namespace xios {
-
-class CAxis;
-class CDomain;
-class CScalar;
-/*!
-  \class CAxisAlgorithmTransformation
-  Algorithms for axis.
-*/
-class CAxisAlgorithmTransformation : public /*virtual*/ CGenericAlgorithmTransformation
-{
-public:
-  CAxisAlgorithmTransformation(bool isSource, CAxis* axisDestination, CAxis* axisSource);
-  CAxisAlgorithmTransformation(bool isSource, CAxis* axisDestination, CDomain* domainSource);
-  CAxisAlgorithmTransformation(bool isSource, CAxis* axisDestination, CScalar* scalarSource);
-
-  virtual ~CAxisAlgorithmTransformation();
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-  virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalAxisIndex,
-                                          int elementType,
-                                          CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc);
-
-protected:
-  //! Global index of an axis on grid destination
-  std::vector<int> axisDestGlobalIndex_;
-
-  //! Size of
-  int axisDestGlobalSize_;
-
-    //! Axis on grid destination
-  CAxis* axisDest_;
-
-  //! Axis on grid source
-  CAxis* axisSrc_;
-
-  //! Domain on grid source
-  CDomain* domainSrc_;
-
-  //! Scalar on grid source
-
-  CScalar* scalarSrc_;
-};
-
-}
-#endif // __XIOS_AXIS_ALGORITHM_TRANSFORMATION_HPP__
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_zoom.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_zoom.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/axis_algorithm/axis_algorithm_zoom.hpp	(revision 2011)
@@ -47,4 +47,5 @@
   CAxis* axisDest_;
 
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CAxis>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.cpp	(revision 2011)
@@ -51,5 +51,4 @@
 TRY
 {
-  this->type_ = (ELEMENT_NO_MODIFICATION_WITHOUT_DATA);
   compute_connectivityDomain->checkValid(domainDestination);
   int& nbNeighborMax = compute_connectivityDomain->n_neighbor_max;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_compute_connectivity.hpp	(revision 2011)
@@ -36,5 +36,5 @@
                                 CArray<int,2>& localConnectivity);
 
-private:
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CDomain>* transformation,
@@ -50,3 +50,4 @@
 
 }
+
 #endif // __XIOS_DOMAIN_ALGORITHM_COMPUTE_CONNECTIVITY_HPP__
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_expand.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_expand.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_expand.hpp	(revision 2011)
@@ -44,5 +44,5 @@
                                           CArray<int,2>& neighborsDomainSrc);
 
-private:
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CDomain>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_extract.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_extract.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_extract.hpp	(revision 2011)
@@ -40,6 +40,6 @@
   CDomain* domainDest_ ;
 
-private:
 
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CDomain>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_generate_rectilinear.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_generate_rectilinear.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_generate_rectilinear.hpp	(revision 2011)
@@ -42,4 +42,6 @@
   void computeDistributionGridDestination(CGrid* gridDest);
   void fillInAttributesDomainDestination();
+
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CDomain>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_interpolate.hpp	(revision 2011)
@@ -95,5 +95,5 @@
                                                 std::map<int, int>& elementPositionInGridDst2AxisPosition,
                                                 std::map<int, int>& elementPositionInGridDst2DomainPosition);
-  
+private:  
   CDomain* domainSrc_ ;
   CDomain* domainDest_ ;
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp	(revision 2011)
@@ -61,6 +61,5 @@
            << "Domain destination " <<domainDestination->getId() << std::endl);
   }
-  this->type_ = (ELEMENT_MODIFICATION_WITHOUT_DATA);
-
+  
   if (!reorderDomain->invert_lat.isEmpty())
   {
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_reorder.hpp	(revision 2011)
@@ -27,6 +27,6 @@
       static bool registerTrans();
 
-    private:
-
+  
+    public:
       static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                      CTransformation<CDomain>* transformation,
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_transformation.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_transformation.cpp	(revision 2010)
+++ 	(revision )
@@ -1,69 +1,0 @@
-/*!
-   \file domain_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 02 Jul 2015
-   \date 02 Jul 2015
-
-   \brief Interface for all domain transformation algorithms.
- */
-
-#include "domain_algorithm_transformation.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "domain.hpp"
-
-namespace xios {
-
-CDomainAlgorithmTransformation::CDomainAlgorithmTransformation(bool isSource, CDomain* domainDestination, CDomain* domainSource)
- : CGenericAlgorithmTransformation(isSource), domainDest_(domainDestination), domainSrc_(domainSource)
-{
-}
-
-CDomainAlgorithmTransformation::~CDomainAlgorithmTransformation()
-{
-}
-
-void CDomainAlgorithmTransformation::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-/*!
-  Compute global index of domain on different processes
-  \param [in] globalDomainIndex global index of domain source
-  \param [out] globalDomainIndexOnProc processes which contain the corresponding global index of domain source
-*/
-void CDomainAlgorithmTransformation::computeExchangeGlobalIndex(const CArray<size_t,1>& globalDomainIndex,
-                                                                int elementType,
-                                                                CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  int clientRank = context->intraCommRank_;
-  int clientSize = context->intraCommSize_;
-
-  int niGlob = domainSrc_->ni_glo.getValue();
-  int njGlob = domainSrc_->nj_glo.getValue();
-  size_t globalIndex;
-  int nIndexSize = domainSrc_->i_index.numElements(), i_ind, j_ind;
-  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-  globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-  CArray<bool,1>& localMask=domainSrc_->localMask ;
-  for (int idx = 0; idx < nIndexSize; ++idx)
-  {
-    if (localMask(idx))
-    {
-      i_ind=domainSrc_->i_index(idx) ;
-      j_ind=domainSrc_->j_index(idx) ;
-
-      globalIndex = i_ind + j_ind * niGlob;
-      globalIndex2ProcRank[globalIndex].push_back(clientRank);
-    }
-  }
-
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
-  dhtIndexProcRank.computeIndexInfoMapping(globalDomainIndex);
-  globalDomainIndexOnProc = dhtIndexProcRank.getInfoIndexMap();
-}
-CATCH
-
-}
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_transformation.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_transformation.hpp	(revision 2010)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*!
-   \file domain_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 02 Jul 2015
-   \date 02 Jul 2015
-
-   \brief Interface for all domain transformation algorithms.
- */
-#ifndef __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__
-#define __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__
-
-#include "generic_algorithm_transformation.hpp"
-#include "client_client_dht_template.hpp"
-
-namespace xios {
-
-class CDomain;
-/*!
-  \class CDomainAlgorithmTransformation
-  Algorithms for domain.
-*/
-class CDomainAlgorithmTransformation : public /*virtual*/ CGenericAlgorithmTransformation
-{
-public:
-  CDomainAlgorithmTransformation(bool isSource, CDomain* domainDestination, CDomain* domainSource);
-
-  virtual ~CDomainAlgorithmTransformation();
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&);
-
-  virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalDomainIndex,
-                                          int elementType,
-                                          CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc);
-
-protected:
-    //! Domain on grid destination
-  CDomain* domainDest_;
-
-  //! Domain on grid source
-  CDomain* domainSrc_;
-};
-
-}
-#endif // __XIOS_DOMAIN_ALGORITHM_TRANSFORMATION_HPP__
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_zoom.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_zoom.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_zoom.hpp	(revision 2011)
@@ -44,6 +44,6 @@
   CDomain* domainDest_ ;
 
-private:
 
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CDomain>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.cpp	(revision 2011)
@@ -23,1120 +23,8 @@
 
 CGenericAlgorithmTransformation::CGenericAlgorithmTransformation(bool isSource)
- : isSource_(isSource), transformationMapping_(), transformationWeight_(), transformationPosition_(),
-   idAuxInputs_(), type_(ELEMENT_NO_MODIFICATION_WITH_DATA), indexElementSrc_(),
-   computedProcSrcNonTransformedElement_(false), eliminateRedondantSrc_(true), isDistributedComputed_(false)
+ : isSource_(isSource)
 {
 }
 
-void CGenericAlgorithmTransformation::updateData(CArray<double,1>& dataOut)
-{
-
-}
-
-void CGenericAlgorithmTransformation::apply(const std::vector<std::pair<int,double> >& localIndex,
-                                            const double* dataInput,
-                                            CArray<double,1>& dataOut,
-                                            std::vector<bool>& flagInitial,
-                                            bool ignoreMissingValue, bool firstPass  )
-TRY
-{
-  int nbLocalIndex = localIndex.size();   
-  double defaultValue = std::numeric_limits<double>::quiet_NaN();
-    
-  if (ignoreMissingValue)
-  {
-    if (firstPass) dataOut=defaultValue ;
-    
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
-    {
-      if (! NumTraits<double>::isNan(*(dataInput + idx)))
-      {
-        if (flagInitial[localIndex[idx].first]) dataOut(localIndex[idx].first) = *(dataInput + idx) * localIndex[idx].second;
-        else dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second;
-        flagInitial[localIndex[idx].first] = false; // Reset flag to indicate not all data source are nan
-      }
-    }
-
-  }
-  else
-  {
-    for (int idx = 0; idx < nbLocalIndex; ++idx)
-    {
-      dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second;
-    }
-  }
-}
-CATCH
-
-void CGenericAlgorithmTransformation::computePositionElements(CGrid* dst, CGrid* src)
-TRY
-{
-  int idxScalar = 0, idxAxis = 0, idxDomain = 0;
-  CArray<int,1> axisDomainOrderDst = dst->axis_domain_order;
-  for (int i = 0; i < axisDomainOrderDst.numElements(); ++i)
-  {
-    int dimElement = axisDomainOrderDst(i);
-    if (2 == dimElement)
-    {
-      elementPositionInGridDst2DomainPosition_[i] = idxDomain;
-      ++idxDomain;
-    }
-    else if (1 == dimElement)
-    {
-      elementPositionInGridDst2AxisPosition_[i] = idxAxis;
-      ++idxAxis;
-    }
-    else
-    {
-      elementPositionInGridDst2ScalarPosition_[i] = idxScalar;
-      ++idxScalar;
-    }
-  }
-
-  idxScalar = idxAxis = idxDomain = 0;
-  CArray<int,1> axisDomainOrderSrc = src->axis_domain_order;
-  for (int i = 0; i < axisDomainOrderSrc.numElements(); ++i)
-  {
-    int dimElement = axisDomainOrderSrc(i);
-    if (2 == dimElement)
-    {
-      elementPositionInGridSrc2DomainPosition_[i] = idxDomain;
-      ++idxDomain;
-    }
-    else if (1 == dimElement)
-    {
-      elementPositionInGridSrc2AxisPosition_[i] = idxAxis;
-      ++idxAxis;
-    }
-    else
-    {
-      elementPositionInGridSrc2ScalarPosition_[i] = idxScalar;
-      ++idxScalar;
-    }
-  }
-}
-CATCH
-
-bool CGenericAlgorithmTransformation::isDistributedTransformation(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst)
-TRY
-{
-
-  if (!isDistributedComputed_)
-  {
-    isDistributedComputed_=true ;
-    if (!eliminateRedondantSrc_) isDistributed_=true ;
-    else
-    {
-      CContext* context = CContext::getCurrent();
-        
-      computePositionElements(gridSrc, gridDst);
-      std::vector<CScalar*> scalarListSrcP  = gridSrc->getScalars();
-      std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
-      std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
-      int distributed, distributed_glo ;
-  
-      CArray<int,1> axisDomainSrcOrder = gridSrc->axis_domain_order;
-      if (2 == axisDomainSrcOrder(elementPositionInGrid)) // It's domain
-      {
-        distributed=domainListSrcP[elementPositionInGridSrc2DomainPosition_[elementPositionInGrid]]->isDistributed() ;
-        MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, context->intraComm_) ;
-    
-      }
-      else if (1 == axisDomainSrcOrder(elementPositionInGrid))//it's an axis
-      {
-        distributed=axisListSrcP[elementPositionInGridSrc2AxisPosition_[elementPositionInGrid]]->isDistributed() ;
-        MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, context->intraComm_) ;
-      }
-      else //it's a scalar
-      {
-        distributed_glo=false ;
-      } 
-      isDistributed_=distributed_glo ;
-    }
-  }
-  return isDistributed_ ;
-}
-CATCH
-
-/*!
-  This function computes the global indexes of grid source, which the grid destination is in demand.
-  \param[in] elementPositionInGrid position of an element in a grid .E.g: if grid is composed of domain and axis (in order),
-                then position of axis in grid is 1 and domain is positioned at 0.
-  \param[in] gridSrc Grid source
-  \param[in] gridDst Grid destination
-  \param[in\out] globaIndexWeightFromSrcToDst mapping of each global index source and weight to index destination
-*/
-void CGenericAlgorithmTransformation::computeGlobalSourceIndex(int elementPositionInGrid,
-                                                               CGrid* gridSrc,
-                                                               CGrid* gridDst,
-                                                               SourceDestinationIndexMap& globaIndexWeightFromSrcToDst)
-TRY
- {
-  CContext* context = CContext::getCurrent();
-  int nbClient = context->intraCommSize_;
-
-  typedef std::unordered_map<int, std::vector<std::pair<int,double> > > SrcToDstMap;
-  int idx;
-
-  // compute position of elements on grids
-  computePositionElements(gridDst, gridSrc);
-  std::vector<CScalar*> scalarListDestP = gridDst->getScalars();
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CDomain*> domainListDestP = gridDst->getDomains();
-  CArray<int,1> axisDomainDstOrder = gridDst->axis_domain_order;
-  std::vector<CScalar*> scalarListSrcP  = gridSrc->getScalars();
-  std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
-  std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
-  CArray<int,1> axisDomainSrcOrder = gridSrc->axis_domain_order;  
-  
-  bool isTransPosEmpty = transformationPosition_.empty();
-  CArray<size_t,1> transPos;
-  if (!isTransPosEmpty) transPos.resize(transformationMapping_.size());
-  std::set<size_t> allIndexSrc; // All index of source, which can be scattered among processes, need for doing transformation 
-  
-  for (size_t idxTrans = 0; idxTrans < transformationMapping_.size(); ++idxTrans)
-  {
-    TransformationIndexMap::const_iterator itbTransMap = transformationMapping_[idxTrans].begin(), itTransMap,
-                                           iteTransMap = transformationMapping_[idxTrans].end();
-    TransformationWeightMap::const_iterator itbTransWeight = transformationWeight_[idxTrans].begin(), itTransWeight;
-
-    // Build mapping between global source element index and global destination element index.
-    itTransWeight = itbTransWeight;
-    for (itTransMap = itbTransMap; itTransMap != iteTransMap; ++itTransMap, ++itTransWeight)
-    {
-      const std::vector<int>& srcIndex = itTransMap->second;
-      for (idx = 0; idx < srcIndex.size(); ++idx)
-        allIndexSrc.insert(srcIndex[idx]);
-    }
-
-    if (!isTransPosEmpty)
-    {
-      TransformationPositionMap::const_iterator itPosMap = transformationPosition_[idxTrans].begin();
-      transPos(idxTrans) = itPosMap->second[0];
-    }
-  }
-
-  size_t indexSrcSize = 0;
-  CArray<size_t,1> indexSrc(allIndexSrc.size());
-  for (std::set<size_t>::iterator it = allIndexSrc.begin(); it != allIndexSrc.end(); ++it, ++indexSrcSize)
-    indexSrc(indexSrcSize) = *it;
-
-  // Flag to indicate whether we will recompute distribution of source global index  on processes
-  bool computeGlobalIndexOnProc = false; 
-  if (indexElementSrc_.size() != allIndexSrc.size())
-    computeGlobalIndexOnProc = true;  
-  else
-  {
-    for (std::set<size_t>::iterator it = allIndexSrc.begin(); it != allIndexSrc.end(); ++it)
-      if (0 == indexElementSrc_.count(*it))
-      {
-        computeGlobalIndexOnProc = true;
-        break;        
-      }
-  }
-
-  if (computeGlobalIndexOnProc)
-    indexElementSrc_.swap(allIndexSrc);
-      
-  int sendValue = (computeGlobalIndexOnProc) ? 1 : 0;
-  int recvValue = 0;
-  MPI_Allreduce(&sendValue, &recvValue, 1, MPI_INT, MPI_SUM, context->intraComm_);
-  computeGlobalIndexOnProc = (0 < recvValue);
-
-//  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndexOfTransformedElementOnProc;
-
-  if (computeGlobalIndexOnProc || !computedProcSrcNonTransformedElement_)
-  {    
-    {
-      CClientClientDHTInt::Index2VectorInfoTypeMap tmp ;
-      globalIndexOfTransformedElementOnProc_.swap(tmp) ;
-    }
-    // Find out global index source of transformed element on corresponding process.    
-    if (globalElementIndexOnProc_.empty())
-      globalElementIndexOnProc_.resize(axisDomainDstOrder.numElements());
-    
-    for (idx = 0; idx < axisDomainDstOrder.numElements(); ++idx)
-    {
-      
-      if (idx == elementPositionInGrid)
-        computeExchangeGlobalIndex(indexSrc, axisDomainSrcOrder(idx), globalIndexOfTransformedElementOnProc_); //globalElementIndexOnProc[idx]);
-      if (!computedProcSrcNonTransformedElement_)
-      {
-        if (2 == axisDomainDstOrder(idx)) // It's domain
-        {
-          if (idx != elementPositionInGrid)
-            computeExchangeDomainIndex(domainListDestP[elementPositionInGridDst2DomainPosition_[idx]],
-                                       domainListSrcP[elementPositionInGridSrc2DomainPosition_[idx]],
-                                       transPos,
-                                       globalElementIndexOnProc_[idx]);      
-
-        }
-        else if (1 == axisDomainDstOrder(idx))//it's an axis
-        {
-          if (idx != elementPositionInGrid)
-            computeExchangeAxisIndex(axisListDestP[elementPositionInGridDst2AxisPosition_[idx]],
-                                     axisListSrcP[elementPositionInGridSrc2AxisPosition_[idx]],
-                                     transPos,
-                                     globalElementIndexOnProc_[idx]);
-        }
-        else //it's a scalar
-        {
-          if (idx != elementPositionInGrid)
-            computeExchangeScalarIndex(scalarListDestP[elementPositionInGridDst2ScalarPosition_[idx]],
-                                       scalarListSrcP[elementPositionInGridSrc2ScalarPosition_[idx]],
-                                       transPos,
-                                       globalElementIndexOnProc_[idx]);
-
-        }
-      }
-    }
-
-    if (!isTransPosEmpty && !computedProcSrcNonTransformedElement_)
-    {
-      for (idx = 0; idx < globalElementIndexOnProc_.size(); ++idx)
-      {
-        if (idx != elementPositionInGrid)
-        {
-          std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,
-                                                                   ite = globalElementIndexOnProc_[idx].end();
-          for (it = itb; it != ite; ++it) it->second.resize(1);
-        }
-      }
-    }
-
-/*      
-    if (!computedProcSrcNonTransformedElement_)
-    {
-      for (idx = 0; idx < globalElementIndexOnProc_.size(); ++idx)
-      {
-        if (idx != elementPositionInGrid)
-        {
-          std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,
-                                                                   ite = globalElementIndexOnProc_[idx].end();
-          for (it = itb; it != ite; ++it) procOfNonTransformedElements_.insert(it->first);
-          if (procOfNonTransformedElements_.size() == nbClient)
-            break;
-        }
-      }
-    }
-   
-    // Processes contain the source index of transformed element
-    std::set<int> procOfTransformedElement; 
-    CClientClientDHTInt::Index2VectorInfoTypeMap::iterator itIdxb = globalIndexOfTransformedElementOnProc.begin(),
-                                                           itIdxe = globalIndexOfTransformedElementOnProc.end(), itIdx;
-    for (itIdx = itIdxb; itIdx != itIdxe; ++itIdx)
-    {
-      std::vector<int>& tmp = itIdx->second;
-      for (int i = 0; i < tmp.size(); ++i)
-        procOfTransformedElement.insert(tmp[i]);
-      if (tmp.size() == nbClient)
-        break;
-    }                                                           
-    
-    std::set<int>& commonProc = (procOfTransformedElement.size() < procOfNonTransformedElements_.size()) ? procOfTransformedElement 
-                              : (!procOfNonTransformedElements_.empty() ? procOfNonTransformedElements_ : procOfTransformedElement);
-    
-    std::vector<int> procContainSrcElementIdx(commonProc.size());
-    int count = 0;
-    for (std::set<int>::iterator it = commonProc.begin(); it != commonProc.end(); ++it)
-      procContainSrcElementIdx[count++] = *it;
-
-    procContainSrcElementIdx_.swap(procContainSrcElementIdx);    
-*/
-    
-    if (procElementList_.empty()) procElementList_.resize(axisDomainDstOrder.numElements()) ;
-    for (idx = 0; idx < axisDomainDstOrder.numElements(); ++idx)
-    {
-      std::set<int>& procList=procElementList_[idx] ;
-      std::set<int> commonTmp ;
-      if (idx == elementPositionInGrid)
-      {
-          set<int> tmpSet ; 
-          procList.swap(tmpSet) ;
-          CClientClientDHTInt::Index2VectorInfoTypeMap::iterator itIdxb = globalIndexOfTransformedElementOnProc_.begin(),
-                                                                 itIdxe = globalIndexOfTransformedElementOnProc_.end(), itIdx;
-          for (itIdx = itIdxb; itIdx != itIdxe; ++itIdx)
-          {
-             std::vector<int>& tmp = itIdx->second;
-             for (int i = 0; i < tmp.size(); ++i) procList.insert(tmp[i]);
-             if (tmp.size() == nbClient)
-             break;
-          }
-      }
-      else
-      {
-        if (!computedProcSrcNonTransformedElement_)
-        {
-          set<int> tmpSet ; 
-          procList.swap(tmpSet) ;
-          std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,
-                                                                   ite = globalElementIndexOnProc_[idx].end();
-          for (it = itb; it != ite; ++it)
-          {
-            procList.insert(it->first);
-            if (procList.size() == nbClient)  break;
-          }
-        }
-      }
-
-      if (idx==0) commonProc_= procList ;
-      else
-      {
-        for (std::set<int>::iterator it = commonProc_.begin(); it != commonProc_.end(); ++it)
-          if (procList.count(*it)==1) commonTmp.insert(*it) ;
-        commonProc_.swap(commonTmp) ;
-      }
-    }
-    std::vector<int> procContainSrcElementIdx(commonProc_.size());
-    int count = 0;
-    for (std::set<int>::iterator it = commonProc_.begin(); it != commonProc_.end(); ++it) procContainSrcElementIdx[count++] = *it;
-    procContainSrcElementIdx_.swap(procContainSrcElementIdx);
-    
-        // For the first time, surely we calculate proc containing non transformed elements
-    if (!computedProcSrcNonTransformedElement_) computedProcSrcNonTransformedElement_ = true;
-  }
-  
-  for (size_t idxTrans = 0; idxTrans < transformationMapping_.size(); ++idxTrans)
-  {
-    TransformationIndexMap::const_iterator itbTransMap = transformationMapping_[idxTrans].begin(), itTransMap,
-                                           iteTransMap = transformationMapping_[idxTrans].end();
-    TransformationWeightMap::const_iterator itbTransWeight = transformationWeight_[idxTrans].begin(), itTransWeight;
-    SrcToDstMap src2DstMap;
-    src2DstMap.rehash(std::ceil(transformationMapping_[idxTrans].size()/src2DstMap.max_load_factor()));
-
-    // Build mapping between global source element index and global destination element index.
-    std::unordered_map<int,std::vector<size_t> >().swap(globalElementIndexOnProc_[elementPositionInGrid]);
-    std::set<int> tmpCounter;
-    itTransWeight = itbTransWeight;
-    for (itTransMap = itbTransMap; itTransMap != iteTransMap; ++itTransMap, ++itTransWeight)
-    {
-      const std::vector<int>& srcIndex = itTransMap->second;
-      const std::vector<double>& weight = itTransWeight->second;
-      for (idx = 0; idx < srcIndex.size(); ++idx)
-      {
-        src2DstMap[srcIndex[idx]].push_back(make_pair(itTransMap->first, weight[idx]));
-        if (0 == tmpCounter.count(srcIndex[idx]))
-        {          
-          tmpCounter.insert(srcIndex[idx]);
-       
-          vector<int>& rankSrc = globalIndexOfTransformedElementOnProc_[srcIndex[idx]] ;
-          for (int n=0;n<rankSrc.size();++n)
-          {
-            if (commonProc_.count(rankSrc[n])==1) globalElementIndexOnProc_[elementPositionInGrid][rankSrc[n]].push_back(srcIndex[idx]);
-          }
-//          for (int j = 0; j < procContainSrcElementIdx_.size(); ++j)
-//            globalElementIndexOnProc_[elementPositionInGrid][procContainSrcElementIdx_[j]].push_back(srcIndex[idx]);
-        }
-      }
-    }
-  
-    if (!isTransPosEmpty)
-    {
-      for (idx = 0; idx < globalElementIndexOnProc_.size(); ++idx)
-      {
-        if (idx != elementPositionInGrid)
-        {
-          std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it,
-                                                                   ite = globalElementIndexOnProc_[idx].end();
-          for (it = itb; it != ite; ++it) it->second[0] = transPos(idxTrans);
-        }
-      }
-    }
-
-    // Ok, now compute global index of grid source and ones of grid destination
-    computeGlobalGridIndexMapping(elementPositionInGrid,
-                                  procContainSrcElementIdx_, //srcRank,
-                                  src2DstMap,
-                                  gridSrc,
-                                  gridDst,
-                                  globalElementIndexOnProc_,
-                                  globaIndexWeightFromSrcToDst);
-  }  
- }
-CATCH
-
-/*!
-  Compute mapping of global index of grid source and grid destination
-  \param [in] elementPositionInGrid position of element in grid. E.x: grid composed of domain and axis, domain has position 0 and axis 1.
-  \param [in] srcRank rank of client from which we demand global index of element source
-  \param [in] src2DstMap mapping of global index of element source and global index of element destination
-  \param [in] gridSrc Grid source
-  \param [in] gridDst Grid destination
-  \param [in] globalElementIndexOnProc Global index of element source on different client rank
-  \param [out] globaIndexWeightFromSrcToDst Mapping of global index of grid source and grid destination
-*/
-void CGenericAlgorithmTransformation::computeGlobalGridIndexMapping(int elementPositionInGrid,
-                                                                   const std::vector<int>& srcRank,
-                                                                   std::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap,
-                                                                   CGrid* gridSrc,
-                                                                   CGrid* gridDst,
-                                                                   std::vector<std::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc,
-                                                                   SourceDestinationIndexMap& globaIndexWeightFromSrcToDst)
-TRY
-{
-  SourceDestinationIndexMap globaIndexWeightFromSrcToDst_tmp ;
-  
-  CContext* context = CContext::getCurrent();
-  int clientRank = context->intraCommRank_;
-  
-  std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
-  std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
-  std::vector<CScalar*> scalarListSrcP = gridSrc->getScalars();
-  CArray<int,1> axisDomainSrcOrder = gridSrc->axis_domain_order;
-
-  size_t nbElement = axisDomainSrcOrder.numElements();
-  std::vector<size_t> nGlobSrc(nbElement);
-  size_t globalSrcSize = 1;
-  int domainIndex = 0, axisIndex = 0, scalarIndex = 0;
-  for (int idx = 0; idx < nbElement; ++idx)
-  {
-    nGlobSrc[idx] = globalSrcSize;
-    int elementDimension = axisDomainSrcOrder(idx);
-
-    // If this is a domain
-    if (2 == elementDimension)
-    {
-      globalSrcSize *= domainListSrcP[domainIndex]->nj_glo.getValue() * domainListSrcP[domainIndex]->ni_glo.getValue();
-      ++domainIndex;
-    }
-    else if (1 == elementDimension) // So it's an axis
-    {
-      globalSrcSize *= axisListSrcP[axisIndex]->n_glo.getValue();
-      ++axisIndex;
-    }
-    else
-    {
-      globalSrcSize *= 1;
-      ++scalarIndex;
-    }
-  }
-
-  std::vector<CDomain*> domainListDestP = gridDst->getDomains();
-  std::vector<CAxis*> axisListDestP = gridDst->getAxis();
-  std::vector<CScalar*> scalarListDestP = gridDst->getScalars();
-  CArray<int,1> axisDomainDstOrder = gridDst->axis_domain_order;
-
-  std::vector<size_t> nGlobDst(nbElement);
-  size_t globalDstSize = 1;
-  domainIndex = axisIndex = scalarIndex = 0;
-  set<size_t>  globalSrcStoreIndex ;
-  
-  for (int idx = 0; idx < nbElement; ++idx)
-  {
-    nGlobDst[idx] = globalDstSize;
-    int elementDimension = axisDomainDstOrder(idx);
-
-    // If this is a domain
-    if (2 == elementDimension)
-    {
-      globalDstSize *= domainListDestP[domainIndex]->nj_glo.getValue() * domainListDestP[domainIndex]->ni_glo.getValue();
-      ++domainIndex;
-    }
-    else if (1 == elementDimension) // So it's an axis
-    {
-      globalDstSize *= axisListDestP[axisIndex]->n_glo.getValue();
-      ++axisIndex;
-    }
-    else
-    {
-      globalDstSize *= 1;
-      ++scalarIndex;
-    }
-  }
-
-  std::map< std::pair<size_t,size_t>, int > rankMap ;
-  std::map< std::pair<size_t,size_t>, int >:: iterator rankMapIt ;
-  
-  for (int i = 0; i < srcRank.size(); ++i)
-  {
-    size_t ssize = 1;
-    int rankSrc = srcRank[i];
-    for (int idx = 0; idx < nbElement; ++idx)
-    {
-      ssize *= (globalElementIndexOnProc[idx][rankSrc]).size();
-    }
-
-    std::vector<int> idxLoop(nbElement,0);
-    std::vector<int> currentIndexSrc(nbElement, 0);
-    std::vector<int> currentIndexDst(nbElement, 0);
-    int innnerLoopSize = (globalElementIndexOnProc[0])[rankSrc].size();
-    size_t idx = 0;
-    while (idx < ssize)
-    {
-      for (int ind = 0; ind < nbElement; ++ind)
-      {
-        if (idxLoop[ind] == (globalElementIndexOnProc[ind])[rankSrc].size())
-        {
-          idxLoop[ind] = 0;
-          ++idxLoop[ind+1];
-        }
-
-        currentIndexDst[ind] = currentIndexSrc[ind] = (globalElementIndexOnProc[ind])[rankSrc][idxLoop[ind]];
-      }
-
-      for (int ind = 0; ind < innnerLoopSize; ++ind)
-      {
-        currentIndexDst[0] = currentIndexSrc[0] = (globalElementIndexOnProc[0])[rankSrc][ind];
-        int globalElementDstIndexSize = 0;
-        if (1 == src2DstMap.count(currentIndexSrc[elementPositionInGrid]))
-        {
-          globalElementDstIndexSize = src2DstMap[currentIndexSrc[elementPositionInGrid]].size();
-        }
-
-        std::vector<size_t> globalDstVecIndex(globalElementDstIndexSize,0);
-        size_t globalSrcIndex = 0;
-        for (int idxElement = 0; idxElement < nbElement; ++idxElement)
-        {
-          if (idxElement == elementPositionInGrid)
-          {
-            for (int k = 0; k < globalElementDstIndexSize; ++k)
-            {
-              globalDstVecIndex[k] += src2DstMap[currentIndexSrc[elementPositionInGrid]][k].first * nGlobDst[idxElement];
-            }
-          }
-          else
-          {
-            for (int k = 0; k < globalElementDstIndexSize; ++k)
-            {
-              globalDstVecIndex[k] += currentIndexDst[idxElement] * nGlobDst[idxElement];
-            }
-          }
-          globalSrcIndex += currentIndexSrc[idxElement] * nGlobSrc[idxElement];
-        }
-
-        for (int k = 0; k < globalElementDstIndexSize; ++k)
-        {
-          
-          globaIndexWeightFromSrcToDst_tmp[rankSrc][globalSrcIndex].push_back(make_pair(globalDstVecIndex[k],src2DstMap[currentIndexSrc[elementPositionInGrid]][k].second ));
-          rankMapIt=rankMap.find(make_pair(globalSrcIndex,globalDstVecIndex[k])) ;
-          if (rankMapIt==rankMap.end()) rankMap[make_pair(globalSrcIndex,globalDstVecIndex[k])] = rankSrc ;
-          else if (rankSrc==clientRank) rankMapIt->second = rankSrc ;
-        }
-        ++idxLoop[0];
-      }
-      idx += innnerLoopSize;
-    }
-  }
-
-  // eliminate redondant global src point owned by differrent processes.
-  // Avoid as possible to tranfer data from an other process if the src point is also owned by current process 
-      int rankSrc ;
-      size_t globalSrcIndex ;
-      size_t globalDstIndex ;
-      double weight ;
- 
-      SourceDestinationIndexMap::iterator rankIt,rankIte ;
-      std::unordered_map<size_t, std::vector<std::pair<size_t,double> > >::iterator globalSrcIndexIt, globalSrcIndexIte ;
-      std::vector<std::pair<size_t,double> >::iterator vectIt,vectIte ;
-   
-      rankIt=globaIndexWeightFromSrcToDst_tmp.begin() ; rankIte=globaIndexWeightFromSrcToDst_tmp.end() ;
-      for(;rankIt!=rankIte;++rankIt)
-      {
-        rankSrc = rankIt->first ;
-        globalSrcIndexIt = rankIt->second.begin() ; globalSrcIndexIte = rankIt->second.end() ;
-        for(;globalSrcIndexIt!=globalSrcIndexIte;++globalSrcIndexIt)
-        { 
-          globalSrcIndex = globalSrcIndexIt->first ;
-          vectIt = globalSrcIndexIt->second.begin() ; vectIte = globalSrcIndexIt->second.end() ;
-          for(vectIt; vectIt!=vectIte; vectIt++)
-          {
-            globalDstIndex = vectIt->first ;
-            weight = vectIt->second ;
-            if (eliminateRedondantSrc_)
-            {
-              if (rankMap[make_pair(globalSrcIndex,globalDstIndex)] == rankSrc)  
-                globaIndexWeightFromSrcToDst[rankSrc][globalSrcIndex].push_back(make_pair(globalDstIndex,weight)) ;
-            }
-            else globaIndexWeightFromSrcToDst[rankSrc][globalSrcIndex].push_back(make_pair(globalDstIndex,weight)) ;
-         }
-       }
-     }
-}
-CATCH
-
-/*!
-  Find out proc and global index of axis source which axis destination is on demande
-  \param[in] scalar Scalar destination
-  \param[in] scalar Scalar source
-  \param[in] destGlobalIndexPositionInGrid Relative position of axis corresponds to other element of grid.
-  \param[out] globalScalarIndexOnProc Global index of axis source on different procs
-*/
-void CGenericAlgorithmTransformation::computeExchangeScalarIndex(CScalar* scalarDst,
-                                                                 CScalar* scalarSrc,
-                                                                 CArray<size_t,1>& destGlobalIndexPositionInGrid,
-                                                                 std::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  int clientRank = context->intraCommRank_;
-  int clientSize = context->intraCommSize_;
-
-  globalScalarIndexOnProc.rehash(std::ceil(clientSize/globalScalarIndexOnProc.max_load_factor()));
-  for (int idx = 0; idx < clientSize; ++idx)
-  {
-    globalScalarIndexOnProc[idx].push_back(0);
-  }
-}
-CATCH
-
-/*!
-  Find out proc and global index of axis source which axis destination is on demande
-  \param[in] axisDst Axis destination
-  \param[in] axisSrc Axis source
-  \param[in] destGlobalIndexPositionInGrid Relative position of axis corresponds to other element of grid.
-  \param[out] globalAxisIndexOnProc Global index of axis source on different procs
-*/
-void CGenericAlgorithmTransformation::computeExchangeAxisIndex(CAxis* axisDst,
-                                                               CAxis* axisSrc,
-                                                               CArray<size_t,1>& destGlobalIndexPositionInGrid,
-                                                               std::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  int clientRank = context->intraCommRank_;
-  int clientSize = context->intraCommSize_;
-
-  size_t globalIndex;
-  int nIndexSize = axisSrc->index.numElements();
-  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-  globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-  for (int idx = 0; idx < nIndexSize; ++idx)
-  {
-    if (axisSrc->mask(idx))
-    {
-      globalIndex = axisSrc->index(idx);
-      globalIndex2ProcRank[globalIndex].push_back(clientRank);
-    }
-  }
-
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
-  CArray<size_t,1> globalAxisIndex(axisDst->index.numElements());
-  for (int idx = 0; idx < globalAxisIndex.numElements(); ++idx)
-  {
-    globalAxisIndex(idx) = axisDst->index(idx);
-  }
-  dhtIndexProcRank.computeIndexInfoMapping(globalAxisIndex);
-
-  std::vector<int> countIndex(clientSize,0);
-  const CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap();
-  CClientClientDHTInt::Index2VectorInfoTypeMap::const_iterator itb = computedGlobalIndexOnProc.begin(), it,
-                                                               ite = computedGlobalIndexOnProc.end();
-  for (it = itb; it != ite; ++it)
-  {
-    const std::vector<int>& procList = it->second;
-    for (int idx = 0; idx < procList.size(); ++idx) ++countIndex[procList[idx]];
-  }
-
-  globalAxisIndexOnProc.rehash(std::ceil(clientSize/globalAxisIndexOnProc.max_load_factor()));
-  for (int idx = 0; idx < clientSize; ++idx)
-  {
-    if (0 != countIndex[idx])
-    {
-      globalAxisIndexOnProc[idx].resize(countIndex[idx]);
-      countIndex[idx] = 0;
-    }
-  }
-
-  for (it = itb; it != ite; ++it)
-  {
-    const std::vector<int>& procList = it->second;
-    for (int idx = 0; idx < procList.size(); ++idx)
-    {
-      globalAxisIndexOnProc[procList[idx]][countIndex[procList[idx]]] = it->first;
-      ++countIndex[procList[idx]];
-    }
-  }
-}
-CATCH
-
-/*!
-  Find out proc and global index of domain source which domain destination is on demande
-  \param[in] domainDst Domain destination
-  \param[in] domainSrc Domain source
-  \param[in] destGlobalIndexPositionInGrid Relative position of domain corresponds to other element of grid.
-  \param[out] globalDomainIndexOnProc Global index of domain source on different procs
-*/
-void CGenericAlgorithmTransformation::computeExchangeDomainIndex(CDomain* domainDst,
-                                                                 CDomain* domainSrc,
-                                                                 CArray<size_t,1>& destGlobalIndexPositionInGrid,
-                                                                 std::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  int clientRank = context->intraCommRank_;
-  int clientSize = context->intraCommSize_;
-
-  int niGlobSrc = domainSrc->ni_glo.getValue();
-  size_t globalIndex;
-  int i_ind, j_ind;
-  int nIndexSize = (destGlobalIndexPositionInGrid.isEmpty()) ? domainSrc->i_index.numElements()
-                                                             : destGlobalIndexPositionInGrid.numElements();
-  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-  globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-  
-  if (destGlobalIndexPositionInGrid.isEmpty())
-  {
-    for (int idx = 0; idx < nIndexSize; ++idx)
-    {
-      i_ind=domainSrc->i_index(idx) ;
-      j_ind=domainSrc->j_index(idx) ;
-
-      if (domainSrc->localMask(idx))
-      {
-        globalIndex = i_ind + j_ind * niGlobSrc;
-        globalIndex2ProcRank[globalIndex].resize(1);
-        globalIndex2ProcRank[globalIndex][0] = clientRank;
-      }
-    }
-  }
-  else
-  {
-    for (int idx = 0; idx < nIndexSize; ++idx)
-    {
-//      if (domainSrc->localMask(idx)) -> not necessairy, mask seem to be included in  destGlobalIndexPositionInGrid(idx)    (ym)
-        globalIndex2ProcRank[destGlobalIndexPositionInGrid(idx)].push_back(clientRank);
-    }
-  }
-
-  CArray<size_t,1> globalDomainIndex;
-  if (destGlobalIndexPositionInGrid.isEmpty())
-  {
-    int niGlobDst = domainDst->ni_glo.getValue();
-    globalDomainIndex.resize(domainDst->i_index.numElements());
-    nIndexSize = domainDst->i_index.numElements();
-
-    for (int idx = 0; idx < nIndexSize; ++idx)
-    {
-      i_ind=domainDst->i_index(idx) ;
-      j_ind=domainDst->j_index(idx) ;
-
-      globalDomainIndex(idx) = i_ind + j_ind * niGlobDst;
-    }
-  }
-  else
-  {
-    globalDomainIndex.reference(destGlobalIndexPositionInGrid);
-  }
-
-  CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
-  dhtIndexProcRank.computeIndexInfoMapping(globalDomainIndex);
-
-  std::vector<int> countIndex(clientSize,0);
-  const CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap();
-  CClientClientDHTInt::Index2VectorInfoTypeMap::const_iterator itb = computedGlobalIndexOnProc.begin(), it,
-                                                               ite = computedGlobalIndexOnProc.end();
-  for (it = itb; it != ite; ++it)
-  {
-    const std::vector<int>& procList = it->second;
-    for (int idx = 0; idx < procList.size(); ++idx) ++countIndex[procList[idx]];
-  }
-
-  globalDomainIndexOnProc.rehash(std::ceil(clientSize/globalDomainIndexOnProc.max_load_factor()));
-  for (int idx = 0; idx < clientSize; ++idx)
-  {
-    if (0 != countIndex[idx])
-    {
-      globalDomainIndexOnProc[idx].resize(countIndex[idx]);
-      countIndex[idx] = 0;
-    }
-  }
-
-  for (it = itb; it != ite; ++it)
-  {
-    const std::vector<int>& procList = it->second;
-    for (int idx = 0; idx < procList.size(); ++idx)
-    {
-      globalDomainIndexOnProc[procList[idx]][countIndex[procList[idx]]] = it->first;
-      ++countIndex[procList[idx]];
-    }
-  }
-}
-CATCH
-
-void CGenericAlgorithmTransformation::computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst,
-                                                                                 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight,
-                                                                                 int& nlocalIndexDest)
-TRY
-{
-
-  CContext* context = CContext::getCurrent();
-  int nbClient = context->intraCommSize_;
-
-  computePositionElements(gridDst, gridSrc);
-  std::vector<CScalar*> scalarListDstP = gridDst->getScalars();
-  std::vector<CAxis*> axisListDstP = gridDst->getAxis();
-  std::vector<CDomain*> domainListDstP = gridDst->getDomains();
-  CArray<int,1> axisDomainDstOrder = gridDst->axis_domain_order;
-  std::vector<CScalar*> scalarListSrcP  = gridSrc->getScalars();
-  std::vector<CAxis*> axisListSrcP = gridSrc->getAxis();
-  std::vector<CDomain*> domainListSrcP = gridSrc->getDomains();
-  CArray<int,1> axisDomainSrcOrder = gridSrc->axis_domain_order;  
-
-  int nElement=axisDomainSrcOrder.numElements() ;
-  int indSrc=1 ;
-  int indDst=1 ;
-  vector<int> nIndexSrc(nElement) ;
-  vector<int> nIndexDst(nElement) ;
-  vector< CArray<bool,1>* > maskSrc(nElement) ;
-  vector< CArray<bool,1>* > maskDst(nElement) ;
-    
-  int nlocalIndexSrc=1 ;
-//  int nlocalIndexDest=1 ;
-  nlocalIndexDest=1 ;
-  CArray<bool,1> maskScalar(1) ;
-  maskScalar  = true ;
-  
-  
-  for(int i=0 ; i<nElement; i++)
-  {
-    int dimElement = axisDomainSrcOrder(i);
-    if (2 == dimElement) //domain
-    {
-      CDomain* domain=domainListSrcP[elementPositionInGridSrc2DomainPosition_[i]] ;
-      nIndexSrc[i] = domain->i_index.numElements() ;
-      maskSrc[i]=&domain->localMask ;
-    }
-    else if (1 == dimElement) //axis
-    {
-      CAxis* axis=axisListSrcP[elementPositionInGridSrc2AxisPosition_[i]] ;
-      nIndexSrc[i] = axis->index.numElements() ;
-      maskSrc[i]=&axis->mask ;
-    }
-    else  //scalar
-    {
-      nIndexSrc[i]=1 ;
-      maskSrc[i]=&maskScalar ;
-    }
-    nlocalIndexSrc=nlocalIndexSrc*nIndexSrc[i] ;
-  }
-
-
-
-  int offset=1 ;
-  for(int i=0 ; i<nElement; i++)
-  {
-    int dimElement = axisDomainDstOrder(i);
-    if (2 == dimElement) //domain
-    {
-      CDomain* domain=domainListDstP[elementPositionInGridDst2DomainPosition_[i]] ;
-      int nIndex=domain->i_index.numElements() ;
-      CArray<bool,1>& localMask=domain->localMask ;
-      int nbInd=0 ;
-      for(int j=0;j<nIndex;j++) if (localMask(j)) nbInd++ ;
-      nIndexDst[i] = nbInd ;
-      maskDst[i]=&domain->localMask ;
-    }
-    else if (1 == dimElement) //axis
-    {
-      CAxis* axis = axisListDstP[elementPositionInGridDst2AxisPosition_[i]] ;
-      int nIndex=axis->index.numElements() ;
-      CArray<bool,1>& localMask=axis->mask ;
-      int nbInd=0 ;
-      for(int j=0;j<nIndex;j++) if (localMask(j)) nbInd++ ;
-      nIndexDst[i] = nbInd ;
-      maskDst[i]=&axis->mask ;
-    }
-    else  //scalar
-    {
-      nIndexDst[i]=1 ;
-      maskDst[i]=&maskScalar ;
-    }
-    if (i<elementPositionInGrid) offset=offset*nIndexDst[i] ;
-    nlocalIndexDest=nlocalIndexDest*nIndexDst[i] ;
-  }
-
-  vector<int> dstLocalInd ;
-  int dimElement = axisDomainDstOrder(elementPositionInGrid);
-  if (2 == dimElement) //domain
-  {
-    CDomain* domain = domainListDstP[elementPositionInGridDst2DomainPosition_[elementPositionInGrid]] ;
-    int ni_glo=domain->ni_glo ;
-    int nj_glo=domain->nj_glo ;
-    int nindex_glo=ni_glo*nj_glo ;
-    dstLocalInd.resize(nindex_glo,-1) ;
-    int nIndex=domain->i_index.numElements() ;
-    CArray<bool,1>& localMask=domain->localMask ;
-    int unmaskedInd=0 ;
-    int globIndex ;
-    for(int i=0;i<nIndex;i++)
-    {
-      if (localMask(i))
-      {
-        globIndex=domain->j_index(i)*ni_glo+domain->i_index(i) ;
-        dstLocalInd[globIndex]=unmaskedInd ;
-        unmaskedInd++ ;
-      }
-    }
-  }
-  else if (1 == dimElement) //axis
-  {
-    CAxis* axis = axisListDstP[elementPositionInGridDst2AxisPosition_[elementPositionInGrid]] ;
-    int nindex_glo=axis->n_glo ;
-    dstLocalInd.resize(nindex_glo,-1) ;
-    int nIndex=axis->index.numElements() ;
-    CArray<bool,1>& localMask=axis->mask ; // axis mask must include later data_index
-    int unmaskedInd=0 ;
-    for(int i=0;i<nIndex;i++)
-    {
-      if (localMask(i))
-      {
-        dstLocalInd[axis->index(i)]=unmaskedInd ;
-        unmaskedInd++ ;
-      }
-    }
-  }
-  else  //scalar
-  {
-    dstLocalInd.resize(1) ; 
-    dstLocalInd[0]=0 ; 
-  }
-
-  vector<vector<vector<pair<int,double> > > > dstIndWeight(transformationMapping_.size()) ;
-   
-  for(int t=0;t<transformationMapping_.size();++t)
-  {
-    TransformationIndexMap::const_iterator   itTransMap = transformationMapping_[t].begin(),
-                                             iteTransMap = transformationMapping_[t].end();
-    TransformationWeightMap::const_iterator itTransWeight = transformationWeight_[t].begin();
-    dstIndWeight[t].resize(nIndexSrc[elementPositionInGrid]) ;
-    
-    for(;itTransMap!=iteTransMap;++itTransMap,++itTransWeight)
-    {
-      int dst=dstLocalInd[itTransMap->first] ;
-      if (dst!=-1)
-      {
-        const vector<int>& srcs=itTransMap->second;
-        const vector<double>& weights=itTransWeight->second;
-        for(int i=0;i<srcs.size() ;i++) dstIndWeight[t][srcs[i]].push_back(pair<int,double>(dst*offset+t,weights[i])) ;
-      }
-    }
-  }
-  int srcInd=0 ;  
-  int currentInd ;
-  int t=0 ;  
-  int srcIndCompressed=0 ;
-  
-  nonDistributedrecursiveFunct(nElement-1,true,elementPositionInGrid,maskSrc,maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight,  
-                               currentInd,localSrc,localDst,weight);
-               
-}
-CATCH
-
-
-void CGenericAlgorithmTransformation::nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid,
-                                                                   vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst,
-                                                                   int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc,
-                                                                   int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd,
-                                                                   vector<int>& localSrc, vector<int>& localDst, vector<double>& weight)
-TRY
-{
-  int masked_ ;
-  if (currentPos!=elementPositionInGrid)
-  {
-    if (currentPos!=0)
-    {
-      CArray<bool,1>& mask = *maskSrc[currentPos] ;
-     
-      for(int i=0;i<nIndexSrc[currentPos];i++)
-      {
-        masked_=masked ;
-        if (!mask(i)) masked_=false ;
-        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t,
-                                     dstIndWeight, currentInd, localSrc, localDst, weight);
-      }
-    }
-    else
-    {
-      CArray<bool,1>& mask = *maskSrc[currentPos] ;
-      for(int i=0;i<nIndexSrc[currentPos];i++)
-      {
-        if (masked && mask(i))
-        {
-          if (dstIndWeight[t][currentInd].size()>0)
-          {
-            for(vector<pair<int,double> >::iterator it = dstIndWeight[t][currentInd].begin(); it!=dstIndWeight[t][currentInd].end(); ++it)
-            {
-              localSrc.push_back(srcIndCompressed) ;
-              localDst.push_back(it->first) ;
-              weight.push_back(it->second) ;
-              (it->first)++ ;
-            }
-          }
-          if (t < dstIndWeight.size()-1) t++ ;
-            srcIndCompressed ++ ;
-        }
-        srcInd++ ;
-      }
-    }
-  }
-  else
-  {
- 
-    if (currentPos!=0)
-    {
-
-      CArray<bool,1>& mask = *maskSrc[currentPos] ;
-      for(int i=0;i<nIndexSrc[currentPos];i++)
-      {
-        t=0 ;
-        masked_=masked ;
-        if (!mask(i)) masked_=false ; 
-        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd,
-                                     srcIndCompressed, nIndexSrc, t, dstIndWeight , i,  localSrc, localDst, weight);
-      }
-    }
-    else
-    {
-      for(int i=0;i<nIndexSrc[currentPos];i++)
-      {
-        if (masked)
-        {
-          t=0 ;        
-          if (dstIndWeight[t][i].size()>0)
-          {
-            for(vector<pair<int,double> >::iterator it = dstIndWeight[t][i].begin(); it!=dstIndWeight[t][i].end(); ++it)
-            {
-              localSrc.push_back(srcIndCompressed) ;
-              localDst.push_back(it->first) ;
-              weight.push_back(it->second) ;
-              (it->first)++ ;
-            }
-           }
-          if (t < dstIndWeight.size()-1) t++ ;
-          srcIndCompressed ++ ;
-        }
-        srcInd++ ;
-      }
-    }
-  }
-
-}
-CATCH
-
-/*!
-  Compute index mapping between element source and element destination with an auxiliary inputs which determine
-position of each mapped index in global index of grid destination.
-  \param [in] dataAuxInputs auxiliary inputs
-*/
-void CGenericAlgorithmTransformation::computeIndexSourceMapping(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  computeIndexSourceMapping_(dataAuxInputs);
-}
-CATCH
-
-std::vector<StdString> CGenericAlgorithmTransformation::getIdAuxInputs()
-TRY
-{
-  return idAuxInputs_;
-}
-CATCH
-
-CGenericAlgorithmTransformation::AlgoTransType CGenericAlgorithmTransformation::type()
-TRY
-{
-  return type_;
-}
-CATCH
 
 
@@ -1154,11 +42,11 @@
 CTransformFilter* CGenericAlgorithmTransformation::createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue)
 {
-  return new CTransformFilter(gc, algo, detectMissingValues, defaultValue) ;
+  return new CTransformFilter(gc, 1, algo, detectMissingValues, defaultValue) ;
 }
 
-void CGenericAlgorithmTransformation::apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut)
+vector<string> CGenericAlgorithmTransformation::getAuxFieldId(void) 
 {
-  // tranform into pure virtual funtion later
-  abort() ;
+  return vector<string>() ;
 }
+
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/generic_algorithm_transformation.hpp	(revision 2011)
@@ -34,160 +34,19 @@
 class CGenericAlgorithmTransformation
 {
-public:
-  enum AlgoTransType {
-    ELEMENT_GENERATION = 0,
-    ELEMENT_MODIFICATION_WITHOUT_DATA = 1,
-    ELEMENT_MODIFICATION_WITH_DATA = 2,
-    ELEMENT_NO_MODIFICATION_WITH_DATA = 3,
-    ELEMENT_NO_MODIFICATION_WITHOUT_DATA = 4
-  } ;
-
-public:
-  // Mapping between global index map of DESTINATION and its local index with pair of global index of SOURCE and weights
-  typedef std::unordered_map<int, std::unordered_map<size_t, std::vector<std::pair<size_t,double> > > > SourceDestinationIndexMap;
-
-protected:
-  typedef std::unordered_map<size_t,int> GlobalLocalMap;
-protected:
-  typedef std::unordered_map<int, std::vector<int> > TransformationIndexMap;
-  typedef std::unordered_map<int, std::vector<double> > TransformationWeightMap;
-  typedef std::unordered_map<int, std::vector<int> > TransformationPositionMap;
-
-public:
-  //CGenericAlgorithmTransformation();
-  CGenericAlgorithmTransformation(bool isSource);
-
-  virtual ~CGenericAlgorithmTransformation() {}
-
-  bool isDistributedTransformation(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst) ;
-
-  void computeGlobalSourceIndex(int elementPositionInGrid,
-                               CGrid* gridSrc,
-                               CGrid* gridDst,
-                               SourceDestinationIndexMap& globaIndexWeightFromSrcToDst);
-
-    /*!
-    Apply a operation on local data.
-    \param [in] localIndex vector contains local index of local data output and the corresponding weight
-    \param [in] dataInput Pointer to the first element of data input array (in form of buffer)
-    \param [in/out] dataOut Array contains local data
-    \param [in/out] flagInitial vector of boolean to mark the local index already initialized. True means there is a need for initalization
-    \param [in] ignoreMissingValue don't count missing value in operation if this flag is true
-    \param [in] firstPass indicate if it is the first time the apply funtion is called for a same transformation, in order to make a clean initialization 
-  */
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,                     
-                     bool ignoreMissingValue, bool firstPass);
-
-  /*!
-   * Update whole dataOut (on necessary).
-   * (Example:  Impose a weight, whose value is only known after being applied an operation, on dataOut)
-   * \param [in/out] dataOut dataOut
-   */
-  virtual void updateData(CArray<double,1>& dataOut);
-
-  std::vector<StdString> getIdAuxInputs();
-  AlgoTransType type();
-  /*!
-  Compute global index mapping from one element of destination grid to the corresponding element of source grid
-  */
-  void computeIndexSourceMapping(const std::vector<CArray<double,1>* >& dataAuxInputs = std::vector<CArray<double,1>* >());
-  void computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst,
-                                                  vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, int& nbLocalIndexOnGridDest);
-  void nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid,  vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst,
-                                    int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc,
-                                    int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd,
-                                    vector<int>& localSrc, vector<int>& localDst, vector<double>& weight) ;
-
-protected:
-  virtual void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&) {};
-
-  /*!
-  Compute proc which contains global index of an element
-    \param[in] globalElementIndex demanding global index of an element of source grid
-    \param[in] elementType type of source element, 2: domain, 1: axis and 0: scalar
-    \param[out] globalElementIndexOnProc Proc contains the demanding global index
-  */
-  virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalElementIndex,
-                                          int elementType,
-                                          CClientClientDHTInt::Index2VectorInfoTypeMap& globalElementIndexOnProc){};
-
-protected:
-  void computeGlobalGridIndexMapping(int elementPositionInGrid,
-                                     const std::vector<int>& srcRank,
-                                     std::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap,
-                                     CGrid* gridDst,
-                                     CGrid* gridSrc,
-                                     std::vector<std::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc,
-                                     SourceDestinationIndexMap& globaIndexWeightFromSrcToDst);
-
-  void computeExchangeDomainIndex(CDomain* domainDst,
-                                  CDomain* domainSrc,
-                                  CArray<size_t,1>& destGlobalIndexPositionInGrid,
-                                  std::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc);
-
-  void computeExchangeAxisIndex(CAxis* axisDst,
-                                CAxis* axisSrc,
-                                CArray<size_t,1>& destGlobalIndexPositionInGrid,
-                                std::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc);
-
-  void computeExchangeScalarIndex(CScalar* scalarDst,
-                                  CScalar* scalarSrc,
-                                  CArray<size_t,1>& destGlobalIndexPositionInGrid,
-                                  std::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc);
-
-  void computePositionElements(CGrid* dst, CGrid* src);
-
-protected:
-  //! indicate if the transformation is performed on a distributed element
-  bool isDistributed_ ;
-  //! indicate if the method  isDistributedTransformation has been called before
-  bool isDistributedComputed_ ;
-  
-  //! Map between global index of destination element and source element
-  std::vector<TransformationIndexMap> transformationMapping_;
-  //! Weight corresponding of source to destination
-  std::vector<TransformationWeightMap> transformationWeight_;
-  //! Map of global index of destination element and corresponding global index of other elements in the same grid
-  //! By default, one index of an element corresponds to all index of remaining element in the grid. So it's empty
-  std::vector<TransformationPositionMap> transformationPosition_;
-
-  //! Id of auxillary inputs which helps doing transformation dynamically
-  std::vector<StdString> idAuxInputs_;
-  AlgoTransType type_;
-
-  std::set<StdSize> indexElementSrc_;
-
-  std::vector<std::unordered_map<int,std::vector<size_t> > > globalElementIndexOnProc_;
-
-  std::vector<int> procContainSrcElementIdx_;  // List of processes containing source index of transformed elements
-//  std::set<int> procOfNonTransformedElements_; // Processes contain the source index of non-transformed elements
-  std::set<int> commonProc_;
-  std::vector< set<int> > procElementList_ ; // List of processes containing source index of elements
-
-  CClientClientDHTInt::Index2VectorInfoTypeMap globalIndexOfTransformedElementOnProc_;
-  
-  bool computedProcSrcNonTransformedElement_; // Flag to indicate whether we computed proc containing non transformed elements
-
-  std::map<int, int> elementPositionInGridSrc2AxisPosition_, elementPositionInGridSrc2DomainPosition_, elementPositionInGridSrc2ScalarPosition_;
-  std::map<int, int> elementPositionInGridDst2AxisPosition_, elementPositionInGridDst2DomainPosition_, elementPositionInGridDst2ScalarPosition_;
-
-  bool eliminateRedondantSrc_ ; // flag to indicate if the transformation must select only one global source point for all proc.
-                               // In this case it will choose preferentially the current process 
-  bool isSource_ ; //flag to indicate that the algorithm is a source algorithm, that mean the grid is modified or generated but 
-                   // no fluxes are tranformed
-  
-// new methods for new algorithm
-
   public : 
-  
+    CGenericAlgorithmTransformation(bool isSource) ;
     virtual CGridAlgorithm* createGridAlgorithm(CGrid* gridSrc, CGrid* newGrid, int pos) ;
     virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, CGridAlgorithm* algo, bool detectMissingValues, double defaultValue) ;
-    virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut); // transform into pure virtual function later
+    virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) { abort() ;} //=0
+    virtual void apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, const vector<CArray<double,1>>& auxData, CArray<double,1>& dataOut) { abort() ;} //=0
+    
+    virtual vector<string> getAuxFieldId(void) ;
   protected :
+    typedef std::unordered_map<int, std::vector<int> > TransformationIndexMap;
+    typedef std::unordered_map<int, std::vector<double> > TransformationWeightMap;
+ 
+    CLocalElement* recvElement_=nullptr ;
+    bool isSource_ ;
 
-    CLocalElement* recvElement_=nullptr ;
   public:
     CLocalElement* getRecvElement(void) { return recvElement_ ;}
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm.hpp	(revision 2011)
@@ -24,5 +24,6 @@
     CGridAlgorithm(CGenericAlgorithmTransformation* algorithm) : algorithm_(algorithm)  {} ;
     virtual ~CGridAlgorithm() {} ;
-    virtual void apply(const CArray<double,1>& dataIn, CArray<double,1>& dataOut)=0 ;
+    virtual void apply(const CArray<double,1>& dataIn, CArray<double,1>& dataOut) { abort(); } //=0
+    virtual void apply(const CArray<double,1>& dataIn, const vector<CArray<double,1>>& auxData, CArray<double,1>& dataOut) { abort(); } //=0
     virtual CTransformFilter* createTransformFilter(CGarbageCollector& gc, bool detectMissingValues, double defaultValue) ;
    
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm_generic.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm_generic.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm_generic.cpp	(revision 2011)
@@ -58,5 +58,15 @@
   }
 
-  
+  void CGridAlgorithmGeneric::apply(const CArray<double,1>& dataIn, const vector<CArray<double,1>>& auxData, CArray<double,1>& dataOut)
+  {
+    CArray<double,1> dataOutTmp ;
+    vector<CArray<double,1>> auxDataOutTmp(auxData.size()) ;
+
+    gridTransformConnector_->transfer(dataIn, dataOutTmp) ;
+    for (int i=0; i<auxData.size();i++)  gridTransformConnector_->transfer(auxData[i], auxDataOutTmp[i]) ;
+
+    algorithm_->apply(dimBefore_, dimAfter_, dataOutTmp, auxDataOutTmp, dataOut) ;
+  }
+ 
 
 }
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm_generic.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm_generic.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_algorithm_generic.hpp	(revision 2011)
@@ -28,5 +28,6 @@
     void computeAlgorithm(void) ;
     virtual void apply(const CArray<double,1>& dataIn, CArray<double,1>& dataOut) ;
- 
+    virtual void apply(const CArray<double,1>& dataIn, const vector<CArray<double,1>>& auxData, CArray<double,1>& dataOut) ;
+    
   protected:
     CGridTransformConnector* gridTransformConnector_=nullptr ;
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_generate.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_generate.cpp	(revision 2010)
+++ 	(revision )
@@ -1,121 +1,0 @@
-/*!
-   \file grid_generate.cpp
-   \author Ha NGUYEN
-   \since 28 Aug 2015
-   \date 23 June 2016
-
-   \brief A special transformation to generate a grid.
- */
-#include "grid_generate.hpp"
-#include "grid.hpp"
-#include "domain_algorithm_generate_rectilinear.hpp"
-#include "generate_rectilinear_domain.hpp"
-
-namespace xios {
-CGridGenerate::CGridGenerate(CGrid* destination, CGrid* source)
-  : CGridTransformationSelector(destination, source, special)
-{
-}
-
-CGridGenerate::~CGridGenerate()
-{
-}
-
-/*!
-  Select algorithm of an axis correspoding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 1 (because it contains 2 basic elements)
-                                             and position of axis is 2
-  \param [in] transType transformation type, for now we have Zoom_axis, inverse_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridGenerate::selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  CGenericAlgorithmTransformation* algo = 0;
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Select algorithm of an axis correspoding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 1 (because it contains 2 basic elements)
-                                             and position of axis is 2
-  \param [in] transType transformation type, for now we have Zoom_axis, inverse_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridGenerate::selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  CGenericAlgorithmTransformation* algo = 0;
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Select algorithm of a domain correspoding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 1 (because it contains 2 basic elements)
-                                             and position of axis is 2
-  \param [in] transType transformation type, for now we have Zoom_axis, inverse_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridGenerate::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDestination_->getDomains();
-  std::vector<CDomain*> domainListSrcP(domainListDestP.size());
-  if (0 != gridSource_) domainListSrcP = gridSource_->getDomains();
-
-  int domainIndex =  elementPositionInGridDst2DomainPosition_[elementPositionInGrid];
-  CDomain::TransMapTypes trans = domainListDestP[domainIndex]->getAllTransformations();
-  CDomain::TransMapTypes::const_iterator it = trans.begin();
-
-  for (int i = 0; i < transformationOrder; ++i, ++it) {}  // Find the correct transformation
-
-  CGenerateRectilinearDomain* genRectDomain = 0;
-  CGenericAlgorithmTransformation* algo = 0;
-  switch (transType)
-  {
-    case TRANS_GENERATE_RECTILINEAR_DOMAIN:
-      if (0 == transformationOrder)
-      {
-        genRectDomain = dynamic_cast<CGenerateRectilinearDomain*> (it->second);
-        algo = new CDomainAlgorithmGenerateRectilinear(true, domainListDestP[domainIndex], domainListSrcP[domainIndex],
-                                                       gridDestination_, gridSource_, genRectDomain);
-      }
-      else
-      {
-         ERROR("CGridGenerate::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)",
-           << "Generate rectilinear domain must be the first transformation");
-      }
-      break;
-    default:
-      break;
-  }
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-
-*/
-void CGridGenerate::completeGrid()
-TRY
-{
-  ListAlgoType::const_iterator itb = listAlgos_.begin(),
-                               ite = listAlgos_.end(), it;
-  CGenericAlgorithmTransformation* algo = 0;
-
-  for (it = itb; it != ite; ++it)
-  {
-    int elementPositionInGrid = it->first;
-    ETranformationType transType = (it->second).first;
-    int transformationOrder = (it->second).second.first;
-    int algoType = (it->second).second.second;
-
-    // First of all, select an algorithm
-    selectAlgo(elementPositionInGrid, transType, transformationOrder, algoType);
-  }
-}
-CATCH
-
-}
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_generate.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_generate.hpp	(revision 2010)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*!
-   \file grid_generate.hpp
-   \author Ha NGUYEN
-   \since 28 Aug 2015
-   \date 28 Aug 2015
-
-   \brief A special transformation to generate a grid.
- */
-#ifndef __XIOS_GRID_GENERATE_HPP__
-#define __XIOS_GRID_GENERATE_HPP__
-
-#include "xios_spl.hpp"
-#include "transformation_enum.hpp"
-#include "grid_transformation_selector.hpp"
-
-namespace xios {
-
-class CGrid;
-
-/*!
-  \class CGridGenerate
-  This class creates a grid from scratch, e.g: only global dimension of grid and its type are provided,
-then the generated grid plays the destination in a transformation. Not only some attributes of grid and its subcomponents are filled in
-automatically but it also have a distribution which might be different from one of grid source.
-This class only plays a role of interface between XIOS and specific algorithm of auto filling-in and auto distributing on sub-component
-*/
-class CGridGenerate : public CGridTransformationSelector
-{
-public:
-  /** Default constructor */
-  CGridGenerate(CGrid* destination, CGrid* source = 0);
-  ~CGridGenerate();
-
-  void completeGrid();
-
-protected:
-  virtual void selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-  virtual void selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-  virtual void selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-};
-
-}
-#endif // __XIOS_GRID_GENERATE_HPP__
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation.cpp	(revision 2010)
+++ 	(revision )
@@ -1,732 +1,0 @@
-/*!
-   \file grid_transformation.cpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 02 Jul 2015
-
-   \brief Interface for all transformations.
- */
-#include "grid_transformation.hpp"
-#include "grid_transformation_factory_impl.hpp"
-#include "algo_types.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "distribution_client.hpp"
-#include "mpi_tag.hpp"
-#include "grid.hpp"
-#include <unordered_map>
-#include "timer.hpp"
-
-namespace xios {
-CGridTransformation::CGridTransformation(CGrid* destination, CGrid* source)
- : CGridTransformationSelector(destination, source),
-  tmpGridDestination_(destination), originalGridSource_(source),
-  tempGridSrcs_(), tempGridDests_(),
-  dynamicalTransformation_(false), timeStamp_()
-{
-}
-
-CGridTransformation::~CGridTransformation()
-{
-}
-
-/*!
-  Select algorithm of a scalar corresponding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 0 and position of axis is 1
-  \param [in] transType transformation type, for now we have
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridTransformation::selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  std::vector<CScalar*> scaListDestP = gridDestination_->getScalars();
-  int scalarDstIndex =  elementPositionInGridDst2ScalarPosition_[elementPositionInGrid];
-  CScalar::TransMapTypes trans = scaListDestP[scalarDstIndex]->getAllTransformations();
-  CScalar::TransMapTypes::const_iterator it = trans.begin();
-
-  for (int i = 0; i < transformationOrder; ++i, ++it) {}  // Find the correct transformation
-  CGenericAlgorithmTransformation* algo = 0;
-  algo = CGridTransformationFactory<CScalar>::createTransformation(transType, false,
-                                                                  gridDestination_,
-                                                                  gridSource_,
-                                                                  it->second,
-                                                                  elementPositionInGrid,
-                                                                  elementPositionInGridSrc2ScalarPosition_,
-                                                                  elementPositionInGridSrc2AxisPosition_,
-                                                                  elementPositionInGridSrc2DomainPosition_,
-                                                                  elementPositionInGridDst2ScalarPosition_,
-                                                                  elementPositionInGridDst2AxisPosition_,
-                                                                  elementPositionInGridDst2DomainPosition_);
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Select algorithm of an axis corresponding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 0 and position of axis is 1
-  \param [in] transType transformation type, for now we have zoom_axis, inverse_axis, interpolate_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridTransformation::selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDestination_->getAxis();
-  int axisDstIndex =  elementPositionInGridDst2AxisPosition_[elementPositionInGrid];
-  CAxis::TransMapTypes trans = axisListDestP[axisDstIndex]->getAllTransformations();
-  CAxis::TransMapTypes::const_iterator it = trans.begin();
-  for (int i = 0; i < transformationOrder; ++i, ++it) {}  // Find the correct transformation
-
-  CGenericAlgorithmTransformation* algo = 0;
-  algo = CGridTransformationFactory<CAxis>::createTransformation(transType, false,
-                                                                 gridDestination_,
-                                                                 gridSource_,
-                                                                 it->second,
-                                                                 elementPositionInGrid,
-                                                                 elementPositionInGridSrc2ScalarPosition_,
-                                                                 elementPositionInGridSrc2AxisPosition_,
-                                                                 elementPositionInGridSrc2DomainPosition_,
-                                                                 elementPositionInGridDst2ScalarPosition_,
-                                                                 elementPositionInGridDst2AxisPosition_,
-                                                                 elementPositionInGridDst2DomainPosition_);
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Select algorithm of a domain corresponding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 0 and position of axis is 1
-  \param [in] transType transformation type, for now we have zoom_domain, interpolate_domain
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-*/
-void CGridTransformation::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder)
-TRY
-{
-  std::vector<CDomain*> domainListDestP = gridDestination_->getDomains();
-  int domainIndex =  elementPositionInGridDst2DomainPosition_[elementPositionInGrid];
-  CDomain::TransMapTypes trans = domainListDestP[domainIndex]->getAllTransformations();
-  CDomain::TransMapTypes::const_iterator it = trans.begin();
-  for (int i = 0; i < transformationOrder; ++i, ++it) {}  // Find the correct transformation  
-
-  CGenericAlgorithmTransformation* algo = 0;
-  algo = CGridTransformationFactory<CDomain>::createTransformation(transType, false,
-                                                                   gridDestination_,
-                                                                   gridSource_,
-                                                                   it->second,
-                                                                   elementPositionInGrid,
-                                                                   elementPositionInGridSrc2ScalarPosition_,
-                                                                   elementPositionInGridSrc2AxisPosition_,
-                                                                   elementPositionInGridSrc2DomainPosition_,
-                                                                   elementPositionInGridDst2ScalarPosition_,
-                                                                   elementPositionInGridDst2AxisPosition_,
-                                                                   elementPositionInGridDst2DomainPosition_);
-  algoTransformation_.push_back(algo);
-}
-CATCH
-
-/*!
-  Find position of element in a grid as well as its type (domain, axis, scalar) and position in its own element list
-  \return element position: map<int,<int,int> > corresponds to <element position in grid, <element type, element position in element list> >
-*/
-std::map<int,std::pair<int,int> > CGridTransformation::getElementPosition(CGrid* grid)
-TRY
-{
-  std::vector<CScalar*> scalarListP = grid->getScalars(); 
-  std::vector<CAxis*> axisListP = grid->getAxis();
-  std::vector<CDomain*> domListP = grid->getDomains();  
-  CArray<int,1> axisDomainOrder = grid->axis_domain_order;
-  int scalarIndex = 0, axisIndex = 0, domainIndex = 0;
-  int nbElement = axisDomainOrder.numElements(), elementDim;
-  std::map<int,std::pair<int,int> > elementPosition;
-  for (int idx = 0; idx < nbElement; ++idx)
-  {
-    elementDim = axisDomainOrder(idx);
-    switch (elementDim)
-    {
-      case 2:
-        elementPosition[idx] = std::make_pair(elementDim, domainIndex);
-        ++domainIndex;
-        break;
-      case 1:
-        elementPosition[idx] = std::make_pair(elementDim, axisIndex);
-        ++axisIndex;
-        break;
-      case 0:
-        elementPosition[idx] = std::make_pair(elementDim, scalarIndex);
-        ++scalarIndex;
-        break;
-      default:
-        break;        
-    }
-  }
-
-  return elementPosition;  
-}
-CATCH
-
-/*!
-  If there are more than one transformation, a new temporary grid will be created and it will play the role of grid destination.
-This new created one keeps a pointer to the real transformed element of grid destination and generate new copies of other elements from grid source.
-  \param [in] elementPositionInGrid position of element in grid
-  \param [in] transType transformation type
-*/
-void CGridTransformation::setUpGridDestination(int elementPositionInGrid, ETranformationType transType)
-TRY
-{
-  if (isSpecialTransformation(transType)) return;
-
-  if (!tempGridDests_.empty() && (getNbAlgo() == tempGridDests_.size()))
-  {
-    tempGridDests_.resize(0);
-  }
-
-  if (1 == getNbAlgo()) 
-  {
-    tmpGridDestination_ = gridDestination_;
-    return;
-  }
-
-  std::vector<CScalar*> scalarListDestP = gridDestination_->getScalars();
-  std::vector<CScalar*> scalarListSrcP = gridSource_->getScalars(), scalarDst;
-
-  std::vector<CAxis*> axisListDestP = gridDestination_->getAxis();
-  std::vector<CAxis*> axisListSrcP = gridSource_->getAxis(), axisDst;
-
-  std::vector<CDomain*> domListDestP = gridDestination_->getDomains();
-  std::vector<CDomain*> domListSrcP = gridSource_->getDomains(), domainDst;
-
-  CArray<int,1> axisDomainOrderSrc = gridSource_->axis_domain_order;
-  CArray<int,1> axisDomainOrderDst = gridDestination_->axis_domain_order;
-
-  std::map<int,std::pair<int,int> > elementPositionSrc = getElementPosition(gridSource_);
-  std::map<int,std::pair<int,int> > elementPositionDst = getElementPosition(gridDestination_);
-
-  CArray<int,1> elementOrder(axisDomainOrderDst.numElements());
-  for (int idx = 0; idx < axisDomainOrderDst.numElements(); ++idx)
-  {
-    if (elementPositionInGrid == idx)
-    {
-      int dimElementDst = elementPositionDst[idx].first;
-      int elementIndex  = elementPositionDst[idx].second;
-      switch (dimElementDst) 
-      {
-        case 2:
-          domainDst.push_back(domListDestP[elementIndex]);
-          break;
-        case 1:
-          axisDst.push_back(axisListDestP[elementIndex]);
-          break;
-        case 0:
-          scalarDst.push_back(scalarListDestP[elementIndex]);
-          break;
-        default:
-          break;
-      }
-      elementOrder(idx) = dimElementDst;
-    }
-    else
-    {      
-      int dimElementSrc = elementPositionSrc[idx].first;
-      int elementIndex  = elementPositionSrc[idx].second;
-      switch (dimElementSrc)
-      {
-        case 2:
-          domainDst.push_back(domListSrcP[elementIndex]);
-          break;
-        case 1:
-          axisDst.push_back(axisListSrcP[elementIndex]);
-          break;
-        case 0:
-          scalarDst.push_back(scalarListSrcP[elementIndex]);
-          break;
-        default:
-          break;
-      }
-      elementOrder(idx) = dimElementSrc;
-    }
-  }
-
-  tmpGridDestination_ = CGrid::createGrid(domainDst, axisDst, scalarDst, elementOrder); 
-  tmpGridDestination_-> solveElementsRefInheritance() ; // ym not sure 
-  tempGridDests_.push_back(tmpGridDestination_);
-}
-CATCH
-
-/*!
-  Assign the current grid destination to the grid source in the new transformation.
-The current grid destination plays the role of grid source in next transformation (if any).
-Only element on which the transformation is performed is modified
-  \param [in] elementPositionInGrid position of element in grid
-  \param [in] transType transformation type
-*/
-void CGridTransformation::setUpGridSource(int elementPositionInGrid)
-TRY
-{
-  if (!tempGridSrcs_.empty() && (getNbAlgo()-1) == tempGridSrcs_.size())
-  {
-    tempGridSrcs_.resize(0);
-  }
-
-  std::vector<CScalar*> scalarListDestP = tmpGridDestination_->getScalars();
-  std::vector<CScalar*> scalarListSrcP = gridSource_->getScalars(), scalarSrc;
-
-  std::vector<CAxis*> axisListDestP = tmpGridDestination_->getAxis();
-  std::vector<CAxis*> axisListSrcP = gridSource_->getAxis(), axisSrc;
-
-  std::vector<CDomain*> domListDestP = tmpGridDestination_->getDomains();
-  std::vector<CDomain*> domListSrcP = gridSource_->getDomains(), domainSrc;
-
-  CArray<int,1> axisDomainOrderSrc = gridSource_->axis_domain_order;
-  CArray<int,1> axisDomainOrderDst = tmpGridDestination_->axis_domain_order;
-
-  std::map<int,std::pair<int,int> > elementPositionSrc = getElementPosition(gridSource_);
-  std::map<int,std::pair<int,int> > elementPositionDst = getElementPosition(tmpGridDestination_);
-
-  for (int idx = 0; idx < axisDomainOrderDst.numElements(); ++idx)
-  {   
-    if (elementPositionInGrid == idx)
-    {
-      int dimElementDst = elementPositionDst[idx].first;
-      int elementIndex  = elementPositionDst[idx].second;
-      if (2 == dimElementDst)
-      {
-        CDomain* domain = CDomain::createDomain();
-        domain->domain_ref.setValue(domListDestP[elementIndex]->getId());
-        domain->solveRefInheritance(true);
-        domain->checkAttributes();
-        domainSrc.push_back(domain);
-      }
-      else if (1 == dimElementDst)
-      {
-        CAxis* axis = CAxis::createAxis();
-        axis->axis_ref.setValue(axisListDestP[elementIndex]->getId());
-        axis->solveRefInheritance(true);
-        axis->checkAttributes();
-        axisSrc.push_back(axis); 
-      }
-      else
-      {
-        CScalar* scalar = CScalar::createScalar();
-        scalar->scalar_ref.setValue(scalarListDestP[elementIndex]->getId());
-        scalar->solveRefInheritance(true);
-        scalar->checkAttributes();
-        scalarSrc.push_back(scalar);
-      }
-    }
-    else
-    {      
-      int dimElementDst = elementPositionDst[idx].first;
-      int elementIndex  = elementPositionDst[idx].second;
-      switch (dimElementDst)
-      {
-        case 2:
-          domainSrc.push_back(domListDestP[elementIndex]);
-          break;
-        case 1:
-          axisSrc.push_back(axisListDestP[elementIndex]);
-          break;
-        case 0:
-          scalarSrc.push_back(scalarListDestP[elementIndex]);
-          break;
-        default:
-          break;
-      }
-    }
-  }
-
-  gridSource_ = CGrid::createGrid(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order);  
-  gridSource_->solveElementsRefInheritance() ; // ym not sure
-
-  tempGridSrcs_.push_back(gridSource_);
-}
-CATCH
-
-/*!
-  Perform all transformations
-  For each transformation, there are some things to do:
-  -) Chose the correct algorithm by transformation type and position of element
-  -) Calculate the mapping of global index between the current grid source and grid destination
-  -) Calculate the mapping of global index between current grid DESTINATION and grid SOURCE
-  -) Make current grid destination become grid source in the next transformation
-*/
-void CGridTransformation::computeAll(const std::vector<CArray<double,1>* >& dataAuxInputs, Time timeStamp)
-TRY
-{
-  if (nbNormalAlgos_ < 1) return;
-  if (!auxInputs_.empty() && !dynamicalTransformation_) { dynamicalTransformation_ = true; return; }
-  if (dynamicalTransformation_)
-  {
-    if (timeStamp_.insert(timeStamp).second)   //Reset map
-    {
-      std::list<SendingIndexGridSourceMap>().swap(localIndexToSendFromGridSource_);
-      std::list<RecvIndexGridDestinationMap>().swap(localIndexToReceiveOnGridDest_);
-      std::list<size_t>().swap(nbLocalIndexOnGridDest_);
-    }
-    else
-      return;
-  }
-
-  CContext* context = CContext::getCurrent();
-
-  ListAlgoType::const_iterator itb = listAlgos_.begin(),
-                               ite = listAlgos_.end(), it;
-
-  CGenericAlgorithmTransformation* algo = 0;
-  int nbAgloTransformation = 0; // Only count for executed transformation. Generate domain is a special one, not executed in the list
-  for (it = itb; it != ite; ++it)
-  {
-    int elementPositionInGrid = it->first;
-    ETranformationType transType = (it->second).first;
-    int transformationOrder = (it->second).second.first;
-    int algoType = ((it->second).second.second); //algoTypes_[std::distance(itb, it)];
-    SourceDestinationIndexMap globaIndexWeightFromSrcToDst;
-    
-
-    // Create a temporary grid destination which contains transformed element of grid destination and
-    // non-transformed elements to grid source
-    setUpGridDestination(elementPositionInGrid, transType);
-
-    // First of all, select an algorithm
-    if (!dynamicalTransformation_ || (algoTransformation_.size() < listAlgos_.size()))
-    {
-      selectAlgo(elementPositionInGrid, transType, transformationOrder, algoType);
-      algo = algoTransformation_.back();
-    }
-    else
-      algo = algoTransformation_[std::distance(itb, it)];
-
-    if ((0 != algo) &&
-        ((CGenericAlgorithmTransformation::ELEMENT_NO_MODIFICATION_WITH_DATA == algo->type()) ||
-        (CGenericAlgorithmTransformation::ELEMENT_MODIFICATION_WITH_DATA == algo->type()))) // Only registered transformation can be executed
-    {
-      CTimer::get("computeIndexSourceMapping").resume() ;
-      algo->computeIndexSourceMapping(dataAuxInputs);
-      CTimer::get("computeIndexSourceMapping").suspend() ;
-      
-      // ComputeTransformation of global index of each element
-      int elementPosition = it->first;
-      bool nonDistributedActivated = CXios::getin<bool>("activate_non_distributed_transformation",false);
-      
-      if (nonDistributedActivated && !algo->isDistributedTransformation(elementPositionInGrid, gridSource_, tmpGridDestination_) )
-      {
-        vector<int> localSrc ;
-        vector<int> localDst ;
-        vector<double> weight ;
-        int nbLocalIndexOnGridDest;
-        CTimer::get("computeTransformationMappingNonDistributed").resume();  
-        algo->computeTransformationMappingNonDistributed(elementPosition, gridSource_, tmpGridDestination_, 
-                                                         localSrc, localDst, weight, nbLocalIndexOnGridDest) ;
-        CTimer::get("computeTransformationMappingNonDistributed").suspend();  
-
-        CTimer::get("computeTransformationMappingConvert").resume();  
-        nbLocalIndexOnGridDest_.push_back(nbLocalIndexOnGridDest) ;
-        int clientRank=context->intraCommRank_ ;
-        {
-          SendingIndexGridSourceMap tmp;
-          localIndexToSendFromGridSource_.push_back(tmp) ;
-          SendingIndexGridSourceMap& src=localIndexToSendFromGridSource_.back() ;
-          CArray<int,1> arrayTmp ;
-          src.insert( pair<int,CArray<int,1> >(clientRank,arrayTmp)) ;
-          CArray<int,1>& array=src[clientRank] ;
-          array.resize(localSrc.size()) ;
-          for(int i=0;i< localSrc.size();++i) array(i)=localSrc[i]  ;    
-        }
-        {
-          RecvIndexGridDestinationMap tmp;
-          localIndexToReceiveOnGridDest_.push_back(tmp) ;
-          RecvIndexGridDestinationMap& dst=localIndexToReceiveOnGridDest_.back() ;
-          vector<pair<int,double> > vectTmp ;
-          dst.insert( pair<int,vector<pair<int,double> >  >(clientRank,vectTmp)) ;
-          vector<pair<int,double> >& vect=dst[clientRank] ;
-          vect.resize(localDst.size()) ;
-          for(int i=0;i< localDst.size();++i) vect[i]=pair<int,double>(localDst[i],weight[i])  ;      
-        }
-        CTimer::get("computeTransformationMappingConvert").suspend();  
-      }
-      else
-      {
-        CTimer::get("computeGlobalSourceIndex").resume();           
-        algo->computeGlobalSourceIndex(elementPosition,
-                                       gridSource_,
-                                       tmpGridDestination_,
-                                       globaIndexWeightFromSrcToDst);
-                                     
-        CTimer::get("computeGlobalSourceIndex").suspend();           
-        CTimer::get("computeTransformationMapping").resume();     
-        // Compute transformation of global indexes among grids
-        computeTransformationMapping(globaIndexWeightFromSrcToDst);
-        CTimer::get("computeTransformationMapping").suspend(); 
-      } 
-      if (1 < nbNormalAlgos_)
-      {
-        // Now grid destination becomes grid source in a new transformation
-        if (nbAgloTransformation != (nbNormalAlgos_-1)) setUpGridSource(elementPositionInGrid);
-      }
-      ++nbAgloTransformation;
-    }
-  }
-}
-CATCH
-
-/*!
-  Compute exchange index between grid source and grid destination
-  \param [in] globalIndexWeightFromDestToSource global index mapping between grid destination and grid source
-*/
-void CGridTransformation::computeTransformationMapping(const SourceDestinationIndexMap& globaIndexWeightFromSrcToDst)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  int nbClient = context->intraCommSize_;
-  int clientRank = context->intraCommRank_;
-
-  // Recalculate the distribution of grid destination
-  CDistributionClient distributionClientDest(clientRank, tmpGridDestination_);
-  CDistributionClient::GlobalLocalDataMap& globalLocalIndexGridDestSendToServer = distributionClientDest.getGlobalLocalDataSendToServer();
-
-  // Update number of local index on each transformation
-  size_t nbLocalIndex = globalLocalIndexGridDestSendToServer.size();
-  nbLocalIndexOnGridDest_.push_back(nbLocalIndex);
-//  localMaskOnGridDest_.push_back(std::vector<bool>());
-//  std::vector<bool>& tmpMask = localMaskOnGridDest_.back();
-//  tmpMask.resize(nbLocalIndex,false);
-
-  // Find out number of index sent from grid source and number of index received on grid destination
-  SourceDestinationIndexMap::const_iterator itbIndex = globaIndexWeightFromSrcToDst.begin(),
-                                            iteIndex = globaIndexWeightFromSrcToDst.end(), itIndex;
-  typedef std::unordered_map<size_t, std::vector<std::pair<size_t,double> > > SendIndexMap;
-  std::map<int,int> sendRankSizeMap,recvRankSizeMap;
-  int connectedClient = globaIndexWeightFromSrcToDst.size();
-  int* recvCount=new int[nbClient];
-  int* displ=new int[nbClient];
-  int* sendRankBuff=new int[connectedClient];
-  int* sendSizeBuff=new int[connectedClient];
-  int n = 0;
-  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex, ++n)
-  {
-    sendRankBuff[n] = itIndex->first;
-    const SendIndexMap& sendIndexMap = itIndex->second;
-    SendIndexMap::const_iterator itbSend = sendIndexMap.begin(), iteSend = sendIndexMap.end(), itSend;
-    int sendSize = 0;
-    for (itSend = itbSend; itSend != iteSend; ++itSend)
-    {
-      sendSize += itSend->second.size();
-    }
-    sendSizeBuff[n] = sendSize;
-    sendRankSizeMap[itIndex->first] = sendSize;
-  }
-  MPI_Allgather(&connectedClient,1,MPI_INT,recvCount,1,MPI_INT, context->intraComm_);
-
-  displ[0]=0 ;
-  for(int n=1;n<nbClient;n++) displ[n]=displ[n-1]+recvCount[n-1];
-  int recvSize=displ[nbClient-1]+recvCount[nbClient-1];
-  int* recvRankBuff=new int[recvSize];
-  int* recvSizeBuff=new int[recvSize];
-  MPI_Allgatherv(sendRankBuff,connectedClient,MPI_INT,recvRankBuff,recvCount,displ,MPI_INT,context->intraComm_);
-  MPI_Allgatherv(sendSizeBuff,connectedClient,MPI_INT,recvSizeBuff,recvCount,displ,MPI_INT,context->intraComm_);
-  for (int i = 0; i < nbClient; ++i)
-  {
-    int currentPos = displ[i];
-    for (int j = 0; j < recvCount[i]; ++j)
-      if (recvRankBuff[currentPos+j] == clientRank)
-      {
-        recvRankSizeMap[i] = recvSizeBuff[currentPos+j];
-      }
-  }
-
-  // Sending global index of grid source to corresponding process as well as the corresponding mask
-  std::vector<MPI_Request> requests;
-  std::vector<MPI_Status> status;
-  std::unordered_map<int, unsigned char* > recvMaskDst;
-  std::unordered_map<int, unsigned long* > recvGlobalIndexSrc;
-  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv)
-  {
-    int recvRank = itRecv->first;
-    int recvSize = itRecv->second;
-    recvMaskDst[recvRank] = new unsigned char [recvSize];
-    recvGlobalIndexSrc[recvRank] = new unsigned long [recvSize];
-
-    requests.push_back(MPI_Request());
-    MPI_Irecv(recvGlobalIndexSrc[recvRank], recvSize, MPI_UNSIGNED_LONG, recvRank, 46, context->intraComm_, &requests.back());
-    requests.push_back(MPI_Request());
-    MPI_Irecv(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 47, context->intraComm_, &requests.back());
-  }
-
-  std::unordered_map<int, CArray<size_t,1> > globalIndexDst;
-  std::unordered_map<int, CArray<double,1> > weightDst;
-  std::unordered_map<int, unsigned char* > sendMaskDst;
-  std::unordered_map<int, unsigned long* > sendGlobalIndexSrc;
-  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex)
-  {
-    int sendRank = itIndex->first;
-    int sendSize = sendRankSizeMap[sendRank];
-    const SendIndexMap& sendIndexMap = itIndex->second;
-    SendIndexMap::const_iterator itbSend = sendIndexMap.begin(), iteSend = sendIndexMap.end(), itSend;
-    globalIndexDst[sendRank].resize(sendSize);
-    weightDst[sendRank].resize(sendSize);
-    sendMaskDst[sendRank] = new unsigned char [sendSize];
-    sendGlobalIndexSrc[sendRank] = new unsigned long [sendSize];
-    int countIndex = 0;
-    for (itSend = itbSend; itSend != iteSend; ++itSend)
-    {
-      const std::vector<std::pair<size_t,double> >& dstWeight = itSend->second;
-      for (int idx = 0; idx < dstWeight.size(); ++idx)
-      {
-        globalIndexDst[sendRank](countIndex) = dstWeight[idx].first;
-        weightDst[sendRank](countIndex) = dstWeight[idx].second;
-        if (0 < globalLocalIndexGridDestSendToServer.count(dstWeight[idx].first))
-          sendMaskDst[sendRank][countIndex] = 1;
-        else
-          sendMaskDst[sendRank][countIndex] = 0;
-        sendGlobalIndexSrc[sendRank][countIndex] = itSend->first;
-        ++countIndex;
-      }
-    }
-
-    // Send global index source and mask
-    requests.push_back(MPI_Request());
-    MPI_Isend(sendGlobalIndexSrc[sendRank], sendSize, MPI_UNSIGNED_LONG, sendRank, 46, context->intraComm_, &requests.back());
-    requests.push_back(MPI_Request());
-    MPI_Isend(sendMaskDst[sendRank], sendSize, MPI_UNSIGNED_CHAR, sendRank, 47, context->intraComm_, &requests.back());
-  }
-
-  status.resize(requests.size());
-  MPI_Waitall(requests.size(), &requests[0], &status[0]);
-
-  // Okie, now use the mask to identify which index source we need to send, then also signal the destination which masked index we will return
-  std::vector<MPI_Request>().swap(requests);
-  std::vector<MPI_Status>().swap(status);
-  // Okie, on destination side, we will wait for information of masked index of source
-  for (std::map<int,int>::const_iterator itSend = sendRankSizeMap.begin(); itSend != sendRankSizeMap.end(); ++itSend)
-  {
-    int recvRank = itSend->first;
-    int recvSize = itSend->second;
-
-    requests.push_back(MPI_Request());
-    MPI_Irecv(sendMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, context->intraComm_, &requests.back());
-  }
-
-  // Ok, now we fill in local index of grid source (we even count for masked index)
-  CDistributionClient distributionClientSrc(clientRank, gridSource_);
-  CDistributionClient::GlobalLocalDataMap& globalLocalIndexGridSrcSendToServer = distributionClientSrc.getGlobalLocalDataSendToServer();
-  localIndexToSendFromGridSource_.push_back(SendingIndexGridSourceMap());
-  SendingIndexGridSourceMap& tmpSend = localIndexToSendFromGridSource_.back();
-  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv)
-  {
-    int recvRank = itRecv->first;
-    int recvSize = itRecv->second;
-    unsigned char* recvMask = recvMaskDst[recvRank];
-    unsigned long* recvIndexSrc = recvGlobalIndexSrc[recvRank];
-    int realSendSize = 0;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      if (0 != (*(recvMask+idx))) // OKie, now we have a demand from non-masked index destination
-        if (0 < globalLocalIndexGridSrcSendToServer.count(*(recvIndexSrc+idx))) // check whether index source is masked
-         ++realSendSize;
-        else // inform the destination that this index is masked
-         *(recvMask+idx) = 0;
-    }
-
-    tmpSend[recvRank].resize(realSendSize);
-    realSendSize = 0;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      if (0 != (*(recvMask+idx))) // OKie, now we have a demand from non-masked index destination
-      {
-        tmpSend[recvRank](realSendSize) = globalLocalIndexGridSrcSendToServer[*(recvIndexSrc+idx)];
-         ++realSendSize;
-      }
-    }
-
-    // Okie, now inform the destination which source index are masked
-    requests.push_back(MPI_Request());
-    MPI_Isend(recvMaskDst[recvRank], recvSize, MPI_UNSIGNED_CHAR, recvRank, 48, context->intraComm_, &requests.back());
-  }
-  status.resize(requests.size());
-  MPI_Waitall(requests.size(), &requests[0], &status[0]);
-
-  // Cool, now we can fill in local index of grid destination (counted for masked index)
-  localIndexToReceiveOnGridDest_.push_back(RecvIndexGridDestinationMap());
-  RecvIndexGridDestinationMap& recvTmp = localIndexToReceiveOnGridDest_.back();
-  for (std::map<int,int>::const_iterator itSend = sendRankSizeMap.begin(); itSend != sendRankSizeMap.end(); ++itSend)
-  {
-    int recvRank = itSend->first;
-    int recvSize = itSend->second;
-    unsigned char* recvMask = sendMaskDst[recvRank];
-
-    CArray<size_t,1>& recvIndexDst = globalIndexDst[recvRank];
-    CArray<double,1>& recvWeightDst = weightDst[recvRank];
-    int realRecvSize = 0;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      if (0 != *(recvMask+idx)) // OKie, now we have a non-masked index destination
-         ++realRecvSize;
-    }
-
-    int localIndexDst;
-    recvTmp[recvRank].resize(realRecvSize);
-    realRecvSize = 0;
-    for (int idx = 0; idx < recvSize; ++idx)
-    {
-      if (0 != *(recvMask+idx)) // OKie, now we have a demand from non-masked index destination
-      {
-        recvTmp[recvRank][realRecvSize].first = globalLocalIndexGridDestSendToServer[recvIndexDst(idx)];
-        recvTmp[recvRank][realRecvSize].second = recvWeightDst(idx);
-         ++realRecvSize;
-      }
-    }
-  }
-
-  delete [] recvCount;
-  delete [] displ;
-  delete [] sendRankBuff;
-  delete [] recvRankBuff;
-  delete [] sendSizeBuff;
-  delete [] recvSizeBuff;
-
-  std::unordered_map<int, unsigned char* >::const_iterator itChar;
-  for (itChar = sendMaskDst.begin(); itChar != sendMaskDst.end(); ++itChar)
-    delete [] itChar->second;
-  for (itChar = recvMaskDst.begin(); itChar != recvMaskDst.end(); ++itChar)
-    delete [] itChar->second;
-  std::unordered_map<int, unsigned long* >::const_iterator itLong;
-  for (itLong = sendGlobalIndexSrc.begin(); itLong != sendGlobalIndexSrc.end(); ++itLong)
-    delete [] itLong->second;
-  for (itLong = recvGlobalIndexSrc.begin(); itLong != recvGlobalIndexSrc.end(); ++itLong)
-    delete [] itLong->second;
-
-}
-CATCH
-
-/*!
-  Local index of data which need sending from the grid source
-  \return local index of data
-*/
-const std::list<CGridTransformation::SendingIndexGridSourceMap>& CGridTransformation::getLocalIndexToSendFromGridSource() const
-TRY
-{
-  return localIndexToSendFromGridSource_;
-}
-CATCH
-
-/*!
-  Local index of data which will be received on the grid destination
-  \return local index of data
-*/
-const std::list<CGridTransformation::RecvIndexGridDestinationMap>& CGridTransformation::getLocalIndexToReceiveOnGridDest() const
-TRY
-{
-  return localIndexToReceiveOnGridDest_;
-}
-CATCH
-
-/*!
- Number of index will be received on the grid destination
-  \return number of index of data
-*/
-const std::list<size_t>& CGridTransformation::getNbLocalIndexToReceiveOnGridDest() const
-TRY
-{
-  return nbLocalIndexOnGridDest_;
-}
-CATCH
-
-}
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation.hpp	(revision 2010)
+++ 	(revision )
@@ -1,91 +1,0 @@
-/*!
-   \file grid_transformation.hpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 26 Aug 2015
-
-   \brief Interface for all transformations.
- */
-#ifndef __XIOS_GRID_TRANSFORMATION_HPP__
-#define __XIOS_GRID_TRANSFORMATION_HPP__
-
-#include <map>
-#include <vector>
-#include "generic_algorithm_transformation.hpp"
-#include "transformation_enum.hpp"
-#include "duration.hpp"
-#include "grid_transformation_selector.hpp"
-
-namespace xios {
-
-class CGrid;
-
-/*!
-  \class CGridTransformation
-  This class is an interface for all transformations to interact with the rest of XIOS.
-The class, firstly, tries to get all information relating to requested transformations by retrieving directly from grid.
-Secondly, with all these information, all necessary transformations will be created by generic class \class CGenericAlgorithmTransformation.
-Then this class accomplishes the transformations by exchanging information among clients (e.g: some index need retrieving index from other clients),
-For each transformation, a new temporary grid source is created.
-For a consequential transformations (e.g: inversing -> zoom -> inversing -> ...),
-the grid destination of current transformation will be grid source of the next transformation
-*/
-class CGridTransformation : public CGridTransformationSelector
-{
-public:
-  typedef std::map<int, CArray<int,1> > SendingIndexGridSourceMap;
-  typedef std::map<int,std::vector<std::pair<int,double> > > RecvIndexGridDestinationMap;
-  typedef CGenericAlgorithmTransformation::SourceDestinationIndexMap SourceDestinationIndexMap;
-  typedef CGenericAlgorithmTransformation::AlgoTransType AlgoTransType;
-
-public:
-  /** Default constructor */
-  CGridTransformation(CGrid* destination, CGrid* source);
-  ~CGridTransformation();
-
-  void computeAll(const std::vector<CArray<double,1>* >& dataAuxInput=std::vector<CArray<double,1>* >(), Time timeStamp = 0);
-
-  const std::list<SendingIndexGridSourceMap>& getLocalIndexToSendFromGridSource() const;
-  const std::list<RecvIndexGridDestinationMap>& getLocalIndexToReceiveOnGridDest() const;
-  const std::list<size_t>& getNbLocalIndexToReceiveOnGridDest() const;
-
-  CGrid* getGridSource() { return originalGridSource_; }
-  CGrid* getGridDestination() { return gridDestination_; }
-
-protected:
-  void computeTransformation();
-
-  virtual void selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-  virtual void selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-  virtual void selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder);
-
-  void setUpGridSource(int elementPositionInGrid);
-  void setUpGridDestination(int elementPositionInGrid, ETranformationType);
-  void computeTransformationMapping(const SourceDestinationIndexMap& globalIndexWeightFromSrcToDest);
-  std::map<int,std::pair<int,int> > getElementPosition(CGrid* grid);
-
-protected:
-  //! The grid source of the first transformation (original grid source)
-  CGrid* tmpGridDestination_;
-  CGrid* originalGridSource_;
-  std::vector<CGrid*> tempGridSrcs_, tempGridDests_;
-
-protected:
-  //! Mapping of (grid) global index representing transformation.
-  std::map<size_t, std::set<size_t> > globaIndexMapFromDestToSource_;
-
-  //! Local index of data to send from grid source
-  std::list<SendingIndexGridSourceMap> localIndexToSendFromGridSource_;
-
-  //! Local index of data to receive on grid destination
-  std::list<RecvIndexGridDestinationMap> localIndexToReceiveOnGridDest_;
-
-  //! Number of local index of data to receive on grid destination
-  std::list<size_t> nbLocalIndexOnGridDest_;
-
-  bool dynamicalTransformation_;
-  std::set<Time> timeStamp_; //! Time stamps for auxillary inputs
-};
-
-}
-#endif // __XIOS_GRID_TRANSFORMATION_HPP__
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation_selector.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation_selector.cpp	(revision 2010)
+++ 	(revision )
@@ -1,375 +1,0 @@
-/*!
-   \file grid_transformation.cpp
-   \author Ha NGUYEN
-   \since 14 May 2015
-   \date 02 Jul 2015
-
-   \brief Interface for all transformations.
- */
-#include "grid_transformation_selector.hpp"
-#include "grid.hpp"
-#include "algo_types.hpp"
-
-namespace xios {
-
-/*!
-  Register transformation to the framework
-*/
-void CGridTransformationSelector::registerTransformations()
-{
-  //! Scalar
-  CScalarAlgorithmReduceAxis::registerTrans();
-  CScalarAlgorithmExtractAxis::registerTrans();
-  CScalarAlgorithmReduceDomain::registerTrans();
-  CScalarAlgorithmReduceScalar::registerTrans();
-
-  //! Axis
-  CAxisAlgorithmZoom::registerTrans();
-  CAxisAlgorithmExtractDomain::registerTrans();
-  CAxisAlgorithmInterpolate::registerTrans();
-  CAxisAlgorithmExtract::registerTrans();
-  CAxisAlgorithmInverse::registerTrans();
-  CAxisAlgorithmReduceDomain::registerTrans();
-  CAxisAlgorithmReduceAxis::registerTrans();
-  CAxisAlgorithmTemporalSplitting::registerTrans();
-  CAxisAlgorithmDuplicateScalar::registerTrans();
-
-  //! Domain
-  CDomainAlgorithmComputeConnectivity::registerTrans();
-  CDomainAlgorithmInterpolate::registerTrans();
-  CDomainAlgorithmZoom::registerTrans();
-  CDomainAlgorithmExpand::registerTrans();
-  CDomainAlgorithmReorder::registerTrans();
-  CDomainAlgorithmExtract::registerTrans();
-}
-
-CGridTransformationSelector::CGridTransformationSelector(CGrid* destination, CGrid* source, TransformationType type)
- : gridSource_(source), gridDestination_(destination), isSameGrid_(false),
-  listAlgos_(), algoTypes_(), nbNormalAlgos_(0), nbSpecialAlgos_(0), auxInputs_()
-TRY
-{
-  if (0 == source)
-  {  gridSource_ = gridDestination_; }
-  if (gridSource_ == gridDestination_) isSameGrid_ = true;
-
-  //Verify the compatibity between two grids
-  int numElement = gridDestination_->axis_domain_order.numElements();
-  if (numElement != gridSource_->axis_domain_order.numElements())
-    ERROR("CGridTransformationSelector::CGridTransformationSelector(CGrid* destination, CGrid* source)",
-       << "Two grids have different number of elements"
-       << "Number of elements of grid source " <<gridSource_->getId() << " is " << gridSource_->axis_domain_order.numElements()  << std::endl
-       << "Number of elements of grid destination " <<gridDestination_->getId() << " is " << numElement);
-  registerTransformations();
-  initializeTransformations(type);
-}
-CATCH
-
-/*!
-  Initialize the mapping between the first grid source and the original one
-  In a series of transformation, for each step, there is a need to "create" a new grid that plays a role of "temporary" source.
-Because at the end of the series, we need to know about the index mapping between the final grid destination and original grid source,
-for each transformation, we need to make sure that the current "temporary source" maps its global index correctly to the original one.
-*/
-void CGridTransformationSelector::initializeTransformations(TransformationType type)
-TRY
-{
-  // Initialize algorithms
-  initializeAlgorithms();
-  ListAlgoType::iterator itb = listAlgos_.begin(),
-                         ite = listAlgos_.end(), it;
-
-  for (it = itb; it != ite; ++it)
-  {
-    ETranformationType transType = (it->second).first;
-    if (!isSpecialTransformation(transType))
-    {
-      ++nbNormalAlgos_;
-      if (special == type)
-      {
-        it = listAlgos_.erase(it);
-        --it;
-      }
-    }
-    else
-    {
-      ++nbSpecialAlgos_;
-      if (normal == type)
-      {
-        it = listAlgos_.erase(it);
-        --it;
-      }
-    }
-
-  }
-}
-CATCH
-
-CGridTransformationSelector::~CGridTransformationSelector()
-TRY
-{
-  std::vector<CGenericAlgorithmTransformation*>::const_iterator itb = algoTransformation_.begin(), it,
-                                                                ite = algoTransformation_.end();
-  for (it = itb; it != ite; ++it) delete (*it);
-}
-CATCH
-
-/*!
-  Update position of elements in grid source and grid destination as well as their positions in element list
-*/
-void CGridTransformationSelector::updateElementPosition()
-TRY
-{
-  int idxScalar = 0, idxAxis = 0, idxDomain = 0;
-  CArray<int,1> axisDomainOrderDst = gridDestination_->axis_domain_order;
-  std::map<int, int>().swap(elementPositionInGridDst2DomainPosition_);
-  std::map<int, int>().swap(elementPositionInGridDst2AxisPosition_);
-  std::map<int, int>().swap(elementPositionInGridDst2ScalarPosition_);
-  for (int i = 0; i < axisDomainOrderDst.numElements(); ++i)
-  {
-    int dimElement = axisDomainOrderDst(i);
-    if (2 == dimElement)
-    {
-      elementPositionInGridDst2DomainPosition_[i] = idxDomain;
-      ++idxDomain;
-    }
-    else if (1 == dimElement)
-    {
-      elementPositionInGridDst2AxisPosition_[i] = idxAxis;
-      ++idxAxis;
-    }
-    else
-    {
-      elementPositionInGridDst2ScalarPosition_[i] = idxScalar;
-      ++idxScalar;
-    }
-  }
-
-  idxScalar = idxAxis = idxDomain = 0;
-  CArray<int,1> axisDomainOrderSrc = gridSource_->axis_domain_order;
-  std::map<int, int>().swap(elementPositionInGridSrc2DomainPosition_);
-  std::map<int, int>().swap(elementPositionInGridSrc2AxisPosition_);
-  std::map<int, int>().swap(elementPositionInGridSrc2ScalarPosition_);
-  for (int i = 0; i < axisDomainOrderSrc.numElements(); ++i)
-  {
-    int dimElement = axisDomainOrderSrc(i);
-    if (2 == dimElement)
-    {
-      elementPositionInGridSrc2DomainPosition_[i] = idxDomain;
-      ++idxDomain;
-    }
-    else if (1 == dimElement)
-    {
-      elementPositionInGridSrc2AxisPosition_[i] = idxAxis;
-      ++idxAxis;
-    }
-    else
-    {
-      elementPositionInGridSrc2ScalarPosition_[i] = idxScalar;
-      ++idxScalar;
-    }
-  }
-}
-CATCH
-
-/*!
-  Initialize the algorithms (transformations)
-*/
-void CGridTransformationSelector::initializeAlgorithms()
-TRY
-{
-  updateElementPosition();
-  CArray<int,1> axisDomainOrderDst = gridDestination_->axis_domain_order;
-  for (int i = 0; i < axisDomainOrderDst.numElements(); ++i)
-  {
-    int dimElement = axisDomainOrderDst(i);
-    if (2 == dimElement)
-    {
-      initializeDomainAlgorithms(i);
-    }
-    else if (1 == dimElement)
-    {
-      initializeAxisAlgorithms(i);
-    }
-    else
-    {
-      initializeScalarAlgorithms(i);
-    }
-  }
-}
-CATCH
-
-/*!
-  Initialize the algorithms corresponding to transformation info contained in each scalar.
-If an scalar has transformations, these transformations will be represented in form of vector of CTransformation pointers
-In general, each scalar can have several transformations performed on itself. However, should they be done seperately or combinely (of course in order)?
-For now, one approach is to do these combinely but maybe this needs changing.
-\param [in] axisPositionInGrid position of an axis in grid. (for example: a grid with one domain and one scalar, position of domain is 0, position of axis is 1)
-*/
-void CGridTransformationSelector::initializeScalarAlgorithms(int scalarPositionInGrid)
-TRY
-{
-  std::vector<CScalar*> scalarListDestP = gridDestination_->getScalars();
-  std::vector<CScalar*> scalarListSrcP = gridSource_->getScalars();
-  if (!scalarListDestP.empty())
-  {
-    int scalarDstPos = -1, scalarSrcPos = -1;
-    if (0 < elementPositionInGridDst2ScalarPosition_.count(scalarPositionInGrid))
-      scalarDstPos = elementPositionInGridDst2ScalarPosition_[scalarPositionInGrid];
-    if (0 < elementPositionInGridSrc2ScalarPosition_.count(scalarPositionInGrid))
-      scalarSrcPos = elementPositionInGridSrc2ScalarPosition_[scalarPositionInGrid];
-
-    // If source and destination grid share the same scalar
-    if ((-1 != scalarDstPos) && (-1 != scalarSrcPos)  && !isSameGrid_ &&
-        ((scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) ||
-         (scalarListDestP[scalarDstPos]->isEqual(scalarListSrcP[scalarSrcPos])))) return;
-
-    if (scalarListDestP[scalarDstPos]->hasTransformation())
-    {
-      CScalar::TransMapTypes trans = scalarListDestP[scalarDstPos]->getAllTransformations();
-      CScalar::TransMapTypes::const_iterator itb = trans.begin(), it,
-                                           ite = trans.end();
-      int transformationOrder = 0;
-      for (it = itb; it != ite; ++it)
-      {
-        listAlgos_.push_back(std::make_pair(scalarPositionInGrid, std::make_pair(it->first, std::make_pair(transformationOrder,0))));        
-        ++transformationOrder;
-        std::vector<StdString> auxInput = (it->second)->checkAuxInputs();
-        for (int idx = 0; idx < auxInput.size(); ++idx) auxInputs_.push_back(auxInput[idx]);
-      }
-    }
-  }
-}
-CATCH
-
-/*!
-  Initialize the algorithms corresponding to transformation info contained in each axis.
-If an axis has transformations, these transformations will be represented in form of vector of CTransformation pointers
-In general, each axis can have several transformations performed on itself. However, should they be done seperately or combinely (of course in order)?
-For now, one approach is to do these combinely but maybe this needs changing.
-\param [in] axisPositionInGrid position of an axis in grid. (for example: a grid with one domain and one axis, position of domain is 1, position of axis is 2)
-*/
-void CGridTransformationSelector::initializeAxisAlgorithms(int axisPositionInGrid)
-TRY
-{
-  std::vector<CAxis*> axisListDestP = gridDestination_->getAxis();
-  std::vector<CAxis*> axisListSrcP = gridSource_->getAxis();
-  if (!axisListDestP.empty())
-  {
-    int axisDstPos = -1, axisSrcPos = -1;
-    if (0 < elementPositionInGridDst2AxisPosition_.count(axisPositionInGrid))
-      axisDstPos = elementPositionInGridDst2AxisPosition_[axisPositionInGrid];
-    if (0 < elementPositionInGridSrc2AxisPosition_.count(axisPositionInGrid))
-      axisSrcPos = elementPositionInGridSrc2AxisPosition_[axisPositionInGrid];
-
-    // If source and destination grid share the same axis
-    if ((-1 != axisDstPos) && (-1 != axisSrcPos) && !isSameGrid_ &&
-        ((axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) ||
-         (axisListDestP[axisDstPos]->isEqual(axisListSrcP[axisSrcPos]))) ) return;
-
-    if (axisListDestP[axisDstPos]->hasTransformation())
-    {
-      CAxis::TransMapTypes trans = axisListDestP[axisDstPos]->getAllTransformations();
-      CAxis::TransMapTypes::const_iterator itb = trans.begin(), it,
-                                           ite = trans.end();
-      int transformationOrder = 0;
-      for (it = itb; it != ite; ++it)
-      {
-        listAlgos_.push_back(std::make_pair(axisPositionInGrid, std::make_pair(it->first, std::make_pair(transformationOrder,1))));        
-        ++transformationOrder;
-        std::vector<StdString> auxInput = (it->second)->checkAuxInputs();
-        for (int idx = 0; idx < auxInput.size(); ++idx) auxInputs_.push_back(auxInput[idx]);
-      }
-    }
-  }
-}
-CATCH
-
-/*!
-  Initialize the algorithms corresponding to transformation info contained in each domain.
-If a domain has transformations, they will be represented in form of vector of CTransformation pointers
-In general, each domain can have several transformations performed on itself.
-\param [in] domPositionInGrid position of a domain in grid. (for example: a grid with one domain and one axis, position of domain is 1, position of axis is 2)
-*/
-void CGridTransformationSelector::initializeDomainAlgorithms(int domPositionInGrid)
-TRY
-{
-  std::vector<CDomain*> domListDestP = gridDestination_->getDomains();
-  std::vector<CDomain*> domListSrcP = gridSource_->getDomains();
-  if (!domListDestP.empty())
-  {
-    int domDstPos = -1, domSrcPos = -1;
-    if (0 < elementPositionInGridDst2DomainPosition_.count(domPositionInGrid))
-      domDstPos = elementPositionInGridDst2DomainPosition_[domPositionInGrid];
-    if (0 < elementPositionInGridSrc2DomainPosition_.count(domPositionInGrid))
-      domSrcPos = elementPositionInGridSrc2DomainPosition_[domPositionInGrid];
-
-    // If source and destination grid share the same domain
-    if ((-1 != domDstPos) && (-1 != domSrcPos) && !isSameGrid_ &&
-        ((domListDestP[domDstPos] == domListSrcP[domSrcPos]) ||
-         (domListDestP[domDstPos]->isEqual(domListSrcP[domSrcPos])))) return;
-
-    if (domListDestP[domDstPos]->hasTransformation())
-    {
-      CDomain::TransMapTypes trans = domListDestP[domDstPos]->getAllTransformations();
-      CDomain::TransMapTypes::const_iterator itb = trans.begin(), it,
-                                             ite = trans.end();
-      int transformationOrder = 0;
-      for (it = itb; it != ite; ++it)
-      {
-        listAlgos_.push_back(std::make_pair(domPositionInGrid, std::make_pair(it->first, std::make_pair(transformationOrder,2))));        
-        ++transformationOrder;
-        std::vector<StdString> auxInput = (it->second)->checkAuxInputs();
-        for (int idx = 0; idx < auxInput.size(); ++idx) auxInputs_.push_back(auxInput[idx]);
-      }
-    }
-  }
-}
-CATCH
-
-/*!
-  Select algorithm correspoding to its transformation type and its position in each element
-  \param [in] elementPositionInGrid position of element in grid. e.g: a grid has 1 domain and 1 axis, then position of domain is 1 (because it contains 2 basic elements)
-                                             and position of axis is 2
-  \param [in] transType transformation type, for now we have Zoom_axis, inverse_axis
-  \param [in] transformationOrder position of the transformation in an element (an element can have several transformation)
-  \param [in] algoType flag to specify type of algorithm (2 for domain, 1 for axis and 0 for scalar) 
-*/
-void CGridTransformationSelector::selectAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder, int algoType)
-TRY
-{
-  updateElementPosition();
-  switch (algoType)
-  {
-  case 0:
-    selectScalarAlgo(elementPositionInGrid, transType, transformationOrder);
-    break;
-  case 1:
-    selectAxisAlgo(elementPositionInGrid, transType, transformationOrder);
-    break;
-  case 2:
-    selectDomainAlgo(elementPositionInGrid, transType, transformationOrder);
-    break;
-  default:
-    break;
-  }
-}
-CATCH
-
-bool CGridTransformationSelector::isSpecialTransformation(ETranformationType transType)
-TRY
-{
-  bool res = false;
-  switch (transType)
-  {
-    case TRANS_GENERATE_RECTILINEAR_DOMAIN:
-     res = true;
-     break;
-    default:
-     break;
-  }
-
-  return res;
-}
-CATCH
-
-}
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation_selector.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/grid_transformation_selector.hpp	(revision 2010)
+++ 	(revision )
@@ -1,112 +1,0 @@
-/*!
-   \file grid_transformation.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Helper class to select different transformations.
- */
-#ifndef __XIOS_GRID_TRANSFORMATION_SELECTOR_HPP__
-#define __XIOS_GRID_TRANSFORMATION_SELECTOR_HPP__
-
-#include <map>
-#include <vector>
-#include "generic_algorithm_transformation.hpp"
-#include "transformation_enum.hpp"
-#include "duration.hpp"
-
-namespace xios {
-
-class CGrid;
-
-/*!
-  \class CGridTransformationSelector
-  This class is a helper class to chose a algorithm (transformation) from the algorithm list of
-specific grid.
-*/
-class CGridTransformationSelector
-{
-public:
-  // Stupid C++98, should be replaced with tuple.
-  // List of algorithm to process. Order of element in this list
-  // <Position of element in grid, <transformationType, <transformation order, alogrithm type> > >
-  typedef std::list<std::pair<int,std::pair<ETranformationType,std::pair<int,int> > > > ListAlgoType;
-protected:
-  enum AlgoType {
-    scalarType = 0, axisType = 1, domainType = 2
-  };
-
-protected:
-  enum TransformationType {
-    special = 0, normal = 1
-  };
-
-public:
-  /** Default constructor */
-  CGridTransformationSelector(CGrid* destination, CGrid* source, TransformationType type = normal);
-  virtual ~CGridTransformationSelector();
-
-  ListAlgoType getAlgoList() const { return listAlgos_; }
-  int getNbAlgo() { return nbNormalAlgos_; }
-  const std::vector<StdString>& getAuxInputs() const { return auxInputs_; }
-  const std::vector<CGenericAlgorithmTransformation*>& getAlgos() const { return algoTransformation_; }
-  const std::map<int, int> getElementPositionInGridSrc2AxisPosition() const { return elementPositionInGridSrc2AxisPosition_ ;}
-  const std::map<int, int> getElementPositionInGridSrc2DomainPosition() const { return elementPositionInGridSrc2DomainPosition_ ;}
-  const std::map<int, int> getElementPositionInGridSrc2ScalarPosition() const { return elementPositionInGridSrc2ScalarPosition_ ;}
-  const std::map<int, int> getElementPositionInGridDst2AxisPosition() const { return elementPositionInGridDst2AxisPosition_ ;}
-  const std::map<int, int> getElementPositionInGridDst2DomainPosition() const { return elementPositionInGridDst2DomainPosition_ ;}
-  const std::map<int, int> getElementPositionInGridDst2ScalarPosition() const { return elementPositionInGridDst2ScalarPosition_ ;}
-
-
-protected:
-  void updateElementPosition();
-  void initializeAlgorithms();
-  void initializeDomainAlgorithms(int domPositionInGrid);
-  void initializeAxisAlgorithms(int axisPositionInGrid);
-  void initializeScalarAlgorithms(int scalarPositionInGrid);
-  void initializeTransformations(TransformationType type);
-  void selectAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder, int algo);
-  bool isSpecialTransformation(ETranformationType transType);
-  void registerTransformations();
-
-protected:
-  virtual void selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) = 0;
-  virtual void selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) = 0;
-  virtual void selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) = 0;
-
-protected:
-  //! Grid source on transformation
-  CGrid* gridSource_;
-
-  //! Grid destination on transformation
-  CGrid* gridDestination_;
-
-  //! Grid source and grid destination it's the same
-  bool isSameGrid_;
-
-protected:
-  //! List of algorithm types and their order
-  ListAlgoType listAlgos_;
-
-  //! Number of normal algorithm
-  int nbNormalAlgos_;
-
-  //! Number of special algorithms (such as generate_rectilinear_grid)
-  int nbSpecialAlgos_;
-
-  // true if domain algorithm and false if axis algorithm (can be replaced by tuple with listAlgos_
-  std::vector<AlgoType> algoTypes_;
-
-  // Mapping between position of an element in grid and its transformation (if any)
-  std::vector<CGenericAlgorithmTransformation*> algoTransformation_;
-
-  //! Position of scalar, axis and domain in grid
-  std::map<int, int> elementPositionInGridSrc2AxisPosition_, elementPositionInGridSrc2DomainPosition_, elementPositionInGridSrc2ScalarPosition_;
-  std::map<int, int> elementPositionInGridDst2AxisPosition_, elementPositionInGridDst2DomainPosition_, elementPositionInGridDst2ScalarPosition_;
-
-  std::vector<StdString> auxInputs_;
-  std::set<Time> timeStamp_; //! Time stamps for auxillary inputs
-};
-
-}
-#endif // __XIOS_GRID_TRANSFORMATION_SELECTOR_HPP__
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.hpp	(revision 2011)
@@ -37,5 +37,5 @@
   int pos_;
 
-private:
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CScalar>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_axis.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_axis.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_axis.hpp	(revision 2011)
@@ -34,6 +34,6 @@
   static bool registerTrans();
 
-private:
 
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CScalar>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_domain.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_domain.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_domain.hpp	(revision 2011)
@@ -36,6 +36,6 @@
   CDomain* domainSrc_ ;
 
-private:
 
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CScalar>* transformation,
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_scalar.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_scalar.cpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_scalar.cpp	(revision 2011)
@@ -44,5 +44,5 @@
 
 CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(bool isSource, CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)
- : CScalarAlgorithmTransformation(isSource, scalarDestination, scalarSource), reduction_(0)
+ : CAlgorithmTransformationReduce(isSource)
 TRY
 {
@@ -57,14 +57,14 @@
   {
     case CReduceScalarToScalar::operation_attr::sum:
-      op = "sum";
+      operator_ = EReduction::sum;
       break;
     case CReduceScalarToScalar::operation_attr::min:
-      op = "min";
+      operator_ = EReduction::min;
       break;
     case CReduceScalarToScalar::operation_attr::max:
-      op = "max";
+      operator_ = EReduction::max;
       break;
     case CReduceScalarToScalar::operation_attr::average:
-      op = "average";
+      operator_ = EReduction::average;
       break;
     default:
@@ -75,27 +75,8 @@
 
   }
-  
-  if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op))
-    ERROR("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)",
-       << "Operation '" << op << "' not found. Please make sure to use a supported one"
-       << "Scalar source " <<scalarSource->getId() << std::endl
-       << "Scalar destination " << scalarDestination->getId());
+  transformationMapping_[0].push_back(0) ;
 
-  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]);
-}
-CATCH
-
-void CScalarAlgorithmReduceScalar::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut,
-                                         std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass)
-TRY
-{
-  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass);
-}
-CATCH
-
-void CScalarAlgorithmReduceScalar::updateData(CArray<double,1>& dataOut)
-TRY
-{
-  reduction_->updateData(dataOut);
+  scalarDestination->checkAttributes() ;
+  this->computeAlgorithm(scalarSource->getLocalView(CElementView::WORKFLOW), scalarDestination->getLocalView(CElementView::WORKFLOW)) ; 
 }
 CATCH
@@ -104,22 +85,7 @@
 TRY
 {
-  if (0 != reduction_) delete reduction_;
 }
 CATCH
 
-void CScalarAlgorithmReduceScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-TRY
-{
-  this->transformationMapping_.resize(1);
-  this->transformationWeight_.resize(1);
-
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationWeightMap& transWeight = this->transformationWeight_[0];
-
-  transMap[0].push_back(0);
-  transWeight[0].push_back(1.0);
 
 }
-CATCH
-
-}
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_scalar.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_scalar.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_reduce_scalar.hpp	(revision 2011)
@@ -6,5 +6,5 @@
 #define __XIOS_SCALAR_ALGORITHM_REDUCE_SCALAR_HPP__
 
-#include "scalar_algorithm_transformation.hpp"
+#include "algorithm_transformation_reduce.hpp"
 #include "transformation.hpp"
 
@@ -19,28 +19,16 @@
   Reducing an scalar to a scalar
 */
-class CScalarAlgorithmReduceScalar : public CScalarAlgorithmTransformation
+class CScalarAlgorithmReduceScalar : public CAlgorithmTransformationReduce
 {
 public:
   CScalarAlgorithmReduceScalar(bool isSource, CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo);
 
-  virtual void apply(const std::vector<std::pair<int,double> >& localIndex,
-                     const double* dataInput,
-                     CArray<double,1>& dataOut,
-                     std::vector<bool>& flagInitial,
-                     bool ignoreMissingValue, bool firstPass);
-
-  virtual void updateData(CArray<double,1>& dataOut);
-  
   virtual ~CScalarAlgorithmReduceScalar();
 
   static bool registerTrans();
 protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
+  
 
-protected:
-  CReductionAlgorithm* reduction_;
-
-private:
-
+public:
   static CGenericAlgorithmTransformation* create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
                                                 CTransformation<CScalar>* transformation,
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_transformation.cpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_transformation.cpp	(revision 2010)
+++ 	(revision )
@@ -1,124 +1,0 @@
-/*!
-   \file scalar_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 Oct 2016
-
-   \brief Interface for all scalar transformation algorithms.
- */
-
-#include "scalar_algorithm_transformation.hpp"
-#include "context.hpp"
-#include "context_client.hpp"
-#include "client_client_dht_template.hpp"
-#include "domain.hpp"
-#include "axis.hpp"
-#include "scalar.hpp"
-
-namespace xios {
-
-CScalarAlgorithmTransformation::CScalarAlgorithmTransformation(bool isSource, CScalar* scalarDestination, CScalar* scalarSource)
- : CGenericAlgorithmTransformation(isSource),
-   scalarDest_(scalarDestination),
-   scalarSrc_(scalarSource), axisSrc_(0), domainSrc_(0)
-{
-}
-
-CScalarAlgorithmTransformation::CScalarAlgorithmTransformation(bool isSource, CScalar* scalarDestination, CAxis* axisSource)
- : CGenericAlgorithmTransformation(isSource),
-   scalarDest_(scalarDestination),
-   scalarSrc_(0), axisSrc_(axisSource), domainSrc_(0)
-{
-}
-
-CScalarAlgorithmTransformation::CScalarAlgorithmTransformation(bool isSource, CScalar* scalarDestination, CDomain* domainSource)
- : CGenericAlgorithmTransformation(isSource),
-   scalarDest_(scalarDestination),
-   scalarSrc_(0), axisSrc_(0), domainSrc_(domainSource)
-{
-}
-
-CScalarAlgorithmTransformation::~CScalarAlgorithmTransformation()
-{
-}
-
-void CScalarAlgorithmTransformation::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
-{
-}
-
-/*!
-  Compute global index of element source on different processes on knowing the global index source of transformation
-
-  \param [in] globalIndexElementSource global index source of transformation (represented in the transformation mapping)
-  \param [in] elementSourceType type of element source
-  \param [out] globalIndexElementSourceOnProc processes which contain the corresponding global index of scalar source
-*/
-void CScalarAlgorithmTransformation::computeExchangeGlobalIndex(const CArray<size_t,1>& globalIndexElementSource,
-                                                                int elementSourceType,
-                                                                CClientClientDHTInt::Index2VectorInfoTypeMap& globalIndexElementSourceOnProc)
-TRY
-{
-  CContext* context = CContext::getCurrent();
-  int clientRank = context->intraCommRank_;
-  int clientSize = context->intraCommSize_;
-
-  if (2 == elementSourceType) // Source is a domain
-  {
-    size_t globalIndex;
-    int nIndexSize = domainSrc_->i_index.numElements();
-    CArray<int,1>& iIndex = domainSrc_->i_index;
-    CArray<int,1>& jIndex = domainSrc_->j_index;
-    int niGlo = domainSrc_->ni_glo;
-    CArray<bool,1>& localMask = domainSrc_ -> localMask ;
-    CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-    globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-    for (int idx = 0; idx < nIndexSize; ++idx)
-    {
-      if (localMask(idx))
-      {
-        globalIndex = jIndex(idx) * niGlo + iIndex(idx);
-        globalIndex2ProcRank[globalIndex].resize(1);
-        globalIndex2ProcRank[globalIndex][0] = clientRank;
-      }
-    }
-
-    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
-    dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource);
-    globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
-  }
-  else if (1 == elementSourceType) // Source is an axis
-  {
-    size_t globalIndex;
-    int nIndexSize = axisSrc_->index.numElements();
-    CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-    globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor()));
-    CArray<bool,1>& localMask = axisSrc_ -> mask ;
-   
-    for (int idx = 0; idx < nIndexSize; ++idx)
-    {
-      if (localMask(idx))
-      {
-        globalIndex = axisSrc_->index(idx);
-        globalIndex2ProcRank[globalIndex].resize(1);
-        globalIndex2ProcRank[globalIndex][0] = clientRank;
-      }
-    }
-
-    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
-    dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource);
-    globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
-  }
-  else // scalar
-  {
-    size_t globalIndex = 0;    
-    CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank;
-    globalIndex2ProcRank[globalIndex].resize(1);
-    globalIndex2ProcRank[globalIndex][0] = clientRank;
-
-    CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, context->intraComm_);
-    dhtIndexProcRank.computeIndexInfoMapping(globalIndexElementSource);
-    globalIndexElementSourceOnProc = dhtIndexProcRank.getInfoIndexMap();
-  }
-}
-CATCH
-}
Index: OS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_transformation.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/scalar_algorithm/scalar_algorithm_transformation.hpp	(revision 2010)
+++ 	(revision )
@@ -1,59 +1,0 @@
-/*!
-   \file scalar_algorithm_transformation.hpp
-   \author Ha NGUYEN
-   \since 23 June 2016
-   \date 23 June 2016
-
-   \brief Interface for all scalar transformation algorithms.
- */
-#ifndef __XIOS_SCALAR_ALGORITHM_TRANSFORMATION_HPP__
-#define __XIOS_SCALAR_ALGORITHM_TRANSFORMATION_HPP__
-
-#include "generic_algorithm_transformation.hpp"
-
-namespace xios {
-
-class CScalar;
-class CAxis;
-class CDomain;
-
-/*!
-  \class CScalarAlgorithmTransformation
-  Algorithms for scalar.
-*/
-class CScalarAlgorithmTransformation : public /*virtual*/ CGenericAlgorithmTransformation
-{
-public:
-  CScalarAlgorithmTransformation(bool isSource, CScalar* scalarDestination, CScalar* scalarSource);
-  CScalarAlgorithmTransformation(bool isSource, CScalar* scalarDestination, CAxis* axisSource);
-  CScalarAlgorithmTransformation(bool isSource, CScalar* scalarDestination, CDomain* domainSource);
-
-  virtual ~CScalarAlgorithmTransformation();
-
-protected:
-  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs);
-
-  virtual void computeExchangeGlobalIndex(const CArray<size_t,1>& globalScalarIndex,
-                                          int elementType,
-                                          CClientClientDHTInt::Index2VectorInfoTypeMap& globalScalarIndexOnProc);
-
-protected:
-  //! Global index of an scalar on grid destination
-  std::vector<int> scalarDestGlobalIndex_;
-
-  //! Size of
-  int scalarDestGlobalSize_;
-
-    //! Scalar on grid destination
-  CScalar* scalarDest_;
-
-  //! Scalar on grid source
-  CScalar* scalarSrc_;
-  //! Axis source
-  CAxis* axisSrc_;
-  //! Domain source
-  CDomain* domainSrc_;
-};
-
-}
-#endif // __XIOS_SCALAR_ALGORITHM_TRANSFORMATION_HPP__
Index: /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/transformation.hpp
===================================================================
--- /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/transformation.hpp	(revision 2010)
+++ /XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/transformation.hpp	(revision 2011)
@@ -13,4 +13,7 @@
     This class describes inverse_axis in xml file.
   */
+  class CGenericAlgorithmTransformation;
+   class CGrid;
+
   template<typename T>
   class CTransformation
@@ -36,4 +39,14 @@
       virtual const string& getName(void) { ERROR("string Transformation<T>::getId())",<< "unimplemented virtual function for child"); } ;
       virtual const string& getDefName(void) { ERROR("string Transformation<T>::getId())",<< "unimplemented virtual function for child"); } ;
+      virtual CGenericAlgorithmTransformation* createAlgorithm(bool isSource,
+                                                               CGrid* gridDst, CGrid* gridSrc,
+                                                               int elementPositionInGrid,
+                                                               std::map<int, int>& elementPositionInGridSrc2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridSrc2DomainPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2ScalarPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2AxisPosition,
+                                                               std::map<int, int>& elementPositionInGridDst2DomainPosition) =0 ;
+
       /// Destructeur ///
     public:
