Index: XMLIO_V2/dev/common/src/xmlio/node/context.cpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/context.cpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/context.cpp	(revision 286)
@@ -143,5 +143,5 @@
 #define DECLARE_NODE_PAR(Name_, name_)
 #include "node_type.conf"
-            std::cout << name << std::endl;
+
             DEBUG(<< "L'Ã©lÃ©ment nommÃ© \'"     << name
                   << "\' dans le contexte \'" << CObjectFactory::GetCurrentContextId()
Index: XMLIO_V2/dev/common/src/xmlio/node/domain.cpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/domain.cpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/domain.cpp	(revision 286)
@@ -517,4 +517,6 @@
             const int zoom_ibegin_cl = ibegin_zoom_sub[k], zoom_ni_cl = ni_zoom_sub[k],
                       zoom_jbegin_cl = jbegin_zoom_sub[k], zoom_nj_cl = nj_zoom_sub[k],
+                      ibegin_cl = ibegin_sub[k] ,
+                      jbegin_cl = jbegin_sub[k] ,
                       ni_cl = iend_sub[k] - ibegin_sub[k] + 1;
                       
@@ -523,6 +525,6 @@
                for (int j = 0; j < zoom_nj_cl; j++)
                {
-                  int ii = i /*- (ibegin_serv - 1)*/ + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1);
-                  int jj = j /*- (jbegin_serv - 1)*/ + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1);
+                  int ii = i + (ibegin_cl-1) - (ibegin_serv - 1) + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1);
+                  int jj = j + (jbegin_cl-1) - (jbegin_serv - 1) + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1);
                   (*lonvalue_temp)[ii + jj * zoom_ni_serv] =
                   (*lonvalue_loc)[i + j * zoom_ni_cl];
@@ -602,5 +604,5 @@
          {
             zoom_ni_loc.setValue(0);
-            zoom_ibegin_loc.setValue(-1);
+            zoom_ibegin_loc.setValue(zoom_ibegin.getValue());
          }
          else
@@ -622,5 +624,5 @@
          {
             zoom_nj_loc.setValue(0);
-            zoom_jbegin_loc.setValue(-1);
+            zoom_jbegin_loc.setValue(zoom_jbegin.getValue());
          }
          else
@@ -662,16 +664,22 @@
          this->iend_sub.push_back(this->iend.getValue());
          this->jend_sub.push_back(this->jend.getValue()); 
+
+         this->ibegin_zoom_sub.push_back(this->zoom_ibegin_loc.getValue());
+         this->jbegin_zoom_sub.push_back(this->zoom_jbegin_loc.getValue());
+         this->ni_zoom_sub.push_back(this->zoom_ni_loc.getValue());
+         this->nj_zoom_sub.push_back(this->zoom_nj_loc.getValue());
       
          this->latvalue_sub.push_back(this->latvalue.getValue());
          this->lonvalue_sub.push_back(this->lonvalue.getValue());  
-         
-         if (!this->isEmpty())
-         {
+
+
+//         if (!this->isEmpty())
+//         {
             this->completeLonLatClient();
-         }
+//         }
       }
       else
       { // CÃŽtÃ© serveur uniquement
-         if (!this->isEmpty())
+//         if (!this->isEmpty())
             this->completeLonLatServer();
       }
@@ -707,4 +715,9 @@
    {
       return (this->ibegin_zoom_sub);
+   }
+
+   const std::vector<int> & CDomain::getNiZoomSub(void) const
+   {
+      return (this->ni_zoom_sub);
    }
                
@@ -729,4 +742,9 @@
       return (this->jbegin_zoom_sub);
    }
+
+   const std::vector<int> & CDomain::getNjZoomSub(void) const
+   {
+      return (this->nj_zoom_sub);
+   }
                   
    
@@ -735,5 +753,5 @@
    const std::vector<int> & CDomain::getJEndSub(void) const
    {
-      return (this->iend_sub);
+      return (this->jend_sub);
    }
    
Index: XMLIO_V2/dev/common/src/xmlio/node/domain.hpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/domain.hpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/domain.hpp	(revision 286)
@@ -80,4 +80,6 @@
          const std::vector<int> & getIBeginZoomSub(void) const;
          const std::vector<int> & getJBeginZoomSub(void) const;
+         const std::vector<int> & getNiZoomSub(void) const;
+         const std::vector<int> & getNjZoomSub(void) const;
          
          const std::vector<ARRAY(double, 1)> & getLonValueSub(void) const;
Index: XMLIO_V2/dev/common/src/xmlio/node/field.cpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/field.cpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/field.cpp	(revision 286)
@@ -220,5 +220,5 @@
          sset.insert(refer_ptr);
          baseRefObject = refer_sptr;
