Ignore:
Timestamp:
06/06/17 17:58:16 (7 years ago)
Author:
oabramkina
Message:

Two server levels: merging with trunk r1137.
There are bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/filter/spatial_transform_filter.cpp

    r1021 r1158  
    1111 
    1212  std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 
    13   CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue) 
     13  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue) 
    1414  { 
    1515    if (!srcGrid || !destGrid) 
     
    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() : 0.0; 
    2829      boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 
    2930 
     
    103104      } 
    104105      packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements()); 
    105       packet->data = defaultValue; 
     106      if (0 != packet->data.numElements()) 
     107        (packet->data)(0) = defaultValue; 
    106108      apply(data[0]->data, packet->data); 
    107109    } 
     
    115117 
    116118    // Get default value for output data 
    117     double defaultValue = 0.0; 
    118     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)); 
    119122 
    120123    const std::list<CGridTransformation::SendingIndexGridSourceMap>& listLocalIndexSend = gridTransformation->getLocalIndexToSendFromGridSource(); 
     
    191194        else dataCurrentDest(i) = defaultValue; 
    192195 
    193       std::vector<bool> localInitFlag(dataCurrentDest.size(), true); 
     196      std::vector<bool> localInitFlag(dataCurrentDest.numElements(), true); 
    194197      currentBuff = 0; 
    195198      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) 
     
    201204                         dataCurrentDest, 
    202205                         localInitFlag, 
    203                          defaultValue); 
     206                         ignoreMissingValue); 
    204207 
    205208        currentBuff += countSize; 
Note: See TracChangeset for help on using the changeset viewer.