Index: XIOS/dev/dev_olga/src/node/axis.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/axis.cpp	(revision 1654)
+++ XIOS/dev/dev_olga/src/node/axis.cpp	(revision 1686)
@@ -345,5 +345,4 @@
       Check the validity of data, fill in values if any, and apply mask.
    */
-
    void CAxis::checkData()
    TRY
@@ -848,5 +847,8 @@
 
       numberWrittenIndexes_[writtenCommSize] = nbWritten;
-      if (isDistributed())
+
+      bool distributed_glo, distributed=isDistributed() ;
+      MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, writtenComm) ;
+      if (distributed_glo)
       {
              
Index: XIOS/dev/dev_olga/src/node/domain.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/domain.cpp	(revision 1654)
+++ XIOS/dev/dev_olga/src/node/domain.cpp	(revision 1686)
@@ -226,4 +226,5 @@
       bool distributed =  !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) ||
               (!i_index.isEmpty() && i_index.numElements() == ni_glo*nj_glo));
+      bool distributed_glo ;
       distributed |= (1 == CContext::getCurrent()->client->clientSize);
 
@@ -2061,5 +2062,8 @@
 
       numberWrittenIndexes_[writtenCommSize] = nbWritten;
-      if (isDistributed())
+      bool distributed_glo, distributed=isDistributed() ;
+      MPI_Allreduce(&distributed,&distributed_glo, 1, MPI_INT, MPI_LOR, writtenComm) ;
+      
+      if (distributed_glo)
       {
              
Index: XIOS/dev/dev_olga/src/node/field.cpp
===================================================================
--- XIOS/dev/dev_olga/src/node/field.cpp	(revision 1654)
+++ XIOS/dev/dev_olga/src/node/field.cpp	(revision 1686)
@@ -46,5 +46,8 @@
       , mustAutoTrigger(false)
       , isEOF(false), nstepMaxRead(false)
-   { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); }
+   { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); 
+     field_graph_start = -2;
+     field_graph_end = -2;
+   }
 
    CField::CField(const StdString& id)
@@ -64,5 +67,9 @@
       , mustAutoTrigger(false)
       , isEOF(false), nstepMaxRead(false)
-   { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); }
+   { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); 
+     field_graph_start = -2;
+     field_graph_end = -2;
+   }
+
 
    CField::~CField(void)
@@ -1107,15 +1114,72 @@
     *                     read by the client or/and written to a file
     */
-   void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput)
+   void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput, Time start_graph, Time end_graph)
    TRY
    {     
-     if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform();
-     if (!isGridChecked) checkGridOfEnabledFields();
+    if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform();
+    if (!isGridChecked) checkGridOfEnabledFields();
 
      const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
+     
      const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);
+
+     
      const double defaultValue  = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0);
 
      CContext* context = CContext::getCurrent();
