Index: /XIOS/trunk/src/config/field_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/field_attribute.conf	(revision 997)
+++ /XIOS/trunk/src/config/field_attribute.conf	(revision 998)
@@ -11,4 +11,5 @@
 DECLARE_ATTRIBUTE(int,       level)
 DECLARE_ATTRIBUTE(int,       prec)
+DECLARE_ATTRIBUTE(StdString, expr)
 
 DECLARE_ATTRIBUTE(bool,      enabled)
Index: /XIOS/trunk/src/context_server.cpp
===================================================================
--- /XIOS/trunk/src/context_server.cpp	(revision 997)
+++ /XIOS/trunk/src/context_server.cpp	(revision 998)
@@ -184,5 +184,5 @@
          // The best way to properly solve this problem will be to use the event scheduler also in attached mode
          // for now just set up a MPI barrier
-         if (!CServer::eventScheduler) MPI_Barrier(intraComm) ;
+         if (!CServer::eventScheduler && CXios::isServer) MPI_Barrier(intraComm) ;
 
          CTimer::get("Process events").resume();
Index: /XIOS/trunk/src/node/field.cpp
===================================================================
--- /XIOS/trunk/src/node/field.cpp	(revision 997)
+++ /XIOS/trunk/src/node/field.cpp	(revision 998)
@@ -768,17 +768,20 @@
    {
      if (!areAllReferenceSolved) solveAllReferenceEnabledField(false);
-
      // Start by building a filter which can provide the field's instant data
      if (!instantDataFilter)
      {
+        boost::shared_ptr<COutputPin> arithmDataFilter;
+   
        // Check if we have an expression to parse
-       if (!content.empty())
-       {
-         boost::scoped_ptr<IFilterExprNode> expr(parseExpr(content + '\0'));
-         instantDataFilter = expr->reduce(gc, *this);
-       }
-       // Check if we have a reference on another field
-       else if (!field_ref.isEmpty())
-         instantDataFilter = getFieldReference(gc);
+       if (hasExpression() || !field_ref.isEmpty())
+       {
+         if (hasExpression())
+         {
+           boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0'));
+           arithmDataFilter = expr->reduce(gc, *this);
+         }
+         // Check if we have a reference on another field
+         if (!field_ref.isEmpty()) instantDataFilter = getFieldReference(gc,arithmDataFilter);
+       }  
        // Check if the data is to be read from a file
        else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read)
@@ -813,5 +816,5 @@
     * \return the output pin corresponding to the field reference
     */
-   boost::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc)
+   boost::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc, boost::shared_ptr<COutputPin> OutputPin)
    {
      if (instantDataFilter || field_ref.isEmpty())
@@ -820,5 +823,5 @@
 
      CField* fieldRef = CField::get(field_ref);
-     fieldRef->buildFilterGraph(gc, false);
+     if (!OutputPin) fieldRef->buildFilterGraph(gc, false);
 
      std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters;
@@ -834,5 +837,6 @@
        filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc));
 
-     fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0);
+     if (!OutputPin)   fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0);
+     else OutputPin->connectOutput(filters.first, 0);
 
      return filters.second;
@@ -850,5 +854,5 @@
    boost::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc)
    {
-     if (instantDataFilter || content.empty())
+     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.");
@@ -865,5 +869,9 @@
        }
        else if (!field_ref.isEmpty())
-         selfReferenceFilter = getFieldReference(gc);
+       {
+         CField* fieldRef = CField::get(field_ref);
+         fieldRef->buildFilterGraph(gc, false); 
+         selfReferenceFilter = fieldRef->getInstantDataFilter();
+       }
        else
        {
@@ -915,4 +923,73 @@
      return it->second;
    }
