Changeset 1321


Ignore:
Timestamp:
10/30/17 14:41:06 (4 years ago)
Author:
rlacroix
Message:

Improve the check for late data added in r1318.

Avoid waiting for data at the beginning of timestep 0 of the user calls "xios_update_calendar(0)". Data expected at timestep 0 is late only if it still has not been received with switching from timestep 0 to timestep 1.

Location:
XIOS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp

    r1320 r1321  
    566566 
    567567    // Check if data previously requested has been received as expected 
    568     if (wasDataRequestedFromServer && (!isEOF || context->getCalendar()->getCurrentDate() <= dateEOF)) 
     568    if (wasDataRequestedFromServer && (!isEOF || currentDate <= dateEOF)) 
    569569    { 
    570570      CTimer timer("CField::checkForLateDataFromServer"); 
    571  
    572       bool isDataLate = !wasDataAlreadyReceivedFromServer || lastDataReceivedFromServer + file->output_freq < currentDate; 
     571      const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + file->output_freq) : context->getCalendar()->getInitDate(); 
     572 
     573      bool isDataLate = nextDataDue < currentDate; 
    573574      while (isDataLate && timer.getCumulatedTime() < CXios::recvFieldTimeout) 
    574575      { 
     
    579580        timer.suspend(); 
    580581 
    581         isDataLate = !wasDataAlreadyReceivedFromServer || lastDataReceivedFromServer + file->output_freq < currentDate; 
     582        isDataLate = nextDataDue < currentDate; 
    582583      } 
    583584 
  • XIOS/trunk/src/node/field.cpp

    r1319 r1321  
    479479 
    480480    // Check if data previously requested has been received as expected 
    481     if (wasDataRequestedFromServer && (!isEOF || context->getCalendar()->getCurrentDate() <= dateEOF)) 
     481    if (wasDataRequestedFromServer && (!isEOF || currentDate <= dateEOF)) 
    482482    { 
    483483      CTimer timer("CField::checkForLateDataFromServer"); 
    484  
    485       bool isDataLate = !wasDataAlreadyReceivedFromServer || lastDataReceivedFromServer + file->output_freq < currentDate; 
     484      const CDate nextDataDue = wasDataAlreadyReceivedFromServer ? (lastDataReceivedFromServer + file->output_freq) : context->getCalendar()->getInitDate(); 
     485 
     486      bool isDataLate = nextDataDue < currentDate; 
    486487      while (isDataLate && timer.getCumulatedTime() < CXios::recvFieldTimeout) 
    487488      { 
     
    492493        timer.suspend(); 
    493494 
    494         isDataLate = !wasDataAlreadyReceivedFromServer || lastDataReceivedFromServer + file->output_freq < currentDate; 
     495        isDataLate = nextDataDue < currentDate; 
    495496      } 
    496497 
Note: See TracChangeset for help on using the changeset viewer.