Index: XIOS/dev/dev_olga/src/distribution_client.cpp
===================================================================
--- XIOS/dev/dev_olga/src/distribution_client.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/distribution_client.cpp	(revision 1144)
@@ -10,110 +10,4 @@
 
 namespace xios {
-
-CDistributionClient::CDistributionClient(int rank, CGrid* grid, const GlobalLocalDataMap& globalLocalIndex)
-  : CDistribution(rank, 0)
-   , axisDomainOrder_()
-   , nLocal_(), nGlob_(), nBeginLocal_(), nBeginGlobal_(),nZoomBegin_(), nZoomEnd_()
-   , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_(), domainMasks_(), axisMasks_()
-   , gridMask_(), indexMap_()
-   , isDataDistributed_(true), axisNum_(0), domainNum_(0)
-   , localDataIndex_(), localMaskIndex_()
-   , globalLocalDataSendToServerMap_(globalLocalIndex)
-   , infoIndex_(), isComputed_(false)
-   , elementLocalIndex_(), elementGlobalIndex_(), elementIndexData_()
-   , elementZoomMask_(), elementNLocal_(), elementNGlobal_()
-{
-  isComputed_ = true;
-  localDataIndex_.resize(globalLocalIndex.size());
-  localMaskIndex_.resize(globalLocalIndex.size());
-  GlobalLocalDataMap::const_iterator it = globalLocalIndex.begin(), ite = globalLocalIndex.end();
-  int idx = 0;
-  for (; it!=ite; ++it)
-  {
-    localMaskIndex_[idx] = localDataIndex_[idx] = it->second;
-    ++idx;
-  }
-
-  std::vector<CDomain*> domList = grid->getDomains();
-  std::vector<CAxis*> axisList = grid->getAxis();
-  std::vector<CScalar*> scalarList = grid->getScalars();
-  CArray<int,1> axisDomainOrder = grid->axis_domain_order;
-
-  int numElement = axisDomainOrder.numElements();
-  // Because domain and axis can be in any order (axis1, domain1, axis2, axis3, )
-  // their position should be specified. In axisDomainOrder, domain == true, axis == false
-  int dims = numElement;
-  idx = 0;
-  std::vector<int> indexMap(numElement);  
-  for (int i = 0; i < numElement; ++i)
-  {
-    indexMap[i] = idx;
-    if (2 == axisDomainOrder(i))
-    {
-      ++dims;
-      idx += 2;
-    }
-    else ++idx;
-  }
-
-  nGlob_.resize(dims);
-
-  // Data_n_index of domain or axis (For now, axis uses its size as data_n_index
-  dataNIndex_.resize(numElement);
-  dataDims_.resize(numElement);
-  isDataDistributed_ = false;
-  int domIndex = 0, axisIndex = 0, scalarIndex = 0;
-  for (idx = 0; idx < numElement; ++idx)
-  {
-    int eleDim = axisDomainOrder(idx);
-
-    // If this is a domain
-    if (2 == eleDim)
-    {
-      // On the j axis
-      nGlob_.at(indexMap[idx]+1)  = domList[domIndex]->nj_glo.getValue();
-      nGlob_.at(indexMap[idx]) = domList[domIndex]->ni_glo.getValue();
-      dataNIndex_.at(idx) = domList[domIndex]->data_i_index.numElements();
-      dataDims_.at(idx) = domList[domIndex]->data_dim.getValue();
-
-      isDataDistributed_ |= domList[domIndex]->isDistributed();
-      ++domIndex;
-    }
-    else if (1 == eleDim)// So it's an axis
-    {
-      nGlob_.at(indexMap[idx]) = axisList[axisIndex]->n_glo.getValue();
-      dataNIndex_.at(idx) = axisList[axisIndex]->data_index.numElements();
-      dataDims_.at(idx) = 1;
-
-      isDataDistributed_ |= axisList[axisIndex]->isDistributed();
-      ++axisIndex;
-    }
-    else // scalar
-    {
-      nGlob_.at(indexMap[idx]) = 1;
-      dataNIndex_.at(idx) = 1;
-      dataDims_.at(idx) = 1;
-
-      isDataDistributed_ |= false;
-      ++scalarIndex;
-    }
-  }
-
-}
-
-CDistributionClient::CDistributionClient(int rank, int dims, const CArray<size_t,1>& globalIndex)
-   : CDistribution(rank, dims, globalIndex)
-   , axisDomainOrder_()
-   , nLocal_(), nGlob_(), nBeginLocal_(), nBeginGlobal_(),nZoomBegin_(), nZoomEnd_()
-   , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_(), domainMasks_(), axisMasks_()
-   , gridMask_(), indexMap_()
-   , isDataDistributed_(true), axisNum_(0), domainNum_(0)
-   , localDataIndex_(), localMaskIndex_()
-   , globalLocalDataSendToServerMap_()
-   , infoIndex_(), isComputed_(false)
-   , elementLocalIndex_(), elementGlobalIndex_(), elementIndexData_()
-   , elementZoomMask_(), elementNLocal_(), elementNGlobal_()
-{
-}
 
 CDistributionClient::CDistributionClient(int rank, CGrid* grid)
Index: XIOS/dev/dev_olga/src/distribution_client.hpp
===================================================================
--- XIOS/dev/dev_olga/src/distribution_client.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/distribution_client.hpp	(revision 1144)
@@ -33,7 +33,5 @@
 
   public:
-    /** Default constructor */
-    CDistributionClient(int rank, CGrid* grid, const GlobalLocalDataMap& globalLocalIndex);
-    CDistributionClient(int rank, int dims, const CArray<size_t,1>& globalIndex = CArray<size_t,1>());
+    /** Default constructor */        
     CDistributionClient(int rank, CGrid* grid);
 
Index: XIOS/dev/dev_olga/src/distribution_server.cpp
===================================================================
--- XIOS/dev/dev_olga/src/distribution_server.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/distribution_server.cpp	(revision 1144)
@@ -12,18 +12,4 @@
 namespace xios {
 
-CDistributionServer::CDistributionServer(int rank, int dims, const CArray<size_t,1>& globalIndex)
-  : CDistribution(rank, dims, globalIndex), nGlobal_(), nZoomSize_(), nZoomBegin_(), globalLocalIndexMap_(),
-  globalIndexEachDimension_()
-{
-}
-
-CDistributionServer::CDistributionServer(int rank, const std::vector<int>& nZoomBegin,
-                                         const std::vector<int>& nZoomSize, const std::vector<int>& nGlobal)
-  : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nZoomSize_(nZoomSize), nZoomBegin_(nZoomBegin), globalLocalIndexMap_(),
-  globalIndexEachDimension_()
-{
-  createGlobalIndex();
-}
-
 CDistributionServer::CDistributionServer(int rank, const std::vector<int>& nZoomBegin,
                                          const std::vector<int>& nZoomSize,
@@ -31,19 +17,8 @@
                                          const std::vector<int>& nGlobal)
   : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nZoomBeginGlobal_(nZoomBeginGlobal),
-    nZoomSize_(nZoomSize), nZoomBegin_(nZoomBegin), globalLocalIndexMap_(),
-    globalIndexEachDimension_()
+    nZoomSize_(nZoomSize), nZoomBegin_(nZoomBegin), globalLocalIndexMap_()
 {
   createGlobalIndex();
 }
-
-// CDistributionServer::CDistributionServer(int rank, 
-//                                          const std::vector<CArray<int,1> >& globalIndexEachDimension,
-//                                          const std::vector<int>& nGlobal)
-//   : CDistribution(rank, nGlobal.size()), nGlobal_(nGlobal), nZoomBeginGlobal_(),
-//     nZoomSize_(), nZoomBegin_(), globalLocalIndexMap_(), 
-//     globalIndexEachDimension_(globalIndexEachDimension)
-// {
-//   createGlobalIndexFromIndex(globalIndexEachDimension, nGlobal);
-// }
 
 CDistributionServer::~CDistributionServer()
@@ -99,76 +74,4 @@
     idxLoop[0] += innerLoopSize;
   }
-}
-
-// void CDistributionServer::createGlobalIndexFromIndex(const std::vector<CArray<int,1> >& globalIndexOnEachDimension,
-//                                                      const std::vector<int>& nbGlobal)
-// {
-//   size_t idx = 0, ssize = 1;
-//   for (int i = 0; i < globalIndexOnEachDimension.size(); ++i) ssize *= globalIndexOnEachDimension[i].numElements();
-
-//   this->globalIndex_.resize(ssize);
-//   size_t nbDim = nbGlobal.size();
-//   std::vector<int> idxLoop(nbDim,0);
-//   std::vector<int> currentIndex(nbDim);
-//   int innerLoopSize = globalIndexOnEachDimension[0].numElements();
-
-//   globalLocalIndexMap_.rehash(std::ceil(ssize/globalLocalIndexMap_.max_load_factor()));
-//   while (idx<ssize)
-//   {
-//     for (int i = 0; i < nbDim-1; ++i)
-//     {
-//       if (idxLoop[i] == globalIndexOnEachDimension[i].numElements())
-//       {
-//         idxLoop[i] = 0;
-//         ++idxLoop[i+1];
-//       }
-//     }
-
-//     for (int i = 1; i < nbDim; ++i)
-//       currentIndex[i] = globalIndexOnEachDimension[i](idxLoop[i]);
-
-//     size_t mulDim, globalIndex;
-//     for (int i = 0; i < innerLoopSize; ++i)
-//     {
-//       mulDim = 1;
-//       globalIndex = globalIndexOnEachDimension[0](i);
-
-//       for (int k = 0; k < nbDim; ++k)
-//       {
-//         mulDim *= nbGlobal[k];
-//         globalIndex += (currentIndex[k])*mulDim;
-//       }
-//       globalLocalIndexMap_[globalIndex] = idx;
-//       this->globalIndex_(idx) = globalIndex;
-
-//       ++idx;
-//     }
-//     idxLoop[0] += innerLoopSize;
-//   }
-
-// }
-
-/*!
-  Compute local index for writing data on server
-  \param [in] globalIndex global index received from client
-  \return local index of written data
-*/
-CArray<size_t,1> CDistributionServer::computeLocalIndex(const CArray<size_t,1>& globalIndex)
-{
-  size_t ssize = globalIndex.numElements();
-  size_t localIndexSize = std::min(globalIndex_.numElements(), ssize);
-  CArray<size_t,1> localIndex(localIndexSize);
-  GlobalLocalMap::const_iterator ite = globalLocalIndexMap_.end(), it;
-  for (int idx = 0, i = 0; idx < ssize; ++idx)
-  {
-    it = globalLocalIndexMap_.find(globalIndex(idx));
-    if (ite != it)
-    {
-      localIndex(idx) = it->second;
-      ++i;
-    }
-  }
-
-  return localIndex;
 }
 
