Ignore:
Timestamp:
07/20/21 16:22:31 (3 years ago)
Author:
jderouillat
Message:

Add bound checking when the workflow view is scaned (highlighted by blitz check in debug mode)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/transformation/domain_algorithm/domain_algorithm_extract.cpp

    r2186 r2190  
    195195      domainDest_->j_index(countDest) = jIdxSrc-extractJBegin_; 
    196196      transformationMapping_[extractNi_*(jIdxSrc-extractJBegin_)+iIdxSrc-extractIBegin_]=sourceGlobalIdx(countSrc); 
    197       if ( sourceFullIdx(countSrc)==sourceWorkflowIdx(countSrc-countMasked) ) 
    198       { 
    199         domainDest_->mask_1d(countDest) = 1; 
    200       } 
    201       else { 
     197      if ( ( (countSrc-countMasked) >= sourceWorkflowIdx.numElements() ) 
     198         || ( sourceFullIdx(countSrc)!=sourceWorkflowIdx(countSrc-countMasked) ) ) 
     199      { 
    202200        domainDest_->mask_1d(countDest) = 0; 
    203201        // if point masked, manage offset between full and worfklow views of domainSource 
    204202        countMasked++; 
     203      } 
     204      else { 
     205        domainDest_->mask_1d(countDest) = 1; 
    205206      } 
    206207 
     
    262263    } 
    263264    else 
    264       if ( sourceFullIdx(countSrc)!=sourceWorkflowIdx(countSrc-countMasked) ) 
     265      if ( ( (countSrc-countMasked) >= sourceWorkflowIdx.numElements() ) 
     266         || ( sourceFullIdx(countSrc)!=sourceWorkflowIdx(countSrc-countMasked) ) ) 
    265267      { 
    266268        // manage offset between full and worfklow views of domainSource even if point i is not concerned 
Note: See TracChangeset for help on using the changeset viewer.