Index: XIOS/trunk/src/node/axis.cpp
===================================================================
--- XIOS/trunk/src/node/axis.cpp	(revision 666)
+++ XIOS/trunk/src/node/axis.cpp	(revision 667)
@@ -251,15 +251,28 @@
     int nbServer = client->serverSize;
     int range, clientSize = client->clientSize;
+
     size_t ni = this->n.getValue();
     size_t ibegin = this->begin.getValue();
+    size_t zoom_end = global_zoom_begin+global_zoom_size-1;
+    size_t nZoomCount = 0;
+    for (size_t idx = 0; idx < ni; ++idx)
+    {
+      size_t globalIndex = ibegin + idx;
+
+      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) ++nZoomCount;
+    }
 
     CArray<size_t,1> globalIndexAxis(ni);
-    int zoom_end = global_zoom_begin+global_zoom_size-1;
-    std::vector<size_t> globalAxisZoom;
+    std::vector<size_t> globalAxisZoom(nZoomCount);
+    nZoomCount = 0;
     for (size_t idx = 0; idx < ni; ++idx)
     {
       size_t globalIndex = ibegin + idx;
       globalIndexAxis(idx) = globalIndex;
-      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end) globalAxisZoom.push_back(globalIndex);
+      if (globalIndex >= global_zoom_begin && globalIndex <= zoom_end)
+      {
+        globalAxisZoom[nZoomCount];
+        ++nZoomCount;
+      }
     }
 
Index: XIOS/trunk/src/node/domain.cpp
===================================================================
--- XIOS/trunk/src/node/domain.cpp	(revision 666)
+++ XIOS/trunk/src/node/domain.cpp	(revision 667)
@@ -169,5 +169,5 @@
       else if (!i_index.isEmpty())
       {
-        ibegin = i_index(0);
+        if (ibegin.isEmpty()) ibegin = i_index(0);
       }
 
@@ -192,5 +192,5 @@
      else if (!j_index.isEmpty())
      {
-       jbegin = j_index(0);
+       if (jbegin.isEmpty()) jbegin = j_index(0);
      }
 
@@ -208,11 +208,4 @@
    void CDomain::checkMask(void)
    {
-      using namespace std;
-
-      int ibegin_mask = 0,
-          jbegin_mask = 0,
-          iend_mask = ibegin.getValue() + ni.getValue() - 1,
-          jend_mask = jbegin.getValue() + nj.getValue() - 1;
-
       if (!mask_1d.isEmpty() && !mask_2d.isEmpty())
         ERROR("CDomain::checkMask(void)",
@@ -644,5 +637,5 @@
 
    //----------------------------------------------------------------
-   // Divide function checkAttributes into 2 seperate onescheckBounds
+   // Divide function checkAttributes into 2 seperate ones
    // This function only checks all attributes of current domain
    void CDomain::checkAttributesOnClient()
@@ -682,5 +675,4 @@
        if (hasLonLat || hasArea) sendLonLatArea();
      }
-
      this->isChecked = true;
    }
@@ -877,4 +869,7 @@
   }
 
+  /*!
+    Send index from client to server(s)
+  */
   void CDomain::sendIndex()
   {
@@ -923,4 +918,7 @@
   }
 
+  /*!
+    Send area from client to server(s)
+  */
   void CDomain::sendArea()
   {
@@ -965,4 +963,9 @@
   }
 
+  /*!
+    Send longitude and latitude from client to servers
+    Each client send long and lat information to corresponding connected server(s).
+    Because longitude and latitude are optional, this function only called if latitude and longitude exist
+  */
   void CDomain::sendLonLat()
   {
@@ -1042,5 +1045,8 @@
   }
 
-
+  /*!
+    Send some optional information to server(s)
+    In the future, this function can be extended with more optional information to send
+  */
   void CDomain::sendLonLatArea(void)
   {
@@ -1085,4 +1091,8 @@
   }
 
+  /*!
+    Receive attributes event from clients(s)
+    \param[in] event event contain info about rank and associated attributes
+  */
   void CDomain::recvServerAttribut(CEventServer& event)
   {
@@ -1093,4 +1103,9 @@
   }
 
+  /*!
+    Receive attributes from client(s): zoom info and begin and n of each server
+    \param[in] rank rank of client source
+    \param[in] buffer message containing attributes info
+  */
   void CDomain::recvServerAttribut(CBufferIn& buffer)
   {
@@ -1130,4 +1145,8 @@
   }
 
+  /*!
+    Receive index event from clients(s)
+    \param[in] event event contain info about rank and associated index
+  */
   void CDomain::recvIndex(CEventServer& event)
   {
@@ -1142,4 +1161,9 @@
   }
 
+  /*!
+    Receive index information from client(s)
+    \param[in] rank rank of client source
+    \param[in] buffer message containing index info
+  */
   void CDomain::recvIndex(int rank, CBufferIn& buffer)
   {
@@ -1149,4 +1173,8 @@
   }
 
