Changeset 1321 for XIOS/dev


Ignore:
Timestamp:
10/30/17 14:41:06 (6 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.

File:
1 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 
Note: See TracChangeset for help on using the changeset viewer.