Changeset 1313
- Timestamp:
- 10/24/17 11:23:54 (7 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/config/reduce_domain_to_scalar_attribute.conf
r976 r1313 1 1 DECLARE_ENUM4(operation, min, max, sum, average) 2 DECLARE_ATTRIBUTE(bool, local) -
XIOS/dev/XIOS_DEV_CMIP6/src/node/reduce_domain_to_scalar.cpp
r976 r1313 39 39 void CReduceDomainToScalar::checkValid(CScalar* scalarDst, CDomain* domainSrc) 40 40 { 41 if (this->local.isEmpty()) local=false ; 41 42 } 42 43 -
XIOS/dev/XIOS_DEV_CMIP6/src/transformation/scalar_algorithm_reduce_domain.cpp
r1260 r1313 76 76 77 77 reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 78 local = algo->local ; 78 79 } 79 80 … … 105 106 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 106 107 107 int globalIndexSize = domainSrc_->ni_glo * domainSrc_->nj_glo; 108 int ni_glo = domainSrc_->ni_glo ; 109 int nj_glo = domainSrc_->nj_glo ; 110 int nbDomainIdx ; 111 112 if (local) 113 { 114 const CArray<int, 1>& i_index = domainSrc_-> i_index.getValue() ; 115 const CArray<int, 1>& j_index = domainSrc_-> j_index.getValue() ; 116 const CArray<bool,1>& localMask = domainSrc_-> localMask ; 117 int nbDomainIdx = i_index.numElements(); 108 118 109 transMap[0].resize(globalIndexSize); 110 transWeight[0].resize(globalIndexSize, 1.0); 111 for (int idx = 0; idx < globalIndexSize; ++idx) 112 { 113 transMap[0][idx] = idx; 119 for (int idxDomain = 0; idxDomain < nbDomainIdx; ++idxDomain) 120 { 121 if (localMask(idxDomain)) 122 { 123 transMap[0].push_back(j_index(idxDomain)* ni_glo + i_index(idxDomain)); 124 transWeight[0].push_back(1.0) ; 125 } 126 } 114 127 } 128 else 129 { 130 nbDomainIdx = ni_glo * nj_glo; 131 transMap[0].resize(nbDomainIdx); 132 transWeight[0].resize(nbDomainIdx, 1.0); 133 for (int idxDomain = 0; idxDomain < nbDomainIdx; ++idxDomain) transMap[0][idxDomain] = idxDomain; 134 } 135 115 136 } 116 137 -
XIOS/dev/XIOS_DEV_CMIP6/src/transformation/scalar_algorithm_reduce_domain.hpp
r1260 r1313 41 41 static bool registerTrans(); 42 42 protected: 43 bool local ; 43 44 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 44 45
Note: See TracChangeset
for help on using the changeset viewer.