Index: XIOS/dev/dev_olga/src/distribution_server.hpp
===================================================================
--- XIOS/dev/dev_olga/src/distribution_server.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/distribution_server.hpp	(revision 1144)
@@ -23,13 +23,7 @@
   public:
     /** Default constructor */
-    CDistributionServer(int rank, int dims, const CArray<size_t,1>& globalIndex = CArray<size_t,1>());
-    CDistributionServer(int rank, const std::vector<int>& nZoomBeginServer,
-                        const std::vector<int>& nZoomSizeServer, const std::vector<int>& nGlobal);
     CDistributionServer(int rank, const std::vector<int>& nZoomBeginServer,
                         const std::vector<int>& nZoomSizeServer,
                         const std::vector<int>& nZoomBeginGlobal,
-                        const std::vector<int>& nGlobal);
-    CDistributionServer(int rank, 
-                        const std::vector<CArray<int,1> >& globalIndexEachDimension,
                         const std::vector<int>& nGlobal);
 
@@ -40,9 +34,7 @@
     const std::vector<int>& getZoomBeginServer() const;
     const std::vector<int>& getZoomSizeServer() const;
-    const GlobalLocalMap& getGlobalLocalIndex() const { return globalLocalIndexMap_; }
-    const std::vector<CArray<int,1> >& getGlobalIndexEachDimension() const {return globalIndexEachDimension_;}
+    const GlobalLocalMap& getGlobalLocalIndex() const { return globalLocalIndexMap_; }    
     int getGridSize() const;
-
-    virtual CArray<size_t,1> computeLocalIndex(const CArray<size_t,1>& globalIndex);
+    
     virtual void computeLocalIndex(CArray<size_t,1>& globalIndex);
     virtual void computeGlobalIndex(CArray<int,1>& indexes) const;
@@ -62,6 +54,4 @@
     std::vector<int> nZoomSize_;
     std::vector<int> nZoomBegin_;
-    std::vector<CArray<int, 1> > globalIndexEachDimension_;
-
 };
 
Index: XIOS/dev/dev_olga/src/io/nc4_data_output.cpp
===================================================================
--- XIOS/dev/dev_olga/src/io/nc4_data_output.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/io/nc4_data_output.cpp	(revision 1144)
@@ -1378,17 +1378,8 @@
              if (i != 0) compress << ' ';
            }
-           SuperClassWriter::addAttribute("compress", compress.str(), &varId);
-
-           // grid->computeCompressedIndex();
+           SuperClassWriter::addAttribute("compress", compress.str(), &varId);         
 
            CArray<int, 1> indexes(grid->getNumberWrittenIndexes());
            indexes = grid->localIndexToWriteOnServer;
-           // std::map<int, CArray<size_t, 1> >::const_iterator it;
-           // for (it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)
-           // {
-           //   const CArray<size_t, 1> compressedIndexes = grid->compressedOutIndexFromClient[it->first];
-           //   for (int i = 0; i < it->second.numElements(); i++)
-           //     indexes(compressedIndexes(i)) = it->second(i);
-           // }
 
            switch (SuperClass::type)
@@ -1447,9 +1438,4 @@
                }
 
-               // const std::vector<int>& indexesToWrite = domain->getIndexesToWrite();
-               // indexes.resize(indexesToWrite.size());
-               // for (int n = 0; n < indexes.numElements(); ++n)
-               //   indexes(n) = indexesToWrite[n];
-
                indexes.resize(domain->compressedIndexToWriteOnServer.numElements());
                indexes = domain->compressedIndexToWriteOnServer;
@@ -1478,9 +1464,4 @@
                compress = axisId;
 
-               // const std::vector<int>& indexesToWrite = axis->getIndexesToWrite();
-               // indexes.resize(indexesToWrite.size());
-               // for (int n = 0; n < indexes.numElements(); ++n)
-               //   indexes(n) = indexesToWrite[n];
-
                indexes.resize(axis->compressedIndexToWriteOnServer.numElements());
                indexes = axis->compressedIndexToWriteOnServer;
@@ -1529,8 +1510,5 @@
                }
              }
-           }
-
-           // if (!dims.empty())
-           //   grid->computeCompressedIndex();
+            }
          }
 
Index: XIOS/dev/dev_olga/src/node/axis.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/axis.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/axis.cpp	(revision 1144)
@@ -58,10 +58,4 @@
 
    ///---------------------------------------------------------------
-
-   const std::set<StdString> & CAxis::getRelFiles(void) const
-   {
-      return (this->relFiles);
-   }
-
    bool CAxis::IsWritten(const StdString & filename) const
    {
@@ -101,9 +95,4 @@
 
    //----------------------------------------------------------------
-
-   const std::vector<int>& CAxis::getIndexesToWrite(void) const
-   {
-     return indexesToWrite;
-   }
 
    /*!
@@ -207,9 +196,8 @@
    }
 
-   void CAxis::fillInValues(const CArray<double,1>& values)
-   {
-     this->value = values;
-   }
-
+   /*!
+     Check common attributes of an axis.
+     This check should be done in the very beginning of work flow
+   */
    void CAxis::checkAttributes(void)
    {
@@ -270,4 +258,7 @@
    }
 
+   /*!
+      Check the validity of data and fill in values if any.
+   */
    void CAxis::checkData()
    {
@@ -292,4 +283,7 @@
    }
 
+   /*!
+     Check validity of zoom info and fill in values if any.
+   */
    void CAxis::checkZoom(void)
    {
@@ -304,4 +298,7 @@
    }
 
+   /*!
+     Check validity of mask info and fill in values if any.
+   */
    void CAxis::checkMask()
    {
@@ -325,25 +322,28 @@
    }
 
-  void CAxis::checkBounds()
-  {
-    if (!bounds.isEmpty())
-    {
-      if (bounds.extent(0) != 2 || bounds.extent(1) != n)
-        ERROR("CAxis::checkAttributes(void)",
-              << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension 2 x axis size." << std::endl
-              << "Axis size is " << n.getValue() << "." << std::endl
-              << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << ".");
-      hasBounds_ = true;
-    }
-    else hasBounds_ = false;
-  }
-
-  void CAxis::checkEligibilityForCompressedOutput()
-  {
-    // We don't check if the mask is valid here, just if a mask has been defined at this point.
-    isCompressible_ = !mask.isEmpty();
-  }
-
-  bool CAxis::dispatchEvent(CEventServer& event)
+   /*!
+     Check validity of bounds info and fill in values if any.
+   */
+   void CAxis::checkBounds()
+   {
+     if (!bounds.isEmpty())
+     {
+       if (bounds.extent(0) != 2 || bounds.extent(1) != n)
+         ERROR("CAxis::checkAttributes(void)",
+               << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension 2 x axis size." << std::endl
+               << "Axis size is " << n.getValue() << "." << std::endl
+               << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << ".");
+       hasBounds_ = true;
+     }
+     else hasBounds_ = false;
+   }
+
+   void CAxis::checkEligibilityForCompressedOutput()
+   {
+     // We don't check if the mask is valid here, just if a mask has been defined at this point.
+     isCompressible_ = !mask.isEmpty();
+   }
+
+   bool CAxis::dispatchEvent(CEventServer& event)
    {
       if (SuperClass::dispatchEvent(event)) return true;
@@ -356,8 +356,4 @@
              return true;
              break;
-          //  case EVENT_ID_INDEX:
-          //   recvIndex(event);
-          //   return true;
-          //   break;
           case EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES:
             recvNonDistributedAttributes(event);
@@ -376,4 +372,7 @@
    }
 
+   /*!
+     Check attributes on client side (This name is still adequate???)
+   */
    void CAxis::checkAttributesOnClient()
    {
@@ -385,4 +384,7 @@
    }
 
+   /*
+     The (spatial) transformation sometimes can change attributes of an axis. Therefore, we should recheck them.
+   */
    void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid,
                                                           CServerDistributionDescription::ServerDistributionType distType)
@@ -413,4 +415,9 @@
    }
 
+  /*!
+    Send attributes from one client to other clients
+    \param[in] globalDim global dimension of grid which contains this axis
+    \param[in] order
+  */
   void CAxis::sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid,
                              CServerDistributionDescription::ServerDistributionType distType)
@@ -561,31 +568,6 @@
       indSrv_.swap(globalIndexAxisOnServer);
 
-      // CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexAxisOnServer.begin(),
-      //                                                      ite = globalIndexAxisOnServer.end();
       CClientServerMapping::GlobalIndexMap::const_iterator it = indSrv_.begin(),
                                                            ite = indSrv_.end();
-      // std::vector<size_t>::const_iterator itbVec = (globalAxisZoom).begin(),
-      //                                     iteVec = (globalAxisZoom).end();
-      // indSrv_.clear();
-      // indWrittenSrv_.clear();
-      // for (; it != ite; ++it)
-      // {
-      //   int rank = it->first;
-      //   const std::vector<size_t>& globalIndexTmp = it->second;
-      //   int nb = globalIndexTmp.size();
-
-      //   for (int i = 0; i < nb; ++i)
-      //   {
-      //     if (std::binary_search(itbVec, iteVec, globalIndexTmp[i]))
-      //     {
-      //       indSrv_[rank].push_back(globalIndexTmp[i]);
-      //     }
-
-      //     if (writtenInd.count(globalIndexTmp[i]))
-      //     {
-      //       indWrittenSrv_[rank].push_back(globalIndexTmp[i]);
-      //     }
-      //   }
-      // }
 
       connectedServerRank_.clear();
@@ -594,12 +576,4 @@
       }
 
