Index: XIOS/dev/branch_openmp/src/node/axis.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/axis.cpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/axis.cpp	(revision 1642)
@@ -14,6 +14,4 @@
 #include "distribution_client.hpp"
 
-using namespace ep_lib;
-
 namespace xios {
 
@@ -28,5 +26,5 @@
       , transformationMap_(), hasValue(false), hasLabel(false)
       , computedWrittenIndex_(false)
-      , clients()
+	  , clients()
    {
    }
@@ -40,5 +38,5 @@
       , transformationMap_(), hasValue(false), hasLabel(false)
       , computedWrittenIndex_(false)
-      , clients()
+	  , clients()
    {
    }
@@ -47,10 +45,12 @@
    { /* Ne rien faire de plus */ }
 
-   std::map<StdString, ETranformationType> *CAxis::transformationMapList_ptr = 0;
-
+   std::map<StdString, ETranformationType> CAxis::transformationMapList_ = std::map<StdString, ETranformationType>();
+   bool CAxis::dummyTransformationMapList_ = CAxis::initializeTransformationMap(CAxis::transformationMapList_);
    bool CAxis::initializeTransformationMap(std::map<StdString, ETranformationType>& m)
+   TRY
    {
      m["zoom_axis"] = TRANS_ZOOM_AXIS;
      m["interpolate_axis"] = TRANS_INTERPOLATE_AXIS;
+     m["extract_axis"] = TRANS_EXTRACT_AXIS;
      m["inverse_axis"] = TRANS_INVERSE_AXIS;
      m["reduce_domain"] = TRANS_REDUCE_DOMAIN_TO_AXIS;
@@ -59,45 +59,42 @@
      m["temporal_splitting"] = TRANS_TEMPORAL_SPLITTING;
      m["duplicate_scalar"] = TRANS_DUPLICATE_SCALAR_TO_AXIS;
-   }
-
-   bool CAxis::initializeTransformationMap()
-   {
-     if(CAxis::transformationMapList_ptr == 0) CAxis::transformationMapList_ptr = new std::map<StdString, ETranformationType>();
-     (*CAxis::transformationMapList_ptr)["zoom_axis"]        = TRANS_ZOOM_AXIS;
-     (*CAxis::transformationMapList_ptr)["interpolate_axis"] = TRANS_INTERPOLATE_AXIS;
-     (*CAxis::transformationMapList_ptr)["inverse_axis"]     = TRANS_INVERSE_AXIS;
-     (*CAxis::transformationMapList_ptr)["reduce_domain"]    = TRANS_REDUCE_DOMAIN_TO_AXIS;
-     (*CAxis::transformationMapList_ptr)["extract_domain"]   = TRANS_EXTRACT_DOMAIN_TO_AXIS;
-     (*CAxis::transformationMapList_ptr)["reduce_axis"]      = TRANS_REDUCE_AXIS_TO_AXIS;
-     (*CAxis::transformationMapList_ptr)["temporal_splitting"] = TRANS_TEMPORAL_SPLITTING;
-     (*CAxis::transformationMapList_ptr)["duplicate_scalar"] = TRANS_DUPLICATE_SCALAR_TO_AXIS;
-   }
+
+   }
+   CATCH
 
    ///---------------------------------------------------------------
 
    const std::set<StdString> & CAxis::getRelFiles(void) const
+   TRY
    {
       return (this->relFiles);
    }
+   CATCH
 
    bool CAxis::IsWritten(const StdString & filename) const
+   TRY
    {
       return (this->relFiles.find(filename) != this->relFiles.end());
    }
+   CATCH
 
    bool CAxis::isWrittenCompressed(const StdString& filename) const
+   TRY
    {
       return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end());
    }
+   CATCH
 
    bool CAxis::isDistributed(void) const
+   TRY
    {
       bool distributed = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) ||
              (!this->n.isEmpty() && (this->n != this->n_glo));
-      // A same stupid condition to make sure that if there is only one client, axis
+      // A condition to make sure that if there is only one client, axis
       // should be considered to be distributed. This should be a temporary solution     
       distributed |= (1 == CContext::getCurrent()->client->clientSize);
       return distributed;
    }
+   CATCH
 
    /*!
@@ -107,17 +104,23 @@
     */
    bool CAxis::isCompressible(void) const
+   TRY
    {
       return isCompressible_;
    }
+   CATCH
 
    void CAxis::addRelFile(const StdString & filename)
+   TRY
    {
       this->relFiles.insert(filename);
    }
+   CATCH_DUMP_ATTR
 
    void CAxis::addRelFileCompressed(const StdString& filename)
+   TRY
    {
       this->relFilesCompressed.insert(filename);
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -128,4 +131,5 @@
    */
    int CAxis::getNumberWrittenIndexes(ep_lib::MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -133,4 +137,5 @@
      return numberWrittenIndexes_[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -139,4 +144,5 @@
    */
    int CAxis::getTotalNumberWrittenIndexes(ep_lib::MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -144,4 +150,5 @@
      return totalNumberWrittenIndexes_[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -150,4 +157,5 @@
    */
    int CAxis::getOffsetWrittenIndexes(ep_lib::MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -155,6 +163,8 @@
      return offsetWrittenIndexes_[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    CArray<int, 1>& CAxis::getCompressedIndexToWriteOnServer(ep_lib::MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -162,4 +172,6 @@
      return compressedIndexToWriteOnServer[writtenSize];
    }
+   CATCH_DUMP_ATTR
+
    //----------------------------------------------------------------
 
@@ -171,4 +183,5 @@
    std::map<int, StdSize> CAxis::getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid,
                                                          CServerDistributionDescription::ServerDistributionType distType)
+   TRY
    {
 
@@ -234,7 +247,7 @@
        }
      }
-
      return attributesSizes;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -247,8 +260,10 @@
 
    CAxis* CAxis::createAxis()
+   TRY
    {
      CAxis* axis = CAxisGroup::get("axis_definition")->createChild();
      return axis;
    }
+   CATCH
 
    /*!
@@ -257,6 +272,9 @@
    */
    void CAxis::checkAttributes(void)
-   {
-      if (this->n_glo.isEmpty())
+   TRY
+   {
+     CContext* context=CContext::getCurrent();
+
+     if (this->n_glo.isEmpty())
         ERROR("CAxis::checkAttributes(void)",
               << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] "
@@ -298,12 +316,16 @@
       }
 
-      // Remove this check because it doen't make sense in case of a hole or overlapping axes
       if (!this->value.isEmpty())
       {
-//        StdSize true_size = value.numElements();
-//        if (this->n.getValue() != true_size)
-//          ERROR("CAxis::checkAttributes(void)",
-//                << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] "
-//                << "The axis is wrongly defined, attribute 'value' has a different size (" << true_size << ") than the one defined by the \'size\' attribute (" << n.getValue() << ").");
+        // Avoid this check at writing because it fails in case of a hole
+        if (context->hasClient)
+        {
+          StdSize true_size = value.numElements();
+          if (this->n.getValue() != true_size)
+            ERROR("CAxis::checkAttributes(void)",
+                << "[ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] "
+                << "The axis is wrongly defined, attribute 'value' has a different size (" << true_size
+                << ") than the one defined by the \'size\' attribute (" << n.getValue() << ").");
+        }
         this->hasValue = true;
       }
@@ -311,18 +333,18 @@
       this->checkBounds();
 
-      CContext* context=CContext::getCurrent();
       if (context->hasClient)
       {
+        this->checkMask();
         this->checkData();
-        this->checkZoom();
-        this->checkMask();
         this->checkLabel();
       }
    }
+   CATCH_DUMP_ATTR
 
    /*!
-      Check the validity of data and fill in values if any.
+      Check the validity of data, fill in values if any, and apply mask.
    */
    void CAxis::checkData()
+   TRY
    {
       if (data_begin.isEmpty()) data_begin.setValue(0);
@@ -342,27 +364,38 @@
       {
         data_index.resize(data_n);
-        for (int i = 0; i < data_n; ++i) data_index(i) = i;
-      }
-   }
-
-   /*!
-     Check validity of zoom info and fill in values if any.
-   */
-   void CAxis::checkZoom(void)
-   {
-     if (global_zoom_begin.isEmpty()) global_zoom_begin.setValue(0);
-     if (global_zoom_n.isEmpty()) global_zoom_n.setValue(n_glo.getValue());
-     if (zoom_index.isEmpty())
-     {
-       zoom_index.setValue(index.getValue());
-     }
-     if (zoom_n.isEmpty()) zoom_n.setValue(n);
-     if (zoom_begin.isEmpty()) zoom_begin.setValue(begin);
-   }
+        for (int i = 0; i < data_n; ++i)
+        {
+          if ((i+data_begin) >= 0 && (i+data_begin<n))
+          {
+            if (mask(i+data_begin))
+              data_index(i) = i+data_begin;
+            else
+              data_index(i) = -1;
+          }
+          else
+            data_index(i) = -1;
+        }
+      }
+      else
+      {
+        if (data_index.numElements() != data_n)
+        {
+          ERROR("CAxis::checkData(void)",
+                << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
+                << "The size of data_index = "<< data_index.numElements() << "is not equal to the data size data_n = " << data_n.getValue() << ").");
+        }
+        for (int i = 0; i < data_n; ++i)
+        {
+          if ((i+data_begin) >= 0 && (i+data_begin<n) && !mask(i+data_begin))
+            data_index(i) = -1;
+        }
+      }
+
+   }
+   CATCH_DUMP_ATTR
 
     size_t CAxis::getGlobalWrittenSize(void)
     {
-      if (zoomByIndex()) return  global_zoom_index.numElements();
-      else return global_zoom_n ;
+      return n_glo ;
     }
 
@@ -371,23 +404,24 @@
    */
    void CAxis::checkMask()
+   TRY
    {
       if (!mask.isEmpty())
       {
-         if (mask.extent(0) != n)
-           ERROR("CAxis::checkMask(void)",
-                 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
-                 << "The mask does not have the same size as the local domain." << std::endl
-                 << "Local size is " << n.getValue() << "." << std::endl
-                 << "Mask size is " << mask.extent(0) << ".");
-      }
-      else // (mask.isEmpty())
-      { // If no mask was defined, we create a default one without any masked point.
-         mask.resize(n);
-         for (int i = 0; i < n; ++i)
-         {
-           mask(i) = true;
-         }
-      }
-   }
+        if (mask.extent(0) != n)
+        {
+          ERROR("CAxis::checkMask(void)",
+              << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
+              << "The mask does not have the same size as the local domain." << std::endl
+              << "Local size is " << n.getValue() << "." << std::endl
+              << "Mask size is " << mask.extent(0) << ".");
+        }
+      }
+      else
+      {
+        mask.resize(n);
+        mask = true;
+      }
+   }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -395,4 +429,5 @@
    */
    void CAxis::checkBounds()
+   TRY
    {
      if (!bounds.isEmpty())
@@ -407,6 +442,8 @@
      else hasBounds = false;
    }
+   CATCH_DUMP_ATTR
 
   void CAxis::checkLabel()
+  TRY
   {
     if (!label.isEmpty())
@@ -421,4 +458,5 @@
     else hasLabel = false;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -426,17 +464,10 @@
   */
   void CAxis::checkEligibilityForCompressedOutput()
+  TRY
   {
     // We don't check if the mask is valid here, just if a mask has been defined at this point.
     isCompressible_ = !mask.isEmpty();
   }
-
-  /*
-    Check whether we do zooming by indexing
-    return true if do zooming by index
-  */
-  bool CAxis::zoomByIndex()
-  {
-    return (!global_zoom_index.isEmpty() && (0 != global_zoom_index.numElements()));
-  }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -444,4 +475,5 @@
   */
   bool CAxis::dispatchEvent(CEventServer& event)
+  TRY
   {
      if (SuperClass::dispatchEvent(event)) return true;
@@ -469,4 +501,5 @@
      }
   }
+  CATCH
 
    /*!
@@ -474,4 +507,5 @@
    */
    void CAxis::checkAttributesOnClient()
+   TRY
    {
      if (this->areClientAttributesChecked_) return;
@@ -482,4 +516,5 @@
      this->areClientAttributesChecked_ = true;
    }
+   CATCH_DUMP_ATTR
 
    /*
@@ -489,4 +524,5 @@
    void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid,
                                                           CServerDistributionDescription::ServerDistributionType distType)
+   TRY
    {
      CContext* context=CContext::getCurrent() ;
@@ -502,4 +538,5 @@
      this->isClientAfterTransformationChecked = true;
    }
+   CATCH_DUMP_ATTR
 
    /*
@@ -512,4 +549,5 @@
    void CAxis::sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid,
                                      CServerDistributionDescription::ServerDistributionType distType)
+   TRY
    {
      if (!this->areClientAttributesChecked_) checkAttributesOnClient();
@@ -522,4 +560,5 @@
      this->isChecked = true;
    }
+   CATCH_DUMP_ATTR
 
   /*!
@@ -530,4 +569,5 @@
   void CAxis::sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid,
                              CServerDistributionDescription::ServerDistributionType distType)
+  TRY
   {
      sendDistributionAttribute(globalDim, orderPositionInGrid, distType);
@@ -544,4 +584,5 @@
      }     
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -555,4 +596,5 @@
   void CAxis::computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid,
                                      CServerDistributionDescription::ServerDistributionType distType)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -574,6 +616,4 @@
         size_t ni = this->n.getValue();
         size_t ibegin = this->begin.getValue();
-        size_t global_zoom_end = global_zoom_begin+global_zoom_n-1;
-        size_t nZoomCount = 0;
         size_t nbIndex = index.numElements();
 
@@ -588,19 +628,18 @@
 
         // Calculate the compressed index if any
-        std::set<int> writtenInd;
-        if (isCompressible_)
-        {
-          for (int idx = 0; idx < data_index.numElements(); ++idx)
-          {
-            int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, ni);
-
-            if (ind >= 0 && ind < ni && mask(ind))
-            {
-              ind += ibegin;
-              if (ind >= global_zoom_begin && ind <= global_zoom_end)
-                writtenInd.insert(ind);
-            }
-          }
-        }
+//        std::set<int> writtenInd;
+//        if (isCompressible_)
+//        {
+//          for (int idx = 0; idx < data_index.numElements(); ++idx)
+//          {
+//            int ind = CDistributionClient::getAxisIndex(data_index(idx), data_begin, ni);
+//
+//            if (ind >= 0 && ind < ni && mask(ind))
+//            {
+//              ind += ibegin;
+//              writtenInd.insert(ind);
+//            }
+//          }
+//        }
 
         // Compute the global index of the current client (process) hold
@@ -635,5 +674,5 @@
 
         CServerDistributionDescription serverDescription(nGlobAxis, nbServer, distType);
-
+      
         std::vector<int> serverZeroIndex;
         serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t&,size_t&>(indexBegin, indexEnd), 0);
@@ -654,12 +693,8 @@
         if (distType==CServerDistributionDescription::ROOT_DISTRIBUTION)
         {
-          for(int i=1; i<nbServer; ++i) 
-          {
-            indSrv_[nbServer].insert(pair<int, vector<size_t> >(i,indSrv_[nbServer][0]) ) ;
-          }
-
+          for(int i=1; i<nbServer; ++i) indSrv_[nbServer].insert(pair<int, vector<size_t> >(i,indSrv_[nbServer][0]) ) ;
           serverZeroIndexLeader.clear() ;
         }
-
+         
         CClientServerMapping::GlobalIndexMap::const_iterator it  = indSrv_[nbServer].begin(),
                                                              ite = indSrv_[nbServer].end();
@@ -675,5 +710,5 @@
           connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize);
 
-         nbSenders[nbServer] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]);
+        nbSenders[nbServer] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]);
 
         delete clientServerMap;
@@ -681,4 +716,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -688,4 +724,5 @@
   */
   void CAxis::computeWrittenIndex()
+  TRY
   {  
     if (computedWrittenIndex_) return;
@@ -697,6 +734,6 @@
     // We describe the distribution of client (server) on which data are written
     std::vector<int> nBegin(1), nSize(1), nBeginGlobal(1), nGlob(1);
-    nBegin[0]       = zoom_begin;
-    nSize[0]        = zoom_n;   
+    nBegin[0]       = begin;
+    nSize[0]        = n;
     nBeginGlobal[0] = 0; 
     nGlob[0]        = n_glo;
@@ -711,56 +748,26 @@
     CArray<size_t,1>::const_iterator itSrvb = writtenGlobalIndex.begin(),
                                      itSrve = writtenGlobalIndex.end(), itSrv;  
-    if (!zoomByIndex())
-    {   
-      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
-      {
-        indGlo = *itSrv;
-        if (ite != globalLocalIndexMap_.find(indGlo))
-        {          
-          ++nbWritten;
-        }                 
-      }
-
-      localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements());
-//      localIndexToWriteOnServer.resize(nbWritten);
-
-      nbWritten = 0;
-      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
-      {
-        indGlo = *itSrv;
-        if (ite != globalLocalIndexMap_.find(indGlo))
-        {
-          localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo];
-          ++nbWritten;
-        }                 
-      }
-    }
-    else
-    {
-      nbWritten = 0;
-      std::unordered_map<size_t,size_t>::const_iterator itb = globalLocalIndexMap_.begin(),
-                                                          ite = globalLocalIndexMap_.end(), it;
-      for (int i = 0; i < zoom_index.numElements(); ++i)
-      {
-         if (ite != globalLocalIndexMap_.find(zoom_index(i)))
-          ++nbWritten;
-      }
-
-      localIndexToWriteOnServer.resize(nbWritten);
-
-      nbWritten = 0;
-      for (int i = 0; i < zoom_index.numElements(); ++i)
-      {
-         if (ite != globalLocalIndexMap_.find(zoom_index(i)))
-         {
-           localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[zoom_index(i)];
-           ++nbWritten;
-         }
-      }
-    }
-
-  }
+
+    localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements());
+    nbWritten = 0;
+    for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
+    {
+      indGlo = *itSrv;
+      if (ite != globalLocalIndexMap_.find(indGlo))
+      {
+        localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo];
+      }
+      else
+      {
+        localIndexToWriteOnServer(nbWritten) = -1;
+      }
+      ++nbWritten;
+    }
+
+  }
+  CATCH_DUMP_ATTR
 
   void CAxis::computeWrittenCompressedIndex(ep_lib::MPI_Comm writtenComm)
+  TRY
   {
     int writtenCommSize;
@@ -777,6 +784,6 @@
       // We describe the distribution of client (server) on which data are written
       std::vector<int> nBegin(1), nSize(1), nBeginGlobal(1), nGlob(1);
-      nBegin[0]       = zoom_begin;
-      nSize[0]        = zoom_n;   
+      nBegin[0]       = 0;
+      nSize[0]        = n;
       nBeginGlobal[0] = 0; 
       nGlob[0]        = n_glo;
@@ -798,4 +805,24 @@
         }                 
       }
+//
+//      nbWritten = 0;
+//      for (int idx = 0; idx < data_index.numElements(); ++idx)
+//      {
+//        if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_index(idx)))
+//        {
+//          ++nbWritten;
+//        }
+//      }
+//
+//      compressedIndexToWriteOnServer[writtenCommSize].resize(nbWritten);
+//      nbWritten = 0;
+//      for (int idx = 0; idx < data_index.numElements(); ++idx)
+//      {
+//        if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_index(idx)))
+//        {
+//          compressedIndexToWriteOnServer[writtenCommSize](nbWritten) = localGlobalIndexMap[data_index(idx)];
+//          ++nbWritten;
+//        }
+//      }
 
       nbWritten = 0;
@@ -823,6 +850,6 @@
       {
              
-        ep_lib::MPI_Allreduce(&numberWrittenIndexes_[writtenCommSize], &totalNumberWrittenIndexes_[writtenCommSize], 1, MPI_INT, MPI_SUM, writtenComm);
-        ep_lib::MPI_Scan(&numberWrittenIndexes_[writtenCommSize], &offsetWrittenIndexes_[writtenCommSize], 1, MPI_INT, MPI_SUM, writtenComm);
+        ep_lib::MPI_Allreduce(&numberWrittenIndexes_[writtenCommSize], &totalNumberWrittenIndexes_[writtenCommSize], 1, EP_INT, EP_SUM, writtenComm);
+        ep_lib::MPI_Scan(&numberWrittenIndexes_[writtenCommSize], &offsetWrittenIndexes_[writtenCommSize], 1, EP_INT, EP_SUM, writtenComm);
         offsetWrittenIndexes_[writtenCommSize] -= numberWrittenIndexes_[writtenCommSize];
       }
@@ -831,4 +858,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -841,4 +869,5 @@
   void CAxis::sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid,
                                         CServerDistributionDescription::ServerDistributionType distType)
+  TRY
   {
     std::list<CContextClient*>::iterator it;
@@ -865,10 +894,9 @@
           const int begin = serverIndexBegin[*itRank][orderPositionInGrid];
           const int ni    = serverDimensionSizes[*itRank][orderPositionInGrid];
-          const int end   = begin + ni - 1;          
 
           msgs.push_back(CMessage());
           CMessage& msg = msgs.back();
           msg << this->getId();
-          msg << ni << begin << end;          
+          msg << ni << begin;
           msg << isCompressible_;                    
 
@@ -880,4 +908,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -886,4 +915,5 @@
   */
   void CAxis::recvDistributionAttribute(CEventServer& event)
+  TRY
   {
     CBufferIn* buffer = event.subEvents.begin()->buffer;
@@ -892,4 +922,5 @@
     get(axisId)->recvDistributionAttribute(*buffer);
   }
+  CATCH
 
   /*
@@ -898,13 +929,8 @@
   */
   void CAxis::recvDistributionAttribute(CBufferIn& buffer)
-  {
-    int ni_srv, begin_srv, end_srv;
-    int global_zoom_end, zoom_end;
-    bool zoomIndex = zoomByIndex();
-    
-    std::vector<int> zoom_index_tmp;
-    std::vector<int>::iterator itZoomBegin, itZoomEnd, itZoom;
-
-    buffer >> ni_srv >> begin_srv >> end_srv;    
+  TRY
+  {
+    int ni_srv, begin_srv;
+    buffer >> ni_srv >> begin_srv;
     buffer >> isCompressible_;            
 
@@ -912,44 +938,6 @@
     n.setValue(ni_srv);
     begin.setValue(begin_srv);
-
-    // If we have zoom by index then process it
-    if (zoomIndex)
-    {
-      zoom_index_tmp.resize(global_zoom_index.numElements());
-      std::copy(global_zoom_index.begin(), global_zoom_index.end(), zoom_index_tmp.begin());
-      std::sort(zoom_index_tmp.begin(), zoom_index_tmp.end());
-      itZoomBegin = std::lower_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), begin_srv);
-      itZoomEnd   = std::upper_bound(zoom_index_tmp.begin(), zoom_index_tmp.end(), end_srv);      
-      int sz = std::distance(itZoomBegin, itZoomEnd);
-      zoom_index.resize(sz);
-      itZoom = itZoomBegin;
-      for (int i = 0; i < sz; ++i, ++itZoom)
-      {
-        zoom_index(i) = *(itZoom);
-      }
-    }
-
-    global_zoom_begin = zoomIndex ? 0 : global_zoom_begin ;
-    global_zoom_n     = zoomIndex ? zoom_index_tmp.size() : global_zoom_n;
-    global_zoom_end   = global_zoom_begin + global_zoom_n - 1;
-
-    zoom_begin = zoomIndex ? std::distance(zoom_index_tmp.begin(), itZoomBegin)
-                           : global_zoom_begin > begin_srv ? global_zoom_begin : begin_srv ;
-    zoom_end   = zoomIndex ? std::distance(zoom_index_tmp.begin(), itZoomEnd) - 1 
-                           : global_zoom_end < end_srv ? global_zoom_end : end_srv ;
-    zoom_n     = zoom_end - zoom_begin + 1;
-
-    if (zoom_n<=0)
-    {
-      zoom_n = 0; zoom_begin=global_zoom_begin; //0; zoom_begin = 0; 
-    }
-
-    if (n_glo == n)
-    {
-      zoom_begin = zoomIndex ? std::distance(itZoomBegin, zoom_index_tmp.begin())
-                             : global_zoom_begin;      
-      zoom_n     = zoomIndex ? zoom_index_tmp.size() : global_zoom_n;
-    }
-  }
+  }
+  CATCH_DUMP_ATTR
 
   /*
@@ -959,9 +947,10 @@
   */
   void CAxis::sendNonDistributedAttributes()
