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

    r1297 r1612  
    2727                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2828                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     29TRY 
    2930{ 
    3031  std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 
     
    3738  return (new CScalarAlgorithmReduceAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], reduceAxis)); 
    3839} 
     40CATCH 
    3941 
    4042bool CScalarAlgorithmReduceAxis::registerTrans() 
     43TRY 
    4144{ 
    4245  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_REDUCE_AXIS_TO_SCALAR, create); 
    4346} 
     47CATCH 
    4448 
    4549CScalarAlgorithmReduceAxis::CScalarAlgorithmReduceAxis(CScalar* scalarDestination, CAxis* axisSource, CReduceAxisToScalar* algo) 
    4650 : CScalarAlgorithmTransformation(scalarDestination, axisSource), 
    4751   reduction_(0) 
     52TRY 
    4853{ 
    4954  if (algo->operation.isEmpty()) 
     
    8388  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    8489} 
     90CATCH 
    8591 
    8692void CScalarAlgorithmReduceAxis::apply(const std::vector<std::pair<int,double> >& localIndex, const double* dataInput, CArray<double,1>& dataOut, 
    8793                                         std::vector<bool>& flagInitial, bool ignoreMissingValue, bool firstPass) 
     94TRY 
    8895{ 
    8996  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    9097} 
     98CATCH 
    9199 
    92100void CScalarAlgorithmReduceAxis::updateData(CArray<double,1>& dataOut) 
     101TRY 
    93102{ 
    94103  reduction_->updateData(dataOut); 
    95104} 
     105CATCH 
    96106 
    97107CScalarAlgorithmReduceAxis::~CScalarAlgorithmReduceAxis() 
     108TRY 
    98109{ 
    99110  if (0 != reduction_) delete reduction_; 
    100111} 
     112CATCH 
    101113 
    102114void CScalarAlgorithmReduceAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     115TRY 
    103116{ 
    104117  this->transformationMapping_.resize(1); 
     
    116129  } 
    117130} 
     131CATCH 
    118132 
    119133} 
Note: See TracChangeset for help on using the changeset viewer.