+
+  /*!
+    * Returns the temporal filter corresponding to the field's temporal operation
+    * for the specified operation frequency. The filter is created if it does not
+    * exist, otherwise it is reused.
+    *
+    * \param gc the garbage collector to use
+    * \param outFreq the operation frequency, i.e. the frequency at which the output data will be computed
+    * \return the output pin corresponding to the requested temporal filter
+    */
+   
+   boost::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)
+   {
+     
+     if (instantDataFilter || !hasExpression())
+       ERROR("COutputPin* CField::getSelfTemporalDataFilter(CGarbageCollector& gc)",
+             "Impossible to add a self reference to a field which has already been parsed or which does not have an expression.");
+
+     if (!selfReferenceFilter) getSelfReference(gc) ;
+
+     if (serverSourceFilter || clientSourceFilter)
+     {
+       if (operation.isEmpty())
+         ERROR("void CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)",
+               << "An operation must be defined for field \"" << getId() << "\".");
+
+       if (freq_op.isEmpty()) freq_op.setValue(TimeStep);
+       if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu);
+
+       const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);
+
+       boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation,
+                                                                             CContext::getCurrent()->getCalendar()->getInitDate(),
+                                                                             freq_op, freq_offset, outFreq,
+                                                                             ignoreMissingValue, ignoreMissingValue ? default_value : 0.0));
+       selfReferenceFilter->connectOutput(temporalFilter, 0);
+       return temporalFilter ;
+     }
+     else if (!field_ref.isEmpty())
+     {
+       CField* fieldRef = CField::get(field_ref);
+       fieldRef->buildFilterGraph(gc, false); 
+       return fieldRef->getTemporalDataFilter(gc, outFreq) ;
+     }
+  }
+
+
+/*
+   boost::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)
+   {
+
+       if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read)
+       {
+         if (!serverSourceFilter)
+           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid,
+                                                                                   freq_offset.isEmpty() ? NoneDu : freq_offset));
+
+         selfReferenceFilter = serverSourceFilter;
+       }
+       else if (!field_ref.isEmpty())
+       {   
+          CField* fieldRef = CField::get(field_ref);
+          fieldRef->buildFilterGraph(gc, false);
+          return fieldRef->getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) ;
+       }
+  
+    }
+
+*/
 
    //----------------------------------------------------------------
@@ -1344,4 +1421,24 @@
    }
 
+   /*!
+    * Returns string arithmetic expression associated to the field.
+    * \return if content is defined return content string, otherwise, if "expr" attribute is defined, return expr string.
+    */
+   string CField::getExpression(void)
+   {
+     if (! expr.isEmpty() && content.empty())
+     {
+       content=expr ;
+       expr.reset() ;
+     }
+     return content;
+   }
+   
+   bool CField::hasExpression(void)
+   {
+     if (! expr.isEmpty()) return true ;
+     if (!content.empty()) return true ;
+     return false;
+   }   
    DEFINE_REF_FUNC(Field,field)
 } // namespace xios
Index: /XIOS/trunk/src/node/field.hpp
===================================================================
--- /XIOS/trunk/src/node/field.hpp	(revision 997)
+++ /XIOS/trunk/src/node/field.hpp	(revision 998)
@@ -121,7 +121,8 @@
 
          void buildFilterGraph(CGarbageCollector& gc, bool enableOutput);
-         boost::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc);
+         boost::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc, boost::shared_ptr<COutputPin> OutputPin = boost::shared_ptr<COutputPin>());
          boost::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc);
          boost::shared_ptr<COutputPin> getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq);
+         boost::shared_ptr<COutputPin> getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq);
 
 //         virtual void fromBinary(StdIStream& is);
@@ -177,4 +178,6 @@
 
         const std::vector<StdString>& getRefDomainAxisIds();
+        string getExpression(void) ;
+        bool hasExpression(void) ;
 
       public:
Index: /XIOS/trunk/src/node/field_impl.hpp
===================================================================
--- /XIOS/trunk/src/node/field_impl.hpp	(revision 997)
+++ /XIOS/trunk/src/node/field_impl.hpp	(revision 998)
@@ -20,5 +20,5 @@
     if (clientSourceFilter)
       clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
-    else if (!field_ref.isEmpty() || !content.empty())
+    else if (!field_ref.isEmpty() || hasExpression())
       ERROR("void CField::setData(const CArray<double, N>& _data)",
             << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation.");
Index: /XIOS/trunk/src/parse_expr/filter_expr_node.cpp
===================================================================
--- /XIOS/trunk/src/parse_expr/filter_expr_node.cpp	(revision 997)
+++ /XIOS/trunk/src/parse_expr/filter_expr_node.cpp	(revision 998)
@@ -40,8 +40,11 @@
   boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const
   {
-    if (!CField::has(fieldId))
+      if (fieldId == "this") return thisField.getSelfTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op);
+      
+      if (!CField::has(fieldId))
       ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const",
             << "The field " << fieldId << " does not exist.");
 
+      
     CField* field = CField::get(fieldId);
     if (field == &thisField)
