Index: XIOS/dev/dev_olga/src/node/domain.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/domain.cpp	(revision 1600)
+++ XIOS/dev/dev_olga/src/node/domain.cpp	(revision 1612)
@@ -58,13 +58,17 @@
 
    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;
    }
+   CATCH
 
    std::map<StdString, ETranformationType> CDomain::transformationMapList_ = std::map<StdString, ETranformationType>();
@@ -72,4 +76,5 @@
 
    bool CDomain::initializeTransformationMap(std::map<StdString, ETranformationType>& m)
+   TRY
    {
      m["zoom_domain"] = TRANS_ZOOM_DOMAIN;
@@ -81,10 +86,12 @@
      m["extract_domain"] = TRANS_EXTRACT_DOMAIN;
    }
+   CATCH
 
    const std::set<StdString> & CDomain::getRelFiles(void) const
+   TRY
    {
       return (this->relFiles);
    }
-
+   CATCH
 
    /*!
@@ -93,4 +100,5 @@
    */
    int CDomain::getNumberWrittenIndexes(MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -98,4 +106,5 @@
      return numberWrittenIndexes_[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -104,4 +113,5 @@
    */
    int CDomain::getTotalNumberWrittenIndexes(MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -109,4 +119,5 @@
      return totalNumberWrittenIndexes_[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -115,4 +126,5 @@
    */
    int CDomain::getOffsetWrittenIndexes(MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -120,6 +132,8 @@
      return offsetWrittenIndexes_[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    CArray<int, 1>& CDomain::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom)
+   TRY
    {
      int writtenSize;
@@ -127,4 +141,5 @@
      return compressedIndexToWriteOnServer[writtenSize];
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -136,4 +151,5 @@
     */
    std::map<int, StdSize> CDomain::getAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= false*/)
+   TRY
    {
 
@@ -176,27 +192,35 @@
      return attributesSizes;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    bool CDomain::isEmpty(void) const
+   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)) ||
@@ -206,4 +230,5 @@
       return distributed;
    }
+   CATCH
 
    //----------------------------------------------------------------
@@ -215,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")); }
@@ -240,4 +271,5 @@
    */
    bool CDomain::distributionAttributesHaveValue() const
+   TRY
    {
       bool hasValues = true;
@@ -251,4 +283,5 @@
       return hasValues;
    }
+   CATCH
 
    /*!
@@ -260,4 +293,5 @@
    */
    void CDomain::redistribute(int nbLocalDomain)
+   TRY
    {
      if (this->isRedistributed_) return;
@@ -422,4 +456,5 @@
      checkDomain();
    }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -427,4 +462,5 @@
    */
    void CDomain::fillInLonLat()
+   TRY
    {
      switch (type)
@@ -444,6 +480,6 @@
      }
      completeLonLatClient() ;
-
-   }
+   }
+   CATCH_DUMP_ATTR
 
    /*!
@@ -453,4 +489,5 @@
    */
    void CDomain::fillInRectilinearLonLat()
+   TRY
    {
      if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty())
@@ -462,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();
@@ -496,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();
@@ -521,4 +558,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
     /*
@@ -527,4 +565,5 @@
     */
    void CDomain::fillInCurvilinearLonLat()
+   TRY
    {
      if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty())
@@ -569,6 +608,6 @@
        bounds_latvalue_curvilinear_read_from_file.free();
      }
-
-   }
+   }
+   CATCH_DUMP_ATTR
 
     /*
@@ -577,4 +616,5 @@
     */
    void CDomain::fillInUnstructuredLonLat()
