Index: XIOS3/trunk/src/config/domain_attribute.conf
===================================================================
--- XIOS3/trunk/src/config/domain_attribute.conf	(revision 2498)
+++ XIOS3/trunk/src/config/domain_attribute.conf	(revision 2507)
@@ -62,4 +62,6 @@
 
 DECLARE_ARRAY(double, 2, area, false)
+DECLARE_ARRAY(double, 2, area_2d, false)
+DECLARE_ARRAY(double, 1, area_1d, false)
 DECLARE_ATTRIBUTE(double, radius)
 
Index: XIOS3/trunk/src/config/node_type.conf
===================================================================
--- XIOS3/trunk/src/config/node_type.conf	(revision 2498)
+++ XIOS3/trunk/src/config/node_type.conf	(revision 2507)
@@ -132,4 +132,16 @@
 #endif //__XIOS_CServiceNode__
 
+#ifdef __XIOS_CRedistributeDomain__
+   DECLARE_NODE(RedistributeDomain, redistribute_domain)
+#endif //__XIOS_CRedistributeDomain__
+
+#ifdef __XIOS_CRedistributeAxis__
+   DECLARE_NODE(RedistributeAxis, redistribute_axis)
+#endif //__XIOS_CRedistributeAxis__
+
+#ifdef __XIOS_CRedistributeScalar__
+   DECLARE_NODE(RedistributeScalar, redistribute_scalar)
+#endif //__XIOS_CRedistributeScalar__
+
 #ifdef __XIOS_CContext__
    DECLARE_NODE_PAR(Context, context)
Index: XIOS3/trunk/src/config/redistribute_axis_attribute.conf
===================================================================
--- XIOS3/trunk/src/config/redistribute_axis_attribute.conf	(revision 2507)
+++ XIOS3/trunk/src/config/redistribute_axis_attribute.conf	(revision 2507)
@@ -0,0 +1,3 @@
+DECLARE_ARRAY(int,1, index, false)
+DECLARE_ARRAY(bool, 1 , mask, false)
+DECLARE_ENUM5(type, index, root, bands, column, full)
Index: XIOS3/trunk/src/config/redistribute_domain_attribute.conf
===================================================================
--- XIOS3/trunk/src/config/redistribute_domain_attribute.conf	(revision 2507)
+++ XIOS3/trunk/src/config/redistribute_domain_attribute.conf	(revision 2507)
@@ -0,0 +1,3 @@
+DECLARE_ARRAY(int,1, index, false)
+DECLARE_ARRAY(bool, 1 , mask, false)
+DECLARE_ENUM5(type, index, root, bands, column, full)
Index: XIOS3/trunk/src/config/redistribute_scalar_attribute.conf
===================================================================
--- XIOS3/trunk/src/config/redistribute_scalar_attribute.conf	(revision 2507)
+++ XIOS3/trunk/src/config/redistribute_scalar_attribute.conf	(revision 2507)
@@ -0,0 +1,3 @@
+DECLARE_ARRAY(int,1, index, false)
+DECLARE_ARRAY(bool, 1 , mask, false)
+DECLARE_ENUM5(type, index, root, bands, column, full)
Index: XIOS3/trunk/src/distribution/grid_remote_connector.cpp
===================================================================
--- XIOS3/trunk/src/distribution/grid_remote_connector.cpp	(revision 2498)
+++ XIOS3/trunk/src/distribution/grid_remote_connector.cpp	(revision 2507)
@@ -99,7 +99,8 @@
       size_t globalIndexSize = globalIndex.numElements() ;
       
-      size_t allEqual ;
-      MPI_Allreduce(&globalIndexSize, &allEqual, 1, MPI_SIZE_T, MPI_BXOR, localComm_) ;
-      if (allEqual!=0) 
+      size_t minVal,maxVal ;
+      MPI_Allreduce(&globalIndexSize, &minVal, 1, MPI_SIZE_T, MPI_MIN, localComm_) ;
+      MPI_Allreduce(&globalIndexSize, &maxVal, 1, MPI_SIZE_T, MPI_MAX, localComm_) ;
+      if (minVal!=maxVal) 
       {
         isSrcViewDistributed_[i]=true ;
@@ -110,6 +111,7 @@
       size_t hashValue=0 ;
       for(size_t ind=0;ind<globalIndexSize;ind++) hashValue += hashGlobalIndex(globalIndex(ind)) ;
-      MPI_Allreduce(&hashValue, &allEqual, 1, MPI_SIZE_T, MPI_BXOR, localComm_) ;
-      if (allEqual!=0) isSrcViewDistributed_[i]=true ;
+      MPI_Allreduce(&hashValue, &minVal, 1, MPI_SIZE_T, MPI_MIN, localComm_) ;
+      MPI_Allreduce(&hashValue, &maxVal, 1, MPI_SIZE_T, MPI_MAX, localComm_) ;
+      if (minVal!=maxVal) isSrcViewDistributed_[i]=true ;
       else isSrcViewDistributed_[i]=false ;
     }
Index: XIOS3/trunk/src/distribution/transform_connector.hpp
===================================================================
--- XIOS3/trunk/src/distribution/transform_connector.hpp	(revision 2498)
+++ XIOS3/trunk/src/distribution/transform_connector.hpp	(revision 2507)
@@ -32,6 +32,8 @@
    
     public:
+      
+
       template<typename T> 
-      void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut)
+      void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut, bool useMissingValue, T missingValue)
       {
         map<int,CArray<T,1>> tmpArrayIn ;
@@ -58,6 +60,21 @@
         MPI_Waitall(requests.size(), requests.data(),status.data()) ;
         
-        const double nanValue = std::numeric_limits<double>::quiet_NaN();
-        gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut, nanValue) ;
+        if (useMissingValue) gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut, missingValue) ;
+        else gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut) ;
+ //       const double nanValue = std::numeric_limits<double>::quiet_NaN();
+ //       gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut, nanValue) ;
+      }
+
+      template<typename T> 
+      void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut)
+      {
+        T missingValue ;
+        transfer(1, sizeT, dataIn, dataOut, false, missingValue) ;
+      }
+
+      template<typename T> 
+      void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut, T missingValue)
+      {
+        transfer(1, sizeT, dataIn, dataOut, true, missingValue) ;
       }
 
@@ -66,4 +83,10 @@
       {
         transfer(1, sizeT, dataIn, dataOut) ;
+      }
+
+      template<typename T> 
+      void transfer(int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut, T missingValue)
+      {
+        transfer(1, sizeT, dataIn, dataOut, missingValue) ;
       }
    
@@ -74,4 +97,10 @@
       }
 
+      template<typename T> 
+      void transfer(const CArray<T,1>& dataIn, CArray<T,1>& dataOut, T missingValue)
+      {
+        transfer(1, 1, dataIn, dataOut, missingValue) ;
+      }
+
   };
 
Index: XIOS3/trunk/src/filter/client_online_reader_filter.cpp
===================================================================
--- XIOS3/trunk/src/filter/client_online_reader_filter.cpp	(revision 2507)
+++ XIOS3/trunk/src/filter/client_online_reader_filter.cpp	(revision 2507)
@@ -0,0 +1,100 @@
+#include "client_from_server_source_filter.hpp"
+#include "grid.hpp"
+#include "field.hpp"
+#include "file.hpp"
+#include "exception.hpp"
+#include "calendar_util.hpp"
+#include "context.hpp"
+#include "event_client.hpp"
+#include "timer.hpp"
+#include "tracer.hpp"
+#include <limits> 
+#include "workflow_graph.hpp"
+#include "grid_redistribute_filter_in.hpp"
+
+namespace xios
+{
+  CClientOnlineReaderFilter::CClientOnlineReaderFilter(CGarbageCollector& gc, CField* fieldOut)
+    : CFilter(gc, 1, this)
+  {
+    CContext* context = CContext::getCurrent();
+ 
+    CField* fieldIn ;
+    redistributeFilter_ = std::shared_ptr<CGridRedistributeFilterIn>(new CGridRedistributeFilterIn(gc, fieldOut, fieldIn));
+    fieldIn->setFileIn(fieldOut->getFileIn());
+    fieldOut->getFileIn()->replaceEnabledFields(fieldOut, fieldIn) ;
+    fileReaderSourceFilter_ = std::shared_ptr<CFileReaderSourceFilter>(new CFileReaderSourceFilter(gc, fieldIn));
+    fieldIn->solveServerOperation() ; // might not be called, create a new time functor.... find a better solution later
+
+// connect filters
+    fileReaderSourceFilter_->connectOutput(redistributeFilter_, 0);
+
+    field_ = fieldIn ;
+    freqOp_ = fieldOut->getRelFile()->output_freq ;
+    offset_ = fieldOut->freq_offset ;
+  }
+
+
+  void CClientOnlineReaderFilter::connectOutput(std::shared_ptr<CInputPin> inputPin, size_t inputSlot)
+  {
+    // connection to redistributeFilter cannot be done at construction time due to shared_from_this(), doing it now
+    redistributeFilter_->connectOutput(shared_from_this(), 0);
+    CFilter::connectOutput(inputPin,inputSlot) ;
+  }
+
+  CDataPacketPtr CClientOnlineReaderFilter::apply(std::vector<CDataPacketPtr> data)
+  {
+    const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate();
+    
+    data[0]->date = currentDate ;
+    data[0]->timestamp = currentDate ;
+
+    if (data[0]->status == CDataPacket::END_OF_STREAM)
+    {  
+      isEOF_=true ;
+      dateEOF_ = data[0]->date ;
+    }
+    return data[0];
+  }
+
+  bool CClientOnlineReaderFilter::sendReadDataRequest(const CDate& tsDataRequested)
+  {
+    CContext* context = CContext::getCurrent();
+    const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate();
+    CDate checkDate ;
+    if (isFirstDataSent_) checkDate = lastDateReceived_ + freqOp_ ;
+    else checkDate = context->getCalendar()->getInitDate() + offset_ ;
+    
+    if (currentDate >= checkDate)  
+    {
+      fileReaderSourceFilter_->streamData();
+      if (isFirstDataSent_)  lastDateReceived_ = lastDateReceived_ + freqOp_ ;
+      else lastDateReceived_ = context->getCalendar()->getInitDate() + offset_ ;
+      isFirstDataSent_ = true ;
+    }
+    return !isEOF_;
+  }
+
+  bool CClientOnlineReaderFilter::sendReadDataRequestIfNeeded(void)
+  TRY
+  {
+    const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate();
+    return sendReadDataRequest(currentDate);
+  }
+  CATCH
+
+  void CClientOnlineReaderFilter::checkForLateData(void)
+  TRY
+  {
+    return ;
+  }
+  CATCH
+
+  
+  bool CClientOnlineReaderFilter::isDataLate(void)
+  {
+    return false ; 
+  }
+
+
+} // namespace xios
Index: XIOS3/trunk/src/filter/client_online_reader_filter.hpp
===================================================================
--- XIOS3/trunk/src/filter/client_online_reader_filter.hpp	(revision 2507)
+++ XIOS3/trunk/src/filter/client_online_reader_filter.hpp	(revision 2507)
@@ -0,0 +1,64 @@
+#ifndef __XIOS_CLIENT_ONLINE_READER_FILTER__
+#define __XIOS_CLIENT_ONLINE_READER_FILTER__
+
+#include <map>
+
+#include "output_pin.hpp"
+#include "event_server.hpp"
+#include "context_client.hpp"
+#include "calendar_util.hpp"
+
+
+namespace xios
+{
+  class CGrid;
+  class CField;
+  class CGridRedistributeFilterIn ;
+  class CFileReaderSourceFilter ;
+
+  /*!
+   * A source filter is the entry point of the data in the graph of filters.
+   */
+  class CClientOnlineReaderFilter : public CFilter, public IFilterEngine, public std::enable_shared_from_this<CClientOnlineReaderFilter>
+  {
+    public:
+      /*!
+       * Constructs a source filter accepting data attached to the specified grid.
+       *
+       * \param gc the garbage collector associated with this filter
+       * \param field associated to the filter
+       */
+      CClientOnlineReaderFilter(CGarbageCollector& gc, CField* field);
+      virtual void connectOutput(std::shared_ptr<CInputPin> inputPin, size_t inputSlot) ;
+      /*!
+       * Transforms the data received from the model into a packet and send it
+       * in the filter graph. The array containing the data can safely be reused
+       * immediately after this method returns.
+       *
+       * \param event the event coming from server with the associated data
+       */
+      void streamData(CEventServer& event);
+      bool isDataLate(void) ;
+      bool isEOF() {return isEOF_ ;}
+      bool sendReadDataRequest(const CDate& tsDataRequested) ;
+      CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data);
+      bool sendReadDataRequestIfNeeded(void) ;
+      void checkForLateData(void) ;
+
+     private:
+      
+      CDuration freqOp_ ;
+      CDuration offset_ ;
+      CDate lastDateReceived_ ;
+      bool isFirstDataSent_ = false ;
+
+      CField* field_;
+      shared_ptr<CGridRedistributeFilterIn> redistributeFilter_ ;
+      std::shared_ptr<CFileReaderSourceFilter> fileReaderSourceFilter_ ; 
+
+      bool isEOF_ = false ;
+      CDate dateEOF_ ;
+  }; // class CClientFromServerSourceFilter
+} // namespace xios
+
+#endif // __XIOS_CLIENT_ONLINE_READER_FILTER__
Index: XIOS3/trunk/src/filter/client_online_writer_filter.cpp
===================================================================
--- XIOS3/trunk/src/filter/client_online_writer_filter.cpp	(revision 2507)
+++ XIOS3/trunk/src/filter/client_online_writer_filter.cpp	(revision 2507)
@@ -0,0 +1,32 @@
+#include "context.hpp"
+
+#include "grid_redistribute_filter.hpp"
+#include "client_online_writer_filter.hpp"
+#include "field.hpp"
+#include "file.hpp"
+
+
+namespace xios
+{
+
+
+CClientOnlineWriterFilter::CClientOnlineWriterFilter(CGarbageCollector& gc, CField* field)
+    : CFilter(gc, 1, this)
+  {
+    CField* fieldOut ;
+    redistributeFilter_ = std::shared_ptr<CGridRedistributeFilter>(new CGridRedistributeFilter(gc, field, fieldOut));
+    fieldOut->setFileOut(field->getFileOut());
+    field->getFileOut()->replaceEnabledFields(field, fieldOut) ;
+    fieldOut->solveServerOperation() ; // might not be called, create a new time functor.... find a better solution later
+    
+    fileWriterStoreFilter_ = std::shared_ptr<CFileWriterStoreFilter>(new CFileWriterStoreFilter(gc, fieldOut));
+    redistributeFilter_->connectOutput(fileWriterStoreFilter_, 0);
+    connectOutput(redistributeFilter_,1) ;
+  }
+  
+  CDataPacketPtr CClientOnlineWriterFilter::apply(std::vector<CDataPacketPtr> data)
+  {
+    return data[0];
+  }
+
+}
Index: XIOS3/trunk/src/filter/client_online_writer_filter.hpp
===================================================================
--- XIOS3/trunk/src/filter/client_online_writer_filter.hpp	(revision 2507)
+++ XIOS3/trunk/src/filter/client_online_writer_filter.hpp	(revision 2507)
@@ -0,0 +1,40 @@
+#ifndef __XIOS_CLIENT_ONLINE_WRITER_FILTER__
+#define __XIOS_CLIENT_ONLINE_WRITER_FILTER__
+
+#include <map>
+
+#include "output_pin.hpp"
+#include "event_server.hpp"
+#include "context_client.hpp"
+#include "calendar_util.hpp"
+
+
+namespace xios
+{
+  class CGrid;
+  class CField;
+  class CGridRedistributeFilter ;
+  class CFileWriterStoreFilter ;
+
+  /*!
+   * A source filter is the entry point of the data in the graph of filters.
+   */
+  class CClientOnlineWriterFilter : public CFilter, public IFilterEngine
+  {
+    public:
+      /*!
+       * Constructs a source filter accepting data attached to the specified grid.
+       *
+       * \param gc the garbage collector associated with this filter
+       * \param field associated to the filter
+       */
+      CClientOnlineWriterFilter(CGarbageCollector& gc, CField* field);
+      CDataPacketPtr apply(std::vector<CDataPacketPtr> data) ;
+     private:
+
+      std::shared_ptr<CGridRedistributeFilter> redistributeFilter_ ;
+      std::shared_ptr<CFileWriterStoreFilter> fileWriterStoreFilter_ ; 
+  }; // class CClientFromServerSourceFilter
+} // namespace xios
+
+#endif // __XIOS_ONLINE_WRITER_FILTER__
Index: XIOS3/trunk/src/filter/file_writer_store_filter.cpp
===================================================================
--- XIOS3/trunk/src/filter/file_writer_store_filter.cpp	(revision 2498)
+++ XIOS3/trunk/src/filter/file_writer_store_filter.cpp	(revision 2507)
@@ -29,4 +29,5 @@
     if (!field->prec.isEmpty() && field->prec == 2) hasRounding_ = true ;
     if (!field->default_value.isEmpty()) {hasDefaultValue_=true ; defaultValue_ = field->default_value ;}
+    context->registerFileToWrite(file_) ;
   }
 
