Ignore:
Timestamp:
12/11/18 13:22:07 (6 years ago)
Author:
oabramkina
Message:

Exception handling on trunk.

To activate it, compilation flag -DXIOS_EXCEPTION should be added.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp

    r1617 r1622  
    3131                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    3232                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     33TRY 
    3334{ 
    3435  std::vector<CDomain*> domainListDestP = gridDst->getDomains(); 
     
    4142  return (new CDomainAlgorithmInterpolate(domainListDestP[domainDstIndex], domainListSrcP[domainSrcIndex], interpolateDomain)); 
    4243} 
     44CATCH 
    4345 
    4446bool CDomainAlgorithmInterpolate::registerTrans() 
     47TRY 
    4548{ 
    4649  CGridTransformationFactory<CDomain>::registerTransformation(TRANS_INTERPOLATE_DOMAIN, create); 
    4750} 
     51CATCH 
    4852 
    4953CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain) 
    5054: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false) 
     55TRY 
    5156{ 
    5257  CContext* context = CContext::getCurrent(); 
     
    9398     
    9499} 
     100CATCH 
    95101 
    96102/*! 
     
    98104*/ 
    99105void CDomainAlgorithmInterpolate::computeRemap() 
     106TRY 
    100107{ 
    101108  using namespace sphereRemap; 
     
    418425 
    419426} 
     427CATCH 
    420428 
    421429void CDomainAlgorithmInterpolate::processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole, 
    422430                                              int nbGlobalPointOnPole) 
     431TRY 
    423432{ 
    424433  CContext* context = CContext::getCurrent(); 
     
    487496 
    488497} 
     498CATCH 
    489499 
    490500/*! 
     
    492502*/ 
    493503void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     504TRY 
    494505{ 
    495506  if (readFromFile_)   
     
    500511  } 
    501512} 
     513CATCH 
    502514 
    503515void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     516TRY 
    504517 
    505518  writeInterpolationInfo(fileToReadWrite_, interpMapValue); 
    506519} 
     520CATCH 
    507521 
    508522void CDomainAlgorithmInterpolate::readRemapInfo() 
     523TRY 
    509524 
    510525  std::map<int,std::vector<std::pair<int,double> > > interpMapValue; 
     
    513528  exchangeRemapInfo(interpMapValue); 
    514529} 
     530CATCH 
    515531 
    516532void CDomainAlgorithmInterpolate::convertRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     533TRY 
    517534{ 
    518535  CContext* context = CContext::getCurrent(); 
     
    539556  }       
    540557} 
     558CATCH 
    541559 
    542560/*! 
     
    544562*/ 
    545563void CDomainAlgorithmInterpolate::exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     564TRY 
    546565{ 
    547566  CContext* context = CContext::getCurrent(); 
     
    723742  delete [] recvBuff; 
    724743} 
     744CATCH 
    725745  
    726746/*! Redefined some functions of CONetCDF4 to make use of them */ 
     
    729749int CDomainAlgorithmInterpolate::WriteNetCdf::addDimensionWrite(const StdString& name,  
    730750                                                                const StdSize size) 
     751TRY 
    731752{ 
    732753  return CONetCDF4::addDimension(name, size);   
    733754} 
     755CATCH 
    734756 
    735757int CDomainAlgorithmInterpolate::WriteNetCdf::addVariableWrite(const StdString& name, nc_type type, 
    736758                                                               const std::vector<StdString>& dim) 
     759TRY 
    737760{ 
    738761  return CONetCDF4::addVariable(name, type, dim); 
    739762} 
     763CATCH 
    740764 
    741765void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition() 
     766TRY 
    742767{ 
    743768  CONetCDF4::definition_end(); 
    744769} 
     770CATCH 
    745771 
    746772void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<int,1>& data, const StdString& name, 
     
    748774                                                              const std::vector<StdSize>* start, 
    749775                                                              const std::vector<StdSize>* count) 
     776TRY 
    750777{ 
    751778  CONetCDF4::writeData<int,1>(data, name, collective, record, start, count); 
    752779} 
     780CATCH 
    753781 
    754782void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<double,1>& data, const StdString& name, 
     
    756784                                                              const std::vector<StdSize>* start, 
    757785                                                              const std::vector<StdSize>* count) 
     786TRY 
    758787{ 
    759788  CONetCDF4::writeData<double,1>(data, name, collective, record, start, count); 
    760789} 
     790CATCH 
    761791 
    762792/* 
     
    767797void CDomainAlgorithmInterpolate::writeInterpolationInfo(std::string& filename, 
    768798                                                         std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     799TRY 
    769800{ 
    770801  CContext* context = CContext::getCurrent(); 
     
    846877  netCdfWriter.closeFile(); 
    847878} 
     879CATCH 
    848880 
    849881/*! 
     
    855887void CDomainAlgorithmInterpolate::readInterpolationInfo(std::string& filename, 
    856888                                                        std::map<int,std::vector<std::pair<int,double> > >& interpMapValue) 
     889TRY 
    857890{ 
    858891  int ncid ; 
     
    913946      interpMapValue[dstIndex[ind]-indexOffset].push_back(make_pair(srcIndex[ind]-indexOffset,weight[ind])); 
    914947 } 
     948CATCH 
    915949 
    916950void CDomainAlgorithmInterpolate::apply(const std::vector<std::pair<int,double> >& localIndex, 
     
    919953                                            std::vector<bool>& flagInitial, 
    920954                                            bool ignoreMissingValue, bool firstPass  ) 
     955TRY 
    921956{ 
    922957  int nbLocalIndex = localIndex.size();    
     
    960995  } 
    961996} 
     997CATCH 
    962998 
    963999void CDomainAlgorithmInterpolate::updateData(CArray<double,1>& dataOut) 
     1000TRY 
    9641001{ 
    9651002  if (detectMissingValue) 
     
    9831020  } 
    9841021} 
    985  
    986 } 
     1022CATCH 
     1023 
     1024} 
Note: See TracChangeset for help on using the changeset viewer.