-      // if (!indSrv_.empty())
-      // {
-      //   std::map<int, vector<size_t> >::const_iterator itIndSrv  = indSrv_.begin(),
-      //                                                  iteIndSrv = indSrv_.end();
-      //   connectedServerRank_.clear();
-      //   for (; itIndSrv != iteIndSrv; ++itIndSrv)
-      //     connectedServerRank_.push_back(itIndSrv->first);
-      // }
       nbConnectedClients_ = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
     }
@@ -750,145 +724,4 @@
     }
   }
-
-  // void CAxis::computeConnectedServer(const std::vector<int>& globalDim, int orderPositionInGrid,
-  //                                    CServerDistributionDescription::ServerDistributionType distType)
-  // {
-  //   CContext* context = CContext::getCurrent();
-  //   CContextClient* client = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
-  //   int nbServer = client->serverSize;
-  //   int range, clientSize = client->clientSize;
-  //   int rank = client->clientRank;
-
-  //   size_t ni = this->n.getValue();
-  //   size_t ibegin = this->begin.getValue();
-  //   size_t zoom_end = global_zoom_begin+global_zoom_n-1;
-  //   size_t nZoomCount = 0;
-  //   size_t nbIndex = index.numElements();
-  //   for (size_t idx = 0; idx < nbIndex; ++idx)
-  //   {
-  //     size_t globalIndex = index(idx);
-  //     if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nZoomCount;
-  //   }
-
-  //   CArray<size_t,1> globalIndexAxis(nbIndex);
-  //   std::vector<size_t> globalAxisZoom(nZoomCount);
-  //   nZoomCount = 0;
-  //   for (size_t idx = 0; idx < nbIndex; ++idx)
-  //   {
-  //     size_t globalIndex = index(idx);
-  //     globalIndexAxis(idx) = globalIndex;
-  //     if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end)
-  //     {
-  //       globalAxisZoom[nZoomCount] = globalIndex;
-  //       ++nZoomCount;
-  //     }
-  //   }
-
-  //   std::set<int> writtenInd;
-  //   if (isCompressible_)
-  //   {
-  //     for (int idx = 0; idx < data_index.numElements(); ++idx)
-  //     {
-  //       int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, ni);
-
-  //       if (ind >= 0 && ind < ni && mask(ind))
-  //       {
-  //         ind += ibegin;
-  //         if (ind >= global_zoom_begin && ind <= zoom_end)
-  //           writtenInd.insert(ind);
-  //       }
-  //     }
-  //   }
-
-  //   CServerDistributionDescription serverDescriptionGlobal(globalDim, nbServer);
-  //   int distributedDimensionOnServer = serverDescriptionGlobal.getDimensionDistributed();
-  //   CClientServerMapping::GlobalIndexMap globalIndexAxisOnServer;
-  //   if (distributedDimensionOnServer == orderPositionInGrid) // So we have distributed axis on client side and also on server side*
-  //   {
-  //     std::vector<int> nGlobAxis(1);
-  //     nGlobAxis[0] = n_glo.getValue();
-
-  //     size_t globalSizeIndex = 1, indexBegin, indexEnd;
-  //     for (int i = 0; i < nGlobAxis.size(); ++i) globalSizeIndex *= nGlobAxis[i];
-  //     indexBegin = 0;
-  //     if (globalSizeIndex <= clientSize)
-  //     {
-  //       indexBegin = rank%globalSizeIndex;
-  //       indexEnd = indexBegin;
-  //     }
-  //     else
-  //     {
-  //       for (int i = 0; i < clientSize; ++i)
-  //       {
-  //         range = globalSizeIndex / clientSize;
-  //         if (i < (globalSizeIndex%clientSize)) ++range;
-  //         if (i == client->clientRank) break;
-  //         indexBegin += range;
-  //       }
-  //       indexEnd = indexBegin + range - 1;
-  //     }
-
-  //     CServerDistributionDescription serverDescription(nGlobAxis, nbServer);
-  //     serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t,size_t>(indexBegin, indexEnd));
-  //     CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), client->intraComm);
-  //     clientServerMap->computeServerIndexMapping(globalIndexAxis);
-  //     globalIndexAxisOnServer = clientServerMap->getGlobalIndexOnServer();
-  //     delete clientServerMap;
-  //   }
-  //   else
-  //   {
-  //     std::vector<size_t> globalIndexServer(n_glo.getValue());
-  //     for (size_t idx = 0; idx < n_glo.getValue(); ++idx)
-  //     {
-  //       globalIndexServer[idx] = idx;
-  //     }
-
-  //     for (int idx = 0; idx < nbServer; ++idx)
-  //     {
-  //       globalIndexAxisOnServer[idx] = globalIndexServer;
-  //     }
-  //   }
-
-  //   CClientServerMapping::GlobalIndexMap::const_iterator it = globalIndexAxisOnServer.begin(),
-  //                                                        ite = globalIndexAxisOnServer.end();
-  //   std::vector<size_t>::const_iterator itbVec = (globalAxisZoom).begin(),
-  //                                       iteVec = (globalAxisZoom).end();
-  //   indSrv_.clear();
-  //   indWrittenSrv_.clear();
-  //   for (; it != ite; ++it)
-  //   {
-  //     int rank = it->first;
-  //     const std::vector<size_t>& globalIndexTmp = it->second;
-  //     int nb = globalIndexTmp.size();
-
-  //     for (int i = 0; i < nb; ++i)
-  //     {
-  //       if (std::binary_search(itbVec, iteVec, globalIndexTmp[i]))
-  //       {
-  //         indSrv_[rank].push_back(globalIndexTmp[i]);
-  //       }
-
-  //       if (writtenInd.count(globalIndexTmp[i]))
-  //       {
-  //         indWrittenSrv_[rank].push_back(globalIndexTmp[i]);
-  //       }
-  //     }
-  //   }
-
-  //   connectedServerRank_.clear();
-  //   for (it = globalIndexAxisOnServer.begin(); it != ite; ++it) {
-  //     connectedServerRank_.push_back(it->first);
-  //   }
-
-  //   if (!indSrv_.empty())
-  //   {
-  //     std::map<int, vector<size_t> >::const_iterator itIndSrv  = indSrv_.begin(),
-  //                                                    iteIndSrv = indSrv_.end();
-  //     connectedServerRank_.clear();
-  //     for (; itIndSrv != iteIndSrv; ++itIndSrv)
-  //       connectedServerRank_.push_back(itIndSrv->first);
-  //   }
-  //   nbConnectedClients_ = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
-  // }
 
   void CAxis::sendNonDistributedAttributes()
Index: XIOS/dev/dev_olga/src/node/axis.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/axis.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/axis.hpp	(revision 1144)
@@ -45,6 +45,5 @@
          enum EEventId
          {
-           EVENT_ID_DISTRIBUTION_ATTRIBUTE,
-           EVENT_ID_INDEX,
+           EVENT_ID_DISTRIBUTION_ATTRIBUTE,           
            EVENT_ID_DISTRIBUTED_VALUE,
            EVENT_ID_NON_DISTRIBUTED_VALUE,
@@ -69,9 +68,5 @@
 
          static CAxis* createAxis();
-
-         /// Accesseurs ///
-         const std::set<StdString> & getRelFiles(void) const;
-
-         const std::vector<int>& getIndexesToWrite(void) const;
+     
          int getNumberWrittenIndexes() const;
          int getTotalNumberWrittenIndexes() const;
@@ -117,6 +112,5 @@
          bool hasTransformation();
          void solveInheritanceTransformation();
-         TransMapTypes getAllTransformations();
-         void fillInValues(const CArray<double,1>& values);
+         TransMapTypes getAllTransformations();         
          void duplicateTransformation(CAxis*);
          CTransformation<CAxis>* addTransformation(ETranformationType transType, const StdString& id="");
Index: XIOS/dev/dev_olga/src/node/context.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/context.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/context.cpp	(revision 1144)
@@ -526,17 +526,11 @@
    void CContext::postProcessingGlobalAttributes()
    {
-     if (allProcessed) return;
+     if (allProcessed) return;  
      
-     // if (hasClient)
-     // {
-       // After xml is parsed, there are some more works with post processing
-       postProcessing();
-
-       // Check grid and calculate its distribution
-       checkGridEnabledFields();
-
-     //}
-
-
+     // After xml is parsed, there are some more works with post processing
+     postProcessing();
+
+     // Check grid and calculate its distribution
+     checkGridEnabledFields();    
 
      setClientServerBuffer();
@@ -565,4 +559,5 @@
        // We have a xml tree on the server side and now, it should be also processed
        sendPostProcessing();
+
        sendGridEnabledFields();       
      }
@@ -605,6 +600,5 @@
 
    void CContext::recvPostProcessingGlobalAttributes(CBufferIn& buffer)
-   {
-      // CCalendarWrapper::get(CCalendarWrapper::GetDefName())->createCalendar();
+   {      
       postProcessingGlobalAttributes();
    }
@@ -632,8 +626,6 @@
       buildFilterGraphOfFieldsWithReadAccess();
     }
-
-    // if (hasClient) this->solveAllRefOfEnabledFields(true);    
-    checkGridEnabledFields();
-    // sendGridEnabledFields();
+    
+    checkGridEnabledFields();    
 
     if (hasClient) this->sendProcessingGridOfEnabledFields();
@@ -666,18 +658,4 @@
       for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i)
         (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode();
-   }
-
-   void CContext::solveAllEnabledFields()
-   {
-     int size = this->enabledFiles.size();
-     for (int i = 0; i < size; ++i)
-     {
-       this->enabledFiles[i]->solveOnlyRefOfEnabledFields(false);
-     }
-
-     for (int i = 0; i < size; ++i)
-     {
-       this->enabledFiles[i]->generateNewTransformationGridDest();
-     }
    }
 
@@ -1062,6 +1040,5 @@
       CBufferIn* buffer=event.subEvents.begin()->buffer;
       string id;
-      *buffer>>id;
-      //get(id)->solveOnlyRefOfEnabledFields(false);
+      *buffer>>id;      
    }
 
@@ -1156,6 +1133,5 @@
 
       // Check if some automatic time series should be generated
-      // Warning: This must be done after solving the inheritance and before the rest of post-processing
-      // prepareTimeseries();
+      // Warning: This must be done after solving the inheritance and before the rest of post-processing      
 
       // The timeseries should only be prepared in client
@@ -1164,8 +1140,7 @@
       //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ã  sortir.
       this->findEnabledFiles();