Index: XIOS3/trunk/src/filter/grid_redistribute_filter.cpp
===================================================================
--- XIOS3/trunk/src/filter/grid_redistribute_filter.cpp	(revision 2507)
+++ XIOS3/trunk/src/filter/grid_redistribute_filter.cpp	(revision 2507)
@@ -0,0 +1,80 @@
+#include "grid_redistribute_filter.hpp"
+#include "workflow_graph.hpp"
+namespace xios
+{
+  
+  CGridRedistributeFilter::CGridRedistributeFilter(CGarbageCollector& gc, CField* fieldIn, CField* &fieldOut) 
+                                    : CFilter(gc, 1, this)
+  {
+    
+    CGrid* redistributedGrid = fieldIn->getGrid()->redistributeGridToWriter() ;
+    fieldOut = CField::create() ;
+    fieldOut->field_ref=fieldIn->getId();
+    fieldOut->solveRefInheritance() ;
+    fieldOut->grid_ref=redistributedGrid->getId();
+    fieldOut->domain_ref.reset();
+    fieldOut->axis_ref.reset();
+    fieldOut->scalar_ref.reset();
+    fieldOut-> solveGridReference() ;
+    fieldOut-> getGrid()-> solveElementsRefInheritance() ;
+    CGrid* newGrid ;
+    std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = redistributedGrid->buildTransformationGraph(gc, false,  fieldIn->getGrid(), false, 0. , newGrid, false, fieldOut) ;
+    fieldOut -> setGrid(newGrid) ;
+    fieldOut -> grid_ref = fieldOut->getGrid()->getId() ; // for server 
+    fieldOut->getGrid()->checkElementsAttributes() ;
+    redistributeConnector_ = fieldOut->getGrid()->getRedistributeToWriterConnector(fieldIn->getGrid()) ;
+  }
+
+  CDataPacketPtr CGridRedistributeFilter::apply(std::vector<CDataPacketPtr> data)
+  {
+    // for now, no auxilliairy field
+    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) 
+    {
+      // buildWorkflowGraph(data, packet, algorithm_);
+      
+      redistributeConnector_->transfer(data[0]->data, packet->data);
+    }
+    return packet;
+  }
+/*
+  void CTransformFilter::buildWorkflowGraph(std::vector<CDataPacketPtr> data, CDataPacketPtr packet, shared_ptr<CGridAlgorithm> algorithm)
+  {
+    if(this->graphEnabled)
+    {
+      this->graphPackage->filterId = CWorkflowGraph::getNodeSize();
+    
+      packet->graphPackage = new CGraphDataPackage;
+      if(data[0]->graphPackage)
+      {
+        packet->graphPackage->fromFilter = data[0]->graphPackage->fromFilter;
+      }
+      packet->graphPackage->toFilter = data[0]->graphPackage->toFilter;
+      packet->graphPackage->current_filter_name = data[0]->graphPackage->current_filter_name;
+      packet->graphPackage->contextId = data[0]->graphPackage->contextId;          
+    
+      int tmp_from = packet->graphPackage->fromFilter;
+      if(this->graphPackage->show)
+      {
+        packet->graphPackage->currentField = this->graphPackage->inFields[0];
+        CWorkflowGraph::addNode("Spatial transform filter "+algorithm->getAlgoName(), 4, false, 1, packet);
+        CWorkflowGraph::addEdge(packet->graphPackage->fromFilter, this->graphPackage->filterId, packet);
+        packet->graphPackage->fromFilter = this->graphPackage->filterId;
+        packet->graphPackage->currentField = this->graphPackage->inFields[0];
+        std::rotate(this->graphPackage->inFields.begin(), this->graphPackage->inFields.begin() + 1, this->graphPackage->inFields.end());
+      }
+      else
+      {
+        packet->graphPackage->currentField = this->graphPackage->inFields[0];
+        if(CXios::isClient) CWorkflowGraph::vectorOfNodes_->at(tmp_from).filter_name += algorithm->getAlgoName();
+        else                CWorkflowGraph::vectorOfNodes_srv_->at(tmp_from).filter_name += algorithm->getAlgoName();
+        
+      }     
+    }
+  }
+*/
+}
Index: XIOS3/trunk/src/filter/grid_redistribute_filter.hpp
===================================================================
--- XIOS3/trunk/src/filter/grid_redistribute_filter.hpp	(revision 2507)
+++ XIOS3/trunk/src/filter/grid_redistribute_filter.hpp	(revision 2507)
@@ -0,0 +1,33 @@
+#ifndef __XIOS_GRID_REDISTRIBUTE_FILTER_HPP__
+#define __XIOS_GRID_REDISTRIBUTE_FILTER_HPP__
+
+#include "filter.hpp"
+
+namespace xios
+{
+  
+  class CGridTransformConnector ;
+  /*!
+   * A filter to redistribute data from source grid to destination grid.
+   */
+    class CGridRedistributeFilter : public CFilter, IFilterEngine
+  {
+    public:
+
+      CGridRedistributeFilter(CGarbageCollector& gc, CField* fieldIn, CField* &fieldOut) ;
+
+    protected:
+      /*!
+        Overriding this function to process transformations with auxillary inputs
+      */
+      CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data) ;
+    
+    private:
+
+    shared_ptr<CGridTransformConnector> redistributeConnector_ ;
+  }; // class CTransformFilter
+
+
+} // namespace xios
+
+#endif //__XIOS_CSpatialTransformFilter__
Index: XIOS3/trunk/src/filter/grid_redistribute_filter_in.cpp
===================================================================
--- XIOS3/trunk/src/filter/grid_redistribute_filter_in.cpp	(revision 2507)
+++ XIOS3/trunk/src/filter/grid_redistribute_filter_in.cpp	(revision 2507)
@@ -0,0 +1,81 @@
+#include "grid_redistribute_filter_in.hpp"
+#include "workflow_graph.hpp"
+namespace xios
+{
+  
+  CGridRedistributeFilterIn::CGridRedistributeFilterIn(CGarbageCollector& gc, CField* fieldIn, CField* &fieldOut) 
+                                    : CFilter(gc, 1, this)
+  {
+    CGrid* redistributedGrid = fieldIn->getGrid()->redistributeGridToWriter() ;
+    fieldOut = CField::create() ;
+    fieldOut->field_ref=fieldIn->getId();
+    fieldOut->solveRefInheritance() ;
+    fieldOut->grid_ref=redistributedGrid->getId();
+    fieldOut->domain_ref.reset();
+    fieldOut->axis_ref.reset();
+    fieldOut->scalar_ref.reset();
+    fieldOut-> solveGridReference() ;
+    fieldOut-> getGrid()-> solveElementsRefInheritance() ;
+    CGrid* newGrid ;
+    std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = redistributedGrid->buildTransformationGraph(gc, false,  fieldIn->getGrid(), false, 0. , newGrid, false, fieldOut) ;
+    fieldOut -> setGrid(newGrid) ;
+    fieldOut -> grid_ref = fieldOut->getGrid()->getId() ; // for server 
+    fieldOut->getGrid()->checkElementsAttributes() ;
+
+    redistributeConnector_ = fieldIn->getGrid()->getRedistributeToWriterConnector(fieldOut->getGrid()) ;    
+
+  }
+
+  CDataPacketPtr CGridRedistributeFilterIn::apply(std::vector<CDataPacketPtr> data)
+  {
+    // for now, no auxilliairy field
+    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) 
+    {
+      // buildWorkflowGraph(data, packet, algorithm_);
+      
+      redistributeConnector_->transfer(data[0]->data, packet->data);
+    }
+    return packet;
+  }
+/*
+  void CTransformFilter::buildWorkflowGraph(std::vector<CDataPacketPtr> data, CDataPacketPtr packet, shared_ptr<CGridAlgorithm> algorithm)
+  {
+    if(this->graphEnabled)
+    {
+      this->graphPackage->filterId = CWorkflowGraph::getNodeSize();
+    
+      packet->graphPackage = new CGraphDataPackage;
+      if(data[0]->graphPackage)
+      {
+        packet->graphPackage->fromFilter = data[0]->graphPackage->fromFilter;
+      }
+      packet->graphPackage->toFilter = data[0]->graphPackage->toFilter;
+      packet->graphPackage->current_filter_name = data[0]->graphPackage->current_filter_name;
+      packet->graphPackage->contextId = data[0]->graphPackage->contextId;          
+    
+      int tmp_from = packet->graphPackage->fromFilter;
+      if(this->graphPackage->show)
+      {
+        packet->graphPackage->currentField = this->graphPackage->inFields[0];
+        CWorkflowGraph::addNode("Spatial transform filter "+algorithm->getAlgoName(), 4, false, 1, packet);
+        CWorkflowGraph::addEdge(packet->graphPackage->fromFilter, this->graphPackage->filterId, packet);
+        packet->graphPackage->fromFilter = this->graphPackage->filterId;
+        packet->graphPackage->currentField = this->graphPackage->inFields[0];
+        std::rotate(this->graphPackage->inFields.begin(), this->graphPackage->inFields.begin() + 1, this->graphPackage->inFields.end());
+      }
+      else
+      {
+        packet->graphPackage->currentField = this->graphPackage->inFields[0];
+        if(CXios::isClient) CWorkflowGraph::vectorOfNodes_->at(tmp_from).filter_name += algorithm->getAlgoName();
+        else                CWorkflowGraph::vectorOfNodes_srv_->at(tmp_from).filter_name += algorithm->getAlgoName();
+        
+      }     
+    }
+  }
+*/
+}
Index: XIOS3/trunk/src/filter/grid_redistribute_filter_in.hpp
===================================================================
--- XIOS3/trunk/src/filter/grid_redistribute_filter_in.hpp	(revision 2507)
+++ XIOS3/trunk/src/filter/grid_redistribute_filter_in.hpp	(revision 2507)
@@ -0,0 +1,33 @@
+#ifndef __XIOS_GRID_REDISTRIBUTE_FILTER_IN_HPP__
+#define __XIOS_GRID_REDISTRIBUTE_FILTER_IN_HPP__
+
+#include "filter.hpp"
+
+namespace xios
+{
+  
+  class CGridTransformConnector ;
+  /*!
+   * A filter to redistribute data from source grid to destination grid.
+   */
+    class CGridRedistributeFilterIn : public CFilter, IFilterEngine
+  {
+    public:
+
+      CGridRedistributeFilterIn(CGarbageCollector& gc, CField* fieldOut, CField* &fieldIn) ;
+
+    protected:
+      /*!
+        Overriding this function to process transformations with auxillary inputs
+      */
+      CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data) ;
+    
+    private:
+
+    shared_ptr<CGridTransformConnector> redistributeConnector_ ;
+  }; // class CTransformFilter
+
+
+} // namespace xios
+
+#endif //__XIOS_GRID_REDISTRIBUTE_FILTER_IN_HPP__
Index: XIOS3/trunk/src/filter/output_pin.hpp
===================================================================
--- XIOS3/trunk/src/filter/output_pin.hpp	(revision 2498)
+++ XIOS3/trunk/src/filter/output_pin.hpp	(revision 2507)
@@ -30,5 +30,5 @@
        * \param inputSlot the input slot number
        */
