Index: XIOS/dev/branch_yushan_merged/src/transformation/Functions/average_reduction.cpp
===================================================================
--- XIOS/dev/branch_yushan_merged/src/transformation/Functions/average_reduction.cpp	(revision 1157)
+++ XIOS/dev/branch_yushan_merged/src/transformation/Functions/average_reduction.cpp	(revision 1160)
@@ -39,6 +39,7 @@
     int nbLocalIndex = localIndex.size();
     int currentlocalIndex = 0;
-    double currentWeight  = 0.0;    
+    double currentWeight  = 0.0;
 
+    dataOut=std::numeric_limits<double>::quiet_NaN();
 
     for (int idx = 0; idx < nbLocalIndex; ++idx)
@@ -58,9 +59,4 @@
           weights_(currentlocalIndex) += 1.0;
         }
-      }
-      else
-      {
-        if (flagInitial[currentlocalIndex]) 
-          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();
       }
     }
Index: XIOS/dev/branch_yushan_merged/src/transformation/Functions/max_reduction.cpp
===================================================================
--- XIOS/dev/branch_yushan_merged/src/transformation/Functions/max_reduction.cpp	(revision 1157)
+++ XIOS/dev/branch_yushan_merged/src/transformation/Functions/max_reduction.cpp	(revision 1160)
@@ -37,5 +37,5 @@
     int nbLocalIndex = localIndex.size();
     int currentlocalIndex = 0;
-
+    dataOut=std::numeric_limits<double>::quiet_NaN();    
     for (int idx = 0; idx < nbLocalIndex; ++idx)
     {
@@ -52,9 +52,4 @@
           dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex));
         }
-      }
-      else
-      {
-        if (flagInitial[currentlocalIndex]) 
-          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();
       }
     }
Index: XIOS/dev/branch_yushan_merged/src/transformation/Functions/min_reduction.cpp
===================================================================
--- XIOS/dev/branch_yushan_merged/src/transformation/Functions/min_reduction.cpp	(revision 1157)
+++ XIOS/dev/branch_yushan_merged/src/transformation/Functions/min_reduction.cpp	(revision 1160)
@@ -37,5 +37,5 @@
     int nbLocalIndex = localIndex.size();
     int currentlocalIndex = 0;
-
+    dataOut=std::numeric_limits<double>::quiet_NaN();
     for (int idx = 0; idx < nbLocalIndex; ++idx)
     {
@@ -52,9 +52,4 @@
           dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex));
         }
-      }
-      else
-      {
-        if (flagInitial[currentlocalIndex]) 
-          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();
       }
     }
Index: XIOS/dev/branch_yushan_merged/src/transformation/Functions/sum_reduction.cpp
===================================================================
--- XIOS/dev/branch_yushan_merged/src/transformation/Functions/sum_reduction.cpp	(revision 1157)
+++ XIOS/dev/branch_yushan_merged/src/transformation/Functions/sum_reduction.cpp	(revision 1160)
@@ -37,4 +37,6 @@
     int nbLocalIndex = localIndex.size();
     int currentlocalIndex = 0;
+
+    dataOut=std::numeric_limits<double>::quiet_NaN();
   
     for (int idx = 0; idx < nbLocalIndex; ++idx)
@@ -52,9 +54,4 @@
           dataOut(currentlocalIndex) += *(dataInput + idx);
         }
-      }
-      else
-      {
-        if (flagInitial[currentlocalIndex]) 
-          dataOut(currentlocalIndex) = std::numeric_limits<double>::quiet_NaN();
       }
     }    
Index: XIOS/dev/branch_yushan_merged/src/transformation/generic_algorithm_transformation.cpp
===================================================================
--- XIOS/dev/branch_yushan_merged/src/transformation/generic_algorithm_transformation.cpp	(revision 1157)
+++ XIOS/dev/branch_yushan_merged/src/transformation/generic_algorithm_transformation.cpp	(revision 1160)
@@ -45,14 +45,12 @@
       {
         dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second;
-        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;
-    }
+      }
+    }
+
+    // for (int idx = 0; idx < nbLocalIndex; ++idx)
+    // {
+    //   if (!flagInitial[localIndex[idx].first])
+    //     dataOut(localIndex[idx].first) = defaultValue;
+    // }
   }
   else