-      // this->findEnabledReadModeFiles();
+      
       // For now, only read files with client and only one level server
       if (hasClient && !hasServer) this->findEnabledReadModeFiles();
-
 
       // Find all enabled fields of each file
@@ -1174,10 +1149,10 @@
       if (hasClient && !hasServer) this->findAllEnabledFieldsInReadModeFiles();
 
-//     if (hasClient)
-     if (hasClient && !hasServer)
-     {
-      // Try to read attributes of fields in file then fill in corresponding grid (or domain, axis)
-      this->readAttributesOfEnabledFieldsInReadModeFiles();
-     }
+
+      if (hasClient && !hasServer)
+      {
+       // Try to read attributes of fields in file then fill in corresponding grid (or domain, axis)
+       this->readAttributesOfEnabledFieldsInReadModeFiles();
+      }
 
       // Only search and rebuild all reference objects of enable fields, don't transform
Index: XIOS/dev/dev_olga/src/node/context.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/context.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/context.hpp	(revision 1144)
@@ -128,5 +128,4 @@
 
          void solveAllRefOfEnabledFieldsAndTransform(bool sendToServer);
-         void solveAllEnabledFields();
          void checkGridEnabledFields();
          void sendGridEnabledFields();
Index: XIOS/dev/dev_olga/src/node/domain.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/domain.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/domain.cpp	(revision 1144)
@@ -79,15 +79,4 @@
    }
 
-   const std::set<StdString> & CDomain::getRelFiles(void) const
-   {
-      return (this->relFiles);
-   }
-
-
-   const std::vector<int>& CDomain::getIndexesToWrite(void) const
-   {
-     return indexesToWrite;
-   }
-
    /*!
      Returns the number of indexes written by each server.
@@ -115,38 +104,4 @@
    {
      return offsetWrittenIndexes_;
-   }
-
-   /*!
-     Returns the start of indexes written by each server.
-     \return the start of indexes written by each server
-   */
-   const std::vector<int>& CDomain::getStartWriteIndex() const
-   {
-     return start_write_index_;
-   }
-
-   /*!
-     Returns the count of indexes written by each server.
-     \return the count of indexes written by each server
-   */
-   const std::vector<int>& CDomain::getCountWriteIndex() const
-   {
-     return count_write_index_;
-   }
-
-   /*!
-     Returns the local data written by each server.     
-   */
-   const std::vector<int>& CDomain::getLocalWriteSize() const
-   {
-     return local_write_size_;
-   }
-
-   /*!
-     Returns the global data written by all server.     
-   */
-   const std::vector<int>& CDomain::getGlobalWriteSize() const
-   {
-     return global_write_size_;
    }
 
@@ -1564,9 +1519,9 @@
    }
 
-
-  // void CDomain::computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid,
-  //                                     CServerDistributionDescription::ServerDistributionType distType)
   /*!
-     Compute the connection of a client to other clients to determine which clients to send attributes to
+     Compute the connection of a client to other clients to determine which clients to send attributes to.
+     The sending clients are supposed to already know the distribution of receiving clients (In simple cases, it's band)
+     The connection among clients is calculated by using global index. 
+     A client connects to other clients which holds the same global index as it.     
   */
   void CDomain::computeConnectedClients()
@@ -1609,35 +1564,6 @@
       }
 
-      // for (i = 0; i < nbIndex; ++i)
-      // {
-      //   i_ind=i_index(i);
-      //   j_ind=j_index(i);
-
-      //   if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-      //   {
-      //     ++globalIndexCountZoom;
-      //   }
-      // }
-
-      // int globalIndexWrittenCount = 0;
-      // if (isCompressible_)
-      // {
-      //   for (i = 0; i < data_i_index.numElements(); ++i)
-      //   {
-      //     i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
-      //                                                 data_ibegin, data_jbegin, data_dim, ni,
-      //                                                 j_ind);
-      //     if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
-      //     {
-      //       i_ind += ibegin;
-      //       j_ind += jbegin;
-      //       if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-      //         ++globalIndexWrittenCount;
-      //     }
-      //   }
-      // }
 
       // Fill in index
-
       CArray<size_t,1> globalIndexDomainZoom(globalIndexCountZoom);
       CArray<size_t,1> localIndexDomainZoom(globalIndexCountZoom);
@@ -1672,10 +1598,4 @@
           globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
           ++globalIndexCountZoom;
-          // if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-          // {
-          //   globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
-          //   localIndexDomainZoom(globalIndexCountZoom) = i;
-          //   ++globalIndexCountZoom;
-          // }
         }
       }
@@ -1699,5 +1619,5 @@
           int jend = jbegin + nj -1;
           zoom_ibegin = global_zoom_ibegin > ibegin ? global_zoom_ibegin : ibegin;
-          int zoom_iend   = global_zoom_iend < iend ? zoom_iend : iend ;
+          int zoom_iend  = global_zoom_iend < iend ? zoom_iend : iend ;
           zoom_ni     = zoom_iend-zoom_ibegin+1 ;
 
@@ -1707,33 +1627,4 @@
       }
 
-      // if (globalLocalIndexZoomMap_.empty())
-      // {
-      //   int nbIndexZoom = globalIndexDomainZoom.numElements();
-      //   for (i = 0; i < nbIndex; ++i)
-      //     globalLocalIndexZoomMap_[globalIndexDomainZoom(i)] = i;
-      // }
-
-
-      // CArray<int,1> globalIndexWrittenDomain(globalIndexWrittenCount);
-      // if (isCompressible_)
-      // {
-      //   globalIndexWrittenCount = 0;
-      //   for (i = 0; i < data_i_index.numElements(); ++i)
-      //   {
-      //     i_ind = CDistributionClient::getDomainIndex(data_i_index(i), data_j_index(i),
-      //                                                 data_ibegin, data_jbegin, data_dim, ni,
-      //                                                 j_ind);
-      //     if (i_ind >= 0 && i_ind < ni && j_ind >= 0 && j_ind < nj && mask_1d(i_ind + j_ind * ni))
-      //     {
-      //       i_ind += ibegin;
-      //       j_ind += jbegin;
-      //       if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-      //       {
-      //         globalIndexWrittenDomain(globalIndexWrittenCount) = i_ind + j_ind * ni_glo;
-      //         ++globalIndexWrittenCount;
-      //       }
-      //     }
-      //   }
-      // }
 
       size_t globalSizeIndex = 1, indexBegin, indexEnd;
@@ -1772,34 +1663,4 @@
       CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
                                                            ite = globalIndexDomainOnServer.end();
-      // typedef XIOSBinarySearchWithIndex<size_t> BinarySearch;
-      // std::vector<int>::iterator itVec;
-
-      // indSrv_.clear();
-      // indWrittenSrv_.clear();
-      // for (; it != ite; ++it)
-      // {
-      //   int rank = it->first;
-      //   int indexSize = it->second.size();
-      //   std::vector<int> permutIndex(indexSize);
-      //   XIOSAlgorithms::fillInIndex(indexSize, permutIndex);
-      //   XIOSAlgorithms::sortWithIndex<size_t, CVectorStorage>(it->second, permutIndex);
-      //   BinarySearch binSearch(it->second);
-      //   int nb = globalIndexDomainZoom.numElements();
-      //   for (int i = 0; i < nb; ++i)
-      //   {
-      //     if (binSearch.search(permutIndex.begin(), permutIndex.end(), globalIndexDomainZoom(i), itVec))
-      //     {
-      //       indSrv_[rank].push_back(localIndexDomainZoom(i));
-      //     }
-      //   }
-      //   for (int i = 0; i < globalIndexWrittenDomain.numElements(); ++i)
-      //   {
-      //     if (binSearch.search(permutIndex.begin(), permutIndex.end(), globalIndexWrittenDomain(i), itVec))
-      //     {
-      //       indWrittenSrv_[rank].push_back(globalIndexWrittenDomain(i));
-      //     }
-      //   }
-      // }
-
       connectedServerRank_.clear();
       for (it = globalIndexDomainOnServer.begin(); it != ite; ++it) {
@@ -1823,9 +1684,9 @@
   }
 
-  const boost::unordered_map<int, vector<size_t> >& CDomain::getIndexServer() const
-  {
-    return indSrv_;
-  }
-
+   /*!
+     Compute index to write data. We only write data on the zoomed region, therefore, there should
+     be a map between the complete grid and the reduced grid where we write data.
+     By using global index we can easily create this kind of mapping.
+   */
    void CDomain::computeWrittenIndex()
    {  
@@ -1976,16 +1837,4 @@
         list_msgsIndex.back() << list_indGlob.back(); //list_indi.back() << list_indj.back();
        
-        // if (isCompressible_)
-        // {
-        //   std::vector<int>& writtenIndSrc = indWrittenSrv_[rank];
-        //   list_writtenInd.push_back(CArray<int,1>(writtenIndSrc.size()));
-        //   CArray<int,1>& writtenInd = list_writtenInd.back();
-
-        //   for (n = 0; n < writtenInd.numElements(); ++n)
-        //     writtenInd(n) = writtenIndSrc[n];
-
-        //   list_msgsIndex.back() << writtenInd;
-        // }
-
         eventIndex.push(rank, nbConnectedClients_[rank], list_msgsIndex.back());
       }
@@ -1997,5 +1846,6 @@
   /*!
     Send global index and zoom index from client to connected client(s)
-    zoom index can be smaller than global index
+    zoom index can be smaller than global index.
+    This function can be used in the future???
   */
   void CDomain::sendIndexZoom()
@@ -2100,5 +1950,5 @@
 
   /*!
-    Send mask index from client to connected(s)
+    Send mask index from client to connected(s) clients    
   */
   void CDomain::sendMask()
@@ -2196,5 +2046,5 @@
   /*!
     Send longitude and latitude from client to servers
-    Each client send long and lat information to corresponding connected server(s).
+    Each client send long and lat information to corresponding connected clients(s).
     Because longitude and latitude are optional, this function only called if latitude and longitude exist
   */
@@ -2295,4 +2145,5 @@
     Data index can be compressed however, we always send decompressed data index
     and they will be compressed on receiving.
+    The compressed index are represented with 1 and others are represented with -1
   */
   void CDomain::sendDataIndex()
@@ -2431,19 +2282,9 @@
     }
     get(domainId)->recvIndex(rankBuffers);
