- Timestamp:
- 09/26/17 14:13:40 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/transformation/domain_algorithm_zoom.cpp
r1144 r1281 74 74 void CDomainAlgorithmZoom::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs) 75 75 { 76 int niSource = domainSrc_->ni.getValue();77 int ibeginSource = domainSrc_->ibegin.getValue();78 int iendSource = ibeginSource + niSource - 1;79 80 int ibegin = std::max(ibeginSource, zoomIBegin_);81 int iend = std::min(iendSource, zoomIEnd_);82 int ni = iend + 1 - ibegin;83 if (iend < ibegin) ni = 0;84 85 int njSource = domainSrc_->nj.getValue();86 int jbeginSource = domainSrc_->jbegin.getValue();87 int jendSource = jbeginSource + njSource - 1;88 89 int jbegin = std::max(jbeginSource, zoomJBegin_);90 int jend = std::min(jendSource, zoomJEnd_);91 int nj = jend + 1 - jbegin;92 if (jend < jbegin) nj = 0;93 76 94 77 int niGlob = domainSrc_->ni_glo.getValue(); … … 102 85 103 86 int domainGlobalIndex; 104 for (int j = 0; j < nj; ++j) 87 int iglob ; 88 int jglob ; 89 const CArray<int,1>& i_index = domainSrc_->i_index.getValue() ; 90 const CArray<int,1>& j_index = domainSrc_->j_index.getValue() ; 91 92 int nglo = i_index.numElements() ; 93 for (size_t i = 0; i < nglo ; ++i) 105 94 { 106 for (int i = 0; i < ni; ++i) 95 iglob=i_index(i) ; jglob=j_index(i) ; 96 if (iglob>=zoomIBegin_ && iglob<=zoomIEnd_ && jglob>=zoomJBegin_ && jglob<=zoomJEnd_) 107 97 { 108 domainGlobalIndex = (j+jbegin) * niGlob + (i+ibegin);98 domainGlobalIndex = jglob*niGlob + iglob; 109 99 transMap[domainGlobalIndex].push_back(domainGlobalIndex); 110 100 transWeight[domainGlobalIndex].push_back(1.0); 111 101 } 112 102 } 113 114 103 updateZoom(); 115 // updateDomainDestinationMask();116 104 } 117 105
Note: See TracChangeset
for help on using the changeset viewer.