Changeset 893
- Timestamp:
- 07/06/16 17:40:32 (8 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/domain.cpp
r881 r893 896 896 897 897 //---------------------------------------------------------------- 898 898 void CDomain::computeLocalMask(void) 899 { 900 localMask.resize(ni*nj) ; 901 localMask=false ; 902 size_t zoom_ibegin=global_zoom_ibegin ; 903 size_t zoom_iend=global_zoom_ibegin+global_zoom_ni-1 ; 904 size_t zoom_jbegin=global_zoom_jbegin ; 905 size_t zoom_jend=global_zoom_jbegin+global_zoom_nj-1 ; 906 907 908 size_t dn=data_i_index.numElements() ; 909 int i,j ; 910 size_t k,ind ; 911 912 for(k=0;k<dn;k++) 913 { 914 if (data_dim==2) 915 { 916 i=data_i_index(k)+data_ibegin ; 917 j=data_j_index(k)+data_jbegin ; 918 } 919 else 920 { 921 i=(data_i_index(k)+data_ibegin)%ni ; 922 j=(data_i_index(k)+data_ibegin)/ni ; 923 } 924 925 if (i>=0 && i<ni && j>=0 && j<nj) 926 if (i+ibegin>=zoom_ibegin && i+ibegin<=zoom_iend && j+jbegin>=zoom_jbegin && j+jbegin<=zoom_jend) 927 { 928 ind=i+ni*j ; 929 localMask(ind)=mask_1d(ind) ; 930 } 931 } 932 } 933 934 935 936 937 938 939 899 940 void CDomain::checkEligibilityForCompressedOutput(void) 900 941 { … … 1188 1229 this->checkDomainData(); 1189 1230 this->checkCompression(); 1231 this->computeLocalMask() ; 1190 1232 } 1191 1233 else … … 1227 1269 this->checkDomainData(); 1228 1270 this->checkCompression(); 1271 this->computeLocalMask() ; 1229 1272 1230 1273 } -
XIOS/trunk/src/node/domain.hpp
r881 r893 159 159 static ENodeType GetType(void); 160 160 const std::map<int, vector<size_t> >& getIndexServer() const; 161 CArray< int, 2> local_mask;161 CArray<bool, 1> localMask; 162 162 bool isCurvilinear ; 163 163 bool hasBounds ; … … 177 177 void checkLonLat(); 178 178 void checkZoom(void); 179 void computeLocalMask(void) ; 179 180 180 181 void checkTransformations(); -
XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp
r880 r893 233 233 mapper.setVerbosity(PROGRESS) ; 234 234 235 236 CArray<bool,1> localMask(nSrcLocal) ;237 localMask=false ;238 size_t ndata=domainSrc_->data_i_index.numElements() ;239 for (int idx=0; idx < ndata; ++idx)240 {241 size_t ind = domainSrc_->data_j_index(idx)*domainSrc_->ni+domainSrc_->data_i_index(idx) ;242 localMask(ind)=domainSrc_->mask_1d(ind) ;243 }244 245 235 246 236 // supress masked data for the source 247 237 int nSrcLocalUnmasked = 0 ; 248 for (int idx=0 ; idx < nSrcLocal; idx++) if ( localMask(idx)) ++nSrcLocalUnmasked ;238 for (int idx=0 ; idx < nSrcLocal; idx++) if (domainSrc_->localMask(idx)) ++nSrcLocalUnmasked ; 249 239 250 240 … … 256 246 for (int idx=0 ; idx < nSrcLocal; idx++) 257 247 { 258 if ( localMask(idx))248 if (domainSrc_->localMask(idx)) 259 249 { 260 250 for(int n=0;n<nVertexSrc;++n) … … 268 258 } 269 259 270 localMask.resize(nDstLocal) ; 271 localMask=false ; 272 ndata=domainDest_->data_i_index.numElements() ; 273 for (int idx=0; idx < ndata; ++idx) 274 { 275 size_t ind = domainDest_->data_j_index(idx)*domainDest_->ni+domainDest_->data_i_index(idx) ; 276 localMask(ind)=domainDest_->mask_1d(ind) ; 277 } 278 260 279 261 int nDstLocalUnmasked = 0 ; 280 for (int idx=0 ; idx < nDstLocal; idx++) if ( localMask(idx)) ++nDstLocalUnmasked ;262 for (int idx=0 ; idx < nDstLocal; idx++) if (domainDest_->localMask(idx)) ++nDstLocalUnmasked ; 281 263 282 264 CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); … … 287 269 for (int idx=0 ; idx < nDstLocal; idx++) 288 270 { 289 if ( localMask(idx))271 if (domainDest_->localMask(idx)) 290 272 { 291 273 for(int n=0;n<nVertexDest;++n)
Note: See TracChangeset
for help on using the changeset viewer.