-         refObject.push_back(refer_sptr);
+//ym         refObject.push_back(refer_sptr);
       }
    }
Index: XMLIO_V2/dev/common/src/xmlio/node/field.hpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/field.hpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/field.hpp	(revision 286)
@@ -166,5 +166,6 @@
 //      std::cout	<< "(writeDate <= currDate) = " << std::boolalpha << (writeDate <= currDate) << std::endl;   
    
-       //std::cout << ">> " << currDate <<  " : Envoi de donnÃ©es " << this->getBaseFieldId() << std::endl;
+      std::cout << ">> " << currDate <<  " : Envoi de donnÃ©es " << this->getBaseFieldId() << std::endl;
+      std::cout << ">> next operation "  << opeDate<<std::endl;
       if (opeDate <= currDate)
       {
@@ -180,5 +181,5 @@
          
          *last_operation = currDate;
-//         std::cout << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl; 
+         std::cout << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl; 
       }
       
@@ -188,5 +189,5 @@
          this->incrementNStep();
          *last_Write = writeDate;
-//         std::cout << "(*last_Write = currDate) : " << *last_Write << " = " << currDate	<< std::endl;
+         std::cout << "(*last_Write = currDate) : " << *last_Write << " = " << currDate	<< std::endl;
          return (true);        
       }
Index: XMLIO_V2/dev/common/src/xmlio/node/file.cpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/file.cpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/file.cpp	(revision 286)
@@ -62,4 +62,5 @@
       this->enabledFields = this->getAllFields();
 
+      std::cout<<"---> File :"<<this->name.getValue()<<std::endl ;
       for ( it = this->enabledFields.begin() ; it != this->enabledFields.end(); it++ )
       {
@@ -86,7 +87,11 @@
          }
 
-         // Le champ est finalement actif, on ajoute la rÃ©fÃ©rence au champ de base.
+         // Le champ est finalement actif, on y ajoute sa propre reference.
+         (*it)->refObject.push_back(*it);
+         // Le champ est finalement actif, on y ajoute la rÃ©fÃ©rence au champ de base.
+         std::cout<<"    Field Enabled : "<<(*it)->getId()<<std::endl ;
          (*it)->setRelFile(CObjectFactory::GetObject(this));
          (*it)->baseRefObject->refObject.push_back(*it);
+         // A faire, ajouter les references intermediaires...
       }
 
@@ -133,4 +138,8 @@
    }
 
+   void CFile::close(void)
+   {
+     this->data_out->closeFile();
+   }
    //----------------------------------------------------------------
 
Index: XMLIO_V2/dev/common/src/xmlio/node/file.hpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/file.hpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/file.hpp	(revision 286)
@@ -63,5 +63,6 @@
 
          void initializeDataOutput(boost::shared_ptr<io::CDataOutput> dout);
-
+         void close(void) ;
+         
          /// Traitements ///
          virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
Index: XMLIO_V2/dev/common/src/xmlio/node/grid.cpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/grid.cpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/grid.cpp	(revision 286)
@@ -5,4 +5,6 @@
 #include "object_template_impl.hpp"
 #include "group_template_impl.hpp"
+#include <iostream>
+#include "mpi_manager.hpp"
 
 namespace xmlioserver {
@@ -140,4 +142,14 @@
       for (StdSize s = 0; s < shape_.size(); s++)
          retvalue *= shape_[s];
+      return (retvalue);
+   }
+
+   StdSize CGrid::getDataSize(void) const
+   {
+      StdSize retvalue ;
+      retvalue=domain->data_ni.getValue() ;
+      if (domain->data_dim.getValue()==2) retvalue*=domain->data_nj.getValue() ;
+      if (this->withAxis) retvalue*=this->axis->size.getValue() ;
+
       return (retvalue);
    }
@@ -437,9 +449,15 @@
       const std::vector<int> & ibegin = this->domain->getIBeginSub();
       const std::vector<int> & jbegin = this->domain->getJBeginSub();
+      const std::vector<int> & iend = this->domain->getIEndSub();
+      const std::vector<int> & jend = this->domain->getJEndSub();
       const std::vector<int> & ibegin_zoom = this->domain->getIBeginZoomSub();
       const std::vector<int> & jbegin_zoom = this->domain->getJBeginZoomSub();
+      const std::vector<int> & ni_zoom = this->domain->getNiZoomSub();
+      const std::vector<int> & nj_zoom = this->domain->getNjZoomSub();
       
       const int ibegin_srv  = this->domain->ibegin.getValue();
       const int jbegin_srv  = this->domain->jbegin.getValue();