+   TRY
    {
      if (i_index.isEmpty())
@@ -628,4 +668,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
   /*
@@ -633,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,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;
 
@@ -766,4 +810,5 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    /*
@@ -771,4 +816,5 @@
    */
    void CDomain::checkDomain(void)
+   TRY
    {
      if (type.isEmpty())
@@ -862,4 +908,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    size_t CDomain::getGlobalWrittenSize(void)
@@ -871,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
@@ -929,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
@@ -980,8 +1030,10 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    void CDomain::checkMask(void)
+   TRY
    {
       if (!mask_1d.isEmpty() && !mask_2d.isEmpty())
@@ -1029,8 +1081,10 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    void CDomain::checkDomainData(void)
+   TRY
    {
       if (data_dim.isEmpty())
@@ -1072,8 +1126,10 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
 
    void CDomain::checkCompression(void)
+   TRY
    {
      int i,j,ind;
@@ -1202,7 +1258,9 @@
       }
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
    void CDomain::computeLocalMask(void)
+   TRY
    {
      localMask.resize(i_index.numElements()) ;
@@ -1236,10 +1294,13 @@
      }
    }
+   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
 
    //----------------------------------------------------------------
@@ -1250,4 +1311,5 @@
    */
    void CDomain::completeLonLatClient(void)
+   TRY
    {
      bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());
@@ -1363,4 +1425,5 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    /*
@@ -1368,4 +1431,5 @@
    */
    void CDomain::convertLonLatValue(void)
+   TRY
    {
      bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements());
@@ -1465,7 +1529,8 @@
      }
    }
-
+   CATCH_DUMP_ATTR
 
    void CDomain::checkBounds(void)
+   TRY
    {
      bool hasBoundValues = (0 != bounds_lonvalue.numElements()) || (0 != bounds_latvalue.numElements());
@@ -1559,6 +1624,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::checkArea(void)
+   TRY
    {
      bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements());
@@ -1588,6 +1655,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::checkLonLat()
+   TRY
    {
      if (!hasLonLat) hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) ||
@@ -1649,6 +1718,8 @@
      }
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::checkAttributesOnClientAfterTransformation()
+   TRY
    {
      CContext* context=CContext::getCurrent() ;
@@ -1665,4 +1736,5 @@
      this->isClientAfterTransformationChecked = true;
    }
+   CATCH_DUMP_ATTR
 
    //----------------------------------------------------------------
@@ -1670,4 +1742,5 @@
    // This function only checks all attributes of current domain
    void CDomain::checkAttributesOnClient()
+   TRY
    {
      if (this->isClientChecked) return;
@@ -1695,7 +1768,9 @@
       this->isClientChecked = true;
    }
+   CATCH_DUMP_ATTR
 
    // Send all checked attributes to server
    void CDomain::sendCheckedAttributes()
+   TRY
    {
      if (!this->isClientChecked) checkAttributesOnClient();
@@ -1710,6 +1785,8 @@
      this->isChecked = true;
    }
+   CATCH_DUMP_ATTR
 
    void CDomain::checkAttributes(void)
+   TRY
    {
       if (this->isChecked) return;
@@ -1741,4 +1818,5 @@
       this->isChecked = true;
    }
+   CATCH_DUMP_ATTR
 
   /*!
@@ -1749,4 +1827,5 @@
   */
   void CDomain::computeConnectedClients()
+  TRY
   {
     CContext* context=CContext::getCurrent() ;
@@ -1876,4 +1955,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
    /*!
@@ -1883,4 +1963,5 @@
    */
    void CDomain::computeWrittenIndex()
+   TRY
    {  
       if (computedWrittenIndex_) return;
@@ -1920,6 +2001,8 @@
       }
    }
+   CATCH_DUMP_ATTR
 
   void CDomain::computeWrittenCompressedIndex(MPI_Comm writtenComm)
+  TRY
   {
     int writtenCommSize;
@@ -1989,4 +2072,5 @@
       }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -1995,4 +2079,5 @@
   */
   void CDomain::sendAttributes()
+  TRY
   {
     sendDistributionAttributes();
@@ -2002,9 +2087,10 @@
     sendDataIndex();
   }
-
+  CATCH
   /*!
     Send global index from client to connected client(s)
   */
   void CDomain::sendIndex()
+  TRY
   {
     int ns, n, i, j, ind, nv, idx;
@@ -2049,4 +2135,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2056,4 +2143,5 @@
   */
   void CDomain::sendDistributionAttributes(void)
+  TRY
   {
     std::list<CContextClient*>::iterator it;
@@ -2102,4 +2190,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2107,4 +2196,5 @@
   */
   void CDomain::sendArea()
+  TRY
   {
     if (!hasArea) return;
@@ -2150,4 +2240,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2157,4 +2248,5 @@
   */
   void CDomain::sendLonLat()
+  TRY
   {
     if (!hasLonLat) return;
@@ -2245,4 +2337,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2253,4 +2346,5 @@
   */
   void CDomain::sendDataIndex()
+  TRY
   {
     int ns, n, i, j, ind, nv, idx;
@@ -2321,6 +2415,8 @@
     }
   }
+  CATCH
   
   bool CDomain::dispatchEvent(CEventServer& event)
+  TRY
   {
     if (SuperClass::dispatchEvent(event)) return true;
@@ -2360,4 +2456,5 @@
     }
   }
+  CATCH
 
   /*!
@@ -2366,4 +2463,5 @@
   */
   void CDomain::recvIndex(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2379,4 +2477,5 @@
     get(domainId)->recvIndex(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2386,4 +2485,5 @@
   */
   void CDomain::recvIndex(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, type_int, iIndex, jIndex;
@@ -2445,4 +2545,5 @@
     domainMask.resize(0); // Mask is not defined anymore on servers
   }
+  CATCH
 
   /*!
@@ -2451,4 +2552,5 @@
   */
   void CDomain::recvDistributionAttributes(CEventServer& event)
+  TRY
   {
     CBufferIn* buffer=event.subEvents.begin()->buffer;
@@ -2457,4 +2559,5 @@
     get(domainId)->recvDistributionAttributes(*buffer);
   }
+  CATCH
 
   /*!
@@ -2464,4 +2567,5 @@
   */
   void CDomain::recvDistributionAttributes(CBufferIn& buffer)
+  TRY
   {
     int ni_tmp, ibegin_tmp, nj_tmp, jbegin_tmp;
@@ -2479,5 +2583,5 @@
 
   }
-
+ CATCH_DUMP_ATTR
   /*!
     Receive longitude event from clients(s)
@@ -2485,4 +2589,5 @@
   */
   void CDomain::recvLon(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2498,4 +2603,5 @@
     get(domainId)->recvLon(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2504,4 +2610,5 @@
   */
   void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd;
@@ -2563,4 +2670,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2569,4 +2677,5 @@
   */
   void CDomain::recvLat(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2582,4 +2691,5 @@
     get(domainId)->recvLat(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2588,4 +2698,5 @@
   */
   void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd;
@@ -2649,4 +2760,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2655,4 +2767,5 @@
   */
   void CDomain::recvArea(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2668,4 +2781,5 @@
     get(domainId)->recvArea(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2674,4 +2788,5 @@
   */
   void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, lInd;
@@ -2719,4 +2834,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2728,4 +2844,5 @@
   */
   bool CDomain::isEqual(CDomain* obj)
+  TRY
   {
     vector<StdString> excludedAttr;
@@ -2750,4 +2867,5 @@
     return objEqual;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2756,4 +2874,5 @@
   */
   void CDomain::recvDataIndex(CEventServer& event)
+  TRY
   {
     string domainId;
@@ -2769,4 +2888,5 @@
     get(domainId)->recvDataIndex(rankBuffers);
   }
+  CATCH
 
   /*!
@@ -2780,4 +2900,5 @@
   */
   void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers)
+  TRY
   {
     int nbReceived = rankBuffers.size(), i, ind, index, indexI, indexJ, type_int, lInd;    
@@ -2846,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
 
   /*!
@@ -2858,7 +2982,9 @@
   */
   bool CDomain::hasTransformation()
+  TRY
   {
     return (!transformationMap_.empty());
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2867,7 +2993,9 @@
   */
   void CDomain::setTransformations(const TransMapTypes& domTrans)
+  TRY
   {
     transformationMap_ = domTrans;
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2876,9 +3004,12 @@
   */
   CDomain::TransMapTypes CDomain::getAllTransformations(void)
+  TRY
   {
     return transformationMap_;
   }
+  CATCH_DUMP_ATTR
 
   void CDomain::duplicateTransformation(CDomain* src)
+  TRY
   {
     if (src->hasTransformation())
@@ -2887,4 +3018,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2892,4 +3024,5 @@
    */
   void CDomain::solveInheritanceTransformation()
+  TRY
   {
     if (hasTransformation() || !hasDirectDomainReference())
@@ -2908,6 +3041,8 @@
         refDomains[i]->setTransformations(domain->getAllTransformations());
   }
+  CATCH_DUMP_ATTR
 
   void CDomain::setContextClient(CContextClient* contextClient)
+  TRY
   {
     if (clientsSet.find(contextClient)==clientsSet.end())
@@ -2917,4 +3052,5 @@
     }
   }
+  CATCH_DUMP_ATTR
 
   /*!
@@ -2924,4 +3060,5 @@
   */
   void CDomain::parse(xml::CXMLNode & node)
+  TRY
   {
     SuperClass::parse(node);
@@ -2954,4 +3091,5 @@
     }
   }
+  CATCH_DUMP_ATTR
    //----------------------------------------------------------------
 
