Changeset 850


Ignore:
Timestamp:
05/11/16 16:11:10 (8 years ago)
Author:
ymipsl
Message:

Add cyclic file attribute. If cyclic=true, when last time record of a field is read in a file, it will cycle at the beginning instead of send a EOF signal to the clients.

YM

Location:
XIOS/trunk/src
Files:
3 edited

Legend:

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

    r802 r850  
    1919DECLARE_ATTRIBUTE(StdString, time_counter_name) 
    2020DECLARE_ATTRIBUTE(int,       record_offset) 
     21DECLARE_ATTRIBUTE(bool,       cyclic) 
    2122 
    2223DECLARE_ATTRIBUTE(int,       compression_level) 
  • XIOS/trunk/src/io/nc4_data_input.cpp

    r825 r850  
    5555    { 
    5656      case MULTI_FILE: 
    57         SuperClassWriter::getData(fieldData, fieldId, isCollective, field->getNStep() - 1); 
     57        SuperClassWriter::getData(fieldData, fieldId, isCollective, (field->getNStep() - 1)%field->nstepMax ); 
    5858        break; 
    5959      case ONE_FILE: 
     
    116116        } 
    117117 
    118         SuperClassWriter::getData(fieldData, fieldId, isCollective, field->getNStep() - 1, &start, &count); 
     118        SuperClassWriter::getData(fieldData, fieldId, isCollective, (field->getNStep() - 1)%field->nstepMax, &start, &count); 
    119119        break; 
    120120      } 
  • XIOS/trunk/src/node/field.cpp

    r824 r850  
    284284 
    285285    if (requestData) 
     286    { 
     287      cout<<"currentDate : "<<currentDate<<endl ; 
     288      cout<<"lastDataRequestedFromServer : "<<lastDataRequestedFromServer<<endl ; 
     289      cout<<"file->output_freq.getValue() : "<<file->output_freq.getValue()<<endl ; 
     290      cout<<"lastDataRequestedFromServer + file->output_freq.getValue() : "<<lastDataRequestedFromServer + file->output_freq.getValue()<<endl ; 
     291      
    286292      sendReadDataRequest(); 
     293    } 
    287294 
    288295    return requestData; 
     
    335342 
    336343        getRelFile()->checkFile(); 
    337         this->incrementNStep(); 
    338  
    339344        if (!nstepMax) 
    340345        { 
    341346          nstepMax = getRelFile()->getDataInput()->getFieldNbRecords(CField::get(this)); 
    342347        } 
    343  
    344         if (getNStep() > nstepMax) 
     348         
     349        this->incrementNStep(); 
     350 
     351 
     352 
     353        if (getNStep() > nstepMax && (getRelFile()->cyclic.isEmpty() || !getRelFile()->cyclic) ) 
    345354          return false; 
    346355 
Note: See TracChangeset for help on using the changeset viewer.