+  TRY
   {
     std::list<CContextClient*>::iterator it;
     for (it=clients.begin(); it!=clients.end(); ++it)
-    {
-      CContextClient* client = *it;
+	{
+	  CContextClient* client = *it;
 
       CEventClient event(getType(), EVENT_ID_NON_DISTRIBUTED_ATTRIBUTES);
@@ -1012,4 +1001,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -1018,4 +1008,5 @@
   */
   void CAxis::recvNonDistributedAttributes(CEventServer& event)
+  TRY
   {
     list<CEventServer::SSubEvent>::iterator it;
@@ -1028,4 +1019,5 @@
     }
   }
+  CATCH
 
   /*
@@ -1035,6 +1027,7 @@
   */
   void CAxis::recvNonDistributedAttributes(int rank, CBufferIn& buffer)
+  TRY
   { 
-    CArray<int,1> tmp_index, tmp_data_index, tmp_zoom_index;
+    CArray<int,1> tmp_index, tmp_data_index;
     CArray<bool,1> tmp_mask;
     CArray<double,1> tmp_val;
@@ -1076,13 +1069,15 @@
     for (int idx = 0; idx < index.numElements(); ++idx) globalLocalIndexMap_[index(idx)] = idx;
   }
+  CATCH_DUMP_ATTR
 
   /*
-    Send attributes of axis from a group of client to other group of clients/servers 
-    on supposing that these attributes are distributed among the clients of the sending group
-    In the future, if new attributes are added, they should also be processed in this function
+    Send axis attributes from a group of clients to another group of clients/servers
+    supposing that these attributes are distributed among the clients of the sending group
+    In future, if new attributes are added, they should also be processed in this function
   */
   void CAxis::sendDistributedAttributes(void)
-  {
-    int ns, n, i, j, ind, nv, idx;
+  TRY
+  {
+    int ind, idx;
     std::list<CContextClient*>::iterator it;
 
@@ -1095,10 +1090,10 @@
 
       list<CMessage> listData;
-      list<CArray<int,1> > list_indi, list_dataInd, list_zoomInd;
-      list<CArray<bool,1> > list_mask;
+      list<CArray<int,1> > list_indi, list_dataInd;
       list<CArray<double,1> > list_val;
       list<CArray<double,2> > list_bounds;
       list<CArray<string,1> > list_label;
 
+      // Cut off the ghost points
       int nbIndex = index.numElements();
       CArray<int,1> dataIndex(nbIndex);
@@ -1107,5 +1102,5 @@
       {
         if (0 <= data_index(idx) && data_index(idx) < nbIndex)
-          dataIndex(idx) = 1;
+          dataIndex(data_index(idx)) = 1;
       }
 
@@ -1114,5 +1109,5 @@
       for (int k = 0; k < connectedServerRank_[nbServer].size(); ++k)
       {
-        int nbData = 0;
+        int nbData = 0, nbDataCount = 0;
         int rank = connectedServerRank_[nbServer][k];
         it = indSrv_[nbServer].find(rank);
@@ -1121,6 +1116,5 @@
 
         list_indi.push_back(CArray<int,1>(nbData));
-        list_dataInd.push_back(CArray<int,1>(nbData));        
-        list_mask.push_back(CArray<bool,1>(nbData));
+        list_dataInd.push_back(CArray<int,1>(nbData));
 
         if (hasValue)
@@ -1134,8 +1128,8 @@
 
         CArray<int,1>& indi = list_indi.back();
-        CArray<int,1>& dataIndi = list_dataInd.back();        
-        CArray<bool,1>& maskIndi = list_mask.back();
-
-        for (n = 0; n < nbData; ++n)
+        CArray<int,1>& dataIndi = list_dataInd.back();
+        dataIndi = -1;
+
+        for (int n = 0; n < nbData; ++n)
         {
           idx = static_cast<int>(it->second[n]);
@@ -1144,5 +1138,4 @@
           ind = globalLocalIndexMap_[idx];
           dataIndi(n) = dataIndex(ind);
-          maskIndi(n) = mask(ind);
 
           if (hasValue)
@@ -1168,5 +1161,5 @@
         listData.push_back(CMessage());
         listData.back() << this->getId()
-                        << list_indi.back() << list_dataInd.back() << list_mask.back();
+                        << list_indi.back() << list_dataInd.back();
 
         listData.back() << hasValue;
@@ -1188,4 +1181,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -1194,4 +1188,5 @@
   */
   void CAxis::recvDistributedAttributes(CEventServer& event)
+  TRY
   {
     string axisId;
@@ -1209,4 +1204,5 @@
     get(axisId)->recvDistributedAttributes(ranks, buffers);
   }
+  CATCH
 
   /*
@@ -1216,8 +1212,8 @@
   */
   void CAxis::recvDistributedAttributes(vector<int>& ranks, vector<CBufferIn*> buffers)
+  TRY
   {
     int nbReceived = ranks.size(), idx, ind, gloInd, locInd;
-    vector<CArray<int,1> > vec_indi(nbReceived), vec_dataInd(nbReceived), vec_zoomInd(nbReceived);    
-    vector<CArray<bool,1> > vec_mask(nbReceived);
+    vector<CArray<int,1> > vec_indi(nbReceived), vec_dataInd(nbReceived);
     vector<CArray<double,1> > vec_val(nbReceived);
     vector<CArray<double,2> > vec_bounds(nbReceived);
@@ -1229,5 +1225,4 @@
       buffer >> vec_indi[idx];
       buffer >> vec_dataInd[idx];      
-      buffer >> vec_mask[idx];
 
       buffer >> hasValue;
@@ -1256,4 +1251,5 @@
     globalLocalIndexMap_.rehash(std::ceil(index.numElements()/globalLocalIndexMap_.max_load_factor()));
     nbIndexGlob = 0;
+    int nbIndLoc = 0;
     for (idx = 0; idx < nbReceived; ++idx)
     {
@@ -1262,8 +1258,9 @@
       {
          gloInd = tmp(ind);
+         nbIndLoc = (gloInd % n_glo)-begin;
          if (0 == globalLocalIndexMap_.count(gloInd))
          {
-           index(nbIndexGlob) = gloInd % n_glo;           
-           globalLocalIndexMap_[gloInd] = nbIndexGlob;  
+           index(nbIndexGlob) = gloInd % n_glo;
+           globalLocalIndexMap_[gloInd] = nbIndexGlob;
            ++nbIndexGlob;
          } 
@@ -1278,5 +1275,6 @@
     CArray<int,1> nonCompressedData(nbData);
     nonCompressedData = -1;   
-    mask.resize(nbData);
+    // Mask is incorporated into data_index and is not sent/received anymore
+    mask.resize(0);
     if (hasValue)
       value.resize(nbData);
@@ -1291,5 +1289,4 @@
       CArray<int,1>& indi = vec_indi[idx];
       CArray<int,1>& dataIndi = vec_dataInd[idx];
-      CArray<bool,1>& maskIndi = vec_mask[idx];
       int nb = indi.numElements();
       for (int n = 0; n < nb; ++n)
@@ -1299,7 +1296,4 @@
         nonCompressedData(locInd) = (-1 == nonCompressedData(locInd)) ? dataIndi(n) : nonCompressedData(locInd);
 
-        if (!mask(locInd)) // Only rewrite mask if it's not true
-          mask(locInd) = maskIndi(n);
-        
         if (hasValue)
           value(locInd) = vec_val[idx](n);
@@ -1316,9 +1310,9 @@
     }
     
-    int nbCompressedData = 0; 
+    int nbCompressedData = 0;
     for (idx = 0; idx < nonCompressedData.numElements(); ++idx)
     {
       if (0 <= nonCompressedData(idx))
-        ++nbCompressedData;        
+        ++nbCompressedData;
     }
 
@@ -1330,10 +1324,12 @@
       {
         data_index(nbCompressedData) = idx % n;
-        ++nbCompressedData;        
+        ++nbCompressedData;
       }
     }
 
     data_begin.setValue(0);
-  }
+    data_n.setValue(data_index.numElements());
+  }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -1345,4 +1341,5 @@
   */
   bool CAxis::isEqual(CAxis* obj)
+  TRY
   {
     vector<StdString> excludedAttr;
@@ -1368,4 +1365,5 @@
     return objEqual;
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -1375,8 +1373,10 @@
   */
   CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id)
+  TRY
   {
     transformationMap_.push_back(std::make_pair(transType, CTransformation<CAxis>::createTransformation(transType,id)));
     return transformationMap_.back().second;
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -1384,7 +1384,9 @@
   */
   bool CAxis::hasTransformation()
+  TRY
   {
     return (!transformationMap_.empty());
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -1393,7 +1395,9 @@
   */
   void CAxis::setTransformations(const TransMapTypes& axisTrans)
+  TRY
   {
     transformationMap_ = axisTrans;
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -1402,7 +1406,9 @@
   */
   CAxis::TransMapTypes CAxis::getAllTransformations(void)
+  TRY
   {
     return transformationMap_;
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -1411,4 +1417,5 @@
   */
   void CAxis::duplicateTransformation(CAxis* src)
+  TRY
   {
     if (src->hasTransformation())
@@ -1417,4 +1424,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -1422,4 +1430,5 @@
    */
   void CAxis::solveInheritanceTransformation()
+  TRY
   {
     if (hasTransformation() || !hasDirectAxisReference())
@@ -1438,6 +1447,8 @@
         refAxis[i]->setTransformations(axis->getAllTransformations());
   }
+  CATCH_DUMP_ATTR
 
   void CAxis::setContextClient(CContextClient* contextClient)
+  TRY
   {
     if (clientsSet.find(contextClient)==clientsSet.end())
@@ -1446,7 +1457,9 @@
       clientsSet.insert(contextClient);
     }
-}
+  }
+  CATCH_DUMP_ATTR
 
   void CAxis::parse(xml::CXMLNode & node)
+  TRY
   {
     SuperClass::parse(node);
@@ -1462,8 +1475,6 @@
 
         nodeElementName = node.getElementName();
-
-        if(transformationMapList_ptr == 0) initializeTransformationMap();
-        std::map<StdString, ETranformationType>::const_iterator ite = (*CAxis::transformationMapList_ptr).end(), it;
-        it = (*CAxis::transformationMapList_ptr).find(nodeElementName);
+        std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_.end(), it;
+        it = transformationMapList_.find(nodeElementName);
         if (ite != it)
         {
@@ -1481,4 +1492,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   DEFINE_REF_FUNC(Axis,axis)
Index: XIOS/dev/branch_openmp/src/node/axis.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/axis.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/axis.hpp	(revision 1642)
@@ -17,6 +17,4 @@
 #include "transformation_enum.hpp"
 
-#include "mpi_std.hpp"
-
 namespace xios {
    /// ////////////////////// DÃ©clarations ////////////////////// ///
@@ -31,5 +29,4 @@
    BEGIN_DECLARE_ATTRIBUTE_MAP(CAxis)
 #  include "axis_attribute.conf"
-#  include "axis_attribute_private.conf"
    END_DECLARE_ATTRIBUTE_MAP(CAxis)
 
@@ -123,14 +120,15 @@
          CTransformation<CAxis>* addTransformation(ETranformationType transType, const StdString& id="");
          bool isEqual(CAxis* axis);
-         bool zoomByIndex();
 
       public: 
         bool hasValue;        
-        CArray<size_t,1> localIndexToWriteOnServer;        
+        bool hasBounds;
+        bool hasLabel;
+
+        CArray<int,1> localIndexToWriteOnServer;
 
       private:
          void checkData();
          void checkMask();
-         void checkZoom();
          void checkBounds();
          void checkLabel();
@@ -175,15 +173,10 @@
          std::map<int, CArray<int, 1> > compressedIndexToWriteOnServer;
          std::map<int, std::vector<int> > connectedServerRank_;
-         bool hasBounds;
-         bool hasLabel;         
          bool computedWrittenIndex_;                  
 
        private:
          static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m);
-         static bool initializeTransformationMap();
-         static std::map<StdString, ETranformationType> *transformationMapList_ptr;
-         #pragma omp threadprivate(transformationMapList_ptr)
+         static std::map<StdString, ETranformationType> transformationMapList_;
          static bool dummyTransformationMapList_;
-         #pragma omp threadprivate(dummyTransformationMapList_)
 
          DECLARE_REF_FUNC(Axis,axis)
Index: XIOS/dev/branch_openmp/src/node/compute_connectivity_domain.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/compute_connectivity_domain.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/compute_connectivity_domain.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CComputeConnectivityDomain
 
Index: XIOS/dev/branch_openmp/src/node/context.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/context.cpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/context.cpp	(revision 1642)
@@ -21,9 +21,7 @@
 #include "distribute_file_server2.hpp"
 
-using namespace ep_lib;
-
 namespace xios {
 
-  std::shared_ptr<CContextGroup> * CContext::root_ptr = 0;
+  std::shared_ptr<CContextGroup> CContext::root;
 
    /// ////////////////////// DÃ©finitions ////////////////////// ///
@@ -35,4 +33,5 @@
       , idServer_(), client(0), server(0)
       , allProcessed(false), countChildCtx_(0)
+
    { /* Ne rien faire de plus */ }
 
@@ -67,8 +66,10 @@
    */
    CContextGroup* CContext::getRoot(void)
-   {
-      if(root_ptr == 0) root_ptr = new std::shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName()));
-      return root_ptr->get();
-   }
+   TRY
+   {
+      if (root.get()==NULL) root=std::shared_ptr<CContextGroup>(new CContextGroup(xml::CXMLNode::GetRootName()));
+      return root.get();
+   }
+   CATCH
 
    //----------------------------------------------------------------
@@ -79,7 +80,9 @@
    */
    std::shared_ptr<CCalendar> CContext::getCalendar(void) const
+   TRY
    {
       return (this->calendar);
    }
+   CATCH
 
    //----------------------------------------------------------------
@@ -90,7 +93,9 @@
    */
    void CContext::setCalendar(std::shared_ptr<CCalendar> newCalendar)
+   TRY
    {
       this->calendar = newCalendar;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -100,4 +105,5 @@
    */
    void CContext::parse(xml::CXMLNode & node)
+   TRY
    {
       CContext::SuperClass::parse(node);
@@ -154,8 +160,10 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
    //! Show tree structure of context
    void CContext::ShowTree(StdOStream & out)
+   TRY
    {
       StdString currentContextId = CContext::getCurrent() -> getId();
@@ -178,5 +186,5 @@
       CContext::setCurrent(currentContextId);
    }
-
+   CATCH
 
    //----------------------------------------------------------------
@@ -184,4 +192,5 @@
    //! Convert context object into string (to print)
    StdString CContext::toString(void) const
+   TRY
    {
       StdOStringStream oss;
@@ -203,9 +212,8 @@
 
       }
-
       oss << "</" << CContext::GetName() << " >";
-
       return (oss.str());
    }
+   CATCH
 
    //----------------------------------------------------------------
@@ -218,4 +226,5 @@
    */
    void CContext::solveDescInheritance(bool apply, const CAttributeMap * const UNUSED(parent))
+   TRY
    {
 #define DECLARE_NODE(Name_, name_)    \
@@ -225,4 +234,5 @@
 #include "node_type.conf"
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -230,4 +240,5 @@
    //! Verify if all root definition in the context have child.
    bool CContext::hasChild(void) const
+   TRY
    {
       return (
@@ -238,8 +249,10 @@
       false);
 }
+   CATCH
 
    //----------------------------------------------------------------
 
    void CContext::CleanTree(void)
+   TRY
    {
 #define DECLARE_NODE(Name_, name_) C##Name_##Definition::ClearAllAttributes();
@@ -247,8 +260,11 @@
 #include "node_type.conf"
    }
+   CATCH
+
    ///---------------------------------------------------------------
 
    //! Initialize client side
    void CContext::initClient(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtServer /*= 0*/)
+   TRY
    {
 
@@ -257,5 +273,6 @@
      
 
-     if (CServer::serverLevel != 1) // initClient is called by client
+     if (CServer::serverLevel != 1)
+      // initClient is called by client
      {
        client = new CContextClient(this, intraComm, interComm, cxtServer);
@@ -288,6 +305,6 @@
        server = new CContextServer(this, intraCommServer, interCommServer);
      }
-
-     else // initClient is called by primary server
+     else
+     // initClient is called by primary server
      {
        clientPrimServer.push_back(new CContextClient(this, intraComm, interComm));
@@ -299,4 +316,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -307,4 +325,5 @@
   */
    void CContext::setClientServerBuffer(CContextClient* contextClient, bool bufferForWriting)
+   TRY
    {
       // Estimated minimum event size for small events (10 is an arbitrary constant just for safety)
@@ -353,14 +372,17 @@
      }
      contextClient->setBufferSize(bufferSize, maxEventSize);
-
-   }
+   }
+   CATCH_DUMP_ATTR
 
    //! Verify whether a context is initialized
    bool CContext::isInitialized(void)
+   TRY
    {
      return hasClient;
    }
+   CATCH_DUMP_ATTR
 
    void CContext::initServer(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtClient /*= 0*/)
+   TRY
    {
      hasServer=true;
@@ -395,7 +417,9 @@
      client = new CContextClient(this,intraCommClient,interCommClient, cxtClient);
    }
+   CATCH_DUMP_ATTR
 
    //! Try to send the buffers and receive possible answers
   bool CContext::checkBuffersAndListen(bool enableEventsProcessing /*= true*/)
+  TRY
   {
     bool clientReady, serverFinished;
@@ -435,7 +459,9 @@
     }
   }
+   CATCH_DUMP_ATTR
 
    //! Terminate a context
    void CContext::finalize(void)
+   TRY
    {
       if (hasClient && !hasServer) // For now we only use server level 1 to read data
@@ -480,5 +506,4 @@
          comms.clear();
 
-         #pragma omp critical (_output)
          info(20)<<"CContext: Context <"<<getId()<<"> is finalized."<<endl;
        }
@@ -496,5 +521,4 @@
        {
          // Blocking send of context finalize message to its client (e.g. primary server or model)
-         #pragma omp critical (_output)
          info(100)<<"DEBUG: context "<<getId()<<" Send client finalize<<"<<endl ;
          client->finalize();
@@ -524,5 +548,4 @@
          comms.clear();
 
-         #pragma omp critical (_output)
          info(20)<<"CContext: Context <"<<getId()<<"> is finalized."<<endl;
        }
@@ -531,7 +554,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Free internally allocated communicators
    void CContext::freeComms(void)
+   TRY
    {
      for (std::list<ep_lib::MPI_Comm>::iterator it = comms.begin(); it != comms.end(); ++it)
@@ -539,7 +564,9 @@
      comms.clear();
    }
+   CATCH_DUMP_ATTR
 
    //! Deallocate buffers allocated by clientContexts
    void CContext::releaseClientBuffers(void)
+   TRY
    {
      client->releaseBuffers();
@@ -547,6 +574,8 @@
        clientPrimServer[i]->releaseBuffers();
    }
+   CATCH_DUMP_ATTR
 
    void CContext::postProcessingGlobalAttributes()
+   TRY
    {
      if (allProcessed) return;  
@@ -612,6 +641,8 @@
      allProcessed = true;
    }
+   CATCH_DUMP_ATTR
 
    void CContext::sendPostProcessingGlobalAttributes()
+   TRY
    {
       // Use correct context client to send message
@@ -638,6 +669,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CContext::recvPostProcessingGlobalAttributes(CEventServer& event)
+   TRY
    {
       CBufferIn* buffer=event.subEvents.begin()->buffer;
@@ -646,9 +679,12 @@
       get(id)->recvPostProcessingGlobalAttributes(*buffer);
    }
+   CATCH
 
    void CContext::recvPostProcessingGlobalAttributes(CBufferIn& buffer)
+   TRY
    {      
       postProcessingGlobalAttributes();
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -661,5 +697,7 @@
    and the active fields (fields will be written onto active files)
    */
+
    void CContext::closeDefinition(void)
+   TRY
    {
     CTimer::get("Context : close definition").resume() ;
@@ -692,18 +730,24 @@
     CTimer::get("Context : close definition").suspend() ;
    }
+   CATCH_DUMP_ATTR
 
    void CContext::findAllEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   TRY
    {
      for (unsigned int i = 0; i < activeFiles.size(); i++)
      (void)activeFiles[i]->getEnabledFields();
    }
+   CATCH_DUMP_ATTR
 
    void CContext::readAttributesOfEnabledFieldsInReadModeFiles()
+   TRY
    {
       for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i)
         (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode();
    }
+   CATCH_DUMP_ATTR
 
    void CContext::sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   TRY
    {
      int size = activeFiles.size();
@@ -713,4 +757,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -719,4 +764,5 @@
    */
    void CContext::sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   TRY
    {
      int size = activeFiles.size();
@@ -726,6 +772,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CContext::checkGridEnabledFields()
+   TRY
    {
      int size = enabledFiles.size();
@@ -735,4 +783,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -741,4 +790,5 @@
    */
    void CContext::checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   TRY
    {
      int size = activeFiles.size();
@@ -748,4 +798,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
     /*!
@@ -755,4 +806,5 @@
    */
    void CContext::solveOnlyRefOfEnabledFields(bool sendToServer)
+   TRY
    {
      int size = this->enabledFiles.size();
@@ -767,4 +819,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
     /*!
@@ -775,4 +828,5 @@
    */
    void CContext::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer)
+   TRY
    {
      int size = this->enabledFiles.size();
@@ -782,6 +836,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CContext::buildFilterGraphOfEnabledFields()
+   TRY
    {
      int size = this->enabledFiles.size();
@@ -791,6 +847,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CContext::postProcessFilterGraph()
+   TRY
    {
      int size = enabledFiles.size();
@@ -800,6 +858,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CContext::startPrefetchingOfEnabledReadModeFiles()
+   TRY
    {
      int size = enabledReadModeFiles.size();
@@ -809,6 +869,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CContext::doPreTimestepOperationsForEnabledReadModeFiles()
+   TRY
    {
      int size = enabledReadModeFiles.size();
@@ -818,6 +880,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CContext::doPostTimestepOperationsForEnabledReadModeFiles()
+   TRY
    {
      int size = enabledReadModeFiles.size();
@@ -827,6 +891,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
   void CContext::findFieldsWithReadAccess(void)
+  TRY
   {
     fieldsWithReadAccess.clear();
@@ -842,18 +908,24 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   void CContext::solveAllRefOfFieldsWithReadAccess()
+  TRY
   {
     for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i)
       fieldsWithReadAccess[i]->solveAllReferenceEnabledField(false);
   }
+  CATCH_DUMP_ATTR
 
   void CContext::buildFilterGraphOfFieldsWithReadAccess()
+  TRY
   {
     for (size_t i = 0; i < fieldsWithReadAccess.size(); ++i)
       fieldsWithReadAccess[i]->buildFilterGraph(garbageCollector, true);
   }
+  CATCH_DUMP_ATTR
 
    void CContext::solveAllInheritance(bool apply)
+   TRY
    {
      // RÃ©solution des hÃ©ritages descendants (cÃ d des hÃ©ritages de groupes)
@@ -878,6 +950,8 @@
 
    }
+  CATCH_DUMP_ATTR
 
    void CContext::findEnabledFiles(void)
+   TRY
    {
       const std::vector<CFile*> allFiles = CFile::getAll();
@@ -928,6 +1002,8 @@
 
    }
+   CATCH_DUMP_ATTR
 
    void CContext::distributeFiles(void)
+   TRY
    {
      bool distFileMemory=false ;
@@ -937,7 +1013,8 @@
      else distributeFileOverBandwith() ;
    }
-
+   CATCH_DUMP_ATTR
 
    void CContext::distributeFileOverBandwith(void)
+   TRY
    {
      double eps=std::numeric_limits<double>::epsilon()*10 ;
@@ -1006,10 +1083,6 @@
        }
 
-       for (std::multimap<double,int>:: iterator it=poolDataSize.begin() ; it!=poolDataSize.end(); ++it)
-       {
-         #pragma omp critical (_output)
-         info(30)<<"Load Balancing for servers (perfect=1) : "<<it->second<<" :  ratio "<<it->first*1./dataPerPool<<endl ;
-       }
-
+       for (std::multimap<double,int>:: iterator it=poolDataSize.begin() ; it!=poolDataSize.end(); ++it) info(30)<<"Load Balancing for servers (perfect=1) : "<<it->second<<" :  ratio "<<it->first*1./dataPerPool<<endl ;
+ 
        for (int i = 0; i < this->enabledReadModeFiles.size(); ++i)
        {
@@ -1023,6 +1096,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CContext::distributeFileOverMemoryBandwith(void)
+   TRY
    {
      // If primary server
@@ -1099,14 +1174,7 @@
        }
 
-       for (int i = 0; i < nbPools; ++i)
-       {
-         #pragma omp critical (_output)
-         info(100)<<"Pool server level2 "<<i<<"   assigned file bandwith "<<bandwithSize[i]*86400.*4./1024/1024.<<" Mb / days"<<endl ;
-       }
-       for (int i = 0; i < nbPools; ++i)
-       {
-         #pragma omp critical (_output)
-         info(100)<<"Pool server level2 "<<i<<"   assigned grid memory "<<memorySize[i]*100/1024./1024.<<" Mb"<<endl ;
-       }
+       for (int i = 0; i < nbPools; ++i) info(100)<<"Pool server level2 "<<i<<"   assigned file bandwith "<<bandwithSize[i]*86400.*4./1024/1024.<<" Mb / days"<<endl ;
+       for (int i = 0; i < nbPools; ++i) info(100)<<"Pool server level2 "<<i<<"   assigned grid memory "<<memorySize[i]*100/1024./1024.<<" Mb"<<endl ;
+
 
        for (int i = 0; i < this->enabledReadModeFiles.size(); ++i)
@@ -1122,6 +1190,5 @@
    }
 }
-
-
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1129,4 +1196,5 @@
    */
    void CContext::findEnabledWriteModeFiles(void)
+   TRY
    {
      int size = this->enabledFiles.size();
@@ -1138,4 +1206,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1143,4 +1212,5 @@
    */
    void CContext::findEnabledReadModeFiles(void)
+   TRY
    {
      int size = this->enabledFiles.size();
@@ -1151,6 +1221,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CContext::closeAllFile(void)
+   TRY
    {
      std::vector<CFile*>::const_iterator
@@ -1159,9 +1231,9 @@
      for (; it != end; it++)
      {
-       #pragma omp critical (_output)
        info(30)<<"Closing File : "<<(*it)->getId()<<endl;
        (*it)->close();
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1173,4 +1245,5 @@
    */
    bool CContext::dispatchEvent(CEventServer& event)
+   TRY
    {
 
@@ -1214,7 +1287,9 @@
       }
    }
+   CATCH
 
    //! Client side: Send a message to server to make it close
    void CContext::sendCloseDefinition(void)
+   TRY
    {
      // Use correct context client to send message
@@ -1239,7 +1314,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Server side: Receive a message of client announcing a context close
    void CContext::recvCloseDefinition(CEventServer& event)
+   TRY
    {
       CBufferIn* buffer=event.subEvents.begin()->buffer;
@@ -1248,7 +1325,9 @@
       get(id)->closeDefinition();
    }
+   CATCH
 
    //! Client side: Send a message to update calendar in each time step
    void CContext::sendUpdateCalendar(int step)
+   TRY
    {
      // Use correct context client to send message
@@ -1274,7 +1353,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Server side: Receive a message of client annoucing calendar update
    void CContext::recvUpdateCalendar(CEventServer& event)
+   TRY
    {
       CBufferIn* buffer=event.subEvents.begin()->buffer;
@@ -1283,7 +1364,9 @@
       get(id)->recvUpdateCalendar(*buffer);
    }
+   CATCH
 
    //! Server side: Receive a message of client annoucing calendar update
    void CContext::recvUpdateCalendar(CBufferIn& buffer)
+   TRY
    {
       int step;
@@ -1295,7 +1378,9 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //! Client side: Send a message to create header part of netcdf file
    void CContext::sendCreateFileHeader(void)
+   TRY
    {
      // Use correct context client to send message
@@ -1322,7 +1407,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Server side: Receive a message of client annoucing the creation of header part of netcdf file
    void CContext::recvCreateFileHeader(CEventServer& event)
+   TRY
    {
       CBufferIn* buffer=event.subEvents.begin()->buffer;
@@ -1331,14 +1418,18 @@
       get(id)->recvCreateFileHeader(*buffer);
    }
+   CATCH
 
    //! Server side: Receive a message of client annoucing the creation of header part of netcdf file
    void CContext::recvCreateFileHeader(CBufferIn& buffer)
+   TRY
    {
       if (!hasClient && hasServer) 
         createFileHeader();
    }
+   CATCH_DUMP_ATTR
 
    //! Client side: Send a message to do some post processing on server
    void CContext::sendProcessingGridOfEnabledFields()
+   TRY
    {
       // Use correct context client to send message
@@ -1364,7 +1455,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Server side: Receive a message to do some post processing
    void CContext::recvProcessingGridOfEnabledFields(CEventServer& event)
+   TRY
    {
       CBufferIn* buffer=event.subEvents.begin()->buffer;
@@ -1372,7 +1465,9 @@
       *buffer>>id;      
    }
+   CATCH
 
    //! Client side: Send a message to do some post processing on server
    void CContext::sendPostProcessing()
+   TRY
    {
       // Use correct context client to send message
@@ -1398,7 +1493,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Server side: Receive a message to do some post processing
    void CContext::recvPostProcessing(CEventServer& event)
+   TRY
    {
       CBufferIn* buffer=event.subEvents.begin()->buffer;
@@ -1407,13 +1504,17 @@
       get(id)->recvPostProcessing(*buffer);
    }
+   CATCH
 
    //! Server side: Receive a message to do some post processing
    void CContext::recvPostProcessing(CBufferIn& buffer)
+   TRY
    {
       CCalendarWrapper::get(CCalendarWrapper::GetDefName())->createCalendar();
       postProcessing();
    }
+   CATCH_DUMP_ATTR
 
    const StdString& CContext::getIdServer()
+   TRY
    {
       if (hasClient)
@@ -1425,6 +1526,8 @@
       if (hasServer) return (this->getId());
    }
+   CATCH_DUMP_ATTR
 
    const StdString& CContext::getIdServer(const int i)
+   TRY
    {
      idServer_ = this->getId();
@@ -1433,5 +1536,5 @@
      return idServer_;
    }
-
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1442,4 +1545,5 @@
    */
    void CContext::postProcessing()
+   TRY
    {
      if (isPostProcessed) return;
@@ -1504,4 +1608,5 @@
       isPostProcessed = true;
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1514,4 +1619,5 @@
    std::map<int, StdSize> CContext::getAttributesBufferSize(std::map<int, StdSize>& maxEventSize,
                                                            CContextClient* contextClient, bool bufferForWriting /*= "false"*/)
+   TRY
    {
 	 // As calendar attributes are sent even if there are no active files or fields, maps are initialized according the size of calendar attributes
@@ -1545,4 +1651,5 @@
      return attributesSize;
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1555,4 +1662,5 @@
    std::map<int, StdSize> CContext::getDataBufferSize(std::map<int, StdSize>& maxEventSize,
                                                       CContextClient* contextClient, bool bufferForWriting /*= "false"*/)
+   TRY
    {
      std::map<int, StdSize> dataSize;
@@ -1563,5 +1671,4 @@
      for (size_t i = 0; i < numEnabledFiles; ++i)
      {
-//       CFile* file = this->enabledFiles[i];
        CFile* file = fileList[i];
        if (file->getContextClient() == contextClient)
@@ -1591,7 +1698,9 @@
      return dataSize;
    }
+   CATCH_DUMP_ATTR
 
    //! Client side: Send infomation of active files (files are enabled to write out)
    void CContext::sendEnabledFiles(const std::vector<CFile*>& activeFiles)
+   TRY
    {
      int size = activeFiles.size();
@@ -1611,7 +1720,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Client side: Send information of active fields (ones are written onto files)
    void CContext::sendEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)
+   TRY
    {
      int size = activeFiles.size();
@@ -1621,7 +1732,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Client side: Check if the defined axis, domains and grids are eligible for compressed indexed output
    void CContext::checkAxisDomainsGridsEligibilityForCompressedOutput()
+   TRY
    {
      if (!hasClient) return;
@@ -1639,7 +1752,9 @@
        (*it)->checkEligibilityForCompressedOutput();
    }
+   CATCH_DUMP_ATTR
 
    //! Client side: Prepare the timeseries by adding the necessary files
    void CContext::prepareTimeseries()
+   TRY
    {
      if (!hasClient) return;
@@ -1739,7 +1854,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Client side: Send information of reference grid of active fields
    void CContext::sendRefGrid(const std::vector<CFile*>& activeFiles)
+   TRY
    {
      std::set<StdString> gridIds;
@@ -1773,7 +1890,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Client side: Send information of reference domain, axis and scalar of active fields
    void CContext::sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles)
+   TRY
    {
      std::set<StdString> domainIds, axisIds, scalarIds;
@@ -1834,7 +1953,9 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //! Update calendar in each time step
    void CContext::updateCalendar(int step)
+   TRY
    {
       int prevStep = calendar->getStep();
@@ -1847,11 +1968,8 @@
         }
 
-        #pragma omp critical (_output)
         info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl;
         calendar->update(step);
-        #pragma omp critical (_output)
         info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl;
   #ifdef XIOS_MEMTRACK_LIGHT
-        #pragma omp critical (_output)
         info(50) << " Current memory used by XIOS : "<<  MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ;
   #endif
@@ -1864,14 +1982,13 @@
       }
       else if (prevStep == step)
-      {
-        #pragma omp critical (_output)
         info(50) << "updateCalendar: already at step " << step << ", no operation done." << endl;
-      }
       else // if (prevStep > step)
         ERROR("void CContext::updateCalendar(int step)",
               << "Illegal calendar update: previous step was " << prevStep << ", new step " << step << "is in the past!")
    }
+   CATCH_DUMP_ATTR
 
    void CContext::initReadFiles(void)
+   TRY
    {
       vector<CFile*>::const_iterator it;
@@ -1882,7 +1999,9 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //! Server side: Create header of netcdf file
    void CContext::createFileHeader(void)
+   TRY
    {
       vector<CFile*>::const_iterator it;
@@ -1894,10 +2013,13 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //! Get current context
    CContext* CContext::getCurrent(void)
+   TRY
    {
      return CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()).get();
    }
+   CATCH
 
    /*!
@@ -1906,8 +2028,10 @@
    */
    void CContext::setCurrent(const string& id)
+   TRY
    {
      CObjectFactory::SetCurrentContextId(id);
      CGroupFactory::SetCurrentContextId(id);
    }
+   CATCH
 
   /*!
@@ -1917,4 +2041,5 @@
   */
   CContext* CContext::create(const StdString& id)
+  TRY
   {
     CContext::setCurrent(id);
@@ -1923,5 +2048,5 @@
     CContext* context = CObjectFactory::CreateObject<CContext>(id).get();
     getRoot();
-    if (!hasctxt) CGroupFactory::AddChild(*root_ptr, context->getShared());
+    if (!hasctxt) CGroupFactory::AddChild(root, context->getShared());
 
 #define DECLARE_NODE(Name_, name_) \
@@ -1932,8 +2057,9 @@
     return (context);
   }
-
+  CATCH
 
      //! Server side: Receive a message to do some post processing
   void CContext::recvRegistry(CEventServer& event)
+  TRY
   {
     CBufferIn* buffer=event.subEvents.begin()->buffer;
@@ -1942,6 +2068,8 @@
     get(id)->recvRegistry(*buffer);
   }
+  CATCH
 
   void CContext::recvRegistry(CBufferIn& buffer)
+  TRY
   {
     if (server->intraCommRank==0)
@@ -1952,6 +2080,8 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   void CContext::sendRegistry(void)
+  TRY
   {
     registryOut->hierarchicalGatherRegistry() ;
@@ -1979,4 +2109,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -1985,7 +2116,23 @@
   */
   bool CContext::isFinalized(void)
+  TRY
   {
     return finalized;
   }
+  CATCH_DUMP_ATTR
+  ///--------------------------------------------------------------
+  StdString CContext::dumpClassAttributes(void)
+  {
+    StdString str;
+    str.append("enabled files=\"");
+    int size = this->enabledFiles.size();
+    for (int i = 0; i < size; ++i)
+    {
+      str.append(enabledFiles[i]->getId());
+      str.append(" ");
+    }
+    str.append("\"");
+    return str;
+  }
 
 } // namespace xios
Index: XIOS/dev/branch_openmp/src/node/context.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/context.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/context.hpp	(revision 1642)
@@ -5,5 +5,4 @@
 #include "xios_spl.hpp"
 //#include "node_type.hpp"
-#include "mpi_std.hpp"
 #include "calendar_wrapper.hpp"
 
@@ -12,4 +11,5 @@
 #include "garbage_collector.hpp"
 #include "registry.hpp"
+#include "mpi.hpp"
 
 
@@ -91,4 +91,6 @@
          void initServer(ep_lib::MPI_Comm intraComm, ep_lib::MPI_Comm interComm, CContext* cxtClient = 0);
          bool isInitialized(void);
+
+         StdString dumpClassAttributes(void);
 
          // Put sever or client into loop state
@@ -143,5 +145,4 @@
          void distributeFileOverMemoryBandwith() ;
          
-
          // Send context close definition
          void sendCloseDefinition(void);
@@ -239,6 +240,5 @@
 
          // Context root
-         static std::shared_ptr<CContextGroup> *root_ptr;
-         #pragma omp threadprivate(root_ptr)
+         static std::shared_ptr<CContextGroup> root;
 
          // Determine context on client or not
Index: XIOS/dev/branch_openmp/src/node/domain.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/domain.cpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/domain.cpp	(revision 1642)
@@ -19,6 +19,4 @@
 #include "client_server_mapping_distributed.hpp"
 
-using namespace ep_lib;
-
 #include <algorithm>
 
@@ -32,8 +30,9 @@
       , hasBounds(false), hasArea(false), isCompressible_(false), isUnstructed_(false)
       , isClientAfterTransformationChecked(false), hasLonLat(false)
-      , isRedistributed_(false), hasPole(false), doZoomByIndex_(false)
+      , isRedistributed_(false), hasPole(false)
       , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue()
       , globalLocalIndexMap_(), computedWrittenIndex_(false)
-	  , clients()
+      , clients(), hasLatInReadFile_(false), hasBoundsLatInReadFile_(false)
+      , hasLonInReadFile_(false), hasBoundsLonInReadFile_(false)
    {
    }
@@ -44,8 +43,9 @@
       , hasBounds(false), hasArea(false), isCompressible_(false), isUnstructed_(false)
       , isClientAfterTransformationChecked(false), hasLonLat(false)
-      , isRedistributed_(false), hasPole(false), doZoomByIndex_(false)
+      , isRedistributed_(false), hasPole(false)
       , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue()
       , globalLocalIndexMap_(), computedWrittenIndex_(false)
-	  , clients()
+      , clients(), hasLatInReadFile_(false), hasBoundsLatInReadFile_(false)
+      , hasLonInReadFile_(false), hasBoundsLonInReadFile_(false)
    {
     }
@@ -58,17 +58,23 @@
 
    void CDomain::assignMesh(const StdString meshName, const int nvertex)
+   TRY
    {
      mesh = CMesh::getMesh(meshName, nvertex);
    }
+   CATCH_DUMP_ATTR
 
    CDomain* CDomain::createDomain()
+   TRY
    {
      CDomain* domain = CDomainGroup::get("domain_definition")->createChild();
      return domain;
    }
-
-   std::map<StdString, ETranformationType> *CDomain::transformationMapList_ptr = 0;
+   CATCH
+
+   std::map<StdString, ETranformationType> CDomain::transformationMapList_ = std::map<StdString, ETranformationType>();
+   bool CDomain::_dummyTransformationMapList = CDomain::initializeTransformationMap(CDomain::transformationMapList_);
 
    bool CDomain::initializeTransformationMap(std::map<StdString, ETranformationType>& m)
+   TRY
    {
      m["zoom_domain"] = TRANS_ZOOM_DOMAIN;
@@ -78,22 +84,14 @@
      m["expand_domain"] = TRANS_EXPAND_DOMAIN;
      m["reorder_domain"] = TRANS_REORDER_DOMAIN;
-   }
-
-   bool CDomain::initializeTransformationMap()
-   {
-     CDomain::transformationMapList_ptr = new std::map<StdString, ETranformationType>();
-     (*CDomain::transformationMapList_ptr)["zoom_domain"] = TRANS_ZOOM_DOMAIN;
-     (*CDomain::transformationMapList_ptr)["interpolate_domain"] = TRANS_INTERPOLATE_DOMAIN;
-     (*CDomain::transformationMapList_ptr)["generate_rectilinear_domain"] = TRANS_GENERATE_RECTILINEAR_DOMAIN;
-     (*CDomain::transformationMapList_ptr)["compute_connectivity_domain"] = TRANS_COMPUTE_CONNECTIVITY_DOMAIN;
-     (*CDomain::transformationMapList_ptr)["expand_domain"] = TRANS_EXPAND_DOMAIN;
-     (*CDomain::transformationMapList_ptr)["reorder_domain"] = TRANS_REORDER_DOMAIN;
-   }
+     m["extract_domain"] = TRANS_EXTRACT_DOMAIN;
+   }
+   CATCH
 
    const std::set<StdString> & CDomain::getRelFiles(void) const
+   TRY
    {
       return (this->relFiles);
    }
-
+   CATCH
 
    /*!
@@ -102,4 +100,5 @@
    */
    int CDomain::getNumberWrittenIndexes(ep_lib::MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -107,4 +106,5 @@
      return numberWrittenIndexes_[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -113,4 +113,5 @@
    */
    int CDomain::getTotalNumberWrittenIndexes(ep_lib::MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -118,4 +119,5 @@
      return totalNumberWrittenIndexes_[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -124,4 +126,5 @@
    */
    int CDomain::getOffsetWrittenIndexes(ep_lib::MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -129,6 +132,8 @@
      return offsetWrittenIndexes_[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    CArray<int, 1>& CDomain::getCompressedIndexToWriteOnServer(ep_lib::MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -136,4 +141,5 @@
      return compressedIndexToWriteOnServer[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -145,4 +151,5 @@
     */
    std::map<int, StdSize> CDomain::getAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= false*/)
+   TRY
    {
 
@@ -172,10 +179,4 @@
        // size estimation for sendIndex (and sendArea which is always smaller or equal)
        size_t sizeIndexEvent = 2 * sizeof(size_t) + 2 * CArray<int,1>::size(idxCount);
-       // if (isCompressible_)
-       // {
-       //   std::map<int, std::vector<int> >::const_iterator itWritten = indWrittenSrv_.find(rank);
-       //   size_t writtenIdxCount = (itWritten != itWrittenIndexEnd) ? itWritten->second.size() : 0;
-       //   sizeIndexEvent += CArray<int,1>::size(writtenIdxCount);
-       // }
 
        // size estimation for sendLonLat
@@ -191,28 +192,35 @@
      return attributesSizes;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    bool CDomain::isEmpty(void) const
-   {
-      return ((this->zoom_i_index.isEmpty()) || (0 == this->zoom_i_index.numElements()));
-
-   }
+   TRY
+   {
+     return ((this->i_index.isEmpty()) || (0 == this->i_index.numElements()));
+   }
+   CATCH
 
    //----------------------------------------------------------------
 
    bool CDomain::IsWritten(const StdString & filename) const
+   TRY
    {
       return (this->relFiles.find(filename) != this->relFiles.end());
    }
+   CATCH
 
    bool CDomain::isWrittenCompressed(const StdString& filename) const
+   TRY
    {
       return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end());
    }
+   CATCH
 
    //----------------------------------------------------------------
 
    bool CDomain::isDistributed(void) const
+   TRY
    {
       bool distributed =  !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) ||
@@ -222,4 +230,5 @@
       return distributed;
    }
+   CATCH
 
    //----------------------------------------------------------------
@@ -231,17 +240,23 @@
     */
    bool CDomain::isCompressible(void) const
+   TRY
    {
       return isCompressible_;
    }
+   CATCH
 
    void CDomain::addRelFile(const StdString & filename)
+   TRY
    {
       this->relFiles.insert(filename);
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::addRelFileCompressed(const StdString& filename)
+   TRY
    {
       this->relFilesCompressed.insert(filename);
    }
+   CATCH_DUMP_ATTR
 
    StdString CDomain::GetName(void)   { return (StdString("domain")); }
@@ -256,4 +271,5 @@
    */
    bool CDomain::distributionAttributesHaveValue() const
+   TRY
    {
       bool hasValues = true;
@@ -267,4 +283,5 @@
       return hasValues;
    }
+   CATCH
 
    /*!
@@ -276,4 +293,5 @@
    */
    void CDomain::redistribute(int nbLocalDomain)
+   TRY
    {
      if (this->isRedistributed_) return;
@@ -438,4 +456,5 @@
      checkDomain();
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -443,4 +462,5 @@
    */
    void CDomain::fillInLonLat()
+   TRY
    {
      switch (type)
@@ -460,6 +480,6 @@
      }
      completeLonLatClient() ;
-
-   }
+   }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -469,6 +489,7 @@
    */
    void CDomain::fillInRectilinearLonLat()
-   {
-     if (!lonvalue_rectilinear_read_from_file.isEmpty())
+   TRY
+   {
+     if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty())
      {
        lonvalue_1d.resize(ni);
@@ -478,5 +499,5 @@
        lon_end.setValue(lonvalue_rectilinear_read_from_file(ni_glo-1));
      }
-     else
+     else if (!hasLonInReadFile_)
      {
        if (!lonvalue_2d.isEmpty()) lonvalue_2d.free();
@@ -504,5 +525,5 @@
 
 
-     if (!latvalue_rectilinear_read_from_file.isEmpty())
+     if (!latvalue_rectilinear_read_from_file.isEmpty() && latvalue_2d.isEmpty() && latvalue_1d.isEmpty())
      {
        latvalue_1d.resize(nj);
@@ -512,5 +533,5 @@
        lat_end.setValue(latvalue_rectilinear_read_from_file(nj_glo-1));
      }
-     else
+     else if (!hasLatInReadFile_)
      {
        if (!latvalue_2d.isEmpty()) latvalue_1d.free();
@@ -537,12 +558,14 @@
      }
    }
+   CATCH_DUMP_ATTR
 
     /*
-      Fill in longitude and latitude of curvilinear domain read from a file
-      If there are already longitude and latitude defined by model. We just igonore reading value.
+      Fill in 2D longitude and latitude of curvilinear domain read from a file.
+      If there are already longitude and latitude defined by model. We just ignore read value.
     */
    void CDomain::fillInCurvilinearLonLat()
-   {
-     if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty())
+   TRY
+   {
+     if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty())
      {
        lonvalue_2d.resize(ni,nj);
@@ -554,5 +577,5 @@
      }
 
-     if (!latvalue_curvilinear_read_from_file.isEmpty() && latvalue_2d.isEmpty())
+     if (!latvalue_curvilinear_read_from_file.isEmpty() && latvalue_2d.isEmpty() && latvalue_1d.isEmpty())
      {
        latvalue_2d.resize(ni,nj);
@@ -564,5 +587,5 @@
      }
 
-     if (!bounds_lonvalue_curvilinear_read_from_file.isEmpty() && bounds_lon_2d.isEmpty())
+     if (!bounds_lonvalue_curvilinear_read_from_file.isEmpty() && bounds_lon_2d.isEmpty() && bounds_lon_1d.isEmpty())
      {
        bounds_lon_2d.resize(nvertex,ni,nj);
@@ -575,5 +598,5 @@
      }
 
-     if (!bounds_latvalue_curvilinear_read_from_file.isEmpty() && bounds_lat_2d.isEmpty())
+     if (!bounds_latvalue_curvilinear_read_from_file.isEmpty() && bounds_lat_2d.isEmpty() && bounds_lat_1d.isEmpty())
      {
        bounds_lat_2d.resize(nvertex,ni,nj);
@@ -585,6 +608,6 @@
        bounds_latvalue_curvilinear_read_from_file.free();
      }
-
-   }
+   }
+   CATCH_DUMP_ATTR
 
     /*
@@ -593,4 +616,5 @@
     */
    void CDomain::fillInUnstructuredLonLat()
+   TRY
    {
      if (i_index.isEmpty())
@@ -644,4 +668,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
   /*
@@ -649,4 +674,5 @@
   */
    void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g)
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -664,14 +690,14 @@
      int v ;
      v=ibegin ;
-     ep_lib::MPI_Allgather(&v,1,MPI_INT,ibegin_g,1,MPI_INT,client->intraComm) ;
+     ep_lib::MPI_Allgather(&v,1,EP_INT,ibegin_g,1,EP_INT,client->intraComm) ;
      v=jbegin ;
-     ep_lib::MPI_Allgather(&v,1,MPI_INT,jbegin_g,1,MPI_INT,client->intraComm) ;
+     ep_lib::MPI_Allgather(&v,1,EP_INT,jbegin_g,1,EP_INT,client->intraComm) ;
      v=ni ;
-     ep_lib::MPI_Allgather(&v,1,MPI_INT,ni_g,1,MPI_INT,client->intraComm) ;
+     ep_lib::MPI_Allgather(&v,1,EP_INT,ni_g,1,EP_INT,client->intraComm) ;
      v=nj ;
-     ep_lib::MPI_Allgather(&v,1,MPI_INT,nj_g,1,MPI_INT,client->intraComm) ;
-
-     ep_lib::MPI_Allgatherv(lon.dataFirst(),ni,MPI_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,MPI_DOUBLE,client->intraComm) ;
-     ep_lib::MPI_Allgatherv(lat.dataFirst(),nj,MPI_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,MPI_DOUBLE,client->intraComm) ;
+     ep_lib::MPI_Allgather(&v,1,EP_INT,nj_g,1,EP_INT,client->intraComm) ;
+
+     ep_lib::MPI_Allgatherv(lon.dataFirst(),ni,EP_DOUBLE,lon_g.dataFirst(),ni_g, ibegin_g,EP_DOUBLE,client->intraComm) ;
+     ep_lib::MPI_Allgatherv(lat.dataFirst(),nj,EP_DOUBLE,lat_g.dataFirst(),nj_g, jbegin_g,EP_DOUBLE,client->intraComm) ;
 
       delete[] ibegin_g ;
@@ -680,8 +706,10 @@
       delete[] nj_g ;
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat,
                                               CArray<double,2>& boundsLon, CArray<double,2>& boundsLat)
-   {
+   TRY
+  {
      int i,j,k;
 
@@ -782,4 +810,5 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    /*
@@ -787,4 +816,5 @@
    */
    void CDomain::checkDomain(void)
+   TRY
    {
      if (type.isEmpty())
@@ -877,31 +907,10 @@
          for (int i = 0; i < ni; ++i) j_index(i+j*ni) = j+jbegin;
      }
-     
-     checkZoom();
-   }
-
-   // Check global zoom of a domain
-   // If there is no zoom defined for the domain, zoom will have value of global doamin
-   void CDomain::checkZoom(void)
-   {
-     if (global_zoom_ibegin.isEmpty())
-      global_zoom_ibegin.setValue(0);
-     if (global_zoom_ni.isEmpty())
-      global_zoom_ni.setValue(ni_glo);
-     if (global_zoom_jbegin.isEmpty())
-      global_zoom_jbegin.setValue(0);
-     if (global_zoom_nj.isEmpty())
-      global_zoom_nj.setValue(nj_glo);
-    if (zoom_i_index.isEmpty()) zoom_i_index.setValue(i_index.getValue());
-    if (zoom_j_index.isEmpty()) zoom_j_index.setValue(j_index.getValue());
-    if (zoom_ibegin.isEmpty()) zoom_ibegin.setValue(ibegin);
-    if (zoom_ni.isEmpty()) zoom_ni.setValue(ni);
-    if (zoom_jbegin.isEmpty()) zoom_jbegin.setValue(jbegin);
-    if (zoom_nj.isEmpty()) zoom_nj.setValue(nj);
-   }
+   }
+   CATCH_DUMP_ATTR
 
    size_t CDomain::getGlobalWrittenSize(void)
    {
-      return global_zoom_ni*global_zoom_nj ;
+     return ni_glo*nj_glo ;
    }
    //----------------------------------------------------------------
@@ -909,4 +918,5 @@
    // Check validity of local domain on using the combination of 3 parameters: ibegin, ni and i_index
    void CDomain::checkLocalIDomain(void)
+   TRY
    {
       // If ibegin and ni are provided then we use them to check the validity of local domain
@@ -967,7 +977,9 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    // Check validity of local domain on using the combination of 3 parameters: jbegin, nj and j_index
    void CDomain::checkLocalJDomain(void)
+   TRY
    {
     // If jbegin and nj are provided then we use them to check the validity of local domain
@@ -1018,8 +1030,10 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    void CDomain::checkMask(void)
+   TRY
    {
       if (!mask_1d.isEmpty() && !mask_2d.isEmpty())
@@ -1067,8 +1081,10 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    void CDomain::checkDomainData(void)
+   TRY
    {
       if (data_dim.isEmpty())
@@ -1110,9 +1126,12 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    void CDomain::checkCompression(void)
-   {
+   TRY
+   {
+     int i,j,ind;
       if (!data_i_index.isEmpty())
       {
@@ -1135,4 +1154,23 @@
                    << "'data_j_index' must be defined when 'data_i_index' is set and 'data_dim' is 2.");
           }
+          for (int k=0; k<data_i_index.numElements(); ++k)
+          {
+            i = data_i_index(k)+data_ibegin ;
+            j = data_j_index(k)+data_jbegin ;
+            if (i>=0 && i<ni && j>=0 && j<nj)
+            {
+              ind=j*ni+i ;
+              if (!domainMask(ind))
+              {
+                data_i_index(k) = -1;
+                data_j_index(k) = -1;
+              }
+            }
+            else
+            {
+              data_i_index(k) = -1;
+              data_j_index(k) = -1;
+            }
+          }
         }
         else // (1 == data_dim)
@@ -1141,5 +1179,17 @@
           {
             data_j_index.resize(data_ni);
-            for (int j = 0; j < data_ni; ++j) data_j_index(j) = 0;
+            data_j_index = 0;
+          }
+          for (int k=0; k<data_i_index.numElements(); ++k)
+          {
+            i=data_i_index(k)+data_ibegin ;
+            if (i>=0 && i < domainMask.size())
+            {
+              if (!domainMask(i)) data_i_index(k) = -1;
+            }
+            else
+              data_i_index(k) = -1;
+
+            if (!domainMask(i)) data_i_index(k) = -1;
           }
         }
@@ -1156,9 +1206,18 @@
           data_i_index.resize(data_ni);
           data_j_index.resize(data_ni);
-
-          for (int i = 0; i < data_ni; ++i)
+          data_j_index = 0;
+
+          for (int k = 0; k < data_ni; ++k)
           {
-            data_i_index(i) = i;
-            data_j_index(i) = 0;
+            i=k+data_ibegin ;
+            if (i>=0 && i < domainMask.size())
+            {
+              if (domainMask(i))
+                data_i_index(k) = k;
+              else
+                data_i_index(k) = -1;
+            }
+            else
+              data_i_index(k) = -1;
           }
         }
@@ -1169,10 +1228,29 @@
           data_j_index.resize(dsize);
 
-          for(int count = 0, j = 0; j < data_nj; ++j)
+          for(int count = 0, kj = 0; kj < data_nj; ++kj)
           {
-            for(int i = 0; i < data_ni; ++i, ++count)
+            for(int ki = 0; ki < data_ni; ++ki, ++count)
             {
-              data_i_index(count) = i;
-              data_j_index(count) = j;
+              i = ki + data_ibegin;
+              j = kj + data_jbegin;
+              ind=j*ni+i ;
+              if (i>=0 && i<ni && j>=0 && j<nj)
+              {
+                if (domainMask(ind))
+                {
+                  data_i_index(count) = ki;
+                  data_j_index(count) = kj;
+                }
+                else
+                {
+                  data_i_index(count) = -1;
+                  data_j_index(count) = -1;
+                }
+              }
+              else
+              {
+                data_i_index(count) = -1;
+                data_j_index(count) = -1;
+              }
             }
           }
@@ -1180,7 +1258,9 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
    void CDomain::computeLocalMask(void)
+   TRY
    {
      localMask.resize(i_index.numElements()) ;
@@ -1214,21 +1294,27 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::checkEligibilityForCompressedOutput(void)
+   TRY
    {
      // We don't check if the mask or the indexes are valid here, just if they have been defined at this point.
      isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !data_i_index.isEmpty();
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    /*
-     Fill in longitude and latitude value from clients (or models) into internal values lonvalue, latvalue which
-     will be used by XIOS.
+     Fill in longitude, latitude, bounds, and area into internal values (lonvalue, latvalue, bounds_lonvalue, bounds_latvalue, areavalue)
+     which will be used by XIOS.
    */
    void CDomain::completeLonLatClient(void)
+   TRY
    {
      bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());
      checkBounds() ;
+     checkArea() ;
+
      if (!lonvalue_2d.isEmpty() && !lonlatValueExisted)
      {
@@ -1325,5 +1411,19 @@
        }
      }
-   }
+
+     if (!area.isEmpty() && areavalue.isEmpty())
+     {
+        areavalue.resize(ni*nj);
+       for (int j = 0; j < nj; ++j)
+       {
+         for (int i = 0; i < ni; ++i)
+         {
+           int k = j * ni + i;
+           areavalue(k) = area(i,j);
+         }
+       }
+     }
+   }
+   CATCH_DUMP_ATTR
 
    /*
@@ -1331,4 +1431,5 @@
    */
    void CDomain::convertLonLatValue(void)
+   TRY
    {
      bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());
@@ -1428,7 +1529,8 @@
      }
    }
-
+   CATCH_DUMP_ATTR
 
    void CDomain::checkBounds(void)
+   TRY
    {
      bool hasBoundValues = (0 != bounds_lonvalue.numElements()) || (0 != bounds_latvalue.numElements());
@@ -1467,5 +1569,5 @@
                << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
                << "'bounds_lon_1d' dimension is not compatible with 'nvertex'." << std::endl
-               << "'bounds_lon_1d' dimension is " << bounds_lon_1d.extent(1)
+               << "'bounds_lon_1d' dimension is " << bounds_lon_1d.extent(0)
                << " but nvertex is " << nvertex.getValue() << ".");
 
@@ -1474,5 +1576,5 @@
                << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
                << "'bounds_lon_2d' dimension is not compatible with 'nvertex'." << std::endl
-               << "'bounds_lon_2d' dimension is " << bounds_lon_2d.extent(2)
+               << "'bounds_lon_2d' dimension is " << bounds_lon_2d.extent(0)
                << " but nvertex is " << nvertex.getValue() << ".");
 
@@ -1491,5 +1593,5 @@
                << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
                << "'bounds_lat_1d' dimension is not compatible with 'nvertex'." << std::endl
-               << "'bounds_lat_1d' dimension is " << bounds_lat_1d.extent(1)
+               << "'bounds_lat_1d' dimension is " << bounds_lat_1d.extent(0)
                << " but nvertex is " << nvertex.getValue() << ".");
 
@@ -1498,5 +1600,5 @@
                << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] "
                << "'bounds_lat_2d' dimension is not compatible with 'nvertex'." << std::endl
-               << "'bounds_lat_2d' dimension is " << bounds_lat_2d.extent(2)
+               << "'bounds_lat_2d' dimension is " << bounds_lat_2d.extent(0)
                << " but nvertex is " << nvertex.getValue() << ".");
 
@@ -1522,6 +1624,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::checkArea(void)
+   TRY
    {
      bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements());
@@ -1537,20 +1641,22 @@
                << "Area size is " << area.extent(0) << " x " << area.extent(1) << ".");
        }
-       if (areavalue.isEmpty())
-       {
-          areavalue.resize(ni*nj);
-         for (int j = 0; j < nj; ++j)
-         {
-           for (int i = 0; i < ni; ++i)
-           {
-             int k = j * ni + i;
-             areavalue(k) = area(i,j);
-           }
-         }
-       }
-     }
-   }
+//       if (areavalue.isEmpty())
+//       {
+//          areavalue.resize(ni*nj);
+//         for (int j = 0; j < nj; ++j)
+//         {
+//           for (int i = 0; i < ni; ++i)
+//           {
+//             int k = j * ni + i;
+//             areavalue(k) = area(i,j);
+//           }
+//         }
+//       }
+     }
+   }
+   CATCH_DUMP_ATTR
 
    void CDomain::checkLonLat()
+   TRY
    {
      if (!hasLonLat) hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) ||
@@ -1612,6 +1718,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::checkAttributesOnClientAfterTransformation()
+   TRY
    {
      CContext* context=CContext::getCurrent() ;
@@ -1628,4 +1736,5 @@
      this->isClientAfterTransformationChecked = true;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -1633,4 +1742,5 @@
    // This function only checks all attributes of current domain
    void CDomain::checkAttributesOnClient()
+   TRY
    {
      if (this->isClientChecked) return;
@@ -1658,7 +1768,9 @@
       this->isClientChecked = true;
    }
+   CATCH_DUMP_ATTR
 
    // Send all checked attributes to server
    void CDomain::sendCheckedAttributes()
+   TRY
    {
      if (!this->isClientChecked) checkAttributesOnClient();
@@ -1673,6 +1785,8 @@
      this->isChecked = true;
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::checkAttributes(void)
+   TRY
    {
       if (this->isChecked) return;
@@ -1704,4 +1818,5 @@
       this->isChecked = true;
    }
+   CATCH_DUMP_ATTR
 
   /*!
@@ -1712,4 +1827,5 @@
   */
   void CDomain::computeConnectedClients()
+  TRY
   {
     CContext* context=CContext::getCurrent() ;
@@ -1734,155 +1850,110 @@
         if (indSrv_.find(nbServer) == indSrv_.end())
         {
-          int i,j,i_ind,j_ind, nbIndex, nbIndexZoom;
-          int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1;
-          int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1;
-
-           // Precompute number of index
-           int globalIndexCountZoom = 0;
-           nbIndex = i_index.numElements();
-
-           if (doZoomByIndex_)
-           {
-             globalIndexCountZoom = zoom_i_index.numElements();
-           }
-           else
-           {
-             for (i = 0; i < nbIndex; ++i)
-             {
-               i_ind=i_index(i);
-               j_ind=j_index(i);
-
-               if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-               {
-                  ++globalIndexCountZoom;
-               }
-             }
-           }
-
-           // Fill in index
-           CArray<size_t,1> globalIndexDomainZoom(globalIndexCountZoom);
-           CArray<size_t,1> localIndexDomainZoom(globalIndexCountZoom);
-           CArray<size_t,1> globalIndexDomain(nbIndex);
-           size_t globalIndex;
-           int globalIndexCount = 0;
-
-           for (i = 0; i < nbIndex; ++i)
-           {
-             i_ind=i_index(i);
-             j_ind=j_index(i);
-             globalIndex = i_ind + j_ind * ni_glo;
-             globalIndexDomain(i) = globalIndex;
-           }
-
-           if (globalLocalIndexMap_.empty())
-           {
-             for (i = 0; i < nbIndex; ++i)
-               globalLocalIndexMap_[globalIndexDomain(i)] = i;
-           }
-
-           globalIndexCountZoom = 0;
-           if (doZoomByIndex_)
-           {
-             int nbIndexZoom = zoom_i_index.numElements();
-
-             for (i = 0; i < nbIndexZoom; ++i)
-             {
-               i_ind=zoom_i_index(i);
-               j_ind=zoom_j_index(i);
-               globalIndex = i_ind + j_ind * ni_glo;
-               globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
-               ++globalIndexCountZoom;
-             }
-           }
-           else
-           {
-             int global_zoom_iend=global_zoom_ibegin+global_zoom_ni-1;
-             int global_zoom_jend=global_zoom_jbegin+global_zoom_nj-1;
-             for (i = 0; i < nbIndex; ++i)
-             {
-               i_ind=i_index(i);
-               j_ind=j_index(i);
-               globalIndex = i_ind + j_ind * ni_glo;
-               if (i_ind >= global_zoom_ibegin && i_ind <= global_zoom_iend && j_ind >= global_zoom_jbegin && j_ind <= global_zoom_jend)
-               {
-                  globalIndexDomainZoom(globalIndexCountZoom) = globalIndex;
-                  ++globalIndexCountZoom;
-               }
-             }
-
-             int iend = ibegin + ni -1;
-             int jend = jbegin + nj -1;
-             zoom_ibegin = global_zoom_ibegin > ibegin ? global_zoom_ibegin.getValue() : ibegin;
-             int zoom_iend  = global_zoom_iend < iend ? zoom_iend : iend ;
-             zoom_ni     = zoom_iend-zoom_ibegin+1 ;
-
-             zoom_jbegin = global_zoom_jbegin > jbegin ? global_zoom_jbegin.getValue() : jbegin ;
-             int zoom_jend   = global_zoom_jend < jend ? zoom_jend : jend;
-             zoom_nj     = zoom_jend-zoom_jbegin+1;
-           }
-
-           size_t globalSizeIndex = 1, indexBegin, indexEnd;
-           int range, clientSize = client->clientSize;
-           std::vector<int> nGlobDomain(2);
-           nGlobDomain[0] = this->ni_glo;
-           nGlobDomain[1] = this->nj_glo;
-           for (int i = 0; i < nGlobDomain.size(); ++i) globalSizeIndex *= nGlobDomain[i];
-           indexBegin = 0;
-           if (globalSizeIndex <= clientSize)
-           {
-             indexBegin = rank%globalSizeIndex;
-             indexEnd = indexBegin;
-           }
-           else
-           {
-             for (int i = 0; i < clientSize; ++i)
-             {
-               range = globalSizeIndex / clientSize;
-               if (i < (globalSizeIndex%clientSize)) ++range;
-               if (i == client->clientRank) break;
-               indexBegin += range;
-             }
-             indexEnd = indexBegin + range - 1;
-           }
-
-           // Even if servers have no index, they must received something from client
-           // We only use several client to send "empty" message to these servers
-           CServerDistributionDescription serverDescription(nGlobDomain, nbServer);
-           std::vector<int> serverZeroIndex;
-           if (isUnstructed_) serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t&,size_t&>(indexBegin, indexEnd), 0);
-           else serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t&,size_t&>(indexBegin, indexEnd), 1);
-
-           std::list<int> serverZeroIndexLeader;
-           std::list<int> serverZeroIndexNotLeader;
-           CContextClient::computeLeader(client->clientRank, client->clientSize, serverZeroIndex.size(), serverZeroIndexLeader, serverZeroIndexNotLeader);
-           for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
-              *it = serverZeroIndex[*it];
-
-           CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(),
-                 client->intraComm);
-           clientServerMap->computeServerIndexMapping(globalIndexDomain, nbServer);
-           CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer();
-
-           CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
+          int i,j,i_ind,j_ind, nbIndex=i_index.numElements();
+          int globalIndexCount = i_index.numElements();
+          // Fill in index
+          CArray<size_t,1> globalIndexDomain(nbIndex);
+          size_t globalIndex;
+
+          for (i = 0; i < nbIndex; ++i)
+          {
+            i_ind=i_index(i);
+            j_ind=j_index(i);
+            globalIndex = i_ind + j_ind * ni_glo;
+            globalIndexDomain(i) = globalIndex;
+          }
+
+          if (globalLocalIndexMap_.empty())
+          {
+            for (i = 0; i < nbIndex; ++i)
+              globalLocalIndexMap_[globalIndexDomain(i)] = i;
+          }
+
+          size_t globalSizeIndex = 1, indexBegin, indexEnd;
+          int range, clientSize = client->clientSize;
+          std::vector<int> nGlobDomain(2);
+          nGlobDomain[0] = this->ni_glo;
+          nGlobDomain[1] = this->nj_glo;
+          for (int i = 0; i < nGlobDomain.size(); ++i) globalSizeIndex *= nGlobDomain[i];
+          indexBegin = 0;
+          if (globalSizeIndex <= clientSize)
+          {
+            indexBegin = rank%globalSizeIndex;
+            indexEnd = indexBegin;
+          }
+          else
+          {
+            for (int i = 0; i < clientSize; ++i)
+            {
+              range = globalSizeIndex / clientSize;
+              if (i < (globalSizeIndex%clientSize)) ++range;
+              if (i == client->clientRank) break;
+              indexBegin += range;
+            }
+            indexEnd = indexBegin + range - 1;
+          }
+
+          // Even if servers have no index, they must received something from client
+          // We only use several client to send "empty" message to these servers
+          CServerDistributionDescription serverDescription(nGlobDomain, nbServer);
+          std::vector<int> serverZeroIndex;
+          if (isUnstructed_) serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t&,size_t&>(indexBegin, indexEnd), 0);
+          else serverZeroIndex = serverDescription.computeServerGlobalIndexInRange(std::make_pair<size_t&,size_t&>(indexBegin, indexEnd), 1);
+
+          std::list<int> serverZeroIndexLeader;
+          std::list<int> serverZeroIndexNotLeader;
+          CContextClient::computeLeader(client->clientRank, client->clientSize, serverZeroIndex.size(), serverZeroIndexLeader, serverZeroIndexNotLeader);
+          for (std::list<int>::iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+            *it = serverZeroIndex[*it];
+
+          CClientServerMapping* clientServerMap = new CClientServerMappingDistributed(serverDescription.getGlobalIndexRange(), client->intraComm);
+          clientServerMap->computeServerIndexMapping(globalIndexDomain, nbServer);
+          CClientServerMapping::GlobalIndexMap& globalIndexDomainOnServer = clientServerMap->getGlobalIndexOnServer();
+
+          CClientServerMapping::GlobalIndexMap::const_iterator it  = globalIndexDomainOnServer.begin(),
                  ite = globalIndexDomainOnServer.end();
-           indSrv_[nbServer].swap(globalIndexDomainOnServer);
-           connectedServerRank_[nbServer].clear();
-           for (it = indSrv_[nbServer].begin(); it != ite; ++it)
-             connectedServerRank_[nbServer].push_back(it->first);
-
-           for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
-              connectedServerRank_[nbServer].push_back(*it);
-
-           // Even if a client has no index, it must connect to at least one server and
-           // send an "empty" data to this server
-           if (connectedServerRank_[nbServer].empty())
-              connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize);
-
-           nbSenders[nbServer] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]);
-           delete clientServerMap;
+          indSrv_[nbServer].swap(globalIndexDomainOnServer);
+          connectedServerRank_[nbServer].clear();
+          for (it = indSrv_[nbServer].begin(); it != ite; ++it)
+            connectedServerRank_[nbServer].push_back(it->first);
+
+          for (std::list<int>::const_iterator it = serverZeroIndexLeader.begin(); it != serverZeroIndexLeader.end(); ++it)
+            connectedServerRank_[nbServer].push_back(*it);
+
+          // Even if a client has no index, it must connect to at least one server and
+          // send an "empty" data to this server
+          if (connectedServerRank_[nbServer].empty())
+            connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize);
+
+          // Now check if all servers have data to receive. If not, master client will send empty data.
+          // This ensures that all servers will participate in collective calls upon receiving even if they have no date to receive.
+          std::vector<int> counts (clientSize);
+          std::vector<int> displs (clientSize);
+          displs[0] = 0;
+          int localCount = connectedServerRank_[nbServer].size() ;
+          ep_lib::MPI_Gather(&localCount, 1, EP_INT, &counts[0], 1, EP_INT, 0, client->intraComm) ;
+          for (int i = 0; i < clientSize-1; ++i)
+          {
+            displs[i+1] = displs[i] + counts[i];
+          }
+          std::vector<int> allConnectedServers(displs[clientSize-1]+counts[clientSize-1]);
+          ep_lib::MPI_Gatherv(&(connectedServerRank_[nbServer])[0], localCount, EP_INT, &allConnectedServers[0], &counts[0], &displs[0], EP_INT, 0, client->intraComm);
+
+          if ((allConnectedServers.size() != nbServer) && (rank == 0))
+          {
+            std::vector<bool> isSrvConnected (nbServer, false);
+            for (int i = 0; i < allConnectedServers.size(); ++i) isSrvConnected[allConnectedServers[i]] = true;
+            for (int i = 0; i < nbServer; ++i)
+            {
+              if (!isSrvConnected[i]) connectedServerRank_[nbServer].push_back(i);
+            }
+          }
+          nbSenders[nbServer] = clientServerMap->computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]);
+          delete clientServerMap;
         }
       }
     }
   }
+  CATCH_DUMP_ATTR
 
    /*!
@@ -1892,4 +1963,5 @@
    */
    void CDomain::computeWrittenIndex()
+   TRY
    {  
       if (computedWrittenIndex_) return;
@@ -1900,6 +1972,6 @@
 
       std::vector<int> nBegin(2), nSize(2), nBeginGlobal(2), nGlob(2);
-      nBegin[0]       = zoom_ibegin;  nBegin[1] = zoom_jbegin;
-      nSize[0]        = zoom_ni;      nSize[1]  = zoom_nj;
+      nBegin[0]       = ibegin;  nBegin[1] = jbegin;
+      nSize[0]        = ni;      nSize[1]  = nj;
       nBeginGlobal[0] = 0; nBeginGlobal[1] = 0;
       nGlob[0]        = ni_glo;   nGlob[1] = nj_glo;
@@ -1913,16 +1985,5 @@
                                        itSrve = writtenGlobalIndex.end(), itSrv;
 
-//      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
-//      {
-//        indGlo = *itSrv;
-//        if (ite != globalLocalIndexMap_.find(indGlo))
-//        {
-//          ++nbWritten;
-//        }
-//      }
-
-//      localIndexToWriteOnServer.resize(nbWritten);
       localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements());
-
       nbWritten = 0;
       for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)
@@ -1932,15 +1993,16 @@
         {
           localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo];
-          ++nbWritten;
         }
         else
         {
-          localIndexToWriteOnServer(nbWritten) = 0;
-          ++nbWritten;
-        }
-      }
-   }
+          localIndexToWriteOnServer(nbWritten) = -1;
+        }
+        ++nbWritten;
+      }
+   }
+   CATCH_DUMP_ATTR
 
   void CDomain::computeWrittenCompressedIndex(ep_lib::MPI_Comm writtenComm)
+  TRY
   {
     int writtenCommSize;
@@ -1956,6 +2018,6 @@
 
       std::vector<int> nBegin(2), nSize(2), nBeginGlobal(2), nGlob(2);
-      nBegin[0]       = zoom_ibegin;  nBegin[1] = zoom_jbegin;
-      nSize[0]        = zoom_ni;      nSize[1]  = zoom_nj;
+      nBegin[0]       = ibegin;  nBegin[1] = jbegin;
+      nSize[0]        = ni;      nSize[1]  = nj;
       nBeginGlobal[0] = 0; nBeginGlobal[1] = 0;
       nGlob[0]        = ni_glo;   nGlob[1] = nj_glo;
@@ -2002,6 +2064,6 @@
       {
              
-        ep_lib::MPI_Allreduce(&numberWrittenIndexes_[writtenCommSize], &totalNumberWrittenIndexes_[writtenCommSize], 1, MPI_INT, MPI_SUM, writtenComm);
-        ep_lib::MPI_Scan(&numberWrittenIndexes_[writtenCommSize], &offsetWrittenIndexes_[writtenCommSize], 1, MPI_INT, MPI_SUM, writtenComm);
+        ep_lib::MPI_Allreduce(&numberWrittenIndexes_[writtenCommSize], &totalNumberWrittenIndexes_[writtenCommSize], 1, EP_INT, EP_SUM, writtenComm);
+        ep_lib::MPI_Scan(&numberWrittenIndexes_[writtenCommSize], &offsetWrittenIndexes_[writtenCommSize], 1, EP_INT, EP_SUM, writtenComm);
         offsetWrittenIndexes_[writtenCommSize] -= numberWrittenIndexes_[writtenCommSize];
       }
@@ -2010,4 +2072,5 @@
       }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2016,18 +2079,18 @@
   */
   void CDomain::sendAttributes()
+  TRY
   {
     sendDistributionAttributes();
     sendIndex();       
-    sendMask();
     sendLonLat();
     sendArea();    
     sendDataIndex();
   }
-
+  CATCH
   /*!
-    Send global index and zoom index from client to connected client(s)
-    zoom index can be smaller than global index
+    Send global index from client to connected client(s)
   */
   void CDomain::sendIndex()
+  TRY
   {
     int ns, n, i, j, ind, nv, idx;
@@ -2041,5 +2104,5 @@
 
       list<CMessage> list_msgsIndex;
-      list<CArray<int,1> > list_indZoom, list_writtenInd, list_indGlob;
+      list<CArray<int,1> > list_indGlob;
 
       std::unordered_map<int, vector<size_t> >::const_iterator itIndex, iteIndex;
@@ -2072,4 +2135,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2079,4 +2143,5 @@
   */
   void CDomain::sendDistributionAttributes(void)
+  TRY
   {
     std::list<CContextClient*>::iterator it;
@@ -2115,5 +2180,5 @@
           msg << isUnstructed_;
           msg << ni_srv << ibegin_srv << nj_srv << jbegin_srv;
-          msg << global_zoom_ni.getValue() << global_zoom_ibegin.getValue() << global_zoom_nj.getValue() << global_zoom_jbegin.getValue();        
+          msg << ni_glo.getValue() << nj_glo.getValue();
           msg << isCompressible_;
 
@@ -2125,48 +2190,5 @@
     }
   }
-
-  /*!
-    Send mask index from client to connected(s) clients    
-  */
-  void CDomain::sendMask()
-  {
-    int ns, n, i, j, ind, nv, idx;
-    std::list<CContextClient*>::iterator it;
-    for (it=clients.begin(); it!=clients.end(); ++it)
-    {
-      CContextClient* client = *it;
-      int serverSize = client->serverSize;
-
-      // send area for each connected server
-      CEventClient eventMask(getType(), EVENT_ID_MASK);
-
-      list<CMessage> list_msgsMask;
-      list<CArray<bool,1> > list_mask;
-
-      std::unordered_map<int, vector<size_t> >::const_iterator it, iteMap;
-      iteMap = indSrv_[serverSize].end();
-      for (int k = 0; k < connectedServerRank_[serverSize].size(); ++k)
-      {
-        int nbData = 0;
-        int rank = connectedServerRank_[serverSize][k];
-        it = indSrv_[serverSize].find(rank);
-        if (iteMap != it)
-          nbData = it->second.size();
-        list_mask.push_back(CArray<bool,1>(nbData));
-
-        const std::vector<size_t>& temp = it->second;
-        for (n = 0; n < nbData; ++n)
-        {
-          idx = static_cast<int>(it->second[n]);
-          list_mask.back()(n) = domainMask(globalLocalIndexMap_[idx]);
-        }
-
-        list_msgsMask.push_back(CMessage());
-        list_msgsMask.back() << this->getId() << list_mask.back();
-        eventMask.push(rank, nbSenders[serverSize][rank], list_msgsMask.back());
-      }
-      client->sendEvent(eventMask);
-    }
-  }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2174,4 +2196,5 @@
   */
   void CDomain::sendArea()
+  TRY
   {
     if (!hasArea) return;
@@ -2217,4 +2240,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2224,4 +2248,5 @@
   */
   void CDomain::sendLonLat()
+  TRY
   {
     if (!hasLonLat) return;
@@ -2312,4 +2337,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2320,4 +2346,5 @@
   */
   void CDomain::sendDataIndex()
+  TRY
   {
     int ns, n, i, j, ind, nv, idx;
@@ -2388,6 +2415,8 @@
     }
   }
+  CATCH
   
   bool CDomain::dispatchEvent(CEventServer& event)
+  TRY
   {
     if (SuperClass::dispatchEvent(event)) return true;
@@ -2402,8 +2431,4 @@
         case EVENT_ID_INDEX:
           recvIndex(event);
-          return true;
-          break;
-        case EVENT_ID_MASK:
-          recvMask(event);
           return true;
           break;
@@ -2431,4 +2456,5 @@
     }
   }
+  CATCH
 
   /*!
@@ -2437,4 +2463,5 @@
   */
   void CDomain::recvIndex(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2450,4 +2477,5 @@
     get(domainId)->recvIndex(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2457,4 +2485,5 @@
   */
   void CDomain::recvIndex(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, type_int, iIndex, jIndex;
@@ -2495,15 +2524,8 @@
            jIndex = (jIndex < 0) ? 0 : jIndex;
            nbIndLoc = iIndex + ni * jIndex;
-           if (nbIndLoc < nbIndexGlobMax)
-           {
-             i_index(nbIndLoc) = index % ni_glo;
-             j_index(nbIndLoc) = index / ni_glo;
-             globalLocalIndexMap_[index] = nbIndLoc;  
-             ++nbIndGlob;
-           }
-           // i_index(nbIndGlob) = index % ni_glo;
-           // j_index(nbIndGlob) = index / ni_glo;
-           // globalLocalIndexMap_[index] = nbIndGlob;  
-           // ++nbIndGlob;
+           i_index(nbIndGlob) = index % ni_glo;
+           j_index(nbIndGlob) = index / ni_glo;
+           globalLocalIndexMap_[index] = nbIndGlob;
+           ++nbIndGlob;
          } 
       } 
@@ -2520,5 +2542,8 @@
       j_index.resizeAndPreserve(nbIndGlob);
     }
+
+    domainMask.resize(0); // Mask is not defined anymore on servers
   }
+  CATCH
 
   /*!
@@ -2527,4 +2552,5 @@
   */
   void CDomain::recvDistributionAttributes(CEventServer& event)
+  TRY
   {
     CBufferIn* buffer=event.subEvents.begin()->buffer;
@@ -2533,117 +2559,29 @@
     get(domainId)->recvDistributionAttributes(*buffer);
   }
+  CATCH
 
   /*!
-    Receive attributes from client(s): zoom info and begin and n of each server
+    Receive attributes from client(s)
     \param[in] rank rank of client source
     \param[in] buffer message containing attributes info
   */
   void CDomain::recvDistributionAttributes(CBufferIn& buffer)
+  TRY
   {
     int ni_tmp, ibegin_tmp, nj_tmp, jbegin_tmp;
-    int global_zoom_ni_tmp, global_zoom_ibegin_tmp, global_zoom_nj_tmp, global_zoom_jbegin_tmp;
+    int ni_glo_tmp, nj_glo_tmp;
     buffer >> isUnstructed_ >> ni_tmp >> ibegin_tmp >> nj_tmp >> jbegin_tmp
-           >> global_zoom_ni_tmp >> global_zoom_ibegin_tmp >> global_zoom_nj_tmp >> global_zoom_jbegin_tmp           
+           >> ni_glo_tmp >> nj_glo_tmp
            >> isCompressible_;
+
     ni.setValue(ni_tmp);
     ibegin.setValue(ibegin_tmp);
     nj.setValue(nj_tmp);
     jbegin.setValue(jbegin_tmp);
-
-    global_zoom_ni.setValue(global_zoom_ni_tmp);
-    global_zoom_ibegin.setValue(global_zoom_ibegin_tmp);
-    global_zoom_nj.setValue(global_zoom_nj_tmp);
-    global_zoom_jbegin.setValue(global_zoom_jbegin_tmp);
-
-    int iend = ibegin + ni  - 1;
-    int jend = jbegin + nj  - 1;
-    int zoom_iend_glob = global_zoom_ibegin + global_zoom_ni - 1;
-    int zoom_jend_glob = global_zoom_jbegin + global_zoom_nj - 1;
-
-    zoom_ibegin.setValue(global_zoom_ibegin > ibegin ? global_zoom_ibegin.getValue() : ibegin);
-    int zoom_iend = zoom_iend_glob < iend ? zoom_iend_glob : iend ;
-    zoom_ni.setValue(zoom_iend-zoom_ibegin+1);
-
-    zoom_jbegin.setValue(global_zoom_jbegin > jbegin ? global_zoom_jbegin.getValue() : jbegin);
-    int zoom_jend = zoom_jend_glob < jend ? zoom_jend_glob : jend ;
-    zoom_nj.setValue(zoom_jend-zoom_jbegin+1);
-
-    if (zoom_ni<=0 || zoom_nj<=0)
-    {
-      zoom_ni=0 ; zoom_ibegin=global_zoom_ibegin ; //=0; zoom_iend=0 ; 
-      zoom_nj=0 ; zoom_jbegin=global_zoom_jbegin ; //=0; zoom_jend=0 ;
-    }
+    ni_glo.setValue(ni_glo_tmp);
+    nj_glo.setValue(nj_glo_tmp);
 
   }
-
-  /*!
-    Receive area event from clients(s)
-    \param[in] event event contain info about rank and associated area
-  */
-  void CDomain::recvMask(CEventServer& event)
-  {
-    string domainId;
-    std::map<int, CBufferIn*> rankBuffers;
-
-    list<CEventServer::SSubEvent>::iterator it;
-    for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it)
-    {      
-      CBufferIn* buffer = it->buffer;
-      *buffer >> domainId;
-      rankBuffers[it->rank] = buffer;     
-    }
-    get(domainId)->recvMask(rankBuffers);
-  }
-
-
-  /*!
-    Receive mask information from client(s)
-    \param[in] rankBuffers rank of sending client and the corresponding receive buffer  
-  */
-  void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers)
-  {
-    int nbReceived = rankBuffers.size(), i, ind, index, lInd;
-    if (nbReceived != recvClientRanks_.size())
-      ERROR("void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers)",
-           << "The number of sending clients is not correct."
-           << "Expected number: " << recvClientRanks_.size() << " but received " << nbReceived);
-
-    vector<CArray<bool,1> > recvMaskValue(nbReceived);      
-    for (i = 0; i < recvClientRanks_.size(); ++i)
-    {
-      int rank = recvClientRanks_[i];
-      CBufferIn& buffer = *(rankBuffers[rank]);      
-      buffer >> recvMaskValue[i];
-    }
-
-    int nbMaskInd = 0;
-    for (i = 0; i < nbReceived; ++i)
-    {
-      nbMaskInd += recvMaskValue[i].numElements();
-    }
-  
-    if (nbMaskInd != globalLocalIndexMap_.size())
-      info (0) << "If domain " << this->getDomainOutputName() <<" does not have overlapped regions between processes "
-               << "something must be wrong with mask index "<< std::endl;
-
-    nbMaskInd = globalLocalIndexMap_.size();
-    mask_1d.resize(nbMaskInd);
-    domainMask.resize(nbMaskInd);
-    mask_1d = false;
-    
-    for (i = 0; i < nbReceived; ++i)
-    {
-      CArray<int,1>& tmpInd = indGlob_[recvClientRanks_[i]];
-      CArray<bool,1>& tmp = recvMaskValue[i];
-      for (ind = 0; ind < tmp.numElements(); ++ind)
-      {
-        lInd = globalLocalIndexMap_[size_t(tmpInd(ind))];
-        if (!mask_1d(lInd)) // Only rewrite mask_1d if it's not true
-          mask_1d(lInd) = tmp(ind);
-      }
-    }
-    domainMask=mask_1d ;
-  }
-
+ CATCH_DUMP_ATTR
   /*!
     Receive longitude event from clients(s)
@@ -2651,4 +2589,5 @@
   */
   void CDomain::recvLon(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2664,4 +2603,5 @@
     get(domainId)->recvLon(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2670,4 +2610,5 @@
   */
   void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd;
@@ -2729,4 +2670,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2735,4 +2677,5 @@
   */
   void CDomain::recvLat(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2748,4 +2691,5 @@
     get(domainId)->recvLat(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2754,4 +2698,5 @@
   */
   void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd;
@@ -2815,4 +2760,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2821,4 +2767,5 @@
   */
   void CDomain::recvArea(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2834,4 +2781,5 @@
     get(domainId)->recvArea(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2840,4 +2788,5 @@
   */
   void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, lInd;
@@ -2885,4 +2834,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2894,4 +2844,5 @@
   */
   bool CDomain::isEqual(CDomain* obj)
+  TRY
   {
     vector<StdString> excludedAttr;
@@ -2916,4 +2867,5 @@
     return objEqual;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2922,4 +2874,5 @@
   */
   void CDomain::recvDataIndex(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2935,4 +2888,5 @@
     get(domainId)->recvDataIndex(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2946,4 +2900,5 @@
   */
   void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, indexI, indexJ, type_int, lInd;    
@@ -2982,9 +2937,4 @@
          dataIIndex(lInd) = (-1 == dataIIndex(lInd)) ? tmpI(ind) : dataIIndex(lInd); // Only fill in dataIndex if there is no data
          dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd);  
-
-         if (!domainMask(lInd))   // Include mask info into data index on the RECEIVE getServerDimensionSizes    
-         {
-           dataIIndex(lInd) = dataJIndex(lInd) = -1;
-         }
       } 
     }
@@ -3017,10 +2967,13 @@
     data_jbegin.setValue(0);
   }
+  CATCH_DUMP_ATTR
 
   CTransformation<CDomain>* CDomain::addTransformation(ETranformationType transType, const StdString& id)
+  TRY
   {
     transformationMap_.push_back(std::make_pair(transType, CTransformation<CDomain>::createTransformation(transType,id)));
     return transformationMap_.back().second;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -3029,7 +2982,9 @@
   */
   bool CDomain::hasTransformation()
+  TRY
   {
     return (!transformationMap_.empty());
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -3038,7 +2993,9 @@
   */
   void CDomain::setTransformations(const TransMapTypes& domTrans)
+  TRY
   {
     transformationMap_ = domTrans;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -3047,9 +3004,12 @@
   */
   CDomain::TransMapTypes CDomain::getAllTransformations(void)
+  TRY
   {
     return transformationMap_;
   }
+  CATCH_DUMP_ATTR
 
   void CDomain::duplicateTransformation(CDomain* src)
+  TRY
   {
     if (src->hasTransformation())
@@ -3058,4 +3018,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -3063,4 +3024,5 @@
    */
   void CDomain::solveInheritanceTransformation()
+  TRY
   {
     if (hasTransformation() || !hasDirectDomainReference())
@@ -3079,6 +3041,8 @@
         refDomains[i]->setTransformations(domain->getAllTransformations());
   }
+  CATCH_DUMP_ATTR
 
   void CDomain::setContextClient(CContextClient* contextClient)
+  TRY
   {
     if (clientsSet.find(contextClient)==clientsSet.end())
@@ -3088,4 +3052,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -3095,4 +3060,5 @@
   */
   void CDomain::parse(xml::CXMLNode & node)
+  TRY
   {
     SuperClass::parse(node);
@@ -3108,9 +3074,6 @@
 
         nodeElementName = node.getElementName();
-        if(transformationMapList_ptr == 0) initializeTransformationMap();
-
-        std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_ptr->end(), it;
-
-        it = transformationMapList_ptr->find(nodeElementName);
+        std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_.end(), it;
+        it = transformationMapList_.find(nodeElementName);
         if (ite != it)
         {
@@ -3128,4 +3091,5 @@
     }
   }
+  CATCH_DUMP_ATTR
    //----------------------------------------------------------------
 
Index: XIOS/dev/branch_openmp/src/node/domain.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/domain.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/domain.hpp	(revision 1642)
@@ -17,5 +17,4 @@
 #include "transformation_enum.hpp"
 #include "server_distribution_description.hpp"
-#include "mpi_std.hpp"
 #include "mesh.hpp"
 
@@ -50,5 +49,5 @@
          {
            EVENT_ID_INDEX, EVENT_ID_LON, EVENT_ID_LAT, 
-           EVENT_ID_AREA, EVENT_ID_MASK,
+           EVENT_ID_AREA,
            EVENT_ID_DATA_INDEX, EVENT_ID_SERVER_ATTRIBUT
          } ;
@@ -143,5 +142,5 @@
          CArray<double, 1> areavalue;
 
-         CArray<size_t,1> localIndexToWriteOnServer;         
+         CArray<int,1> localIndexToWriteOnServer;
 
          CArray<bool, 1> domainMask; // mask_1d, mask_2d -> domainMask
@@ -152,4 +151,8 @@
          bool hasLonLat;
          bool hasPole ;
+         bool hasLatInReadFile_ ; // specify if latitude is defined on read file, so it can be read later when grid distribution will be defined
+         bool hasBoundsLatInReadFile_ ; // specify if latitude boundarues are defined on read file, so it can be read later when grid distribution will be defined
+         bool hasLonInReadFile_ ; // specify if longitude is defined on read file, so it can be read later when grid distribution will be defined
+         bool hasBoundsLonInReadFile_ ; // specify if longitude boundaries are defined on read file, so it can be read later when grid distribution will be defined
 
          void computeLocalMask(void) ;
@@ -166,5 +169,4 @@
          void checkArea(void);
          void checkLonLat();
-         void checkZoom(void);
 
          void setTransformations(const TransMapTypes&);         
@@ -173,5 +175,4 @@
          void sendIndex();
          void sendDistributionAttributes();
-         void sendMask();
          void sendArea();
          void sendLonLat();         
@@ -184,6 +185,4 @@
          static void recvDistributionAttributes(CEventServer& event);
          static void recvIndex(CEventServer& event);
-         static void recvIndexZoom(CEventServer& event);
-         static void recvMask(CEventServer& event);         
          static void recvLon(CEventServer& event);
          static void recvLat(CEventServer& event);
@@ -192,5 +191,4 @@
          void recvDistributionAttributes(CBufferIn& buffer);                  
          void recvIndex(std::map<int, CBufferIn*>& rankBuffers);         
-         void recvMask(std::map<int, CBufferIn*>& rankBuffers);
          void recvLon(std::map<int, CBufferIn*>& rankBuffers);
          void recvLat(std::map<int, CBufferIn*>& rankBuffers);
@@ -201,5 +199,5 @@
          void computeConnectedClients();    
 
-       private:
+       private:         
 
 /** Clients that have to send a domain. There can be multiple clients in case of secondary server, otherwise only one client. */
@@ -207,5 +205,4 @@
          std::set<CContextClient*> clientsSet;
 
-         bool doZoomByIndex_;
          bool isChecked, computedWrittenIndex_;
          std::set<StdString> relFiles, relFilesCompressed;
@@ -234,9 +231,6 @@
        private:
          static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m);
-         static bool initializeTransformationMap();
-         static std::map<StdString, ETranformationType> *transformationMapList_ptr;
-         #pragma omp threadprivate(transformationMapList_ptr)
+         static std::map<StdString, ETranformationType> transformationMapList_;
          static bool _dummyTransformationMapList;
-         #pragma omp threadprivate(_dummyTransformationMapList)
 
          DECLARE_REF_FUNC(Domain,domain)
Index: XIOS/dev/branch_openmp/src/node/duplicate_scalar_to_axis.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/duplicate_scalar_to_axis.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/duplicate_scalar_to_axis.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CReduceAxisToAxis
 
Index: XIOS/dev/branch_openmp/src/node/expand_domain.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/expand_domain.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/expand_domain.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CExpandDomain
 
Index: XIOS/dev/branch_openmp/src/node/extract_axis_to_scalar.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/extract_axis_to_scalar.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/extract_axis_to_scalar.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CScalar>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CExtractAxisToScalar
 
Index: XIOS/dev/branch_openmp/src/node/extract_domain_to_axis.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/extract_domain_to_axis.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/extract_domain_to_axis.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CExtractDomainToAxis
 
Index: XIOS/dev/branch_openmp/src/node/field.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/field.cpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/field.cpp	(revision 1642)
@@ -71,27 +71,36 @@
 
    void CField::setVirtualVariableGroup(CVariableGroup* newVVariableGroup)
+   TRY
    {
       this->vVariableGroup = newVVariableGroup;
    }
+   CATCH
 
    CVariableGroup* CField::getVirtualVariableGroup(void) const
+   TRY
    {
       return this->vVariableGroup;
    }
+   CATCH
 
    std::vector<CVariable*> CField::getAllVariables(void) const
+   TRY
    {
       return this->vVariableGroup->getAllChildren();
    }
+   CATCH
 
    void CField::solveDescInheritance(bool apply, const CAttributeMap* const parent)
+   TRY
    {
       SuperClassAttribute::setAttributes(parent, apply);
       this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL);
    }
+   CATCH_DUMP_ATTR
 
   //----------------------------------------------------------------
 
   bool CField::dispatchEvent(CEventServer& event)
+  TRY
   {
     if (SuperClass::dispatchEvent(event)) return true;
@@ -131,6 +140,8 @@
     }
   }
+  CATCH
 
   void CField::sendUpdateData(const CArray<double,1>& data)
+  TRY
   {
     CTimer::get("Field : send data").resume();
@@ -189,6 +200,8 @@
     CTimer::get("Field : send data").suspend();
   }
+  CATCH_DUMP_ATTR
 
   void CField::recvUpdateData(CEventServer& event)
+  TRY
   {
     std::map<int,CBufferIn*> rankBuffers;
@@ -207,6 +220,8 @@
     CTimer::get("Field : recv data").suspend();
   }
+  CATCH
 
   void  CField::recvUpdateData(std::map<int,CBufferIn*>& rankBuffers)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -249,6 +264,8 @@
     recvDataSrv.reset() ;
   }
+  CATCH_DUMP_ATTR
 
   void CField::writeUpdateData(const CArray<double,1>& data)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -277,6 +294,8 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   void CField::writeField(void)
+  TRY
   {
     if (!getRelFile()->isEmptyZone())
@@ -290,4 +309,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -299,4 +319,5 @@
   */
   bool CField::sendReadDataRequest(const CDate& tsDataRequested)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -330,4 +351,5 @@
     return !isEOF;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -336,4 +358,5 @@
   */
   bool CField::sendReadDataRequestIfNeeded(void)
+  TRY
   {
     const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate();
@@ -343,11 +366,8 @@
     while (currentDate >= lastDataRequestedFromServer)
     {
-      #pragma omp critical (_output)
-      {
-        info(20) << "currentDate : " << currentDate << endl ;
-        info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer << endl ;
-        info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() << endl ;
-        info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ;
-      }
+      info(20) << "currentDate : " << currentDate << endl ;
+      info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer << endl ;
+      info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() << endl ;
+      info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ;
 
       dataRequested |= sendReadDataRequest(lastDataRequestedFromServer + file->output_freq);
@@ -356,6 +376,8 @@
     return dataRequested;
   }
+  CATCH_DUMP_ATTR
 
   void CField::recvReadDataRequest(CEventServer& event)
+  TRY
   {
     CBufferIn* buffer = event.subEvents.begin()->buffer;
@@ -364,4 +386,5 @@
     get(fieldId)->recvReadDataRequest();
   }
+  CATCH
 
   /*!
@@ -372,4 +395,5 @@
   */
   void CField::recvReadDataRequest(void)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -452,4 +476,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -459,4 +484,5 @@
   */
   CField::EReadField CField::readField(void)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -505,5 +531,9 @@
     if (!nstepMaxRead)
     {
-       MPI_Allreduce(&nstepMax, &nstepMax, 1, MPI_INT, MPI_MAX, context->server->intraComm);
+       #ifdef _usingMPI
+       MPI_Allreduce(MPI_IN_PLACE, &nstepMax, 1, MPI_INT, MPI_MAX, context->server->intraComm);
+       #elif _usingEP
+       ep_lib::MPI_Allreduce(&nstepMax, &nstepMax, 1, EP_INT, EP_MAX, context->server->intraComm);
+       #endif
        nstepMaxRead = true;
     }
@@ -511,4 +541,5 @@
     return readState;
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -519,4 +550,5 @@
   */
   void CField::recvReadDataReady(CEventServer& event)
+  TRY
   {
     string fieldId;
@@ -534,4 +566,5 @@
     get(fieldId)->recvReadDataReady(ranks, buffers);
   }
+  CATCH
 
   /*!
@@ -541,4 +574,5 @@
   */
   void CField::recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -577,6 +611,8 @@
       serverSourceFilter->streamDataFromServer(lastDataReceivedFromServer, data);
   }
+  CATCH_DUMP_ATTR
 
   void CField::checkForLateDataFromServer(void)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -610,23 +646,30 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   void CField::checkIfMustAutoTrigger(void)
+  TRY
   {
     mustAutoTrigger = serverSourceFilter ? serverSourceFilter->mustAutoTrigger() : false;
   }
+  CATCH_DUMP_ATTR
 
   void CField::autoTriggerIfNeeded(void)
+  TRY
   {
     if (mustAutoTrigger)
       serverSourceFilter->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate());
   }
+  CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    void CField::setRelFile(CFile* _file)
+   TRY
    {
       this->file = _file;
       hasOutputFile = true;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -639,46 +682,61 @@
 
    CGrid* CField::getRelGrid(void) const
+   TRY
    {
       return this->grid;
    }
+   CATCH
 
    //----------------------------------------------------------------
 
    CFile* CField::getRelFile(void) const
+   TRY
    {
       return this->file;
    }
+   CATCH
 
    int CField::getNStep(void) const
+   TRY
    {
       return this->nstep;
    }
+   CATCH
 
    func::CFunctor::ETimeType CField::getOperationTimeType() const
+   TRY
    {
      return operationTimeType;
    }
+   CATCH
 
    //----------------------------------------------------------------
 
    void CField::incrementNStep(void)
+   TRY
    {
       this->nstep++;
    }
+   CATCH_DUMP_ATTR
 
    void CField::resetNStep(int nstep /*= 0*/)
+   TRY
    {
       this->nstep = nstep;
    }
+   CATCH_DUMP_ATTR
 
    void CField::resetNStepMax(void)
+   TRY
    {
       this->nstepMax = 0;
       nstepMaxRead = false;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    bool CField::isActive(bool atCurrentTimestep /*= false*/) const
+   TRY
    {
       if (clientSourceFilter)
@@ -692,35 +750,46 @@
       return false;
    }
+   CATCH
 
    //----------------------------------------------------------------
 
    bool CField::wasWritten() const
+   TRY
    {
      return written;
    }
+   CATCH
 
    void CField::setWritten()
+   TRY
    {
      written = true;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    bool CField::getUseCompressedOutput() const
+   TRY
    {
      return useCompressedOutput;
    }
+   CATCH
 
    void CField::setUseCompressedOutput()
+   TRY
    {
      useCompressedOutput = true;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    std::shared_ptr<COutputPin> CField::getInstantDataFilter()
+   TRY
    {
      return instantDataFilter;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -731,4 +800,5 @@
    */
    void CField::buildGridTransformationGraph()
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -741,4 +811,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -746,4 +817,5 @@
    */
    void CField::generateNewTransformationGridDest()
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -800,6 +872,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CField::updateRef(CGrid* grid)
+   TRY
    {
      if (!grid_ref.isEmpty()) grid_ref.setValue(grid->getId());
@@ -823,4 +897,5 @@
      }
    }
+   CATCH_DUMP_ATTR
    
    /*!
@@ -829,4 +904,5 @@
    */
    void CField::solveAllEnabledFieldsAndTransform()
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -865,6 +941,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CField::checkGridOfEnabledFields()
+   TRY
    {
      if (!isGridChecked)
@@ -874,18 +952,24 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CField::sendGridComponentOfEnabledFields()
+   TRY
    {
       solveGridDomainAxisRef(true);
       // solveCheckMaskIndex(true);
    }
+   CATCH_DUMP_ATTR
 
    void CField::sendGridOfEnabledFields()
+   TRY
    {
       // solveGridDomainAxisRef(true);
       solveCheckMaskIndex(true);
    }   
+   CATCH_DUMP_ATTR
 
    void CField::solveOnlyReferenceEnabledField(bool doSending2Server)
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -913,6 +997,8 @@
      }
    }
-     
+   CATCH_DUMP_ATTR
+
    void CField::solveAllReferenceEnabledField(bool doSending2Server)
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -922,5 +1008,5 @@
      {
         areAllReferenceSolved = true;
-
+       
         if (context->hasClient && !context->hasServer)
         {
@@ -943,23 +1029,31 @@
      solveCheckMaskIndex(doSending2Server);
    }
+   CATCH_DUMP_ATTR
 
    std::map<int, StdSize> CField::getGridAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= "false"*/)
+   TRY
    {
      return grid->getAttributesBufferSize(client, bufferForWriting);
    }
+   CATCH_DUMP_ATTR
 
    std::map<int, StdSize> CField::getGridDataBufferSize(CContextClient* client, bool bufferForWriting /*= "false"*/)
+   TRY
    {
      return grid->getDataBufferSize(client, getId(), bufferForWriting);
    }
+   CATCH_DUMP_ATTR
 
    size_t CField::getGlobalWrittenSize()
+   TRY
    {
      return grid->getGlobalWrittenSize();
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    void CField::solveServerOperation(void)
+   TRY
    {
       CContext* context = CContext::getCurrent();
@@ -1004,4 +1098,5 @@
       operationTimeType = functor->timeType();
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -1016,4 +1111,5 @@
     */
    void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput)
+   TRY
    {     
     if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform();
@@ -1030,5 +1126,5 @@
      {
         if (!instantDataFilter)
-          instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,true));
+          instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false));
 
 
@@ -1046,5 +1142,5 @@
      {
        if (!instantDataFilter)
-         instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true));
+         instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, false));
 
              // If the field data is to be read by the client or/and written to a file
@@ -1092,5 +1188,5 @@
          {
            checkTimeAttributes();
-           instantDataFilter = serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, freq_offset, true,
+           instantDataFilter = serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false, freq_offset, true,
                                                                                                        detectMissingValues, defaultValue));
          }
@@ -1098,5 +1194,5 @@
          {
             if (check_if_active.isEmpty()) check_if_active = false; 
-            instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, NoneDu, false,
+            instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, true, NoneDu, false,
                                                                                                         detectMissingValues, defaultValue));
          }
@@ -1121,4 +1217,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1130,4 +1227,5 @@
     */
    std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc)
+   TRY
    {
      if (instantDataFilter || field_ref.isEmpty())
@@ -1153,4 +1251,5 @@
      return filters.second;
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1164,4 +1263,5 @@
     */
    std::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc)
+   TRY
    {
      if (instantDataFilter || !hasExpression())
@@ -1179,5 +1279,5 @@
          {
            checkTimeAttributes();
-           serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, freq_offset, true,
+           serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false, freq_offset, true,
                                                                                    detectMissingValues, defaultValue));
          }
@@ -1196,5 +1296,5 @@
          {
            if (check_if_active.isEmpty()) check_if_active = false;
-           clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, NoneDu, false,
+           clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, true, NoneDu, false,
                                                                                    detectMissingValues, defaultValue));
          }
@@ -1206,4 +1306,5 @@
      return selfReferenceFilter;
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1217,4 +1318,5 @@
     */
    std::shared_ptr<COutputPin> CField::getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)
+   TRY
    {
      std::map<CDuration, std::shared_ptr<COutputPin> >::iterator it = temporalDataFilters.find(outFreq);
@@ -1240,4 +1342,5 @@
      return it->second;
    }
+   CATCH_DUMP_ATTR
 
   /*!
@@ -1251,4 +1354,5 @@
    
    std::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)
+   TRY
    {
      if (instantDataFilter || !hasExpression())
@@ -1281,4 +1385,5 @@
      }
   }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -1299,4 +1404,5 @@
 
    void CField::solveGridReference(void)
+   TRY
    {
       if (grid_ref.isEmpty() && domain_ref.isEmpty() && axis_ref.isEmpty() && scalar_ref.isEmpty())
@@ -1382,16 +1488,22 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    void CField::solveGridDomainAxisRef(bool checkAtt)
+   TRY
    {
      grid->solveDomainAxisRef(checkAtt);
    }
+   CATCH_DUMP_ATTR
 
    void CField::solveCheckMaskIndex(bool doSendingIndex)
+   TRY
    {
      grid->checkMaskIndex(doSendingIndex);
    }
+   CATCH_DUMP_ATTR
 
    void CField::solveTransformedGrid()
+   TRY
    {
      if (grid && !grid->isTransformed() && hasDirectFieldReference() && grid != getDirectFieldReference()->grid)
@@ -1442,6 +1554,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CField::solveGenerateGrid()
+   TRY
    {
      if (grid && !grid->isTransformed() && hasDirectFieldReference() && grid != getDirectFieldReference()->grid)
@@ -1450,10 +1564,13 @@
        grid->completeGrid();
    }
+   CATCH_DUMP_ATTR
 
    void CField::solveGridDomainAxisBaseRef()
+   TRY
    {
      grid->solveDomainAxisRef(false);
      grid->solveDomainAxisBaseRef();
    }
+   CATCH_DUMP_ATTR
 
    ///-------------------------------------------------------------------
@@ -1461,4 +1578,5 @@
    template <>
    void CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void)
+   TRY
    {
       if (this->group_ref.isEmpty()) return;
@@ -1472,5 +1590,6 @@
       CFieldGroup* group = CFieldGroup::get(gref);
       CFieldGroup* owner = CFieldGroup::get(boost::polymorphic_downcast<CFieldGroup*>(this));
-
+      owner->setAttributes(group); // inherite of attributes of group reference
+      
       std::vector<CField*> allChildren  = group->getAllChildren();
       std::vector<CField*>::iterator it = allChildren.begin(), end = allChildren.end();
@@ -1483,16 +1602,22 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    void CField::scaleFactorAddOffset(double scaleFactor, double addOffset)
+   TRY
    {
      recvDataSrv = (recvDataSrv - addOffset) / scaleFactor;
    }
+   CATCH_DUMP_ATTR
 
    void CField::invertScaleFactorAddOffset(double scaleFactor, double addOffset)
+   TRY
    {
      recvDataSrv = recvDataSrv * scaleFactor + addOffset;
    }
+   CATCH_DUMP_ATTR
 
    void CField::outputField(CArray<double,1>& fieldOut)
+   TRY
    { 
       CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;
@@ -1503,6 +1628,8 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    void CField::inputField(CArray<double,1>& fieldIn)
+   TRY
    {
       CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;
@@ -1512,8 +1639,9 @@
         recvDataSrv(outIndexClient(idx)) = fieldIn(outIndexServer(idx));
       }
-
-   }
+   }
+   CATCH_DUMP_ATTR
 
    void CField::outputCompressedField(CArray<double,1>& fieldOut)
+   TRY
    {
       CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;
@@ -1524,8 +1652,10 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    ///-------------------------------------------------------------------
 
    void CField::parse(xml::CXMLNode& node)
+   TRY
    {
       string newContent ;
@@ -1542,4 +1672,5 @@
       if (node.getContent(newContent)) content=newContent ;
     }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1549,4 +1680,5 @@
    */
    const std::vector<StdString>& CField::getRefDomainAxisIds()
+   TRY
    {
      CGrid* cgPtr = getRelGrid();
@@ -1577,16 +1709,22 @@
      return (domAxisScalarIds_);
    }
+   CATCH_DUMP_ATTR
 
    CVariable* CField::addVariable(const string& id)
+   TRY
    {
      return vVariableGroup->createChild(id);
    }
+   CATCH
 
    CVariableGroup* CField::addVariableGroup(const string& id)
+   TRY
    {
      return vVariableGroup->createChildGroup(id);
    }
+   CATCH
 
    void CField::setContextClient(CContextClient* contextClient)
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -1604,11 +1742,15 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    CContextClient* CField::getContextClient()
+   TRY
    {
      return client;
    }
+   CATCH
 
    void CField::sendAddAllVariables(CContextClient* client)
+   TRY
    {
      std::vector<CVariable*> allVar = getAllVariables();
@@ -1623,5 +1765,5 @@
      }
    }
-
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1631,4 +1773,5 @@
     
    void CField::sendAllAttributesToServer(CContextClient* client)
+   TRY
    {
      if (grid_ref.isEmpty())
@@ -1640,16 +1783,22 @@
      else SuperClass::sendAllAttributesToServer(client) ;
    }
+   CATCH_DUMP_ATTR
     
    void CField::sendAddVariable(const string& id, CContextClient* client)
+   TRY
    {
       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client);
    }
+   CATCH_DUMP_ATTR
 
    void CField::sendAddVariableGroup(const string& id, CContextClient* client)
+   TRY
    {
       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client);
    }
+   CATCH_DUMP_ATTR
 
    void CField::recvAddVariable(CEventServer& event)
+   TRY
    {
 
@@ -1659,6 +1808,8 @@
       get(id)->recvAddVariable(*buffer);
    }
+   CATCH
 
    void CField::recvAddVariable(CBufferIn& buffer)
+   TRY
    {
       string id;
@@ -1666,6 +1817,8 @@
       addVariable(id);
    }
+   CATCH_DUMP_ATTR
 
    void CField::recvAddVariableGroup(CEventServer& event)
+   TRY
    {
 
@@ -1675,6 +1828,8 @@
       get(id)->recvAddVariableGroup(*buffer);
    }
+   CATCH
 
    void CField::recvAddVariableGroup(CBufferIn& buffer)
+   TRY
    {
       string id;
@@ -1682,4 +1837,5 @@
       addVariableGroup(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1687,4 +1843,5 @@
     */
    void CField::checkTimeAttributes(CDuration* freqOp)
+   TRY
    {
      bool isFieldRead  = file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read;
@@ -1708,4 +1865,5 @@
        freq_offset.setValue(isFieldRead ? NoneDu : (freq_op.getValue() - TimeStep));
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1714,4 +1872,5 @@
     */
    const string& CField::getExpression(void)
+   TRY
    {
      if (!expr.isEmpty() && content.empty())
@@ -1723,10 +1882,19 @@
      return content;
    }
+   CATCH_DUMP_ATTR
 
    bool CField::hasExpression(void) const
+   TRY
    {
      return (!expr.isEmpty() || !content.empty());
    }
-
+   CATCH
+
+   bool CField::hasGridMask(void) const
+   TRY
+   {
+     return (this->grid->hasMask());
+   }
+   CATCH
 
    DEFINE_REF_FUNC(Field,field)
Index: XIOS/dev/branch_openmp/src/node/field.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/field.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/field.hpp	(revision 1642)
@@ -209,4 +209,6 @@
         bool hasExpression(void) const;
 
+        bool hasGridMask(void) const;
+
       public:
          /// PropriÃ©tÃ©s privÃ©es ///
Index: XIOS/dev/branch_openmp/src/node/field_impl.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/field_impl.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/field_impl.hpp	(revision 1642)
@@ -17,4 +17,5 @@
   template <int N>
   void CField::setData(const CArray<double, N>& _data)
+  TRY
   {
     if (clientSourceFilter)
@@ -27,7 +28,9 @@
             << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation.");
   }
+  CATCH_DUMP_ATTR
 
   template <int N>
   void CField::getData(CArray<double, N>& _data) const
+  TRY
   {
     if (storeFilter)
@@ -45,4 +48,5 @@
     }
   }
+  CATCH
 } // namespace xios
 
Index: XIOS/dev/branch_openmp/src/node/file.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/file.cpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/file.cpp	(revision 1642)
@@ -25,5 +25,5 @@
    CFile::CFile(void)
       : CObjectTemplate<CFile>(), CFileAttributes()
-      , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL)
+      , vFieldGroup(), data_out(), enabledFields(), fileComm(EP_COMM_NULL)
       , isOpen(false), read_client(0), checkRead(false), allZoneEmpty(false)
    {
@@ -34,5 +34,5 @@
    CFile::CFile(const StdString & id)
       : CObjectTemplate<CFile>(id), CFileAttributes()
-      , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL)
+      , vFieldGroup(), data_out(), enabledFields(), fileComm(EP_COMM_NULL)
       , isOpen(false), read_client(0), checkRead(false), allZoneEmpty(false)
     {
@@ -53,7 +53,9 @@
 
    const StdString CFile::getFileOutputName(void) const
+   TRY
    {
      return (name.isEmpty() ? getId() : name) + (name_suffix.isEmpty() ? StdString("") :  name_suffix.getValue());
    }
+   CATCH
 
    //----------------------------------------------------------------
@@ -65,7 +67,9 @@
    */
    std::shared_ptr<CDataOutput> CFile::getDataOutput(void) const
+   TRY
    {
       return data_out;
    }
+   CATCH
 
    /*!
@@ -76,7 +80,9 @@
    */
    std::shared_ptr<CDataInput> CFile::getDataInput(void) const
+   TRY
    {
       return data_in;
    }
+   CATCH
 
    /*!
@@ -88,7 +94,9 @@
    */
    CFieldGroup* CFile::getVirtualFieldGroup(void) const
+   TRY
    {
       return (this->vFieldGroup);
    }
+   CATCH
 
    /*!
@@ -100,19 +108,25 @@
    */
    CVariableGroup* CFile::getVirtualVariableGroup(void) const
+   TRY
    {
       return (this->vVariableGroup);
    }
+   CATCH
 
    //! Get all fields of a file
    std::vector<CField*> CFile::getAllFields(void) const
+   TRY
    {
       return (this->vFieldGroup->getAllChildren());
    }
+   CATCH
 
    //! Get all variables of a file
    std::vector<CVariable*> CFile::getAllVariables(void) const
+   TRY
    {
       return (this->vVariableGroup->getAllChildren());
    }
+   CATCH
 
    //----------------------------------------------------------------
@@ -129,4 +143,5 @@
                                                 int default_level,
                                                 bool default_enabled)
+   TRY
    {
       if (!this->enabledFields.empty())
@@ -145,10 +160,8 @@
          {
             if (! (*it)->enabled.getValue()) continue;
-//            { it--; this->enabledFields.erase(it+1); continue; }
          }
          else // Si l'attribut 'enabled' n'est pas dfini ...
          {
             if (!default_enabled) continue;
-//            { it--; this->enabledFields.erase(it+1); continue; }
          }
 
@@ -156,18 +169,11 @@
          {
             if ((*it)->level.getValue() > _outputlevel) continue;
-//            { it--; this->enabledFields.erase(it+1); continue; }
          }
          else // Si l'attribut 'level' n'est pas dfini ...
          {
             if (default_level > _outputlevel) continue;
-//            { it--; this->enabledFields.erase(it+1); continue; }
          }
 
-//         CField* field_tmp=(*it).get();
-//         shared_ptr<CField> sptfield=*it;
-//         field_tmp->refObject.push_back(sptfield);
          newEnabledFields.push_back(*it);
-         // 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 rfrence au champ de base.
          (*it)->setRelFile(CFile::get(this));
@@ -177,20 +183,26 @@
       return (this->enabledFields);
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
    //! Change virtual field group to a new one
    void CFile::setVirtualFieldGroup(CFieldGroup* newVFieldGroup)
+   TRY
    {
       this->vFieldGroup = newVFieldGroup;
    }
+   CATCH_DUMP_ATTR
 
    //! Change virtual variable group to new one
    void CFile::setVirtualVariableGroup(CVariableGroup* newVVariableGroup)
+   TRY
    {
       this->vVariableGroup = newVVariableGroup;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
    bool CFile::isSyncTime(void)
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -206,7 +218,9 @@
       return false;
     }
+    CATCH_DUMP_ATTR
 
    //! Initialize a file in order to write into it
    void CFile::initWrite(void)
+   TRY
    {
       CContext* context = CContext::getCurrent();
@@ -261,7 +275,9 @@
       if (time_counter_name.isEmpty()) time_counter_name = "time_counter";
     }
+    CATCH_DUMP_ATTR
 
     //! Initialize a file in order to write into it
     void CFile::initRead(void)
+    TRY
     {
       if (checkRead) return;
@@ -269,4 +285,5 @@
       checkRead = true;
     }
+    CATCH_DUMP_ATTR
 
     /*!
@@ -274,4 +291,5 @@
     */
     void CFile::createSubComFile()
+    TRY
     {
       CContext* context = CContext::getCurrent();
@@ -292,4 +310,5 @@
       if (allZoneEmpty) ep_lib::MPI_Comm_free(&fileComm);
     }
+    CATCH_DUMP_ATTR
 
     /*
@@ -299,4 +318,5 @@
     */
     void CFile::checkWriteFile(void)
+    TRY
     {
       CContext* context = CContext::getCurrent();
@@ -315,4 +335,5 @@
       }
     }
+    CATCH_DUMP_ATTR
 
     /*
@@ -323,4 +344,5 @@
     */
     void CFile::checkReadFile(void)
+    TRY
     {
       CContext* context = CContext::getCurrent();
@@ -340,4 +362,5 @@
       }
     }
+    CATCH_DUMP_ATTR
 
     /*!
@@ -346,7 +369,9 @@
     */
     bool CFile::isEmptyZone()
+    TRY
     {
       return allZoneEmpty;
     }
+    CATCH_DUMP_ATTR
 
     /*!
@@ -357,4 +382,5 @@
     */
    bool CFile::checkSync(void)
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -371,4 +397,5 @@
       return false;
     }