-
-    // if (domain->isCompressible_)
-    // {
-    //   std::sort(domain->indexesToWrite.begin(), domain->indexesToWrite.end());
-
-    //   CContextServer* server = CContext::getCurrent()->server;
-    //   domain->numberWrittenIndexes_ = domain->indexesToWrite.size();
-    //   MPI_Allreduce(&domain->numberWrittenIndexes_, &domain->totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-    //   MPI_Scan(&domain->numberWrittenIndexes_, &domain->offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-    //   domain->offsetWrittenIndexes_ -= domain->numberWrittenIndexes_;
-    // }
   }
 
   /*!
-    Receive index information from client(s)
+    Receive index information from client(s). We use the global index for mapping index between
+    sending clients and receiving clients.
     \param[in] rankBuffers rank of sending client and the corresponding receive buffer  
   */
@@ -2484,80 +2325,5 @@
          ++nbIndGlob;
       } 
-    }   
-    
-    // {
-    //   CContextServer* server = CContext::getCurrent()->server;
-    //   count_write_index_.resize(2);
-    //   start_write_index_.resize(2);
-    //   local_write_size_.resize(2);
-    //   global_write_size_.resize(2);
-    //   if ((this->type) == CDomain::type_attr::unstructured)
-    //   {
-    //     count_write_index_[0] = zoom_i_index.numElements();
-    //     count_write_index_[1] = 0;
-    //   }
-    //   else
-    //   {
-    //     int ni_zoom = zoom_i_index.numElements(), idx, nbIZoom = 0, nbJZoom = 0;
-    //     for (idx =0; idx < ni_zoom; ++idx)
-    //     {
-    //        if ((ibegin <= zoom_i_index(idx)) && (zoom_i_index(idx) < ibegin+ni) && (nbIZoom < ni))
-    //         ++nbIZoom;
-    //        if ((jbegin <= zoom_j_index(idx)) && (zoom_j_index(idx) < jbegin+nj) && (nbJZoom < nj))
-    //         ++nbJZoom;
-    //     }
-    //     count_write_index_[0] = nbIZoom;
-    //     count_write_index_[1] = nbJZoom;
-
-    //     // Reoder the zoom_index
-    //     for (int j = 0; j < nbJZoom; ++j)
-    //       for (int i = 0; i < nbIZoom; ++i)
-    //       {
-    //         idx = nbIZoom * j + i;
-    //         if (idx < ni_zoom)
-    //         {
-    //           zoom_i_index(idx) = ibegin + i;
-    //           zoom_j_index(idx) = jbegin + j;
-    //         }
-    //       }  
-
-    //     // Reorder the global index
-    //     for (int j = 0; j < nj; ++j)
-    //       for (int i = 0; i < ni; ++i)
-    //       {
-    //         idx = ni * j + i;
-    //         if (idx < nbIndGlob)
-    //         {
-    //           i_index(idx) = ibegin + i;
-    //           j_index(idx) = jbegin + j;
-    //         }
-    //       }         
-    //   }
-
-            
-    //   MPI_Scan(&count_write_index_[0], &start_write_index_[0], 2, MPI_INT, MPI_SUM, server->intraComm);      
-    //   start_write_index_[0] = 0; 
-    //   start_write_index_[1] -= count_write_index_[1];
-    //   local_write_size_[0] = count_write_index_[0];
-    //   local_write_size_[1] = count_write_index_[1];
-    //   MPI_Allreduce(&count_write_index_[0], &global_write_size_[0], 2, MPI_INT, MPI_SUM, server->intraComm);
-    //   global_write_size_[0] = count_write_index_[0];
-    //   global_write_size_[1] = (global_write_size_[1] > nj_glo) ? nj_glo : global_write_size_[1];
-         
-
-    // }
-
-    // int type_int;
-    // buffer >> type_int >> isCurvilinear >> indiSrv[rank] >> indjSrv[rank];
-    // type.setValue((type_attr::t_enum)type_int); // probleme des type enum avec les buffers : ToFix
-
-    // if (isCompressible_)
-    // {
-    //   CArray<int, 1> writtenIndexes;
-    //   buffer >> writtenIndexes;
-    //   indexesToWrite.reserve(indexesToWrite.size() + writtenIndexes.numElements());
-    //   for (int i = 0; i < writtenIndexes.numElements(); ++i)
-    //     indexesToWrite.push_back(writtenIndexes(i));
-    // }
+    } 
   }
 
@@ -2627,13 +2393,4 @@
     {
     }
-
-    // globalLocalIndexZoomMap_.rehash(std::ceil(nbZoomInd/globalLocalIndexZoomMap_.max_load_factor()));
-    // nbZoomInd = 0;
-    // for (int j = 0; j < zoom_nj; ++j) 
-    //   for (int i = 0; i < zoom_ni; ++i)
-    //   {
-    //     globalLocalIndexZoomMap_[(i + zoom_ibegin) + (j + zoom_jbegin) * ni_glo] = nbZoomInd;
-    //     ++nbZoomInd;
-    //   }
   }
 
@@ -3004,15 +2761,4 @@
     }
     get(domainId)->recvDataIndex(rankBuffers);
-
-    // if (domain->isCompressible_)
-    // {
-    //   std::sort(domain->indexesToWrite.begin(), domain->indexesToWrite.end());
-
-    //   CContextServer* server = CContext::getCurrent()->server;
-    //   domain->numberWrittenIndexes_ = domain->indexesToWrite.size();
-    //   MPI_Allreduce(&domain->numberWrittenIndexes_, &domain->totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-    //   MPI_Scan(&domain->numberWrittenIndexes_, &domain->offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-    //   domain->offsetWrittenIndexes_ -= domain->numberWrittenIndexes_;
-    // }
   }
 
Index: XIOS/dev/dev_olga/src/node/domain.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/domain.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/domain.hpp	(revision 1144)
@@ -91,18 +91,11 @@
          CTransformation<CDomain>* addTransformation(ETranformationType transType, const StdString& id="");
 
-      public:
-         const std::set<StdString> & getRelFiles(void) const;
+      public:         
          bool IsWritten(const StdString & filename) const;
          bool isWrittenCompressed(const StdString& filename) const;
-
-         const std::vector<int>& getIndexesToWrite(void) const;
+         
          int getNumberWrittenIndexes() const;
          int getTotalNumberWrittenIndexes() const;
          int getOffsetWrittenIndexes() const;
-
-         const std::vector<int>& getStartWriteIndex() const;
-         const std::vector<int>& getCountWriteIndex() const;
-         const std::vector<int>& getLocalWriteSize() const;
-         const std::vector<int>& getGlobalWriteSize() const;
 
          std::map<int, StdSize> getAttributesBufferSize();
@@ -164,7 +157,6 @@
          static StdString GetName(void);
          static StdString GetDefName(void);
-
-         static ENodeType GetType(void);
-         const boost::unordered_map<int, vector<size_t> >& getIndexServer() const;
+         static ENodeType GetType(void);   
+
          CArray<bool, 1> localMask;
          bool isCurvilinear ;
@@ -199,13 +191,7 @@
          void sendIndexZoom();
          void sendDataIndex();
-
          void convertLonLatValue();
 
        private:         
-         std::vector<int> start_write_index_;
-         std::vector<int> count_write_index_;
-         std::vector<int> local_write_size_;
-         std::vector<int> global_write_size_;
-
          bool doZoomByIndex_;
          bool isChecked, computedWrittenIndex_;
Index: XIOS/dev/dev_olga/src/node/field.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/field.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/field.cpp	(revision 1144)
@@ -172,62 +172,8 @@
         }
         client->sendEvent(event);
-      }
-    // }
+      }    
 
     CTimer::get("XIOS Send Data").suspend();
   }
-
-  // void CField::sendUpdateData(const CArray<double,1>& data, CContextClient* client)
-  // {
-  //   CTimer::get("XIOS Send Data").resume();
-
-  //   CEventClient event(getType(), EVENT_ID_UPDATE_DATA);
-
-  //   map<int, CArray<int,1> >::iterator it;
-  //   list<CMessage> list_msg;
-  //   list<CArray<double,1> > list_data;
-
-  //   if (!grid->doGridHaveDataDistributed())
-  //   {
-  //      if (client->isServerLeader())
-  //      {
-  //         for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++)
-  //         {
-  //           int rank = it->first;
-  //           CArray<int,1>& index = it->second;
-
-  //           list_msg.push_back(CMessage());
-  //           list_data.push_back(CArray<double,1>(index.numElements()));
-
-  //           CArray<double,1>& data_tmp = list_data.back();
-  //           for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n));
-
-  //           list_msg.back() << getId() << data_tmp;
-  //           event.push(rank, 1, list_msg.back());
-  //         }
-  //         client->sendEvent(event);
-  //      }
-  //      else client->sendEvent(event);
-  //   }
-  //   else
-  //   {
-  //     for (it = grid->storeIndex_toSrv.begin(); it != grid->storeIndex_toSrv.end(); it++)
-  //     {
-  //       int rank = it->first;
-  //       CArray<int,1>& index = it->second;
-
-  //       list_msg.push_back(CMessage());
-  //       list_data.push_back(CArray<double,1>(index.numElements()));
-
-  //       CArray<double,1>& data_tmp = list_data.back();
-  //       for (int n = 0; n < data_tmp.numElements(); n++) data_tmp(n) = data(index(n));
-
-  //       list_msg.back() << getId() << data_tmp;
-  //       event.push(rank, grid->nbSenders[rank], list_msg.back());
-  //     }
-  //     client->sendEvent(event);
-  //   }
-  //   CTimer::get("XIOS Send Data").suspend();
-  // }
 
   void CField::recvUpdateData(CEventServer& event)
