Ignore:
Timestamp:
11/23/18 14:48:14 (5 years 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_scalar.cpp

    r1314 r1612  
    2222                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2323                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     24TRY 
    2425{ 
    2526  std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 
     
    3233  return (new CScalarAlgorithmReduceScalar(scalarListDestP[scalarDstIndex], scalarListSrcP[scalarSrcIndex], reduceScalar)); 
    3334} 
     35CATCH 
    3436 
    3537bool CScalarAlgorithmReduceScalar::registerTrans() 
     38TRY 
    3639{ 
    3740  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_SCALAR_TO_SCALAR, create); 
    3841} 
     42CATCH 
    3943 
    4044CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo) 
    4145 : CScalarAlgorithmTransformation(scalarDestination, scalarSource), 
    4246   reduction_(0) 
     47TRY 
    4348{ 
    4449  eliminateRedondantSrc_= false ; 
     
    7984  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    8085} 
     86CATCH 
    8187 
    8288void CScalarAlgorithmReduceScalar::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 
    8389                                         std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 
     90TRY 
    8491{ 
    8592  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    8693} 
     94CATCH 
    8795 
    8896void CScalarAlgorithmReduceScalar::updateData(CArray<double,1>& dataOut) 
     97TRY 
    8998{ 
    9099  reduction_->updateData(dataOut); 
    91100} 
     101CATCH 
    92102 
    93103CScalarAlgorithmReduceScalar::~CScalarAlgorithmReduceScalar() 
     104TRY 
    94105{ 
    95106  if (0 != reduction_) delete reduction_; 
    96107} 
     108CATCH 
    97109 
    98110void CScalarAlgorithmReduceScalar::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     111TRY 
    99112{ 
    100113  this->transformationMapping_.resize(1); 
     
    108121 
    109122} 
     123CATCH 
    110124 
    111125} 
Note: See TracChangeset for help on using the changeset viewer.