Index: XIOS/branchs/xios-1.0/src/node/domain.cpp
===================================================================
--- XIOS/branchs/xios-1.0/src/node/domain.cpp	(revision 609)
+++ XIOS/branchs/xios-1.0/src/node/domain.cpp	(revision 610)
@@ -16,5 +16,5 @@
 
 namespace xios {
-   
+
    /// ////////////////////// DÃ©finitions ////////////////////// ///
 
@@ -30,5 +30,5 @@
 
    CDomain::~CDomain(void)
-   { 
+   {
    }
 
@@ -37,20 +37,20 @@
    const std::set<StdString> & CDomain::getRelFiles(void) const
    {
-      return (this->relFiles); 
-   }
-
-   //----------------------------------------------------------------
-   
+      return (this->relFiles);
+   }
+
+   //----------------------------------------------------------------
+
    bool CDomain::hasZoom(void) const
    {
-      return ((this->zoom_ni.getValue() != this->ni_glo.getValue()) && 
+      return ((this->zoom_ni.getValue() != this->ni_glo.getValue()) &&
               (this->zoom_nj.getValue() != this->nj_glo.getValue()));
    }
-   
-   //----------------------------------------------------------------
-   
+
+   //----------------------------------------------------------------
+
    bool CDomain::isEmpty(void) const
    {
-      return ((this->zoom_ni_srv == 0) || 
+      return ((this->zoom_ni_srv == 0) ||
               (this->zoom_nj_srv == 0));
    }
@@ -86,5 +86,5 @@
                << "[ Id = " << this->getId() << " ] "
                << "The global domain is badly defined,"
-               << " check the \'ni_glo\'  value !") 
+               << " check the \'ni_glo\'  value !")
          }
          nj_glo=ni_glo ;
@@ -111,5 +111,5 @@
          ibegin=1 ;
          iend=1 ;
-         
+
       }
       else if ((ni_glo.isEmpty() || ni_glo.getValue() <= 0 ) ||
@@ -119,23 +119,23 @@
                << "[ Id = " << this->getId() << " ] "
                << "The global domain is badly defined,"
-               << " check the \'ni_glo\' et \'nj_glo\' values !") 
+               << " check the \'ni_glo\' et \'nj_glo\' values !")
       }
       checkLocalIDomain() ;
       checkLocalJDomain() ;
-      
+
      if (i_index.isEmpty())
      {
        i_index.resize(ni,nj) ;
        for(int j=0;j<nj;j++)
-         for(int i=0;i<ni;i++) i_index(i,j)=i ;   
+         for(int i=0;i<ni;i++) i_index(i,j)=i ;
      }
-     
+
      if (j_index.isEmpty())
      {
         j_index.resize(ni,nj) ;
         for(int j=0;j<nj;j++)
-         for(int i=0;i<ni;i++) j_index(i,j)=j ;   
+         for(int i=0;i<ni;i++) j_index(i,j)=j ;
      }
- 
+
    }
 
@@ -211,5 +211,5 @@
                << "Domain is wrong defined,"
                << " Check the values : nj, nj_glo, jbegin, jend") ;
-               
+
      ibegin_client=ibegin ; iend_client=iend ; ni_client=ni ;
      jbegin_client=jbegin ; jend_client=jend ; nj_client=nj ;