-      void connectOutput(std::shared_ptr<CInputPin> inputPin, size_t inputSlot);
+      void virtual connectOutput(std::shared_ptr<CInputPin> inputPin, size_t inputSlot);
 
       /*!
Index: XIOS3/trunk/src/generate_fortran_interface.cpp
===================================================================
--- XIOS3/trunk/src/generate_fortran_interface.cpp	(revision 2498)
+++ XIOS3/trunk/src/generate_fortran_interface.cpp	(revision 2507)
@@ -53,4 +53,8 @@
   CDuplicateScalarToAxis duplicateScalarToAxis;
   CReduceScalarToScalar reduceScalarToScalar;
+
+  CRedistributeDomain redistributeDomain ;
+  CRedistributeAxis   redistributeAxis ;
+  CRedistributeScalar redistributeScalar ;
   
   ostringstream oss;
@@ -329,4 +333,8 @@
   file.open((path+"ireorder_domain_attr.F90").c_str());
   reorderDomain.generateFortranInterface(file);
+  file.close();
+
+  file.open((path+"iredistribute_domain_attr.F90").c_str());
+  redistributeDomain.generateFortranInterface(file);
   file.close();
   
@@ -435,4 +443,9 @@
   duplicateScalarToAxis.generateFortranInterface(file);
   file.close();
+
+  file.open((path+"iredistribute_axis_attr.F90").c_str());
+  redistributeAxis.generateFortranInterface(file);
+  file.close();
+
   /*!
     Scalar transformations
@@ -488,4 +501,7 @@
   file.close();
 
+  file.open((path+"iredistribute_scalar_attr.F90").c_str());
+  redistributeScalar.generateFortranInterface(file);
+  file.close();
 
 
Index: XIOS3/trunk/src/group_factory_decl.cpp
===================================================================
--- XIOS3/trunk/src/group_factory_decl.cpp	(revision 2498)
+++ XIOS3/trunk/src/group_factory_decl.cpp	(revision 2507)
@@ -50,4 +50,7 @@
   macro(CPoolNodeGroup)
   macro(CServiceNodeGroup)
+  macro(CRedistributeDomainGroup)
+  macro(CRedistributeAxisGroup)
+  macro(CRedistributeScalarGroup)
 
 }
Index: XIOS3/trunk/src/group_template_decl.cpp
===================================================================
--- XIOS3/trunk/src/group_template_decl.cpp	(revision 2498)
+++ XIOS3/trunk/src/group_template_decl.cpp	(revision 2507)
@@ -39,4 +39,7 @@
   macro(PoolNode)
   macro(ServiceNode)
+  macro(RedistributeDomain)
+  macro(RedistributeAxis)
+  macro(RedistributeScalar)
 
 }
Index: XIOS3/trunk/src/io/nc4_data_input.cpp
===================================================================
--- XIOS3/trunk/src/io/nc4_data_input.cpp	(revision 2498)
+++ XIOS3/trunk/src/io/nc4_data_input.cpp	(revision 2507)
@@ -81,9 +81,9 @@
             if ((domain->type) != CDomain::type_attr::unstructured)
             {
-              start.push_back(domain->jbegin);
-              count.push_back(domain->nj);
+              start.push_back(domain->jbeginValue_);
+              count.push_back(domain->njValue_);
             }
-            start.push_back(domain->ibegin);
-            count.push_back(domain->ni);
+            start.push_back(domain->ibeginValue_);
+            count.push_back(domain->niValue_);
             --idxDomain;
           }
@@ -131,5 +131,5 @@
     // Verify the compatibility of dimension of declared grid and real grid in file
     int realGridDim = 1;
-    bool isUnstructuredGrid = ((gridDim < 2) ? false :  SuperClassWriter::isUnstructured(fieldId));
+    bool isUnstructuredGrid = ((gridDim < 2 || domainP.size()==0) ? false :  SuperClassWriter::isUnstructured(fieldId));
     std::map<StdString, StdSize> dimSizeMap = SuperClassWriter::getDimensions(&fieldId);
     std::list<StdString> dimList = SuperClassWriter::getDimensionsList(&fieldId);
Index: XIOS3/trunk/src/io/nc4_data_output.cpp
===================================================================
--- XIOS3/trunk/src/io/nc4_data_output.cpp	(revision 2498)
+++ XIOS3/trunk/src/io/nc4_data_output.cpp	(revision 2507)
@@ -202,6 +202,6 @@
                  else bounds_latid = "bounds_"+latName+appendDomid;
 
-                 SuperClassWriter::addDimension(dimXid, domain->ni);
-                 SuperClassWriter::addDimension(dimYid, domain->nj);
+                 SuperClassWriter::addDimension(dimXid, domain->niValue_);
+                 SuperClassWriter::addDimension(dimYid, domain->njValue_);
 
                  if (domain->hasBounds)
@@ -210,16 +210,16 @@
                  if (context->intraCommSize_ > 1)
                  {
-                   this->writeLocalAttributes(domain->ibegin,
-                                              domain->ni,
-                                              domain->jbegin,
-                                              domain->nj,
+                   this->writeLocalAttributes(domain->ibeginValue_,
+                                              domain->niValue_,
+                                              domain->jbeginValue_,
+                                              domain->njValue_,
                                               appendDomid);
 
                    if (singleDomain)
                     this->writeLocalAttributes_IOIPSL(dimXid, dimYid,
-                                                      domain->ibegin,
-                                                      domain->ni,
-                                                      domain->jbegin,
-                                                      domain->nj,
+                                                      domain->ibeginValue_,
+                                                      domain->niValue_,
+                                                      domain->jbeginValue_,
+                                                      domain->njValue_,
                                                       domain->ni_glo,domain->nj_glo,
                                                       context->intraCommRank_,context->intraCommSize_);
@@ -373,7 +373,7 @@
                      std::vector<StdSize> start(2) ;
                      std::vector<StdSize> count(2) ;
-                     start[1]=domain->ibegin;
-                     start[0]=domain->jbegin;
-                     count[1]=domain->ni ; count[0]=domain->nj ;
+                     start[1]=domain->ibeginValue_;
+                     start[0]=domain->jbeginValue_;
+                     count[1]=domain->niValue_ ; count[0]=domain->njValue_ ;
 
                      if (domain->hasLonLat)
@@ -391,14 +391,14 @@
                        std::vector<StdSize> count(1) ;
                        
-                       start[0]=domain->jbegin;
-                       count[0]=domain->nj;
+                       start[0]=domain->jbeginValue_;
+                       count[0]=domain->njValue_;
                        CArray<double,1> lat;
-                       lat.resize( domain->nj.getValue() );
-                       for (int j=0;j<domain->nj.getValue();j++) lat(j) = domain->latvalue(j*domain->ni.getValue());
+                       lat.resize( domain->njValue_);
+                       for (int j=0;j<domain->njValue_;j++) lat(j) = domain->latvalue(j*domain->niValue_);
                        SuperClassWriter::writeData(CArray<double,1>(lat.copy()), latid, isCollective, 0,&start,&count);
 
-                       start[0]=domain->ibegin;
-                       count[0]=domain->ni;
-                       CArray<double,1> lon = domain->lonvalue(Range(0,domain->ni-1));
+                       start[0]=domain->ibeginValue_;
+                       count[0]=domain->niValue_;
+                       CArray<double,1> lon = domain->lonvalue(Range(0,domain->niValue_-1));
                        SuperClassWriter::writeData(CArray<double,1>(lon.copy()), lonid, isCollective, 0,&start,&count);
                      }
@@ -419,9 +419,9 @@
                    {
                      start[2] = 0;
-                     start[1] = domain->ibegin;
-                     start[0] = domain->jbegin;
+                     start[1] = domain->ibeginValue_;
+                     start[0] = domain->jbeginValue_;
                      count[2] = domain->nvertex;
-                     count[1] = domain->ni;
-                     count[0] = domain->nj;
+                     count[1] = domain->niValue_;
+                     count[0] = domain->njValue_;
                    }
                  
@@ -435,8 +435,8 @@
                    std::vector<StdSize> count(2);
 
-                   start[1] = domain->ibegin;
-                   start[0] = domain->jbegin;
-                   count[1] = domain->ni;
-                   count[0] = domain->nj;
+                   start[1] = domain->ibeginValue_;
+                   start[0] = domain->jbeginValue_;
+                   count[1] = domain->niValue_;
+                   count[0] = domain->njValue_;
                    
                    SuperClassWriter::writeData(domain->areavalue, areaId, isCollective, 0, &start, &count);
@@ -703,6 +703,6 @@
                else
                {
-                 startNodes[0] = domain->ibegin;
-                 countNodes[0] = domain->ni ;
+                 startNodes[0] = domain->ibeginValue_;
+                 countNodes[0] = domain->niValue_ ;
                }
 
@@ -726,12 +726,12 @@
                else
                {
-                 startEdges[0] = domain->ibegin;
-                 countEdges[0] = domain->ni;
+                 startEdges[0] = domain->ibeginValue_;
+                 countEdges[0] = domain->niValue_;
                  startNodes[0] = domain->mesh->node_start;
                  countNodes[0] = domain->mesh->node_count;
                  if (countNodes[0]==0) startNodes[0]=0 ; // for netcdf error
-                 startEdgeNodes[0] = domain->ibegin;
+                 startEdgeNodes[0] = domain->ibeginValue_;
                  startEdgeNodes[1] = 0;
-                 countEdgeNodes[0] = domain->ni;
+                 countEdgeNodes[0] = domain->niValue_;
                  countEdgeNodes[1] = 2;
                }
@@ -763,6 +763,6 @@
                else
                {
-                 startFaces[0] = domain->ibegin;
-                 countFaces[0] = domain->ni ;
+                 startFaces[0] = domain->ibeginValue_;
+                 countFaces[0] = domain->niValue_ ;
                  startNodes[0] = domain->mesh->node_start;
                  countNodes[0] = domain->mesh->node_count;
@@ -785,6 +785,6 @@
                  countEdgeFaces[1]= 2;
                  
-                 startFaceConctv[0] = domain->ibegin;
-                 countFaceConctv[0] = domain->ni;
+                 startFaceConctv[0] = domain->ibeginValue_;
+                 countFaceConctv[0] = domain->niValue_;
                  startFaceConctv[1] = 0;
                  countFaceConctv[1] = domain->nvertex;
@@ -998,9 +998,9 @@
                  else
                  {
-                   start[0]=domain->ibegin;
-                   count[0]=domain->ni;
-                   startBounds[0]=domain->ibegin;
+                   start[0]=domain->ibeginValue_;
+                   count[0]=domain->niValue_;
+                   startBounds[0]=domain->ibeginValue_;
                    startBounds[1]=0 ;
-                   countBounds[0]=domain->ni;
+                   countBounds[0]=domain->niValue_;
                    countBounds[1]=nvertex ;
                  }
@@ -1110,5 +1110,5 @@
           if (!axis->label.isEmpty() && !SuperClassWriter::dimExist(strId)) SuperClassWriter::addDimension(strId, stringArrayLen);
 
-          if (axis->hasValue || !axis->label.isEmpty())
+          if (axis->hasValue() || !axis->label.isEmpty())
           {
             if (!axis->label.isEmpty()) dims.push_back(strId);
@@ -1499,5 +1499,5 @@
               }
 
-              firstGlobalIndex = domain->ibegin + domain->jbegin * domain->ni_glo;
+              firstGlobalIndex = domain->ibeginValue_ + domain->jbeginValue_ * domain->ni_glo;
 
               domain->addRelFileCompressed(this->filename);
@@ -2323,10 +2323,10 @@
                         if ((domain->type) != CDomain::type_attr::unstructured)
                         {
-                          start.push_back(domain->jbegin);
-                          count.push_back(domain->nj);
+                          start.push_back(domain->jbeginValue_);
+                          count.push_back(domain->njValue_);
                         }
                         --idx;
-                        start.push_back(domain->ibegin);
-                        count.push_back(domain->ni);
+                        start.push_back(domain->ibeginValue_);
+                        count.push_back(domain->niValue_);
                         --idx;
                       }
@@ -2383,11 +2383,11 @@
                       if ((domain->type) != CDomain::type_attr::unstructured)
                       {
-                        start.push_back(domain->jbegin);
-                        count.push_back(domain->nj);
+                        start.push_back(domain->jbeginValue_);
+                        count.push_back(domain->njValue_);
                       }
                       --idx ;
 
-                        start.push_back(domain->ibegin);
-                        count.push_back(domain->ni);
+                        start.push_back(domain->ibeginValue_);
+                        count.push_back(domain->niValue_);
                       --idx ;
                       --idxDomain;
Index: XIOS3/trunk/src/manager/services_manager.cpp
===================================================================
--- XIOS3/trunk/src/manager/services_manager.cpp	(revision 2498)
+++ XIOS3/trunk/src/manager/services_manager.cpp	(revision 2507)
@@ -227,7 +227,9 @@
     int leader ;
 
-    services_.clear() ;
     int nbServices ;
     buffer>>nbServices ;
+    bool newServices = nbServices != services_.size() ; 
+
+    services_.clear() ;
 
     for(int i=0;i<nbServices;i++) 
@@ -235,4 +237,6 @@
       buffer>>poolId>>serviceId>>partitionId>>type>>size>>nbPartitions>>leader ;
       services_[std::tuple<std::string,std::string,int>(poolId,serviceId,partitionId)]=std::make_tuple(type,size,nbPartitions,leader) ;
+      if (newServices)
+        info(40)<<"Receive new services informations : "<<poolId<<"::"<<serviceId<<"::"<<partitionId<<" => type : "<<type<<"  size : "<<size<<"  nbPartitions : "<<nbPartitions<<"  leader : "<<leader<<endl ;
     }
   }
@@ -256,14 +260,13 @@
                                         int& size, int& nbPartitions, int& leader, bool wait)
   {
-    
     winServices_->lockWindowShared(managerGlobalLeader_) ;
     winServices_->updateFromLockedWindow(managerGlobalLeader_, this, &CServicesManager::servicesDumpIn) ;
     winServices_->unlockWindow(managerGlobalLeader_) ;
-
+    
+    if (wait) waitServiceRegistration(poolId, serviceId, partitionId) ;
     auto it=services_.find(std::tuple<std::string,std::string,int>(poolId,serviceId,partitionId)) ;
-    if ( it == services_.end() && !wait) return false ;
+    if ( it == services_.end()) return false ;
     else
     {
-      if (wait) waitServiceRegistration(poolId, serviceId, partitionId) ;
       type= std::get<0>(it->second); 
       size= std::get<1>(it->second); 
@@ -279,6 +282,5 @@
     int size ;
     int nbPartitions;
-    //return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ;
-    return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader) ;
+    return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ;
   }
 
@@ -288,6 +290,5 @@
     int nbPartitions;
     int leader;
-    //return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ;
-    return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader) ;
+    return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ;
   }
 
@@ -297,13 +298,12 @@
     int type;
     int leader;
-    //return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ;
-    return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader) ;
+    return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ;
   }
 
   bool CServicesManager::hasService(const std::string& poolId, const std::string& serviceId, const int& partitionId)
   {
-    winServices_->lockWindow(managerGlobalLeader_,0) ;
-    winServices_->updateFromWindow(managerGlobalLeader_, this, &CServicesManager::servicesDumpIn) ;
-    winServices_->unlockWindow(managerGlobalLeader_,0) ;
+    winServices_->lockWindowShared(managerGlobalLeader_) ;
+    winServices_->updateFromLockedWindow(managerGlobalLeader_, this, &CServicesManager::servicesDumpIn) ;
+    winServices_->unlockWindow(managerGlobalLeader_) ;
     auto it=services_.find(std::tuple<std::string, std::string, int>(poolId, serviceId, partitionId)) ;
     if ( it == services_.end()) return false ;
Index: XIOS3/trunk/src/mpi_tools.cpp
===================================================================
--- XIOS3/trunk/src/mpi_tools.cpp	(revision 2498)
+++ XIOS3/trunk/src/mpi_tools.cpp	(revision 2507)
@@ -28,4 +28,7 @@
 
   template<>
+  MPI_Datatype MPI_GetType<bool>(void) { return MPI_CXX_BOOL ;}
+
+  template<>
   MPI_Datatype MPI_GetType<char>(void) { return MPI_CHAR ;}
 
Index: XIOS3/trunk/src/node/axis.cpp
===================================================================
--- XIOS3/trunk/src/node/axis.cpp	(revision 2498)
+++ XIOS3/trunk/src/node/axis.cpp	(revision 2507)
@@ -24,6 +24,6 @@
       : CObjectTemplate<CAxis>()
       , CAxisAttributes(), isChecked(false), relFiles()
-      , hasBounds(false), isCompressible_(false)
-      , transformationMap_(), hasValue(false), hasLabel(false)
+      , hasBounds_(false), isCompressible_(false)
+      , transformationMap_()
       , clients()
    {
@@ -33,6 +33,6 @@
       : CObjectTemplate<CAxis>(id)
       , CAxisAttributes(), isChecked(false), relFiles()
-      , hasBounds(false), isCompressible_(false)
-      , transformationMap_(), hasValue(false), hasLabel(false)
+      , hasBounds_(false), isCompressible_(false)
+      , transformationMap_()
       , clients()
    {
@@ -56,4 +56,6 @@
      m["temporal_splitting"] = TRANS_TEMPORAL_SPLITTING;
      m["duplicate_scalar"] = TRANS_DUPLICATE_SCALAR_TO_AXIS;
+     m["redistribute_axis"] = TRANS_REDISTRIBUTE_AXIS;
+
      return true;
    }
@@ -165,7 +167,7 @@
          size += CArray<bool,1>::size(n_glo);
          size += CArray<double,1>::size(n_glo);
-         if (hasBounds)
+         if (hasBounds_)
            size += CArray<double,2>::size(2*n_glo);
-         if (hasLabel)
+         if (hasLabel_)
           size += CArray<StdString,1>::size(n_glo);
        }
@@ -198,7 +200,7 @@
          size += CArray<bool,1>::size(it->second.size());
          size += CArray<double,1>::size(it->second.size());
-         if (hasBounds)
+         if (hasBounds_)
            size += CArray<double,2>::size(2 * it->second.size());
-         if (hasLabel)
+         if (hasLabel_)
            size += CArray<StdString,1>::size(it->second.size());
 
@@ -457,5 +459,5 @@
                                    << ") than the one defined by the \'size\' attribute (" << n.getValue() << ").")
           else return false ; 
-        this->hasValue = true;
+        this->hasValue_ = true;
       }
 
@@ -567,7 +569,7 @@
                                << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << ".")
          else return false ;
-       hasBounds = true;
-     }
-     else hasBounds = false;
+       hasBounds_ = true;
+     }
+     else hasBounds_ = false;
      return true ;
    }
@@ -585,7 +587,7 @@
                               << "label size is "<< label.extent(0)<<  " .")
         else return false ;
-      hasLabel = true;
-    }
-    else hasLabel = false;
+      hasLabel_ = true;
+    }
+    else hasLabel_ = false;
     return true ;
   }
@@ -1163,5 +1165,5 @@
     CContext* context = CContext::getCurrent();
 
-    if (hasValue)
+    if (hasValue_)
     {
       { // send level value
@@ -1173,5 +1175,5 @@
     }
 
-    if (hasBounds)
+    if (hasBounds_)
     {
       { // send bounds level value
@@ -1183,5 +1185,5 @@
     }
 
-    if (hasLabel)
+    if (hasLabel_)
     {
       { // send label
Index: XIOS3/trunk/src/node/axis.hpp
===================================================================
--- XIOS3/trunk/src/node/axis.hpp	(revision 2498)
+++ XIOS3/trunk/src/node/axis.hpp	(revision 2507)
@@ -175,8 +175,12 @@
          bool isEqual(CAxis* axis);
 
-      public: 
-        bool hasValue;        
-        bool hasBounds;
-        bool hasLabel;
+      private: 
+        bool hasValue_= false;        
+        bool hasBounds_= false;
+        bool hasLabel_= false;
+      public:
+        bool hasValue(void) { return hasValue_ ;}
+        bool hasBounds(void) { return hasBounds_ ;}
+        bool hasLabel(void) { return hasLabel_ ;}
 
       private:
Index: XIOS3/trunk/src/node/context.cpp
===================================================================
--- XIOS3/trunk/src/node/context.cpp	(revision 2498)
+++ XIOS3/trunk/src/node/context.cpp	(revision 2507)
@@ -7,4 +7,5 @@
 #include "duration.hpp"
 
+#include "online_context_client.hpp"
 #include "legacy_context_client.hpp"
 #include "legacy_context_server.hpp"
@@ -662,6 +663,5 @@
       
       int serviceType ;
-      //if (intraCommRank_==0) CXios::getServicesManager()->getServiceType(poolId, serviceId, 0, serviceType, true) ;
-      if (intraCommRank_==0) CXios::getServicesManager()->getServiceType(poolId, serviceId, 0, serviceType) ;
+      if (intraCommRank_==0) CXios::getServicesManager()->getServiceType(poolId, serviceId, 0, serviceType, true) ;
       MPI_Bcast(&serviceType,1,MPI_INT,0,intraComm_) ;
       
@@ -679,8 +679,13 @@
   vector<CContextClient*> CContext::getContextClient(const string& poolId, const string& serviceId)
   {
-    vector<pair<CContextClient*,CContextServer*>> clientServers ;
-    getServerInterComm(poolId, serviceId, clientServers ) ;
-    vector<CContextClient*> ret ;
-    for(auto& clientServer : clientServers) ret.push_back(clientServer.first) ;
+     vector<CContextClient*> ret ;
+    
+    if (serviceId=="attached") ret.push_back(onlineContextClient_) ;
+    else
+    {
+      vector<pair<CContextClient*,CContextServer*>> clientServers ;
+      getServerInterComm(poolId, serviceId, clientServers ) ;
+      for(auto& clientServer : clientServers) ret.push_back(clientServer.first) ;
+    }
     return ret ;
   }
@@ -808,5 +813,4 @@
       if (serviceType_==CServicesManager::CLIENT)
       {
-//ym        doPreTimestepOperationsForEnabledReadModeFiles(); // For now we only use server level 1 to read data
         triggerLateFields() ;
 
@@ -986,4 +990,6 @@
 
      CTimer::get("Context : close definition").resume() ;
+
+     onlineContextClient_=CContextClient::getNew<CContextClient::online>(this,intraComm_, intraComm_);
           
      // create intercommunicator with servers. 
@@ -1146,7 +1152,10 @@
     {
       for(auto field : fileInField) 
-      {
-        field->sendFieldToInputFileServer() ;
-        field->connectToServerInput(garbageCollector) ; // connect the field to server filter
+        if (field->getContextClient()->getType() != CContextClient::online) field->sendFieldToInputFileServer() ;
+
+      for(auto field : fileInField) 
+      {
+        if (field->getContextClient()->getType() == CContextClient::online) field->connectToOnlineReader(garbageCollector) ;
+        else field->connectToServerInput(garbageCollector) ; // connect the field to server filter
         fileInFields_.push_back(field) ;
       }
@@ -1158,7 +1167,9 @@
       for(auto field : fileOutField) 
       {
-        field->connectToFileServer(garbageCollector) ; // connect the field to server filter
-      }
-      for(auto field : fileOutField) field->sendFieldToFileServer() ;
+        if (field->getContextClient()->getType() == CContextClient::online)  field->connectToOnlineWriter(garbageCollector) ;
+        else  field->connectToFileServer(garbageCollector) ; // connect the field to server filter
+      }
+      for(auto field : fileOutField) 
+        if (field->getContextClient()->getType() != CContextClient::online) field->sendFieldToFileServer() ;
     }
 
@@ -1177,5 +1188,6 @@
       for(auto field : fileInField) 
       {
-        field->connectToServerToClient(garbageCollector) ;
+        if (field->getContextClient()->getType() == CContextClient::online) field->connectToOnlineReader(garbageCollector) ;
+        else field->connectToServerToClient(garbageCollector) ;
       }
     }
@@ -1232,6 +1244,8 @@
     if (serviceType_==CServicesManager::CLIENT) 
     {
-      for(auto field : fileOutField) slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ; 
-      for(auto field : fileInField) slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ; 
+      for(auto field : fileOutField)
+        if (field->getContextClient()->getType()!=CContextClient::online)  slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ; 
+      for(auto field : fileInField) 
+        if (field->getContextClient()->getType()!=CContextClient::online)  slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ; 
     }
     else if (serviceType_==CServicesManager::GATHERER) 
@@ -1242,10 +1256,9 @@
     for(auto& slaveServer : slaveServers_) sendCloseDefinition(slaveServer) ;
 
-    if (serviceType_==CServicesManager::WRITER)  
-    {
-      createFileHeader();
-    }
-
-    if (serviceType_==CServicesManager::CLIENT) startPrefetchingOfEnabledReadModeFiles();
+    createFileHeader();
+   
+    //if (serviceType_==CServicesManager::CLIENT) startPrefetchingOfEnabledReadModeFiles();
+    if (serviceType_==CServicesManager::CLIENT) 
+       for(auto field : fileInField) field->sendReadDataRequest(getCalendar()->getCurrentDate());  
    
     // send signal to couplerIn context that definition phasis is done
@@ -1356,16 +1369,4 @@
    CATCH_DUMP_ATTR
 
-
-   void CContext::postProcessFilterGraph()
-   TRY
-   {
-     int size = enabledFiles.size();
-     for (int i = 0; i < size; ++i)
-     {
-        enabledFiles[i]->postProcessFilterGraph();
-     }
-   }
-   CATCH_DUMP_ATTR
-
    void CContext::startPrefetchingOfEnabledReadModeFiles()
    TRY
@@ -1375,15 +1376,4 @@
      {
         enabledReadModeFiles[i]->prefetchEnabledReadModeFields();
-     }
-   }
-   CATCH_DUMP_ATTR
-
-   void CContext::doPreTimestepOperationsForEnabledReadModeFiles()
-   TRY
-   {
-     int size = enabledReadModeFiles.size();
-     for (int i = 0; i < size; ++i)
-     {
-        enabledReadModeFiles[i]->doPreTimestepOperationsForEnabledReadModeFields();
      }
    }
@@ -2177,5 +2167,6 @@
         if (serviceType_==CServicesManager::CLIENT) // For now we only use server level 1 to read data
         {
-          doPostTimestepOperationsForEnabledReadModeFiles();
+         // doPostTimestepOperationsForEnabledReadModeFiles();
+          for(auto& field : fileInFields_) field->sendReadDataRequestIfNeeded() ;
           garbageCollector.invalidate(calendar->getCurrentDate());
         }
@@ -2202,15 +2193,9 @@
    CATCH_DUMP_ATTR
 
-   //! Server side: Create header of netcdf file
+   //! Create header of netcdf file
    void CContext::createFileHeader(void)
    TRY
    {
-      vector<CFile*>::const_iterator it;
-
-      //for (it=enabledFiles.begin(); it != enabledFiles.end(); it++)
-      for (it=enabledWriteModeFiles.begin(); it != enabledWriteModeFiles.end(); it++)
-      {
-         (*it)->initWrite();
-      }
+      for(auto& file : filesToWrite_) file->initWrite();
    }
    CATCH_DUMP_ATTR
Index: XIOS3/trunk/src/node/context.hpp
===================================================================
--- XIOS3/trunk/src/node/context.hpp	(revision 2498)
+++ XIOS3/trunk/src/node/context.hpp	(revision 2507)
@@ -141,7 +141,5 @@
          void initReadFiles(void);
          void prepareTimeseries(void);
-         void postProcessFilterGraph();
          void startPrefetchingOfEnabledReadModeFiles();
-         void doPreTimestepOperationsForEnabledReadModeFiles();
          void doPostTimestepOperationsForEnabledReadModeFiles();
          void findFieldsWithReadAccess(void);
@@ -298,7 +296,12 @@
          // Determine context on server or not
          bool hasServer;
-
+      public:
+        void registerFileToWrite(CFile* file) { filesToWrite_.insert(file); } // Add a file that need to be write for example to create headers
+      private:  
+        std::set<CFile*> filesToWrite_ ;  
 
       private:
+        CContextClient* onlineContextClient_=nullptr ;
+        
         std::string defaultPoolWriterId_ ;
         std::string defaultPoolReaderId_ ;
Index: XIOS3/trunk/src/node/domain.cpp
===================================================================
--- XIOS3/trunk/src/node/domain.cpp	(revision 2498)
+++ XIOS3/trunk/src/node/domain.cpp	(revision 2507)
@@ -293,4 +293,5 @@
     \param [in] nbLocalDomain number of local domain on the domain destination
    */
+
    void CDomain::redistribute(int nbLocalDomain)
    TRY
@@ -862,5 +863,5 @@
         
 
-        if (!area.isEmpty()) area.transposeSelf(1, 0); // => to be checked why is it transposed
+//        if (!area.isEmpty()) area.transposeSelf(1, 0); // => to be checked why is it transposed
      }
 
@@ -914,4 +915,37 @@
    CATCH_DUMP_ATTR
 
+   void CDomain::compute2dBox(void)
+   {
+     if (i_index.numElements()==0)
+     {
+       ibeginValue_= 0 ;
+       jbeginValue_= 0 ;
+       niValue_= 0 ;
+       njValue_= 0 ;
+     }
+     else
+     {
+       int maxI=0 ;
+       int maxJ=0 ;
+       int minI=nj_glo*ni_glo ;
+       int minJ=nj_glo*ni_glo ;
+       int i,j,k,ij ;
+       for(int k=0; k<i_index.numElements(); k++)
+       {
+         ij=j_index(k)*ni_glo + i_index(k) ;
+         i=ij%ni_glo ;
+         j=ij/ni_glo ;
+         if (i<minI) minI=i;
+         if (j<minJ) minJ=j;
+         if (i>maxI) maxI=i;
+         if (j>maxJ) maxJ=j;
+       }
+       ibeginValue_=minI ;
+       jbeginValue_=minJ ;
+       niValue_=maxI-minI+1 ;
+       njValue_=maxJ-minJ+1 ;
+     }
+   }
+
    size_t CDomain::getGlobalWrittenSize(void)
    {
@@ -943,5 +977,5 @@
         {          
          // No information about ni
-          int minIndex = ni_glo - 1;
+          int minIndex = ni_glo*nj_glo - 1;
           int maxIndex = 0;
           for (int idx = 0; idx < i_index.numElements(); ++idx)
@@ -950,12 +984,11 @@
             if (i_index(idx) > maxIndex) maxIndex = i_index(idx);
           }
-	  if (i_index.numElements()) {
+	        if (i_index.numElements())
+          {
             ni = maxIndex - minIndex + 1; 
             minIIndex = minIndex;
           }	    
-	  else {
-            ni = 0;
-	  }
-        }
+	        else ni = 0;
+	      }
 
         // It's not so correct but if ibegin is not the first value of i_index 
@@ -1010,5 +1043,5 @@
         {
           // No information about nj
-          int minIndex = nj_glo - 1;
+          int minIndex = ni_glo*nj_glo - 1;
           int maxIndex = 0;
           for (int idx = 0; idx < j_index.numElements(); ++idx)
@@ -1354,4 +1387,123 @@
      }
      else if (!lonvalue_1d.isEmpty()  && !lonlatValueExisted)
+     {
+       if (type_attr::rectilinear == type)
+       {
+         if (ni == lonvalue_1d.numElements() && nj == latvalue_1d.numElements())
+         {
+           lonvalue.resize(ni * nj);
+           latvalue.resize(ni * nj);
+           if (hasBounds)
+           {
+             bounds_lonvalue.resize(nvertex, ni * nj);
+             bounds_latvalue.resize(nvertex, ni * nj);
+           }
+
+           for (int j = 0; j < nj; ++j)
+           {
+             for (int i = 0; i < ni; ++i)
+             {
+               int k = j * ni + i;
+
+               lonvalue(k) = lonvalue_1d(i);
+               latvalue(k) = latvalue_1d(j);
+
+               if (hasBounds)
+               {
+                 for (int n = 0; n < nvertex; ++n)
+                 {
+                   bounds_lonvalue(n,k) = bounds_lon_1d(n,i);
+                   bounds_latvalue(n,k) = bounds_lat_1d(n,j);
+                 }
+               }
+             }
+           }
+         }
+         else if (i_index.numElements() == lonvalue_1d.numElements() && j_index.numElements() == latvalue_1d.numElements()  && !lonlatValueExisted)
+         {
+           lonvalue.reference(lonvalue_1d.copy());
+           latvalue.reference(latvalue_1d.copy());
+           if (hasBounds)
+           {
+             bounds_lonvalue.reference(bounds_lon_1d.copy());
+             bounds_latvalue.reference(bounds_lat_1d.copy());
+           }
+         }
+         else
+           ERROR("CDomain::completeLonClient(void)",
+                 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
+                 << "'lonvalue_1d' and 'latvalue_1d' does not have the same size as the local domain." << std::endl
+                 << "'lonvalue_1d' size is " << lonvalue_1d.numElements() 
+                 << " and 'latvalue_1d' size is " << latvalue_1d.numElements() << std::endl 
+                 << " They should be correspondingly " << ni.getValue() << " and "  << nj.getValue() << " or " << std::endl
+                 << i_index.numElements() << " and "  << j_index.numElements() << ".");
+       }
+       else if (type == type_attr::curvilinear || type == type_attr::unstructured  && !lonlatValueExisted)
+       {
+         lonvalue.reference(lonvalue_1d.copy());
+         latvalue.reference(latvalue_1d.copy());
+         if (hasBounds)
+         {
+           bounds_lonvalue.reference(bounds_lon_1d.copy());
+           bounds_latvalue.reference(bounds_lat_1d.copy());
+         }
+       }
+     }
+
+     if (!area_2d.isEmpty() && areavalue.isEmpty())
+     {
+       areavalue.resize(ni*nj);
+       for (int j = 0; j < nj; ++j)
+       {
+         for (int i = 0; i < ni; ++i)
+         {
+           int k = j * ni + i;
+           areavalue(k) = area_2d(i,j);
+         }
+       }
+     }
+     else if (!area_1d.isEmpty() && areavalue.isEmpty()) areavalue.reference(area_1d.copy());
+
+   }
+   CATCH_DUMP_ATTR
+
+   /*
+     Convert internal longitude latitude value used by XIOS to "lonvalue_*" which can be retrieved with Fortran interface
+   */
+   void CDomain::convertLonLatValue(void)
+   TRY
+   {
+     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());
+     if (!lonvalue_2d.isEmpty() && lonlatValueExisted)
+     {
+       lonvalue_2d.resize(ni,nj);
+       latvalue_2d.resize(ni,nj);
+       if (hasBounds)
+       {
+         bounds_lon_2d.resize(nvertex, ni, nj);
+         bounds_lat_2d.resize(nvertex, ni, nj);
+       }
+
+       for (int j = 0; j < nj; ++j)
+       {
+         for (int i = 0; i < ni; ++i)
+         {
+           int k = j * ni + i;
+
+           lonvalue_2d(i,j) = lonvalue(k);
+           latvalue_2d(i,j) = latvalue(k);
+
+           if (hasBounds)
+           {
+             for (int n = 0; n < nvertex; ++n)
+             {
+               bounds_lon_2d(n,i,j) = bounds_lonvalue(n,k);
+               bounds_lat_2d(n,i,j) = bounds_latvalue(n,k);
+             }
+           }
+         }
+       }
+     }
+     else if (!lonvalue_1d.isEmpty()  && lonlatValueExisted)
      {
        if (type_attr::rectilinear == type)
@@ -1417,121 +1569,4 @@
        }
      }