@@ -388,5 +334,4 @@
   {
     CContext* context = CContext::getCurrent();
-//    CContextClient* client = context->client;
     CContextClient* client = (!context->hasServer) ? context->client : this->file->getContextClient();
 
@@ -686,5 +631,4 @@
      CContext* context = CContext::getCurrent();
      if (context->hasClient && !context->hasServer)
-//     if (context->hasClient)
      {
        if (grid && !grid->isTransformed() && hasDirectFieldReference() && grid != getDirectFieldReference()->grid)
@@ -702,5 +646,4 @@
      CContext* context = CContext::getCurrent();
      if (context->hasClient && !context->hasServer)
-//     if (context->hasClient)
      {
        std::map<CGrid*,std::pair<bool,StdString> >& gridSrcMap = grid->getTransGridSource();
@@ -840,10 +783,9 @@
 
         if (context->hasClient && !context->hasServer)
-//        if (context->hasClient)
         {
           solveRefInheritance(true);
           if (hasDirectFieldReference()) getDirectFieldReference()->solveOnlyReferenceEnabledField(false);
         }
-//        else if (context->hasServer)
+
         if (context->hasServer)
           solveServerOperation();
@@ -852,5 +794,4 @@
 
         if (context->hasClient && !context->hasServer)
-//       if (context->hasClient)
        {
          solveGenerateGrid();
@@ -868,6 +809,5 @@
      {
         areAllReferenceSolved = true;
-
-       // if (context->hasClient)
+       
         if (context->hasClient && !context->hasServer)
         {
@@ -875,6 +815,5 @@
           if (hasDirectFieldReference()) getDirectFieldReference()->solveAllReferenceEnabledField(false);
         }
-       else if (context->hasServer)
-        // if (context->hasServer && !context->hasClient)
+       else if (context->hasServer)        
           solveServerOperation();
 
@@ -959,6 +898,5 @@
     */
    void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput)
-   {
-     // if (!areAllReferenceSolved) solveAllReferenceEnabledField(false);
+   {     
     if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform();
      CContext* context = CContext::getCurrent();
@@ -1367,6 +1305,4 @@
    void CField::scaleFactorAddOffset(double scaleFactor, double addOffset)
    {
-     // map<int, CArray<double,1> >::iterator it;
-     // for (it = data_srv.begin(); it != data_srv.end(); it++) it->second = (it->second - addOffset) / scaleFactor;
      recvDataSrv = (recvDataSrv - addOffset) / scaleFactor;
    }
@@ -1374,6 +1310,4 @@
    void CField::invertScaleFactorAddOffset(double scaleFactor, double addOffset)
    {
-     // map<int, CArray<double,1> >::iterator it;
-     // for (it = data_srv.begin(); it != data_srv.end(); it++) it->second = it->second * scaleFactor + addOffset;
      recvDataSrv = recvDataSrv * scaleFactor + addOffset;
    }
@@ -1402,11 +1336,4 @@
    void CField::outputCompressedField(CArray<double,1>& fieldOut)
    {
-      // map<int, CArray<double,1> >::iterator it;
-
-      // for (it = data_srv.begin(); it != data_srv.end(); it++)
-      // {
-      //    grid->outputCompressedField(it->first, it->second, fieldOut.dataFirst());
-      // }
-
       CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;
       CArray<size_t,1>& outIndexServer = grid->localIndexToWriteOnServer;
@@ -1480,5 +1407,5 @@
    }
 
-   void CField::sendAddAllVariables()
+   void CField::sendAddAllVariables(CContextClient* client)
    {
      std::vector<CVariable*> allVar = getAllVariables();
@@ -1488,18 +1415,4 @@
      for (; it != itE; ++it)
      {
-       this->sendAddVariable((*it)->getId());
-       (*it)->sendAllAttributesToServer();
-       (*it)->sendValue();
-     }
-   }
-
-   void CField::sendAddAllVariables(CContextClient* client)
-   {
-     std::vector<CVariable*> allVar = getAllVariables();
-     std::vector<CVariable*>::const_iterator it = allVar.begin();
-     std::vector<CVariable*>::const_iterator itE = allVar.end();
-
-     for (; it != itE; ++it)
-     {
        this->sendAddVariable((*it)->getId(), client);
        (*it)->sendAllAttributesToServer(client);
@@ -1508,9 +1421,4 @@
    }
 
-   void CField::sendAddVariable(const string& id)
-   {
-      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE);
-   }
-
    void CField::sendAddVariable(const string& id, CContextClient* client)
    {
@@ -1518,7 +1426,7 @@
    }
 
-   void CField::sendAddVariableGroup(const string& id)
-   {
-      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP);
+   void CField::sendAddVariableGroup(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client);
    }
 
Index: XIOS/dev/dev_olga/src/node/field.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/field.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/field.hpp	(revision 1144)
@@ -170,16 +170,13 @@
 
         CVariable* addVariable(const string& id = "");
-        CVariableGroup* addVariableGroup(const string& id = "");
-        void sendAddVariable(const string& id = "");
+        CVariableGroup* addVariableGroup(const string& id = "");        
         void sendAddVariable(const string& id, CContextClient* client);
-        void sendAddVariableGroup(const string& id = "");
+        void sendAddVariableGroup(const string& id, CContextClient* client);
         static void recvAddVariable(CEventServer& event);
         void recvAddVariable(CBufferIn& buffer);
         static void recvAddVariableGroup(CEventServer& event);
-        void recvAddVariableGroup(CBufferIn& buffer);
-        void sendAddAllVariables();
+        void recvAddVariableGroup(CBufferIn& buffer);        
         void sendAddAllVariables(CContextClient* client);
         void writeUpdateData(const CArray<double,1>& data);
-
 
         const std::vector<StdString>& getRefDomainAxisIds();
@@ -206,5 +203,5 @@
          map<int,boost::shared_ptr<func::CFunctor> > foperation_srv;
 
-         map<int, CArray<double,1> > data_srv;
+         // map<int, CArray<double,1> > data_srv;
          CArray<double,1> recvDataSrv;
          
Index: XIOS/dev/dev_olga/src/node/file.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/file.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/file.cpp	(revision 1144)
@@ -616,10 +616,4 @@
 
      // Just check file and try to open it
-     CContext* context = CContext::getCurrent();
-     // CContextClient* client=context->client;
-     CContextClient* client = (0 != context->clientPrimServer.size()) ? context->clientPrimServer[0] : context->client;
-
-     // It would probably be better to call initFile() somehow
-     // MPI_Comm_dup(client->intraComm, &fileComm);
      if (time_counter_name.isEmpty()) time_counter_name = "time_counter";
 
@@ -719,6 +713,4 @@
      {
        this->enabledFields[i]->solveOnlyReferenceEnabledField(sendToServer);
-       // this->enabledFields[i]->solveAllEnabledFields();
-//       this->enabledFields[i]->buildGridTransformationGraph();
      }
    }
@@ -763,6 +755,5 @@
      int size = this->enabledFields.size();
      for (int i = 0; i < size; ++i)
-     {
-       // this->enabledFields[i]->solveAllReferenceEnabledField(sendToServer);
+     {       
       this->enabledFields[i]->solveAllEnabledFieldsAndTransform();
      }
@@ -886,21 +877,7 @@
    \param[in] id String identity of field that will be created on server
    */
-   void CFile::sendAddField(const string& id)
-   {
-      sendAddItem(id, EVENT_ID_ADD_FIELD);
-   }
-
    void CFile::sendAddField(const string& id, CContextClient* client)
    {
       sendAddItem(id, EVENT_ID_ADD_FIELD, client);
-   }
-
-   /*!
-   \brief Send a message to create a field group on server side
-   \param[in] id String identity of field group that will be created on server
-   */
-   void CFile::sendAddFieldGroup(const string& id)
-   {
-      sendAddItem(id, (int)EVENT_ID_ADD_FIELD_GROUP);
    }
 
@@ -968,18 +945,4 @@
    is to duplicate this value on server, too.
    */
-   void CFile::sendAddAllVariables()
-   {
-     std::vector<CVariable*> allVar = getAllVariables();
-     std::vector<CVariable*>::const_iterator it = allVar.begin();
-     std::vector<CVariable*>::const_iterator itE = allVar.end();
-
-     for (; it != itE; ++it)
-     {
-       this->sendAddVariable((*it)->getId());
-       (*it)->sendAllAttributesToServer();
-       (*it)->sendValue();
-     }
-   }
-
    void CFile::sendAddAllVariables(CContextClient* client)
    {
@@ -999,13 +962,4 @@
    \brief Send a message to create a variable group on server side
    \param[in] id String identity of variable group that will be created on server
-   */
-   void CFile::sendAddVariableGroup(const string& id)
-   {
-      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP);
-   }
-
-   /*!
-   \brief Send a message to create a variable group on server side
-   \param[in] id String identity of variable group that will be created on server
    \param [in] client client to which we will send this adding action
    */
@@ -1013,14 +967,4 @@
    {
       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client);
-   }
-
-   /*!
-   \brief Send a message to create a variable on server side
-      A variable always belongs to a variable group
-   \param[in] id String identity of variable that will be created on server
-   */
-   void CFile::sendAddVariable(const string& id)
-   {
-      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE);
    }
 
Index: XIOS/dev/dev_olga/src/node/file.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/file.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/file.hpp	(revision 1144)
@@ -123,18 +123,12 @@
          CContextClient* getContextClient();
 
-         // Send info to server
-         void sendEnabledFields();
-         void sendEnabledFields(CContextClient* client);
-         void sendAddField(const string& id = "");
-         void sendAddField(const string& id, CContextClient* client);
-         void sendAddFieldGroup(const string& id = "");
-         void sendAddFieldGroup(const string& id, CContextClient* client);
-         void sendAddAllVariables();                        // to be removed (?)
+         // Send info to server         
+         void sendEnabledFields(CContextClient* client);         
+         void sendAddField(const string& id, CContextClient* client);         
+         void sendAddFieldGroup(const string& id, CContextClient* client);                           
+         void sendAddVariable(const string& id, CContextClient* client);
+         void sendAddVariableGroup(const string& id, CContextClient* client);
          void sendAddAllVariables(CContextClient* client);
-         void sendAddVariable(const string& id = "");         // to be removed (?)
-         void sendAddVariable(const string& id, CContextClient* client);
-         void sendAddVariableGroup(const string& id = "");
-         void sendAddVariableGroup(const string& id, CContextClient* client);
-
+         
          // Receive info from client
          static void recvAddField(CEventServer& event);
Index: XIOS/dev/dev_olga/src/node/grid.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/grid.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/grid.cpp	(revision 1144)
@@ -536,9 +536,7 @@
    }
 
-   std::vector<int> CGrid::getAxisPositionInGrid() const
-   {
-     return axisPositionInGrid_;
-   }
-
+   /*!
+      Compute the index to for write data into a file
+   */
    void CGrid::computeWrittenIndex()
    {      
@@ -561,6 +559,5 @@
       localIndexToWriteOnClient.resize(nbWritten);  
       localIndexToWriteOnServer.resize(nbWritten);
-
-      // if (isCompressible())
+      
       {
         numberWrittenIndexes_ = nbWritten;
@@ -607,15 +604,13 @@
        int rank = client->clientRank;
 
-         clientDistribution_ = new CDistributionClient(rank, this);
-         // Get local data index on client
-         storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size());
-         int nbStoreIndex = storeIndex_client.numElements();
-         for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx];
-       // }
+       clientDistribution_ = new CDistributionClient(rank, this);
+       // Get local data index on client
+       storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size());
+       int nbStoreIndex = storeIndex_client.numElements();
+       for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx];       
      
        if (0 == serverDistribution_) isDataDistributed_= clientDistribution_->isDataDistributed();
        else          