+   CATCH_DUMP_ATTR
 
     /*!
@@ -379,4 +406,5 @@
     */
     bool CFile::checkSplit(void)
+    TRY
     {
       CContext* context = CContext::getCurrent();
@@ -402,4 +430,5 @@
       return false;
     }
+    CATCH_DUMP_ATTR
 
    /*!
@@ -408,4 +437,5 @@
    */
    void CFile::createHeader(void)
+   TRY
    {
       CContext* context = CContext::getCurrent();
@@ -594,4 +624,5 @@
       }
    }
+   CATCH_DUMP_ATTR
 
   /*!
@@ -599,4 +630,5 @@
   */
   void CFile::openInReadMode()
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -675,7 +707,9 @@
     }
   }
+  CATCH_DUMP_ATTR
 
    //! Close file
    void CFile::close(void)
+   TRY
    {
      if (!allZoneEmpty)
@@ -688,9 +722,12 @@
         isOpen = false;
        }
-      //if (fileComm != MPI_COMM_NULL) MPI_Comm_free(&fileComm);
-   }
+      if (fileComm != EP_COMM_NULL) ep_lib::MPI_Comm_free(&fileComm);
+   }
+   CATCH_DUMP_ATTR
+
    //----------------------------------------------------------------
 
    void CFile::readAttributesOfEnabledFieldsInReadMode()
