Ignore:
Timestamp:
04/13/18 16:25:46 (3 years ago)
Author:
yushan
Message:

Branch EP merged with Dev_cmip6 @r1481

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/transformation/generic_algorithm_transformation.cpp

    r1460 r1482  
    3737  int nbLocalIndex = localIndex.size();    
    3838  double defaultValue = std::numeric_limits<double>::quiet_NaN(); 
     39   
    3940  if (ignoreMissingValue) 
    4041  { 
     42    if (firstPass) dataOut=defaultValue ; 
     43  
    4144    for (int idx = 0; idx < nbLocalIndex; ++idx) 
    4245    { 
    43       if (NumTraits<double>::isnan(*(dataInput + idx))) 
    44       { 
    45         flagInitial[localIndex[idx].first] = false; 
    46       } 
    47       else 
    48       { 
    49         dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 
    50         flagInitial[localIndex[idx].first] = true; // Reset flag to indicate not all data source are nan 
    51       } 
    52     } 
    53  
    54     // If all data source are nan then data destination must be nan 
    55     for (int idx = 0; idx < nbLocalIndex; ++idx) 
    56     { 
    57       if (!flagInitial[localIndex[idx].first]) 
    58         dataOut(localIndex[idx].first) = defaultValue; 
     46      if (! NumTraits<double>::isNan(*(dataInput + idx))) 
     47      { 
     48        if (flagInitial[localIndex[idx].first]) dataOut(localIndex[idx].first) = *(dataInput + idx) * localIndex[idx].second; 
     49        else dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 
     50        flagInitial[localIndex[idx].first] = false; // Reset flag to indicate not all data source are nan 
     51      } 
    5952    } 
    6053  } 
Note: See TracChangeset for help on using the changeset viewer.