Index: XIOS/dev/dev_olga/src/node/field.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/field.cpp	(revision 1133)
+++ XIOS/dev/dev_olga/src/node/field.cpp	(revision 1136)
@@ -125,9 +125,4 @@
 
     CContext* context = CContext::getCurrent();
-//    CContextClient* client = context->client;
-    // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
-    // int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1;
-    // for (int i = 0; i < nbSrvPools; ++i)
-    // {
       CContextClient* client = (!context->hasServer) ? context->client : this->file->getContextClient();
 
@@ -261,24 +256,11 @@
     {            
       CArray<int,1>& storeClient = grid->storeIndex_client;
-      // for (map<int, CArray<size_t, 1> >::iterator it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)
-      // {
-      //   // sizeData += it->second.numElements();
-      //   data_srv.insert(std::make_pair(it->first, CArray<double,1>(it->second.numElements())));
-      // }
-
-      // for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient.begin(); it != grid->outLocalIndexStoreOnClient.end(); ++it)
-      // {
-      //   // sizeData += it->second.numElements();
-      //   data_srv.insert(std::make_pair(it->first, CArray<double,1>(it->second.numElements())));
-      // }
-
-      // Gather all data from different clients
-      // recvDataSrv.resize(sizeData);
+
+      // Gather all data from different clients      
       recvDataSrv.resize(storeClient.numElements());
       recvFoperationSrv = boost::shared_ptr<func::CFunctor>(new func::CInstant(recvDataSrv));
     }
 
-    CArray<double,1> recv_data_tmp(recvDataSrv.numElements());
-    // sizeData = 0;
+    CArray<double,1> recv_data_tmp(recvDataSrv.numElements());    
     const CDate& currDate = context->getCalendar()->getCurrentDate();
     const CDate opeDate   = last_operation_srv +freq_op + freq_operation_srv - freq_op;
@@ -286,5 +268,5 @@
     if (opeDate <= currDate)
     {
-       for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient.begin(); it != grid->outLocalIndexStoreOnClient.end(); ++it)
+      for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient.begin(); it != grid->outLocalIndexStoreOnClient.end(); ++it)
       {
         CArray<double,1> tmp;
@@ -294,21 +276,6 @@
         {
           recv_data_tmp(indexTmp(idx)) = tmp(idx);
-        }
-        // recv_data_tmp(Range(sizeData,sizeData+it->second.numElements()-1)) = tmp;  
-        // sizeData += it->second.numElements();      
-      }
-
-      // for (map<int, CArray<size_t, 1> >::iterator it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)
-      // {        
-      //   CArray<double,1> tmp;
-      //   CArray<size_t,1>& indexTmp = it->second;
-      //   *(rankBuffers[it->first]) >> tmp;
-      //   for (int idx = 0; idx < indexTmp.numElements(); ++idx)
-      //   {
-      //     recv_data_tmp(indexTmp(idx)) = tmp(idx);
-      //   }
-      //   // recv_data_tmp(Range(sizeData,sizeData+it->second.numElements()-1)) = tmp;  
-      //   // sizeData += it->second.numElements();      
-      // }
+        }      
+      }
     }
 
@@ -328,9 +295,4 @@
       (*recvFoperationSrv)(data);
       last_operation_srv = currDate;
-//        sendUpdateData(fieldData);
-        // Redirecting data to the correct secondary server
-        //int fileIdx = std::find(context->enabledFiles.begin(), context->enabledFiles.end(), this->file) - context->enabledFiles.begin();
-        //int srvId = fileIdx % context->clientPrimServer.size();
-        //sendUpdateData(fieldData, context->clientPrimServer[srvId]);
     }
 
