Index: /XIOS/trunk/src/transformation/Functions/average_reduction.cpp
===================================================================
--- /XIOS/trunk/src/transformation/Functions/average_reduction.cpp	(revision 1153)
+++ /XIOS/trunk/src/transformation/Functions/average_reduction.cpp	(revision 1154)
@@ -39,7 +39,5 @@
     int nbLocalIndex = localIndex.size();
     int currentlocalIndex = 0;
-    double currentWeight  = 0.0;
-
-    dataOut=std::numeric_limits<double>::quiet_NaN();
+    double currentWeight  = 0.0;    
 
     for (int idx = 0; idx < nbLocalIndex; ++idx)
@@ -59,4 +57,9 @@
           weights_(currentlocalIndex) += 1.0;
         }
+      }
+      else
+      {
+        if (flagInitial[currentlocalIndex]) 
+          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();
       }
     }
Index: /XIOS/trunk/src/transformation/Functions/max_reduction.cpp
===================================================================
--- /XIOS/trunk/src/transformation/Functions/max_reduction.cpp	(revision 1153)
+++ /XIOS/trunk/src/transformation/Functions/max_reduction.cpp	(revision 1154)
@@ -36,6 +36,5 @@
   {
     int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;
-    dataOut=std::numeric_limits<double>::quiet_NaN();    
+    int currentlocalIndex = 0;    
     for (int idx = 0; idx < nbLocalIndex; ++idx)
     {
@@ -52,4 +51,9 @@
           dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex));
         }
+      }
+      else
+      {
+        if (flagInitial[currentlocalIndex]) 
+          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();
       }
     }
Index: /XIOS/trunk/src/transformation/Functions/min_reduction.cpp
===================================================================
--- /XIOS/trunk/src/transformation/Functions/min_reduction.cpp	(revision 1153)
+++ /XIOS/trunk/src/transformation/Functions/min_reduction.cpp	(revision 1154)
@@ -36,6 +36,5 @@
   {
     int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;
-    dataOut=std::numeric_limits<double>::quiet_NaN();
+    int currentlocalIndex = 0;    
     for (int idx = 0; idx < nbLocalIndex; ++idx)
     {
@@ -52,4 +51,9 @@
           dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex));
         }
+      }
+      else
+      {
+        if (flagInitial[currentlocalIndex]) 
+          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();
       }
     }
Index: /XIOS/trunk/src/transformation/Functions/sum_reduction.cpp
===================================================================
--- /XIOS/trunk/src/transformation/Functions/sum_reduction.cpp	(revision 1153)
+++ /XIOS/trunk/src/transformation/Functions/sum_reduction.cpp	(revision 1154)
@@ -36,7 +36,5 @@
   {
     int nbLocalIndex = localIndex.size();
-    int currentlocalIndex = 0;
-
-    dataOut=std::numeric_limits<double>::quiet_NaN();
+    int currentlocalIndex = 0;    
   
     for (int idx = 0; idx < nbLocalIndex; ++idx)
@@ -54,4 +52,9 @@
           dataOut(currentlocalIndex) += *(dataInput + idx);
         }
+      }
+      else
+      {
+        if (flagInitial[currentlocalIndex]) 
+          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();
       }
     }    
Index: /XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp
===================================================================
--- /XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp	(revision 1153)
+++ /XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp	(revision 1154)
@@ -45,12 +45,14 @@
       {
         dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second;
-      }
-    }
-
-    // for (int idx = 0; idx < nbLocalIndex; ++idx)
-    // {
-    //   if (!flagInitial[localIndex[idx].first])
-    //     dataOut(localIndex[idx].first) = defaultValue;
-    // }
+        flagInitial[localIndex[idx].first] = true; // Reset flag to indicate not all data source are nan
+      }
+    }
+
+    // If all data source are nan then data destination must be nan
+    for (int idx = 0; idx < nbLocalIndex; ++idx)
+    {
+      if (!flagInitial[localIndex[idx].first])
+        dataOut(localIndex[idx].first) = defaultValue;
+    }
   }
   else