-
-     if (!area.isEmpty() && areavalue.isEmpty())
-     {
-        areavalue.resize(ni*nj);
-       for (int j = 0; j < nj; ++j)
-       {
-         for (int i = 0; i < ni; ++i)
-         {
-           int k = j * ni + i;
-           areavalue(k) = area(i,j);
-         }
-       }
-     }
-   }
-   CATCH_DUMP_ATTR
-
-   /*
-     Convert internal longitude latitude value used by XIOS to "lonvalue_*" which can be retrieved with Fortran interface
-   */
-   void CDomain::convertLonLatValue(void)
-   TRY
-   {
-     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());
-     if (!lonvalue_2d.isEmpty() && lonlatValueExisted)
-     {
-       lonvalue_2d.resize(ni,nj);
-       latvalue_2d.resize(ni,nj);
-       if (hasBounds)
-       {
-         bounds_lon_2d.resize(nvertex, ni, nj);
-         bounds_lat_2d.resize(nvertex, ni, nj);
-       }
-
-       for (int j = 0; j < nj; ++j)
-       {
-         for (int i = 0; i < ni; ++i)
-         {
-           int k = j * ni + i;
-
-           lonvalue_2d(i,j) = lonvalue(k);
-           latvalue_2d(i,j) = latvalue(k);
-
-           if (hasBounds)
-           {
-             for (int n = 0; n < nvertex; ++n)
-             {
-               bounds_lon_2d(n,i,j) = bounds_lonvalue(n,k);
-               bounds_lat_2d(n,i,j) = bounds_latvalue(n,k);
-             }
-           }
-         }
-       }
-     }
-     else if (!lonvalue_1d.isEmpty()  && lonlatValueExisted)
-     {
-       if (type_attr::rectilinear == type)
-       {
-         if (ni == lonvalue_1d.numElements() && nj == latvalue_1d.numElements())
-         {
-           lonvalue.resize(ni * nj);
-           latvalue.resize(ni * nj);
-           if (hasBounds)
-           {
-             bounds_lonvalue.resize(nvertex, ni * nj);
-             bounds_latvalue.resize(nvertex, ni * nj);
-           }
-
-           for (int j = 0; j < nj; ++j)
-           {
-             for (int i = 0; i < ni; ++i)
-             {
-               int k = j * ni + i;
-
-               lonvalue(k) = lonvalue_1d(i);
-               latvalue(k) = latvalue_1d(j);
-
-               if (hasBounds)
-               {
-                 for (int n = 0; n < nvertex; ++n)
-                 {
-                   bounds_lonvalue(n,k) = bounds_lon_1d(n,i);
-                   bounds_latvalue(n,k) = bounds_lat_1d(n,j);
-                 }
-               }
-             }
-           }
-         }
-         else if (i_index.numElements() == lonvalue_1d.numElements() && j_index.numElements() == latvalue_1d.numElements()  && !lonlatValueExisted)
-         {
-           lonvalue.reference(lonvalue_1d);
-           latvalue.reference(latvalue_1d);
-            if (hasBounds)
-           {
-             bounds_lonvalue.reference(bounds_lon_1d);
-             bounds_latvalue.reference(bounds_lat_1d);
-           }
-         }
-         else
-           ERROR("CDomain::completeLonClient(void)",
-                 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
-                 << "'lonvalue_1d' and 'latvalue_1d' does not have the same size as the local domain." << std::endl
-                 << "'lonvalue_1d' size is " << lonvalue_1d.numElements() 
-                 << " and 'latvalue_1d' size is " << latvalue_1d.numElements() << std::endl 
-                 << " They should be correspondingly " << ni.getValue() << " and "  << nj.getValue() << " or " << std::endl
-                 << i_index.numElements() << " and "  << j_index.numElements() << ".");
-       }
-       else if (type == type_attr::curvilinear || type == type_attr::unstructured  && !lonlatValueExisted)
-       {
-         lonvalue.reference(lonvalue_1d);
-         latvalue.reference(latvalue_1d);
-         if (hasBounds)
-         {
-           bounds_lonvalue.reference(bounds_lon_1d);
-           bounds_latvalue.reference(bounds_lat_1d);
-         }
-       }
-     }
    }
    CATCH_DUMP_ATTR
@@ -1636,8 +1671,8 @@
    {
      bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements());
-     hasArea = !area.isEmpty();
+     hasArea = !area_1d.isEmpty() || !area_2d.isEmpty();
      if (hasArea && !hasAreaValue)
      {
-       if (area.extent(0) != ni || area.extent(1) != nj)
+       if (!area_2d.isEmpty() && (area_2d.extent(0) != ni || area_2d.extent(1) != nj))
        {
          ERROR("CDomain::checkArea(void)",
@@ -1645,18 +1680,16 @@
                << "The area does not have the same size as the local domain." << std::endl
                << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl
-               << "Area size is " << area.extent(0) << " x " << area.extent(1) << ".");
-       }
-//       if (areavalue.isEmpty())
-//       {
-//          areavalue.resize(ni*nj);
-//         for (int j = 0; j < nj; ++j)
-//         {
-//           for (int i = 0; i < ni; ++i)
-//           {
-//             int k = j * ni + i;
-//             areavalue(k) = area(i,j);
-//           }
-//         }
-//       }
+               << "Area size is " << area_2d.extent(0) << " x " << area_2d.extent(1) << ".");
+       }
+       
+       if (!area_1d.isEmpty() && area_1d.extent(0) != ni*nj)
+       {
+         ERROR("CDomain::checkArea(void)",
+               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
+               << "The area does not have the same size as the local domain." << std::endl
+               << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl
+               << "Area size is " << area_1d.extent(0) << " but must be ni*nj=" << ni*nj << " .");
+       }
+
      }
    }
@@ -1731,4 +1764,5 @@
       if (this->checkAttributes_done_) return;
       this->checkDomain();
+      this->compute2dBox() ;
       this->checkLonLat();
       this->checkBounds();
@@ -1803,5 +1837,5 @@
      excludedAttr.insert(excludedAttr.end(), { "mask_1d", "mask_2d" }); // ???
      excludedAttr.insert(excludedAttr.end(), { "bounds_lon_1d", "bounds_lat_1d", "bounds_lon_2d", "bounds_lat_2d" });
-     excludedAttr.insert(excludedAttr.end(), { "area" });
+     excludedAttr.insert(excludedAttr.end(), { "area_1d", "area_2d" });
      // private
      excludedAttr.insert(excludedAttr.end(), { "lon_start", "lon_end", "lat_start", "lat_end" });
@@ -1952,39 +1986,5 @@
     CContext* context = CContext::getCurrent();
     map<int, CArray<size_t,1>> globalIndex ;
-/* old method
-    if (type==EDistributionType::BANDS) // Bands distribution to send to file server
-    {
-      int nbServer = client->getRemoteSize();
-      std::vector<int> nGlobDomain(2);
-      nGlobDomain[0] = this->ni_glo;
-      nGlobDomain[1] = this->nj_glo;
-
-      // to be changed in future, need to rewrite more simply domain distribution
-      CServerDistributionDescription serverDescription(nGlobDomain, nbServer);
-      int distributedPosition ;
-      if (isUnstructed_) distributedPosition = 0 ;
-      else distributedPosition = 1 ;
-      
-      std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin();
-      std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes();
-      vector<unordered_map<size_t,vector<int>>> indexServerOnElement ;
-      CArray<int,1> axisDomainOrder(1) ; axisDomainOrder(0)=2 ;
-      auto zeroIndex=serverDescription.computeServerGlobalByElement(indexServerOnElement, context->getIntraCommRank(), context->getIntraCommSize(),
-                                                                  axisDomainOrder,distributedPosition) ;
-      // distribution is very bad => to redo
-      // convert indexServerOnElement => map<int,CArray<size_t,1>> - need to be changed later
-      map<int, vector<size_t>> vectGlobalIndex ;
-      for(auto& indexRanks : indexServerOnElement[0])
-      {
-        size_t index=indexRanks.first ;
-        auto& ranks=indexRanks.second ;
-        for(int rank : ranks) vectGlobalIndex[rank].push_back(index) ;
-      }
-      for(auto& vect : vectGlobalIndex ) globalIndex.emplace(vect.first, CArray<size_t,1>(vect.second.data(), shape(vect.second.size()),duplicateData)) ;
-    // some servers receves no index (zeroIndex array) => root process take them into account.
-      if (context->getIntraCommRank()==0) 
-        for(auto& rank : zeroIndex) globalIndex[rank] = CArray<size_t,1>() ; 
-    }
-*/    
+
     if (distType==EDistributionType::BANDS && isUnstructed_) distType=EDistributionType::COLUMNS ;
 
@@ -2134,6 +2134,4 @@
   CATCH
 
- 
-
   void CDomain::distributeToServer(CContextClient* client, bool inOut, map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn,
                                    shared_ptr<CScattererConnector> &scattererConnector, const string& domainId)
@@ -2409,6 +2407,6 @@
       CArray<double,1> value ;
       gathererConnector_->transfer(event, value, 0.); 
-      area.resize(ni,nj) ;
-      if (area.numElements()>0) area=CArray<double,2>(value.dataFirst(),shape(ni,nj),neverDeleteData) ; 
+      area_2d.resize(ni,nj) ;
+      if (area_2d.numElements()>0) area_2d=CArray<double,2>(value.dataFirst(),shape(ni,nj),neverDeleteData) ; 
     }
   }
@@ -2491,4 +2489,5 @@
     m["reorder_domain"] = TRANS_REORDER_DOMAIN;
     m["extract_domain"] = TRANS_EXTRACT_DOMAIN;
+    m["redistribute_domain"] = TRANS_REDISTRIBUTE_DOMAIN;
     return true;
   }
Index: XIOS3/trunk/src/node/domain.hpp
===================================================================
--- XIOS3/trunk/src/node/domain.hpp	(revision 2498)
+++ XIOS3/trunk/src/node/domain.hpp	(revision 2507)
@@ -214,4 +214,8 @@
          CArray<double, 2> bounds_lonvalue, bounds_latvalue;
          CArray<double, 1> areavalue;
+         int niValue_ ;
+         int njValue_ ;
+         int ibeginValue_ ;
+         int jbeginValue_ ;
 
 
@@ -241,4 +245,5 @@
          void checkArea(void);
          void checkLonLat();
+         void compute2dBox(void) ;
          
        public:
Index: XIOS3/trunk/src/node/field.cpp
===================================================================
--- XIOS3/trunk/src/node/field.cpp	(revision 2498)
+++ XIOS3/trunk/src/node/field.cpp	(revision 2507)
@@ -20,5 +20,7 @@
 #include "temporal_filter.hpp"
 #include "server_from_client_source_filter.hpp"
+#include "client_online_reader_filter.hpp"
 #include "file_reader_source_filter.hpp"
+#include "grid_redistribute_filter.hpp"
 #include "tracer.hpp"
 #include "graph_package.hpp"
@@ -205,5 +207,7 @@
   TRY
   {
-    return clientFromServerSourceFilter_->sendReadDataRequest(tsDataRequested) ;
+    if (clientFromServerSourceFilter_) return clientFromServerSourceFilter_->sendReadDataRequest(tsDataRequested) ;
+    else if (clientOnlineReaderFilter_) return clientOnlineReaderFilter_->sendReadDataRequest(tsDataRequested) ;
+    else ERROR("bool CField::sendReadDataRequest(const CDate& tsDataRequested)", << "uninitialized source filter");
   }
   CATCH_DUMP_ATTR
@@ -217,5 +221,7 @@
   TRY
   {
-    return clientFromServerSourceFilter_->sendReadDataRequestIfNeeded() ;
+    if (clientFromServerSourceFilter_) return clientFromServerSourceFilter_->sendReadDataRequestIfNeeded() ;
+    else if (clientOnlineReaderFilter_) return clientOnlineReaderFilter_->sendReadDataRequestIfNeeded() ;
+    else ERROR("bool CField::sendReadDataRequestIfNeeded(void)", << "uninitialized source filter");
   }
   CATCH_DUMP_ATTR
@@ -304,5 +310,7 @@
   TRY
   {
-    clientFromServerSourceFilter_->checkForLateData() ;
+    if (clientFromServerSourceFilter_) return clientFromServerSourceFilter_->checkForLateData() ;
+    else if (clientOnlineReaderFilter_) return clientOnlineReaderFilter_->checkForLateData() ;
+    else ERROR("void CField::checkForLateDataFromServer(void)", << "uninitialized source filter");
   }
   CATCH_DUMP_ATTR 
@@ -315,5 +323,6 @@
     {
       checkForLateDataFromServer() ;
-      clientFromServerSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ;
+      if (clientFromServerSourceFilter_) clientFromServerSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ;
+      else if (clientOnlineReaderFilter_) clientOnlineReaderFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ;
     } 
     else if (hasCouplerIn())
@@ -325,20 +334,5 @@
   CATCH_DUMP_ATTR
 
-
-  void CField::checkIfMustAutoTrigger(void)
-  TRY
-  {
-    mustAutoTrigger = clientFromServerSourceFilter_ ? clientFromServerSourceFilter_->mustAutoTrigger() : false;
-  }
-  CATCH_DUMP_ATTR
-
-  void CField::autoTriggerIfNeeded(void)
-  TRY
-  {
-    if (mustAutoTrigger)
-      clientFromServerSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate());
-  }
-  CATCH_DUMP_ATTR
-
+  
 
   //----------------------------------------------------------------
@@ -506,7 +500,7 @@
                                               bool bufferForWriting)
   {
-    auto& contextBufferSize = bufferSize[client] ;
-    auto& contextMaxEventSize = maxEventSize[client] ;
-    const std::map<int, size_t> mapSize = grid_->getDataBufferSize(client, getId(), bufferForWriting);
+    auto& contextBufferSize = bufferSize[client_] ;
+    auto& contextMaxEventSize = maxEventSize[client_] ;
+    const std::map<int, size_t> mapSize = grid_->getDataBufferSize(client_, getId(), bufferForWriting);
     for(auto& it : mapSize )
     {
@@ -525,7 +519,7 @@
                                                    bool bufferForWriting)
   {
-    auto& contextBufferSize = bufferSize[client] ;
-    auto& contextMaxEventSize = maxEventSize[client] ;
-    const std::map<int, size_t> mapSize = grid_->getAttributesBufferSize(client, bufferForWriting);
+    auto& contextBufferSize = bufferSize[client_] ;
+    auto& contextMaxEventSize = maxEventSize[client_] ;
+    const std::map<int, size_t> mapSize = grid_->getAttributesBufferSize(client_, bufferForWriting);
     for(auto& it : mapSize )
     {
@@ -797,5 +791,5 @@
   {
     // insert temporal filter before sending to files
-    clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client));
+    clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client_));
     // insert temporal filter before sending to files
     getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(clientToServerStoreFilter_, 0);
@@ -809,8 +803,54 @@
   } 
 
+/*
+  void CField::connectToOnlineWriter(CGarbageCollector& gc)
+  {
+    // insert temporal filter before sending to files
+    CField* fieldOut ;
+    redistributeFilter_ = std::shared_ptr<CGridRedistributeFilter>(new CGridRedistributeFilter(gc, this, fieldOut));
+    fieldOut->setFileOut(this->getFileOut());
+    fileOut_->replaceEnabledFields(this, fieldOut) ;
+    // insert temporal filter before sending to files
+    getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(redistributeFilter_, 0);
+    fieldOut->inputFilter = std::shared_ptr<CPassThroughFilter>(new CPassThroughFilter(gc)); 
+    fieldOut->instantDataFilter = fieldOut->inputFilter ;
+    redistributeFilter_->connectOutput(fieldOut->inputFilter, 0);
+    fieldOut->connectToFileWriter(gc) ;
+    fieldOut->solveServerOperation() ; // might not be called, create a new time functor.... find a better solution later
+    const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ;
+  
+    if(buildGraph_) 
+    {
+      clientToServerStoreFilter_->graphPackage = new CGraphPackage;
+      clientToServerStoreFilter_->graphEnabled = true;
+      clientToServerStoreFilter_->graphPackage->inFields.push_back(this);
+    }
+  } 
+*/
+  void CField::connectToOnlineWriter(CGarbageCollector& gc)
+  {
+    // insert temporal filter before sending to files
+    clientOnlineWriterFilter_ = std::shared_ptr<CClientOnlineWriterFilter>(new CClientOnlineWriterFilter(gc,this)) ;
+    getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(clientOnlineReaderFilter_, 0);
+   
+    const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ;
+  
+    if(buildGraph_) 
+    {
+      // to do
+    }
+  } 
+
+  void CField::connectToOnlineReader(CGarbageCollector& gc)
+  {
+    // insert temporal filter before sending to files
+    clientOnlineReaderFilter_ = std::shared_ptr<CClientOnlineReaderFilter>(new CClientOnlineReaderFilter(gc,this)) ;
+    clientOnlineReaderFilter_ -> connectOutput(inputFilter,0) ;
+  } 
+
   void CField::connectToCouplerOut(CGarbageCollector& gc)
   {
     // insert temporal filter before sending to files
-    clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client));
+    clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client_));
     instantDataFilter->connectOutput(clientToServerStoreFilter_, 0);
     const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ;