-       {
-          
+       {          
           // Mapping global index received from clients to the storeIndex_client
           CDistributionClient::GlobalLocalDataMap& globalDataIndex = clientDistribution_->getGlobalDataIndexOnClient();
@@ -858,21 +853,4 @@
          }
 
-//         nbIndexOnServer = 0;
-//         for (it = itb; it != ite; ++it)
-//         {
-//           const std::vector<int>& tmp = it->second;
-//           nbIndexOnServerTmp = 0;
-//           for (int i = 0; i < tmp.size(); ++i)
-//           {
-//             if (0 == nbIndexOnServerTmp(tmp[i]))
-//             {
-//               globalElementIndexOnServer[idx][tmp[i]][nbIndexOnServer(tmp[i])] = it->first;
-//               ++nbIndexOnServerTmp(tmp[i]);
-//             }
-//           }
-//           nbIndexOnServer += nbIndexOnServerTmp;
-//         }
-//       }
-
        nbIndexOnServer = 0;
        for (size_t j = 0; j < globalIndexElementOnServerMap.size(); ++j)
@@ -1144,36 +1122,4 @@
    }
 
-   void CGrid::outputField(int rank, const CArray<double, 1>& stored, double* field)
-   {
-     const CArray<size_t,1>& out_i = outIndexFromClient[rank];
-     StdSize numElements = stored.numElements();
-     for (StdSize n = 0; n < numElements; ++n)
-     {
-       field[out_i(n)] = stored(n);
-     }
-   }
-
-   void CGrid::inputField(int rank, const double* const field, CArray<double,1>& stored)
-   {
-     const CArray<size_t,1>& out_i = outIndexFromClient[rank];
-     StdSize numElements = stored.numElements();
-     for (StdSize n = 0; n < numElements; ++n)
-     {
-       stored(n) = field[out_i(n)];
-     }
-   }
-
-   void CGrid::outputCompressedField(int rank, const CArray<double,1>& stored, double* field)
-   {
-     const CArray<size_t,1>& out_i = compressedOutIndexFromClient[rank];
-     StdSize numElements = stored.numElements();
-     for (StdSize n = 0; n < numElements; ++n)
-     {
-       field[out_i(n)] = stored(n);
-     }
-   }
-
-   //----------------------------------------------------------------
-
    void CGrid::storeField_arr(const double* const data, CArray<double, 1>& stored) const
    {
@@ -1193,6 +1139,5 @@
   void CGrid::computeIndexScalarGrid()
   {
-    CContext* context = CContext::getCurrent();
-    // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
+    CContext* context = CContext::getCurrent();    
     int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;
     connectedServerRank_.resize(nbSrvPools);
@@ -1219,38 +1164,4 @@
       }
       isDataDistributed_ = false;
-    }
-  }
-
-  void CGrid::computeCompressedIndex()
-  {
-    compressedOutIndexFromClient = outIndexFromClient;
-
-    std::map<size_t, size_t> indexes;
-
-    {
-      std::map<int, CArray<size_t,1> >::const_iterator it = compressedOutIndexFromClient.begin();
-      std::map<int, CArray<size_t,1> >::const_iterator itEnd = compressedOutIndexFromClient.end();
-      for (; it != itEnd; ++it)
-      {
-        for (int i = 0; i < it->second.numElements(); ++i)
-          indexes.insert(std::make_pair(it->second(i), 0));
-      }
-    }
-
-    {
-      std::map<size_t, size_t>::iterator it = indexes.begin();
-      std::map<size_t, size_t>::iterator itEnd = indexes.end();
-      for (size_t i = 0; it != itEnd; ++it, ++i)
-        it->second = i;
-    }
-
-    {
-      std::map<int, CArray<size_t,1> >::iterator it = compressedOutIndexFromClient.begin();
-      std::map<int, CArray<size_t,1> >::iterator itEnd = compressedOutIndexFromClient.end();
-      for (; it != itEnd; ++it)
-      {
-        for (int i = 0; i < it->second.numElements(); ++i)
-          it->second(i) = indexes[it->second(i)];
-      }
     }
   }
@@ -1378,53 +1289,4 @@
       else
       {
-        // CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itGlobalMap, itbGlobalMap;
-        // itbGlobalMap = globalIndexOnServer_.begin(), itGlobalMap;
-        // iteGlobalMap = globalIndexOnServer_.end();
-        
-        // std::map<int,int > nbGlobalLocalTmp;
-        // for (itGlobalMap = itbGlobalMap; itGlobalMap != iteGlobalMap; ++itGlobalMap)
-        // {
-        //   int serverRank = itGlobalMap->first;
-        //   nbGlobalLocalTmp[serverRank] = 0;
-        //   const std::vector<size_t>& indexVec = itGlobalMap->second;
-        //   int indexSize = indexVec.size();          
-        //   for (int idx = 0; idx < indexSize; ++idx)
-        //   {
-        //     itIndex = globalLocalIndexSendToServer.find(indexVec[idx]);
-        //     if (iteIndex != itIndex)
-        //     {
-        //       ++nbGlobalLocalTmp[serverRank];
-        //     }
-        //   }
-        // }
-
-        // std::map<int,std::vector<int> >localIndexTmp;
-        // std::map<int,std::vector<size_t> > globalIndexTmp;
-        // for (std::map<int,int>::iterator it = nbGlobalLocalTmp.begin(); it != nbGlobalLocalTmp.end(); ++it)
-        // {
-        //   localIndexTmp[it->first].resize(it->second);
-        //   globalIndexTmp[it->first].resize(it->second);
-        //   it->second = 0;
-        // }
-
-        // for (itGlobalMap = itbGlobalMap; itGlobalMap != iteGlobalMap; ++itGlobalMap)
-        // {
-        //   int serverRank = itGlobalMap->first;          
-        //   const std::vector<size_t>& indexVec = itGlobalMap->second;
-        //   int indexSize = indexVec.size();          
-        //   int ind = 0;
-        //   for (int idx = 0; idx < indexSize; ++idx)
-        //   {
-        //     itIndex = globalLocalIndexSendToServer.find(indexVec[idx]);
-        //     if (iteIndex != itIndex)
-        //     {              
-        //       ind = nbGlobalLocalTmp[serverRank];
-        //       globalIndexTmp[serverRank][ind] = itIndex->first;
-        //       localIndexTmp[serverRank][ind]  = itIndex->second;
-        //       ++nbGlobalLocalTmp[serverRank];
-        //     }
-        //   }
-        // }
-
         CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itGlobalMap;
         itGlobalMap = globalIndexOnServer_.begin();
@@ -1502,6 +1364,5 @@
 
     int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;
-    nbSrvPools = 1;
-    // connectedServerRank_.resize(nbSrvPools);
+    nbSrvPools = 1;    
     nbReadSenders.resize(nbSrvPools);
     for (int p = 0; p < nbSrvPools; ++p)
@@ -1510,9 +1371,4 @@
       CContextClient* client = (!context->hasClient) ? context->client : context->clientPrimServer[p];
       
-//      CContextServer* server = (context->hasServer) ? context->server : context->serverPrimServer[p];
-//      CContextClient* client = (context->hasServer) ? context->client : context->clientPrimServer[p];
-      // numberWrittenIndexes_ = totalNumberWrittenIndexes_ = offsetWrittenIndexes_ = 0;
-      //connectedServerRank_[p] = ranks;
-
       int idx = 0, numElement = axis_domain_order.numElements();
       int ssize = numElement;
@@ -1596,19 +1452,9 @@
         else
         {
-//          dataSize = outIndex.numElements();
-//          for (int i = 0; i < outIndex.numElements(); ++i) outIndex(i) = i;
           // THE PROBLEM HERE IS THAT DATA CAN BE NONDISTRIBUTED ON CLIENT AND DISTRIBUTED ON SERVER
           // BELOW IS THE TEMPORARY FIX only for a single type of element (domain, asix, scalar)
           dataSize = serverDistribution_->getGridSize();
-          // dataSize = serverDistribution_->getGlobalIndexEachDimension()[0].numElements();
-          // outIndex.resize(dataSize);
-          // outIndex = serverDistribution_->getGlobalIndexEachDimension()[0];
-
         }
         writtenDataSize_ += dataSize;
-
-        // outIndexFromClient.insert(std::make_pair(rank, outIndex));
-        // connectedDataSize_[p][rank] = outIndex.numElements();
-        // numberWrittenIndexes_ += outIndex.numElements();
       }
 
@@ -1686,14 +1532,5 @@
       }
 
-      // if (isScalarGrid()) return;
-
-      // if (isDataDistributed_)
-      // {
-      //   MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      //   MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-      //   offsetWrittenIndexes_ -= numberWrittenIndexes_;
-      // }
-      // else
-      //   totalNumberWrittenIndexes_ = numberWrittenIndexes_;
+      if (isScalarGrid()) return;
 
       nbReadSenders[p] = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks);
@@ -1910,23 +1747,4 @@
    {
       sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN);
-    // CContext* context=CContext::getCurrent();
-
-    // if (! context->hasServer )
-    // {
-    //    CContextClient* client=context->client;
-
-    //    CEventClient event(this->getType(),EVENT_ID_ADD_DOMAIN);
-    //    if (client->isServerLeader())
-    //    {
-    //      CMessage msg;
-    //      msg<<this->getId();
-    //      msg<<id;
-    //      const std::list<int>& ranks = client->getRanksServerLeader();
-    //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-    //        event.push(*itRank,1,msg);
-    //      client->sendEvent(event);
-    //    }
-    //    else client->sendEvent(event);
-    // }
    }
 
