Changeset 893


Ignore:
Timestamp:
07/06/16 17:40:32 (8 years ago)
Author:
ymipsl
Message:

Interpolation : solve issue with indexed mesh definition.

YM

Location:
XIOS/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/domain.cpp

    r881 r893  
    896896 
    897897   //---------------------------------------------------------------- 
    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    
    899940   void CDomain::checkEligibilityForCompressedOutput(void) 
    900941   { 
     
    11881229         this->checkDomainData(); 
    11891230         this->checkCompression(); 
     1231         this->computeLocalMask() ; 
    11901232      } 
    11911233      else 
     
    12271269         this->checkDomainData(); 
    12281270         this->checkCompression(); 
     1271         this->computeLocalMask() ; 
    12291272 
    12301273      } 
  • XIOS/trunk/src/node/domain.hpp

    r881 r893  
    159159         static ENodeType GetType(void); 
    160160         const std::map<int, vector<size_t> >& getIndexServer() const; 
    161          CArray<int, 2> local_mask; 
     161         CArray<bool, 1> localMask; 
    162162         bool isCurvilinear ; 
    163163         bool hasBounds ; 
     
    177177         void checkLonLat(); 
    178178         void checkZoom(void); 
     179         void computeLocalMask(void) ; 
    179180 
    180181         void checkTransformations(); 
  • XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp

    r880 r893  
    233233  mapper.setVerbosity(PROGRESS) ; 
    234234 
    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       
    245235      
    246236  // supress masked data for the source 
    247237  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 ; 
    249239 
    250240 
     
    256246  for (int idx=0 ; idx < nSrcLocal; idx++) 
    257247  { 
    258     if (localMask(idx)) 
     248    if (domainSrc_->localMask(idx)) 
    259249    { 
    260250      for(int n=0;n<nVertexSrc;++n) 
     
    268258  } 
    269259 
    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 
    279261  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 ; 
    281263 
    282264  CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 
     
    287269  for (int idx=0 ; idx < nDstLocal; idx++) 
    288270  { 
    289     if (localMask(idx)) 
     271    if (domainDest_->localMask(idx)) 
    290272    { 
    291273      for(int n=0;n<nVertexDest;++n) 
Note: See TracChangeset for help on using the changeset viewer.