Changeset 1120


Ignore:
Timestamp:
05/05/17 08:58:34 (4 years ago)
Author:
rlacroix
Message:

Add some error checking for xios_field_is_active.

It does not make sense to call this function on fields that cannot be used to send or receive data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/field.cpp

    r1119 r1120  
    520520   bool CField::isActive(bool atCurrentTimestep /*= false*/) const 
    521521   { 
    522       if (atCurrentTimestep && clientSourceFilter) 
    523         return clientSourceFilter->isDataExpected(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
    524       else 
    525         return (instantDataFilter != NULL); 
     522      if (clientSourceFilter) 
     523        return atCurrentTimestep ? clientSourceFilter->isDataExpected(CContext::getCurrent()->getCalendar()->getCurrentDate()) : true; 
     524      else if (storeFilter) 
     525        return true; 
     526      else if (instantDataFilter) 
     527        ERROR("bool CField::isActive(bool atCurrentTimestep)", 
     528              << "Impossible to check if field [ id = " << getId() << " ] is active as it cannot be used to receive nor send data."); 
     529 
     530      return false; 
    526531   } 
    527532 
Note: See TracChangeset for help on using the changeset viewer.