+      const int iend_srv  = this->domain->iend.getValue();
+      const int jend_srv  = this->domain->jend.getValue();
       const int zoom_ni_srv = this->domain->zoom_ni_loc.getValue();
       const int zoom_nj_srv = this->domain->zoom_nj_loc.getValue();
@@ -447,5 +465,8 @@
       const int ibegin_zoom_srv = this->domain->zoom_ibegin_loc.getValue();
       const int jbegin_zoom_srv = this->domain->zoom_jbegin_loc.getValue();
-           
+       const int iend_zoom_srv = ibegin_zoom_srv + zoom_ni_srv-1 ;
+      const int  jend_zoom_srv = jbegin_zoom_srv + zoom_nj_srv-1 ;
+        
+//      std::cout<<"----> computeIndexServer !!"<<std::endl ;
       StdSize dn = 0;      
       for (StdSize j = 1; j < this->out_i_index.size(); j++)
@@ -466,4 +487,11 @@
          int ibegin_zoom_cl = ibegin[i]; //ibegin_zoom[i];
          int jbegin_zoom_cl = jbegin[i]; //jbegin_zoom[i];
+         int iend_zoom_cl = iend[i]; //ibegin_zoom[i];
+         int jend_zoom_cl = jend[i]; //jbegin_zoom[i];
+
+         int ibegin_cl = ibegin[i]; //ibegin[i];
+         int jbegin_cl = jbegin[i]; //jbegin[i];
+         int iend_cl = iend[i]; //ibegin[i];
+         int jend_cl = jend[i]; //jbegin[i];
          
          if (ibegin_zoom.size() != 0)
@@ -471,19 +499,52 @@
             ibegin_zoom_cl = ibegin_zoom[i];
             jbegin_zoom_cl = jbegin_zoom[i];
+            iend_zoom_cl = ibegin_zoom[i]+ni_zoom[i]-1;
+            jend_zoom_cl = jbegin_zoom[i]+nj_zoom[i]-1;
          }
          
-         for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++)
-         {
-            (*storeIndex_srv)[n]  = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur.
+//         std::cout<<"--> client No "<<i<<std::endl ;
+//         std::cout<<" ibegin "<<ibegin[i]<<" iend "<<iend[i]<<" jbegin "<<jbegin[i]<<" jend "<<jend[i]<<std::endl ;
+//         std::cout<<"zoom cl : ibegin "<<ibegin_zoom_cl<<" iend "<<iend_zoom_cl<<" jbegin "<<jbegin_zoom_cl<<" jend "<<jend_zoom_cl<<std::endl ;
+//         std::cout<<"--> server "<<std::endl ;
+//         std::cout<<" ibegin "<<ibegin_srv<<" iend "<<iend_srv<<" jbegin "<<jbegin_srv<<" jend "<<jend_srv<<std::endl ;
+//        std::cout<<"zoom : ibegin "<<ibegin_zoom_srv<<" iend "<<iend_zoom_srv<< " ni "<<zoom_ni_srv<<" jbegin "<<jbegin_zoom_srv<<" jend "<<jend_zoom_srv<<" nj "<<zoom_nj_srv<<std::endl ;
+//         std::cout<<"zoom_size "<<ibegin_zoom.size()<<std::endl ;
+
+         if (comm::CMPIManager::IsClient())
+         {
+           for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++)
+           {
+              (*storeIndex_srv)[n]  = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur.
+
+//            (*out_i_index_srv)[n] = (*out_i_index_cl)[m] 
+//                                  /*+ (ibegin_cl - 1) - (ibegin_srv - 1)*/ + (ibegin_zoom_cl - 1) - (ibegin_zoom_srv - 1);
+//            (*out_j_index_srv)[n] = (*out_j_index_cl)[m]
+//                                  /*+ (jbegin_cl - 1) - (jbegin_srv - 1)*/ + (jbegin_zoom_cl - 1) - (jbegin_zoom_srv - 1);
+//            (*out_l_index_srv)[n] = (*out_l_index_cl)[m];
+              (*out_i_index_srv)[n] = (*out_i_index_cl)[m] + ibegin_cl - 1 - (ibegin_srv + ibegin_zoom_srv - 1) + 1 ;
+              (*out_j_index_srv)[n] = (*out_j_index_cl)[m] + jbegin_cl - 1 - (jbegin_srv + jbegin_zoom_srv - 1) + 1 ;
+              (*out_l_index_srv)[n] = (*out_l_index_cl)[m];
+           }
+         }
+         else
+         {
+           for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++)
+           {
+              (*storeIndex_srv)[n]  = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur.
             (*out_i_index_srv)[n] = (*out_i_index_cl)[m] 
-                                  /*+ (ibegin_cl - 1) - (ibegin_srv - 1)*/ + (ibegin_zoom_cl - 1) - (ibegin_zoom_srv - 1);
+                                   + (ibegin_cl - 1) - (ibegin_srv - 1) + (ibegin_zoom_cl - 1) - (ibegin_zoom_srv - 1);
             (*out_j_index_srv)[n] = (*out_j_index_cl)[m]
-                                  /*+ (jbegin_cl - 1) - (jbegin_srv - 1)*/ + (jbegin_zoom_cl - 1) - (jbegin_zoom_srv - 1);
+                                   + (jbegin_cl - 1) - (jbegin_srv - 1) + (jbegin_zoom_cl - 1) - (jbegin_zoom_srv - 1);
             (*out_l_index_srv)[n] = (*out_l_index_cl)[m];
+           }         
+            
          }
                   
