Changeset 1632


Ignore:
Timestamp:
01/09/19 18:07:38 (8 months ago)
Author:
oabramkina
Message:

Undoing r1631.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/io/onetcdf4_impl.hpp

    r1631 r1632  
    7373    } 
    7474    char *PtrArrayStr ; 
    75     PtrArrayStr=new char[stringArrayLen*data.numElements()] ; 
    76     memset (PtrArrayStr,' ',stringArrayLen*data.numElements()); 
    77     size_t offset=0 ; 
     75    PtrArrayStr=new char[stringArrayLen] ; 
    7876    Array<StdString,1>::const_iterator it, itb=data.begin(), ite=data.end() ; 
    79     for(it=itb;it!=ite;++it, offset+=stringArrayLen) 
     77    int lineNb = 0; 
     78    for(it=itb;it!=ite;++it) 
    8079    { 
    81       it->copy(PtrArrayStr+offset,it->size()) ; 
    82       PtrArrayStr[offset+it->size()]='\0' ; 
     80      it->copy(PtrArrayStr,it->size()) ; 
     81      PtrArrayStr[it->size()]='\0' ; 
     82      sstart[0] = lineNb; 
     83      sstart[dimArrayLen] = 0; 
     84      scount[0] = 1; 
     85      scount[dimArrayLen] = it->size() + 1; 
     86      CTimer::get("CONetCDF4::writeData writeData_").resume(); 
     87      this->writeData_(grpid, varid, sstart, scount, PtrArrayStr); 
     88      CTimer::get("CONetCDF4::writeData writeData_").suspend(); 
     89      ++lineNb; 
    8390    } 
    84  
    85      CTimer::get("CONetCDF4::writeData writeData_").resume(); 
    86      this->writeData_(grpid, varid, sstart, scount, PtrArrayStr); 
    87      CTimer::get("CONetCDF4::writeData writeData_").suspend(); 
    88  
    8991    delete []  PtrArrayStr; 
    9092  } 
Note: See TracChangeset for help on using the changeset viewer.