Changeset 1302
- Timestamp:
- 10/09/17 16:48:08 (7 years ago)
- Location:
- XIOS/dev/XIOS_DEV_CMIP6/src
- Files:
-
- 3 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 -
XIOS/dev/XIOS_DEV_CMIP6/src/filter/temporal_filter.hpp
r1285 r1302 56 56 const CDuration samplingOffset; //!< The sampling offset, i.e. the offset after which the input data will be used 57 57 const CDuration opFreq; //!< The operation frequency, i.e. the frequency at which the output data will be computed 58 const CDuration offsetMonth; //!< The month duration of samplingOffset 59 CDuration offsetAllButMonth; //!< All but the month duration of samplingOffset 60 const CDate initDate; 58 61 CDate nextSamplingDate; //!< The date of the next sampling 59 CDate nextOperationDate; //!< The date of the next operation 62 int nbOperationDates; //!< The number of times an operation is performed 63 // CDate nextOperationDate; //!< The date of the next operation 60 64 bool isFirstOperation; //!< True before the first operation was been computed 61 65 }; // class CTemporalFilter -
XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp
r1294 r1302 951 951 { 952 952 if (!instantDataFilter) 953 // instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, NoneDu, false,954 // detectMissingValues, defaultValue));955 953 instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,true)); 956 954 … … 969 967 { 970 968 if (!instantDataFilter) 971 // instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, NoneDu, false,972 // detectMissingValues, defaultValue));973 969 instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true)); 974 970
Note: See TracChangeset
for help on using the changeset viewer.