@@ -416,5 +378,5 @@
       if (grid->doGridHaveDataToWrite() || getRelFile()->type == CFile::type_attr::one_file)
       {
-        getRelFile()->checkFile();
+        getRelFile()->checkWriteFile();
         this->incrementNStep();
         getRelFile()->getDataOutput()->writeFieldData(CField::get(this));
@@ -479,5 +441,5 @@
   {
     CContext* context = CContext::getCurrent();
-    CContextClient* client = context->client;
+    CContextClient* client = context->client;    
 
     CEventClient event(getType(), EVENT_ID_READ_DATA_READY);
@@ -486,24 +448,11 @@
     bool hasData = readField();
 
-    map<int, CArray<double,1> >::iterator it;
-//    for (it = data_srv.begin(); it != data_srv.end(); it++)
-//    {
-//      msgs.push_back(CMessage());
-//      CMessage& msg = msgs.back();
-//      msg << getId();
-//      if (hasData)
-//        msg << getNStep() - 1 << it->second;
-//      else
-//        msg << int(-1);
-//      event.push(it->first, grid->nbSenders[it->first], msg);
-//    }
-//    client->sendEvent(event);
+    
     if (!grid->doGridHaveDataDistributed())
     {
        if (client->isServerLeader())
        {
-          if (!data_srv.empty())
-          {
-            it = data_srv.begin();
+          if (0 != recvDataSrv.numElements())
+          {            
             const std::list<int>& ranks = client->getRanksServerLeader();
             for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
@@ -513,5 +462,5 @@
               msg << getId();
               if (hasData)
-                msg << getNStep() - 1 << it->second;
+                msg << getNStep() - 1 << recvDataSrv;
               else
                 msg << int(-1);
@@ -519,24 +468,9 @@
             }
           }
+
           client->sendEvent(event);
        }
        else
        {
-          // if (!data_srv.empty())
-          // {
-          //   it = data_srv.begin();
-          //   const std::list<int>& ranks = client->getRanksServerNotLeader();
-          //   for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-          //   {
-          //     msgs.push_back(CMessage());
-          //     CMessage& msg = msgs.back();
-          //     msg << getId();
-          //     if (hasData)
-          //       msg << getNStep() - 1 << it->second;
-          //     else
-          //       msg << int(-1);
-          //     event.push(*itRank, 1, msg);
-          //   }
-          // }
           client->sendEvent(event);
        }
@@ -544,14 +478,22 @@
     else
     {
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
+      for (map<int, CArray<size_t, 1> >::iterator it = grid->outLocalIndexStoreOnClient.begin(); 
+                                                  it != grid->outLocalIndexStoreOnClient.end(); ++it)
       {
+        CArray<size_t,1>& indexTmp = it->second;
+        CArray<double,1> tmp(indexTmp.numElements());
+        for (int idx = 0; idx < indexTmp.numElements(); ++idx)
+        {
+          tmp(idx) = recvDataSrv(indexTmp(idx));
+        } 
+
         msgs.push_back(CMessage());
         CMessage& msg = msgs.back();
         msg << getId();
         if (hasData)
-          msg << getNStep() - 1 << it->second;
+          msg << getNStep() - 1 << tmp;
         else
           msg << int(-1);
-        event.push(it->first, grid->nbSenders[0][it->first], msg);
+        event.push(it->first, grid->nbReadSenders[0][it->first], msg);
       }
       client->sendEvent(event);
@@ -561,15 +503,16 @@
   bool CField::readField(void)
   {
+    grid->computeWrittenIndex();
     if (!getRelFile()->allDomainEmpty)
     {
       if (grid->doGridHaveDataToWrite() || getRelFile()->type == CFile::type_attr::one_file)
       {
-        if (data_srv.empty())
-        {
-          for (map<int, CArray<size_t, 1> >::iterator it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)
-            data_srv.insert(std::make_pair(it->first, CArray<double,1>(it->second.numElements())));
+        if (0 == recvDataSrv.numElements())
+        {            
+          CArray<int,1>& storeClient = grid->storeIndex_client;          
+          recvDataSrv.resize(storeClient.numElements());          
         }
 
-        getRelFile()->checkFile();
+        getRelFile()->checkReadFile();
         if (!nstepMax)
         {
@@ -578,6 +521,4 @@
 
         this->incrementNStep();
-
-
 
         if (getNStep() > nstepMax && (getRelFile()->cyclic.isEmpty() || !getRelFile()->cyclic) )
@@ -1426,36 +1367,18 @@
    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;
+     // 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;
    }
 
    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;
-   }
-
-   void CField::outputField(CArray<double,3>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
-      {
-        grid->outputField(it->first, it->second, fieldOut.dataFirst());
-      }
-   }
-
-   void CField::outputField(CArray<double,2>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for(it=data_srv.begin();it!=data_srv.end();it++)
-      {
-         grid->outputField(it->first, it->second, fieldOut.dataFirst());
-      }
+     // 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;
    }
 
    void CField::outputField(CArray<double,1>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;      
-     
+   { 
       CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;
       CArray<size_t,1>& outIndexServer = grid->localIndexToWriteOnServer;
@@ -1464,37 +1387,20 @@
         fieldOut(outIndexServer(idx)) = recvDataSrv(outIndexClient(idx));
       }
-
+   }
+
+   void CField::inputField(CArray<double,1>& fieldIn)
+   {
+      // map<int, CArray<double,1> >::iterator it;
       // for (it = data_srv.begin(); it != data_srv.end(); it++)
       // {
-      //    grid->outputField(it->first, it->second, fieldOut.dataFirst());
+      //    grid->inputField(it->first, fieldOut.dataFirst(), it->second);
       // }
-    // grid->outputField(recvDataSrv, fieldOut);
-   }
-
-   void CField::inputField(CArray<double,3>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
+      CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;
+      CArray<size_t,1>& outIndexServer = grid->localIndexToWriteOnServer;
+      for (size_t idx = 0; idx < outIndexServer.numElements(); ++idx)
       {
-        grid->inputField(it->first, fieldOut.dataFirst(), it->second);
-      }
-   }
-
-   void CField::inputField(CArray<double,2>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for(it = data_srv.begin(); it != data_srv.end(); it++)
-      {
-         grid->inputField(it->first, fieldOut.dataFirst(), it->second);
-      }
-   }
-
-   void CField::inputField(CArray<double,1>& fieldOut)
-   {
-      map<int, CArray<double,1> >::iterator it;
-      for (it = data_srv.begin(); it != data_srv.end(); it++)
-      {
-         grid->inputField(it->first, fieldOut.dataFirst(), it->second);
-      }
+        recvDataSrv(outIndexClient(idx)) = fieldIn(outIndexServer(idx));
+      }
+
    }
 
@@ -1603,23 +1509,4 @@
    {
       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE);
-    // CContext* context = CContext::getCurrent();
-
-    // if (!context->hasServer)
-    // {
-    //    CContextClient* client = context->client;
-
-    //    CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE);
-    //    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);
-    // }
    }
 
@@ -1627,23 +1514,4 @@
    {
       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client);
-    // CContext* context = CContext::getCurrent();
-
-    // if (!context->hasServer)
-    // {
-    //    CContextClient* client = context->client;
-
-    //    CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE);
-    //    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);
-    // }
    }
 
@@ -1651,22 +1519,4 @@
    {
       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP);
-    // CContext* context = CContext::getCurrent();
-    // if (!context->hasServer)
-    // {
-    //    CContextClient* client = context->client;
-
-    //    CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE_GROUP);
-    //    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);
-    // }
    }
 
Index: XIOS/dev/dev_olga/src/node/field.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/field.hpp	(revision 1133)
+++ XIOS/dev/dev_olga/src/node/field.hpp	(revision 1136)
@@ -157,9 +157,5 @@
         static void recvReadDataReady(CEventServer& event);
         void recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers);
-        void outputField(CArray<double,3>& fieldOut);
-        void outputField(CArray<double,2>& fieldOut);
         void outputField(CArray<double,1>& fieldOut);
-        void inputField(CArray<double,3>& fieldOut);
-        void inputField(CArray<double,2>& fieldOut);
         void inputField(CArray<double,1>& fieldOut);
         void outputCompressedField(CArray<double, 1>& fieldOut);
Index: XIOS/dev/dev_olga/src/node/file.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/file.cpp	(revision 1133)
+++ XIOS/dev/dev_olga/src/node/file.cpp	(revision 1136)
@@ -267,10 +267,15 @@
     }
 
-    //! Verify state of a file
-    void CFile::checkFile(void)
+    /*
+       Check condition to write into a file
+       For now, we only use the level-2 server to write files (if this mode is activated)
+       or classical server to do this job.
+    */
+    void CFile::checkWriteFile(void)
     {
       CContext* context = CContext::getCurrent();
       // Done by classical server or secondary server
-      if (!CXios::usingServer2 || (CXios::usingServer2 && !context->hasClient))
+      // This condition should be changed soon
+      if (!CXios::usingServer2 || (CXios::usingServer2 && !context->hasClient))          
       {
         if (mode.isEmpty() || mode.getValue() == mode_attr::write)
@@ -278,10 +283,27 @@
           if (!isOpen) createHeader();
           checkSync();
+        }        
+        checkSplit(); // REally need this?
+      }
+    }
+
+    /*
+       Check condition to read from a file
+       For now, we only use the level-1 server to write files (if this mode is activated)
+       or classical server to do this job.
+       This function can be used by client for reading metadata
+    */
+    void CFile::checkReadFile(void)
+    {
+      CContext* context = CContext::getCurrent();
+      // Done by classical server or secondary server
+      // TODO: This condition should be changed soon. It only works with maximum number of level as 2
+      if (!CXios::usingServer2 || (CXios::usingServer2 && context->hasClient))
+      {
+        if (!mode.isEmpty() && mode.getValue() == mode_attr::read)
+        {
+          if (!isOpen) openInReadMode(&(context->server->intraComm));
         }
-        else
-        {
-          if (!isOpen) openInReadMode();
-        }
-        checkSplit();
+        //checkSplit(); // Really need for reading?
       }
     }
