Changeset 1286 for XIOS


Ignore:
Timestamp:
10/02/17 10:50:43 (7 years ago)
Author:
oabramkina
Message:

Backporting r1280 to trunk: adding a check on the field attributes freq_op and freq_offset and changing their default values.

Location:
XIOS/trunk/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/filter/temporal_filter.cpp

    r1124 r1286  
    1414    , isOnceOperation(functor->timeType() == func::CFunctor::once) 
    1515    , isInstantOperation(functor->timeType() == func::CFunctor::instant) 
    16     // If we can optimize the sampling when dealing with an instant functor we do it 
    17     , samplingFreq((isInstantOperation && samplingFreq == TimeStep && samplingOffset == NoneDu) ? opFreq : samplingFreq) 
    18     , samplingOffset((isInstantOperation && samplingFreq == TimeStep && samplingOffset == NoneDu) ? opFreq - initDate.getRelCalendar().getTimeStep() : samplingOffset) 
     16    , samplingFreq(samplingFreq) 
     17    , samplingOffset(samplingOffset) 
    1918    , opFreq(opFreq) 
    2019    , nextSamplingDate(initDate + this->samplingOffset + initDate.getRelCalendar().getTimeStep()) 
  • XIOS/trunk/src/node/field.cpp

    r1186 r1286  
    14461446 
    14471447   /*! 
     1448    * Check on freq_off and freq_op attributes. 
     1449    */ 
     1450   void CField::checkAttributes(void) 
     1451   { 
     1452     if (freq_op.isEmpty()) 
     1453     { 
     1454       if (!freq_offset.isEmpty()) 
     1455         ERROR("CField::checkAttributes(void)", 
     1456               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
     1457               << "Attribute freq_offset cannot be defined if attribute freq_op is not defined. " 
     1458               << "Please define freq_op.") 
     1459       else 
     1460       { 
     1461         if (operation.getValue()=="instant") 
     1462         { 
     1463           freq_op.setValue(file->output_freq.getValue()); 
     1464           freq_offset.setValue(file->output_freq.getValue()-TimeStep); 
     1465         } 
     1466         else 
     1467         { 
     1468           freq_op.setValue(TimeStep); 
     1469           freq_offset.setValue(freq_op.getValue()-TimeStep); 
     1470         } 
     1471       } 
     1472     } 
     1473     else 
     1474     { 
     1475       if (freq_offset.isEmpty()) 
     1476         freq_offset.setValue(freq_op.getValue()-TimeStep); 
     1477     } 
     1478   } 
     1479 
     1480   /*! 
    14481481    * Returns string arithmetic expression associated to the field. 
    14491482    * \return if content is defined return content string, otherwise, if "expr" attribute is defined, return expr string. 
  • XIOS/trunk/src/node/field.hpp

    r1119 r1286  
    176176        void sendAddAllVariables(); 
    177177 
     178        /// Vérifications /// 
     179        void checkAttributes(void); 
    178180 
    179181        const std::vector<StdString>& getRefDomainAxisIds(); 
  • XIOS/trunk/src/node/file.cpp

    r1195 r1286  
    10981098       CField* field = this->enabledFields[i]; 
    10991099       this->sendAddField(field->getId()); 
     1100       field->checkAttributes(); 
    11001101       field->sendAllAttributesToServer(); 
    11011102       field->sendAddAllVariables(); 
Note: See TracChangeset for help on using the changeset viewer.