@@ -1938,23 +1756,4 @@
    {
       sendAddItem(id, (int)EVENT_ID_ADD_AXIS);
-    // CContext* context=CContext::getCurrent();
-
-    // if (! context->hasServer )
-    // {
-    //    CContextClient* client=context->client;
-
-    //    CEventClient event(this->getType(),EVENT_ID_ADD_AXIS);
-    //    if (client->isServerLeader())
-    //    {
-    //      CMessage msg;
-    //      msg<<this->getId();
-    //      msg<<id;
-    //      const std::list<int>& ranks = client->getRanksServerLeader();
-    //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-    //        event.push(*itRank,1,msg);
-    //      client->sendEvent(event);
-    //    }
-    //    else client->sendEvent(event);
-    // }
    }
 
@@ -1966,23 +1765,4 @@
    {
       sendAddItem(id, (int)EVENT_ID_ADD_SCALAR);
-    // CContext* context=CContext::getCurrent();
-
-    // if (! context->hasServer )
-    // {
-    //    CContextClient* client=context->client;
-
-    //    CEventClient event(this->getType(),EVENT_ID_ADD_SCALAR);
-    //    if (client->isServerLeader())
-    //    {
-    //      CMessage msg;
-    //      msg<<this->getId();
-    //      msg<<id;
-    //      const std::list<int>& ranks = client->getRanksServerLeader();
-    //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-    //        event.push(*itRank,1,msg);
-    //      client->sendEvent(event);
-    //    }
-    //    else client->sendEvent(event);
-    // }
    }
 
@@ -2075,6 +1855,5 @@
     {
       CDomain* pDom = CDomain::get(*it);
-      if (context->hasClient && !context->hasServer)
-      //if (context->hasClient)
+      if (context->hasClient && !context->hasServer)      
       {
         pDom->solveRefInheritance(apply);
@@ -2089,5 +1868,4 @@
       CAxis* pAxis = CAxis::get(*it);
       if (context->hasClient && !context->hasServer)
-//     if (context->hasClient)
       {
         pAxis->solveRefInheritance(apply);
@@ -2102,5 +1880,4 @@
       CScalar* pScalar = CScalar::get(*it);
       if (context->hasClient && !context->hasServer)
-//     if (context->hasClient)
       {
         pScalar->solveRefInheritance(apply);
Index: XIOS/dev/dev_olga/src/node/grid.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/grid.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/grid.hpp	(revision 1144)
@@ -91,14 +91,9 @@
          StdSize  getDataSize(void) const;
 
-         /// EntrÃ©es-sorties de champs ///
+         /// EntrÃ©es-sorties de champs 
          template <int n>
          void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const;
          template <int n>
-         void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const;
-
-         void outputField(int rank, const CArray<double,1>& stored, double* field);
-         void inputField(int rank, const double* const field, CArray<double,1>& stored);
-
-         void outputCompressedField(int rank, const CArray<double,1>& stored, double* field);
+         void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const;      
 
          virtual void parse(xml::CXMLNode& node);
@@ -129,15 +124,8 @@
          static CGrid* cloneGrid(const StdString& idNewGrid, CGrid* gridSrc);
 
-      public:
-
-         /// EntrÃ©es-sorties de champs (interne) ///
-         void storeField_arr(const double* const data, CArray<double,1>& stored) const;
-         void restoreField_arr(const CArray<double,1>& stored, double* const data) const;
-
-         /// Traitements protÃ©gÃ©s ///
+      public:            
          void computeIndexServer(void);
          void computeIndex(void);
          void computeIndexScalarGrid();
-         void computeCompressedIndex();
          void computeWrittenIndex();
 
@@ -188,5 +176,4 @@
          std::vector<int> getGlobalDimension();
          bool isScalarGrid() const;
-         std::vector<int> getAxisPositionInGrid() const;
 
          bool doGridHaveDataToWrite();
@@ -261,4 +248,7 @@
         template<int N>
         void modifyGridMaskSize(CArray<bool,N>& gridMask, const std::vector<int>& eachDimSize, bool newValue);
+
+        void storeField_arr(const double* const data, CArray<double, 1>& stored) const;
+        void restoreField_arr(const CArray<double, 1>& stored, double* const data) const;
 
         void setVirtualDomainGroup(CDomainGroup* newVDomainGroup);
Index: XIOS/dev/dev_olga/src/node/scalar.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/scalar.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/scalar.cpp	(revision 1144)
@@ -86,18 +86,4 @@
   }
 
-  /*!
-    Check the validity of all transformations applied on scalar
-  This functions is called AFTER all inherited attributes are solved
-  */
-  void CScalar::checkTransformations()
-  {
-    TransMapTypes::const_iterator itb = transformationMap_.begin(), it,
-                                  ite = transformationMap_.end();
-//    for (it = itb; it != ite; ++it)
-//    {
-//      (it->second)->checkValid(this);
-//    }
-  }
-
   void CScalar::duplicateTransformation(CScalar* src)
   {
Index: XIOS/dev/dev_olga/src/node/scalar.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/scalar.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/node/scalar.hpp	(revision 1144)
@@ -81,6 +81,5 @@
 
          private:
-            TransMapTypes transformationMap_;
-            void checkTransformations();
+            TransMapTypes transformationMap_;            
             void setTransformations(const TransMapTypes&);
 
Index: XIOS/dev/dev_olga/src/transformation/axis_algorithm_zoom.cpp
===================================================================
--- XIOS/dev/dev_olga/src/transformation/axis_algorithm_zoom.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/transformation/axis_algorithm_zoom.cpp	(revision 1144)
@@ -104,18 +104,18 @@
 correct index be extracted
 */
-void CAxisAlgorithmZoom::updateAxisDestinationMask()
-{
-  StdSize niMask = axisDest_->mask.numElements();
-  StdSize iBeginMask = axisDest_->begin.getValue();
-  StdSize globalIndexMask = 0;
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationIndexMap::const_iterator ite = (transMap).end();
-  for (StdSize idx = 0; idx < niMask; ++idx)
-  {
-    globalIndexMask = iBeginMask + idx;
-    if (transMap.find(globalIndexMask) == ite)
-      (axisDest_->mask)(idx) = false;
-  }
-}
+// void CAxisAlgorithmZoom::updateAxisDestinationMask()
+// {
+//   StdSize niMask = axisDest_->mask.numElements();
+//   StdSize iBeginMask = axisDest_->begin.getValue();
+//   StdSize globalIndexMask = 0;
+//   TransformationIndexMap& transMap = this->transformationMapping_[0];
+//   TransformationIndexMap::const_iterator ite = (transMap).end();
+//   for (StdSize idx = 0; idx < niMask; ++idx)
+//   {
+//     globalIndexMask = iBeginMask + idx;
+//     if (transMap.find(globalIndexMask) == ite)
+//       (axisDest_->mask)(idx) = false;
+//   }
+// }
 
 }
Index: XIOS/dev/dev_olga/src/transformation/axis_algorithm_zoom.hpp
===================================================================
--- XIOS/dev/dev_olga/src/transformation/axis_algorithm_zoom.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/transformation/axis_algorithm_zoom.hpp	(revision 1144)
@@ -35,5 +35,5 @@
 
 private:
-  void updateAxisDestinationMask();
+  // void updateAxisDestinationMask();
   void updateZoom();
 
Index: XIOS/dev/dev_olga/src/transformation/domain_algorithm_zoom.cpp
===================================================================
--- XIOS/dev/dev_olga/src/transformation/domain_algorithm_zoom.cpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/transformation/domain_algorithm_zoom.cpp	(revision 1144)
@@ -132,25 +132,25 @@
 correct index be extracted
 */
-void CDomainAlgorithmZoom::updateDomainDestinationMask()
-{
-  int niMask     = domainDest_->ni.getValue();
-  int iBeginMask = domainDest_->ibegin.getValue();
-  int njMask     = domainDest_->nj.getValue();
-  int jBeginMask = domainDest_->jbegin.getValue();
-  int niGlob = domainDest_->ni_glo.getValue();
-  int globalIndexMask = 0;
+// void CDomainAlgorithmZoom::updateDomainDestinationMask()
+// {
+//   int niMask     = domainDest_->ni.getValue();
+//   int iBeginMask = domainDest_->ibegin.getValue();
+//   int njMask     = domainDest_->nj.getValue();
+//   int jBeginMask = domainDest_->jbegin.getValue();
+//   int niGlob = domainDest_->ni_glo.getValue();
+//   int globalIndexMask = 0;
 
-  TransformationIndexMap& transMap = this->transformationMapping_[0];
-  TransformationIndexMap::const_iterator ite = (transMap).end();
-  for (int j = 0; j < njMask; ++j)
-  {
-    for (int i = 0; i < niMask; ++i)
-    {
-      globalIndexMask = (j+jBeginMask) * niGlob + (i + iBeginMask);
-      if (transMap.find(globalIndexMask) == ite)
-        (domainDest_->mask_1d)(i+j*niMask) = false;
-    }
-  }
-}
+//   TransformationIndexMap& transMap = this->transformationMapping_[0];
+//   TransformationIndexMap::const_iterator ite = (transMap).end();
+//   for (int j = 0; j < njMask; ++j)
+//   {
+//     for (int i = 0; i < niMask; ++i)
+//     {
+//       globalIndexMask = (j+jBeginMask) * niGlob + (i + iBeginMask);
+//       if (transMap.find(globalIndexMask) == ite)
+//         (domainDest_->mask_1d)(i+j*niMask) = false;
+//     }
+//   }
+// }
 
 }
Index: XIOS/dev/dev_olga/src/transformation/domain_algorithm_zoom.hpp
===================================================================
--- XIOS/dev/dev_olga/src/transformation/domain_algorithm_zoom.hpp	(revision 1143)
+++ XIOS/dev/dev_olga/src/transformation/domain_algorithm_zoom.hpp	(revision 1144)
@@ -36,5 +36,5 @@
 
 private:
-  void updateDomainDestinationMask();
+  // void updateDomainDestinationMask();
   void updateZoom();
 
