Changeset 1440


Ignore:
Timestamp:
02/23/18 11:15:33 (6 years ago)
Author:
ymipsl
Message:

Bug fix : for temporal filter, to detect_missing value, default_value attribute must be defined in the incoming field. This is not requiere any more since default value is automatically fixed to NaN in the internal workflow.

YM

Location:
XIOS/dev/XIOS_DEV_CMIP6/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/filter/temporal_filter.cpp

    r1406 r1440  
    55namespace xios 
    66{ 
    7   static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, double missingValue, CArray<double, 1>& tmpData); 
     7  static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, CArray<double, 1>& tmpData); 
    88 
    99  CTemporalFilter::CTemporalFilter(CGarbageCollector& gc, const std::string& opId, 
    1010                                   const CDate& initDate, const CDuration samplingFreq, const CDuration samplingOffset, const CDuration opFreq, 
    11                                    bool ignoreMissingValue /*= false*/, double missingValue /*= 0.0*/) 
     11                                   bool ignoreMissingValue /*= false*/) 
    1212    : CFilter(gc, 1, this) 
    13     , functor(createFunctor(opId, ignoreMissingValue, missingValue, tmpData)) 
     13    , functor(createFunctor(opId, ignoreMissingValue, tmpData)) 
    1414    , isOnceOperation(functor->timeType() == func::CFunctor::once) 
    1515    , isInstantOperation(functor->timeType() == func::CFunctor::instant) 
     
    9595  } 
    9696 
    97   static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, double missingValue, CArray<double, 1>& tmpData) 
     97  static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, CArray<double, 1>& tmpData) 
    9898  { 
    9999    func::CFunctor* functor = NULL; 
    100100 
    101     double defaultValue = ignoreMissingValue ? std::numeric_limits<double>::quiet_NaN() : missingValue; 
     101    double defaultValue = std::numeric_limits<double>::quiet_NaN(); 
    102102 
    103103#define DECLARE_FUNCTOR(MType, mtype) \ 
  • XIOS/dev/XIOS_DEV_CMIP6/src/filter/temporal_filter.hpp

    r1358 r1440  
    2626       * \param ignoreMissingValue true if and only if the missing value must be ignored 
    2727                                   when doing the operation 
    28        * \param missingValue the missing value 
    2928       */ 
    3029      CTemporalFilter(CGarbageCollector& gc, const std::string& opId, 
    3130                      const CDate& initDate, const CDuration samplingFreq, const CDuration samplingOffset, const CDuration opFreq, 
    32                       bool ignoreMissingValue = false, double missingValue = 0.0); 
     31                      bool ignoreMissingValue = false); 
    3332 
    3433      /*! 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/field.cpp

    r1417 r1440  
    12171217       checkTimeAttributes(&outFreq); 
    12181218 
    1219        const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     1219       const bool detectMissingValues = (!detect_missing_value.isEmpty() && detect_missing_value == true); 
    12201220       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    12211221                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
    1222                                                                              freq_op, freq_offset, outFreq, 
    1223                                                                              detectMissingValues, detectMissingValues ? default_value : 0.0)); 
     1222                                                                             freq_op, freq_offset, outFreq, detectMissingValues)); 
    12241223 
    12251224       instantDataFilter->connectOutput(temporalFilter, 0); 
     
    12561255       checkTimeAttributes(&outFreq); 
    12571256 
    1258        const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     1257       const bool detectMissingValues = (!detect_missing_value.isEmpty() && detect_missing_value == true); 
    12591258       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    12601259                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
    1261                                                                              freq_op, freq_offset, outFreq, 
    1262                                                                              detectMissingValues, detectMissingValues ? default_value : 0.0)); 
     1260                                                                             freq_op, freq_offset, outFreq, detectMissingValues)); 
    12631261 
    12641262       selfReferenceFilter->connectOutput(temporalFilter, 0); 
Note: See TracChangeset for help on using the changeset viewer.