Ignore:
Timestamp:
03/10/22 13:47:59 (2 years ago)
Author:
ymipsl
Message:

Fix problem when reading scalar on multiple servers.
YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/io/inetcdf4.cpp

    r2274 r2308  
    708708      scount.push_back(1); 
    709709      it++; 
    710     } 
    711     for (int i = 0; it != dimlist.end(); it++, i++) 
     710     
     711      if ( it == dimlist.end()) // scalar case 
     712      { 
     713        if (start && count) 
     714        { 
     715          scount.pop_back(); 
     716          scount.push_back((*count)[0]); 
     717          array_size *= (*count)[0]; 
     718        } 
     719        return ; 
     720      } 
     721    } 
     722     
     723    if ( it == dimlist.end()) // scalar case 
    712724    { 
    713725      if (start && count) 
    714726      { 
    715         sstart.push_back((*start)[i]); 
    716         scount.push_back((*count)[i]); 
    717         array_size *= (*count)[i]; 
     727        sstart.push_back((*start)[0]); 
     728        scount.push_back((*count)[0]); 
     729        array_size *= (*count)[0]; 
    718730      } 
    719731      else 
    720732      { 
    721733        sstart.push_back(0); 
    722         scount.push_back(dimmap[*it]); 
    723         array_size *= dimmap[*it]; 
     734        scount.push_back(1); 
     735        array_size *= 1; 
     736      } 
     737 
     738    } 
     739    else 
     740    {   
     741      for (int i = 0; it != dimlist.end(); it++, i++) 
     742      { 
     743        if (start && count) 
     744        { 
     745          sstart.push_back((*start)[i]); 
     746          scount.push_back((*count)[i]); 
     747          array_size *= (*count)[i]; 
     748        } 
     749        else 
     750        { 
     751          sstart.push_back(0); 
     752          scount.push_back(dimmap[*it]); 
     753          array_size *= dimmap[*it]; 
     754        } 
    724755      } 
    725756    } 
Note: See TracChangeset for help on using the changeset viewer.