Ignore:
Timestamp:
12/11/14 16:07:42 (10 years ago)
Author:
rlacroix
Message:

Convert more attributes to use the new duration type:

  • field: freq_op and freq_offset
  • file: output_freq, sync_freq and split_freq.

Remember that you now have to use the "xios_duration" type instead of strings to get/set those attributes through the Fortran interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/field.cpp

    r518 r538  
    518518      CContext* context = CContext::getCurrent(); 
    519519 
    520       if (freq_op.isEmpty()) freq_op=string("1ts") ; 
     520      if (freq_op.isEmpty()) freq_op.setValue(TimeStep); 
    521521 
    522522      if (operation.isEmpty() ) 
     
    527527      } 
    528528 
    529       CDuration freq_offset_ = NoneDu; 
    530       if (!freq_offset.isEmpty()) 
    531       { 
    532          freq_offset_ = CDuration::FromString(freq_offset.getValue()); 
    533       } 
    534       else 
    535       { 
    536          freq_offset.setValue(NoneDu.toString()); 
    537       } 
     529      if (freq_offset.isEmpty()) 
     530        freq_offset.setValue(NoneDu); 
    538531 
    539532//      if (CXIOSManager::GetStatus() == CXIOSManager::LOC_SERVER) 
     
    542535         if (hasOutputFile) 
    543536         { 
    544            this->freq_operation_srv =CDuration::FromString(this->file->output_freq.getValue()); 
    545            this->freq_write_srv = CDuration::FromString(this->file->output_freq.getValue()); 
     537           this->freq_operation_srv = this->file->output_freq.getValue(); 
     538           this->freq_write_srv = this->file->output_freq.getValue(); 
    546539         } 
    547          this->lastlast_Write_srv     = boost::shared_ptr<CDate> 
     540         this->lastlast_Write_srv = boost::shared_ptr<CDate> 
    548541                        (new CDate(context->getCalendar()->getInitDate())); 
    549542         this->last_Write_srv     = boost::shared_ptr<CDate> 
     
    556549         if (hasOutputFile) 
    557550         { 
    558            const CDuration toffset = this->freq_operation_srv - freq_offset_ - context->getCalendar()->getTimeStep(); 
     551           const CDuration toffset = this->freq_operation_srv - freq_offset.getValue() - context->getCalendar()->getTimeStep(); 
    559552           *this->last_operation_srv   = *this->last_operation_srv - toffset; 
    560553         } 
     
    563556//      if (context->hasClient) 
    564557//      { 
    565          this->freq_operation = CDuration::FromString(freq_op.getValue()); 
    566          if (hasOutputFile) this->freq_write     = CDuration::FromString(this->file->output_freq.getValue()); 
     558         this->freq_operation = freq_op.getValue(); 
     559         if (hasOutputFile) this->freq_write = this->file->output_freq.getValue(); 
    567560         if (hasFieldOut) 
    568561         { 
    569            this->freq_write = CDuration::FromString(this->fieldOut->freq_op.getValue()); 
     562           this->freq_write = this->fieldOut->freq_op.getValue(); 
    570563         } 
    571564         this->last_Write     = boost::shared_ptr<CDate> 
     
    574567                        (new CDate(context->getCalendar()->getInitDate())); 
    575568 
    576          const CDuration toffset = this->freq_operation - freq_offset_ - context->getCalendar()->getTimeStep(); 
     569         const CDuration toffset = this->freq_operation - freq_offset.getValue() - context->getCalendar()->getTimeStep(); 
    577570         *this->last_operation   = *this->last_operation - toffset; 
    578571 
Note: See TracChangeset for help on using the changeset viewer.