+   TRY
    {
      if (enabledFields.empty()) return;
@@ -713,5 +750,4 @@
 
         // Read necessary value from file
-        #pragma omp critical (_func)
         this->data_in->readFieldAttributesValues(enabledFields[idx]);
 
@@ -723,5 +759,5 @@
      close();
    }
-
+   CATCH_DUMP_ATTR
 
    /*!
@@ -730,4 +766,5 @@
    */
    void CFile::parse(xml::CXMLNode & node)
+   TRY
    {
       SuperClass::parse(node);
@@ -742,6 +779,7 @@
         node.goToParentElement();
       }
-
-   }
+   }
+   CATCH_DUMP_ATTR
+
    //----------------------------------------------------------------
 
@@ -751,4 +789,5 @@
    */
    StdString CFile::toString(void) const
+   TRY
    {
       StdOStringStream oss;
@@ -763,4 +802,5 @@
       return (oss.str());
    }
+   CATCH
 
    //----------------------------------------------------------------
@@ -773,4 +813,5 @@
    */
    void CFile::solveDescInheritance(bool apply, const CAttributeMap * const parent)
+   TRY
    {
       SuperClassAttribute::setAttributes(parent,apply);
@@ -778,4 +819,5 @@
       this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL);
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -790,4 +832,5 @@
    */
    void CFile::solveOnlyRefOfEnabledFields(bool sendToServer)
