Index: XIOS/trunk/src/node/axis.cpp
===================================================================
--- XIOS/trunk/src/node/axis.cpp	(revision 630)
+++ XIOS/trunk/src/node/axis.cpp	(revision 631)
@@ -104,8 +104,8 @@
 //               << "The array \'value\' of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] has a different size that the one defined by the \'size\' attribute");
 
-      if (0 == global_zoom_size) global_zoom_size = size;
+
       this->checkData();
       this->checkMask();
-//      this->checkZoom();
+      this->checkZoom();
 
       if (!bounds.isEmpty())
@@ -138,25 +138,8 @@
    }
 
-//   void CAxis::checkZoom(void)
-//   {
-//      StdSize zoom_begin,zoom_end, zoom_size, axisSize;
-//
-//      zoom_begin = (this->zoom_begin.isEmpty()) ?  0 : this->zoom_begin.getValue() ;
-//      zoom_size  = (this->zoom_size.isEmpty()) ?  size.getValue() : this->zoom_size.getValue() ;
-//      zoom_end   = (this->zoom_end.isEmpty()) ?  (size.getValue() - 1) : this->zoom_end.getValue() ;
-//
-//      if (this->zoom_begin.isEmpty()) zoom_begin=zoom_end-zoom_size+1 ;
-//      if (this->zoom_end.isEmpty()) zoom_end=zoom_begin+zoom_size-1 ;
-//      if (this->zoom_size.isEmpty()) zoom_size=zoom_end-zoom_begin+1 ;
-//      axisSize = size.getValue();
-//
-//      if ( (zoom_begin < 0) || (zoom_begin > axisSize-1) || (zoom_end<0) || (zoom_end>axisSize-1) || (zoom_size<1) || (zoom_size>axisSize) || (zoom_begin>zoom_end))
-//        ERROR("CAxis::checkAttributes(void)",
-//              << "One or more attributes among <zoom_begin>, <zoom_end>, <zoom_size> of axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] are not well specified");
-//
-//      this->zoom_begin.setValue(zoom_begin) ;
-//      this->zoom_end.setValue(zoom_end) ;
-//      this->zoom_size.setValue(zoom_size) ;
-//   }
+   void CAxis::checkZoom(void)
+   {
+     if (0 == global_zoom_size) global_zoom_size = this->size.getValue();
+   }
 
    void CAxis::checkMask()
Index: XIOS/trunk/src/node/axis.hpp
===================================================================
--- XIOS/trunk/src/node/axis.hpp	(revision 630)
+++ XIOS/trunk/src/node/axis.hpp	(revision 631)
@@ -105,5 +105,5 @@
          void checkData();
          void checkMask();
