Ignore:
Timestamp:
01/30/14 15:55:42 (10 years ago)
Author:
ymipsl
Message:

Enhancement : using new field attribute "detect_missing_value=true" adn defining a default value, the temporal operator (average, minimum, maximum, accumulate ...) detect missing value in the field and don't take them into account to perform the operation.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/functor/minimum.cpp

    r369 r470  
    1111      CMinimum::CMinimum(CArray<double,1>& doutput) 
    1212         : SuperClass(StdString("minimum"), doutput) 
     13      { /* Ne rien faire de plus */ } 
     14 
     15      CMinimum::CMinimum(CArray<double,1>& doutput, double missingValue) 
     16         : SuperClass(StdString("minimum"), doutput, missingValue) 
    1317      { /* Ne rien faire de plus */ } 
    1418 
     
    2630         
    2731        if (this->nbcall == 1)  for (; it1 != end1; it1++, it++) *it = *it1; 
    28         else for (; it1 != end1; it1++, it++) *it = std::min(*it1, *it); 
     32        else  
     33        { 
     34          if (hasMissingValue)  
     35          {  
     36            for (; it1 != end1; it1++, it++)  
     37              if (*it1!=missingValue) 
     38              { 
     39                if (*it != missingValue) *it = std::min(*it1, *it); 
     40                else *it=*it1 ; 
     41              } 
     42          } 
     43          else for (; it1 != end1; it1++, it++) *it = std::min(*it1, *it); 
     44        } 
    2945 
    3046      } 
Note: See TracChangeset for help on using the changeset viewer.