- Timestamp:
- 08/12/16 19:57:50 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp
r889 r918 22 22 const double* dataInput, 23 23 CArray<double,1>& dataOut, 24 std::vector<bool>& flagInitial) 24 std::vector<bool>& flagInitial, 25 const double& defaultValue) 25 26 { 26 27 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 } 30 55 } 31 56 }
Note: See TracChangeset
for help on using the changeset viewer.