-//         void checkZoom();
+         void checkZoom();
          void checkTransformations();
          void computeServerIndex(const std::vector<int>& globalDim, int orderPositionInGrid,
Index: XIOS/trunk/src/node/domain.cpp
===================================================================
--- XIOS/trunk/src/node/domain.cpp	(revision 630)
+++ XIOS/trunk/src/node/domain.cpp	(revision 631)
@@ -16,4 +16,5 @@
 #include "server_distribution_description.hpp"
 #include "client_server_mapping_distributed.hpp"
+#include "zoom_domain.hpp"
 
 namespace xios {
@@ -547,17 +548,33 @@
 
       // compute client zoom indices
-
-      int zoom_iend=zoom_ibegin+zoom_ni-1 ;
-      zoom_ibegin_client = ibegin_client > zoom_ibegin ? ibegin_client : zoom_ibegin ;
-      zoom_iend_client = iend_client < zoom_iend ? iend_client : zoom_iend ;
+      // compute client zoom indices
+      if (0 == global_zoom_ni) global_zoom_ni = ni_glo;
+      if (0 == global_zoom_nj) global_zoom_nj = nj_glo;
+
+      int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ;
+      zoom_ibegin_client = ibegin_client > global_zoom_ibegin ? ibegin_client : global_zoom_ibegin ;
+      zoom_iend_client = iend_client < global_zoom_iend ? iend_client : global_zoom_iend ;
       zoom_ni_client=zoom_iend_client-zoom_ibegin_client+1 ;
       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 ;
-      zoom_jend_client = jend_client < zoom_jend ? jend_client : zoom_jend ;
+      int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ;
+      zoom_jbegin_client = jbegin_client > global_zoom_jbegin ? jbegin_client : global_zoom_jbegin ;
+      zoom_jend_client = jend_client < global_zoom_jend ? jend_client : global_zoom_jend ;
       zoom_nj_client=zoom_jend_client-zoom_jbegin_client+1 ;
       if (zoom_nj_client<0) zoom_nj_client=0 ;
+
+//      int zoom_iend=zoom_ibegin+zoom_ni-1 ;
+//      zoom_ibegin_client = ibegin_client > zoom_ibegin ? ibegin_client : zoom_ibegin ;
+//      zoom_iend_client = iend_client < zoom_iend ? iend_client : zoom_iend ;
+//      zoom_ni_client=zoom_iend_client-zoom_ibegin_client+1 ;
+//      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 ;
+//      zoom_jend_client = jend_client < zoom_jend ? jend_client : zoom_jend ;
+//      zoom_nj_client=zoom_jend_client-zoom_jbegin_client+1 ;
+//      if (zoom_nj_client<0) zoom_nj_client=0 ;
 
    }
@@ -598,5 +615,5 @@
 
       this->checkDomain();
-      this->checkZoom();
+//      this->checkZoom();
       this->checkBounds();
       this->checkArea();
@@ -607,6 +624,6 @@
          this->checkDomainData();
          this->checkCompression();
-         this->completeLonLatClient();
-         this->computeConnectedServer() ;
+//         this->completeLonLatClient();
+//         this->computeConnectedServer() ;
       }
       else
@@ -625,7 +642,11 @@
      CContext* context=CContext::getCurrent() ;
 
