Ignore:
Timestamp:
01/23/19 10:31:44 (5 years ago)
Author:
yushan
Message:

dev on ADA. add flag switch _usingEP/_usingMPI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_extract_axis.cpp

    r1545 r1642  
    1414#include "grid_transformation_factory_impl.hpp" 
    1515 
    16  
     16#include "reduction.hpp" 
    1717 
    1818namespace xios { 
     
    2626                                                                     std::map<int, int>& elementPositionInGridDst2AxisPosition, 
    2727                                                                     std::map<int, int>& elementPositionInGridDst2DomainPosition) 
     28TRY 
    2829{ 
    2930  std::vector<CScalar*> scalarListDestP = gridDst->getScalars(); 
     
    3637  return (new CScalarAlgorithmExtractAxis(scalarListDestP[scalarDstIndex], axisListSrcP[axisSrcIndex], extractAxis)); 
    3738} 
     39CATCH 
    3840 
    3941bool CScalarAlgorithmExtractAxis::registerTrans() 
     42TRY 
    4043{ 
    4144  CGridTransformationFactory<CScalar>::registerTransformation(TRANS_EXTRACT_AXIS_TO_SCALAR, create); 
    4245} 
     46CATCH 
    4347 
    4448CScalarAlgorithmExtractAxis::CScalarAlgorithmExtractAxis(CScalar* scalarDestination, CAxis* axisSource, CExtractAxisToScalar* algo) 
    4549 : CScalarAlgorithmTransformation(scalarDestination, axisSource), 
    4650   reduction_(0) 
     51TRY 
    4752{ 
    4853  algo->checkValid(scalarDestination, axisSource); 
    4954  StdString op = "extract"; 
    5055  pos_ = algo->position; 
    51   if(CReductionAlgorithm::ReductionOperations_ptr == 0)  
    52   { 
    53     CReductionAlgorithm::initReductionOperation(); 
    54   } 
    55   reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
     56  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    5657} 
     58CATCH 
    5759 
    5860void CScalarAlgorithmExtractAxis::apply(const std::vector<std::pair<int,double> >& localIndex, 
     
    6163                                         std::vector<bool>& flagInitial,                      
    6264                                         bool ignoreMissingValue, bool firstPass) 
     65TRY 
    6366{ 
    6467  reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 
    6568} 
     69CATCH 
    6670 
    6771CScalarAlgorithmExtractAxis::~CScalarAlgorithmExtractAxis() 
     72TRY 
    6873{ 
    6974  if (0 != reduction_) delete reduction_; 
    7075} 
     76CATCH 
    7177 
    7278void CScalarAlgorithmExtractAxis::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     79TRY 
    7380{ 
    7481  this->transformationMapping_.resize(1); 
     
    8188  transWeight[0].push_back(1.0); 
    8289} 
     90CATCH 
    8391 
    8492} 
Note: See TracChangeset for help on using the changeset viewer.