+     
+     Time filter_start;
+     if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start;
+     else if(build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = 0;
+     else filter_start = -1;
+
+     Time filter_end;
+     if(!build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = context->calendar->getInitDate()+build_workflow_graph_end;
+     else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807;
+     else filter_end = -1;
+
+     if(this->field_graph_start==-2) this->field_graph_start = filter_start;
+     if(this->field_graph_end==-2) this->field_graph_end = filter_end;         // init
+
+     // if(CXios::isClient) std::cout<<"****************** buildFilterGraph : field_id = "<<this->getId()<<" BEFORE: this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl;
+
+     if(start_graph == -1)
+     {
+       //nothing
+       // if(CXios::isClient) std::cout<<"buildFilterGraph field_id = "<<this->getId()<<" case1: this->field_graph_start = "<<this->field_graph_start<<std::endl;
+     }
+     else //if(start_graph != -1)
+     {
+       if(this->field_graph_start == -1) this->field_graph_start = start_graph;
+       else this->field_graph_start = min(this->field_graph_start, start_graph);
+
+       // if(CXios::isClient) std::cout<<"buildFilterGraph field_id = "<<this->getId()<<" case2: this->field_graph_start = "<<this->field_graph_start<<std::endl;
+     }
+
+
+     if(end_graph == -1)
+     {
+       //nothing
+       // if(CXios::isClient) std::cout<<"buildFilterGraph field_id = "<<this->getId()<<" case1: this->field_graph_end = "<<this->field_graph_end<<std::endl;
+     }
+     else
+     {
+       if(this->field_graph_end == -1) this->field_graph_end = end_graph;
+       else this->field_graph_end = max(this->field_graph_end, end_graph);
+
+       // if(CXios::isClient) std::cout<<"buildFilterGraph field_id = "<<this->getId()<<" case2: this->field_graph_end = "<<this->field_graph_end<<std::endl;
+     }
+    
+
+     filter_start = this->field_graph_start;
+     filter_end = this->field_graph_end;
+
+
+     // if(CXios::isClient) std::cout<<"****************** buildFilterGraph : field_id = "<<this->getId()<<" AFTER: this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl;
+     
+
+     
+     
+
      bool hasWriterServer = context->hasServer && !context->hasClient;
      bool hasIntermediateServer = context->hasServer && context->hasClient;
@@ -1124,7 +1188,6 @@
      {
         if (!instantDataFilter)
-        {
           instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false));
-        }
+
 
        // If the field data is to be read by the client or/and written to a file
@@ -1141,7 +1204,6 @@
      {
        if (!instantDataFilter)
-       {
          instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, false));
-       }
+
              // If the field data is to be read by the client or/and written to a file
        if (enableOutput && !storeFilter && !fileWriterFilter)
@@ -1163,29 +1225,16 @@
          {
            boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0'));
-           std::shared_ptr<COutputPin> filter = expr->reduce(gc, *this);
+           std::shared_ptr<COutputPin> filter = expr->reduce(gc, *this, filter_start, filter_end);
 
            // Check if a spatial transformation is needed
            if (!field_ref.isEmpty())
            {
-             CField* fieldRef = CField::get(field_ref);
-             fieldRef->build_workflow_graph.setValue(buildWorkflowGraph);
-             CGrid* gridRef = fieldRef->grid;
+             CGrid* gridRef = CField::get(field_ref)->grid;
 
              if (grid && grid != gridRef && grid->hasTransform())
              {
-               std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid,
-                                                                                         detectMissingValues, defaultValue, buildWorkflowGraph);
+                 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue); 
 
                filter->connectOutput(filters.first, 0);
-
-               if (buildWorkflowGraph)
-               {
-                 int filterOut = filter->getFilterId();
-                 int filterIn = (std::static_pointer_cast<COutputPin>(filters.second))->getFilterId();
-                 CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterOut);
-                 CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterIn);
-                 CWorkflowGraph::mapFilters[filterOut] = filter->GetName();
-                 CWorkflowGraph::mapFilters[filterIn] = filters.second->GetName();
-               }
                filter = filters.second;
              }
@@ -1193,10 +1242,22 @@
 
            instantDataFilter = filter;
+           instantDataFilter->field = this;
+           filter->tag = buildWorkflowGraph;
+           
+           filter->start_graph = filter_start;
+           filter->end_graph = filter_end;
+
+           for(int i=0; i<filter->parent_filters.size(); i++)
+           {
+             filter->tag = filter->tag || filter->parent_filters[i]->tag;
+           }
          }
          // Check if we have a reference on another field
          else if (!field_ref.isEmpty())
          {
-           CField::get(field_ref)->build_workflow_graph.setValue(buildWorkflowGraph);
-           instantDataFilter = getFieldReference(gc);
+           instantDataFilter = getFieldReference(gc, filter_start, filter_end);
+           instantDataFilter->tag = buildWorkflowGraph;
+           instantDataFilter->start_graph = filter_start;
+           instantDataFilter->end_graph = filter_end;
          }
          // Check if the data is to be read from a file
@@ -1205,5 +1266,10 @@
            checkTimeAttributes();
            instantDataFilter = serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false, freq_offset, true,
-                                                                                                       detectMissingValues, defaultValue, buildWorkflowGraph));
+                                                                                                       detectMissingValues, defaultValue));
+           instantDataFilter->tag = buildWorkflowGraph;
+           instantDataFilter->start_graph = filter_start;
+           instantDataFilter->end_graph = filter_end;
+           instantDataFilter->field = this;
+
          }
          else // The data might be passed from the model