@@ -951,5 +991,5 @@
   void CField::connectToServerToClient(CGarbageCollector& gc)
   {
-    serverToClientStoreFilter_ = std::shared_ptr<CServerToClientStoreFilter>(new CServerToClientStoreFilter(gc, this, client));
+    serverToClientStoreFilter_ = std::shared_ptr<CServerToClientStoreFilter>(new CServerToClientStoreFilter(gc, this, client_));
     instantDataFilter->connectOutput(serverToClientStoreFilter_, 0);
     const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ;
@@ -1435,5 +1475,5 @@
   {
     CContext* context = CContext::getCurrent();
-    client = contextClient;
+    client_ = contextClient;
   
     // A grid is sent by a client (both for read or write) or by primary server (write only)
@@ -1441,11 +1481,12 @@
     {
       if (getRelFile()->mode.isEmpty() || (!getRelFile()->mode.isEmpty() && getRelFile()->mode == CFile::mode_attr::write))
-        grid_->setContextClient(contextClient);
+        /*grid_->setContextClient(contextClient) */; // => nothing to do with thats now, to remove...
     }
     else if (context->getServiceType()==CServicesManager::CLIENT)
     {
       if (grid_)
-        grid_->setContextClient(contextClient);
+        /*grid_->setContextClient(contextClient)*/; // => nothing to do with thats now, to remove...
       else
+
         ERROR( "CField::setContextClient(contextClient)",
                << "Grid not defined for " << getId()
@@ -1459,24 +1500,24 @@
   void CField::sendFieldToFileServer(void)
   {
-    CContext::getCurrent()->sendContextToFileServer(client);
-    getRelFile()->sendFileToFileServer(client);
+    CContext::getCurrent()->sendContextToFileServer(client_);
+    getRelFile()->sendFileToFileServer(client_);
     sentGrid_ = grid_-> duplicateSentGrid() ;
-    sentGrid_->sendGridToFileServer(client, false);
+    sentGrid_->sendGridToFileServer(client_, false);
     name = getFieldOutputName() ;
-    this->sendAllAttributesToServer(client);
-    this->sendAddAllVariables(client);
+    this->sendAllAttributesToServer(client_);
+    this->sendAddAllVariables(client_);
   }
 
   void CField::sendFieldToInputFileServer(void)
   {
-    CContext::getCurrent()->sendContextToFileServer(client);
-    getRelFile()->sendFileToFileServer(client);
+    CContext::getCurrent()->sendContextToFileServer(client_);
+    getRelFile()->sendFileToFileServer(client_);
     sentGrid_ = grid_-> duplicateSentGrid() ;
-    sentGrid_->sendGridToFileServer(client, true);
+    sentGrid_->sendGridToFileServer(client_, true);
     read_access=true ; // not the best solution, but on server side, the field must be a starting point of the workflow
                        // must be replace by a better solution when implementing filters for reading and send to client
                        // on server side
-    this->sendAllAttributesToServer(client);
-    this->sendAddAllVariables(client);
+    this->sendAllAttributesToServer(client_);
+    this->sendAddAllVariables(client_);
   }
 
@@ -1486,5 +1527,5 @@
     else sendFieldToCouplerOut_done_=true ;
     sentGrid_ = grid_-> duplicateSentGrid() ;
-    sentGrid_->sendGridToCouplerOut(client, this->getId());
+    sentGrid_->sendGridToCouplerOut(client_, this->getId());
     this->sendGridCompleted();
 
@@ -1502,12 +1543,12 @@
       CEventClient event(getType(),EVENT_ID_GRID_COMPLETED);
 
-      if (client->isServerLeader())
+      if (client_->isServerLeader())
       {
         CMessage msg;
         msg<<this->getId();
-        for (auto& rank : client->getRanksServerLeader()) event.push(rank,1,msg);
-        client->sendEvent(event);
-      }
-      else client->sendEvent(event);
+        for (auto& rank : client_->getRanksServerLeader()) event.push(rank,1,msg);
+        client_->sendEvent(event);
+      }
+      else client_->sendEvent(event);
    }
    CATCH_DUMP_ATTR
Index: XIOS3/trunk/src/node/field.hpp
===================================================================
--- XIOS3/trunk/src/node/field.hpp	(revision 2498)
+++ XIOS3/trunk/src/node/field.hpp	(revision 2507)
@@ -28,4 +28,6 @@
 #include "client_to_server_store_filter.hpp"
 #include "file_reader_source_filter.hpp"
+#include "client_online_reader_filter.hpp"
+#include "client_online_writer_filter.hpp"
 
 
@@ -56,4 +58,5 @@
    class CSourceFilter;
    class CServerToClientFilter;
+   class CGridRedistributeFilter;
    ///--------------------------------------------------------------
 
@@ -199,6 +202,4 @@
         void checkForLateDataFromCoupler(void) ;
 
-        void checkIfMustAutoTrigger(void); // ym obsolete
-        void autoTriggerIfNeeded(void); //ym obsolete
         void triggerLateField(void) ;
 
@@ -237,4 +238,6 @@
         void connectToFileReader(CGarbageCollector& gc) ;
         void connectToServerToClient(CGarbageCollector& gc) ;
+        void connectToOnlineWriter(CGarbageCollector& gc) ;
+        void connectToOnlineReader(CGarbageCollector& gc) ;
 
         void setContextClientDataBufferSize(map<CContextClient*,map<int,size_t>>& bufferSize, 
@@ -267,4 +270,5 @@
          CGrid*  grid_=nullptr;
          CGrid* getGrid(void) { return grid_; } 
+         void setGrid(CGrid* grid) { grid_=grid; } 
       
       private:
@@ -327,8 +331,8 @@
         
       private:
-         CContextClient* client;
+         CContextClient* client_;
       public:
          void setContextClient(CContextClient* newContextClient);
-         CContextClient* getContextClient(void) {return client;}
+         CContextClient* getContextClient(void) {return client_;}
 
       private:
@@ -372,6 +376,4 @@
          std::shared_ptr<COutputPin> selfReferenceFilter; // probably redondant with inputFilter
 
-         //! The source filter for data provided by the client
-//         std::shared_ptr<CSourceFilter> clientSourceFilter; // obsolete to remove
  
          //! The source filter for data provided by the model to enter the client workflow
@@ -393,7 +395,4 @@
          std::shared_ptr<CFileReaderSourceFilter> fileReaderSourceFilter_;
 
-         //! The source filter for data provided by the server
-//         std::shared_ptr<CSourceFilter> serverSourceFilter; // obsolete to remove
-        
          //! The terminal filter which send data to server for writing
          std::shared_ptr<CClientToServerStoreFilter> clientToServerStoreFilter_;
@@ -405,4 +404,13 @@
          std::shared_ptr<CServerToClientStoreFilter> serverToClientStoreFilter_;
 
+         //! the filter to redistribute data before to call the fileWriterStoreFilter ==> to remove
+         std::shared_ptr<CGridRedistributeFilter>  redistributeFilter_ ;
+
+          //! the filter to connect to online reader
+         std::shared_ptr<CClientOnlineReaderFilter>  clientOnlineReaderFilter_ ;
+
+          //! the filter to connect to online writer
+         std::shared_ptr<CClientOnlineWriterFilter>  clientOnlineWriterFilter_ ;
+
 
    }; // class CField
Index: XIOS3/trunk/src/node/file.cpp
===================================================================
--- XIOS3/trunk/src/node/file.cpp	(revision 2498)
+++ XIOS3/trunk/src/node/file.cpp	(revision 2507)
@@ -178,4 +178,11 @@
 
       return (this->enabledFields);
+   }
+   CATCH_DUMP_ATTR
+
+   void CFile::replaceEnabledFields(CField* fieldIn, CField* fieldOut)
+   TRY
+   {
+     for(auto& enableField : enabledFields) if (enableField==fieldIn) enableField=fieldOut ;
    }
    CATCH_DUMP_ATTR
@@ -979,18 +986,4 @@
 
    /*!
-    * Post-process the filter graph for each active field.
-    */
-   void CFile::postProcessFilterGraph()
-   TRY
-   {
-     int size = this->enabledFields.size();
-     for (int i = 0; i < size; ++i)
-     {
-       this->enabledFields[i]->checkIfMustAutoTrigger();
-     }
-   }
-   CATCH_DUMP_ATTR
-
-   /*!
      Prefetching the data for enabled fields read from file.
    */
@@ -1004,24 +997,4 @@
      for (int i = 0; i < size; ++i)
        this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate());
-   }
-   CATCH_DUMP_ATTR
-
-   /*!
-     Do all pre timestep operations for enabled fields in read mode:
-      - Check that the data excepted from server has been received
-      - Check if some filters must auto-trigger
-   */
-   void CFile::doPreTimestepOperationsForEnabledReadModeFields(void)
-   TRY
-   {
-     if (mode.isEmpty() || mode.getValue() != mode_attr::read)
-       return;
-
-     int size = this->enabledFields.size();
-     for (int i = 0; i < size; ++i)
-     {
-       this->enabledFields[i]->checkForLateDataFromServer();
-       this->enabledFields[i]->autoTriggerIfNeeded();
-     }
    }
    CATCH_DUMP_ATTR
Index: XIOS3/trunk/src/node/file.hpp
===================================================================
--- XIOS3/trunk/src/node/file.hpp	(revision 2498)
+++ XIOS3/trunk/src/node/file.hpp	(revision 2507)
@@ -83,4 +83,5 @@
                                                 int default_level = 1,
                                                 bool default_enabled = true);
+         void replaceEnabledFields(CField* fieldIn, CField* fieldOut) ;
 
          StdString dumpClassAttributes(void);
@@ -112,7 +113,5 @@
          void processEnabledFile(void);
          
-         void postProcessFilterGraph();
          void prefetchEnabledReadModeFields();
-         void doPreTimestepOperationsForEnabledReadModeFields();
          void doPostTimestepOperationsForEnabledReadModeFields();
 
@@ -212,6 +211,8 @@
        
        private:
-
-
+         bool isOnline_=false;
+       public:
+         bool isOnline(void) { return isOnline_ ;}
+         void setOnline(bool online=true) { isOnline_=online ;} 
       public:
         //         virtual void toBinary  (StdOStream& os) const;
Index: XIOS3/trunk/src/node/grid.cpp
===================================================================
--- XIOS3/trunk/src/node/grid.cpp	(revision 2498)
+++ XIOS3/trunk/src/node/grid.cpp	(revision 2507)
@@ -29,4 +29,8 @@
 #include "generic_algorithm_transformation.hpp"
 #include "algo_types.hpp"
+#include "redistribute_domain.hpp"
+#include "redistribute_axis.hpp"
+#include "redistribute_scalar.hpp"
+
 
 #include <regex>
@@ -48,5 +52,4 @@
       , axisPositionInGrid_(), hasDomainAxisBaseRef_(false)
       , gridSrc_(), order_()
-      , clients()
    {
      setVirtualDomainGroup(CDomainGroup::create(getId() + "_virtual_domain_group"));
@@ -66,5 +69,4 @@
       , axisPositionInGrid_(), hasDomainAxisBaseRef_(false)
       , gridSrc_(), order_()
-      , clients()
    {
      setVirtualDomainGroup(CDomainGroup::create(getId() + "_virtual_domain_group"));
@@ -1468,4 +1470,59 @@
     distributeGridToServer(client, false, fieldId) ;
   }
+
+  CGrid* CGrid::redistributeGridToWriter(void)
+  {
+    CContext* context = CContext::getCurrent();
+    CGrid* redistributedGrid ;
+    string redistributeGridId="redistributedToWriter__"+getId() ;
+    if (has(redistributeGridId)) redistributedGrid = get(redistributeGridId) ;
+    else
+    {
+      redistributedGrid = CGrid::create(redistributeGridId) ;
+      // simple Distribution for now 
+      // distribute over the fisrt element except if it is a scalar
+      auto& elements = getElements() ;
+      int posDistributed = 0 ;
+      for(auto& element : elements)
+      {
+        if (element.type==TYPE_DOMAIN) break ;
+        else if (element.type==TYPE_AXIS) break ;
+        else if (element.type==TYPE_SCALAR) posDistributed++ ;
+      }
+      if (posDistributed==elements.size()) posDistributed=0 ; // grid composed only of scalar
+    
+      for(int i=0 ; i<elements.size() ; i++)
+      {
+        if (elements[i].type==TYPE_DOMAIN) 
+        {
+          CDomain* domain = redistributedGrid->addDomain() ;
+          domain->domain_ref=elements[i].domain->getId() ;
+          domain->name = elements[i].domain->getDomainOutputName() ;
+          CRedistributeDomain* redistributeDomain = dynamic_cast<CRedistributeDomain *>(domain->addTransformation(TRANS_REDISTRIBUTE_DOMAIN, "")) ;
+          redistributeDomain->type.setValue(posDistributed==i ? CRedistributeDomain::type_attr::bands : CRedistributeDomain::type_attr::full);
+        }
+        else if (elements[i].type==TYPE_AXIS)      
+        {
+          CAxis* axis = redistributedGrid->addAxis() ;
+          axis->axis_ref=elements[i].axis->getId() ;
+          axis->name = elements[i].axis->getAxisOutputName() ;
+          CRedistributeAxis* redistributeAxis = dynamic_cast<CRedistributeAxis *>(axis->addTransformation(TRANS_REDISTRIBUTE_AXIS, "")) ;
+          redistributeAxis->type.setValue(posDistributed==i ? CRedistributeAxis::type_attr::bands : CRedistributeAxis::type_attr::full);
+        }
+        else if (elements[i].type==TYPE_SCALAR)      
+        {
+          CScalar* scalar = redistributedGrid->addScalar() ;
+          scalar->scalar_ref=elements[i].scalar->getId() ;
+          scalar->name = elements[i].scalar->getScalarOutputName() ;
+          CRedistributeScalar* redistributeScalar = dynamic_cast<CRedistributeScalar *>(scalar->addTransformation(TRANS_REDISTRIBUTE_SCALAR, "")) ;
+          redistributeScalar->type.setValue(posDistributed==i ? CRedistributeScalar::type_attr::root : CRedistributeScalar::type_attr::full);
+        }
+      }
+    }
+
+    return redistributedGrid ; 
+  }
+
+
 
 
@@ -2369,13 +2426,7 @@
   TRY
   {
-    if (clientsSet.find(contextClient)==clientsSet.end())
-    {
-      clients.push_back(contextClient) ;
-      clientsSet.insert(contextClient);
-    }
     for (auto domain : getDomains()) domain->setContextClient(contextClient);
     for (auto axis : getAxis()) axis->setContextClient(contextClient);
     for (auto scalar : getScalars()) scalar->setContextClient(contextClient);
-   
   }
   CATCH_DUMP_ATTR
@@ -2473,4 +2524,28 @@
   }
 
+  void CGrid::computeRedistributeToWriterConnector(CGrid* gridSrc)
+  {
+    CContext* context = CContext::getCurrent();
+
+    vector<shared_ptr<CLocalView>> srcViews ;
+    vector<shared_ptr<CLocalView>> dstViews ;
+        
+    for(auto& element : gridSrc->getElements())
+    {
+      if (element.type==TYPE_DOMAIN) srcViews.push_back(element.domain->getLocalView(CElementView::WORKFLOW)) ;
+      else if (element.type==TYPE_AXIS) srcViews.push_back(element.axis->getLocalView(CElementView::WORKFLOW)) ; 
+      else if (element.type==TYPE_SCALAR) srcViews.push_back(element.scalar->getLocalView(CElementView::WORKFLOW)) ; 
+    }
+
+    for(auto& element : this->getElements())
+    {
+      if (element.type==TYPE_DOMAIN) dstViews.push_back(element.domain->getLocalView(CElementView::WORKFLOW)) ;
+      else if (element.type==TYPE_AXIS) dstViews.push_back(element.axis->getLocalView(CElementView::WORKFLOW)) ; 
+      else if (element.type==TYPE_SCALAR) dstViews.push_back(element.scalar->getLocalView(CElementView::WORKFLOW)) ; 
+    }
+
+    redistributeToWriterConnector_ = make_shared<CGridTransformConnector>(srcViews, dstViews, context->getIntraComm()) ;
+    redistributeToWriterConnector_ -> computeConnector(true) ;
+  }
   
 } // namespace xios
Index: XIOS3/trunk/src/node/grid.hpp
===================================================================
--- XIOS3/trunk/src/node/grid.hpp	(revision 2498)
+++ XIOS3/trunk/src/node/grid.hpp	(revision 2507)
@@ -279,9 +279,4 @@
 
         bool isDataDistributed(void) ; 
-      private:
-
-/** Clients that have to send a grid. There can be multiple clients in case of secondary server, otherwise only one client. */
-        std::list<CContextClient*> clients;
-        std::set<CContextClient*> clientsSet;
 
       private:
@@ -327,4 +322,6 @@
      //////////////////////////////////////////////////////////////////////////////////////
       public:
+        CGrid* redistributeGridToWriter(void) ;
+      public:
        CGrid* duplicateSentGrid(void) ;
       private:
@@ -402,4 +399,11 @@
          void computeServerFromClientConnector(void) ;
 
+      private:
+         shared_ptr<CGridTransformConnector> redistributeToWriterConnector_ = nullptr ;
+      public:
+         shared_ptr<CGridTransformConnector> getRedistributeToWriterConnector(CGrid* gridSrc) { if (redistributeToWriterConnector_==nullptr) computeRedistributeToWriterConnector(gridSrc) ; return redistributeToWriterConnector_;}
+         void computeRedistributeToWriterConnector(CGrid* gridSrc) ;
+
+
    }; // class CGrid
 
Index: XIOS3/trunk/src/node/node_enum.hpp
===================================================================
--- XIOS3/trunk/src/node/node_enum.hpp	(revision 2498)
+++ XIOS3/trunk/src/node/node_enum.hpp	(revision 2507)
@@ -45,5 +45,7 @@
          ePoolNode,gPoolNode,
          eServiceNode,gServiceNode,
-//         eService, gService
+         eRedistributeDomain, gRedistributeDomain,
+         eRedistributeAxis, gRedistributeAxis,
+         eRedistributeScalar, gRedistributeScalar,
        } ENodeType;
 
Index: XIOS3/trunk/src/node/node_type.hpp
===================================================================
--- XIOS3/trunk/src/node/node_type.hpp	(revision 2498)
+++ XIOS3/trunk/src/node/node_type.hpp	(revision 2507)
@@ -35,4 +35,7 @@
 #include "pool_node.hpp"
 #include "service_node.hpp"
