Ignore:
Timestamp:
11/23/18 14:48:14 (22 months ago)
Author:
oabramkina
Message:

Dev: adding exception handling.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/transformation/scalar_algorithm_reduce_domain.cpp

    r1396 r1612  
    2626                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2727                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     28TRY 
    2829{ 
    2930  std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 
     
    3637  return (new CScalarAlgorithmReduceDomain(scalarListDestP[scalarDstIndex], domainListSrcP[domainSrcIndex], reduceDomain)); 
    3738} 
     39CATCH 
    3840 
    3941bool CScalarAlgorithmReduceDomain::registerTrans() 
     42TRY 
    4043{ 
    4144  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_DOMAIN_TO_SCALAR, create); 
    4245} 
     46CATCH 
    4347 
    4448CScalarAlgorithmReduceDomain::CScalarAlgorithmReduceDomain(CScalar* scalarDestination, CDomain* domainSource, CReduceDomainToScalar* algo) 
    4549 : CScalarAlgorithmTransformation(scalarDestination, domainSource), 
    4650   reduction_(0) 
     51TRY 
    4752{ 
    4853  algo->checkValid(scalarDestination, domainSource); 
     
    8085  local = algo->local ; 
    8186} 
     87CATCH 
    8288 
    8389void CScalarAlgorithmReduceDomain::apply(const std::vector<std::pair<int,double> >& localIndex, 
     
    8692                                         std::vector<bool>& flagInitial,                      
    8793                                         bool ignoreMissingValue, bool firstPass) 
     94TRY 
    8895{ 
    8996  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    9097} 
     98CATCH 
    9199 
    92100void CScalarAlgorithmReduceDomain::updateData(CArray<double,1>& dataOut) 
     101TRY 
    93102{ 
    94103  reduction_->updateData(dataOut); 
    95104} 
     105CATCH 
    96106 
    97107CScalarAlgorithmReduceDomain::~CScalarAlgorithmReduceDomain() 
     108TRY 
    98109{ 
    99110  if (0 != reduction_) delete reduction_; 
    100111} 
     112CATCH 
    101113 
    102114void CScalarAlgorithmReduceDomain::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     115TRY 
    103116{ 
    104117  this->transformationMapping_.resize(1); 
     
    137150   
    138151} 
     152CATCH 
    139153 
    140154} 
Note: See TracChangeset for help on using the changeset viewer.