Changeset 1119 for XIOS/trunk/src/node


Ignore:
Timestamp:
05/05/17 08:58:33 (7 years ago)
Author:
rlacroix
Message:

Add the ability to check if an output field is active at the current timestep.

The "xios_field_is_active" function can now take an optional logical argument that can be used to enable this new behavior.

Location:
XIOS/trunk/src/node
Files:
2 edited

Legend:

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

    r1018 r1119  
    518518   //---------------------------------------------------------------- 
    519519 
    520    bool CField::isActive(void) const 
    521    { 
    522       return (instantDataFilter != NULL); 
     520   bool CField::isActive(bool atCurrentTimestep /*= false*/) const 
     521   { 
     522      if (atCurrentTimestep && clientSourceFilter) 
     523        return clientSourceFilter->isDataExpected(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
     524      else 
     525        return (instantDataFilter != NULL); 
    523526   } 
    524527 
  • XIOS/trunk/src/node/field.hpp

    r1017 r1119  
    9797 
    9898       public: 
    99          bool isActive(void) const; 
     99         bool isActive(bool atCurrentTimestep = false) const; 
    100100         bool hasOutputFile; 
    101101 
Note: See TracChangeset for help on using the changeset viewer.