+   TRY
    {
      int size = this->enabledFields.size();
@@ -797,6 +840,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CFile::checkGridOfEnabledFields()
+   TRY
    { 
      int size = this->enabledFields.size();
@@ -806,6 +851,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CFile::sendGridComponentOfEnabledFields()
+   TRY
    { 
      int size = this->enabledFields.size();
@@ -815,4 +862,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -821,4 +869,5 @@
    */
    void CFile::sortEnabledFieldsForUgrid()
+   TRY
    {
      int size = this->enabledFields.size();
@@ -869,6 +918,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CFile::sendGridOfEnabledFields()
+   TRY
    { 
      int size = this->enabledFields.size();
@@ -878,6 +929,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CFile::generateNewTransformationGridDest()
+   TRY
    {
      int size = this->enabledFields.size();
@@ -887,4 +940,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -897,11 +951,13 @@
    */
    void CFile::solveAllRefOfEnabledFieldsAndTransform(bool sendToServer)
+   TRY
    {
      int size = this->enabledFields.size();
      for (int i = 0; i < size; ++i)
-     {
-       this->enabledFields[i]->solveAllEnabledFieldsAndTransform();
-     }
-   }
+     {       
+      this->enabledFields[i]->solveAllEnabledFieldsAndTransform();
+     }
+   }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -911,4 +967,5 @@
     */
    void CFile::buildFilterGraphOfEnabledFields(CGarbageCollector& gc)
+   TRY
    {
      int size = this->enabledFields.size();
@@ -918,4 +975,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -923,4 +981,5 @@
     */
    void CFile::postProcessFilterGraph()
+   TRY
    {
      int size = this->enabledFields.size();
@@ -930,4 +989,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -935,4 +995,5 @@
    */
    void CFile::prefetchEnabledReadModeFields(void)
+   TRY
    {
      if (mode.isEmpty() || mode.getValue() != mode_attr::read)
@@ -943,4 +1004,5 @@
        this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate());
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -950,4 +1012,5 @@
    */
    void CFile::doPreTimestepOperationsForEnabledReadModeFields(void)
+   TRY
    {
      if (mode.isEmpty() || mode.getValue() != mode_attr::read)
@@ -961,4 +1024,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -967,4 +1031,5 @@
    */
    void CFile::doPostTimestepOperationsForEnabledReadModeFields(void)
+   TRY
    {
      if (mode.isEmpty() || mode.getValue() != mode_attr::read)
@@ -977,6 +1042,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CFile::solveFieldRefInheritance(bool apply)
+   TRY
    {
       // Rsolution des hritages par rfrence de chacun des champs contenus dans le fichier.
@@ -985,4 +1052,5 @@
          allF[i]->solveRefInheritance(apply);
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -997,7 +1065,9 @@
    */
    CField* CFile::addField(const string& id)
+   TRY
    {
      return vFieldGroup->createChild(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1009,7 +1079,9 @@
    */
    CFieldGroup* CFile::addFieldGroup(const string& id)
+   TRY
    {
      return vFieldGroup->createChildGroup(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1024,7 +1096,9 @@
    */
    CVariable* CFile::addVariable(const string& id)
+   TRY
    {
      return vVariableGroup->createChild(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1036,9 +1110,12 @@
    */
    CVariableGroup* CFile::addVariableGroup(const string& id)
+   TRY
    {
      return vVariableGroup->createChildGroup(id);
    }
+   CATCH_DUMP_ATTR
 
    void CFile::setContextClient(CContextClient* newContextClient)
+   TRY
    {
      client = newContextClient;
@@ -1049,19 +1126,26 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    CContextClient* CFile::getContextClient()
+   TRY
    {
      return client;
    }
+   CATCH_DUMP_ATTR
 
    void CFile::setReadContextClient(CContextClient* readContextclient)
+   TRY
    {
      read_client = readContextclient;
    }
+   CATCH_DUMP_ATTR
 
    CContextClient* CFile::getReadContextClient()
+   TRY
    {
      return read_client;
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1070,7 +1154,9 @@
    */
    void CFile::sendAddField(const string& id, CContextClient* client)
+   TRY
    {
       sendAddItem(id, EVENT_ID_ADD_FIELD, client);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1079,7 +1165,9 @@
    */
    void CFile::sendAddFieldGroup(const string& id, CContextClient* client)
+   TRY
    {
       sendAddItem(id, (int)EVENT_ID_ADD_FIELD_GROUP, client);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1088,4 +1176,5 @@
    */
    void CFile::recvAddField(CEventServer& event)
+   TRY
    {
 
@@ -1095,4 +1184,5 @@
       get(id)->recvAddField(*buffer);
    }
+   CATCH
 
    /*!
@@ -1101,4 +1191,5 @@
    */
    void CFile::recvAddField(CBufferIn& buffer)
+   TRY
    {
       string id;
@@ -1106,4 +1197,5 @@
       addField(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1112,4 +1204,5 @@
    */
    void CFile::recvAddFieldGroup(CEventServer& event)
+   TRY
    {
 
@@ -1119,4 +1212,5 @@
       get(id)->recvAddFieldGroup(*buffer);
    }
+   CATCH
 
    /*!
@@ -1125,4 +1219,5 @@
    */
    void CFile::recvAddFieldGroup(CBufferIn& buffer)
+   TRY
    {
       string id;
@@ -1130,4 +1225,5 @@
       addFieldGroup(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1138,4 +1234,5 @@
    */
    void CFile::sendAddAllVariables(CContextClient* client)
+   TRY
    {
      std::vector<CVariable*> allVar = getAllVariables();
@@ -1150,4 +1247,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1157,7 +1255,9 @@
    */
    void CFile::sendAddVariableGroup(const string& id, CContextClient* client)
+   TRY
    {
       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE_GROUP, client);
    }
+   CATCH_DUMP_ATTR
 
    /*
@@ -1167,7 +1267,9 @@
    */
    void CFile::sendAddVariable(const string& id, CContextClient* client)
+   TRY
    {
       sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1176,6 +1278,6 @@
    */
    void CFile::recvAddVariable(CEventServer& event)
-   {
-
+   TRY
+   {
       CBufferIn* buffer = event.subEvents.begin()->buffer;
       string id;
@@ -1183,4 +1285,5 @@
       get(id)->recvAddVariable(*buffer);
    }
+   CATCH
 
    /*!
@@ -1189,4 +1292,5 @@
    */
    void CFile::recvAddVariable(CBufferIn& buffer)
+   TRY
    {
       string id;
@@ -1194,4 +1298,5 @@
       addVariable(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1200,4 +1305,5 @@
    */
    void CFile::recvAddVariableGroup(CEventServer& event)
+   TRY
    {
 
@@ -1207,4 +1313,5 @@
       get(id)->recvAddVariableGroup(*buffer);
    }
+   CATCH
 
    /*!
@@ -1213,4 +1320,5 @@
    */
    void CFile::recvAddVariableGroup(CBufferIn& buffer)
+   TRY
    {
       string id;
@@ -1218,4 +1326,5 @@
       addVariableGroup(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1227,4 +1336,5 @@
    */
    void CFile::sendEnabledFields(CContextClient* client)
+   TRY
    {
      size_t size = this->enabledFields.size();
@@ -1238,5 +1348,5 @@
      }
    }
-
+   CATCH_DUMP_ATTR
 
    /*!
@@ -1248,4 +1358,5 @@
    */
    bool CFile::dispatchEvent(CEventServer& event)
+   TRY
    {
       if (SuperClass::dispatchEvent(event)) return true;
@@ -1279,7 +1390,26 @@
       }
    }
-
-
-
+   CATCH
+
+   ///--------------------------------------------------------------
+   /*!
+   */
+   StdString CFile::dumpClassAttributes(void)
+   {
+     StdString str;
+     CContext* context = CContext::getCurrent();
+     str.append("context=\"");
+     str.append(context->getId());
+     str.append("\"");
+     str.append(" enabled fields=\"");
+     int size = this->enabledFields.size();
+     for (int i = 0; i < size; ++i)
+     {
+       str.append(this->enabledFields[i]->getId());
+       str.append(" ");
+     }
+     str.append("\"");
+     return str;
+   }
 
    ///---------------------------------------------------------------
Index: XIOS/dev/branch_openmp/src/node/file.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/file.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/file.hpp	(revision 1642)
@@ -4,5 +4,4 @@
 /// XIOS headers ///
 #include "xios_spl.hpp"
-#include "mpi_std.hpp"
 #include "field.hpp"
 #include "data_output.hpp"
@@ -13,5 +12,5 @@
 #include "attribute_enum_impl.hpp"
 #include "context_client.hpp"
-
+#include "mpi.hpp"
 
 namespace xios {
@@ -82,4 +81,6 @@
                                                 int default_level = 1,
                                                 bool default_enabled = true);
+
+         StdString dumpClassAttributes(void);
 
       public :
Index: XIOS/dev/branch_openmp/src/node/generate_rectilinear_domain.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/generate_rectilinear_domain.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/generate_rectilinear_domain.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CGenerateRectilinearDomain
 
Index: XIOS/dev/branch_openmp/src/node/grid.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/grid.cpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/grid.cpp	(revision 1642)
@@ -82,11 +82,14 @@
 
    StdSize CGrid::getDimension(void)
+   TRY
    {
       return getGlobalDimension().size();
    }
+   CATCH_DUMP_ATTR
 
    //---------------------------------------------------------------
 
    StdSize CGrid::getDataSize(void) const
+   TRY
    {
      StdSize retvalue = 1;
@@ -98,4 +101,5 @@
      return retvalue;
    }
+   CATCH
 
    /*!
@@ -106,4 +110,5 @@
     */
    std::map<int, StdSize> CGrid::getAttributesBufferSize(CContextClient* client, bool bufferForWriting)
+   TRY
    {
      std::map<int, StdSize> attributesSizes = getMinimumBufferSizeForAttributes(client);
@@ -147,4 +152,5 @@
      return attributesSizes;
   }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -156,4 +162,5 @@
     */
    std::map<int, StdSize> CGrid::getDataBufferSize(CContextClient* client, const std::string& id /*= ""*/, bool bufferForWriting /*= "false"*/)
+   TRY
    {     
      // The record index is sometimes sent along with the data but we always
@@ -180,6 +187,8 @@
      return dataSizes;
    }
+   CATCH_DUMP_ATTR
 
    size_t CGrid::getGlobalWrittenSize(void)
+   TRY
    {
 	 std::vector<CDomain*> domainP = this->getDomains();
@@ -191,7 +200,8 @@
      return globalGridSize ;
    }
-   
+   CATCH_DUMP_ATTR
    
    void CGrid::checkAttributesAfterTransformation()
+   TRY
    {
       setAxisList();
@@ -228,4 +238,5 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //---------------------------------------------------------------
@@ -237,19 +248,25 @@
     */
    bool CGrid::isCompressible(void) const
+   TRY
    {
       return isCompressible_;
    }
+   CATCH
 
    //---------------------------------------------------------------
 
    void CGrid::addRelFileCompressed(const StdString& filename)
+   TRY
    {
       this->relFilesCompressed.insert(filename);
    }
+   CATCH_DUMP_ATTR
 
    bool CGrid::isWrittenCompressed(const StdString& filename) const
+   TRY
    {
       return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end());
    }
+   CATCH
 
    //---------------------------------------------------------------
@@ -258,4 +275,5 @@
    */
    void CGrid::solveDomainAxisRef(bool areAttributesChecked)
+   TRY
    {
      if (this->isDomainAxisChecked) return;
@@ -266,4 +284,5 @@
      this->isDomainAxisChecked = areAttributesChecked;
    }
+   CATCH_DUMP_ATTR
 
    /*
@@ -272,4 +291,5 @@
    */
    void CGrid::solveDomainAxisBaseRef()
+   TRY
    {
      if (this->hasDomainAxisBaseRef_) return;
@@ -297,12 +317,16 @@
      this->hasDomainAxisBaseRef_ = true;
    }
+   CATCH_DUMP_ATTR
 
    void CGrid::checkEligibilityForCompressedOutput()
+   TRY
    {
      // We don't check if the mask is valid here, just if a mask has been defined at this point.
      isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !mask_3d.isEmpty();
    }
+   CATCH_DUMP_ATTR
 
    void CGrid::checkMaskIndex(bool doSendingIndex)
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -339,4 +363,12 @@
       this->isChecked = true;
    }
+   CATCH_DUMP_ATTR
+   bool CGrid::hasMask() const
+   TRY
+   {
+     return (!mask_1d.isEmpty() || !mask_2d.isEmpty() || !mask_3d.isEmpty() ||
+             !mask_4d.isEmpty() || !mask_5d.isEmpty() || !mask_6d.isEmpty() || !mask_7d.isEmpty());
+   }
+   CATCH
 
    /*
@@ -344,4 +376,5 @@
    */
    void CGrid::createMask(void)
+   TRY
    {
       using namespace std;
@@ -381,4 +414,5 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    /*
@@ -386,4 +420,5 @@
    */
    void CGrid::checkMask(void)
+   TRY
    {
       using namespace std;
@@ -423,50 +458,6 @@
       }
    }
-
-
-/*!
-  A grid can have multiple dimension, so can its mask in the form of multi-dimension array.
-It's not a good idea to store all multi-dimension arrays corresponding to each mask.
-One of the ways is to convert this array into 1-dimension one and every process is taken place on it.
-  \param [in] multi-dimension array grid mask
-*/
-
-  void CGrid::getLocalMask(CArray<bool,1>& localMask)
-  {
-      std::vector<CDomain*> domainP = this->getDomains();
-      std::vector<CAxis*> axisP = this->getAxis();
-      int dim = domainP.size() * 2 + axisP.size();
-
-      switch (dim)
-      {
-        case 0:
-          getLocalMask(mask_0d, localMask);
-          break;
-        case 1:
-          getLocalMask(mask_1d, localMask);
-          break;
-        case 2:
-          getLocalMask(mask_2d, localMask);
-          break;
-        case 3:
-          getLocalMask(mask_3d, localMask);
-          break;
-        case 4:
-          getLocalMask(mask_4d, localMask);
-          break;
-        case 5:
-          getLocalMask(mask_5d, localMask);
-          break;
-        case 6:
-          getLocalMask(mask_6d, localMask);
-          break;
-        case 7:
-          getLocalMask(mask_7d, localMask);
-          break;
-        default:
-          break;
-      }
-  }
-      
+   CATCH_DUMP_ATTR
+
    /*
      Modify value of mask in a certain index
@@ -476,4 +467,5 @@
    */
    void CGrid::modifyMask(const CArray<int,1>& indexToModify, bool modifyValue)
+   TRY
    {
       using namespace std;
@@ -511,4 +503,5 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    /*
@@ -518,4 +511,5 @@
    */
    void CGrid::modifyMaskSize(const std::vector<int>& newDimensionSize, bool newValue)
+   TRY
    {      
       std::vector<CDomain*> domainP = this->getDomains();
@@ -552,8 +546,10 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //---------------------------------------------------------------
 
    void CGrid::solveDomainRef(bool sendAtt)
+   TRY
    {
       setDomainList();
@@ -568,8 +564,10 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //---------------------------------------------------------------
 
    void CGrid::solveAxisRef(bool sendAtt)
+   TRY
    {
       setAxisList();
@@ -599,8 +597,10 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //---------------------------------------------------------------
 
    void CGrid::solveScalarRef(bool sendAtt)
+   TRY
    {
       setScalarList();
@@ -616,4 +616,5 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -621,4 +622,5 @@
    */
    void CGrid::computeWrittenIndex()
+   TRY
    {      
       if (computedWrittenIndex_) return;
@@ -659,6 +661,6 @@
         {
           CContextServer* server = CContext::getCurrent()->server;      
-          MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
-          MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);
+          ep_lib::MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, EP_INT, EP_SUM, server->intraComm);
+          ep_lib::MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, EP_INT, EP_SUM, server->intraComm);
           offsetWrittenIndexes_ -= numberWrittenIndexes_;
         }
@@ -680,4 +682,5 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //---------------------------------------------------------------
@@ -690,15 +693,20 @@
    */
    void CGrid::computeClientIndex()
+   TRY
    {
      CContext* context = CContext::getCurrent();
 
-     CContextClient* client = context->client;  // Here it's not important which contextClient to recuperate
+     CContextClient* client = context->client;
      int rank = client->clientRank;
 
      clientDistribution_ = new CDistributionClient(rank, this);
      // Get local data index on client
-     storeIndex_client.resize(clientDistribution_->getLocalDataIndexOnClient().size());
-     int nbStoreIndex = storeIndex_client.numElements();
+     int nbStoreIndex = clientDistribution_->getLocalDataIndexOnClient().size();
+     int nbStoreGridMask = clientDistribution_->getLocalMaskIndexOnClient().size();
+     // nbStoreGridMask = nbStoreIndex if grid mask is defined, and 0 otherwise
+     storeIndex_client.resize(nbStoreIndex);
+     storeMask_client.resize(nbStoreGridMask);
      for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx];
+     for (int idx = 0; idx < nbStoreGridMask; ++idx) storeMask_client(idx) = (clientDistribution_->getLocalMaskIndexOnClient())[idx];
 
      if (0 == serverDistribution_) isDataDistributed_= clientDistribution_->isDataDistributed();
@@ -746,4 +754,5 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -751,4 +760,5 @@
    */
    void CGrid::computeConnectedClients()
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -840,8 +850,33 @@
           connectedServerRank_[receiverSize].push_back(client->clientRank % client->serverSize);
 
+         // Now check if all servers have data to receive. If not, master client will send empty data.
+         // This ensures that all servers will participate in collective calls upon receiving even if they have no date to receive.
+         std::vector<int> counts (client->clientSize);
+         std::vector<int> displs (client->clientSize);
+         displs[0] = 0;
+         int localCount = connectedServerRank_[receiverSize].size() ;
+         ep_lib::MPI_Gather(&localCount, 1, EP_INT, &counts[0], 1, EP_INT, 0, client->intraComm) ;
+         for (int i = 0; i < client->clientSize-1; ++i)
+         {
+           displs[i+1] = displs[i] + counts[i];
+         }
+         std::vector<int> allConnectedServers(displs[client->clientSize-1]+counts[client->clientSize-1]);
+         ep_lib::MPI_Gatherv(&(connectedServerRank_[receiverSize])[0], localCount, EP_INT, &allConnectedServers[0], &counts[0], &displs[0], EP_INT, 0, client->intraComm);
+
+         if ((allConnectedServers.size() != receiverSize) && (client->clientRank == 0))
+         {
+           std::vector<bool> isSrvConnected (receiverSize, false);
+           for (int i = 0; i < allConnectedServers.size(); ++i) isSrvConnected[allConnectedServers[i]] = true;
+           for (int i = 0; i < receiverSize; ++i)
+           {
+             if (!isSrvConnected[i]) connectedServerRank_[receiverSize].push_back(i);
+           }
+         }
+
          nbSenders[receiverSize] = clientServerMap_->computeConnectedClients(receiverSize, client->clientSize, client->intraComm, connectedServerRank_[receiverSize]);
        }
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -853,4 +888,5 @@
    */
    void CGrid::computeIndex(void)
+   TRY
    {
      CContext* context = CContext::getCurrent();
@@ -879,4 +915,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -892,4 +929,5 @@
                                      const CContextClient* client,
                                      CClientServerMapping::GlobalIndexMap& globalIndexOnServer)
+   TRY
    {
      int serverSize = client->serverSize;
@@ -1058,7 +1096,9 @@
     }
    }
-   //----------------------------------------------------------------
+   CATCH_DUMP_ATTR
+//----------------------------------------------------------------
 
    CGrid* CGrid::createGrid(CDomain* domain)
+   TRY
    {
       std::vector<CDomain*> vecDom(1, domain);
@@ -1067,7 +1107,9 @@
       return createGrid(vecDom, vecAxis);
    }
+   CATCH
 
    CGrid* CGrid::createGrid(CDomain* domain, CAxis* axis)
-   {
+   TRY
+  {
       std::vector<CDomain*> vecDom(1, domain);
       std::vector<CAxis*> vecAxis(1, axis);
@@ -1075,20 +1117,26 @@
       return createGrid(vecDom, vecAxis);
    }
+   CATCH
 
    CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis,
                             const CArray<int,1>& axisDomainOrder)
+   TRY
    {
      std::vector<CScalar*> vecScalar;
      return createGrid(generateId(domains, axis, vecScalar, axisDomainOrder), domains, axis, vecScalar, axisDomainOrder);
    }
+   CATCH
 
    CGrid* CGrid::createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis,
                             const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder)
+   TRY
    {
      return createGrid(generateId(domains, axis, scalars, axisDomainOrder), domains, axis, scalars, axisDomainOrder);
    }
+   CATCH
 
    CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis,
                             const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder)
+   TRY
    {
       if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size()))
@@ -1132,6 +1180,8 @@
       return grid;
    }
+   CATCH
 
    CGrid* CGrid::cloneGrid(const StdString& idNewGrid, CGrid* gridSrc)
+   TRY
    {
      std::vector<CDomain*> domainSrcTmp = gridSrc->getDomains(), domainSrc;
@@ -1173,7 +1223,9 @@
       return grid;
    }
+   CATCH
 
    StdString CGrid::generateId(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis,
                                const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder)
+   TRY
    {
       if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size() + scalars.size()))
@@ -1216,6 +1268,8 @@
       return id.str();
    }
+   CATCH
 
    StdString CGrid::generateId(const CGrid* gridSrc, const CGrid* gridDest)
+   TRY
    {
      StdString idSrc  = gridSrc->getId();
@@ -1227,21 +1281,28 @@
      return id.str();
    }
+   CATCH
 
    //----------------------------------------------------------------
 
    CDomainGroup* CGrid::getVirtualDomainGroup() const
+   TRY
    {
      return this->vDomainGroup_;
    }
+   CATCH
 
    CAxisGroup* CGrid::getVirtualAxisGroup() const
+   TRY
    {
      return this->vAxisGroup_;
    }
+   CATCH
 
    CScalarGroup* CGrid::getVirtualScalarGroup() const
+   TRY
    {
      return this->vScalarGroup_;
    }
+   CATCH
 
 /*
@@ -1279,4 +1340,5 @@
 
    void CGrid::storeField_arr(const double* const data, CArray<double, 1>& stored) const
+   TRY
    {
       const StdSize size = storeIndex_client.numElements();
@@ -1285,6 +1347,8 @@
       for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)];
    }
+   CATCH
 
    void CGrid::restoreField_arr(const CArray<double, 1>& stored, double* const data) const
+   TRY
    {
       const StdSize size = storeIndex_client.numElements();
@@ -1292,22 +1356,32 @@
       for(StdSize i = 0; i < size; i++) data[storeIndex_client(i)] = stored(i);
    }
+   CATCH
+
+   void CGrid::maskField_arr(const double* const data, CArray<double, 1>& stored) const
+   {
+      const StdSize size = storeIndex_client.numElements();
+      stored.resize(size);
+      const double nanValue = std::numeric_limits<double>::quiet_NaN();
+
+      if (storeMask_client.numElements() != 0)
+        for(StdSize i = 0; i < size; i++) stored(i) = (storeMask_client(i)) ? data[storeIndex_client(i)] : nanValue;
+      else
+        for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)];
+   }
 
    void CGrid::uncompressField_arr(const double* const data, CArray<double, 1>& out) const
+   TRY
    {
       const std::vector<int>& localMaskedDataIndex = clientDistribution_->getLocalMaskedDataIndexOnClient();
       const int size = localMaskedDataIndex.size();
-      
       for(int i = 0; i < size; ++i) out(localMaskedDataIndex[i]) = data[i];
    }
-
+   CATCH
 
   void CGrid::computeClientIndexScalarGrid()
+  TRY
   {
     CContext* context = CContext::getCurrent();    
-//    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; // This should be changed soon
-//    for (int p = 0; p < nbSrvPools; ++p)
-    {
-//      CContextClient* client = (context->hasServer) ? (context->hasClient ? context->clientPrimServer[p] : context->client)
-//                                                    : context->client;
+    {
       CContextClient* client = context->client;
 
@@ -1340,6 +1414,8 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   void CGrid::computeConnectedClientsScalarGrid()
+  TRY
   {
     CContext* context = CContext::getCurrent();    
@@ -1386,6 +1462,8 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   void CGrid::sendIndexScalarGrid()
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -1451,6 +1529,8 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   void CGrid::sendIndex(void)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -1572,6 +1652,8 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   void CGrid::recvIndex(CEventServer& event)
+  TRY
   {
     string gridId;
@@ -1589,6 +1671,8 @@
     get(gridId)->recvIndex(ranks, buffers);
   }
+  CATCH
 
   void CGrid::recvIndex(vector<int> ranks, vector<CBufferIn*> buffers)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -1631,6 +1715,6 @@
           std::vector<CDomain*> domainList = getDomains();
           std::vector<CAxis*> axisList = getAxis();
-          std::vector<int> nZoomBegin(ssize), nZoomSize(ssize), nGlob(ssize), nZoomBeginGlobal(ssize), nGlobElement(numElement);
-          std::vector<CArray<int,1> > globalZoomIndex(numElement);
+          std::vector<int> nBegin(ssize), nSize(ssize), nGlob(ssize), nBeginGlobal(ssize), nGlobElement(numElement);
+          std::vector<CArray<int,1> > globalIndex(numElement);
           for (int i = 0; i < numElement; ++i)
           {
@@ -1638,21 +1722,21 @@
             if (2 == axis_domain_order(i)) //domain
             {
-              nZoomBegin[indexMap[i]] = domainList[domainId]->zoom_ibegin;
-              nZoomSize[indexMap[i]]  = domainList[domainId]->zoom_ni;
-              nZoomBeginGlobal[indexMap[i]] = domainList[domainId]->global_zoom_ibegin;              
+              nBegin[indexMap[i]] = domainList[domainId]->ibegin;
+              nSize[indexMap[i]]  = domainList[domainId]->ni;
+              nBeginGlobal[indexMap[i]] = 0;
               nGlob[indexMap[i]] = domainList[domainId]->ni_glo;
 
-              nZoomBegin[indexMap[i] + 1] = domainList[domainId]->zoom_jbegin;
-              nZoomSize[indexMap[i] + 1] = domainList[domainId]->zoom_nj;
-              nZoomBeginGlobal[indexMap[i] + 1] = domainList[domainId]->global_zoom_jbegin;              
+              nBegin[indexMap[i] + 1] = domainList[domainId]->jbegin;
+              nSize[indexMap[i] + 1] = domainList[domainId]->nj;
+              nBeginGlobal[indexMap[i] + 1] = 0;
               nGlob[indexMap[i] + 1] = domainList[domainId]->nj_glo;
 
               {
                 int count = 0;
-                globalZoomIndex[i].resize(nZoomSize[indexMap[i]]*nZoomSize[indexMap[i]+1]);
-                for (int jdx = 0; jdx < nZoomSize[indexMap[i]+1]; ++jdx)
-                  for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx)                
+                globalIndex[i].resize(nSize[indexMap[i]]*nSize[indexMap[i]+1]);
+                for (int jdx = 0; jdx < nSize[indexMap[i]+1]; ++jdx)
+                  for (int idx = 0; idx < nSize[indexMap[i]]; ++idx)
                   {
-                    globalZoomIndex[i](count) = (nZoomBegin[indexMap[i]] + idx) + (nZoomBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]];
+                    globalIndex[i](count) = (nBegin[indexMap[i]] + idx) + (nBegin[indexMap[i]+1] + jdx) * nGlob[indexMap[i]];
                     ++count;
                   }
@@ -1663,18 +1747,11 @@
             else if (1 == axis_domain_order(i)) // axis
             {
-              nZoomBegin[indexMap[i]] = axisList[axisId]->zoom_begin;
-              nZoomSize[indexMap[i]]  = axisList[axisId]->zoom_n;
-              nZoomBeginGlobal[indexMap[i]] = axisList[axisId]->global_zoom_begin;              
+              nBegin[indexMap[i]] = axisList[axisId]->begin;
+              nSize[indexMap[i]]  = axisList[axisId]->n;
+              nBeginGlobal[indexMap[i]] = 0;
               nGlob[indexMap[i]] = axisList[axisId]->n_glo;     
-              if (axisList[axisId]->zoomByIndex())
-              {
-                globalZoomIndex[i].reference(axisList[axisId]->zoom_index);                
-              }
-              else
-              {
-                globalZoomIndex[i].resize(nZoomSize[indexMap[i]]);
-                for (int idx = 0; idx < nZoomSize[indexMap[i]]; ++idx)
-                  globalZoomIndex[i](idx) = nZoomBegin[indexMap[i]] + idx;
-              }
+              globalIndex[i].resize(nSize[indexMap[i]]);
+              for (int idx = 0; idx < nSize[indexMap[i]]; ++idx)
+                globalIndex[i](idx) = nBegin[indexMap[i]] + idx;
 
               ++axisId;
@@ -1682,10 +1759,10 @@
             else // scalar
             { 
-              nZoomBegin[indexMap[i]] = 0;
-              nZoomSize[indexMap[i]]  = 1;
-              nZoomBeginGlobal[indexMap[i]] = 0;              
+              nBegin[indexMap[i]] = 0;
+              nSize[indexMap[i]]  = 1;
+              nBeginGlobal[indexMap[i]] = 0;
               nGlob[indexMap[i]] = 1;
-              globalZoomIndex[i].resize(1);
-              globalZoomIndex[i](0) = 0;
+              globalIndex[i].resize(1);
+              globalIndex[i](0) = 0;
               ++scalarId;
             }
@@ -1693,9 +1770,9 @@
           dataSize = 1;
 
-          for (int i = 0; i < nZoomSize.size(); ++i)
-            dataSize *= nZoomSize[i];
+          for (int i = 0; i < nSize.size(); ++i)
+            dataSize *= nSize[i];
           serverDistribution_ = new CDistributionServer(server->intraCommRank, 
-                                                        globalZoomIndex, axis_domain_order,
-                                                        nZoomBegin, nZoomSize, nZoomBeginGlobal, nGlob);
+                                                        globalIndex, axis_domain_order,
+                                                        nBegin, nSize, nBeginGlobal, nGlob);
         }
 
@@ -1760,40 +1837,4 @@
           nGlob.push_back(1);  
         }
-
-        modifyMaskSize(nSize, false);
-
-        // These below codes are reserved for future
-        CDistributionServer srvDist(server->intraCommRank, nBegin, nSize, nBeginGlobal, nGlob); 
-        map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(),
-                                               ite = outGlobalIndexFromClient.end(), it;  
-        const CDistributionServer::GlobalLocalMap&  globalLocalMask = srvDist.getGlobalLocalIndex();
-        CDistributionServer::GlobalLocalMap::const_iterator itSrv;
-        size_t nb = 0;
-        for (it = itb; it != ite; ++it)
-        {
-          CArray<size_t,1>& globalInd = it->second;
-          for (size_t idx = 0; idx < globalInd.numElements(); ++idx)
-          {
-            if (globalLocalMask.end() != globalLocalMask.find(globalInd(idx))) ++nb;
-          }
-        }
-        
-        CArray<int,1> indexToModify(nb);
-        nb = 0;    
-        for (it = itb; it != ite; ++it)
-        {
-          CArray<size_t,1>& globalInd = it->second;
-          for (size_t idx = 0; idx < globalInd.numElements(); ++idx)
-          {
-            itSrv = globalLocalMask.find(globalInd(idx));
-            if (globalLocalMask.end() != itSrv) 
-            {
-              indexToModify(nb) = itSrv->second;
-              ++nb;
-            }
-          }
-        }
-
-        modifyMask(indexToModify, true);
       }
 
@@ -1803,4 +1844,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*
@@ -1818,5 +1860,6 @@
                                         const std::vector<CScalar*> scalars,
                                         const CArray<int,1>& axisDomainOrder)
-  {
+  TRY
+ {
  //   globalDim.resize(domains.size()*2+axis.size()+scalars.size());
     globalDim.resize(domains.size()*2+axis.size());
@@ -1858,7 +1901,9 @@
     return positionDimensionDistributed;
   }
+  CATCH_DUMP_ATTR
 
   // Retrieve the global dimension of grid
   std::vector<int> CGrid::getGlobalDimension()
+  TRY
   {
     std::vector<int> globalDim;
@@ -1867,16 +1912,21 @@
     return globalDim;
   }
+  CATCH_DUMP_ATTR
 
   // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension)
   int CGrid::getDistributedDimension()
+  TRY
   {
     std::vector<int> globalDim;
     return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order);    
   }
+  CATCH_DUMP_ATTR
 
   bool CGrid::isScalarGrid() const
+  TRY
   {
     return (axisList_.empty() && domList_.empty());
   }
+  CATCH
 
   /*!
@@ -1886,7 +1936,9 @@
   */
   bool CGrid::doGridHaveDataToWrite()
+  TRY
   {
      return (0 != writtenDataSize_);
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -1897,7 +1949,9 @@
   */
   size_t CGrid::getWrittenDataSize() const
+  TRY
   {
     return writtenDataSize_;
   }
+  CATCH
 
   /*!
@@ -1906,7 +1960,9 @@
   */
   int CGrid::getNumberWrittenIndexes() const
+  TRY
   {
     return numberWrittenIndexes_;
   }
+  CATCH
 
   /*!
@@ -1915,7 +1971,9 @@
   */
   int CGrid::getTotalNumberWrittenIndexes() const
+  TRY
   {
     return totalNumberWrittenIndexes_;
   }
+  CATCH
 
   /*!
@@ -1924,19 +1982,26 @@
   */
   int CGrid::getOffsetWrittenIndexes() const
+  TRY
   {
     return offsetWrittenIndexes_;
   }
+  CATCH
 
   CDistributionServer* CGrid::getDistributionServer()
+  TRY
   {
     return serverDistribution_;
   }
+  CATCH_DUMP_ATTR
 
   CDistributionClient* CGrid::getDistributionClient()
+  TRY
   {
     return clientDistribution_;
   }
+  CATCH_DUMP_ATTR
 
   bool CGrid::doGridHaveDataDistributed(CContextClient* client)
+  TRY
   {
     if (isScalarGrid()) return false;
@@ -1948,4 +2013,5 @@
       return isDataDistributed_;    
   }
+  CATCH_DUMP_ATTR
 
    /*!
@@ -1957,4 +2023,5 @@
    */
   bool CGrid::dispatchEvent(CEventServer& event)
+  TRY
   {
 
@@ -1990,8 +2057,10 @@
     }
   }
+  CATCH
 
    ///---------------------------------------------------------------
 
    CDomain* CGrid::addDomain(const std::string& id)
+   TRY
    {
      order_.push_back(2);
@@ -2000,6 +2069,8 @@
      return vDomainGroup_->createChild(id);
    }
+   CATCH_DUMP_ATTR
 
    CAxis* CGrid::addAxis(const std::string& id)
+   TRY
    {
      order_.push_back(1);
@@ -2008,6 +2079,8 @@
      return vAxisGroup_->createChild(id);
    }
+   CATCH_DUMP_ATTR
 
    CScalar* CGrid::addScalar(const std::string& id)
+   TRY
    {
      order_.push_back(0);
@@ -2016,22 +2089,29 @@
      return vScalarGroup_->createChild(id);
    }
+   CATCH_DUMP_ATTR
 
    //! Change virtual field group to a new one
    void CGrid::setVirtualDomainGroup(CDomainGroup* newVDomainGroup)
+   TRY
    {
       this->vDomainGroup_ = newVDomainGroup;
    }
+   CATCH_DUMP_ATTR
 
    //! Change virtual variable group to new one
    void CGrid::setVirtualAxisGroup(CAxisGroup* newVAxisGroup)
+   TRY
    {
       this->vAxisGroup_ = newVAxisGroup;
    }
+   CATCH_DUMP_ATTR
 
    //! Change virtual variable group to new one
    void CGrid::setVirtualScalarGroup(CScalarGroup* newVScalarGroup)
+   TRY
    {
       this->vScalarGroup_ = newVScalarGroup;
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -2040,7 +2120,9 @@
    */
    void CGrid::sendAddDomain(const string& id)
-   {
+   TRY
+  {
       sendAddItem(id, (int)EVENT_ID_ADD_DOMAIN);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -2049,7 +2131,9 @@
    */
    void CGrid::sendAddAxis(const string& id)
+   TRY
    {
       sendAddItem(id, (int)EVENT_ID_ADD_AXIS);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -2058,7 +2142,9 @@
    */
    void CGrid::sendAddScalar(const string& id)
+   TRY
    {
       sendAddItem(id, (int)EVENT_ID_ADD_SCALAR);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -2067,4 +2153,5 @@
    */
    void CGrid::recvAddDomain(CEventServer& event)
+   TRY
    {
 
@@ -2074,4 +2161,5 @@
       get(id)->recvAddDomain(*buffer);
    }
+   CATCH
 
    /*!
@@ -2080,4 +2168,5 @@
    */
    void CGrid::recvAddDomain(CBufferIn& buffer)
+   TRY
    {
       string id;
@@ -2085,4 +2174,5 @@
       addDomain(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -2091,4 +2181,5 @@
    */
    void CGrid::recvAddAxis(CEventServer& event)
+   TRY
    {
 
@@ -2098,4 +2189,5 @@
       get(id)->recvAddAxis(*buffer);
    }
+   CATCH
 
    /*!
@@ -2104,4 +2196,5 @@
    */
    void CGrid::recvAddAxis(CBufferIn& buffer)
+   TRY
    {
       string id;
@@ -2109,4 +2202,5 @@
       addAxis(id);
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -2115,4 +2209,5 @@
    */
    void CGrid::recvAddScalar(CEventServer& event)
+   TRY
    {
 
@@ -2122,4 +2217,5 @@
       get(id)->recvAddScalar(*buffer);
    }
+   CATCH
 
    /*!
@@ -2128,4 +2224,5 @@
    */
    void CGrid::recvAddScalar(CBufferIn& buffer)
+   TRY
    {
       string id;
@@ -2133,4 +2230,5 @@
       addScalar(id);
    }
+   CATCH_DUMP_ATTR
 
   /*!
@@ -2141,4 +2239,5 @@
   */
   void CGrid::solveDomainAxisRefInheritance(bool apply)
+  TRY
   {
     CContext* context = CContext::getCurrent();
@@ -2181,30 +2280,41 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   bool CGrid::isTransformed()
+  TRY
   {
     return isTransformed_;
   }
+  CATCH_DUMP_ATTR
 
   void CGrid::setTransformed()
+  TRY
   {
     isTransformed_ = true;
   }
+  CATCH_DUMP_ATTR
 
   CGridTransformation* CGrid::getTransformations()
+  TRY
   {
     return transformations_;
   }
+  CATCH_DUMP_ATTR
 
   void CGrid::addTransGridSource(CGrid* gridSrc)
+  TRY
   {
     if (gridSrc_.end() == gridSrc_.find(gridSrc))
       gridSrc_.insert(make_pair(gridSrc,make_pair(false,"")));
   }
+  CATCH_DUMP_ATTR
 
   std::map<CGrid*,std::pair<bool,StdString> >& CGrid::getTransGridSource()
+  TRY
   {
     return gridSrc_;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2213,4 +2323,5 @@
   */
   void CGrid::completeGrid(CGrid* transformGridSrc)
+  TRY
   {
     if (0 != transformGridSrc)
@@ -2231,16 +2342,22 @@
     gridGenerate.completeGrid();
   }
+  CATCH_DUMP_ATTR
 
   bool CGrid::isGenerated()
+  TRY
   {
     return isGenerated_;
   }
+  CATCH
 
   void CGrid::setGenerated()
+  TRY
   {
     isGenerated_ = true;
   }
+  CATCH_DUMP_ATTR
 
   void CGrid::transformGrid(CGrid* transformGridSrc)
+  TRY
   {
     if (!transformGridSrc)
@@ -2268,6 +2385,8 @@
     transformGridSrc->checkMaskIndex(false);
   }
+  CATCH_DUMP_ATTR
 
   bool CGrid::hasTransform()
+  TRY
   {
     if (hasTransform_) return hasTransform_;
@@ -2283,4 +2402,5 @@
     return hasTransform_;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2289,4 +2409,5 @@
   */
   std::vector<CDomain*> CGrid::getDomains()
+  TRY
   {
     std::vector<CDomain*> domList;
@@ -2297,4 +2418,5 @@
     return domList;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2303,4 +2425,5 @@
   */
   std::vector<CAxis*> CGrid::getAxis()
+  TRY
   {
     std::vector<CAxis*> aList;
@@ -2310,4 +2433,5 @@
     return aList;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2316,4 +2440,5 @@
   */
   std::vector<CScalar*> CGrid::getScalars()
+  TRY
   {
     std::vector<CScalar*> sList;
@@ -2323,4 +2448,5 @@
     return sList;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2329,4 +2455,5 @@
   */
   CDomain* CGrid::getDomain(int domainIndex)
+  TRY
   {
     std::vector<CDomain*> domainListP = this->getDomains();
@@ -2346,4 +2473,5 @@
     return domainListP[domainIndex];
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2352,4 +2480,5 @@
   */
   CAxis* CGrid::getAxis(int axisIndex)
+  TRY
   {
     std::vector<CAxis*> axisListP = this->getAxis();
@@ -2369,4 +2498,5 @@
     return axisListP[axisIndex];
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2375,4 +2505,5 @@
   */
   CScalar* CGrid::getScalar(int scalarIndex)
+  TRY
   {
     std::vector<CScalar*> scalarListP = this->getScalars();
@@ -2392,4 +2523,5 @@
     return scalarListP[scalarIndex];
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2398,4 +2530,5 @@
   */
   void CGrid::setDomainList(const std::vector<CDomain*> domains)
+  TRY
   {
     if (isDomListSet) return;
@@ -2418,6 +2551,6 @@
       isDomListSet = true;
     }
-
-  }
+  }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2426,4 +2559,5 @@
   */
   void CGrid::setAxisList(const std::vector<CAxis*> axis)
+  TRY
   {
     if (isAxisListSet) return;
@@ -2447,4 +2581,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2453,4 +2588,5 @@
   */
   void CGrid::setScalarList(const std::vector<CScalar*> scalars)
+  TRY
   {
     if (isScalarListSet) return;
@@ -2474,4 +2610,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2480,8 +2617,10 @@
   */
   std::vector<StdString> CGrid::getDomainList()
+  TRY
   {
     setDomainList();
     return domList_;
   }
+  CATCH
 
   /*!
@@ -2490,8 +2629,10 @@
   */
   std::vector<StdString> CGrid::getAxisList()
+  TRY
   {
     setAxisList();
     return axisList_;
   }
+  CATCH
 
   /*!
@@ -2500,8 +2641,10 @@
   */
   std::vector<StdString> CGrid::getScalarList()
+  TRY
   {
     setScalarList();
     return scalarList_;
   }
+  CATCH
 
   /*!
@@ -2509,4 +2652,5 @@
   */
   void CGrid::sendAllDomains()
+  TRY
   {
     std::vector<CDomain*> domList = this->getVirtualDomainGroup()->getAllChildren();
@@ -2518,4 +2662,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2523,4 +2668,5 @@
   */
   void CGrid::sendAllAxis()
+  TRY
   {
     std::vector<CAxis*> aList = this->getVirtualAxisGroup()->getAllChildren();
@@ -2533,4 +2679,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2538,4 +2685,5 @@
   */
   void CGrid::sendAllScalars()
+  TRY
   {
     std::vector<CScalar*> sList = this->getVirtualScalarGroup()->getAllChildren();
@@ -2548,6 +2696,8 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   void CGrid::setContextClient(CContextClient* contextClient)
+  TRY
   {
     if (clientsSet.find(contextClient)==clientsSet.end())
@@ -2561,4 +2711,5 @@
     	this->getAxis()[i]->setContextClient(contextClient);
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2566,4 +2717,5 @@
   */
   void CGrid::parse(xml::CXMLNode& node)
+  TRY
   {
     SuperClass::parse(node);
@@ -2606,3 +2758,5 @@
     setScalarList();
    }
+  CATCH_DUMP_ATTR
+
 } // namespace xios
Index: XIOS/dev/branch_openmp/src/node/grid.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/grid.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/grid.hpp	(revision 1642)
@@ -19,5 +19,5 @@
 namespace xios {
 
-   /// ////////////////////// Dï¿œï¿œclarations ////////////////////// ///
+   /// ////////////////////// Declarations ////////////////////// ///
 
    class CGridGroup;
@@ -91,7 +91,9 @@
          StdSize  getDataSize(void) const;
 
-         /// Entrï¿œï¿œes-sorties de champs
+         /// Entrees-sorties de champs
          template <int n>
          void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const;
+         template <int n>
+         void maskField(const CArray<double,n>& field, CArray<double,1>& stored) const;
          template <int n>
          void outputField(const CArray<double,1>& stored, CArray<double,n>& field) const;  
@@ -203,9 +205,7 @@
          bool hasTransform();
          size_t getGlobalWrittenSize(void) ;
-         void getLocalMask(CArray<bool,1>& localMask) ;
-         template<int N>
-         void getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) ;
       public:
          CArray<int, 1> storeIndex_client;
+         CArray<bool, 1> storeMask_client;
 
 /** Map containing indexes that will be sent in sendIndex(). */
@@ -247,4 +247,5 @@
          CArray<size_t,1> indexFromClients;
 
+         bool hasMask(void) const;
          void checkMask(void);
          void createMask(void);
@@ -273,4 +274,5 @@
         void restoreField_arr(const CArray<double, 1>& stored, double* const data) const;
         void uncompressField_arr(const double* const data, CArray<double, 1>& outData) const;
+        void maskField_arr(const double* const data, CArray<double, 1>& stored) const;
 
         void setVirtualDomainGroup(CDomainGroup* newVDomainGroup);
@@ -372,4 +374,5 @@
    template <int n>
    void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const
+   TRY
    {
 //#ifdef __XIOS_DEBUG
@@ -383,7 +386,23 @@
       this->storeField_arr(field.dataFirst(), stored);
    }
+   CATCH
+
+   template <int n>
+   void CGrid::maskField(const CArray<double,n>& field, CArray<double,1>& stored) const
+   {
+//#ifdef __XIOS_DEBUG
+      if (this->getDataSize() != field.numElements())
+         ERROR("void CGrid::inputField(const  CArray<double,n>& field, CArray<double,1>& stored) const",
+                << "[ Awaiting data of size = " << this->getDataSize() << ", "
+                << "Received data size = "      << field.numElements() << " ] "
+                << "The data array does not have the right size! "
+                << "Grid = " << this->getId())
+//#endif
+      this->maskField_arr(field.dataFirst(), stored);
+   }
 
    template <int n>
    void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const
+   TRY
    {
 //#ifdef __XIOS_DEBUG
@@ -397,4 +416,5 @@
       this->restoreField_arr(stored, field.dataFirst());
    }
+   CATCH
 
    /*!
@@ -406,7 +426,9 @@
    template <int N>
    void CGrid::uncompressField(const CArray<double,N>& data, CArray<double,1>& outData) const
+   TRY
    {      
      uncompressField_arr(data.dataFirst(), outData);
    }
+   CATCH
 
    template<int N>
@@ -416,4 +438,5 @@
                              const CArray<int,1>& axisDomainOrder,
                              bool createMask)
+   TRY
    {
      int idx = 0;
@@ -510,6 +533,6 @@
       ++idx;
     }
-
-   }
+   }
+   CATCH_DUMP_ATTR
 
    template<int N>
@@ -517,4 +540,5 @@
                                   const std::vector<int>& eachDimSize,
                                   bool newValue)
+   TRY
    {
       if (N != eachDimSize.size())
@@ -531,4 +555,5 @@
       gridMask = newValue;
    }
+   CATCH_DUMP_ATTR
                                  
 
@@ -540,4 +565,5 @@
    template<int N>
    void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify)
+   TRY
    {     
      int num = indexToModify.numElements();
@@ -547,48 +573,9 @@
      }
    }
+   CATCH_DUMP_ATTR
+
    ///--------------------------------------------------------------
 
 
-/*!
-  A grid can have multiple dimension, so can its mask in the form of multi-dimension array.
-It's not a good idea to store all multi-dimension arrays corresponding to each mask.
-One of the ways is to convert this array into 1-dimension one and every process is taken place on it.
-  \param [in] multi-dimension array grid mask
-*/
-template<int N>
-void CGrid::getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask)
-{
-  if (gridMask.isEmpty()) return ;
-  int dim = gridMask.dimensions();
-  std::vector<int> dimensionSizes(dim);
-  for (int i = 0; i < dim; ++i) dimensionSizes[i] = gridMask.extent(i);
-
-  std::vector<int> idxLoop(dim,0);
-  int ssize = gridMask.numElements(), idx = 0;
-  localMask.resize(ssize);
-  while (idx < ssize)
-  {
-    for (int i = 0; i < dim-1; ++i)
-    {
-      if (idxLoop[i] == dimensionSizes[i])
-      {
-        idxLoop[i] = 0;
-        ++idxLoop[i+1];
-      }
-    }
-
-    int maskIndex = idxLoop[0];
-    int mulDim = 1;
-    for (int k = 1; k < dim; ++k)
-    {
-      mulDim *= dimensionSizes[k-1];
-      maskIndex += idxLoop[k]*mulDim;
-    }
-    localMask(maskIndex) = *(gridMask.dataFirst()+maskIndex);
-
-    ++idxLoop[0];
-    ++idx;
-  }
-}
 
    // Declare/Define CGridGroup and CGridDefinition
Index: XIOS/dev/branch_openmp/src/node/interpolate_axis.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/interpolate_axis.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/interpolate_axis.hpp	(revision 1642)
@@ -62,5 +62,4 @@
       static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CInterpolateAxis
 
Index: XIOS/dev/branch_openmp/src/node/interpolate_domain.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/interpolate_domain.cpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/interpolate_domain.cpp	(revision 1642)
@@ -65,4 +65,5 @@
     if (this->read_write_convention.isEmpty()) this->read_write_convention.setValue(read_write_convention_attr::fortran);
 
+
   }
 
Index: XIOS/dev/branch_openmp/src/node/interpolate_domain.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/interpolate_domain.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/interpolate_domain.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CInterpolateDomain
 
Index: XIOS/dev/branch_openmp/src/node/inverse_axis.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/inverse_axis.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/inverse_axis.hpp	(revision 1642)
@@ -59,5 +59,4 @@
       static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
 
   }; // class CInverseAxis
Index: XIOS/dev/branch_openmp/src/node/mesh.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/mesh.cpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/mesh.cpp	(revision 1642)
@@ -6,6 +6,6 @@
 
 #include "mesh.hpp"
-using namespace ep_lib;
 #include <boost/functional/hash.hpp>
+//#include <unordered_map>
 
 namespace xios {
@@ -33,6 +33,6 @@
   }
 
-  std::map <StdString, CMesh> *CMesh::meshList_ptr = 0;
-  std::map <StdString, vector<int> > *CMesh::domainList_ptr = 0;
+  std::map <StdString, CMesh> CMesh::meshList = std::map <StdString, CMesh>();
+  std::map <StdString, vector<int> > CMesh::domainList = std::map <StdString, vector<int> >();
 
 ///---------------------------------------------------------------
@@ -45,20 +45,17 @@
   CMesh* CMesh::getMesh (StdString meshName, int nvertex)
   {
-    if(CMesh::domainList_ptr == NULL) CMesh::domainList_ptr = new std::map <StdString, vector<int> >();
-    if(CMesh::meshList_ptr == NULL)   CMesh::meshList_ptr   = new std::map <StdString, CMesh>();
-
-    CMesh::domainList_ptr->at(meshName).push_back(nvertex);
-
-    if ( CMesh::meshList_ptr->begin() != CMesh::meshList_ptr->end() )
-    {
-      for (std::map<StdString, CMesh>::iterator it=CMesh::meshList_ptr->begin(); it!=CMesh::meshList_ptr->end(); ++it)
+    CMesh::domainList[meshName].push_back(nvertex);
+
+    if ( CMesh::meshList.begin() != CMesh::meshList.end() )
+    {
+      for (std::map<StdString, CMesh>::iterator it=CMesh::meshList.begin(); it!=CMesh::meshList.end(); ++it)
       {
         if (it->first == meshName)
-          return &meshList_ptr->at(meshName);
+          return &meshList[meshName];
         else
         {
           CMesh newMesh;
-          CMesh::meshList_ptr->insert( make_pair(meshName, newMesh) );
-          return &meshList_ptr->at(meshName);
+          CMesh::meshList.insert( make_pair(meshName, newMesh) );
+          return &meshList[meshName];
         }
       }
@@ -67,6 +64,6 @@
     {
       CMesh newMesh;
-      CMesh::meshList_ptr->insert( make_pair(meshName, newMesh) );
-      return &meshList_ptr->at(meshName);
+      CMesh::meshList.insert( make_pair(meshName, newMesh) );
+      return &meshList[meshName];
     }
   }
@@ -227,4 +224,181 @@
  * \param [in] bounds_lat Array of boundary latitudes. Its size depends on the element type.
  */
+//  void CMesh::createMesh(const CArray<double, 1>& lonvalue, const CArray<double, 1>& latvalue,
+//            const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat)
+//  {
+//    int nvertex = (bounds_lon.numElements() == 0) ? 1 : bounds_lon.rows();
+//
+//    if (nvertex == 1)
+//    {
+//      nbNodes_ = lonvalue.numElements();
+//      node_lon.resizeAndPreserve(nbNodes_);
+//      node_lat.resizeAndPreserve(nbNodes_);
+//      for (int nn = 0; nn < nbNodes_; ++nn)
+//      {
+//        if (map_nodes.find(make_pair (lonvalue(nn), latvalue(nn))) == map_nodes.end())
+//        {
+//          map_nodes[make_pair (lonvalue(nn), latvalue(nn))] = nn ;
+//          node_lon(nn) = lonvalue(nn);
+//          node_lat(nn) = latvalue(nn);
+//        }
+//      }
+//    }
+//    else if (nvertex == 2)
+//    {
+//      nbEdges_ = bounds_lon.shape()[1];
+//
+//      // Create nodes and edge_node connectivity
+//      node_lon.resizeAndPreserve(nbEdges_*nvertex); // Max possible number of nodes
+//      node_lat.resizeAndPreserve(nbEdges_*nvertex);
+//      edge_nodes.resizeAndPreserve(nvertex, nbEdges_);
+//
+//      for (int ne = 0; ne < nbEdges_; ++ne)
+//      {
+//        for (int nv = 0; nv < nvertex; ++nv)
+//        {
+//          if (map_nodes.find(make_pair (bounds_lon(nv, ne), bounds_lat(nv ,ne))) == map_nodes.end())
+//          {
+//            map_nodes[make_pair (bounds_lon(nv, ne), bounds_lat(nv, ne))] = nbNodes_ ;
+//            edge_nodes(nv,ne) = nbNodes_ ;
+//            node_lon(nbNodes_) = bounds_lon(nv, ne);
+//            node_lat(nbNodes_) = bounds_lat(nv, ne);
+//            ++nbNodes_ ;
+//          }
+//          else
+//            edge_nodes(nv,ne) = map_nodes[make_pair (bounds_lon(nv, ne), bounds_lat(nv ,ne))];
+//        }
+//      }
+//      node_lon.resizeAndPreserve(nbNodes_);
+//      node_lat.resizeAndPreserve(nbNodes_);
+//
+//      // Create edges
+//      edge_lon.resizeAndPreserve(nbEdges_);
+//      edge_lat.resizeAndPreserve(nbEdges_);
+//
+//      for (int ne = 0; ne < nbEdges_; ++ne)
+//      {
+//        if (map_edges.find(make_ordered_pair (edge_nodes(0,ne), edge_nodes(1,ne))) == map_edges.end())
+//        {
+//          map_edges[make_ordered_pair ( edge_nodes(0,ne), edge_nodes(1,ne) )] = ne ;
+//          edge_lon(ne) = lonvalue(ne);
+//          edge_lat(ne) = latvalue(ne);
+//        }
+//
+//      }
+//      edgesAreWritten = true;
+//    }
+//    else
+//    {
+//      nbFaces_ = bounds_lon.shape()[1];
+//
+//      // Create nodes and face_node connectivity
+//      node_lon.resizeAndPreserve(nbFaces_*nvertex);  // Max possible number of nodes
+//      node_lat.resizeAndPreserve(nbFaces_*nvertex);
+//      face_nodes.resize(nvertex, nbFaces_);
+//
+//      for (int nf = 0; nf < nbFaces_; ++nf)
+//      {
+//        for (int nv = 0; nv < nvertex; ++nv)
+//        {
+//          if (map_nodes.find(make_pair (bounds_lon(nv, nf), bounds_lat(nv ,nf))) == map_nodes.end())
+//          {
+//            map_nodes[make_pair (bounds_lon(nv, nf), bounds_lat(nv, nf))] = nbNodes_ ;
+//            face_nodes(nv,nf) = nbNodes_ ;
+//            node_lon(nbNodes_) = bounds_lon(nv, nf);
+//            node_lat(nbNodes_) = bounds_lat(nv ,nf);
+//            ++nbNodes_ ;
+//          }
+//          else
+//          {
+//            face_nodes(nv,nf) = map_nodes[make_pair (bounds_lon(nv, nf), bounds_lat(nv ,nf))];
+//          }
+//        }
+//      }
+//      node_lon.resizeAndPreserve(nbNodes_);
+//      node_lat.resizeAndPreserve(nbNodes_);
+//
+//      // Create edges and edge_nodes connectivity
+//      edge_lon.resizeAndPreserve(nbFaces_*nvertex); // Max possible number of edges
+//      edge_lat.resizeAndPreserve(nbFaces_*nvertex);
+//      edge_nodes.resizeAndPreserve(2, nbFaces_*nvertex);
+//      edge_faces.resize(2, nbFaces_*nvertex);
+//      face_edges.resize(nvertex, nbFaces_);
+//      face_faces.resize(nvertex, nbFaces_);
+//
+//      vector<int> countEdges(nbFaces_*nvertex);   // needed in case if edges have been already generated
+//      vector<int> countFaces(nbFaces_);
+//      countEdges.assign(nbFaces_*nvertex, 0);
+//      countFaces.assign(nbFaces_, 0);
+//      int edge;
+//      for (int nf = 0; nf < nbFaces_; ++nf)
+//      {
+//        for (int nv1 = 0; nv1 < nvertex; ++nv1)
+//        {
+//          int nv = 0;
+//          int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation
+//          if (map_edges.find(make_ordered_pair (face_nodes(nv1,nf), face_nodes(nv2,nf))) == map_edges.end())
+//          {
+//            map_edges[make_ordered_pair (face_nodes(nv1,nf), face_nodes(nv2,nf))] = nbEdges_ ;
+//            face_edges(nv1,nf) = map_edges[make_ordered_pair (face_nodes(nv1,nf), face_nodes(nv2,nf))];
+//            edge_faces(0,nbEdges_) = nf;
+//            edge_faces(1,nbEdges_) = -999;
+//            face_faces(nv1,nf) = 999999;
+//            edge_nodes(Range::all(),nbEdges_) = face_nodes(nv1,nf), face_nodes(nv2,nf);
+//            edge_lon(nbEdges_) = ( abs( node_lon(face_nodes(nv1,nf)) - node_lon(face_nodes(nv2,nf))) < 180.) ?
+//                        (( node_lon(face_nodes(nv1,nf)) + node_lon(face_nodes(nv2,nf))) * 0.5) :
+//                        (( node_lon(face_nodes(nv1,nf)) + node_lon(face_nodes(nv2,nf))) * 0.5 -180.);
+//            edge_lat(nbEdges_) = ( node_lat(face_nodes(nv1,nf)) + node_lat(face_nodes(nv2,nf)) ) * 0.5;
+//            ++nbEdges_;
+//          }
+//          else
+//          {
+//            edge = map_edges[make_ordered_pair (face_nodes(nv1,nf), face_nodes(nv2,nf))];
+//            face_edges(nv1,nf) = edge;
+//            if (edgesAreWritten)
+//            {
+//              edge_faces(countEdges[edge], edge) = nf;
+//              if (countEdges[edge]==0)
+//              {
+//                face_faces(nv1,nf) = 999999;
+//              }
+//              else
+//              {
+//                int face1 = nf; // = edge_faces(1,edge)
+//                int face2 = edge_faces(0,edge);
+//                face_faces(countFaces[face1], face1) =  face2;
+//                face_faces(countFaces[face2], face2) =  face1;
+//                ++(countFaces[face1]);
+//                ++(countFaces[face2]);
+//              }
+//            }
+//            else
+//            {
+//              edge_faces(1,edge) = nf;
+//              int face1 = nf; // = edge_faces(1,edge)
+//              int face2 = edge_faces(0,edge);
+//              face_faces(countFaces[face1], face1) =  face2;
+//              face_faces(countFaces[face2], face2) =  face1;
+//              ++(countFaces[face1]);
+//              ++(countFaces[face2]);
+//            }
+//            ++(countEdges[edge]);
+//          }
+//        }
+//      }
+//      edge_nodes.resizeAndPreserve(2, nbEdges_);
+//      edge_faces.resizeAndPreserve(2, nbEdges_);
+//      edge_lon.resizeAndPreserve(nbEdges_);
+//      edge_lat.resizeAndPreserve(nbEdges_);
+//
+//      // Create faces
+//      face_lon.resize(nbFaces_);
+//      face_lat.resize(nbFaces_);
+//      face_lon = lonvalue;
+//      face_lat = latvalue;
+//      facesAreWritten = true;
+//
+//    } // nvertex > 2
+//
+//  } // createMesh()
 
 ///----------------------------------------------------------------
@@ -240,5 +414,5 @@
  * \param [in] bounds_lat Array of boundary latitudes. Its size depends on the element type.
  */
-  void CMesh::createMeshEpsilon(const MPI_Comm& comm,
+  void CMesh::createMeshEpsilon(const ep_lib::MPI_Comm& comm,
                                 const CArray<double, 1>& lonvalue, const CArray<double, 1>& latvalue,
                                 const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat)
@@ -247,6 +421,6 @@
     int nvertex = (bounds_lon.numElements() == 0) ? 1 : bounds_lon.rows();
     int mpiRank, mpiSize;
-    MPI_Comm_rank(comm, &mpiRank);
-    MPI_Comm_size(comm, &mpiSize);
+    ep_lib::MPI_Comm_rank(comm, &mpiRank);
+    ep_lib::MPI_Comm_size(comm, &mpiSize);
     double prec = 1e-11;  // used in calculations of edge_lon/lat
 
@@ -286,5 +460,5 @@
       unsigned long nbEdgesOnProc = nbEdges_;
       unsigned long nbEdgesAccum;
-      MPI_Scan(&nbEdgesOnProc, &nbEdgesAccum, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
+      ep_lib::MPI_Scan(&nbEdgesOnProc, &nbEdgesAccum, 1, EP_UNSIGNED_LONG, EP_SUM, comm);
       nbEdgesAccum -= nbEdges_;
 
@@ -416,7 +590,7 @@
          unsigned long nodeCount = nodeIdx2Idx.size();
          unsigned long nodeStart, nbNodes;
-         MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
+         ep_lib::MPI_Scan(&nodeCount, &nodeStart, 1, EP_UNSIGNED_LONG, EP_SUM, comm);
          int nNodes = nodeStart;
-         MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
+         ep_lib::MPI_Bcast(&nNodes, 1, EP_UNSIGNED_LONG, mpiSize-1, comm);
          nbNodesGlo = nNodes;
 
@@ -509,5 +683,5 @@
       unsigned long nbFacesOnProc = nbFaces_;
       unsigned long nbFacesAccum;
-      MPI_Scan(&nbFacesOnProc, &nbFacesAccum, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
+      ep_lib::MPI_Scan(&nbFacesOnProc, &nbFacesAccum, 1, EP_UNSIGNED_LONG, EP_SUM, comm);
       nbFacesAccum -= nbFaces_;
 
@@ -633,7 +807,7 @@
 
         unsigned long edgeStart, nbEdges;
-        MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
+        ep_lib::MPI_Scan(&edgeCount, &edgeStart, 1, EP_UNSIGNED_LONG, EP_SUM, comm);
         int nEdges = edgeStart;
-        MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
+        ep_lib::MPI_Bcast(&nEdges, 1, EP_UNSIGNED_LONG, mpiSize-1, comm);
         nbEdgesGlo = nEdges;
 
@@ -854,7 +1028,7 @@
         unsigned long edgeCount = edgeIdx2Idx.size();
         unsigned long edgeStart, nbEdges;
-        MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
+        ep_lib::MPI_Scan(&edgeCount, &edgeStart, 1, EP_UNSIGNED_LONG, EP_SUM, comm);
         int nEdges = edgeStart;
-        MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
+        ep_lib::MPI_Bcast(&nEdges, 1, EP_UNSIGNED_LONG, mpiSize-1, comm);
         nbEdgesGlo = nEdges;
 
@@ -1124,7 +1298,7 @@
         unsigned long nodeCount = nodeIdx2Idx.size();
         unsigned long nodeStart, nbNodes;
-        MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
+        ep_lib::MPI_Scan(&nodeCount, &nodeStart, 1, EP_UNSIGNED_LONG, EP_SUM, comm);
         int nNodes = nodeStart;
-        MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
+        ep_lib::MPI_Bcast(&nNodes, 1, EP_UNSIGNED_LONG, mpiSize-1, comm);
         nbNodesGlo = nNodes;
 
@@ -1244,7 +1418,7 @@
         unsigned long edgeCount = edgeIdx2Idx.size();
         unsigned long edgeStart, nbEdges;
-        MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm);
+        ep_lib::MPI_Scan(&edgeCount, &edgeStart, 1, EP_UNSIGNED_LONG, EP_SUM, comm);
         int nEdges = edgeStart;
-        MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm);
+        ep_lib::MPI_Bcast(&nEdges, 1, EP_UNSIGNED_LONG, mpiSize-1, comm);
         nbEdgesGlo = nEdges;
 
@@ -1440,5 +1614,5 @@
    */
 
-  void CMesh::getGloNghbFacesNodeType(const MPI_Comm& comm, const CArray<int, 1>& face_idx,
+  void CMesh::getGloNghbFacesNodeType(const ep_lib::MPI_Comm& comm, const CArray<int, 1>& face_idx,
                                const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat,
                                CArray<int, 2>& nghbFaces)
@@ -1449,6 +1623,6 @@
 
     int mpiRank, mpiSize;
-    MPI_Comm_rank(comm, &mpiRank);
-    MPI_Comm_size(comm, &mpiSize);
+    ep_lib::MPI_Comm_rank(comm, &mpiRank);
+    ep_lib::MPI_Comm_size(comm, &mpiSize);
 
     // (1) Generating unique node indexes
@@ -1596,5 +1770,5 @@
    */
 
-  void CMesh::getGloNghbFacesEdgeType(const MPI_Comm& comm, const CArray<int, 1>& face_idx,
+  void CMesh::getGloNghbFacesEdgeType(const ep_lib::MPI_Comm& comm, const CArray<int, 1>& face_idx,
                                const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat,
                                CArray<int, 2>& nghbFaces)
@@ -1605,6 +1779,6 @@
 
     int mpiRank, mpiSize;
-    MPI_Comm_rank(comm, &mpiRank);
-    MPI_Comm_size(comm, &mpiSize);
+    ep_lib::MPI_Comm_rank(comm, &mpiRank);
+    ep_lib::MPI_Comm_size(comm, &mpiSize);
 
     // (1) Generating unique node indexes
@@ -1777,5 +1951,5 @@
    */
 
-  void CMesh::getGlobalNghbFaces(const int nghbType, const MPI_Comm& comm,
+  void CMesh::getGlobalNghbFaces(const int nghbType, const ep_lib::MPI_Comm& comm,
                                  const CArray<int, 1>& face_idx,
                                  const CArray<double, 2>& bounds_lon, const CArray<double, 2>& bounds_lat,
Index: XIOS/dev/branch_openmp/src/node/mesh.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/mesh.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/mesh.hpp	(revision 1642)
@@ -83,8 +83,6 @@
       int nbFaces_;
 
-      static std::map <StdString, CMesh> *meshList_ptr;
-      #pragma omp threadprivate(meshList_ptr)
-      static std::map <StdString, vector<int> > *domainList_ptr;
-      #pragma omp threadprivate(domainList_ptr)
+      static std::map <StdString, CMesh> meshList;
+      static std::map <StdString, vector<int> > domainList;
       CClientClientDHTSizet* pNodeGlobalIndex;                    // pointer to a map <nodeHash, nodeIdxGlo>
       CClientClientDHTSizet* pEdgeGlobalIndex;                    // pointer to a map <edgeHash, edgeIdxGlo>
Index: XIOS/dev/branch_openmp/src/node/node_enum.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/node_enum.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/node_enum.hpp	(revision 1642)
@@ -23,4 +23,5 @@
          eZoomAxis,
          eInterpolateAxis,
+         eExtractAxis,
          eZoomDomain,
          eInterpolateDomain,
@@ -38,5 +39,6 @@
          eDuplicateScalarToAxis,
          eReduceScalarToScalar,
-         eReorderDomain
+         eReorderDomain,
+         eExtractDomain
        } ENodeType;
 
Index: XIOS/dev/branch_openmp/src/node/node_type.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/node_type.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/node_type.hpp	(revision 1642)
@@ -13,4 +13,5 @@
 #include "zoom_axis.hpp"
 #include "interpolate_axis.hpp"
+#include "extract_axis.hpp"
 #include "zoom_domain.hpp"
 #include "interpolate_domain.hpp"
@@ -29,4 +30,5 @@
 #include "reduce_scalar_to_scalar.hpp"
 #include "reorder_domain.hpp"
+#include "extract_domain.hpp"
 
 
Index: XIOS/dev/branch_openmp/src/node/reduce_axis_to_axis.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/reduce_axis_to_axis.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/reduce_axis_to_axis.hpp	(revision 1642)
@@ -59,5 +59,4 @@
       static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CReduceAxisToAxis
 
Index: XIOS/dev/branch_openmp/src/node/reduce_axis_to_scalar.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/reduce_axis_to_scalar.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/reduce_axis_to_scalar.hpp	(revision 1642)
@@ -59,5 +59,4 @@
       static CTransformation<CScalar>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CReduceAxisToScalar
 
Index: XIOS/dev/branch_openmp/src/node/reduce_domain_to_axis.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/reduce_domain_to_axis.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/reduce_domain_to_axis.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CReduceDomainToAxis
 
Index: XIOS/dev/branch_openmp/src/node/reduce_domain_to_scalar.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/reduce_domain_to_scalar.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/reduce_domain_to_scalar.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CScalar>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CReduceDomainToScalar
 
Index: XIOS/dev/branch_openmp/src/node/reduce_scalar_to_scalar.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/reduce_scalar_to_scalar.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/reduce_scalar_to_scalar.hpp	(revision 1642)
@@ -59,5 +59,4 @@
       static CTransformation<CScalar>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CReduceScalarToScalar
 
Index: XIOS/dev/branch_openmp/src/node/reorder_domain.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/reorder_domain.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/reorder_domain.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CReorderDomain
 
Index: XIOS/dev/branch_openmp/src/node/scalar.cpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/scalar.cpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/scalar.cpp	(revision 1642)
@@ -27,7 +27,6 @@
    { /* Ne rien faire de plus */ }
 
-
-   std::map<StdString, ETranformationType> *CScalar::transformationMapList_ptr = 0;
-
+   std::map<StdString, ETranformationType> CScalar::transformationMapList_ = std::map<StdString, ETranformationType>();
+   bool CScalar::dummyTransformationMapList_ = CScalar::initializeTransformationMap(CScalar::transformationMapList_);
    bool CScalar::initializeTransformationMap(std::map<StdString, ETranformationType>& m)
    {
@@ -36,13 +35,4 @@
      m["reduce_domain"] = TRANS_REDUCE_DOMAIN_TO_SCALAR;
      m["reduce_scalar"] = TRANS_REDUCE_SCALAR_TO_SCALAR;
-   }
-
-   bool CScalar::initializeTransformationMap()
-   {
-     CScalar::transformationMapList_ptr = new std::map<StdString, ETranformationType>();
-     (*CScalar::transformationMapList_ptr)["reduce_axis"]   = TRANS_REDUCE_AXIS_TO_SCALAR;
-     (*CScalar::transformationMapList_ptr)["extract_axis"]  = TRANS_EXTRACT_AXIS_TO_SCALAR;
-     (*CScalar::transformationMapList_ptr)["reduce_domain"] = TRANS_REDUCE_DOMAIN_TO_SCALAR;
-     (*CScalar::transformationMapList_ptr)["reduce_scalar"] = TRANS_REDUCE_SCALAR_TO_SCALAR;
    }
 
@@ -175,7 +165,6 @@
 
         nodeElementName = node.getElementName();
-        if(CScalar::transformationMapList_ptr == 0) initializeTransformationMap();
-        std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_ptr->end(), it;
-        it = transformationMapList_ptr->find(nodeElementName);
+        std::map<StdString, ETranformationType>::const_iterator ite = transformationMapList_.end(), it;
+        it = transformationMapList_.find(nodeElementName);
         if (ite != it)
         {
Index: XIOS/dev/branch_openmp/src/node/scalar.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/scalar.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/scalar.hpp	(revision 1642)
@@ -83,13 +83,10 @@
            TransMapTypes transformationMap_;
 
-           void setTransformations(const TransMapTypes&);
+            void setTransformations(const TransMapTypes&);
 
        private:
            static bool initializeTransformationMap(std::map<StdString, ETranformationType>& m);
-           static bool initializeTransformationMap();
-           static std::map<StdString, ETranformationType> *transformationMapList_ptr;
-           #pragma omp threadprivate(transformationMapList_ptr)
+           static std::map<StdString, ETranformationType> transformationMapList_;
            static bool dummyTransformationMapList_;
-           #pragma omp threadprivate(dummyTransformationMapList_)
 
 
Index: XIOS/dev/branch_openmp/src/node/temporal_splitting.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/temporal_splitting.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/temporal_splitting.hpp	(revision 1642)
@@ -59,5 +59,4 @@
       static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CTemporalSplitting
 
Index: XIOS/dev/branch_openmp/src/node/transformation_enum.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/transformation_enum.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/transformation_enum.hpp	(revision 1642)
@@ -24,5 +24,7 @@
         TRANS_DUPLICATE_SCALAR_TO_AXIS = 15,
         TRANS_REDUCE_SCALAR_TO_SCALAR = 16,
-        TRANS_REORDER_DOMAIN = 17
+        TRANS_REORDER_DOMAIN = 17,
+        TRANS_EXTRACT_DOMAIN = 18,
+        TRANS_EXTRACT_AXIS = 19
       } ETranformationType;
 
Index: XIOS/dev/branch_openmp/src/node/zoom_axis.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/zoom_axis.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/zoom_axis.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CAxis>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CZoomAxis
 
Index: XIOS/dev/branch_openmp/src/node/zoom_domain.hpp
===================================================================
--- XIOS/dev/branch_openmp/src/node/zoom_domain.hpp	(revision 1556)
+++ XIOS/dev/branch_openmp/src/node/zoom_domain.hpp	(revision 1642)
@@ -60,5 +60,4 @@
       static CTransformation<CDomain>* create(const StdString& id, xml::CXMLNode* node);
       static bool _dummyRegistered;
-      #pragma omp threadprivate(_dummyRegistered)
   }; // class CZoomDomain
 
