Changeset 1278 for XIOS/dev/XIOS_DEV_CMIP6
- Timestamp:
- 09/25/17 12:19:49 (7 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/filter/temporal_filter.cpp
r1272 r1278 14 14 , isOnceOperation(functor->timeType() == func::CFunctor::once) 15 15 , isInstantOperation(functor->timeType() == func::CFunctor::instant) 16 // If we can optimize the sampling when dealing with an instant functor we do it 17 , samplingOffset((isInstantOperation && samplingFreq == NoneDu && samplingOffset == NoneDu) ? opFreq - initDate.getRelCalendar().getTimeStep() : samplingOffset) 18 , samplingFreq((samplingFreq == NoneDu ? (isInstantOperation ? opFreq : initDate.getRelCalendar().getTimeStep()) : samplingFreq)) 16 , samplingFreq(samplingFreq) 17 , samplingOffset(samplingOffset) 19 18 , opFreq(opFreq) 20 19 , nextSamplingDate(initDate + this->samplingOffset + initDate.getRelCalendar().getTimeStep()) -
XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp
r1272 r1278 1144 1144 << "An operation must be defined for field \"" << getId() << "\"."); 1145 1145 1146 if (freq_op.isEmpty())1147 // freq_op.setValue(TimeStep);1148 freq_op.setValue(NoneDu);1149 if (freq_offset.isEmpty())1150 freq_offset.setValue(NoneDu);1151 1152 1146 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1153 1147 … … 1156 1150 freq_op, freq_offset, outFreq, 1157 1151 detectMissingValues, detectMissingValues ? default_value : 0.0)); 1152 1158 1153 instantDataFilter->connectOutput(temporalFilter, 0); 1159 1154 … … 1187 1182 << "An operation must be defined for field \"" << getId() << "\"."); 1188 1183 1189 if (freq_op.isEmpty()) freq_op.setValue(TimeStep);1190 if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu);1191 1192 1184 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1193 1185 … … 1196 1188 freq_op, freq_offset, outFreq, 1197 1189 detectMissingValues, detectMissingValues ? default_value : 0.0)); 1190 1198 1191 selfReferenceFilter->connectOutput(temporalFilter, 0); 1199 1192 return temporalFilter ; … … 1566 1559 1567 1560 /*! 1561 * Check on freq_off and freq_op attributes. 1562 */ 1563 void CField::checkAttributes(void) 1564 { 1565 if (freq_op.isEmpty()) 1566 { 1567 if (!freq_offset.isEmpty()) 1568 ERROR("CField::checkAttributes(void)", 1569 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 1570 << "Attribute freq_offset cannot be defined if attribute freq_op is not defined. " 1571 << "Please define freq_op.") 1572 else 1573 { 1574 CContext* context = CContext::getCurrent(); 1575 if (operation.getValue()=="instant") 1576 { 1577 freq_op.setValue(file->output_freq.getValue()); 1578 freq_offset.setValue(file->output_freq.getValue() - TimeStep); 1579 } 1580 else 1581 { 1582 freq_op.setValue(TimeStep); 1583 freq_op.setValue(NoneDu); 1584 } 1585 } 1586 } 1587 else 1588 { 1589 if (freq_offset.isEmpty()) 1590 freq_op.setValue(NoneDu); 1591 } 1592 } 1593 1594 /*! 1568 1595 * Returns string arithmetic expression associated to the field. 1569 1596 * \return if content is defined return content string, otherwise, if "expr" attribute is defined, return expr string. -
XIOS/dev/XIOS_DEV_CMIP6/src/node/field.hpp
r1239 r1278 130 130 void checkGridOfEnabledFields(); 131 131 void sendGridOfEnabledFields(); 132 void sendGridComponentOfEnabledFields(); 132 void sendGridComponentOfEnabledFields(); 133 134 /// Vérifications /// 135 void checkAttributes(void); 133 136 134 137 void buildFilterGraph(CGarbageCollector& gc, bool enableOutput); -
XIOS/dev/XIOS_DEV_CMIP6/src/node/file.cpp
r1239 r1278 1129 1129 CField* field = this->enabledFields[i]; 1130 1130 this->sendAddField(field->getId(), client); 1131 field->checkAttributes(); 1131 1132 field->sendAllAttributesToServer(client); 1132 1133 field->sendAddAllVariables(client);
Note: See TracChangeset
for help on using the changeset viewer.