Ignore:
Timestamp:
04/04/18 12:42:24 (6 years ago)
Author:
oabramkina
Message:

DEV_CMIP6: bugfix for certain cases of monthly output and freq_offset such as 1mo-2ts.

Location:
XIOS/dev/XIOS_DEV_CMIP6/src
Files:
3 edited

Legend:

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

    r1472 r1473  
    2424    , nextSamplingDate(initDate + (this->samplingOffset + initDate.getRelCalendar().getTimeStep())) 
    2525    , nbOperationDates(1) 
     26    , nbSamplingDates(0) 
    2627//    , nextOperationDate(initDate + opFreq + this->samplingOffset) 
    2728    , isFirstOperation(true) 
     
    4849      if (usePacket) 
    4950      { 
     51        nbSamplingDates ++; 
    5052        if (!copyLess) 
    5153        { 
     
    5658        } 
    5759 
    58         nextSamplingDate = nextSamplingDate + samplingFreq; 
     60        nextSamplingDate = ((initDate + offsetMonth) + nbSamplingDates * samplingFreq) + offsetAllButMonth + initDate.getRelCalendar().getTimeStep(); 
    5961      } 
    6062 
  • XIOS/dev/XIOS_DEV_CMIP6/src/filter/temporal_filter.hpp

    r1440 r1473  
    6767      CDate nextSamplingDate; //!< The date of the next sampling 
    6868      int nbOperationDates; //!< The number of times an operation is performed 
     69      int nbSamplingDates; 
    6970//      CDate nextOperationDate; //!< The date of the next operation 
    7071      bool isFirstOperation; //!< True before the first operation was been computed 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp

    r1440 r1473  
    224224    CArray<double,1> recv_data_tmp(recvDataSrv.numElements());     
    225225    const CDate& currDate = context->getCalendar()->getCurrentDate(); 
    226     const CDate opeDate   = (last_operation_srv + context->getCalendar()->getTimeStep()) +freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep(); 
     226    CDuration offsetAllButMonth (freq_offset.getValue().year, 0 , freq_offset.getValue().day, 
     227                                   freq_offset.getValue().hour, freq_offset.getValue().minute, 
     228                                   freq_offset.getValue().second, freq_offset.getValue().timestep); 
     229    const CDate opeDate   = (last_operation_srv - offsetAllButMonth + context->getCalendar()->getTimeStep()) 
     230                              + freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep() + offsetAllButMonth; 
    227231 
    228232    if (opeDate <= currDate) 
     
    251255 
    252256    const CDate& currDate = context->getCalendar()->getCurrentDate(); 
    253     const CDate opeDate = (last_operation_srv + context->getCalendar()->getTimeStep()) + freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep(); 
     257    CDuration offsetAllButMonth (freq_offset.getValue().year, 0 , freq_offset.getValue().day, 
     258                                   freq_offset.getValue().hour, freq_offset.getValue().minute, 
     259                                   freq_offset.getValue().second, freq_offset.getValue().timestep); 
     260    const CDate opeDate   = (last_operation_srv - offsetAllButMonth + context->getCalendar()->getTimeStep()) 
     261                              + freq_op + freq_operation_srv - freq_op - context->getCalendar()->getTimeStep() + offsetAllButMonth; 
    254262    const CDate writeDate = last_Write_srv + freq_write_srv; 
    255263 
Note: See TracChangeset for help on using the changeset viewer.