Index: XIOS/trunk/src/filter/file_writer_filter.cpp
===================================================================
--- XIOS/trunk/src/filter/file_writer_filter.cpp	(revision 1006)
+++ XIOS/trunk/src/filter/file_writer_filter.cpp	(revision 1018)
@@ -2,4 +2,5 @@
 #include "exception.hpp"
 #include "field.hpp"
+#include "utils.hpp"
 
 namespace xios
@@ -16,4 +17,18 @@
   void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data)
   {
+    bool ignoreMissingValue = (!field->detect_missing_value.isEmpty() && 
+                               !field->default_value.isEmpty() && 
+                               field->detect_missing_value == true);
+    if (ignoreMissingValue)
+    {
+      double missingValue = field->default_value;
+      size_t nbData = data[0]->data.numElements();
+      for (size_t idx = 0; idx < nbData; ++idx)
+      {
+        if (NumTraits<double>::isnan(data[0]->data(idx)))
+          data[0]->data(idx) = missingValue;
+      }
+    }    
+
     field->sendUpdateData(data[0]->data);
   }
Index: XIOS/trunk/src/filter/source_filter.cpp
===================================================================
--- XIOS/trunk/src/filter/source_filter.cpp	(revision 1006)
+++ XIOS/trunk/src/filter/source_filter.cpp	(revision 1018)
@@ -3,12 +3,16 @@
 #include "exception.hpp"
 #include "calendar_util.hpp"
+#include <limits> 
 
 namespace xios
 {
   CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid,
-                               const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/)
+                               const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/,
+                               bool hasMissingValue /*= false*/,
+                               double defaultValue /*= 0.0*/)
     : COutputPin(gc, manualTrigger)
     , grid(grid)
     , offset(offset)
+    , hasMissingValue(hasMissingValue), defaultValue(defaultValue)
   {
     if (!grid)
@@ -29,4 +33,16 @@
     packet->data.resize(grid->storeIndex_client.numElements());
     grid->inputField(data, packet->data);
+
+    // Convert missing values to NaN
+    if (hasMissingValue)
+    {
+      double nanValue = std::numeric_limits<double>::quiet_NaN();
+      size_t nbData = packet->data.numElements();
+      for (size_t idx = 0; idx < nbData; ++idx)
+      {
+        if (defaultValue == packet->data(idx))
+          packet->data(idx) = nanValue;
+      }
+    }
 
     onOutputReady(packet);
Index: XIOS/trunk/src/filter/source_filter.hpp
===================================================================
--- XIOS/trunk/src/filter/source_filter.hpp	(revision 1006)
+++ XIOS/trunk/src/filter/source_filter.hpp	(revision 1018)
@@ -23,7 +23,11 @@
        * \param offset the offset applied to the timestamp of all packets
        * \param manualTrigger whether the output should be triggered manually
+       * \param hasMissingValue whether data has missing value
+       * \param defaultValue missing value to detect
        */
       CSourceFilter(CGarbageCollector& gc, CGrid* grid,
-                    const CDuration offset = NoneDu, bool manualTrigger = false);
+                    const CDuration offset = NoneDu, bool manualTrigger = false,
+                    bool hasMissingValue = false,
+                    double defaultValue = 0.0);
 
       /*!
@@ -58,4 +62,6 @@
       CGrid* grid; //!< The grid attached to the data the filter can accept
       const CDuration offset; //!< The offset applied to the timestamp of all packets
+      bool hasMissingValue;
+      double defaultValue;
   }; // class CSourceFilter
 } // namespace xios
Index: XIOS/trunk/src/filter/spatial_transform_filter.cpp
===================================================================
--- XIOS/trunk/src/filter/spatial_transform_filter.cpp	(revision 1006)
+++ XIOS/trunk/src/filter/spatial_transform_filter.cpp	(revision 1018)
@@ -11,5 +11,5 @@
 
   std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> >
-  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue)
+  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue)
   {
     if (!srcGrid || !destGrid)
@@ -26,4 +26,5 @@
       const std::vector<StdString>& auxInputs = gridTransformation->getAuxInputs();
       size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size());
+      double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : missingValue;
       boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount));
 
@@ -103,5 +104,6 @@
       }
       packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements());
-      packet->data = defaultValue;
+      if (0 != packet->data.numElements())
+        (packet->data)(0) = defaultValue;
       apply(data[0]->data, packet->data);
     }
Index: XIOS/trunk/src/filter/spatial_transform_filter.hpp
===================================================================
--- XIOS/trunk/src/filter/spatial_transform_filter.hpp	(revision 1006)
+++ XIOS/trunk/src/filter/spatial_transform_filter.hpp	(revision 1018)
@@ -32,8 +32,10 @@
        * \param srcGrid the source grid
        * \param destGrid the destination grid
+       * \param hasMissingValue whether field source has missing value
+       * \param defaultValue default value
        * \return the first and the last filters of the filter graph
        */
       static std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> >
-      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue);
+      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue);
 
     protected:
Index: XIOS/trunk/src/filter/temporal_filter.cpp
===================================================================
--- XIOS/trunk/src/filter/temporal_filter.cpp	(revision 1006)
+++ XIOS/trunk/src/filter/temporal_filter.cpp	(revision 1018)
@@ -15,4 +15,6 @@
     , isFirstOperation(true)
   {
+    double defaultValue = ignoreMissingValue ? std::numeric_limits<double>::quiet_NaN() : missingValue;
+    
 #define DECLARE_FUNCTOR(MType, mtype) \
     if (opId.compare(#mtype) == 0) \
@@ -20,5 +22,5 @@
       if (ignoreMissingValue) \
       { \
-        functor.reset(new func::C##MType(tmpData, missingValue)); \
+        functor.reset(new func::C##MType(tmpData, defaultValue)); \
       } \
       else \