+  /*!
+    Receive longitude event from clients(s)
+    \param[in] event event contain info about rank and associated longitude
+  */
   void CDomain::recvLon(CEventServer& event)
   {
@@ -1161,4 +1189,9 @@
   }
 
+  /*!
+    Receive longitude information from client(s)
+    \param[in] rank rank of client source
+    \param[in] buffer message containing longitude info
+  */
   void CDomain::recvLon(int rank, CBufferIn& buffer)
   {
@@ -1184,4 +1217,8 @@
   }
 
+  /*!
+    Receive latitude event from clients(s)
+    \param[in] event event contain info about rank and associated latitude
+  */
   void CDomain::recvLat(CEventServer& event)
   {
@@ -1196,4 +1233,9 @@
   }
 
+  /*!
+    Receive latitude information from client(s)
+    \param[in] rank rank of client source
+    \param[in] buffer message containing latitude info
+  */
   void CDomain::recvLat(int rank, CBufferIn& buffer)
   {
@@ -1219,4 +1261,8 @@
   }
 
+  /*!
+    Receive area event from clients(s)
+    \param[in] event event contain info about rank and associated area
+  */
   void CDomain::recvArea(CEventServer& event)
   {
@@ -1231,4 +1277,9 @@
   }
 
+  /*!
+    Receive area information from client(s)
+    \param[in] rank rank of client source
+    \param[in] buffer message containing area info
+  */
   void CDomain::recvArea(int rank, CBufferIn& buffer)
   {
@@ -1247,4 +1298,8 @@
   }
 
+  /*!
+    Check whether a domain has transformation
+    \return true if domain has transformation
+  */
   bool CDomain::hasTransformation()
   {
@@ -1252,4 +1307,8 @@
   }
 
+  /*!
+    Set transformation for current domain. It's the method to move transformation in hierarchy
+    \param [in] domTrans transformation on domain
+  */
   void CDomain::setTransformations(const TransMapTypes& domTrans)
   {
@@ -1257,4 +1316,8 @@
   }
 
+  /*!
+    Get all transformation current domain has
+    \return all transformation
+  */
   CDomain::TransMapTypes CDomain::getAllTransformations(void)
   {
@@ -1276,4 +1339,7 @@
   }
 
+  /*!
+    A current domain will go up the hierarchy to find out the domain from which it has transformation
+  */
   void CDomain::solveInheritanceTransformation()
   {
@@ -1296,4 +1362,9 @@
   }
 
+  /*!
+    Parse children nodes of a domain in xml file.
+    Whenver there is a new transformation, its type and name should be added into this function
+    \param node child node to process
+  */
   void CDomain::parse(xml::CXMLNode & node)
   {
Index: XIOS/trunk/src/node/domain.hpp
===================================================================
--- XIOS/trunk/src/node/domain.hpp	(revision 666)
+++ XIOS/trunk/src/node/domain.hpp	(revision 667)
@@ -76,36 +76,13 @@
          TransMapTypes getAllTransformations();
 
-      private :
-         void checkDomain(void);
-         void checkLocalIDomain(void);
-         void checkLocalJDomain(void);
-
-         void checkMask(void);
-         void checkDomainData(void);
-         void checkCompression(void);
-
-         void checkBounds(void);
-         void checkArea(void);
-         void checkLonLat();
-
       public :
-
-         /// Autres ///
-
          const std::set<StdString> & getRelFiles(void) const;
-
-
-         /// Test ///
          bool IsWritten(const StdString & filename) const;
-//         bool hasZoom(void) const;
          bool isEmpty(void) const;
          bool isDistributed(void) const;
 
 
-//         int ni_client,ibegin_client,iend_client ;
-//         int zoom_ni_client,zoom_ibegin_client,zoom_iend_client ;
-//
-//         int nj_client,jbegin_client,jend_client ;
-//         int zoom_nj_client,zoom_jbegin_client,zoom_jend_client ;
+         int global_zoom_ibegin, global_zoom_ni;
+         int global_zoom_jbegin, global_zoom_nj;
 
          int ni_srv,ibegin_srv,iend_srv ;
@@ -121,5 +98,4 @@
          CArray<double, 1> area_srv;
 
-
         vector<int> connectedServer ; // list of connected server
         vector<int> nbSenders ; // for each communication with a server, number of communicating client
@@ -127,10 +103,4 @@
         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
-
-        int global_zoom_ibegin, global_zoom_ni;
-        int global_zoom_jbegin, global_zoom_nj;
 
       public :
@@ -169,4 +139,16 @@
          bool hasLonLat;
       private:
+         void checkDomain(void);
+         void checkLocalIDomain(void);
+         void checkLocalJDomain(void);
+
+         void checkMask(void);
+         void checkDomainData(void);
+         void checkCompression(void);
+
+         void checkBounds(void);
+         void checkArea(void);
+         void checkLonLat();
+
          void checkTransformations();
          void setTransformations(const TransMapTypes&);
@@ -191,6 +173,4 @@
          bool isUnstructed_;
 
-
-
          DECLARE_REF_FUNC(Domain,domain)
 