@@ -1211,6 +1277,10 @@
             if (check_if_active.isEmpty()) check_if_active = false; 
             instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, true, NoneDu, false,
-                                                                                                      detectMissingValues, defaultValue, buildWorkflowGraph));
-            if (buildWorkflowGraph) CWorkflowGraph::mapFilters[instantDataFilter->getFilterId()] = instantDataFilter->GetName();
+                                                                                                      detectMissingValues, defaultValue)); 
+            instantDataFilter->tag = buildWorkflowGraph;
+            instantDataFilter->start_graph = filter_start;
+            instantDataFilter->end_graph = filter_end;
+            instantDataFilter->field = this;
+            // if(CXios::isClient) std::cout<<"***********************buildFilterGraph init source filter : field_id = "<<this->getId()<<" sourcefilter->start_graph = "<<clientSourceFilter->start_graph<<" sourcefilter->end_graph = "<<clientSourceFilter->end_graph<<std::endl;
          }
        }
@@ -1224,19 +1294,32 @@
                                                                           detectMissingValues, defaultValue));
            instantDataFilter->connectOutput(storeFilter, 0);
+
+           storeFilter->tag = (instantDataFilter->tag || buildWorkflowGraph);
+           instantDataFilter->start_graph = filter_start;
+           instantDataFilter->end_graph = filter_end;
+
+           instantDataFilter->setParentFiltersTag();
+           storeFilter->start_graph = filter_start;
+           storeFilter->end_graph = filter_end;
+           storeFilter->field = this;
+           storeFilter->distance = instantDataFilter->distance+1;
          }
 
          if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))
          {
-           fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, buildWorkflowGraph));
+           fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this));
            getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0);
-           if (buildWorkflowGraph)
-           {
-             int filterOut = getTemporalDataFilter(gc, file->output_freq)->getFilterId();
-             int filterIn = fileWriterFilter->getFilterId();
-             CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterOut);
-             CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterIn);
-             CWorkflowGraph::mapFilters[filterOut] = "Temporal filter";
-             CWorkflowGraph::mapFilters[filterIn] = fileWriterFilter->GetName();
-           }
+           
+           fileWriterFilter->tag = (getTemporalDataFilter(gc, file->output_freq)->tag || buildWorkflowGraph);
+           getTemporalDataFilter(gc, file->output_freq)->start_graph = filter_start;
+           getTemporalDataFilter(gc, file->output_freq)->end_graph = filter_end;
+           getTemporalDataFilter(gc, file->output_freq)->tag = buildWorkflowGraph;
+           getTemporalDataFilter(gc, file->output_freq)->setParentFiltersTag();
+           fileWriterFilter->start_graph = filter_start;
+           fileWriterFilter->end_graph = filter_end;
+           fileWriterFilter->distance = getTemporalDataFilter(gc, file->output_freq)->distance+1;
+
+           // std::cout<<"CFileWriterFilter filter start = "<<filter_start<<" end = "<<filter_end<<" field = "<<this->getId()<<std::endl;
+
          }
        }
@@ -1252,5 +1335,5 @@
     * \return the output pin corresponding to the field reference
     */