@@ -502,8 +524,9 @@
   \brief Open an existing NetCDF file in read-only mode
   */
-  void CFile::openInReadMode(void)
+  void CFile::openInReadMode(MPI_Comm* comm)
   {
     CContext* context = CContext::getCurrent();
     CContextServer* server = context->server;
+    MPI_Comm readComm = *comm;
 
     if (!allDomainEmpty)
@@ -547,6 +570,6 @@
       {
         int commSize, commRank;
-        MPI_Comm_size(fileComm, &commSize);
-        MPI_Comm_rank(fileComm, &commRank);
+        MPI_Comm_size(readComm, &commSize);
+        MPI_Comm_rank(readComm, &commRank);
 
         if (server->intraCommSize > 1)
@@ -567,6 +590,6 @@
 
       if (isOpen) data_out->closeFile();
-      if (time_counter_name.isEmpty()) data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective));
-      else data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), fileComm, multifile, isCollective, time_counter_name));
+      if (time_counter_name.isEmpty()) data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective));
+      else data_in = shared_ptr<CDataInput>(new CNc4DataInput(oss.str(), readComm, multifile, isCollective, time_counter_name));
       isOpen = true;
     }
@@ -594,12 +617,12 @@
      // 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;
+     // 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);
+     // MPI_Comm_dup(client->intraComm, &fileComm);
      if (time_counter_name.isEmpty()) time_counter_name = "time_counter";
 
