Changeset 757


Ignore:
Timestamp:
10/23/15 10:49:19 (5 years ago)
Author:
rlacroix
Message:

File: Add a new record_offset attribute.

This is mostly useful in read mode to skip some records.

Location:
XIOS/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/config/file_attribute.conf

    r711 r757  
    1717DECLARE_ENUM2(mode,          read, write) 
    1818DECLARE_ENUM4(time_counter,  centered, instant, record, none) 
     19DECLARE_ATTRIBUTE(int,       record_offset) 
    1920 
    2021DECLARE_ATTRIBUTE(int,       compression_level) 
  • XIOS/trunk/src/io/nc4_data_output.cpp

    r713 r757  
    14011401        if (!field->wasWritten()) 
    14021402        { 
    1403           if (appendMode) 
     1403          if (appendMode && field->file->record_offset.isEmpty()) 
    14041404          { 
    14051405            field->resetNStep(getRecordFromTime(field->last_Write_srv) + 1); 
  • XIOS/trunk/src/node/file.cpp

    r702 r757  
    236236      allDomainEmpty = true; 
    237237 
     238      if (!record_offset.isEmpty() && record_offset < 0) 
     239        ERROR("void CFile::initFile(void)", 
     240              "Invalid 'record_offset', this attribute cannot be negative."); 
     241      const size_t recordOffset = record_offset.isEmpty() ? 0 : record_offset; 
     242 
    238243      set<CAxis*> setAxis; 
    239244      set<CDomain*> setDomains; 
     
    250255         for (size_t i = 0; i < vecDomains.size(); ++i) 
    251256            setDomains.insert(vecDomains[i]); 
     257 
     258         field->resetNStep(recordOffset); 
    252259      } 
    253260      nbAxis = setAxis.size(); 
Note: See TracChangeset for help on using the changeset viewer.