Changeset 1076 for XIOS/trunk/src/filter


Ignore:
Timestamp:
03/16/17 15:04:53 (7 years ago)
Author:
mhnguyen
Message:

Correcting behavior of detecting_missing_value:

  • Missing value detection is activated only when detecting_missing_value = true

and a default_value is defined.

  • By default, undefined value by the computation of vertical (horizontal) interpolation will be NaN (not a number).

They are only converted to default_value if missing value detection is activated

Test

  • On Curie
  • Work
File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/filter/spatial_transform_filter.cpp

    r1042 r1076  
    2626      const std::vector<StdString>& auxInputs = gridTransformation->getAuxInputs(); 
    2727      size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size()); 
    28       double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : missingValue; 
     28      double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : 0.0; 
    2929      boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 
    3030 
     
    117117 
    118118    // Get default value for output data 
    119     double defaultValue = 0.0; 
    120     if (0 != dataDest.numElements()) defaultValue = dataDest(0); 
     119    bool ignoreMissingValue = false;  
     120    double defaultValue = std::numeric_limits<double>::quiet_NaN(); 
     121    if (0 != dataDest.numElements()) ignoreMissingValue = NumTraits<double>::isnan(dataDest(0)); 
    121122 
    122123    const std::list<CGridTransformation::SendingIndexGridSourceMap>& listLocalIndexSend = gridTransformation->getLocalIndexToSendFromGridSource(); 
     
    203204                         dataCurrentDest, 
    204205                         localInitFlag, 
    205                          defaultValue); 
     206                         ignoreMissingValue); 
    206207 
    207208        currentBuff += countSize; 
Note: See TracChangeset for help on using the changeset viewer.