-     checkFile();
+     checkReadFile();
 
      for (int idx = 0; idx < enabledFields.size(); ++idx)
@@ -883,4 +906,13 @@
 
    /*!
+   \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, CContextClient* client)
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_FIELD_GROUP, client);
+   }
+
+   /*!
    \brief Receive a message annoucing the creation of a field on server side
    \param[in] event Received event
@@ -1057,5 +1089,6 @@
    With these two id, it's easier to make reference to grid where all data should be written.
    Remark: This function must be called AFTER all active (enabled) files have been created on the server side
-   */   void CFile::sendEnabledFields(CContextClient* client)
+   */
+   void CFile::sendEnabledFields(CContextClient* client)
    {
      size_t size = this->enabledFields.size();
Index: XIOS/dev/dev_olga/src/node/file.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/file.hpp	(revision 1133)
+++ XIOS/dev/dev_olga/src/node/file.hpp	(revision 1136)
@@ -87,5 +87,6 @@
          bool checkSplit(void);
          bool checkSync(void);
-         void checkFile(void);
+         void checkWriteFile(void);
+         void checkReadFile(void);
          void initFile(void);
 
@@ -96,5 +97,5 @@
 
          void createHeader(void);
-         void openInReadMode(void);
+         void openInReadMode(MPI_Comm* readComm = NULL);
          void close(void);
          void readAttributesOfEnabledFieldsInReadMode();
@@ -128,4 +129,5 @@
          void sendAddField(const string& id, CContextClient* client);
          void sendAddFieldGroup(const string& id = "");
+         void sendAddFieldGroup(const string& id, CContextClient* client);
          void sendAddAllVariables();                        // to be removed (?)
          void sendAddAllVariables(CContextClient* client);
Index: XIOS/dev/dev_olga/src/node/grid.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/grid.cpp	(revision 1133)
+++ XIOS/dev/dev_olga/src/node/grid.cpp	(revision 1136)
@@ -409,5 +409,5 @@
       using namespace std;
       std::vector<CDomain*> domainP = this->getDomains();
-      std::vector<CAxis*> axisP = this->getAxis();
+      std::vector<CAxis*> axisP = this->getAxis();      
       int dim = domainP.size() * 2 + axisP.size();
 
@@ -442,5 +442,5 @@
    {      
       std::vector<CDomain*> domainP = this->getDomains();
-      std::vector<CAxis*> axisP = this->getAxis();
+      std::vector<CAxis*> axisP = this->getAxis();            
       int dim = domainP.size() * 2 + axisP.size();
 
@@ -591,21 +591,6 @@
      {
        CContextClient* client = (context->hasServer) ? (context->hasClient ? context->clientPrimServer[p] : context->client) : context->client;
-       // CContextClient* client = (context->hasServer) ? context->clientPrimServer[i] : context->client;
-       // CContextServer* server = (context->hasServer) ? context->server : 0 ;
-       // int rank = (server && !client) ? server->intraCommRank : client->clientRank;
        int rank = client->clientRank;
 
-       // First of all, compute distribution on client side
-       // if (0 != serverDistribution_)
-       // {
-       //   // clientDistribution_ = new CDistributionClient(rank, this, serverDistribution_->getGlobalLocalIndex());
-       //   clientDistribution_ = new CDistributionClient(rank, this);
-       //   storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size());
-       //   // storeIndex_client.resize(serverDistribution_->getGridSize());
-       //   int nbStoreIndex = storeIndex_client.numElements();
-       //   for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = idx;
-       // }
-       // else
-       // {
          clientDistribution_ = new CDistributionClient(rank, this);
          // Get local data index on client
@@ -665,8 +650,12 @@
    }
 
+   /*!
+     Compute the connected clients and index to send to these clients.
+     Each client can connect to a pool of other clients, each of which can have a piece of information of a grid
+
+   */
    void CGrid::computeConnectedClients()
    {
      CContext* context = CContext::getCurrent();
-     // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
      int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1;
      connectedServerRank_.resize(nbSrvPools);
@@ -747,24 +736,4 @@
    {
      CContext* context = CContext::getCurrent();
-//     CContextClient* client = context->client;
-     // CContextClient* client = (context->hasServer) ? context->clientPrimServer : context->client;
-     
-
-     // // First of all, compute distribution on client side
-     // if (0 != serverDistribution_)
-     //   clientDistribution_ = new CDistributionClient(client->clientRank, this, serverDistribution_->getGlobalLocalIndex());
-     // else
-     //   clientDistribution_ = new CDistributionClient(client->clientRank, this);
-
-     // // Get local data index on client
-     // int tmp = clientDistribution_->getLocalDataIndexOnClient().size();
-     // storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size());
-     // int nbStoreIndex = storeIndex_client.numElements();
-     // for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx];
-     // isDataDistributed_= clientDistribution_->isDataDistributed();
-
-
-     // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
-
      computeClientIndex();
      if (context->hasClient)
@@ -772,61 +741,4 @@
        computeConnectedClients();
      }
-
-     // connectedServerRank_.clear();
-
-     // if (!doGridHaveDataDistributed())
-     // {
-     //    if (client->isServerLeader())
-     //    {
-     //      size_t ssize = clientDistribution_->getLocalDataIndexOnClient().size();
-     //      const std::list<int>& ranks = client->getRanksServerLeader();
-     //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
-     //      {
-     //        connectedServerRank_.push_back(*itRank);
-     //        connectedDataSize_[*itRank] = ssize;
-     //      }
-     //    }
-     //    return;
-     // }
-
-     // // Compute mapping between client and server
-     // std::vector<boost::unordered_map<size_t,std::vector<int> > > indexServerOnElement;
-     // CServerDistributionDescription serverDistributionDescription(globalDim_, client->serverSize);
-     // serverDistributionDescription.computeServerGlobalByElement(indexServerOnElement,
-     //                                                            client->clientRank,
-     //                                                            client->clientSize,
-     //                                                            axis_domain_order,
-     //                                                            positionDimensionDistributed_);
-     // computeIndexByElement(indexServerOnElement, globalIndexOnServer_);
-
-     // const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = clientDistribution_->getGlobalLocalDataSendToServer();
-     // CDistributionClient::GlobalLocalDataMap::const_iterator iteGlobalLocalIndexMap = globalLocalIndexSendToServer.end(), itGlobalLocalIndexMap;
-     // CClientServerMapping::GlobalIndexMap::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap;
-     // itGlobalMap  = itbGlobalMap = globalIndexOnServer_.begin();
-     // iteGlobalMap = globalIndexOnServer_.end();
-
-     // for (; itGlobalMap != iteGlobalMap; ++itGlobalMap)
-     // {
-     //   int serverRank = itGlobalMap->first;
-     //   int indexSize = itGlobalMap->second.size();
-     //   const std::vector<size_t>& indexVec = itGlobalMap->second;
-     //   for (int idx = 0; idx < indexSize; ++idx)
-     //   {
-     //      itGlobalLocalIndexMap = globalLocalIndexSendToServer.find(indexVec[idx]);
-     //      if (iteGlobalLocalIndexMap != itGlobalLocalIndexMap)
-     //      {
-     //         if (connectedDataSize_.end() == connectedDataSize_.find(serverRank))
-     //           connectedDataSize_[serverRank] = 1;
-     //         else
-     //           ++connectedDataSize_[serverRank];
-     //      }
-     //   }
-     // }
-
-     // for (itGlobalMap = itbGlobalMap; itGlobalMap != iteGlobalMap; ++itGlobalMap) {
-     //   connectedServerRank_.push_back(itGlobalMap->first);
-     // }
-
-     // nbSenders = clientServerMap_->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_);
    }
 
@@ -950,5 +862,4 @@
 
        nbIndexOnServer = 0;
-//       for (it = itb; it != ite; ++it)
        for (size_t j = 0; j < globalIndexElementOnServerMap.size(); ++j)
        {
@@ -1585,9 +1496,10 @@
     nbSrvPools = 1;
     // connectedServerRank_.resize(nbSrvPools);
-    // nbSenders.resize(nbSrvPools);
+    nbReadSenders.resize(nbSrvPools);
     for (int p = 0; p < nbSrvPools; ++p)
     {
       CContextServer* server = (!context->hasClient) ? context->server : context->serverPrimServer[p];
       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];
@@ -1699,5 +1611,6 @@
         std::vector<CDomain*> domainList = getDomains();
         std::vector<CAxis*> axisList = getAxis();
-        std::vector<int> nBegin(ssize), nSize(ssize), nGlob(ssize), nBeginGlobal(ssize);        
+        int dimSize = 2 * domainList.size() + axisList.size();
+        std::vector<int> nBegin(dimSize), nSize(dimSize), nGlob(dimSize), nBeginGlobal(dimSize);        
         for (int i = 0; i < numElement; ++i)
         {          
@@ -1726,10 +1639,4 @@
           else // scalar
           { 
-            nBegin[indexMap[i]] = 0;
-            nSize[indexMap[i]]  = 1;
-            nBeginGlobal[indexMap[i]] = 0;              
-            nGlob[indexMap[i]] = 1;
-
-            ++scalarId;
           }
         }
@@ -1782,5 +1689,5 @@
         totalNumberWrittenIndexes_ = numberWrittenIndexes_;
 
-      // nbSenders[p] = CClientServerMappingDistributed::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, ranks);
+      nbReadSenders[p] = CClientServerMappingDistributed::computeConnectedClients(context->client->serverSize, context->client->clientSize, context->client->intraComm, ranks);
     }
   }
Index: XIOS/dev/dev_olga/src/node/grid.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/grid.hpp	(revision 1133)
+++ XIOS/dev/dev_olga/src/node/grid.hpp	(revision 1136)
@@ -223,5 +223,5 @@
          map<int, CArray<int, 1> > storeIndex_toSrv;
          map<int, CArray<int, 1> > storeIndex_fromSrv;
-         std::vector<map<int,int> > nbSenders;
+         std::vector<map<int,int> > nbSenders, nbReadSenders;
 
          map<int, CArray<size_t, 1> > outIndexFromClient, compressedOutIndexFromClient, outGlobalIndexFromClient;
Index: XIOS/dev/dev_olga/src/test/test_remap.f90
===================================================================
--- XIOS/dev/dev_olga/src/test/test_remap.f90	(revision 1133)
+++ XIOS/dev/dev_olga/src/test/test_remap.f90	(revision 1136)
@@ -176,5 +176,5 @@
   ! ALLOCATE(tmp_field_2(src_tmp_ni*src_tmp_nj))
 
-  DO ts=1,5
+  DO ts=1,1
     CALL xios_recv_field("src_field_regular", tmp_field_0)
     ! CALL xios_recv_field("src_field_curvilinear", tmp_field_1)
@@ -184,6 +184,6 @@
     CALL xios_send_field("src_field_2D_clone",src_field_2D)
     CALL xios_send_field("src_field_3D",src_field_3D)
-    CALL xios_send_field("src_field_4D",src_field_4D)
-    CALL xios_send_field("src_field_3D_pression",src_field_pression)
+    ! CALL xios_send_field("src_field_4D",src_field_4D)
+    ! CALL xios_send_field("src_field_3D_pression",src_field_pression)
     CALL xios_send_field("tmp_field_0",tmp_field_0)
     ! CALL xios_send_field("tmp_field_1",tmp_field_1)
