Changeset 1302 for XIOS/dev/XIOS_DEV_CMIP6/src/filter/temporal_filter.cpp
- Timestamp:
- 10/09/17 16:48:08 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/filter/temporal_filter.cpp
r1285 r1302 17 17 , samplingOffset(samplingOffset) 18 18 , opFreq(opFreq) 19 , offsetMonth({0, this->samplingOffset.month, 0, 0, 0, 0, 0}) 20 , offsetAllButMonth({this->samplingOffset.year, 0 , this->samplingOffset.day, 21 this->samplingOffset.hour, this->samplingOffset.minute, 22 this->samplingOffset.second, this->samplingOffset.timestep}) 23 , initDate(initDate) 19 24 , nextSamplingDate(initDate + this->samplingOffset + initDate.getRelCalendar().getTimeStep()) 20 , nextOperationDate(initDate + opFreq + this->samplingOffset) 25 , nbOperationDates(1) 26 // , nextOperationDate(initDate + opFreq + this->samplingOffset) 21 27 , isFirstOperation(true) 22 28 { … … 35 41 { 36 42 usePacket = (data[0]->date >= nextSamplingDate); 37 outputResult = (data[0]->date + samplingFreq > nextOperationDate); 43 // outputResult = (data[0]->date + samplingFreq > nextOperationDate); 44 outputResult = (data[0]->date > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 38 45 copyLess = (isInstantOperation && usePacket && outputResult); 39 46 } … … 54 61 if (outputResult) 55 62 { 63 nbOperationDates ++; 56 64 if (!copyLess) 57 65 { … … 69 77 70 78 isFirstOperation = false; 71 nextOperationDate = nextOperationDate + samplingFreq + opFreq - samplingFreq;79 // nextOperationDate = initDate + samplingFreq + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth; 72 80 } 73 81 } … … 78 86 bool CTemporalFilter::isDataExpected(const CDate& date) const 79 87 { 80 return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date + samplingFreq > nextOperationDate); 88 // return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date + samplingFreq > nextOperationDate); 89 return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 81 90 } 82 91
Note: See TracChangeset
for help on using the changeset viewer.