- Timestamp:
- 09/25/17 10:59:29 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/transformation/axis_algorithm_transformation.cpp
r895 r1275 19 19 20 20 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource) 21 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(axisSource), domainSrc_(0) 21 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(axisSource), domainSrc_(0),scalarSrc_(0) 22 22 { 23 23 axisDestGlobalSize_ = axisDestination->n_glo.getValue(); … … 30 30 31 31 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CDomain* domainSource) 32 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(domainSource) 32 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(domainSource),scalarSrc_(0) 33 33 { 34 34 axisDestGlobalSize_ = axisDestination->n_glo.getValue(); … … 40 40 } 41 41 42 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CScalar* scalarSource) 43 : CGenericAlgorithmTransformation(), axisDest_(axisDestination), axisSrc_(0), domainSrc_(0), scalarSrc_(scalarSource) 44 { 45 axisDestGlobalSize_ = axisDestination->n_glo.getValue(); 46 int niDest = axisDestination->n.getValue(); 47 int ibeginDest = axisDestination->begin.getValue(); 48 49 for (int idx = 0; idx < niDest; ++idx) 50 if ((axisDestination->mask)(idx)) axisDestGlobalIndex_.push_back(ibeginDest+idx); 51 } 42 52 CAxisAlgorithmTransformation::~CAxisAlgorithmTransformation() 43 53 { … … 66 76 if (2 == elementType) nIndexSize = domainSrc_->i_index.numElements(); 67 77 else if (1 == elementType) nIndexSize = axisSrc_->index.numElements(); 78 else nIndexSize=1 ; // scalar 79 68 80 CClientClientDHTInt::Index2VectorInfoTypeMap globalIndex2ProcRank; 69 81 globalIndex2ProcRank.rehash(std::ceil(nIndexSize/globalIndex2ProcRank.max_load_factor())); 70 82 for (int idx = 0; idx < nIndexSize; ++idx) 71 83 { 72 if (2 == elementType) 84 if (2 == elementType) // domain 73 85 { 74 86 globalIndex = domainSrc_->i_index(idx) + domainSrc_->j_index(idx) * domainSrc_->ni_glo; 75 87 } 76 else if (1 == elementType) 88 else if (1 == elementType) // axis 77 89 { 78 90 globalIndex = axisSrc_->index(idx); 91 } 92 else // scalar 93 { 94 globalIndex = 0; 79 95 } 80 96
Note: See TracChangeset
for help on using the changeset viewer.