@@ -221,20 +221,20 @@
    {
       using namespace std;
-      
+
       int ibegin_mask = 0,
           jbegin_mask = 0,
           iend_mask = iend.getValue() - ibegin.getValue(),
           jend_mask = jend.getValue() - jbegin.getValue();
-      
+
       if (!zoom_ibegin.isEmpty())
       {
          int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
          int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
-         
+
          ibegin_mask = max (ibegin.getValue(), zoom_ibegin.getValue());
          jbegin_mask = max (jbegin.getValue(), zoom_jbegin.getValue());
          iend_mask   = min (iend.getValue(), zoom_iend);
          jend_mask   = min (jend.getValue(), zoom_jend);
-                 
+
          ibegin_mask -= ibegin.getValue();
          jbegin_mask -= jbegin.getValue();
@@ -242,5 +242,5 @@
          jend_mask   -= jbegin.getValue();
       }
-      
+
 
       if (!mask.isEmpty())
@@ -251,5 +251,5 @@
                   <<"the mask has not the same size than the local domain"<<endl
                    <<"Local size is "<<ni<<"x"<<nj<<endl
-                  <<"Mask size is "<<mask.extent(0)<<"x"<<mask.extent(1));                 
+                  <<"Mask size is "<<mask.extent(0)<<"x"<<mask.extent(1));
          for (int i = 0; i < ni; i++)
          {
@@ -283,5 +283,5 @@
 
    void CDomain::checkDomainData(void)
-   {     
+   {
       if (!data_dim.isEmpty() &&
          !(data_dim.getValue() == 1 || data_dim.getValue() == 2))
@@ -378,7 +378,7 @@
             data_i_index.resize(dni) ;
             data_j_index.resize(dni) ;
-            
+
             data_n_index.setValue(dni);
-            
+
             for(int count = 0, j = 0; j  < data_nj.getValue(); j++)
             {
@@ -394,5 +394,5 @@
 
    //----------------------------------------------------------------
-   
+
    void CDomain::completeLonLatClient(void)
    {
@@ -402,13 +402,13 @@
       CArray<double,2> bounds_lon_temp(nvertex,ni*nj) ;
       CArray<double,2> bounds_lat_temp(nvertex,ni*nj) ;
-      
+
       if (type.isEmpty())
       {
-        if ( lonvalue.numElements() == ni*nj && latvalue.numElements() == ni*nj ) 
+        if ( lonvalue.numElements() == ni*nj && latvalue.numElements() == ni*nj )
         {
           type.setValue(type_attr::curvilinear) ;
           isCurvilinear=true ;
         }
-        else if ( lonvalue.numElements() == ni && latvalue.numElements() == nj ) 
+        else if ( lonvalue.numElements() == ni && latvalue.numElements() == nj )
         {
           type.setValue(type_attr::regular) ;
@@ -429,5 +429,5 @@
       {
         for(j=0;j<nj;j++)
-          for(i=0;i<ni;i++) 
+          for(i=0;i<ni;i++)
           {
             k=j*ni+i ;
@@ -436,5 +436,5 @@
             if (hasBounds)
             {
-              for(int n=0;n<nvertex;n++) 
+              for(int n=0;n<nvertex;n++)
               {
                 bounds_lon_temp(n,k)=bounds_lon(n,i) ;
@@ -444,21 +444,21 @@
           }
       }
-         
+
       StdSize dm = zoom_ni_client * zoom_nj_client;
 
       lonvalue.resize(dm);
       latvalue.resize(dm);
-         
+
       for (int i = 0; i < zoom_ni_client; i++)
       {
         for (int j = 0; j < zoom_nj_client; j++)
         {
-          lonvalue(i + j * zoom_ni_client) = lonvalue_temp( (i + zoom_ibegin_client-ibegin) + (j + zoom_jbegin_client -jbegin)*ni ); 
+          lonvalue(i + j * zoom_ni_client) = lonvalue_temp( (i + zoom_ibegin_client-ibegin) + (j + zoom_jbegin_client -jbegin)*ni );
           latvalue(i + j * zoom_ni_client) = latvalue_temp( (i + zoom_ibegin_client - ibegin)+(j + zoom_jbegin_client - jbegin)*ni );
           if (hasBounds)
           {
-            for(int n=0;n<nvertex;n++) 
+            for(int n=0;n<nvertex;n++)
             {
-              bounds_lon(n,i + j * zoom_ni_client) = bounds_lon_temp( n, (i + zoom_ibegin_client - ibegin) + (j + zoom_jbegin_client -jbegin)*ni ); 
+              bounds_lon(n,i + j * zoom_ni_client) = bounds_lon_temp( n, (i + zoom_ibegin_client - ibegin) + (j + zoom_jbegin_client -jbegin)*ni );
               bounds_lat(n,i + j * zoom_ni_client) = bounds_lat_temp( n, (i + zoom_ibegin_client - ibegin)+(j + zoom_jbegin_client -jbegin)*ni );
             }
@@ -467,5 +467,5 @@
       }
     }
- 
+
 
    //----------------------------------------------------------------
@@ -487,5 +487,5 @@
             int zoom_iend = zoom_ibegin + zoom_ni - 1;
             int zoom_jend = zoom_jbegin + zoom_nj - 1;
-                
+
             if (zoom_ibegin < 1  || zoom_jbegin < 1 || zoom_iend > ni_glo || zoom_jend > nj_glo)
                ERROR("CDomain::checkZoom(void)",
@@ -496,10 +496,10 @@
       else
       {
-         zoom_ni = ni_glo; 
+         zoom_ni = ni_glo;
          zoom_nj = nj_glo;
          zoom_ibegin = 1;
          zoom_jbegin = 1;
       }
-      
+
       // compute client zoom indices
 
@@ -510,5 +510,5 @@
       if (zoom_ni_client<0) zoom_ni_client=0 ;
 
-    
+
       int zoom_jend=zoom_jbegin+zoom_nj-1 ;
       zoom_jbegin_client = jbegin_client > zoom_jbegin ? jbegin_client : zoom_jbegin ;
@@ -518,5 +518,5 @@
 
    }
-   
+
    void CDomain::checkBounds(void)
    {
@@ -524,7 +524,7 @@
      {
        hasBounds=true ;
-       
+
      }
-     else 
+     else
      {
        hasBounds=false;
@@ -532,5 +532,5 @@
      }
    }
-            
+
    //----------------------------------------------------------------
 
@@ -543,5 +543,5 @@
       this->checkZoom();
       this->checkBounds();
-      
+
       if (context->hasClient)
       { // CÃŽtÃ© client uniquement
@@ -556,5 +556,5 @@
 // ne sert plus //   this->completeLonLatServer();
       }
-    
+
       if (context->hasClient)
       {
@@ -563,8 +563,8 @@
         sendLonLat() ;
       }
-      
+
       this->isChecked = true;
    }
-   
+
   void CDomain::sendServerAttribut(void)
   {
@@ -572,14 +572,14 @@
     int ibegin_srv=1 ;
     int iend_srv=ni_glo.getValue() ;
-     
+
     int nj_srv ;
     int jbegin_srv ;
     int jend_srv ;
-    
+
     CContext* context=CContext::getCurrent() ;
     CContextClient* client=context->client ;
     int nbServer=client->serverSize ;
     int serverRank=client->getServerLeader() ;
-    
+
     jend_srv=0 ;
     for(int i=0;i<=serverRank;i++)
@@ -590,6 +590,6 @@
       jend_srv=jbegin_srv+nj_srv-1 ;
     }
-    
-     CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT) ;   
+
+     CEventClient event(getType(),EVENT_ID_SERVER_ATTRIBUT) ;
      if (client->isServerLeader())
      {
@@ -606,8 +606,8 @@
   {
     int i,j,i_ind,j_ind ;
-    
+
     ibegin_client=ibegin ; iend_client=iend ; ni_client=ni ;
     jbegin_client=jbegin ; jend_client=jend ; nj_client=nj ;
-     
+
     CContext* context = CContext::getCurrent() ;
     CContextClient* client=context->client ;
@@ -617,15 +617,15 @@
     int zoom_iend=zoom_ibegin+zoom_ni-1 ;
     int zoom_jend=zoom_jbegin+zoom_nj-1 ;
-    
+
     int blockSize=nj_glo/nbServer ;
     int ns=nj_glo%nbServer ;
     int pos=ns*(blockSize+1) ;
     int serverNum ;
-    
+
     mapConnectedServer.resize(ni,nj) ;
     vector<int> nbData(nbServer,0) ;
     vector<int> indServer(nbServer,-1) ;
     vector<bool> IsConnected(nbServer,false) ;
-    
+
     for(j=0;j<nj;j++)
       for(i=0;i<ni;i++)
@@ -633,9 +633,9 @@
         i_ind=ibegin+i_index(i,j)-1 ;
         j_ind=jbegin+j_index(i,j)-1 ;
-        
+
         if (j_ind<pos) serverNum=j_ind/(blockSize+1) ;
         else serverNum=ns+(j_ind-pos)/blockSize ;
         IsConnected[serverNum]=true ;
-                
+
         if (i_ind >= zoom_ibegin-1 && i_ind <= zoom_iend-1 && j_ind >= zoom_jbegin-1 && j_ind <= zoom_jend-1)
         {
@@ -647,5 +647,5 @@
 
 
-    for(serverNum=0 ; serverNum<nbServer ; serverNum++) 
+    for(serverNum=0 ; serverNum<nbServer ; serverNum++)
       if (IsConnected[serverNum])
       {
@@ -655,10 +655,10 @@
         nbDataSrv.push_back(nbData[serverNum]) ;
       }
-     
+
      i_indSrv.resize(connectedServer.size()) ;
      j_indSrv.resize(connectedServer.size()) ;
 
      for(j=0;j<nj;j++)
-      for(i=0;i<ni;i++) 
+      for(i=0;i<ni;i++)
       {
         if (mapConnectedServer(i,j)>=0)
@@ -670,5 +670,5 @@
         }
       }
-          
+
     int nbConnectedServer=connectedServer.size() ;
 
@@ -677,21 +677,21 @@
     int* sendBuff=new int[nbConnectedServer] ;
     valarray<int> nbClient(0,client->serverSize) ;
-    
+
     for(int n=0;n<nbConnectedServer;n++) sendBuff[n]=connectedServer[n] ;
-    
+
     // get connected server for everybody
     MPI_Allgather(&nbConnectedServer,1,MPI_INT,recvCount,1,MPI_INT,client->intraComm) ;
-    
+
     displ[0]=0 ;
     for(int n=1;n<client->clientSize;n++) displ[n]=displ[n-1]+recvCount[n-1] ;
     int recvSize=displ[client->clientSize-1]+recvCount[client->clientSize-1] ;
     int* recvBuff=new int[recvSize] ;
- 
-    
+
+
     MPI_Allgatherv(sendBuff,nbConnectedServer,MPI_INT,recvBuff,recvCount,displ,MPI_INT,client->intraComm) ;
     for(int n=0;n<recvSize;n++) nbClient[recvBuff[n]]++ ;
-    
+
     for(int n=0;n<nbConnectedServer;n++) nbSenders.push_back(nbClient[connectedServer[n]]) ;
-   
+
     delete [] recvCount ;
     delete [] displ ;
@@ -703,98 +703,98 @@
   void CDomain::sendLonLat(void)
   {
-    int ns,n,i,j,ind,nv ;
-    CContext* context = CContext::getCurrent() ;
-    CContextClient* client=context->client ;
+    int ns,n,i,j,ind,nv;
+    CContext* context = CContext::getCurrent();
+    CContextClient* client = context->client;
+
     // send lon lat for each connected server
-    CEventClient event(getType(),EVENT_ID_LON_LAT) ;
-    
-    list<shared_ptr<CMessage> > list_msg ;    
-    list< CArray<int,1>* > list_indi,list_indj ;
-    list< CArray<double,1>* >list_lon,list_lat ;
-    list< CArray<double,2>* >list_boundslon,list_boundslat ;
-
-    for(int ns=0;ns<connectedServer.size();ns++)
+    CEventClient event(getType(), EVENT_ID_LON_LAT);
+
+    list<CMessage> list_msg;
+    list<CArray<int,1> > list_indi,list_indj;
+    list<CArray<double,1> >list_lon,list_lat;
+    list<CArray<double,2> >list_boundslon,list_boundslat;
+
+    for (int ns = 0; ns < connectedServer.size(); ns++)
     {
-      int nbData = nbDataSrv[ns] ;
-      CArray<int,1> indi(nbData) ;
-      CArray<int,1> indj(nbData) ;
-      CArray<double,1> lon(nbData) ;
-      CArray<double,1> lat(nbData) ;
-      CArray<double,2> boundslon(nvertex,nbData) ;
-      CArray<double,2> boundslat(nvertex,nbData) ;
-      
-      for(n=0;n<nbData;n++) 
-      {
-        i=i_indSrv[ns][n] ;
-        j=j_indSrv[ns][n] ;
-        ind=(i-(zoom_ibegin_client-1))+(j-(zoom_jbegin_client-1))*zoom_ni_client ;
-        
-        lon(n)=lonvalue(ind) ;
-        lat(n)=latvalue(ind) ;
+      int nbData = nbDataSrv[ns];
+
+      list_indi.push_back(CArray<int,1>(nbData));
+      list_indj.push_back(CArray<int,1>(nbData));
+      list_lon.push_back(CArray<double,1>(nbData));
+      list_lat.push_back(CArray<double,1>(nbData));
+
+      if (hasBounds)
+      {
+        list_boundslon.push_back(CArray<double,2>(nvertex, nbData));
+        list_boundslat.push_back(CArray<double,2>(nvertex, nbData));
+      }
+
+      CArray<int,1>& indi = list_indi.back();
+      CArray<int,1>& indj = list_indj.back();
+      CArray<double,1>& lon = list_lon.back();
+      CArray<double,1>& lat = list_lat.back();
+
+      for (n = 0; n < nbData; n++)
+      {
+        i = i_indSrv[ns][n];
+        j = j_indSrv[ns][n];
+        ind = (i - (zoom_ibegin_client - 1)) + (j - (zoom_jbegin_client - 1)) * zoom_ni_client;
+
+        lon(n) = lonvalue(ind);
+        lat(n) = latvalue(ind);
+
         if (hasBounds)
         {
-          for(nv=0;nv<nvertex;nv++)
+          CArray<double,2>& boundslon = list_boundslon.back();
+          CArray<double,2>& boundslat = list_boundslat.back();
+
+          for(nv = 0; nv < nvertex; nv++)
           {
-            boundslon(nv,n)=bounds_lon(nv,ind);
-            boundslat(nv,n)=bounds_lat(nv,ind);
+            boundslon(nv,n) = bounds_lon(nv,ind);
+            boundslat(nv,n) = bounds_lat(nv,ind);
           }
         }
-        indi(n)=ibegin+i_index(i-ibegin+1,j-jbegin+1)-1  ;
-        indj(n)=jbegin+j_index(i-ibegin+1,j-jbegin+1)-1  ;
-      }
-    
-      list_indi.push_back(new CArray<int,1>(indi.copy())) ;
-      list_indj.push_back(new CArray<int,1>(indj.copy())) ;
-      list_lon.push_back(new CArray<double,1>(lon.copy())) ;
-      list_lat.push_back(new CArray<double,1>(lat.copy())) ;
-      if (hasBounds) list_boundslon.push_back(new CArray<double,2>(boundslon.copy())) ;
-      if (hasBounds) list_boundslat.push_back(new CArray<double,2>(boundslat.copy())) ;
-
-      list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ;
-
-      *list_msg.back()<<this->getId()<<(int)type ; // enum ne fonctionne pour les message => ToFix
-      *list_msg.back()<<isCurvilinear ;
-      *list_msg.back()<<*list_indi.back()<<*list_indj.back()<<*list_lon.back()<<*list_lat.back() ;
-      if (hasBounds) *list_msg.back()<<*list_boundslon.back()<<*list_boundslat.back();
-      event.push(connectedServer[ns],nbSenders[ns],*list_msg.back()) ;
+
+        indi(n) = ibegin + i_index(i - ibegin + 1, j - jbegin + 1) - 1;
+        indj(n) = jbegin + j_index(i - ibegin + 1, j - jbegin + 1) - 1;
+      }
+
+      list_msg.push_back(CMessage());
+
+      list_msg.back() << this->getId() << (int)type; // enum ne fonctionne pour les message => ToFix
+      list_msg.back() << isCurvilinear;
+      list_msg.back() << list_indi.back() << list_indj.back() << list_lon.back() << list_lat.back();
+      if (hasBounds) list_msg.back() << list_boundslon.back() << list_boundslat.back();
+        
+      event.push(connectedServer[ns], nbSenders[ns], list_msg.back());
     }
 
-    client->sendEvent(event) ;
-    
-    
-    for(list<CArray<int,1>* >::iterator it=list_indi.begin();it!=list_indi.end();it++) delete *it;
-    for(list<CArray<int,1>* >::iterator it=list_indj.begin();it!=list_indj.end();it++) delete *it;
-    for(list<CArray<double,1>* >::iterator it=list_lon.begin();it!=list_lon.end();it++)   delete *it;
-    for(list<CArray<double,1>* >::iterator it=list_lat.begin();it!=list_lat.end();it++)   delete *it;
-    if (hasBounds) for(list<CArray<double,2>* >::iterator it=list_boundslon.begin();it!=list_boundslon.end();it++)   delete *it;
-    if (hasBounds) for(list<CArray<double,2>* >::iterator it=list_boundslat.begin();it!=list_boundslat.end();it++)   delete *it;    
-    
+    client->sendEvent(event);
   }
-  
-  
+
+
   bool CDomain::dispatchEvent(CEventServer& event)
-   {
-      
-      if (SuperClass::dispatchEvent(event)) return true ;
-      else
-      {
-        switch(event.type)
-        {
-           case EVENT_ID_SERVER_ATTRIBUT :
-             recvServerAttribut(event) ;
-             return true ;
-             break ;
-           case EVENT_ID_LON_LAT :
-             recvLonLat(event) ;
-             return true ;
-             break ;
-           default :
-             ERROR("bool CContext::dispatchEvent(CEventServer& event)",
-                    <<"Unknown Event") ;
-           return false ;
-         }
-      }
-   }
-   
+  {
+    if (SuperClass::dispatchEvent(event)) return true;
+    else
+    {
+      switch(event.type)
+      {
+        case EVENT_ID_SERVER_ATTRIBUT:
+          recvServerAttribut(event);
+          return true;
+          break;
+        case EVENT_ID_LON_LAT:
+          recvLonLat(event);
+          return true;
+          break;
+        default:
+          ERROR("bool CContext::dispatchEvent(CEventServer& event)",
+                << "Unknown Event");
+          return false;
+      }
+    }
+  }
+
   void CDomain::recvServerAttribut(CEventServer& event)
   {
@@ -804,5 +804,5 @@
     get(domainId)->recvServerAttribut(*buffer) ;
   }
-  
+
   void CDomain::recvServerAttribut(CBufferIn& buffer)
   {
@@ -811,15 +811,15 @@
 
      buffer>>ni_srv>>ibegin_srv>>iend_srv>>nj_srv>>jbegin_srv>>jend_srv;
-     
-    
+
+
     zoom_ibegin_srv = zoom_ibegin.getValue() > ibegin_srv ? zoom_ibegin.getValue() : ibegin_srv ;
     zoom_iend_srv = zoom_iend < iend_srv ? zoom_iend : iend_srv ;
     zoom_ni_srv=zoom_iend_srv-zoom_ibegin_srv+1 ;
-      
+
     zoom_jbegin_srv = zoom_jbegin.getValue() > jbegin_srv ? zoom_jbegin.getValue() : jbegin_srv ;
     zoom_jend_srv = zoom_jend < jend_srv ? zoom_jend : jend_srv ;
     zoom_nj_srv=zoom_jend_srv-zoom_jbegin_srv+1 ;
 
-    if (zoom_ni_srv<=0 || zoom_nj_srv<=0) 
+    if (zoom_ni_srv<=0 || zoom_nj_srv<=0)
     {
       zoom_ibegin_srv=1 ; zoom_iend_srv=0 ; zoom_ni_srv=0 ;
@@ -830,5 +830,5 @@
     latvalue_srv.resize(zoom_ni_srv*zoom_nj_srv) ;
     latvalue_srv = 0. ;
-    if (hasBounds) 
+    if (hasBounds)
     {
       bounds_lon_srv.resize(nvertex,zoom_ni_srv*zoom_nj_srv) ;
@@ -838,44 +838,44 @@
     }
   }
-    
+
   void CDomain::recvLonLat(CEventServer& event)
   {
-    list<CEventServer::SSubEvent>::iterator it ;
-    for (it=event.subEvents.begin();it!=event.subEvents.end();++it)
+    list<CEventServer::SSubEvent>::iterator it;
+    for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
     {
-      CBufferIn* buffer=it->buffer;
-      string domainId ;
-      *buffer>>domainId ;
-      get(domainId)->recvLonLat(*buffer) ;
+      CBufferIn* buffer = it->buffer;
+      string domainId;
+      *buffer >> domainId;
+      get(domainId)->recvLonLat(it->rank, *buffer);
     }
   }
-  
-  void CDomain::recvLonLat(CBufferIn& buffer)
+
+  void CDomain::recvLonLat(int rank, CBufferIn& buffer)
   {
-    CArray<int,1> indi ;
-    CArray<int,1> indj ;
-    CArray<double,1> lon ;
-    CArray<double,1> lat ;
-    CArray<double,2> boundslon ;
-    CArray<double,2> boundslat ;
-    
-    int type_int ;
-    buffer>>type_int>>isCurvilinear>>indi>>indj>>lon>>lat ;
-    if (hasBounds) buffer>>boundslon>>boundslat ;
-    type.setValue((type_attr::t_enum)type_int) ; // probleme des type enum avec les buffers : ToFix
-
-    int i,j,ind_srv ;
-    for(int ind=0;ind<indi.numElements();ind++)
+    CArray<int,1>& indi = indiSrv[rank];
+    CArray<int,1>& indj = indjSrv[rank];
+    CArray<double,1> lon;
+    CArray<double,1> lat;
+    CArray<double,2> boundslon;
+    CArray<double,2> boundslat;
+
+    int type_int;
+    buffer >> type_int >> isCurvilinear >> indi >> indj >> lon >> lat;
+    if (hasBounds) buffer >> boundslon >> boundslat;
+    type.setValue((type_attr::t_enum)type_int); // probleme des type enum avec les buffers : ToFix
+
+    int i, j, ind_srv;
+    for (int ind = 0; ind < indi.numElements(); ind++)
     {
-      i=indi(ind) ; j=indj(ind) ;
-      ind_srv=(i-(zoom_ibegin_srv-1))+(j-(zoom_jbegin_srv-1))*zoom_ni_srv ;
-      lonvalue_srv(ind_srv)=lon(ind) ;
-      latvalue_srv(ind_srv)=lat(ind) ;
-      if (hasBounds) 
-      {
-        for(int nv=0;nv<nvertex;nv++) 
+      i = indi(ind); j = indj(ind);
+      ind_srv = (i - (zoom_ibegin_srv - 1)) + (j - (zoom_jbegin_srv - 1)) * zoom_ni_srv;
+      lonvalue_srv(ind_srv) = lon(ind);
+      latvalue_srv(ind_srv) = lat(ind);
+      if (hasBounds)
+      {
+        for (int nv = 0; nv < nvertex; nv++)
         {
-          bounds_lon_srv(nv,ind_srv)=boundslon(nv,ind) ;
-          bounds_lat_srv(nv,ind_srv)=boundslat(nv,ind) ;
+          bounds_lon_srv(nv, ind_srv) = boundslon(nv, ind);
+          bounds_lat_srv(nv, ind_srv) = boundslat(nv, ind);
         }
       }
@@ -883,7 +883,7 @@
   }
    //----------------------------------------------------------------
-   
-   
-   
+
+
+
    ///---------------------------------------------------------------
 
Index: XIOS/branchs/xios-1.0/src/node/domain.hpp
===================================================================
--- XIOS/branchs/xios-1.0/src/node/domain.hpp	(revision 609)
+++ XIOS/branchs/xios-1.0/src/node/domain.hpp	(revision 610)
@@ -15,5 +15,5 @@
 
 namespace xios {
-   
+
    /// ////////////////////// DÃ©clarations ////////////////////// ///
 
@@ -39,5 +39,5 @@
            EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_LON_LAT
          } ;
-         
+
          /// typedef ///
          typedef CObjectTemplate<CDomain>   SuperClass;
@@ -68,5 +68,5 @@
          void checkDomainData(void);
          void checkCompression(void);
-         
+
          void checkZoom(void);
          void checkBounds(void);
@@ -74,5 +74,5 @@
 
       public :
-      
+
          /// Autres ///
 
@@ -84,6 +84,6 @@
          bool hasZoom(void) const;
          bool isEmpty(void) const;
-         
-         
+
+
          int ni_client,ibegin_client,iend_client ;
          int zoom_ni_client,zoom_ibegin_client,zoom_iend_client ;
@@ -100,31 +100,31 @@
          CArray<double, 1> lonvalue_srv, latvalue_srv ;
          CArray<double, 2> bounds_lon_srv, bounds_lat_srv ;
-         
-         
-        vector<int> connectedServer ; // list of connected server 
+
+
+        vector<int> connectedServer ; // list of connected server
         vector<int> nbSenders ; // for each communication with a server, number of communicating client
-        vector<int> nbDataSrv ; // size of data to send to each server 
+        vector<int> nbDataSrv ; // size of data to send to each server
         vector< vector<int> > i_indSrv ; // for each server, i global index to send
         vector< vector<int> > j_indSrv ; // for each server, j global index to send
-       
+
         CArray<int,2> mapConnectedServer ;  // (ni,nj) => mapped to connected server number, -1 if no server is target
-               
+
 //        vector<int> ib_srv, ie_srv, in_srv ;
 //        vector<int> jb_srv, je_srv, jn_srv ;
-         
+
       public :
-      
+
          /// Mutateur ///
          void addRelFile(const StdString & filename);
          void completeLonLatClient(void);
-         void sendServerAttribut(void) ;
-         void sendLonLat(void) ;
-         void computeConnectedServer(void) ;
-         static bool dispatchEvent(CEventServer& event) ;
-         static void recvLonLat(CEventServer& event) ;
-         static void recvServerAttribut(CEventServer& event) ;
-         void recvLonLat(CBufferIn& buffer) ;
-         void recvServerAttribut(CBufferIn& buffer) ;
-         
+         void sendServerAttribut(void);
+         void sendLonLat(void);
+         void computeConnectedServer(void);
+         static bool dispatchEvent(CEventServer& event);
+         static void recvServerAttribut(CEventServer& event);
+         static void recvLonLat(CEventServer& event);
+         void recvServerAttribut(CBufferIn& buffer);
+         void recvLonLat(int rank, CBufferIn& buffer);
+
          /// Destructeur ///
          virtual ~CDomain(void);
@@ -133,5 +133,5 @@
          static StdString GetName(void);
          static StdString GetDefName(void);
-         
+
          static ENodeType GetType(void);
 
@@ -144,4 +144,5 @@
          bool isChecked;
          std::set<StdString> relFiles;
+         std::map<int, CArray<int,1> > indiSrv, indjSrv;
 
    }; // class CDomain
