Changeset 1285


Ignore:
Timestamp:
09/28/17 11:43:11 (4 years ago)
Author:
oabramkina
Message:

Reverting changes done in r1282.

Location:
XIOS/dev/XIOS_DEV_CMIP6/src/filter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/filter/temporal_filter.cpp

    r1282 r1285  
    1717    , samplingOffset(samplingOffset) 
    1818    , 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    , nextSamplingDate(initDate + this->samplingOffset + initDate.getRelCalendar().getTimeStep()) 
     20    , nextOperationDate(initDate + opFreq + this->samplingOffset) 
    2421    , isFirstOperation(true) 
    25     , nextSamplingDate(initDate + initDate.getRelCalendar().getTimeStep() + this->samplingOffset) 
    26     , nextOperationDate(initDate + opFreq + this->samplingOffset) 
    27 //    , nextOperationDate(initDate + opFreq + this->offsetMonth + this->offsetAllButMonth) 
    28     , nbSamplingDates(0) 
    2922  { 
    30     if (offsetMonth != NoneDu && offsetAllButMonth != NoneDu) 
    31     { 
    32       nextOperationDate = initDate + opFreq + this->offsetMonth; 
    33 //      nextSamplingDate = initDate + initDate.getRelCalendar().getTimeStep() + this->samplingOffset; 
    34       nextSamplingDate = initDate + this->offsetMonth + this->offsetAllButMonth; 
    35     } 
    3623  } 
    3724 
     
    4835      { 
    4936        usePacket = (data[0]->date >= nextSamplingDate); 
    50         outputResult = ((offsetMonth != NoneDu && offsetAllButMonth != NoneDu) 
    51                        ? (data[0]->date - offsetAllButMonth > nextOperationDate - samplingFreq) 
    52                        : (data[0]->date + samplingFreq > nextOperationDate)); 
    53 //        outputResult = (data[0]->date  > nextOperationDate - samplingFreq); 
     37        outputResult = (data[0]->date + samplingFreq > nextOperationDate); 
    5438        copyLess = (isInstantOperation && usePacket && outputResult); 
    5539      } 
     
    6549        } 
    6650 
    67         if (offsetMonth != NoneDu && offsetAllButMonth != NoneDu) 
    68         { 
    69           nextSamplingDate = initDate + samplingFreq; 
    70           for (int i=0; i<(nbSamplingDates+1); i++) 
    71           { 
    72             nextSamplingDate = nextSamplingDate + samplingFreq; 
    73           } 
    74           nextSamplingDate = nextSamplingDate + offsetAllButMonth; 
    75         } 
    76         else 
    77           nextSamplingDate = nextSamplingDate + samplingFreq; 
    78  
    79         nbSamplingDates++; 
    80  
     51        nextSamplingDate = nextSamplingDate + samplingFreq; 
    8152      } 
    8253 
     
    9768          packet = data[0]; 
    9869 
     70        isFirstOperation = false; 
    9971        nextOperationDate = nextOperationDate + samplingFreq + opFreq - samplingFreq; 
    100         isFirstOperation = false; 
    10172      } 
    10273    } 
  • XIOS/dev/XIOS_DEV_CMIP6/src/filter/temporal_filter.hpp

    r1282 r1285  
    5656      const CDuration samplingOffset; //!< The sampling offset, i.e. the offset after which the input data will be used 
    5757      const CDuration opFreq; //!< The operation frequency, i.e. the frequency at which the output data will be computed 
    58       const CDuration offsetMonth; 
    59       const CDuration offsetAllButMonth; 
    60       const CDate initDate; 
    61       bool isFirstOperation; //!< True before the first operation was been computed 
    6258      CDate nextSamplingDate; //!< The date of the next sampling 
    6359      CDate nextOperationDate; //!< The date of the next operation 
    64       int nbSamplingDates; 
     60      bool isFirstOperation; //!< True before the first operation was been computed 
    6561  }; // class CTemporalFilter 
    6662} // namespace xios 
Note: See TracChangeset for help on using the changeset viewer.