-   std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc)
+   std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc, Time start_graph, Time end_graph)
    TRY
    {
@@ -1260,6 +1343,55 @@
 
      CField* fieldRef = CField::get(field_ref);
-     fieldRef->buildFilterGraph(gc, false);
-     bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);
+     fieldRef->buildFilterGraph(gc, false, start_graph, end_graph);
+     const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);
+
+     CContext* context = CContext::getCurrent();
+
+     Time filter_start;
+     if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start;
+     else if(build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = 0;
+     else filter_start = -1;
+
+     Time filter_end;
+     if(!build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = context->calendar->getInitDate()+build_workflow_graph_end;
+     else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807;
+     else filter_end = -1;
+
+     if(this->field_graph_start==-2) this->field_graph_start = filter_start;
+     if(this->field_graph_end==-2) this->field_graph_end = filter_end;         // init
+
+     // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" BEFORE: this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl;
+
+     if(start_graph == -1)
+     {
+       //nothing
+       // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" case1: this->field_graph_start = "<<this->field_graph_start<<std::endl;
+     }
+     else //if(start_graph != -1)
+     {
+       if(this->field_graph_start == -1) this->field_graph_start = start_graph;
+       else this->field_graph_start = min(this->field_graph_start, start_graph);
+
+       // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" case2: this->field_graph_start = "<<this->field_graph_start<<std::endl;
+     }
+
+     if(end_graph == -1)
+     {
+       //nothing
+       // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" case1: this->field_graph_end = "<<this->field_graph_end<<std::endl;
+     }
+     else
+     {
+       if(this->field_graph_end == -1) this->field_graph_end = end_graph;
+       else this->field_graph_end = max(this->field_graph_end, end_graph);
+
+       // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" case2: this->field_graph_end = "<<this->field_graph_end<<std::endl;
+     }
+
+     filter_start = this->field_graph_start;
+     filter_end = this->field_graph_end;
+
+     // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" AFTER: this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl;
+
 
      std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters;
@@ -1269,22 +1401,38 @@
        bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
        double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);                                
-       filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue, buildWorkflowGraph);
+       filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue);
+
+       fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0);
+
+     
+
+       filters.second->parent_filters.resize(1);
+       filters.second->parent_filters[0]= fieldRef->getInstantDataFilter();
+
+       filters.second->tag = (buildWorkflowGraph || filters.second->parent_filters[0]->tag);
+       
+       filters.second->start_graph = filter_start;
+       filters.second->end_graph = filter_end;
+       filters.second->field = this;
+       
      }
      else
      {
-       filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc, buildWorkflowGraph));
-     }
-
-     fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0);
-
-     if (buildWorkflowGraph)
-     {
-       int filterOut = fieldRef->instantDataFilter->getFilterId();
-       int filterIn = (std::static_pointer_cast<COutputPin>(filters.first))->getFilterId();
-       CWorkflowGraph::mapFieldToFilters[fieldRef->getId()].push_back(filterOut);
-       CWorkflowGraph::mapFieldToFilters[fieldRef->getId()].push_back(filterIn);
-       CWorkflowGraph::mapFilters[filterOut] = fieldRef->getInstantDataFilter()->GetName();
-       CWorkflowGraph::mapFilters[filterIn] = filters.first->GetName();
-     }
+       filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc));
+
+       fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0);
+     
+
+       filters.second->parent_filters.resize(1);
+       filters.second->parent_filters[0]= fieldRef->getInstantDataFilter();
+
+       filters.second->tag = (buildWorkflowGraph || filters.second->parent_filters[0]->tag);
+
+       filters.second->start_graph = filter_start;
+       filters.second->end_graph = filter_end;
+       filters.second->field = this;
+
+     }
+
      return filters.second;
    }
@@ -1300,10 +1448,14 @@
     * \return the output pin corresponding to a self reference
     */
-   std::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc)
-   TRY
-   {
+   std::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc, Time start_graph, Time end_graph)
+   TRY
+   {
+     if(CXios::isClient) std::cout<<"getSelfReference field_id = "<<this->getId()<<" start_graph = "<<start_graph<<" end_graph = "<<end_graph<<std::endl;
+
      if (instantDataFilter || !hasExpression())
        ERROR("COutputPin* CField::getSelfReference(CGarbageCollector& gc)",
              "Impossible to add a self reference to a field which has already been parsed or which does not have an expression.");
+     
+     bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);
 
      if (!selfReferenceFilter)
@@ -1342,4 +1494,6 @@
      }
 
+     selfReferenceFilter->tag = buildWorkflowGraph;
+     selfReferenceFilter->field = this;
      return selfReferenceFilter;
    }
@@ -1361,4 +1515,21 @@
      const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);
 