+#include "redistribute_domain.hpp"
+#include "redistribute_axis.hpp"
+#include "redistribute_scalar.hpp"
 
 
Index: XIOS3/trunk/src/node/redistribute_axis.cpp
===================================================================
--- XIOS3/trunk/src/node/redistribute_axis.cpp	(revision 2507)
+++ XIOS3/trunk/src/node/redistribute_axis.cpp	(revision 2507)
@@ -0,0 +1,62 @@
+#include "redistribute_axis.hpp"
+#include "axis_algorithm_redistribute.hpp"
+#include "type.hpp"
+#include "field.hpp"
+
+namespace xios
+{
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CRedistributeAxis::CRedistributeAxis(void)
+    : CObjectTemplate<CRedistributeAxis>(), CRedistributeAxisAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CRedistributeAxis::CRedistributeAxis(const StdString & id)
+    : CObjectTemplate<CRedistributeAxis>(id), CRedistributeAxisAttributes(), CTransformation<CAxis>()
+  { /* Ne rien faire de plus */ }
+
+  CRedistributeAxis::~CRedistributeAxis(void)
+  {}
+
+  CTransformation<CAxis>* CRedistributeAxis::create(const StdString& id, xml::CXMLNode* node)
+  {
+    CRedistributeAxis* redistributeAxis = CRedistributeAxisGroup::get("redistribute_axis_definition")->createChild(id);
+    if (node) redistributeAxis->parse(*node);
+    return static_cast<CTransformation<CAxis>*>(redistributeAxis);
+  }
+
+  bool CRedistributeAxis::registerTrans()
+  {
+    return registerTransformation(TRANS_REDISTRIBUTE_AXIS, {create, getTransformation});
+  }
+
+  bool CRedistributeAxis::_dummyRegistered = CRedistributeAxis::registerTrans();
+
+  //----------------------------------------------------------------
+
+  StdString CRedistributeAxis::GetName(void)    { return StdString("redistribute_axis"); }
+  StdString CRedistributeAxis::GetDefName(void) { return StdString("redistribute_axis"); }
+  ENodeType CRedistributeAxis::GetType(void)    { return eRedistributeAxis; }
+
+  void CRedistributeAxis::checkValid(CAxis* axisSrc)
+  {
+
+  }
+
+  shared_ptr<CGenericAlgorithmTransformation> CRedistributeAxis::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 CAxisAlgorithmRedistribute::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid, 
+                elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
+}
Index: XIOS3/trunk/src/node/redistribute_axis.hpp
===================================================================
--- XIOS3/trunk/src/node/redistribute_axis.hpp	(revision 2507)
+++ XIOS3/trunk/src/node/redistribute_axis.hpp	(revision 2507)
@@ -0,0 +1,84 @@
+#ifndef __XIOS_CRedistributeAxis__
+#define __XIOS_CRedistributeAxis__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+#include "axis.hpp"
+
+namespace xios 
+{
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CRedistributeAxisGroup;
+  class CRedistributeAxisAttributes;
+  class CRedistributeAxis;
+  class CAxis;
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CRedistributeAxis)
+#include "redistribute_axis_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CRedistributeAxis)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CInterpolateAxis
+    This class describes interpolate_axis in xml file.
+  */
+  class CRedistributeAxis
+    : public CObjectTemplate<CRedistributeAxis>
+    , public CRedistributeAxisAttributes
+    , public CTransformation<CAxis>
+  {
+    public :
+      typedef CObjectTemplate<CRedistributeAxis> SuperClass;
+      typedef CRedistributeAxisAttributes SuperClassAttribute;
+      typedef CRedistributeAxis MyClass ;
+      typedef CTransformation<CAxis> SuperTransform ;
+
+    public :
+      /// Constructeurs ///
+      CRedistributeAxis(void);
+      explicit CRedistributeAxis(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CRedistributeAxis(void);
+
+      virtual void checkValid(CAxis* axisDest);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+      const string& getId(void) { return this->SuperClass::getId();}
+      ETranformationType getTransformationType(void) { return TRANS_REDISTRIBUTE_AXIS ;}
+      static CTransformation<CAxis>* getTransformation(const StdString& id) { return SuperClass::get(id);}
+      virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual shared_ptr<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);
+      static bool _dummyRegistered;
+  }; // class CRedistributeAxis
+
+  DECLARE_GROUP(CRedistributeAxis);
+} // namespace xios
+
+#endif // __XIOS_CRedistributeAxis__
Index: XIOS3/trunk/src/node/redistribute_domain.cpp
===================================================================
--- XIOS3/trunk/src/node/redistribute_domain.cpp	(revision 2507)
+++ XIOS3/trunk/src/node/redistribute_domain.cpp	(revision 2507)
@@ -0,0 +1,61 @@
+#include "redistribute_domain.hpp"
+#include "domain_algorithm_redistribute.hpp"
+#include "type.hpp"
+#include "field.hpp"
+
+namespace xios
+{
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CRedistributeDomain::CRedistributeDomain(void)
+    : CObjectTemplate<CRedistributeDomain>(), CRedistributeDomainAttributes(), CTransformation<CDomain>()
+  { /* Ne rien faire de plus */ }
+
+  CRedistributeDomain::CRedistributeDomain(const StdString & id)
+    : CObjectTemplate<CRedistributeDomain>(id), CRedistributeDomainAttributes(), CTransformation<CDomain>()
+  { /* Ne rien faire de plus */ }
+
+  CRedistributeDomain::~CRedistributeDomain(void)
+  {}
+
+  CTransformation<CDomain>* CRedistributeDomain::create(const StdString& id, xml::CXMLNode* node)
+  {
+    CRedistributeDomain* redistributeDomain = CRedistributeDomainGroup::get("redistribute_domain_definition")->createChild(id);
+    if (node) redistributeDomain->parse(*node);
+    return static_cast<CTransformation<CDomain>*>(redistributeDomain);
+  }
+
+  bool CRedistributeDomain::registerTrans()
+  {
+    return registerTransformation(TRANS_REDISTRIBUTE_DOMAIN, {create, getTransformation});
+  }
+
+  bool CRedistributeDomain::_dummyRegistered = CRedistributeDomain::registerTrans();
+
+  //----------------------------------------------------------------
+
+  StdString CRedistributeDomain::GetName(void)    { return StdString("redistribute_domain"); }
+  StdString CRedistributeDomain::GetDefName(void) { return StdString("redistribute_domain"); }
+  ENodeType CRedistributeDomain::GetType(void)    { return eRedistributeDomain; }
+
+  void CRedistributeDomain::checkValid(CDomain* domainSrc)
+  {
+
+  }
+
+  shared_ptr<CGenericAlgorithmTransformation> CRedistributeDomain::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 CDomainAlgorithmRedistribute::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid, 
+                elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
+}
Index: XIOS3/trunk/src/node/redistribute_domain.hpp
===================================================================
--- XIOS3/trunk/src/node/redistribute_domain.hpp	(revision 2507)
+++ XIOS3/trunk/src/node/redistribute_domain.hpp	(revision 2507)
@@ -0,0 +1,83 @@
+#ifndef __XIOS_CRedistributeDomain__
+#define __XIOS_CRedistributeDomain__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+#include "domain.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CRedistributeDomainGroup;
+  class CRedistributeDomainAttributes;
+  class CRedistributeDomain;
+  class CDomain;
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CRedistributeDomain)
+#include "redistribute_domain_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CRedistributeDomain)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CRedistributeDomain
+    This class describes redistribute_from_file_domain in xml file.
+  */
+  class CRedistributeDomain
+    : public CObjectTemplate<CRedistributeDomain>
+    , public CRedistributeDomainAttributes
+    , public CTransformation<CDomain>
+  {
+    public :
+      typedef CObjectTemplate<CRedistributeDomain> SuperClass;
+      typedef CRedistributeDomainAttributes SuperClassAttribute;
+      typedef CRedistributeDomain MyClass ;
+      typedef CTransformation<CDomain> SuperTransform ;
+
+    public :
+      /// Constructeurs ///
+      CRedistributeDomain(void);
+      explicit CRedistributeDomain(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CRedistributeDomain(void);
+
+      virtual void checkValid(CDomain* domainSource);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+      const string& getId(void) { return this->SuperClass::getId();}
+      ETranformationType getTransformationType(void) { return TRANS_REDISTRIBUTE_DOMAIN ;}
+      static CTransformation<CDomain>* getTransformation(const StdString& id) { return SuperClass::get(id);}
+      virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual shared_ptr<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<CDomain>* create(const StdString& id, xml::CXMLNode* node);
+      static bool _dummyRegistered;
+  }; // class CRedistributeDomain
+
+  DECLARE_GROUP(CRedistributeDomain);
+} // namespace xios
+
+#endif // __XIOS_CRedistributeDomain__
Index: XIOS3/trunk/src/node/redistribute_scalar.cpp
===================================================================
--- XIOS3/trunk/src/node/redistribute_scalar.cpp	(revision 2507)
+++ XIOS3/trunk/src/node/redistribute_scalar.cpp	(revision 2507)
@@ -0,0 +1,62 @@
+#include "redistribute_scalar.hpp"
+#include "scalar_algorithm_redistribute.hpp"
+#include "type.hpp"
+#include "field.hpp"
+
+namespace xios
+{
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CRedistributeScalar::CRedistributeScalar(void)
+    : CObjectTemplate<CRedistributeScalar>(), CRedistributeScalarAttributes(), CTransformation<CScalar>()
+  { /* Ne rien faire de plus */ }
+
+  CRedistributeScalar::CRedistributeScalar(const StdString & id)
+    : CObjectTemplate<CRedistributeScalar>(id), CRedistributeScalarAttributes(), CTransformation<CScalar>()
+  { /* Ne rien faire de plus */ }
+
+  CRedistributeScalar::~CRedistributeScalar(void)
+  {}
+
+  CTransformation<CScalar>* CRedistributeScalar::create(const StdString& id, xml::CXMLNode* node)
+  {
+    CRedistributeScalar* redistributeScalar = CRedistributeScalarGroup::get("redistribute_scalar_definition")->createChild(id);
+    if (node) redistributeScalar->parse(*node);
+    return static_cast<CTransformation<CScalar>*>(redistributeScalar);
+  }
+
+  bool CRedistributeScalar::registerTrans()
+  {
+    return registerTransformation(TRANS_REDISTRIBUTE_SCALAR, {create, getTransformation});
+  }
+
+  bool CRedistributeScalar::_dummyRegistered = CRedistributeScalar::registerTrans();
+
+  //----------------------------------------------------------------
+
+  StdString CRedistributeScalar::GetName(void)    { return StdString("redistribute_scalar"); }
+  StdString CRedistributeScalar::GetDefName(void) { return StdString("redistribute_scalar"); }
+  ENodeType CRedistributeScalar::GetType(void)    { return eRedistributeScalar; }
+
+  void CRedistributeScalar::checkValid(CScalar* scalarSrc)
+  {
+
+  }
+
+  shared_ptr<CGenericAlgorithmTransformation> CRedistributeScalar::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 CScalarAlgorithmRedistribute::create(isSource, gridDst,  gridSrc, this, elementPositionInGrid, 
+                elementPositionInGridSrc2ScalarPosition, elementPositionInGridSrc2AxisPosition, elementPositionInGridSrc2DomainPosition,
+                elementPositionInGridDst2ScalarPosition, elementPositionInGridDst2AxisPosition, elementPositionInGridDst2DomainPosition);
+  }
+}
Index: XIOS3/trunk/src/node/redistribute_scalar.hpp
===================================================================
--- XIOS3/trunk/src/node/redistribute_scalar.hpp	(revision 2507)
+++ XIOS3/trunk/src/node/redistribute_scalar.hpp	(revision 2507)
@@ -0,0 +1,83 @@
+#ifndef __XIOS_CRedistributeScalar__
+#define __XIOS_CRedistributeScalar__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+#include "scalar.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CRedistributeScalarGroup;
+  class CRedistributeScalarAttributes;
+  class CRedistributeScalar;
+  class CScalar;
+  class CGenericAlgorithmTransformation ;
+  class CGrid;
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CRedistributeScalar)
+#include "redistribute_scalar_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CRedistributeScalar)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CRedistributeScalar
+    This class describes redistribute_from_file_scalar in xml file.
+  */
+  class CRedistributeScalar
+    : public CObjectTemplate<CRedistributeScalar>
+    , public CRedistributeScalarAttributes
+    , public CTransformation<CScalar>
+  {
+    public :
+      typedef CObjectTemplate<CRedistributeScalar> SuperClass;
+      typedef CRedistributeScalarAttributes SuperClassAttribute;
+      typedef CRedistributeScalar MyClass ;
+      typedef CTransformation<CScalar> SuperTransform ;
+
+    public :
+      /// Constructeurs ///
+      CRedistributeScalar(void);
+      explicit CRedistributeScalar(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CRedistributeScalar(void);
+
+      virtual void checkValid(CScalar* scalarSource);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+      const string& getId(void) { return this->SuperClass::getId();}
+      ETranformationType getTransformationType(void) { return TRANS_REDISTRIBUTE_SCALAR ;}
+      static CTransformation<CScalar>* getTransformation(const StdString& id) { return SuperClass::get(id);}
+      virtual void inheritFrom(SuperTransform* srcTransform) { solveDescInheritance(true, this->SuperClass::get((MyClass*)srcTransform)) ;}
+      virtual shared_ptr<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<CScalar>* create(const StdString& id, xml::CXMLNode* node);
+      static bool _dummyRegistered;
+  }; // class CRedistributeScalar
+
+  DECLARE_GROUP(CRedistributeScalar);
+} // namespace xios
+
+#endif // __XIOS_CRedistributeScalar__
Index: XIOS3/trunk/src/node/scalar.cpp
===================================================================
--- XIOS3/trunk/src/node/scalar.cpp	(revision 2498)
+++ XIOS3/trunk/src/node/scalar.cpp	(revision 2507)
@@ -47,4 +47,5 @@
     m["reduce_domain"] = TRANS_REDUCE_DOMAIN_TO_SCALAR;
     m["reduce_scalar"] = TRANS_REDUCE_SCALAR_TO_SCALAR;
+    m["redistribute_scalar"] = TRANS_REDISTRIBUTE_SCALAR;
     return true;
   }
@@ -122,4 +123,9 @@
     if (n.isEmpty()) n=1 ;
     if (mask.isEmpty()) mask=true ;
+    
+    hasValue_ =  (value.isEmpty())  ? false :true ;
+    hasBounds_ = (bounds.isEmpty()) ? false :true ;
+    hasLabel_ =  (label.isEmpty())  ? false :true ;
+
 
     initializeLocalElement() ;
Index: XIOS3/trunk/src/node/scalar.hpp
===================================================================
--- XIOS3/trunk/src/node/scalar.hpp	(revision 2498)
+++ XIOS3/trunk/src/node/scalar.hpp	(revision 2507)
@@ -143,4 +143,13 @@
 
       bool isEqual(CScalar* scalar);
+
+    public:
+      bool hasValue() { return hasValue_; }
+      bool hasBounds() { return hasBounds_; }
+      bool hasLabel() { return hasLabel_; }
+    private:
+      bool hasValue_  = false ;
+      bool hasBounds_ = false ;
+      bool hasLabel_  = false ;
     private:  
           /** Clients that have to send a scalar. There can be multiple clients in case of secondary server, otherwise only one client. */
Index: XIOS3/trunk/src/object_factory_decl2.cpp
===================================================================
--- XIOS3/trunk/src/object_factory_decl2.cpp	(revision 2498)
+++ XIOS3/trunk/src/object_factory_decl2.cpp	(revision 2507)
@@ -23,4 +23,7 @@
   macro(CPoolNode)
   macro(CServiceNode)
+  macro(CRedistributeDomain)
+  macro(CRedistributeAxis)
+  macro(CRedistributeScalar)
 }
 
Index: XIOS3/trunk/src/object_factory_decl4.cpp
===================================================================
--- XIOS3/trunk/src/object_factory_decl4.cpp	(revision 2498)
+++ XIOS3/trunk/src/object_factory_decl4.cpp	(revision 2507)
@@ -19,4 +19,7 @@
   macro(CReorderDomainGroup)
   macro(CExtractDomainGroup)
+  macro(CRedistributeDomainGroup)
+  macro(CRedistributeAxisGroup)
+  macro(CRedistributeScalarGroup)
 }
 
Index: XIOS3/trunk/src/object_template_decl.cpp
===================================================================
--- XIOS3/trunk/src/object_template_decl.cpp	(revision 2498)
+++ XIOS3/trunk/src/object_template_decl.cpp	(revision 2507)
@@ -38,4 +38,8 @@
   template class CObjectTemplate<CPoolNode>;
   template class CObjectTemplate<CServiceNode>;
+  template class CObjectTemplate<CRedistributeDomain>;
+  template class CObjectTemplate<CRedistributeAxis>;
+  template class CObjectTemplate<CRedistributeScalar>;
+
   
   template class CObjectTemplate<CContextGroup>;
@@ -71,4 +75,7 @@
   template class CObjectTemplate<CPoolNodeGroup>;
   template class CObjectTemplate<CServiceNodeGroup>;
+  template class CObjectTemplate<CRedistributeDomainGroup>;
+  template class CObjectTemplate<CRedistributeAxisGroup>;
+  template class CObjectTemplate<CRedistributeScalarGroup>;
 
 }
Index: XIOS3/trunk/src/transformation/algo_types.cpp
===================================================================
--- XIOS3/trunk/src/transformation/algo_types.cpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/algo_types.cpp	(revision 2507)
@@ -10,10 +10,9 @@
       if (!first) return ;
       bool ret ;
-      std::cout<<"register Transformation"<<std::endl ;
       ret=CScalarAlgorithmReduceAxis::registerTrans();
       ret=CScalarAlgorithmExtractAxis::registerTrans();
       ret=CScalarAlgorithmReduceDomain::registerTrans();
       ret=CScalarAlgorithmReduceScalar::registerTrans();
-
+      ret=CScalarAlgorithmRedistribute::registerTrans() ;
       //! Axis
       ret=CAxisAlgorithmZoom::registerTrans();
@@ -27,4 +26,5 @@
       ret=CAxisAlgorithmTemporalSplitting::registerTrans();
       ret=CAxisAlgorithmDuplicateScalar::registerTrans();
+      ret=CAxisAlgorithmRedistribute::registerTrans() ;
 
       //! Domain
@@ -36,4 +36,5 @@
       ret=CDomainAlgorithmExtract::registerTrans();
       ret=CDomainAlgorithmGenerateRectilinear::registerTrans() ;
+      ret=CDomainAlgorithmRedistribute::registerTrans() ;
       first=false ;
     }
Index: XIOS3/trunk/src/transformation/algo_types.hpp
===================================================================
--- XIOS3/trunk/src/transformation/algo_types.hpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/algo_types.hpp	(revision 2507)
@@ -14,4 +14,5 @@
 #include "scalar_algorithm_reduce_domain.hpp"
 #include "scalar_algorithm_reduce_scalar.hpp"
+#include "scalar_algorithm_redistribute.hpp"
 
 #include "axis_algorithm_inverse.hpp"
@@ -25,5 +26,5 @@
 #include "axis_algorithm_temporal_splitting.hpp"
 #include "axis_algorithm_duplicate_scalar.hpp"
-
+#include "axis_algorithm_redistribute.hpp"
 
 #include "domain_algorithm_zoom.hpp"
@@ -34,4 +35,5 @@
 #include "domain_algorithm_reorder.hpp"
 #include "domain_algorithm_extract.hpp"
+#include "domain_algorithm_redistribute.hpp"
 
 namespace xios
Index: XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_extract.cpp
===================================================================
--- XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_extract.cpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_extract.cpp	(revision 2507)
@@ -92,7 +92,7 @@
   }
 
-  if (axisSrc_->hasValue) axisDest_->value.resize(nDest);
-  if (axisSrc_->hasLabel) axisDest_->label.resize(nDest);
-  if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest);
+  if (axisSrc_->hasValue()) axisDest_->value.resize(nDest);
+  if (axisSrc_->hasLabel()) axisDest_->label.resize(nDest);
+  if (axisSrc_->hasBounds()) axisDest_->bounds.resize(2,nDest);
 
   auto& transMap = this->transformationMapping_;
@@ -142,13 +142,13 @@
       // -----------------------------------------------------------------------------
 
-      if (axisSrc_->hasValue)
+      if (axisSrc_->hasValue())
       {
         axisDest_->value(countDest) = axisSrc_->value(countSrc);
       }
-      if (axisSrc_->hasLabel)
+      if (axisSrc_->hasLabel())
       {
         axisDest_->label(countDest) = axisSrc_->label(countSrc);
       }
-      if (axisSrc_->hasBounds)
+      if (axisSrc_->hasBounds())
       {
         axisDest_->bounds(0,countDest) = axisSrc_->bounds(0,countSrc);
Index: XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_inverse.cpp
===================================================================
--- XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_inverse.cpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_inverse.cpp	(revision 2507)
@@ -123,5 +123,5 @@
   }
 
-  if (axisSrc_->hasValue)
+  if (axisSrc_->hasValue())
   {
     axisDestination->value.resize(indexSize);
@@ -132,5 +132,5 @@
   }
 