-         dn += storeIndex_cl->size();                 
-      }
-           
+         dn += storeIndex_cl->size(); 
+//         std::cout<<"storeIndex_cl->size() "<<storeIndex_cl->size()<<std::endl;               
+      
+//         std::cout<<"storeIndex_srv->size() "<<storeIndex_srv->size()<<std::endl;               
+      }
+      
       if (storeIndex_srv->size() != 0)
       {
@@ -496,5 +557,14 @@
          const int jend_t   =
             *std::max_element(out_j_index_srv->begin(), out_j_index_srv->end());
-            
+               
+//                std::cout<< "[ grille = "      << this->getId()
+//                         << ", ibegin_t = "    << ibegin_t
+//                         << ", jbegin_t = "    << jbegin_t
+//                         << ", iend_t = "      << iend_t
+//                         << ", jend_t = "      << jend_t
+//                         << ", zoom_ni_srv = " << zoom_ni_srv
+//                         << ", zoom_nj_srv = " << zoom_nj_srv
+//                         << ", nb subdomain = "   << out_i_index.size()-1<<std::endl   ;  
+                                 
          if ((ibegin_t < 0) || (jbegin_t < 0) ||
              (iend_t >= zoom_ni_srv) || (jend_t >= zoom_nj_srv))
@@ -508,4 +578,5 @@
                   << ", zoom_ni_srv = " << zoom_ni_srv
                   << ", zoom_nj_srv = " << zoom_nj_srv
+                  << ", nb subdomain = "   << out_i_index.size()-1
                   <<" ] Erreur d'indexation de la grille au niveau du serveur") ;
          }
Index: XMLIO_V2/dev/common/src/xmlio/node/grid.hpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/grid.hpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/grid.hpp	(revision 286)
@@ -71,4 +71,5 @@
          StdSize getLocalSize(void) const;
          StdSize getGlobalSize(void) const;
+         StdSize  getDataSize(void) const;
          std::vector<StdSize> getLocalShape(void) const;
          std::vector<StdSize> getGlobalShape(void) const;
@@ -133,7 +134,7 @@
       void CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored) const
    {
-      if (this->getGlobalSize() != field->num_elements())
+      if (this->getDataSize() != field->num_elements())
          ERROR("CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored)",
-                << "[ Taille des donnÃ©es attendue = " << this->getGlobalSize()       << ", "
+                << "[ Taille des donnÃ©es attendue = " << this->getDataSize()       << ", "
                 << "Taille des donnÃ©es reÃ§ue = "      << field->num_elements() << " ] "
                 << "Le tableau de donnÃ©es n'a pas la bonne taille !") ;
Index: XMLIO_V2/dev/common/src/xmlio/node/variable.hpp
===================================================================
--- XMLIO_V2/dev/common/src/xmlio/node/variable.hpp	(revision 278)
+++ XMLIO_V2/dev/common/src/xmlio/node/variable.hpp	(revision 286)
@@ -64,5 +64,7 @@
 
             
-            template <typename T> inline void getData(T & _data) const;
+            template <typename T> inline T getData(void) const;
+//            bool inline getData<bool>(void) const ;
+            
             template <typename T, StdSize N>
                inline void getData(ARRAY(T, N) _data_array) const;
@@ -81,4 +83,26 @@
       }; // class CVar
 
+     
+      template <typename T>
+      T CVariable::getData(void) const
+      {
+         T retval ;
+         std::stringstream sstr(std::stringstream::in | std::stringstream::out); 
+         sstr<<content ;
+         sstr>>retval ;
+         if (sstr.fail()) ERROR("CVariable::getdata()",
+               << "Cannot convert string <" << content << "> into type required" );
+         return retval ;
+      } 
+
+      template<>
+      bool CVariable::getData<bool>(void) const
+      {
+         if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 
+         else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 
+         else ERROR("CVariable::getdata()",
+               << "Cannot convert string <" << content << "> into type required" );
+         return false ;
+      } 
       ///--------------------------------------------------------------
 
