Ignore:
Timestamp:
08/12/16 19:57:50 (8 years ago)
Author:
mhnguyen
Message:

Modifying vertical interpolation

+) Only process interpolation, the extrapolation will be ignored (value will be unidentified (masked))
+) Make sure even unidenfitified from one transformation can be known in the next transformation

Test
+) On Curie
+) Vertical interpolation: Correct
+) Vertical interpolation + horizontal interpolation: Correct

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp

    r889 r918  
    2222                                            const double* dataInput, 
    2323                                            CArray<double,1>& dataOut, 
    24                                             std::vector<bool>& flagInitial) 
     24                                            std::vector<bool>& flagInitial, 
     25                                            const double& defaultValue) 
    2526{ 
    2627  int nbLocalIndex = localIndex.size(); 
    27   for (int idx = 0; idx < nbLocalIndex; ++idx) 
    28   { 
    29     dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 
     28  bool hasMissingValue = (0.0 != defaultValue) ? true : false; 
     29  if (hasMissingValue) 
     30  { 
     31    for (int idx = 0; idx < nbLocalIndex; ++idx) 
     32    { 
     33      if (defaultValue == *(dataInput + idx)) 
     34      { 
     35        flagInitial[localIndex[idx].first] = false; 
     36      } 
     37      else 
     38      { 
     39        dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 
     40      } 
     41    } 
     42 
     43    for (int idx = 0; idx < nbLocalIndex; ++idx) 
     44    { 
     45      if (!flagInitial[localIndex[idx].first]) 
     46        dataOut(localIndex[idx].first) = defaultValue; 
     47    } 
     48  } 
     49  else 
     50  { 
     51    for (int idx = 0; idx < nbLocalIndex; ++idx) 
     52    { 
     53      dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 
     54    } 
    3055  } 
    3156} 
Note: See TracChangeset for help on using the changeset viewer.