-  if (axisSrc_->hasBounds)
+  if (axisSrc_->hasBounds())
   {
     axisDestination->bounds.resize(2,indexSize);
Index: XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_redistribute.cpp
===================================================================
--- XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_redistribute.cpp	(revision 2507)
+++ XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_redistribute.cpp	(revision 2507)
@@ -0,0 +1,172 @@
+/*!
+   \file axis_algorithm_redistribute.cpp
+   \brief Algorithm for redistribute an axis.
+ */
+#include "axis_algorithm_redistribute.hpp"
+#include "redistribute_axis.hpp"
+#include "axis.hpp"
+#include "grid.hpp"
+#include "grid_transformation_factory_impl.hpp"
+#include "context.hpp"
+
+namespace xios
+{
+
+  shared_ptr<CGenericAlgorithmTransformation> CAxisAlgorithmRedistribute::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();
+
+    CRedistributeAxis* redistributeAxis = dynamic_cast<CRedistributeAxis*> (transformation);
+    int axisDstIndex = elementPositionInGridDst2AxisPosition[elementPositionInGrid];
+    int axisSrcIndex = elementPositionInGridSrc2AxisPosition[elementPositionInGrid];
+
+    return make_shared<CAxisAlgorithmRedistribute>(isSource, axisListDestP[axisDstIndex], axisListSrcP[axisSrcIndex], redistributeAxis);
+  }
+  CATCH
+
+  bool CAxisAlgorithmRedistribute::dummyRegistered_ = CAxisAlgorithmRedistribute::registerTrans();
+  bool CAxisAlgorithmRedistribute::registerTrans()
+  TRY
+  {
+    return CGridTransformationFactory<CAxis>::registerTransformation(TRANS_REDISTRIBUTE_AXIS, create);
+  }
+  CATCH
+
+  CAxisAlgorithmRedistribute::CAxisAlgorithmRedistribute(bool isSource, CAxis* axisDestination, CAxis* axisSource, CRedistributeAxis* redistributeAxis)
+  : CAlgorithmTransformationTransfer(isSource)
+  TRY
+  {
+    CContext* context = CContext::getCurrent(); 
+
+    axisDestination->n_glo.reset();
+    axisDestination->index.reset();
+    axisDestination->n.reset();
+    axisDestination->begin.reset();
+
+    axisDestination->mask.reset();
+    axisDestination->data_index.reset();
+    axisDestination->data_n.reset();
+    axisDestination->data_begin.reset();
+
+    axisDestination->value.reset();
+    axisDestination->label.reset();
+    axisDestination->bounds.reset();
+
+    redistributeAxis->checkValid(axisSource);
+
+    auto& index = redistributeAxis-> index ;
+    int n_glo = axisSource -> n_glo ;
+    axisDestination->n_glo = n_glo ;
+    
+    
+
+    // define the global index of the new domain
+
+    CArray<size_t,1> globalIndex ;
+
+    if (redistributeAxis->type == CRedistributeAxis::type_attr::index)
+    {   
+      globalIndex.resize(index.numElements()) ;
+      globalIndex=index ;
+    }
+    else
+    {
+      
+      auto distType = CRedistributeAxis::type_attr::column ;
+
+      if (redistributeAxis->type == CRedistributeAxis::type_attr::bands) distType = CRedistributeAxis::type_attr::column ;
+      else  distType=redistributeAxis->type;
+
+      int size, start ;
+      if (distType==CRedistributeAxis::type_attr::column) // Bands distribution to send to file server
+      {
+        int nbClient = context->getIntraCommSize() ;
+        int rankClient = context->getIntraCommRank() ;
+      
+        size = n_glo/nbClient ;
+        if (rankClient < n_glo % nbClient)
+        {
+         size++ ;
+         start = rankClient*size ;
+        }
+        else start = (n_glo % nbClient)*(size+1) + (rankClient-(n_glo % nbClient)) * size ;
+
+      }
+      else if (distType==CRedistributeAxis::type_attr::full) // domain is not distributed ie all servers get the same local domain
+      {
+        size=n_glo ; start=0 ;
+      }
+      else if (distType==CRedistributeAxis::type_attr::root) // domain is not distributed ie all servers get the same local domain
+      {
+        if (context->getIntraCommRank()==0) { size=n_glo ; start=0 ; }
+        else { size=0 ; start=0 ; }
+      }
+
+      globalIndex.resize(size) ;
+      size_t ind ;
+      ind=0 ;
+      for(int i=start; i<start+size; i++)
+      {
+       globalIndex(ind) =  i ;
+       ind++ ;
+      }
+    }
+    
+    axisDestination->index.resize(globalIndex.numElements()) ;
+    axisDestination->index = globalIndex ;
+    // apply the transformation to attributes
+
+    auto& transMap = this->transformationMapping_;
+    for(int i=0; i<globalIndex.numElements(); i++) transMap[globalIndex(i)]=globalIndex(i) ;
+
+    auto elementDst=shared_ptr<CLocalElement>(new CLocalElement(context->getIntraCommRank(), n_glo, globalIndex)) ;
+    elementDst->addFullView() ;
+
+    auto transformConnector = make_shared<CTransformConnector>(axisSource->getLocalView(CElementView::FULL), elementDst->getView(CElementView::FULL),context->getIntraComm()) ;
+    transformConnector->computeConnector() ;
+    
+    if (axisSource->hasValue()) transformConnector->transfer(axisSource->value, axisDestination->value) ;
+    
+    
+    
+    if (axisSource->hasBounds())
+    {
+      CArray<double,1> boundsSrc(axisSource->bounds.dataFirst(),shape(axisSource->bounds.numElements()),neverDeleteData) ;
+      CArray<double,1> boundsDst ; 
+      transformConnector->transfer(2, boundsSrc, boundsDst) ;
+      axisDestination->bounds.resize(2,globalIndex.numElements()) ;
+      axisDestination->bounds = CArray<double,2>(boundsDst.dataFirst(), shape(2,globalIndex.numElements()),neverDeleteData) ;
+    }
+    
+    if (axisSource->hasLabel())
+    {
+//ym transferTransformConnector.transfer(axisSrc->label, axisDestination->label) ;  -> probably not supported now, see later
+    }
+
+    // transfer the mask
+    auto transformMask = make_shared<CTransformConnector>(axisSource->getLocalView(CElementView::WORKFLOW), elementDst->getView(CElementView::FULL),context->getIntraComm()) ;
+    transformMask->computeConnector() ;
+
+    CArray<bool,1> workflow(axisSource->getLocalView(CElementView::WORKFLOW)->getSize()) ;
+    axisDestination->mask.resize(axisSource->getLocalView(CElementView::FULL)->getSize()) ;
+    workflow=true ;
+    
+    transformMask->transfer(workflow,axisDestination->mask,false) ;   
+
+    axisDestination->checkAttributes() ;
+    this->computeAlgorithm(axisSource->getLocalView(CElementView::WORKFLOW), axisDestination->getLocalView(CElementView::WORKFLOW)) ;
+  }
+  CATCH
+
+
+}
Index: XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_redistribute.hpp
===================================================================
--- XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_redistribute.hpp	(revision 2507)
+++ XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_redistribute.hpp	(revision 2507)
@@ -0,0 +1,45 @@
+/*!
+   \brief Algorithm for redistributing axis.
+ */
+#ifndef __XIOS_AXIS_ALGORITHM_REDISTRIBUTE_HPP__
+#define __XIOS_AXIS_ALGORITHM_REDISTRIBUTE_HPP__
+
+#include "algorithm_transformation_transfer.hpp"
+#include "transformation.hpp"
+
+namespace xios 
+{
+
+  class CAxis;
+  class CRedistributeAxis;
+
+  /*!
+    \class CAxisAlgorithmReorder
+    Redistribute data on axis
+  */
+  class CAxisAlgorithmRedistribute : public CAlgorithmTransformationTransfer  
+  {
+    public:
+      CAxisAlgorithmRedistribute(bool isSource, CAxis* axisDestination, CAxis* axisSource, CRedistributeAxis* redistributeAxis);
+
+      virtual ~CAxisAlgorithmRedistribute() {}
+
+      static bool registerTrans();
+      virtual StdString getAlgoName() {return "\\nredistribute_axis";}
+
+  
+    public:
+      static shared_ptr<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_DOMAIN_ALGORITHM_REDISTRIBUTE_HPP__
Index: XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_zoom.cpp
===================================================================
--- XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_zoom.cpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_zoom.cpp	(revision 2507)
@@ -79,7 +79,7 @@
 
   axisDest_->mask.resize(nDest);
-  if (axisSrc_->hasValue) axisDest_->value.resize(nDest);
-  if (axisSrc_->hasLabel) axisDest_->label.resize(nDest);
-  if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest);
+  if (axisSrc_->hasValue()) axisDest_->value.resize(nDest);
+  if (axisSrc_->hasLabel()) axisDest_->label.resize(nDest);
+  if (axisSrc_->hasBounds()) axisDest_->bounds.resize(2,nDest);
 
   auto& transMap = this->transformationMapping_;
@@ -92,9 +92,9 @@
     axisDest_->mask(iDest) = axisSrc_->mask(iSrc);
 
-    if (axisSrc_->hasValue)
+    if (axisSrc_->hasValue())
       axisDest_->value(iDest) = axisSrc_->value(iSrc);
-    if (axisSrc_->hasLabel)
+    if (axisSrc_->hasLabel())
       axisDest_->label(iDest) = axisSrc_->label(iSrc);
-    if (axisSrc_->hasBounds)
+    if (axisSrc_->hasBounds())
     {
       axisDest_->bounds(0,iDest) = axisSrc_->bounds(0,iSrc);
Index: XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_extract.cpp
===================================================================
--- XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_extract.cpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_extract.cpp	(revision 2507)
@@ -76,5 +76,6 @@
    domainDestination->bounds_lon_2d.reset();
    domainDestination->bounds_lat_2d.reset();
-   domainDestination->area.reset();
+   domainDestination->area_1d.reset();
+   domainDestination->area_2d.reset();
    domainDestination->radius.reset();
    
@@ -175,6 +176,9 @@
     }
   }
-  if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest);
-
+  if (domainSrc_->hasArea) 
+  {
+    if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d.resize(niDest,njDest);
+    else if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d.resize(niDest*njDest);
+  }
   // Set attributes required to define domainDestination->localElement_ and associated views, full and workflow)
   CArray<size_t,1> sourceGlobalIdx = domainSource->getLocalElement()->getGlobalIndex();
@@ -241,8 +245,6 @@
 
       // area
-      if (!domainSrc_->area.isEmpty())
-      {
-        domainDest_->area(iIdxDestLocal,jIdxDestLocal) = domainSrc_->area(iIdxSrcLocal,jIdxSrcLocal);
-      }
+      if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d(iIdxDestLocal,jIdxDestLocal) = domainSrc_->area_2d(iIdxSrcLocal,jIdxSrcLocal);
+      else if (!domainSrc_->area_1d.isEmpty())  domainDest_->area_1d(countDest) = domainSrc_->area_1d(countSrc);
 
       // bounds
Index: XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_redistribute.cpp
===================================================================
--- XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_redistribute.cpp	(revision 2507)
+++ XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_redistribute.cpp	(revision 2507)
@@ -0,0 +1,258 @@
+/*!
+   \file domain_algorithm_redistribute.cpp
+   \brief Algorithm for redistribute a domain.
+ */
+#include "domain_algorithm_redistribute.hpp"
+#include "redistribute_domain.hpp"
+#include "domain.hpp"
+#include "grid.hpp"
+#include "grid_transformation_factory_impl.hpp"
+#include "context.hpp"
+
+namespace xios
+{
+
+  shared_ptr<CGenericAlgorithmTransformation> CDomainAlgorithmRedistribute::create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
+                                                               CTransformation<CDomain>* 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<CDomain*> domainListDestP = gridDst->getDomains();
+    std::vector<CDomain*> domainListSrcP  = gridSrc->getDomains();
+
+    CRedistributeDomain* redistributeDomain = dynamic_cast<CRedistributeDomain*> (transformation);
+    int domainDstIndex = elementPositionInGridDst2DomainPosition[elementPositionInGrid];
+    int domainSrcIndex = elementPositionInGridSrc2DomainPosition[elementPositionInGrid];
+
+    return make_shared<CDomainAlgorithmRedistribute>(isSource, domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], redistributeDomain);
+  }
+  CATCH
+
+  bool CDomainAlgorithmRedistribute::dummyRegistered_ = CDomainAlgorithmRedistribute::registerTrans();
+  bool CDomainAlgorithmRedistribute::registerTrans()
+  TRY
+  {
+    return CGridTransformationFactory<CDomain>::registerTransformation(TRANS_REDISTRIBUTE_DOMAIN, create);
+  }
+  CATCH
+
+  CDomainAlgorithmRedistribute::CDomainAlgorithmRedistribute(bool isSource, CDomain* domainDestination, CDomain* domainSource, CRedistributeDomain* redistributeDomain)
+  : CAlgorithmTransformationTransfer(isSource)
+  TRY
+  {
+     CContext* context = CContext::getCurrent(); 
+   // Reset geometrical attributes to avoid incompatible (user/domainSource) attributs
+   //   attributs will be defined using domainSource and/or transformation attributs
+    domainDestination->type.reset();
+    domainDestination->ni_glo.reset();
+    domainDestination->nj_glo.reset();
+   
+    domainDestination->i_index.reset();   // defined using domainSource->getLocalElement()
+    domainDestination->j_index.reset();   // "
+    domainDestination->ibegin.reset();    // will be computed in domainDestination->checkDomain() (from checkAttributes())
+    domainDestination->ni.reset();        // "
+    domainDestination->jbegin.reset();    // "
+    domainDestination->nj.reset();        // "
+   
+    domainDestination->mask_1d.reset();   // defined scanning domainSource->getFullView() & domainSource->getWorkflowView() differencies
+    domainDestination->mask_2d.reset();   //   in all case domainDestination->mask_1d used as reference  
+
+    // domainDestination->data_* attributes will be computed in :
+    domainDestination->data_dim.reset();     // domainDestination->checkDomainData() (from checkAttributes())
+    domainDestination->data_ni.reset();
+    domainDestination->data_nj.reset();
+    domainDestination->data_ibegin.reset();
+    domainDestination->data_jbegin.reset();
+    domainDestination->data_i_index.reset(); // domainDestination->checkCompression() (from checkAttributes())
+    domainDestination->data_j_index.reset();
+
+    // Next attributes will be set using domainSource->attributes 
+    domainDestination->lonvalue_1d.reset();
+    domainDestination->latvalue_1d.reset();
+    domainDestination->lonvalue_2d.reset();
+    domainDestination->latvalue_2d.reset();
+    domainDestination->nvertex.reset();
+    domainDestination->bounds_lon_1d.reset();
+    domainDestination->bounds_lat_1d.reset();
+    domainDestination->bounds_lon_2d.reset();
+    domainDestination->bounds_lat_2d.reset();
+    domainDestination->area.reset();
+    domainDestination->radius.reset();
+
+    auto& index = redistributeDomain-> index ;
+    
+    domainDestination->type = domainSource->type ;
+    domainDestination-> ni_glo = domainSource-> ni_glo ;
+    domainDestination-> nj_glo = domainSource-> nj_glo ;
+    
+    CArray<size_t,1> globalIndex ;
+    int start_i, start_j ;
+    int size_i, size_j ;
+    int ni_glo = domainDestination-> ni_glo ;
+    int nj_glo = domainDestination-> nj_glo ;
+    
+       
+    if (redistributeDomain->type == CRedistributeDomain::type_attr::index)
+    {   
+      globalIndex.resize(index.numElements()) ;
+      globalIndex=index ;
+    }
+    else
+    {
+      
+      auto distType = CRedistributeDomain::type_attr::column ;
+      
+      if (redistributeDomain->type == CRedistributeDomain::type_attr::bands && domainDestination->type == CDomain::type_attr::unstructured) 
+        distType = CRedistributeDomain::type_attr::column ;
+      else  distType=redistributeDomain->type;
+
+      if (distType==CRedistributeDomain::type_attr::bands) // Bands distribution to send to file server
+      {
+        int nbClient = context->getIntraCommSize() ;
+        int rankClient = context->getIntraCommRank() ;
+      
+        int size = nj_glo/nbClient ;
+        int start ;
+        if (rankClient < nj_glo % nbClient)
+        {
+         size++ ;
+         start = rankClient*size ;
+        }
+        else start = (nj_glo % nbClient)*(size+1) + (rankClient-(nj_glo % nbClient)) * size ;
+
+        size_i=ni_glo ; start_i=0 ;
+        size_j=size ; start_j=start ;
+      }
+      else if (distType==CRedistributeDomain::type_attr::column) // Bands distribution to send to file server
+      {
+        int nbClient = context->getIntraCommSize() ;
+        int rankClient = context->getIntraCommRank() ;
+      
+        int size = ni_glo/nbClient ;
+        int start ;
+
+        if (rankClient < ni_glo % nbClient)
+        {
+         size++ ;
+         start = rankClient*size ;
+        }
+        else start = (ni_glo % nbClient)*(size+1) + (rankClient-(ni_glo % nbClient)) * size ;
+
+        size_i=size ; start_i=start ;
+        size_j=nj_glo ; start_j=0 ;
+      }
+      else if (distType==CRedistributeDomain::type_attr::full) // domain is not distributed ie all servers get the same local domain
+      {
+        size_i=ni_glo ; start_i=0 ;
+        size_j=nj_glo ; start_j=0 ;
+      }
+      else if (distType==CRedistributeDomain::type_attr::root) // domain is not distributed ie all servers get the same local domain
+      {
+        if (context->getIntraCommRank()==0)
+        {
+          size_i=ni_glo ; start_i=0 ;
+          size_j=nj_glo ; start_j=0 ;
+        }
+        else
+        {
+          size_i=0 ; start_i=0 ;
+          size_j=0 ; start_j=0 ;
+        }  
+      }
+      globalIndex.resize(size_i*size_j) ;
+      size_t ind ;
+      ind=0 ;
+      for(int j=start_j;j<start_j+size_j;j++)
+        for(int i=start_i;i<start_i+size_i;i++)
+        {
+         globalIndex(ind) =  j*ni_glo+i ;
+         ind++ ;
+        }
+    }
+
+
+    //domainDestination->ni = globalIndex.numElements() ;
+    //domainDestination->nj = 1 ;
+    domainDestination->i_index.resize(globalIndex.numElements()) ;
+    domainDestination->i_index = globalIndex ;
+    domainDestination->j_index.resize(globalIndex.numElements()) ;
+    domainDestination->j_index = 0 ;
+    
+    if (!domainSource->nvertex.isEmpty()) domainDestination->nvertex=domainSource->nvertex ;
+    if (!domainSource->radius.isEmpty()) domainDestination->radius = domainSource->radius ;
+    
+
+    auto& transMap = this->transformationMapping_;
+    for(int i=0; i<globalIndex.numElements(); i++) transMap[globalIndex(i)]=globalIndex(i) ;
+    
+    auto elementDst=shared_ptr<CLocalElement>(new CLocalElement(context->getIntraCommRank(),domainDestination-> ni_glo*domainDestination->nj_glo, globalIndex)) ;
+    elementDst->addFullView() ;
+
+    auto transformConnector = make_shared<CTransformConnector>(domainSource->getLocalView(CElementView::FULL), elementDst->getView(CElementView::FULL),context->getIntraComm()) ;
+    transformConnector->computeConnector() ;
+
+    if (domainSource->hasLonLat)
+    {
+      transformConnector->transfer(domainSource->lonvalue, domainDestination->lonvalue_1d) ;
+      transformConnector->transfer(domainSource->latvalue, domainDestination->latvalue_1d) ;
+    }
+
+    if (domainSource->hasBounds)
+    {
+      int nv ;
+      if (domainDestination->type == CDomain::type_attr::rectilinear) nv=2 ;
+      else if (domainDestination->type == CDomain::type_attr::curvilinear) nv=4 ;
+      else if (domainDestination->type == CDomain::type_attr::unstructured) nv=domainDestination->nvertex ;
+
+      { // bounds_lon
+        CArray<double,1> boundsSrc(domainSource->bounds_lonvalue.dataFirst(),shape(domainSource->bounds_lonvalue.numElements()),neverDeleteData) ;
+        CArray<double,1> boundsDst ; 
+        transformConnector->transfer(nv, boundsSrc, boundsDst) ;
+        domainDestination->bounds_lon_1d.resize(nv,globalIndex.numElements()) ;
+        domainDestination->bounds_lon_1d = CArray<double,2>(boundsDst.dataFirst(), shape(nv,globalIndex.numElements()),neverDeleteData) ;
+      }
+      {  // bounds_lat
+        CArray<double,1> boundsSrc(domainSource->bounds_latvalue.dataFirst(),shape(domainSource->bounds_latvalue.numElements()),neverDeleteData) ;
+        CArray<double,1> boundsDst ; 
+        transformConnector->transfer(nv, boundsSrc, boundsDst) ;
+        domainDestination->bounds_lat_1d.resize(nv,globalIndex.numElements()) ;
+        domainDestination->bounds_lat_1d = CArray<double,2>(boundsDst.dataFirst(), shape(nv,globalIndex.numElements()),neverDeleteData) ;
+      }
+    }
+    
+    if (domainSource->hasArea) transformConnector->transfer(domainSource->areavalue, domainDestination->area_1d) ; 
+
+    // transfer the mask
+     auto transformMask = make_shared<CTransformConnector>(domainSource->getLocalView(CElementView::WORKFLOW), elementDst->getView(CElementView::FULL),context->getIntraComm()) ;
+    transformMask->computeConnector() ;
+
+    CArray<bool,1> workflow(domainSource->getLocalView(CElementView::WORKFLOW)->getSize()) ;
+    domainDestination->mask_1d.resize(domainSource->getLocalView(CElementView::FULL)->getSize()) ;
+    workflow=true ;
+    
+    transformMask->transfer(workflow,domainDestination->mask_1d,false) ;   
+/*
+    CArray<int,1> workflow(domainSource->getLocalView(CElementView::WORKFLOW)->getSize()) ;
+    CArray<int,1> mask(domainSource->getLocalView(CElementView::FULL)->getSize()) ;
+    workflow=1 ;
+    
+    transformMask->transfer(workflow,mask,0) ;
+    domainDestination->mask_1d.resize(mask.numElements()) ;
+    for(int i=0 ; i<mask.numElements() ; i++) 
+      if (mask(i)==1) domainDestination->mask_1d(i)=true ;
+      else domainDestination->mask_1d(i)=false ;
+*/  
+
+    domainDestination->checkAttributes() ;
+    this->computeAlgorithm(domainSource->getLocalView(CElementView::WORKFLOW), domainDestination->getLocalView(CElementView::WORKFLOW)) ;
+  }
+  CATCH
+
+
+}
Index: XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_redistribute.hpp
===================================================================
--- XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_redistribute.hpp	(revision 2507)
+++ XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_redistribute.hpp	(revision 2507)
@@ -0,0 +1,45 @@
+/*!
+   \brief Algorithm for redistributing domain.
+ */
+#ifndef __XIOS_DOMAIN_ALGORITHM_REDISTRIBUTE_HPP__
+#define __XIOS_DOMAIN_ALGORITHM_REDISTRIBUTE_HPP__
+
+#include "algorithm_transformation_transfer.hpp"
+#include "transformation.hpp"
+
+namespace xios 
+{
+
+  class CDomain;
+  class CRedistributeDomain;
+
+  /*!
+    \class CDomainAlgorithmReorder
+    Redistribute data on domain
+  */
+  class CDomainAlgorithmRedistribute : public CAlgorithmTransformationTransfer  
+  {
+    public:
+      CDomainAlgorithmRedistribute(bool isSource, CDomain* domainDestination, CDomain* domainSource, CRedistributeDomain* redistributeDomain);
+
+      virtual ~CDomainAlgorithmRedistribute() {}
+
+      static bool registerTrans();
+      virtual StdString getAlgoName() {return "\\nredistribute_domain";}
+
+  
+    public:
+      static shared_ptr<CGenericAlgorithmTransformation> create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
+                                                     CTransformation<CDomain>* 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_DOMAIN_ALGORITHM_REDISTRIBUTE_HPP__
Index: XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp
===================================================================
--- XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp	(revision 2507)
@@ -128,6 +128,6 @@
    else if (!domainSource->lonvalue_2d.isEmpty() )
    {
-     domainDestination->latvalue_2d.resize( domainSource->latvalue_2d.numElements() );
-     domainDestination->lonvalue_2d.resize( domainSource->lonvalue_2d.numElements() );
+     domainDestination->latvalue_2d.resize( domainSource->latvalue_2d.shape() );
+     domainDestination->lonvalue_2d.resize( domainSource->lonvalue_2d.shape() );
      domainDestination->latvalue_2d = domainSource->latvalue_2d;
      domainDestination->lonvalue_2d = domainSource->lonvalue_2d;
@@ -145,15 +145,21 @@
    else if (!domainSource->bounds_lon_2d.isEmpty() )
    {
-     domainDestination->bounds_lon_2d.resize( domainSource->bounds_lon_2d.numElements() );
-     domainDestination->bounds_lat_2d.resize( domainSource->bounds_lat_2d.numElements() );
+     domainDestination->bounds_lon_2d.resize( domainSource->bounds_lon_2d.shape() );
+     domainDestination->bounds_lat_2d.resize( domainSource->bounds_lat_2d.shape() );
      domainDestination->bounds_lon_2d = domainSource->bounds_lon_2d;
      domainDestination->bounds_lat_2d = domainSource->bounds_lat_2d;
    }
    // set area
-   if (!domainSource->area.isEmpty() )
-   {
-     domainDestination->area.resize( domainSource->area.numElements() );
-     domainDestination->area = domainSource->area;    
-   }
+   if (!domainSource->area_1d.isEmpty() )
+   {
+     domainDestination->area_1d.resize( domainSource->area_1d.numElements() );
+     domainDestination->area_1d = domainSource->area_1d;    
+   }
+   else if (!domainSource->area_2d.isEmpty() )
+   {
+     domainDestination->area_2d.resize( domainSource->area_2d.shape() );
+     domainDestination->area_2d = domainSource->area_2d;    
+   }
+
    if (!domainSource->radius.isEmpty() )
      domainDestination->radius = domainSource->radius;
Index: XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_zoom.cpp
===================================================================
--- XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_zoom.cpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_zoom.cpp	(revision 2507)
@@ -173,6 +173,9 @@
     }
   }
-  if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest);
-
+  if (domainSrc_->hasArea)
+  {
+    if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d.resize(niDest*njDest);
+    else if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d.resize(niDest,njDest);
+  }
 
   for (int iDest = 0; iDest < niDest; iDest++)
