Changeset 1015 for XIOS/trunk/src


Ignore:
Timestamp:
01/05/17 14:21:17 (7 years ago)
Author:
oabramkina
Message:

Check if output_frequency >= timestep added.
Files with output_frequency < timestep are considered to be disabled.

Location:
XIOS/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/duration.cpp

    r612 r1015  
    2424        hour = duration.hour; minute = duration.minute; second = duration.second; timestep = duration.timestep; 
    2525        return *this; 
     26      } 
     27 
     28      bool operator<(CDuration a, CDuration b) 
     29      { 
     30        double aSeconds = a.second + 60.*(a.minute + 60.*(a.hour + 24.*(a.day + a.year*365.25) ) ); 
     31        double bSeconds = b.second + 60.*(b.minute + 60.*(b.hour + 24.*(b.day + b.year*365.25) ) ); 
     32        return (aSeconds < bSeconds); 
    2633      } 
    2734 
  • XIOS/trunk/src/duration.hpp

    r612 r1015  
    2222            /// Opérateurs /// 
    2323            CDuration& operator=(const CDuration& duration); 
     24 
     25            friend bool operator<(CDuration a, CDuration b); 
    2426 
    2527            friend StdOStream& operator<<(StdOStream& out, const CDuration& duration); 
  • XIOS/trunk/src/node/context.cpp

    r958 r1015  
    571571         { 
    572572            if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixé à vrai. 
     573            { 
     574              if ( allFiles[i]->output_freq.getValue() < this->getCalendar()->getTimeStep()) 
     575              { 
     576                error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl 
     577                    << "Output frequency in file \""<<allFiles[i]->getId() 
     578                    <<"\" is greater than the time step. File will not be written."<<endl; 
     579              } 
     580              else 
    573581               enabledFiles.push_back(allFiles[i]); 
     582            } 
    574583         } 
    575          else enabledFiles.push_back(allFiles[i]); // otherwise true by default 
    576  
     584         else 
     585         { 
     586           if ( allFiles[i]->output_freq.getValue() < this->getCalendar()->getTimeStep()) 
     587           { 
     588             error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl 
     589                 << "Output frequency in file \""<<allFiles[i]->getId() 
     590                 <<"\" is greater than the time step. File will not be written."<<endl; 
     591           } 
     592           else 
     593             enabledFiles.push_back(allFiles[i]); // otherwise true by default 
     594         } 
    577595 
    578596      if (enabledFiles.size() == 0) 
Note: See TracChangeset for help on using the changeset viewer.