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/maximum.cpp

    r369 r470  
    1414      { /* Ne rien faire de plus */ } 
    1515 
     16      CMaximum::CMaximum(CArray<double,1>& doutput, double missingValue) 
     17         : SuperClass(StdString("maximum"), doutput, missingValue) 
     18      { /* Ne rien faire de plus */ } 
     19 
    1620      CMaximum::~CMaximum(void) 
    1721      { /* Ne rien faire de plus */ } 
     
    2630              double * it   = _doutput.dataFirst(); 
    2731         if (this->nbcall == 1) for (; it1 != end1; it1++, it++) *it = *it1; 
    28          else for (; it1 != end1; it1++, it++) *it = std::max(*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::max(*it1, *it); 
     40                 else *it=*it1 ;   
     41               } 
     42           } 
     43           else for (; it1 != end1; it1++, it++) *it = std::max(*it1, *it); 
     44         } 
    2945 
    3046 
Note: See TracChangeset for help on using the changeset viewer.