@@ -196,5 +199,8 @@
 
       if (domainSrc_->hasArea)
-        domainDest_->area(iDest,jDest) = domainSrc_->area(iSrc,jSrc);
+      {  
+         if (!domainSrc_->area_1d.isEmpty())      domainDest_->area_1d(indLocDest)  = domainSrc_->area_1d(ind);
+         else if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d(iDest,jDest) = domainSrc_->area_2d(iSrc,jSrc);
+      }
 
       if (domainSrc_->hasLonLat)
Index: XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.cpp
===================================================================
--- XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.cpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.cpp	(revision 2507)
@@ -108,5 +108,5 @@
     }
 
-    if (axisSource->hasValue)
+    if (axisSource->hasValue())
     {
       scalarDestination->value = axisSource->value(idxSrc);
Index: XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_redistribute.cpp
===================================================================
--- XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_redistribute.cpp	(revision 2507)
+++ XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_redistribute.cpp	(revision 2507)
@@ -0,0 +1,133 @@
+/*!
+   \file scalar_algorithm_redistribute.cpp
+   \brief Algorithm for redistribute a scalar.
+ */
+#include "scalar_algorithm_redistribute.hpp"
+#include "redistribute_scalar.hpp"
+#include "scalar.hpp"
+#include "grid.hpp"
+#include "grid_transformation_factory_impl.hpp"
+#include "context.hpp"
+
+namespace xios
+{
+
+  shared_ptr<CGenericAlgorithmTransformation> CScalarAlgorithmRedistribute::create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
+                                                               CTransformation<CScalar>* 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<CScalar*> scalarListDestP = gridDst->getScalars();
+    std::vector<CScalar*> scalarListSrcP  = gridSrc->getScalars();
+
+    CRedistributeScalar* redistributeScalar = dynamic_cast<CRedistributeScalar*> (transformation);
+    int scalarDstIndex = elementPositionInGridDst2ScalarPosition[elementPositionInGrid];
+    int scalarSrcIndex = elementPositionInGridSrc2ScalarPosition[elementPositionInGrid];
+
+    return make_shared<CScalarAlgorithmRedistribute>(isSource, scalarListDestP[scalarDstIndex], scalarListSrcP[scalarSrcIndex], redistributeScalar);
+  }
+  CATCH
+
+  bool CScalarAlgorithmRedistribute::dummyRegistered_ = CScalarAlgorithmRedistribute::registerTrans();
+  bool CScalarAlgorithmRedistribute::registerTrans()
+  TRY
+  {
+    return CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDISTRIBUTE_SCALAR, create);
+  }
+  CATCH
+
+  CScalarAlgorithmRedistribute::CScalarAlgorithmRedistribute(bool isSource, CScalar* scalarDestination, CScalar* scalarSource, CRedistributeScalar* redistributeScalar)
+  : CAlgorithmTransformationTransfer(isSource)
+  TRY
+  {
+
+    CContext* context = CContext::getCurrent(); 
+
+    scalarDestination->n.reset();
+    scalarDestination->mask.reset();
+    scalarDestination->value.reset();
+    scalarDestination->bounds.reset();
+
+    redistributeScalar->checkValid(scalarSource);
+
+    // define the global index of the new domain
+
+    CArray<size_t,1> globalIndex ;
+
+    if (    redistributeScalar->type == CRedistributeScalar::type_attr::bands 
+         || redistributeScalar->type == CRedistributeScalar::type_attr::column 
+         || redistributeScalar->type == CRedistributeScalar::type_attr::root )
+    {
+      if (context->getIntraCommRank()==0)
+      {
+        scalarDestination->n = 1;
+        globalIndex.resize(1) ;
+        globalIndex(0)=0 ;
+      }
+      else
+      {
+        scalarDestination->n = 0;
+        globalIndex.resize(0) ;
+      }
+    }
+    else if (redistributeScalar->type == CRedistributeScalar::type_attr::full)
+    {
+      scalarDestination->n = 1;
+      globalIndex.resize(1) ;
+      globalIndex(0)=0 ;
+    }
+    
+    auto& transMap = this->transformationMapping_;
+    for(int i=0; i<globalIndex.numElements(); i++) transMap[globalIndex(i)]=globalIndex(i) ;
+
+    auto elementDst=shared_ptr<CLocalElement>(new CLocalElement(context->getIntraCommRank(), 1, globalIndex)) ;
+    elementDst->addFullView() ;
+
+    auto transformConnector = make_shared<CTransformConnector>(scalarSource->getLocalView(CElementView::FULL), elementDst->getView(CElementView::FULL),context->getIntraComm()) ;
+    transformConnector->computeConnector() ;
+
+    CArray<double,1> valSrc, valDst ;
+    valSrc.resize(scalarSource->getLocalView(CElementView::FULL)->getSize()) ;
+    valDst.resize(scalarDestination->getLocalView(CElementView::FULL)->getSize()) ;
+    
+    if (scalarSource->hasValue())
+    {
+      if (valSrc.numElements()>0)  valSrc(0)=scalarSource->value ;
+      transformConnector->transfer(valSrc, valDst) ;
+      if (valDst.numElements()>0)  scalarDestination->value = valDst(0) ;
+    }
+
+    if (scalarSource->hasBounds()) 
+    {
+      transformConnector->transfer(2, scalarSource->bounds, scalarDestination->bounds) ;
+    }
+    
+    if (scalarSource->hasLabel())
+    {
+//ym transferTransformConnector.transfer(axisSrc->label, axisDestination->label) ;  -> probably not supported now, see later
+    }
+
+    // transfer the mask
+    auto transformMask = make_shared<CTransformConnector>(scalarSource->getLocalView(CElementView::WORKFLOW), elementDst->getView(CElementView::FULL),context->getIntraComm()) ;
+    transformMask->computeConnector() ;
+
+    CArray<bool,1> workflow(scalarSource->getLocalView(CElementView::WORKFLOW)->getSize()) ;
+    CArray<bool,1> mask ;
+    mask.resize(scalarSource->getLocalView(CElementView::FULL)->getSize()) ;
+    workflow=true ;
+    
+    transformMask->transfer(workflow, mask, false) ;   
+    scalarDestination->mask = mask(0) ;
+
+    scalarDestination->checkAttributes() ;
+  }
+  CATCH
+
+
+}
Index: XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_redistribute.hpp
===================================================================
--- XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_redistribute.hpp	(revision 2507)
+++ XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_redistribute.hpp	(revision 2507)
@@ -0,0 +1,45 @@
+/*!
+   \brief Algorithm for redistributing scalar.
+ */
+#ifndef __XIOS_SCALAR_ALGORITHM_REDISTRIBUTE_HPP__
+#define __XIOS_SCALAR_ALGORITHM_REDISTRIBUTE_HPP__
+
+#include "algorithm_transformation_transfer.hpp"
+#include "transformation.hpp"
+
+namespace xios 
+{
+
+  class CScalar;
+  class CRedistributeScalar;
+
+  /*!
+    \class CDomainAlgorithmReorder
+    Redistribute data on domain
+  */
+  class CScalarAlgorithmRedistribute : public CAlgorithmTransformationTransfer  
+  {
+    public:
+      CScalarAlgorithmRedistribute(bool isSource, CScalar* scalarDestination, CScalar* scalarSource, CRedistributeScalar* redistributeScalar);
+
+      virtual ~CScalarAlgorithmRedistribute() {}
+
+      static bool registerTrans();
+      virtual StdString getAlgoName() {return "\\nredistribute_scalar";}
+
+  
+    public:
+      static shared_ptr<CGenericAlgorithmTransformation> create(bool isSource, CGrid* gridDst, CGrid* gridSrc,
+                                                     CTransformation<CScalar>* 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_SCALAR_ALGORITHM_REDISTRIBUTE_HPP__
Index: XIOS3/trunk/src/transformation/transformation_enum.hpp
===================================================================
--- XIOS3/trunk/src/transformation/transformation_enum.hpp	(revision 2498)
+++ XIOS3/trunk/src/transformation/transformation_enum.hpp	(revision 2507)
@@ -26,5 +26,8 @@
         TRANS_REORDER_DOMAIN = 17,
         TRANS_EXTRACT_DOMAIN = 18,
-        TRANS_EXTRACT_AXIS = 19
+        TRANS_EXTRACT_AXIS = 19,
+        TRANS_REDISTRIBUTE_DOMAIN = 20,
+        TRANS_REDISTRIBUTE_AXIS = 21,
+        TRANS_REDISTRIBUTE_SCALAR = 22
       } ETranformationType;
 
Index: XIOS3/trunk/src/transport/context_client.cpp
===================================================================
--- XIOS3/trunk/src/transport/context_client.cpp	(revision 2498)
+++ XIOS3/trunk/src/transport/context_client.cpp	(revision 2507)
@@ -18,4 +18,6 @@
 #include "one_sided_context_client.hpp"
 #include "legacy_context_client.hpp"
+#include "online_context_client.hpp"
+
 
 namespace xios
@@ -61,4 +63,5 @@
       if (defaultProtocol=="one_sided") return getNew<CContextClient::oneSided>(parent, intraComm, interComm) ;
       else if  (defaultProtocol=="legacy") return getNew<CContextClient::legacy>(parent, intraComm, interComm) ;
+      else if  (defaultProtocol=="online") return getNew<CContextClient::online>(parent, intraComm, interComm) ;
       else if  (defaultProtocol=="default") return getNew<CContextClient::legacy>(parent, intraComm, interComm) ;
       else ERROR("CContextClient* CContextClient::getNew<CContextClient::generic>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer)",
@@ -76,4 +79,10 @@
     { 
       return new CLegacyContextClient(parent, intraComm, interComm, parentServer); 
+    }
+
+    template<>
+    CContextClient* CContextClient::getNew<CContextClient::online>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer)
+    { 
+      return new COnlineContextClient(parent, intraComm, interComm, parentServer); 
     }
 
Index: XIOS3/trunk/src/transport/context_client.hpp
===================================================================
--- XIOS3/trunk/src/transport/context_client.hpp	(revision 2498)
+++ XIOS3/trunk/src/transport/context_client.hpp	(revision 2507)
@@ -28,5 +28,5 @@
   {
     public:
-      enum ETransport { generic, legacy, oneSided}  ;
+      enum ETransport { generic, legacy, oneSided, online}  ;
       
       template<ETransport transport=generic> 
@@ -56,4 +56,5 @@
 
 
+      virtual ETransport getType(void) = 0 ;
       // Send event to server
       virtual void sendEvent(CEventClient& event)=0;
@@ -68,5 +69,6 @@
       virtual void setBufferSize(const std::map<int,StdSize>& mapSize)=0;
 
-
+      public: 
+        static CContextClient* ONLINE(void) { return reinterpret_cast<CContextClient*>(0xdeaddead);}
     protected:
 
@@ -104,4 +106,7 @@
   CContextClient* CContextClient::getNew<CContextClient::legacy>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer) ;
 
+  template<>
+  CContextClient* CContextClient::getNew<CContextClient::online>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer) ;
+
 
 }
Index: XIOS3/trunk/src/transport/legacy_context_client.cpp
===================================================================
--- XIOS3/trunk/src/transport/legacy_context_client.cpp	(revision 2498)
+++ XIOS3/trunk/src/transport/legacy_context_client.cpp	(revision 2507)
@@ -40,4 +40,5 @@
     }
 
+    CContextClient::ETransport getType(void) {return CContextClient::legacy ;}
 
     /*!
Index: XIOS3/trunk/src/transport/legacy_context_client.hpp
===================================================================
--- XIOS3/trunk/src/transport/legacy_context_client.hpp	(revision 2498)
+++ XIOS3/trunk/src/transport/legacy_context_client.hpp	(revision 2507)
@@ -31,4 +31,5 @@
 
       // Send event to server
+      ETransport getType(void) {return legacy ;}
       void sendEvent(CEventClient& event);
       void eventLoop(void) ;
Index: XIOS3/trunk/src/transport/legacy_context_server.cpp
===================================================================
--- XIOS3/trunk/src/transport/legacy_context_server.cpp	(revision 2498)
+++ XIOS3/trunk/src/transport/legacy_context_server.cpp	(revision 2507)
@@ -323,4 +323,5 @@
         {
           eventScheduler_->registerEvent(currentTimeLine,hashId);
+          info(100)<<"Context id "<<context->getId()<<"Schedule event : "<< currentTimeLine <<"  "<<hashId<<endl ;
           scheduled=true;
         }
@@ -342,4 +343,22 @@
             if (!flag) return ;
             eventScheduled_=false ;
+          }
+          
+          if (CXios::checkEventSync)
+          {
+            int typeId, classId, typeId_in, classId_in;
+            long long timeLine_out;
+            long long timeLine_in( currentTimeLine );
+            typeId_in=event->type ;
+            classId_in=event->classId ;
+   //        MPI_Allreduce(&timeLine,&timeLine_out, 1, MPI_UINT64_T, MPI_SUM, intraComm) ; // MPI_UINT64_T standardized by MPI 3
+            MPI_Allreduce(&timeLine_in,&timeLine_out, 1, MPI_LONG_LONG_INT, MPI_SUM, intraComm) ; 
+            MPI_Allreduce(&typeId_in,&typeId, 1, MPI_INT, MPI_SUM, intraComm) ;
+            MPI_Allreduce(&classId_in,&classId, 1, MPI_INT, MPI_SUM, intraComm) ;
+            if (typeId/intraCommSize!=event->type || classId/intraCommSize!=event->classId || timeLine_out/intraCommSize!=currentTimeLine)
+            {
+               ERROR("void CLegacyContextClient::sendEvent(CEventClient& event)",
+                  << "Event are not coherent between client for timeline = "<<currentTimeLine);
+            }
           }
 
Index: XIOS3/trunk/src/transport/one_sided_context_client.hpp
===================================================================
--- XIOS3/trunk/src/transport/one_sided_context_client.hpp	(revision 2498)
+++ XIOS3/trunk/src/transport/one_sided_context_client.hpp	(revision 2507)
@@ -30,4 +30,5 @@
       COneSidedContextClient(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0);
 
+      ETransport getType(void) {return oneSided ;}
       // Send event to server
       void sendEvent(CEventClient& event);
Index: XIOS3/trunk/src/transport/online_context_client.hpp
===================================================================
--- XIOS3/trunk/src/transport/online_context_client.hpp	(revision 2507)
+++ XIOS3/trunk/src/transport/online_context_client.hpp	(revision 2507)
@@ -0,0 +1,52 @@
+#ifndef __ONLINE_CONTEXT_CLIENT_HPP__
+#define __ONLINE_CONTEXT_CLIENT_HPP__
+
+#include "xios_spl.hpp"
+#include "buffer_out.hpp"
+#include "buffer_in.hpp"
+#include "buffer_client.hpp"
+#include "event_client.hpp"
+#include "event_server.hpp"
+#include "mpi.hpp"
+#include "registry.hpp"
+#include "context_client.hpp"
+
+namespace xios
+{
+  class CContext;
+  class CContextServer ;
+  /*!
+  \class CLegacyContextClient
+  A context can be both on client and on server side. In order to differenciate the role of
+  context on each side, e.x client sending events, server receiving and processing events, there is a need of
+  concrete "context" classes for both sides.
+  CLegacyContextClient processes and sends events from client to server where CContextServer receives these events
+  and processes them.
+  */
+  class COnlineContextClient : public CContextClient
+  {
+    public:
+      // Contructor
+      COnlineContextClient(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0):
+                          CContextClient(parent, intraComm, interComm, parentServer) {}
+
+      // Send event to server
+      ETransport getType(void) { return online ;}
+      
+      void sendEvent(CEventClient& event) { ERROR("void COnlineContextClient::sendEvent(CEventClient& event)",<< "this method may not be called") ;}
+      void eventLoop(void) { ERROR("void COnlineContextClient::eventLoop(void)",<< "this method may not be called") ;}
+      void releaseBuffers(void) { ERROR("void COnlineContextClient::releaseBuffers(void)",<< "this method may not be called") ;}
+      bool havePendingRequests(void) { ERROR(" bool COnlineContextClient::havePendingRequests(void)",<< "this method may not be called") ; return false ;}
+
+      bool isNotifiedFinalized(void) { ERROR("bool COnlineContextClient::isNotifiedFinalized(void)",<< "this method may not be called") ;return false ;}
+      void finalize(void) { ERROR("void COnlineContextClient::finalize(void)",<< "this method may not be called") ;}
+
+      void setBufferSize(const std::map<int,StdSize>& mapSize) { ERROR("void setBufferSize(const std::map<int,StdSize>& mapSize)",<< "this method may not be called") ;}
+
+
+    private:
+
+  };
+}
+
+#endif // __Online_CONTEXT_CLIENT_HPP__
Index: XIOS3/trunk/src/type/type_util.hpp
===================================================================
--- XIOS3/trunk/src/type/type_util.hpp	(revision 2498)
+++ XIOS3/trunk/src/type/type_util.hpp	(revision 2507)
@@ -70,5 +70,11 @@
     class CServiceNode ;
     class CServiceNodeGroup ;
-      
+    class CRedistributeDomain;
+    class CRedistributeDomainGroup;
+    class CRedistributeAxis;
+    class CRedistributeAxisGroup;
+    class CRedistributeScalar;
+    class CRedistributeScalarGroup;
+       
   template <typename T> inline string getStrType(void);
 
@@ -158,5 +164,11 @@
   macro(CServiceNode)
   macro(CServiceNodeGroup)
-  
+  macro(CRedistributeDomain)
+  macro(CRedistributeDomainGroup)  
+  macro(CRedistributeAxis)
+  macro(CRedistributeAxisGroup)  
+  macro(CRedistributeScalar)
+  macro(CRedistributeScalarGroup)  
+
 #undef macro
 }
Index: XIOS3/trunk/src/xml_parser_decl.cpp
===================================================================
--- XIOS3/trunk/src/xml_parser_decl.cpp	(revision 2498)
+++ XIOS3/trunk/src/xml_parser_decl.cpp	(revision 2507)
@@ -44,4 +44,8 @@
     macro( PoolNode )
     macro( ServiceNode )
+    macro( RedistributeDomain )
+    macro( RedistributeAxis )
+    macro( RedistributeScalar )
+
   }
 }