+     CContext* context = CContext::getCurrent();
+
+     // Time filter_start;
+     // if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start;
+     // else if(build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = 0;
+     // else filter_start = -1;
+
+     // Time filter_end;
+     // if(!build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = context->calendar->getInitDate()+build_workflow_graph_end;
+     // else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807;
+     // else filter_end = -1;
+
+     // filter_start = this->field_graph_start;
+     // filter_end = this->field_graph_end;
+
+     // if(CXios::isClient) std::cout<<"getTemporalDataFilter field_id = "<<this->getId()<<" this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl;
+
      if (it == temporalDataFilters.end())
      {
@@ -1370,22 +1541,24 @@
 
        const bool detectMissingValues = (!detect_missing_value.isEmpty()  && detect_missing_value == true);
-       std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, CContext::getCurrent()->getCalendar()->getInitDate(),
-                                                                             freq_op, freq_offset, outFreq,
-                                                                             detectMissingValues, buildWorkflowGraph));
+       std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation,
+                                                                             CContext::getCurrent()->getCalendar()->getInitDate(),
+                                                                             freq_op, freq_offset, outFreq, detectMissingValues));
 
        instantDataFilter->connectOutput(temporalFilter, 0);
-
-       if (buildWorkflowGraph)
-       {
-         int filterOut = instantDataFilter->getFilterId();
-         int filterIn = (std::static_pointer_cast<COutputPin>(temporalFilter))->getFilterId();
-         CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterOut);
-         CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterIn);
-         CWorkflowGraph::mapFilters[filterOut] = getInstantDataFilter()->GetName();
-         CWorkflowGraph::mapFilters[filterIn] = temporalFilter->GetName();
-       }
+       // temporalFilter->tag = buildWorkflowGraph;
+       
+       temporalFilter->parent_filters.resize(1);
+       temporalFilter->parent_filters[0] = instantDataFilter;
+       
+
+       if(temporalFilter->parent_filters[0]->tag) temporalFilter->tag=true;
+
+       // temporalFilter->start_graph = filter_start;
+       // temporalFilter->end_graph = filter_end;
+       temporalFilter->field = this;
 
        it = temporalDataFilters.insert(std::make_pair(outFreq, temporalFilter)).first;
      }
+
      return it->second;
    }
@@ -1419,21 +1592,12 @@
 
        const bool detectMissingValues = (!detect_missing_value.isEmpty() && detect_missing_value == true);
-       const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);
+       bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);
        std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation,
-                                                                           CContext::getCurrent()->getCalendar()->getInitDate(),
-                                                                           freq_op, freq_offset, outFreq,
-                                                                           detectMissingValues, buildWorkflowGraph));
+                                                                             CContext::getCurrent()->getCalendar()->getInitDate(),
+                                                                             freq_op, freq_offset, outFreq, detectMissingValues));
 
        selfReferenceFilter->connectOutput(temporalFilter, 0);
-       if (buildWorkflowGraph)
-
-       {
-         int filterOut = selfReferenceFilter->getFilterId();
-         int filterIn = (std::static_pointer_cast<COutputPin>(temporalFilter))->getFilterId();
-         CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterOut);
-         CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterIn);
-         CWorkflowGraph::mapFilters[filterOut] = selfReferenceFilter->GetName();
-         CWorkflowGraph::mapFilters[filterIn] = temporalFilter->GetName();
-       }
+       temporalFilter->tag = buildWorkflowGraph;
+       temporalFilter->field = this;
 
        return temporalFilter ;
Index: XIOS/dev/dev_olga/src/node/field.hpp
===================================================================
--- XIOS/dev/dev_olga/src/node/field.hpp	(revision 1654)
+++ XIOS/dev/dev_olga/src/node/field.hpp	(revision 1686)
@@ -140,10 +140,10 @@
          void checkTimeAttributes(CDuration* freqOp=NULL);
 
-         void buildFilterGraph(CGarbageCollector& gc, bool enableOutput);
+         void buildFilterGraph(CGarbageCollector& gc, bool enableOutput, Time start_graph=-1, Time end_graph=-1);
          size_t getGlobalWrittenSize(void) ;
          
          
-         std::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc);
-         std::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc);
+         std::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc, Time start_graph=-1, Time end_graph=-1);
+         std::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc, Time start_graph=-1, Time end_graph=-1);
          std::shared_ptr<COutputPin> getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq);
          std::shared_ptr<COutputPin> getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq);
@@ -244,4 +244,8 @@
          bool hasTimeCentered;
 
+         Time field_graph_start;
+         Time field_graph_end;
+
+
          DECLARE_REF_FUNC(Field,field)
 
