Changeset 880


Ignore:
Timestamp:
07/04/16 14:13:36 (8 years ago)
Author:
ymipsl
Message:

Interpolation : solve issue with indexed mesh definition.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp

    r856 r880  
    234234 
    235235 
     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      
    236246  // supress masked data for the source 
    237247  int nSrcLocalUnmasked = 0 ; 
    238   for (int idx=0 ; idx < nSrcLocal; idx++) if (domainSrc_-> mask_1d(idx)) ++nSrcLocalUnmasked ; 
     248  for (int idx=0 ; idx < nSrcLocal; idx++) if (localMask(idx)) ++nSrcLocalUnmasked ; 
     249 
    239250 
    240251  CArray<double,2> boundsLonSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 
     
    245256  for (int idx=0 ; idx < nSrcLocal; idx++) 
    246257  { 
    247     if (domainSrc_-> mask_1d(idx)) 
     258    if (localMask(idx)) 
    248259    { 
    249260      for(int n=0;n<nVertexSrc;++n) 
     
    257268  } 
    258269 
     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      
    259279  int nDstLocalUnmasked = 0 ; 
    260   for (int idx=0 ; idx < nDstLocal; idx++) if (domainDest_-> mask_1d(idx)) ++nDstLocalUnmasked ; 
     280  for (int idx=0 ; idx < nDstLocal; idx++) if (localMask(idx)) ++nDstLocalUnmasked ; 
    261281 
    262282  CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 
     
    267287  for (int idx=0 ; idx < nDstLocal; idx++) 
    268288  { 
    269     if (domainDest_-> mask_1d(idx)) 
     289    if (localMask(idx)) 
    270290    { 
    271291      for(int n=0;n<nVertexDest;++n) 
     
    279299  } 
    280300 
    281 //  mapper.setSourceMesh(boundsLonSrc.dataFirst(), boundsLatSrc.dataFirst(), nVertexSrc, nSrcLocal, &srcPole[0], globalSrc); 
    282301  mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 
    283 //  mapper.setTargetMesh(boundsLonDest.dataFirst(), boundsLatDest.dataFirst(), nVertexDest, nDstLocal, &dstPole[0], globalDst); 
    284302  mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 
    285303 
Note: See TracChangeset for help on using the changeset viewer.