Changeset 2185 for XIOS


Ignore:
Timestamp:
07/15/21 15:03:45 (3 years ago)
Author:
jderouillat
Message:

Fix ni/nj computation when not defined but number of elements in i_index/j_index is 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp

    r2125 r2185  
    901901            if (i_index(idx) > maxIndex) maxIndex = i_index(idx); 
    902902          } 
    903           ni = maxIndex - minIndex + 1;  
    904           minIIndex = minIIndex;           
     903          if (i_index.numElements()) { 
     904            ni = maxIndex - minIndex + 1;  
     905            minIIndex = minIndex; 
     906          }          
     907          else { 
     908            ni = 0; 
     909          } 
    905910        } 
    906911 
     
    963968            if (j_index(idx) > maxIndex) maxIndex = j_index(idx); 
    964969          } 
    965           nj = maxIndex - minIndex + 1; 
    966           minJIndex = minIndex;  
     970          if (j_index.numElements()) { 
     971            nj = maxIndex - minIndex + 1; 
     972            minJIndex = minIndex;  
     973          } 
     974          else 
     975            nj = 0; 
    967976        }   
    968977        // It's the same as checkLocalIDomain. It's not so correct but if jbegin is not the first value of j_index  
Note: See TracChangeset for help on using the changeset viewer.