+     this->checkZoom();
      if (this->isChecked) return;
      if (context->hasClient)
      {
+       this->computeConnectedServer();
+       this->completeLonLatClient();
+
        sendServerAttribut() ;
        sendLonLatArea() ;
@@ -703,4 +724,5 @@
         msg << this->getId() ;
         msg << ni_srv << ibegin_srv << iend_srv << nj_srv << jbegin_srv << jend_srv;
+        msg << global_zoom_ni << global_zoom_ibegin << global_zoom_nj << global_zoom_jbegin;
 
         event.push(*itRank,1,msg);
@@ -722,6 +744,6 @@
 
     int i,j,i_ind,j_ind ;
-    int zoom_iend=zoom_ibegin+zoom_ni-1 ;
-    int zoom_jend=zoom_jbegin+zoom_nj-1 ;
+    int zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ;
+    int zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ;
 
     // Precompute number of index
@@ -733,5 +755,5 @@
         j_ind=jbegin+j_index(i,j) ;
 
-        if (i_ind >= zoom_ibegin && i_ind <= zoom_iend && j_ind >= zoom_jbegin && j_ind <= zoom_jend)
+        if (i_ind >= global_zoom_ibegin && i_ind <= zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= zoom_jend)
         {
           ++globalIndexCountZoom;
@@ -755,5 +777,5 @@
         globalIndexDomain(globalIndexCount) = globalIndex;
         ++globalIndexCount;
-        if (i_ind >= zoom_ibegin && i_ind <= zoom_iend && j_ind >= zoom_jbegin && j_ind <= zoom_jend)
+        if (i_ind >= global_zoom_ibegin && i_ind <= zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= zoom_jend)
         {
           globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
@@ -976,14 +998,15 @@
   void CDomain::recvServerAttribut(CBufferIn& buffer)
   {
-    int zoom_iend = zoom_ibegin.getValue() + zoom_ni.getValue() - 1;
-    int zoom_jend = zoom_jbegin.getValue() + zoom_nj.getValue() - 1;
-
-    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 ;
+    buffer >> ni_srv >> ibegin_srv >> iend_srv >> nj_srv >> jbegin_srv >> jend_srv
+           >> global_zoom_ni >> global_zoom_ibegin >> global_zoom_nj >> global_zoom_jbegin;
+
+    int zoom_iend = global_zoom_ibegin + global_zoom_ni - 1;
+    int zoom_jend = global_zoom_jbegin + global_zoom_nj - 1;
+
+    zoom_ibegin_srv = global_zoom_ibegin > ibegin_srv ? global_zoom_ibegin : 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_jbegin_srv = global_zoom_jbegin > jbegin_srv ? global_zoom_jbegin : jbegin_srv ;
     zoom_jend_srv = zoom_jend < jend_srv ? zoom_jend : jend_srv ;
     zoom_nj_srv=zoom_jend_srv-zoom_jbegin_srv+1 ;
@@ -1127,4 +1150,72 @@
   }
 
+  bool CDomain::hasTransformation()
+  {
+    return (!transformationMap_.empty());
+  }
+
+  void CDomain::setTransformations(const TransMapTypes& domTrans)
+  {
+    transformationMap_ = domTrans;
+  }
+
+  CDomain::TransMapTypes CDomain::getAllTransformations(void)
+  {
+    return transformationMap_;
+  }
+
+  /*!
+    Check the validity of all transformations applied on domain
+  This functions is called AFTER all inherited attributes are solved
+  */
+  void CDomain::checkTransformations()
+  {
+    TransMapTypes::const_iterator itb = transformationMap_.begin(), it,
+                                  ite = transformationMap_.end();
+    for (it = itb; it != ite; ++it)
+    {
+      (it->second)->checkValid(this);
+    }
+  }
+
+  void CDomain::solveInheritanceTransformation()
+  {
+    if (this->hasTransformation()) return;
+
+    std::vector<CDomain*> refDomain;
+    CDomain* refer_sptr;
+    CDomain* refer_ptr = this;
+    while (refer_ptr->hasDirectDomainReference())
+    {
+      refDomain.push_back(refer_ptr);
+      refer_sptr = refer_ptr->getDirectDomainReference();
+      refer_ptr  = refer_sptr;
+      if (refer_ptr->hasTransformation()) break;
+    }
+
+    if (refer_ptr->hasTransformation())
+      for (int idx = 0; idx < refDomain.size(); ++idx)
+        refDomain[idx]->setTransformations(refer_ptr->getAllTransformations());
+  }
+
+  void CDomain::parse(xml::CXMLNode & node)
+  {
+    SuperClass::parse(node);
+
+    if (node.goToChildElement())
+    {
+      StdString zoomDomainDefRoot("zoom_domain_definition");
+      StdString zoom("zoom_domain");
+      do
+      {
+        if (node.getElementName() == zoom) {
+          CZoomDomain* tmp = (CZoomDomainGroup::get(zoomDomainDefRoot))->createChild();
+          tmp->parse(node);
+          transformationMap_.push_back(std::make_pair(TRANS_ZOOM_DOMAIN,tmp));
+        }
+      } while (node.goToNextElement()) ;
+      node.goToParentElement();
+    }
+  }
    //----------------------------------------------------------------
 
Index: XIOS/trunk/src/node/domain.hpp
===================================================================
--- XIOS/trunk/src/node/domain.hpp	(revision 630)
+++ XIOS/trunk/src/node/domain.hpp	(revision 631)
@@ -14,4 +14,6 @@
 #include "attribute_array.hpp"
 #include "attribute_enum.hpp"
+#include "transformation.hpp"
+#include "transformation_enum.hpp"
 
 namespace xios {
@@ -49,4 +51,5 @@
          typedef CDomainAttributes RelAttributes;
          typedef CDomainGroup      RelGroup;
+         typedef CTransformation<CDomain>::TransformationMapTypes TransMapTypes;
 
          /// Constructeurs ///
@@ -59,4 +62,6 @@
          void duplicateAttributes(CDomain* domain);
 
+         virtual void parse(xml::CXMLNode & node);
+
          /// VÃ©rifications ///
          void checkAttributes(void);
@@ -65,4 +70,8 @@
 
          void sendCheckedAttributes();
+
+         bool hasTransformation();
+         void solveInheritanceTransformation();
+         TransMapTypes getAllTransformations();
 
       private :
@@ -122,5 +131,6 @@
         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;
 //        vector<int> ib_srv, ie_srv, in_srv ;
 //        vector<int> jb_srv, je_srv, jn_srv ;
@@ -160,7 +170,9 @@
          bool hasBounds ;
          bool hasArea;
+      private:
+         void checkTransformations();
+         void setTransformations(const TransMapTypes&);
+
        private :
-
-         /// ProriÃ©tÃ©s protÃ©gÃ©es ///
          bool isChecked;
          std::set<StdString> relFiles;
@@ -171,4 +183,5 @@
          std::vector<int> connectedServerRank_;
          bool isDistributed_;
+         TransMapTypes transformationMap_;
 
          DECLARE_REF_FUNC(Domain,domain)
Index: XIOS/trunk/src/node/grid.cpp
===================================================================
--- XIOS/trunk/src/node/grid.cpp	(revision 630)
+++ XIOS/trunk/src/node/grid.cpp	(revision 631)
@@ -862,10 +862,10 @@
             nZoomBegin[indexMap[i]] = domainList[domainId]->zoom_ibegin_srv;
             nZoomSize[indexMap[i]]  = domainList[domainId]->zoom_ni_srv;
-            nZoomBeginGlobal[indexMap[i]] = domainList[domainId]->zoom_ibegin;
+            nZoomBeginGlobal[indexMap[i]] = domainList[domainId]->global_zoom_ibegin;
             nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
 
             nZoomBegin[indexMap[i] + 1] = domainList[domainId]->zoom_jbegin_srv;
             nZoomSize[indexMap[i] + 1] = domainList[domainId]->zoom_nj_srv;
-            nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->zoom_jbegin;
+            nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->global_zoom_jbegin;
             nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
             ++domainId;
@@ -1124,4 +1124,5 @@
         pDom->solveRefInheritance(apply);
         pDom->solveBaseReference();
+        pDom->solveInheritanceTransformation();
         if ((!pDom->domain_ref.isEmpty()) && (pDom->name.isEmpty()))
           pDom->name.setValue(pDom->getBaseDomainReference()->getId());
Index: XIOS/trunk/src/node/node_enum.hpp
===================================================================
--- XIOS/trunk/src/node/node_enum.hpp	(revision 630)
+++ XIOS/trunk/src/node/node_enum.hpp	(revision 631)
@@ -22,5 +22,6 @@
          eInverseAxis,
          eZoomAxis,
-         eInterpolateAxis
+         eInterpolateAxis,
+         eZoomDomain
 
       } ENodeType;
Index: XIOS/trunk/src/node/node_type.hpp
===================================================================
--- XIOS/trunk/src/node/node_type.hpp	(revision 630)
+++ XIOS/trunk/src/node/node_type.hpp	(revision 631)
@@ -13,4 +13,5 @@
 #include "zoom_axis.hpp"
 #include "interpolate_axis.hpp"
+#include "zoom_domain.hpp"
 
 #endif // __XIOS_NODE_TYPE__
Index: XIOS/trunk/src/node/transformation_enum.hpp
===================================================================
--- XIOS/trunk/src/node/transformation_enum.hpp	(revision 630)
+++ XIOS/trunk/src/node/transformation_enum.hpp	(revision 631)
@@ -9,5 +9,6 @@
         TRANS_ZOOM_AXIS,
         TRANS_INVERSE_AXIS,
-        TRANS_INTERPOLATE_AXIS
+        TRANS_INTERPOLATE_AXIS,
+        TRANS_ZOOM_DOMAIN
       } ETranformationType;
 
Index: XIOS/trunk/src/node/zoom_domain.cpp
===================================================================
--- XIOS/trunk/src/node/zoom_domain.cpp	(revision 631)
+++ XIOS/trunk/src/node/zoom_domain.cpp	(revision 631)
@@ -0,0 +1,60 @@
+#include "zoom_domain.hpp"
+#include "type.hpp"
+
+namespace xios {
+
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+  CZoomDomain::CZoomDomain(void)
+    : CObjectTemplate<CZoomDomain>(), CZoomDomainAttributes(), CTransformation<CDomain>()
+  { /* Ne rien faire de plus */ }
+
+  CZoomDomain::CZoomDomain(const StdString & id)
+    : CObjectTemplate<CZoomDomain>(id), CZoomDomainAttributes(), CTransformation<CDomain>()
+  { /* Ne rien faire de plus */ }
+
+  CZoomDomain::~CZoomDomain(void)
+  {}
+
+  //----------------------------------------------------------------
+
+  StdString CZoomDomain::GetName(void)    { return StdString("zoom_domain"); }
+  StdString CZoomDomain::GetDefName(void) { return StdString("zoom_domain"); }
+  ENodeType CZoomDomain::GetType(void)    { return eZoomDomain; }
+
+  void CZoomDomain::checkValid(CDomain* domainSrc)
+  {
+    int ni_glo = domainSrc->ni_glo.getValue();
+    int nj_glo = domainSrc->nj_glo.getValue();
+
+    // RÃ©solution et vÃ©rification des donnÃ©es globales de zoom.
+    if (!this->zoom_ni.isEmpty() || !this->zoom_nj.isEmpty() ||
+        !this->zoom_ibegin.isEmpty() || !this->zoom_jbegin.isEmpty())
+    {
+       if (this->zoom_ni.isEmpty()     || this->zoom_nj.isEmpty() ||
+           this->zoom_ibegin.isEmpty() || this->zoom_jbegin.isEmpty())
+       {
+          ERROR("CZoomDomain::checkValid(void)",
+                <<"if one of zoom attributes is defined then all zoom attributes must be defined") ;
+       }
+       else
+       {
+          int zoom_iend = zoom_ibegin + zoom_ni - 1;
+          int zoom_jend = zoom_jbegin + zoom_nj - 1;
+
+          if (zoom_ibegin < 0  || zoom_jbegin < 0 || zoom_iend > (ni_glo-1) || zoom_jend > (nj_glo-1))
+             ERROR("CZoomDomain::checkValid(void)",
+                   << "Zoom is wrongly defined,"
+                   << " Check the values : zoom_ni, zoom_nj, zoom_ibegin, zoom_jbegin") ;
+       }
+    }
+    else
+    {
+       zoom_ni = ni_glo;
+       zoom_nj = nj_glo;
+       zoom_ibegin = 0;
+       zoom_jbegin = 0;
+    }
+  }
+
+}
Index: XIOS/trunk/src/node/zoom_domain.hpp
===================================================================
--- XIOS/trunk/src/node/zoom_domain.hpp	(revision 631)
+++ XIOS/trunk/src/node/zoom_domain.hpp	(revision 631)
@@ -0,0 +1,65 @@
+#ifndef __XIOS_CZoomDomain__
+#define __XIOS_CZoomDomain__
+
+/// xios headers ///
+#include "xios_spl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+#include "attribute_array.hpp"
+#include "declare_attribute.hpp"
+#include "object_template.hpp"
+#include "group_factory.hpp"
+#include "declare_group.hpp"
+#include "transformation.hpp"
+#include "domain.hpp"
+
+namespace xios {
+  /// ////////////////////// DÃ©clarations ////////////////////// ///
+  class CZoomDomainGroup;
+  class CZoomDomainAttributes;
+  class CZoomDomain;
+  class CDomain;
+
+  ///--------------------------------------------------------------
+
+  // Declare/Define CFileAttribute
+  BEGIN_DECLARE_ATTRIBUTE_MAP(CZoomDomain)
+#include "zoom_domain_attribute.conf"
+  END_DECLARE_ATTRIBUTE_MAP(CZoomDomain)
+
+  ///--------------------------------------------------------------
+  /*!
+    \class CZoomDomain
+    This class describes zoom_domain in xml file.
+  */
+  class CZoomDomain
+    : public CObjectTemplate<CZoomDomain>
+    , public CZoomDomainAttributes
+    , public CTransformation<CDomain>
+  {
+    public :
+      typedef CObjectTemplate<CZoomDomain> SuperClass;
+      typedef CZoomDomainAttributes SuperClassAttribute;
+
+    public :
+      /// Constructeurs ///
+      CZoomDomain(void);
+      explicit CZoomDomain(const StdString& id);
+
+      /// Destructeur ///
+      virtual ~CZoomDomain(void);
+
+      virtual void checkValid(CDomain* axisDest);
+
+      /// Accesseurs statiques ///
+      static StdString GetName(void);
+      static StdString GetDefName(void);
+      static ENodeType GetType(void);
+    private:
+
+  }; // class CZoomDomain
+
+  DECLARE_GROUP(CZoomDomain);
+} // namespace xios
+
+#endif // __XIOS_CZoomDomain__
