Index: /XIOS/dev/dev_olga/bld.cfg
===================================================================
--- /XIOS/dev/dev_olga/bld.cfg	(revision 1020)
+++ /XIOS/dev/dev_olga/bld.cfg	(revision 1021)
@@ -35,5 +35,5 @@
 bld::target xios_server.exe 
 bld::target xios_server1.exe xios_server2.exe
-bld::target test_regular.exe
+#bld::target test_regular.exe
 #bld::target test_new_features.exe test_unstruct_complete.exe 
 #bld::target test_client.exe test_complete.exe
Index: /XIOS/dev/dev_olga/src/client.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/client.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/client.cpp	(revision 1021)
@@ -57,5 +57,6 @@
 
           unsigned long hashClient = hashString(codeId) ;
-          unsigned long hashServer = hashString(CXios::xiosCodeIdPrm);
+          unsigned long hashServer = hashString(CXios::xiosCodeId);
+//          unsigned long hashServer = hashString(CXios::xiosCodeIdPrm);
           unsigned long* hashAll ;
           int size ;
@@ -88,7 +89,7 @@
           for (i=0; i < size; ++i)
           {
-            if ((hashAll[i] == hashString(CXios::xiosCodeId))
-                || (hashAll[i] == hashString(CXios::xiosCodeIdPrm))
-                || (hashAll[i] == hashString(CXios::xiosCodeIdSnd)))
+            if (hashAll[i] == hashString(CXios::xiosCodeId))
+//                || (hashAll[i] == hashString(CXios::xiosCodeIdPrm))
+//                || (hashAll[i] == hashString(CXios::xiosCodeIdSnd)))
             {
               CXios::setUsingServer();
@@ -103,5 +104,4 @@
           {
             int clientLeader=leaders[hashClient] ;
-//            serverLeader=leaders[hashServer] ;
             serverLeader.push_back(leaders[hashServer]) ;
             int intraCommSize, intraCommRank ;
@@ -111,7 +111,4 @@
                    <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< serverLeader.back()<<endl ;
              MPI_Intercomm_create(intraComm, 0, CXios::globalComm, serverLeader.back(), 0, &interComm) ;
-//             info(50)<<"intercommCreate::client "<<rank<<" intraCommSize : "<<intraCommSize
-//                    <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< serverLeader<<endl ;
-//              MPI_Intercomm_create(intraComm,0,CXios::globalComm,serverLeader,0,&interComm) ;
           }
           else
@@ -181,7 +178,8 @@
 /*!
  * \fn void CClient::registerContext(const string& id, MPI_Comm contextComm)
- * Function creates intraComm (CClient::intraComm) for client group with id=codeId and interComm (CClient::interComm) between client and server groups.
+ * \brief Sends a request to create a context to server. Creates client/server contexts.
  * \param [in] id id of context.
  * \param [in] contextComm.
+ * Function is only called by client.
  */
     void CClient::registerContext(const string& id, MPI_Comm contextComm)
@@ -250,12 +248,14 @@
     }
 
-    ///---------------------------------------------------------------
-    /*!
-     * \fn void CClient::registerContext(const string& id, const int poolNb, MPI_Comm contextComm)
-     * Function creates intraComm (CClient::intraComm) for client group with id=codeId and interComm (CClient::interComm) between client and server groups.
-     * \param [in] id id of context.
-     * \param [in] contextComm.
-     */
-        void CClient::registerContextOnSrvPools(const string& id, MPI_Comm contextComm)
+///---------------------------------------------------------------
+/*!
+  * \fn void CClient::registerContextByClienOfServer(const string& id, MPI_Comm contextComm)
+  * \brief Sends a request to create contexts on secondary servers. Creates clientPrimServer/serverPrimServer contexts.
+  * \param [in] id id of context.
+  * \param [in] contextComm.
+  * Function is called by primary server.
+  * The only difference with CClient::registerContext() is naming of contexts on servers (appearing of pool id at the end).
+  */
+        void CClient::registerContextByClienOfServer(const string& id, MPI_Comm contextComm)
         {
           CContext::setCurrent(id) ;
Index: /XIOS/dev/dev_olga/src/client.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/client.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/client.hpp	(revision 1021)
@@ -15,5 +15,5 @@
         static void finalize(void);
         static void registerContext(const string& id, MPI_Comm contextComm);
-        static void registerContextOnSrvPools(const string& id, MPI_Comm contextComm);
+        static void registerContextByClienOfServer(const string& id, MPI_Comm contextComm);
 
         static MPI_Comm intraComm;
Index: /XIOS/dev/dev_olga/src/config/field_attribute.conf
===================================================================
--- /XIOS/dev/dev_olga/src/config/field_attribute.conf	(revision 1020)
+++ /XIOS/dev/dev_olga/src/config/field_attribute.conf	(revision 1021)
@@ -11,4 +11,5 @@
 DECLARE_ATTRIBUTE(int,       level)
 DECLARE_ATTRIBUTE(int,       prec)
+DECLARE_ATTRIBUTE(StdString, expr)
 
 DECLARE_ATTRIBUTE(bool,      enabled)
@@ -33,2 +34,5 @@
 DECLARE_ATTRIBUTE(bool,      ts_enabled)
 DECLARE_ATTRIBUTE(CDuration, ts_split_freq)
+
+DECLARE_ATTRIBUTE(StdString, cell_methods)
+DECLARE_ENUM4(cell_methods_mode,  overwrite, prefix, suffix, none)
Index: /XIOS/dev/dev_olga/src/config/interpolate_domain_attribute.conf
===================================================================
--- /XIOS/dev/dev_olga/src/config/interpolate_domain_attribute.conf	(revision 1020)
+++ /XIOS/dev/dev_olga/src/config/interpolate_domain_attribute.conf	(revision 1021)
@@ -3,2 +3,7 @@
 DECLARE_ATTRIBUTE(int, order)
 DECLARE_ATTRIBUTE(bool, renormalize)
+
+/* Write interpolation weights into file */
+DECLARE_ENUM3(mode,compute,read,read_or_compute)
+DECLARE_ATTRIBUTE(StdString, weight_filename)
+DECLARE_ATTRIBUTE(bool, write_weight)
Index: /XIOS/dev/dev_olga/src/context_client.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/context_client.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/context_client.cpp	(revision 1021)
@@ -50,5 +50,6 @@
         for (int i = 0; i < serverByClient; i++)
           ranksServerLeader.push_back(rankStart + i);
-      }
+
+        ranksServerNotLeader.resize(0);      }
       else
       {
@@ -60,4 +61,6 @@
           if (clientRank % (clientByServer + 1) == 0)
             ranksServerLeader.push_back(clientRank / (clientByServer + 1));
+          else
+            ranksServerNotLeader.push_back(clientRank / (clientByServer + 1));
         }
         else
@@ -66,4 +69,6 @@
           if (rank % clientByServer == 0)
             ranksServerLeader.push_back(remain + rank / clientByServer);
+          else
+            ranksServerNotLeader.push_back(remain + rank / clientByServer);
         }
       }
@@ -244,4 +249,22 @@
                           + 1;                                   // the other local buffer might contain only one event
    }
+
+   /*!
+    Get leading server in the group of connected server
+    \return ranks of leading servers
+    */
+    const std::list<int>& CContextClient::getRanksServerNotLeader(void) const
+    {
+      return ranksServerNotLeader;
+    }
+
+    /*!
+    Check if client connects to leading server
+    \return connected(true), not connected (false)
+    */
+    bool CContextClient::isServerNotLeader(void) const
+    {
+      return !ranksServerNotLeader.empty();
+    }
 
   /*!
Index: /XIOS/dev/dev_olga/src/context_client.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/context_client.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/context_client.hpp	(revision 1021)
@@ -41,5 +41,7 @@
 
       bool isServerLeader(void) const;
+      bool isServerNotLeader(void) const;
       const std::list<int>& getRanksServerLeader(void) const;
+      const std::list<int>& getRanksServerNotLeader(void) const;
 
       bool isAttachedModeEnabled() const;
@@ -80,4 +82,7 @@
       std::list<int> ranksServerLeader;
 
+      //! List of server ranks for which the client is not leader
+      std::list<int> ranksServerNotLeader;
+
     public: // Some function should be removed in the future
       //    void registerEvent(CEventClient& event);
Index: /XIOS/dev/dev_olga/src/context_server.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/context_server.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/context_server.cpp	(revision 1021)
@@ -44,25 +44,25 @@
   }
 
-  CContextServer::CContextServer(CContext* parent, int srvLvl, MPI_Comm intraComm_,MPI_Comm interComm_)
-  {
-    context=parent;
-    intraComm=intraComm_;
-    MPI_Comm_size(intraComm,&intraCommSize);
-    MPI_Comm_rank(intraComm,&intraCommRank);
-    interComm=interComm_;
-    int flag;
-    MPI_Comm_test_inter(interComm,&flag);
-    if (flag) MPI_Comm_remote_size(interComm,&commSize);
-    else  MPI_Comm_size(interComm,&commSize);
-
-    currentTimeLine=0;
-    scheduled=false;
-    finished=false;
-
-    boost::hash<string> hashString;
-    StdString contextId = context->getId();
-    hashId=hashString(contextId);
-
-  }
+//  CContextServer::CContextServer(CContext* parent, int srvLvl, MPI_Comm intraComm_,MPI_Comm interComm_)
+//  {
+//    context=parent;
+//    intraComm=intraComm_;
+//    MPI_Comm_size(intraComm,&intraCommSize);
+//    MPI_Comm_rank(intraComm,&intraCommRank);
+//    interComm=interComm_;
+//    int flag;
+//    MPI_Comm_test_inter(interComm,&flag);
+//    if (flag) MPI_Comm_remote_size(interComm,&commSize);
+//    else  MPI_Comm_size(interComm,&commSize);
+//
+//    currentTimeLine=0;
+//    scheduled=false;
+//    finished=false;
+//
+//    boost::hash<string> hashString;
+//    StdString contextId = context->getId();
+//    hashId=hashString(contextId);
+//
+//  }
   void CContextServer::setPendingEvent(void)
   {
Index: /XIOS/dev/dev_olga/src/cxios.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/cxios.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/cxios.cpp	(revision 1021)
@@ -16,17 +16,19 @@
   string CXios::rootFile="./iodef.xml" ;
   string CXios::xiosCodeId="xios.x" ;
-  string CXios::xiosCodeIdPrm="xios.x.1" ;
-  string CXios::xiosCodeIdSnd="xios.x.2" ;
+//  string CXios::xiosCodeIdPrm="xios.x.1" ;
+//  string CXios::xiosCodeIdSnd="xios.x.2" ;
   string CXios::clientFile="./xios_client";
   string CXios::serverFile="./xios_server";
-  string CXios::serverPrimFile="./xios_server1";
-  string CXios::serverScndFile="./xios_server2";
+  string CXios::serverPrmFile="./xios_server1";
+  string CXios::serverSndFile="./xios_server2";
 
   bool CXios::isClient ;
   bool CXios::isServer ;
-  int CXios::serverLevel = 0 ;
+//  int CXios::serverLevel = 0 ;
   MPI_Comm CXios::globalComm ;
   bool CXios::usingOasis ;
   bool CXios::usingServer = false;
+  bool CXios::usingServer2 = false;
+  int CXios::ratioServer2 = 50;
   double CXios::bufferSizeFactor = 1.0;
   const double CXios::defaultBufferSizeFactor = 1.0;
@@ -52,4 +54,6 @@
     usingOasis=getin<bool>("using_oasis",false) ;
     usingServer=getin<bool>("using_server",false) ;
+    usingServer2=getin<bool>("using_server2",false) ;
+    ratioServer2=getin<int>("ratio_server2",50);
     info.setLevel(getin<int>("info_level",0)) ;
     report.setLevel(getin<int>("info_level",50));
@@ -135,32 +139,43 @@
   {
     initServer();
-    if (serverLvl == 1)
+
+//    if (serverLvl == 1)
+//      isClient = true;
+//    else
+//      isClient = false;
+//
+//    isServer = true;
+//    serverLevel = serverLvl;
+
+
+
+    // Initialize all aspects MPI
+    CServer::initialize();
+    isServer = true;
+    if (CServer::serverLevel == 1)
       isClient = true;
     else
       isClient = false;
 
-    isServer = true;
-    serverLevel = serverLvl;
-
-    // Initialize all aspects MPI
-    CServer::initialize();
     if (CServer::getRank()==0) globalRegistry = new CRegistry(CServer::intraComm) ;
     
     if (printLogs2Files)
     {
-      if (CXios::serverLevel == 0)
+      if (CServer::serverLevel == 0)
+//      if (CXios::serverLevel == 0)
       {
         CServer::openInfoStream(serverFile);
         CServer::openErrorStream(serverFile);
       }
-      else if (CXios::serverLevel == 1)
+      else if (CServer::serverLevel == 1)
+//      else if (CXios::serverLevel == 1)
       {
-        CServer::openInfoStream(serverPrimFile);
-        CServer::openErrorStream(serverPrimFile);
+        CServer::openInfoStream(serverPrmFile);
+        CServer::openErrorStream(serverPrmFile);
       }
       else
       {
-        CServer::openInfoStream(serverScndFile);
-        CServer::openErrorStream(serverScndFile);
+        CServer::openInfoStream(serverSndFile);
+        CServer::openErrorStream(serverSndFile);
       }
     }
@@ -197,10 +212,4 @@
   }
 
-  //! Set using secondary server
-//  void CXios::setUsingSecondaryServer()
-//  {
-//    usingSecondaryServer = true;
-//  }
-
   //! Unset using server
   void CXios::setNotUsingServer()
Index: /XIOS/dev/dev_olga/src/cxios.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/cxios.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/cxios.hpp	(revision 1021)
@@ -29,15 +29,15 @@
      static string rootFile ; //!< Configuration filename
      static string xiosCodeId ; //!< Identity for XIOS
-     static string xiosCodeIdPrm ; //!< Identity for XIOS primary server
-     static string xiosCodeIdSnd ; //!< Identity for XIOS secondary server
+//     static string xiosCodeIdPrm ; //!< Identity for XIOS primary server
+//     static string xiosCodeIdSnd ; //!< Identity for XIOS secondary server
      static string clientFile;        //!< Filename template for client
      static string serverFile;        //!< Filename template for server
-     static string serverPrimFile;  //!< Filename template for primary server in case of two server groups
-     static string serverScndFile;  //!< Filename template for secondary server in case of two server groups
+     static string serverPrmFile;  //!< Filename template for primary server in case of two server levels
+     static string serverSndFile;  //!< Filename template for secondary server in case of two server levels
 
      static bool isClient ; //!< Check if xios is client
      static bool isServer ; //!< Check if xios is server
 
-     static int serverLevel ; //
+//     static int serverLevel ;
 
      static MPI_Comm globalComm ; //!< Global communicator
@@ -46,4 +46,6 @@
      static bool usingOasis ; //!< Using Oasis
      static bool usingServer ; //!< Using server (server mode)
+     static bool usingServer2 ; //!< Using secondary server (server mode)
+     static int ratioServer2 ;  //!< Percentage of server processors dedicated to secondary server
      static double bufferSizeFactor; //!< Factor used to tune the buffer size
      static const double defaultBufferSizeFactor; //!< Default factor value
@@ -55,7 +57,4 @@
      //! Setting xios to use server mode
      static void setUsingServer();
-
-     //! Setting xios to use secondary server mode
-//     static void setUsingSecondaryServer();
 
      //! Setting xios NOT to use server mode
Index: /XIOS/dev/dev_olga/src/distribution_client.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/distribution_client.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/distribution_client.cpp	(revision 1021)
@@ -24,5 +24,4 @@
    , elementZoomMask_(), elementNLocal_(), elementNGlobal_()
 {
-//  numElement_ = globalLocalIndex.size();    !!! numElement_ should be calculated (?)
   isComputed_ = true;
   localDataIndex_.resize(globalLocalIndex.size());
Index: /XIOS/dev/dev_olga/src/filter/filter.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/filter.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/filter.cpp	(revision 1021)
@@ -5,5 +5,5 @@
   CFilter::CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine)
     : CInputPin(gc, inputSlotsCount)
-    , COutputPin()
+    , COutputPin(gc)
     , engine(engine)
     , inputSlotCount(inputSlotCount)
@@ -14,5 +14,29 @@
     CDataPacketPtr outputPacket = engine->apply(data);
     if (outputPacket)
-      deliverOuput(outputPacket);
+      onOutputReady(outputPacket);
+  }
+
+  void CFilter::setInputTrigger(size_t inputSlot, COutputPin* trigger)
+  {
+    // Was the filter already triggerable? If not, we need to inform
+    // all downstream filters.
+    bool wasTriggerable = canBeTriggered();
+
+    CInputPin::setInputTrigger(inputSlot, trigger);
+
+    if (!wasTriggerable)
+      setOutputTriggers();
+  }
+
+  void CFilter::trigger(Time timestamp)
+  {
+    CInputPin::trigger(timestamp);
+
+    COutputPin::trigger(timestamp);
+  }
+
+  bool CFilter::canBeTriggered() const
+  {
+    return (CInputPin::canBeTriggered() || COutputPin::canBeTriggered());
   }
 } // namespace xios
Index: /XIOS/dev/dev_olga/src/filter/filter.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/filter.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/filter.hpp	(revision 1021)
@@ -26,4 +26,26 @@
       CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine);
 
+      /*!
+       * Sets the trigger for a specific input slot.
+       *
+       * \param inputSlot the input slot number
+       * \param trigger the corresponding trigger
+       */
+      void virtual setInputTrigger(size_t inputSlot, COutputPin* trigger);
+
+      /*!
+       * Triggers the filter for the specified timestamp.
+       *
+       * \param timestamp the timestamp for which we are triggering the filter
+       */
+      void virtual trigger(Time timestamp);
+
+      /*!
+       * Tests if the filter can be triggered.
+       *
+       * \return true if the filter can be triggered
+       */
+      bool virtual canBeTriggered() const;
+
     protected:
       IFilterEngine* engine; //!< The filter engine, might be the filter itself
Index: /XIOS/dev/dev_olga/src/filter/garbage_collector.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/garbage_collector.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/garbage_collector.cpp	(revision 1021)
@@ -3,28 +3,28 @@
 namespace xios
 {
-  void CGarbageCollector::registerFilter(CInputPin* inputPin, Time timestamp)
+  void CGarbageCollector::registerObject(InvalidableObject* Object, Time timestamp)
   {
-    registeredFilters[timestamp].insert(inputPin);
+    registeredObjects[timestamp].insert(Object);
   }
 
-  void CGarbageCollector::unregisterFilter(CInputPin* inputPin, Time timestamp)
+  void CGarbageCollector::unregisterObject(InvalidableObject* Object, Time timestamp)
   {
-    std::map<Time, std::set<CInputPin*> >::iterator it = registeredFilters.find(timestamp);
-    if (it != registeredFilters.end())
-      it->second.erase(inputPin);
+    std::map<Time, std::set<InvalidableObject*> >::iterator it = registeredObjects.find(timestamp);
+    if (it != registeredObjects.end())
+      it->second.erase(Object);
   }
 
   void CGarbageCollector::invalidate(Time timestamp)
   {
-    std::map<Time, std::set<CInputPin*> >::iterator it    = registeredFilters.begin(),
-                                                    itEnd = registeredFilters.lower_bound(timestamp);
+    std::map<Time, std::set<InvalidableObject*> >::iterator it    = registeredObjects.begin(),
+                                                            itEnd = registeredObjects.lower_bound(timestamp);
     for (; it != itEnd; ++it)
     {
-      std::set<CInputPin*>::iterator itFilter    = it->second.begin(),
-                                     itFilterEnd = it->second.end();
-      for (; itFilter != itFilterEnd; ++itFilter)
-        (*itFilter)->invalidate(timestamp);
+      std::set<InvalidableObject*>::iterator itObject    = it->second.begin(),
+                                             itObjectEnd = it->second.end();
+      for (; itObject != itObjectEnd; ++itObject)
+        (*itObject)->invalidate(timestamp);
     }
-    registeredFilters.erase(registeredFilters.begin(), itEnd);
+    registeredObjects.erase(registeredObjects.begin(), itEnd);
   }
 } // namespace xios
Index: /XIOS/dev/dev_olga/src/filter/garbage_collector.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/garbage_collector.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/garbage_collector.hpp	(revision 1021)
@@ -5,8 +5,21 @@
 #include <set>
 
-#include "input_pin.hpp"
+#include "date.hpp"
 
 namespace xios
 {
+  /*!
+   * Interface shared by all objects that might need to invalidate packets.
+   */
+  struct InvalidableObject
+  {
+    /*!
+     * Removes all pending packets which are older than the specified timestamp.
+     *
+     * \param timestamp the timestamp used for invalidation
+     */
+    void virtual invalidate(Time timestamp) = 0;
+  }; // struct InvalidableObject
+
   /*!
    * A basic garbage collector which ensures no old packets linger in the filter graph.
@@ -22,21 +35,21 @@
 
       /*!
-       * Registers a filter for a specified timestamp.
+       * Registers an object for a specified timestamp.
        *
-       * \param inputPin the input pin of the filter to register
-       * \param timestamp the timestamp for which the filter is registered
+       * \param object the object to register
+       * \param timestamp the timestamp for which the object is registered
        */
-      void registerFilter(CInputPin* inputPin, Time timestamp);
+      void registerObject(InvalidableObject* object, Time timestamp);
 
       /*!
-       * Removes a filter previously registered for a specified timestamp.
+       * Removes a object previously registered for a specified timestamp.
        *
-       * \param inputPin the input pin of the filter to unregister
-       * \param timestamp the timestamp for which the filter is unregistered
+       * \param object the object to unregister
+       * \param timestamp the timestamp for which the object is unregistered
        */
-      void unregisterFilter(CInputPin* inputPin, Time timestamp);
+      void unregisterObject(InvalidableObject* object, Time timestamp);
 
       /*!
-       * Ensures all registered filters invalidate packets older than the specified timestamp.
+       * Ensures all registered objects invalidate packets older than the specified timestamp.
        *
        * \param timestamp the timestamp used for invalidation
@@ -48,5 +61,5 @@
       CGarbageCollector& operator=(const CGarbageCollector&);
 
-      std::map<Time, std::set<CInputPin*> > registeredFilters; //!< Currently registered filters
+      std::map<Time, std::set<InvalidableObject*> > registeredObjects; //!< Currently registered objects
   }; // class CGarbageCollector
 } // namespace xios
Index: /XIOS/dev/dev_olga/src/filter/input_pin.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/input_pin.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/input_pin.cpp	(revision 1021)
@@ -1,3 +1,4 @@
 #include "input_pin.hpp"
+#include "output_pin.hpp"
 #include "garbage_collector.hpp"
 #include "exception.hpp"
@@ -8,4 +9,6 @@
     : gc(gc)
     , slotsCount(slotsCount)
+    , triggers(slotsCount)
+    , hasTriggers(false)
   { /* Nothing to do */ }
 
@@ -23,5 +26,5 @@
     {
       it = inputs.insert(std::make_pair(packet->timestamp, InputBuffer(slotsCount))).first;
-      gc.registerFilter(this, packet->timestamp);
+      gc.registerObject(this, packet->timestamp);
     }
     it->second.slotsFilled++;
@@ -31,8 +34,41 @@
     {
       // Unregister before calling onInputReady in case the filter registers again
-      gc.unregisterFilter(this, packet->timestamp);
+      gc.unregisterObject(this, packet->timestamp);
       onInputReady(it->second.packets);
       inputs.erase(it);
     }
+  }
+
+  void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)
+  {
+    if (inputSlot >= slotsCount)
+      ERROR("void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)",
+            "The input slot " << inputSlot << " does not exist.");
+    if (triggers[inputSlot])
+      ERROR("void CInputPin::setInputTrigger(size_t inputSlot, COutputPin* trigger)",
+            "The trigger for input slot " << inputSlot << " has already been set.");
+
+    triggers[inputSlot] = trigger;
+    hasTriggers = true;
+  }
+
+  void CInputPin::trigger(Time timestamp)
+  {
+    if (hasTriggers) // Don't use canBeTriggered here, this function is virtual and can be overriden
+    {
+      std::map<Time, InputBuffer>::iterator it = inputs.find(timestamp);
+      bool nothingReceived = (it == inputs.end());
+
+      for (size_t s = 0; s < slotsCount; s++)
+      {
+        if (triggers[s] && (nothingReceived || !it->second.packets[s]))
+          triggers[s]->trigger(timestamp);
+      }
+    }
+  }
+
+  bool CInputPin::canBeTriggered() const
+  {
+    return hasTriggers;
   }
 
Index: /XIOS/dev/dev_olga/src/filter/input_pin.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/input_pin.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/input_pin.hpp	(revision 1021)
@@ -5,14 +5,15 @@
 #include <map>
 
+#include "garbage_collector.hpp"
 #include "data_packet.hpp"
 
 namespace xios
 {
-  class CGarbageCollector;
+  class COutputPin;
 
   /*!
    * An input pin handles the data packets received by a filter.
    */
-  class CInputPin
+  class CInputPin : public InvalidableObject
   {
     public:
@@ -27,4 +28,12 @@
 
       /*!
+       * Sets the trigger for a specific input slot.
+       *
+       * \param inputSlot the input slot number
+       * \param trigger the corresponding trigger
+       */
+      void virtual setInputTrigger(size_t inputSlot, COutputPin* trigger);
+
+      /*!
        * Receives a data packet from an upstream filter on
        * the specified input slot.
@@ -37,4 +46,18 @@
 
       /*!
+       * Triggers the input of any buffered packet for the specified timestamp.
+       *
+       * \param timestamp the timestamp for which we are triggering the input
+       */
+      void virtual trigger(Time timestamp);
+
+      /*!
+       * Tests if the pin can be triggered.
+       *
+       * \return true if the pin can be triggered
+       */
+      bool virtual canBeTriggered() const;
+
+      /*!
        * Removes all pending packets which are older than the specified timestamp.
        *
@@ -44,6 +67,4 @@
 
     protected:
-      CGarbageCollector& gc; //!< The garbage collector associated to the input pin
-
       /*!
        * Function triggered when all slots have been filled for a specific timestamp.
@@ -75,8 +96,16 @@
       };
 
+      CGarbageCollector& gc; //!< The garbage collector associated to the input pin
+
       size_t slotsCount; //!< The number of slots
 
       //! Input buffer, store the packets until all slots are full for a timestep
       std::map<Time, InputBuffer> inputs;
+
+      //! Store the triggers corresponding to the input slots
+      std::vector<COutputPin*> triggers;
+
+      //! Whether some triggers have been set
+      bool hasTriggers;
   }; // class CInputPin
 } // namespace xios
Index: /XIOS/dev/dev_olga/src/filter/output_pin.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/output_pin.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/output_pin.cpp	(revision 1021)
@@ -4,4 +4,9 @@
 namespace xios
 {
+  COutputPin::COutputPin(CGarbageCollector& gc, bool manualTrigger /*= false*/)
+    : gc(gc)
+    , manualTrigger(manualTrigger)
+  { /* Nothing to do */ }
+
   void COutputPin::connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot)
   {
@@ -11,4 +16,22 @@
 
     outputs.push_back(std::make_pair(inputPin, inputSlot));
+
+    if (canBeTriggered())
+      inputPin->setInputTrigger(inputSlot, this);
+  }
+
+  void COutputPin::onOutputReady(CDataPacketPtr packet)
+  {
+    if (!packet)
+      ERROR("void COutputPin::onOutputReady(CDataPacketPtr packet)",
+            "The packet cannot be null.");
+
+    if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden
+    {
+      outputPackets[packet->timestamp] = packet;
+      gc.registerObject(this, packet->timestamp);
+    }
+    else
+      deliverOuput(packet);
   }
 
@@ -23,3 +46,34 @@
       it->first->setInput(it->second, packet);
   }
+
+  void COutputPin::trigger(Time timestamp)
+  {
+    if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden
+    {
+      std::map<Time, CDataPacketPtr>::iterator it = outputPackets.find(timestamp);
+      if (it != outputPackets.end())
+      {
+        gc.unregisterObject(this, timestamp);
+        deliverOuput(it->second);
+        outputPackets.erase(it);
+      }
+    }
+  }
+
+  bool COutputPin::canBeTriggered() const
+  {
+    return manualTrigger;
+  }
+
+  void COutputPin::setOutputTriggers()
+  {
+    std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::iterator it, itEnd;
+    for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it)
+      it->first->setInputTrigger(it->second, this);
+  }
+
+  void COutputPin::invalidate(Time timestamp)
+  {
+    outputPackets.erase(outputPackets.begin(), outputPackets.lower_bound(timestamp));
+  }
 } // namespace xios
Index: /XIOS/dev/dev_olga/src/filter/output_pin.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/output_pin.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/output_pin.hpp	(revision 1021)
@@ -2,4 +2,5 @@
 #define __XIOS_COutputPin__
 
+#include "garbage_collector.hpp"
 #include "input_pin.hpp"
 
@@ -9,7 +10,16 @@
    * An output pin handles the connections with downstream filters.
    */
-  class COutputPin
+  class COutputPin : public InvalidableObject
   {
     public:
+      /*!
+       * Constructs an ouput pin with manual or automatic trigger
+       * and an associated garbage collector.
+       *
+       * \param gc the garbage collector associated with this ouput pin
+       * \param slotsCount the number of slots
+       */
+      COutputPin(CGarbageCollector& gc, bool manualTrigger = false);
+
       /*!
        * Connects to a specific slot of the input pin of a downstream filter.
@@ -21,5 +31,39 @@
       void connectOutput(boost::shared_ptr<CInputPin> inputPin, size_t inputSlot);
 
+      /*!
+       * Triggers the output of any buffered packet for the specified timestamp.
+       *
+       * \param timestamp the timestamp for which we are triggering the output
+       */
+      void virtual trigger(Time timestamp);
+
+      /*!
+       * Tests if the pin can be triggered.
+       *
+       * \return true if the pin can be triggered
+       */
+      bool virtual canBeTriggered() const;
+
+      /*!
+       * Removes all pending packets which are older than the specified timestamp.
+       *
+       * \param timestamp the timestamp used for invalidation
+       */
+      void virtual invalidate(Time timestamp);
+
     protected:
+      /*!
+       * Function triggered when a packet is ready to be delivered.
+       *
+       * \param packet the packet ready for output
+       */
+      void onOutputReady(CDataPacketPtr packet);
+
+      /*!
+       * Informs the downstream pins that this output pin should be triggered.
+       */
+      void setOutputTriggers();
+
+    private:
       /*!
        * Delivers an output packet to the downstreams filter.
@@ -29,7 +73,14 @@
       void deliverOuput(CDataPacketPtr packet);
 
-    private:
+      CGarbageCollector& gc; //!< The garbage collector associated to the output pin
+
+      //!< Whether the ouput should be triggered manually
+      bool manualTrigger;
+
       //!< The list of connected filters and the corresponding slot numbers
       std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> > outputs;
+
+      //! Output buffer, store the packets until the output is triggered
+      std::map<Time, CDataPacketPtr> outputPackets;
   }; // class COutputPin
 } // namespace xios
Index: /XIOS/dev/dev_olga/src/filter/source_filter.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/source_filter.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/source_filter.cpp	(revision 1021)
@@ -6,6 +6,8 @@
 namespace xios
 {
-  CSourceFilter::CSourceFilter(CGrid* grid, const CDuration offset /*= NoneDu*/)
-    : grid(grid)
+  CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid,
+                               const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/)
+    : COutputPin(gc, manualTrigger)
+    , grid(grid)
     , offset(offset)
   {
@@ -28,5 +30,5 @@
     grid->inputField(data, packet->data);
 
-    deliverOuput(packet);
+    onOutputReady(packet);
   }
 
@@ -48,8 +50,9 @@
     packet->status = CDataPacket::NO_ERROR;
 
-    if (data.size() != grid->storeIndex_toSrv.size())
+    // if (data.size() != grid->storeIndex_toSrv.size())
+    if (data.size() != grid->storeIndex_fromSrv.size())
       ERROR("CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data)",
             << "Incoherent data received from servers,"
-            << " expected " << grid->storeIndex_toSrv.size() << " chunks but " << data.size() << " were given.");
+            << " expected " << grid->storeIndex_fromSrv.size() << " chunks but " << data.size() << " were given.");
 
     packet->data.resize(grid->storeIndex_client.numElements());
@@ -57,11 +60,11 @@
     for (it = data.begin(); it != itEnd; it++)
     {
-      CArray<int,1>& index = grid->storeIndex_toSrv[it->first];
-
+      // CArray<int,1>& index = grid->storeIndex_toSrv[it->first];
+      CArray<int,1>& index = grid->storeIndex_fromSrv[it->first];
       for (int n = 0; n < index.numElements(); n++)
         packet->data(index(n)) = it->second(n);
     }
 
-    deliverOuput(packet);
+    onOutputReady(packet);
   }
 
@@ -72,5 +75,5 @@
     packet->timestamp = date;
     packet->status = CDataPacket::END_OF_STREAM;
-    deliverOuput(packet);
+    onOutputReady(packet);
   }
 } // namespace xios
Index: /XIOS/dev/dev_olga/src/filter/source_filter.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/source_filter.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/source_filter.hpp	(revision 1021)
@@ -19,8 +19,11 @@
        * Constructs a source filter accepting data attached to the specified grid.
        *
+       * \param gc the garbage collector associated with this filter
        * \param grid the grid to which the data is attached
        * \param offset the offset applied to the timestamp of all packets
+       * \param manualTrigger whether the output should be triggered manually
        */
-      CSourceFilter(CGrid* grid, const CDuration offset = NoneDu);
+      CSourceFilter(CGarbageCollector& gc, CGrid* grid,
+                    const CDuration offset = NoneDu, bool manualTrigger = false);
 
       /*!
Index: /XIOS/dev/dev_olga/src/filter/spatial_transform_filter.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/spatial_transform_filter.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/spatial_transform_filter.cpp	(revision 1021)
@@ -53,5 +53,5 @@
     CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue);
     if (outputPacket)
-      deliverOuput(outputPacket);
+      onOutputReady(outputPacket);
   }
 
@@ -218,7 +218,7 @@
     if (dataCurrentDest.numElements() != dataDest.numElements())
     ERROR("CSpatialTransformFilterEngine::apply(const CArray<double, 1>& dataSrc, CArray<double,1>& dataDest)",
-          "Incoherent between the received size and expected size" <<
-          "Expected size: " << dataDest.numElements() <<
-          "Received size: " << dataCurrentDest.numElements());
+          "Incoherent between the received size and expected size. " << std::endl 
+          << "Expected size: " << dataDest.numElements() << std::endl 
+          << "Received size: " << dataCurrentDest.numElements());
 
     dataDest = dataCurrentDest;
Index: /XIOS/dev/dev_olga/src/filter/store_filter.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/store_filter.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/store_filter.cpp	(revision 1021)
@@ -8,4 +8,5 @@
   CStoreFilter::CStoreFilter(CGarbageCollector& gc, CContext* context, CGrid* grid)
     : CInputPin(gc, 1)
+    , gc(gc)
     , context(context)
     , grid(grid)
@@ -23,8 +24,11 @@
     CTimer timer("CStoreFilter::getPacket");
     CConstDataPacketPtr packet;
-    const double timeout = 10; // 10 seconds timeout
+    const double timeout = 10 ; // 10 seconds timeout
 
     do
     {
+      if (canBeTriggered())
+        trigger(timestamp);
+
       timer.resume();
 
@@ -39,7 +43,12 @@
 
     if (!packet)
+    {
+      std::map<Time, CDataPacketPtr>::const_iterator it ;
+      info(0)<<"Impossible to get the packet with timestamp = " << timestamp<<std::endl<<"Available timestamp are : "<<std::endl ;
+      for(it=packets.begin();it!=packets.end();++it) info(0)<<it->first<<"  ";
+      info(0)<<std::endl ;
       ERROR("CConstDataPacketPtr CStoreFilter::getPacket(Time timestamp) const",
             << "Impossible to get the packet with timestamp = " << timestamp);
-
+    }
     return packet;
   }
@@ -69,5 +78,5 @@
     // The packet is always destroyed by the garbage collector
     // so we register but never unregister
-    gc.registerFilter(this, data[0]->timestamp);
+    gc.registerObject(this, data[0]->timestamp);
   }
 
Index: /XIOS/dev/dev_olga/src/filter/store_filter.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/filter/store_filter.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/filter/store_filter.hpp	(revision 1021)
@@ -65,4 +65,5 @@
 
     private:
+      CGarbageCollector& gc; //!< The garbage collector associated to the filter
       CContext* context; //!< The context to which the data belongs
       CGrid* grid; //!< The grid attached to the data the filter can accept
Index: /XIOS/dev/dev_olga/src/group_template.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/group_template.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/group_template.hpp	(revision 1021)
@@ -6,4 +6,5 @@
 #include "event_server.hpp"
 #include "object_template.hpp"
+#include "context_client.hpp"
 
 namespace xios
@@ -72,5 +73,5 @@
          static bool dispatchEvent(CEventServer& event) ;
          void sendCreateChild(const string& id="") ;
-         void sendCreateChild(const string& id, const int srvPool) ;
+         void sendCreateChild(const string& id, CContextClient* client) ;
          void sendCreateChildGroup(const string& id="") ;
          static void recvCreateChild(CEventServer& event) ;
Index: /XIOS/dev/dev_olga/src/group_template_impl.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/group_template_impl.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/group_template_impl.hpp	(revision 1021)
@@ -8,5 +8,4 @@
 #include "context.hpp"
 #include "event_client.hpp"
-#include "context_client.hpp"
 #include "message.hpp"
 #include "type.hpp"
@@ -419,24 +418,23 @@
       
    }
-   
-   template <class U, class V, class W>
-   void CGroupTemplate<U, V, W>::sendCreateChild(const string& id, const int srvPool)
-   {
-    CContext* context=CContext::getCurrent() ;
-    CContextClient* contextClientTmp = context->clientPrimServer[srvPool];
+
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::sendCreateChild(const string& id, CContextClient* client)
+   {
 
     CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD) ;
-    if (contextClientTmp->isServerLeader())
+    if (client->isServerLeader())
     {
       CMessage msg ;
       msg<<this->getId() ;
       msg<<id ;
-      const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+      const std::list<int>& ranks = client->getRanksServerLeader();
       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
        event.push(*itRank,1,msg) ;
-      contextClientTmp->sendEvent(event) ;
+      client->sendEvent(event) ;
     }
-    else contextClientTmp->sendEvent(event) ;
-   }
+    else client->sendEvent(event) ;
+   }
+
 
    template <class U, class V, class W>
@@ -444,10 +442,7 @@
    {
     CContext* context=CContext::getCurrent() ;
-
-        // if (! context->hasServer )
     if (context->hasClient)
     {
-        // Use correct context client to send message
-//      CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
+      // Use correct context client to send message
       int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
       for (int i = 0; i < nbSrvPools; ++i)
Index: /XIOS/dev/dev_olga/src/interface/c_attr/icfield_attr.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/interface/c_attr/icfield_attr.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/interface/c_attr/icfield_attr.cpp	(revision 1021)
@@ -67,4 +67,56 @@
 
 
+  void cxios_set_field_cell_methods(field_Ptr field_hdl, const char * cell_methods, int cell_methods_size)
+  {
+    std::string cell_methods_str;
+    if (!cstr2string(cell_methods, cell_methods_size, cell_methods_str)) return;
+    CTimer::get("XIOS").resume();
+    field_hdl->cell_methods.setValue(cell_methods_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_field_cell_methods(field_Ptr field_hdl, char * cell_methods, int cell_methods_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(field_hdl->cell_methods.getInheritedValue(), cell_methods, cell_methods_size))
+      ERROR("void cxios_get_field_cell_methods(field_Ptr field_hdl, char * cell_methods, int cell_methods_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_field_cell_methods(field_Ptr field_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = field_hdl->cell_methods.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_field_cell_methods_mode(field_Ptr field_hdl, const char * cell_methods_mode, int cell_methods_mode_size)
+  {
+    std::string cell_methods_mode_str;
+    if (!cstr2string(cell_methods_mode, cell_methods_mode_size, cell_methods_mode_str)) return;
+    CTimer::get("XIOS").resume();
+    field_hdl->cell_methods_mode.fromString(cell_methods_mode_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_field_cell_methods_mode(field_Ptr field_hdl, char * cell_methods_mode, int cell_methods_mode_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(field_hdl->cell_methods_mode.getInheritedStringValue(), cell_methods_mode, cell_methods_mode_size))
+      ERROR("void cxios_get_field_cell_methods_mode(field_Ptr field_hdl, char * cell_methods_mode, int cell_methods_mode_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_field_cell_methods_mode(field_Ptr field_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = field_hdl->cell_methods_mode.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_field_compression_level(field_Ptr field_hdl, int compression_level)
   {
@@ -180,4 +232,30 @@
      CTimer::get("XIOS").resume();
      bool isDefined = field_hdl->enabled.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_field_expr(field_Ptr field_hdl, const char * expr, int expr_size)
+  {
+    std::string expr_str;
+    if (!cstr2string(expr, expr_size, expr_str)) return;
+    CTimer::get("XIOS").resume();
+    field_hdl->expr.setValue(expr_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_field_expr(field_Ptr field_hdl, char * expr, int expr_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(field_hdl->expr.getInheritedValue(), expr, expr_size))
+      ERROR("void cxios_get_field_expr(field_Ptr field_hdl, char * expr, int expr_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_field_expr(field_Ptr field_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = field_hdl->expr.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
Index: /XIOS/dev/dev_olga/src/interface/c_attr/icfieldgroup_attr.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 1021)
@@ -67,4 +67,56 @@
 
 
+  void cxios_set_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, const char * cell_methods, int cell_methods_size)
+  {
+    std::string cell_methods_str;
+    if (!cstr2string(cell_methods, cell_methods_size, cell_methods_str)) return;
+    CTimer::get("XIOS").resume();
+    fieldgroup_hdl->cell_methods.setValue(cell_methods_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods, int cell_methods_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(fieldgroup_hdl->cell_methods.getInheritedValue(), cell_methods, cell_methods_size))
+      ERROR("void cxios_get_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods, int cell_methods_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_fieldgroup_cell_methods(fieldgroup_Ptr fieldgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = fieldgroup_hdl->cell_methods.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, const char * cell_methods_mode, int cell_methods_mode_size)
+  {
+    std::string cell_methods_mode_str;
+    if (!cstr2string(cell_methods_mode, cell_methods_mode_size, cell_methods_mode_str)) return;
+    CTimer::get("XIOS").resume();
+    fieldgroup_hdl->cell_methods_mode.fromString(cell_methods_mode_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods_mode, int cell_methods_mode_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(fieldgroup_hdl->cell_methods_mode.getInheritedStringValue(), cell_methods_mode, cell_methods_mode_size))
+      ERROR("void cxios_get_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl, char * cell_methods_mode, int cell_methods_mode_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_fieldgroup_cell_methods_mode(fieldgroup_Ptr fieldgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = fieldgroup_hdl->cell_methods_mode.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
   void cxios_set_fieldgroup_compression_level(fieldgroup_Ptr fieldgroup_hdl, int compression_level)
   {
@@ -180,4 +232,30 @@
      CTimer::get("XIOS").resume();
      bool isDefined = fieldgroup_hdl->enabled.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, const char * expr, int expr_size)
+  {
+    std::string expr_str;
+    if (!cstr2string(expr, expr_size, expr_str)) return;
+    CTimer::get("XIOS").resume();
+    fieldgroup_hdl->expr.setValue(expr_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, char * expr, int expr_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(fieldgroup_hdl->expr.getInheritedValue(), expr, expr_size))
+      ERROR("void cxios_get_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl, char * expr, int expr_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_fieldgroup_expr(fieldgroup_Ptr fieldgroup_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = fieldgroup_hdl->expr.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
Index: /XIOS/dev/dev_olga/src/interface/c_attr/icinterpolate_domain_attr.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/interface/c_attr/icinterpolate_domain_attr.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/interface/c_attr/icinterpolate_domain_attr.cpp	(revision 1021)
@@ -39,4 +39,30 @@
      CTimer::get("XIOS").resume();
      bool isDefined = interpolate_domain_hdl->file.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, const char * mode, int mode_size)
+  {
+    std::string mode_str;
+    if (!cstr2string(mode, mode_size, mode_str)) return;
+    CTimer::get("XIOS").resume();
+    interpolate_domain_hdl->mode.fromString(mode_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, char * mode, int mode_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(interpolate_domain_hdl->mode.getInheritedStringValue(), mode, mode_size))
+      ERROR("void cxios_get_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, char * mode, int mode_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = interpolate_domain_hdl->mode.hasInheritedValue();
      CTimer::get("XIOS").suspend();
      return isDefined;
@@ -88,3 +114,52 @@
      return isDefined;
   }
+
+
+  void cxios_set_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, const char * weight_filename, int weight_filename_size)
+  {
+    std::string weight_filename_str;
+    if (!cstr2string(weight_filename, weight_filename_size, weight_filename_str)) return;
+    CTimer::get("XIOS").resume();
+    interpolate_domain_hdl->weight_filename.setValue(weight_filename_str);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, char * weight_filename, int weight_filename_size)
+  {
+    CTimer::get("XIOS").resume();
+    if (!string_copy(interpolate_domain_hdl->weight_filename.getInheritedValue(), weight_filename, weight_filename_size))
+      ERROR("void cxios_get_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl, char * weight_filename, int weight_filename_size)", << "Input string is too short");
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_interpolate_domain_weight_filename(interpolate_domain_Ptr interpolate_domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = interpolate_domain_hdl->weight_filename.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
+
+
+  void cxios_set_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl, bool write_weight)
+  {
+    CTimer::get("XIOS").resume();
+    interpolate_domain_hdl->write_weight.setValue(write_weight);
+    CTimer::get("XIOS").suspend();
+  }
+
+  void cxios_get_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl, bool* write_weight)
+  {
+    CTimer::get("XIOS").resume();
+    *write_weight = interpolate_domain_hdl->write_weight.getInheritedValue();
+    CTimer::get("XIOS").suspend();
+  }
+
+  bool cxios_is_defined_interpolate_domain_write_weight(interpolate_domain_Ptr interpolate_domain_hdl)
+  {
+     CTimer::get("XIOS").resume();
+     bool isDefined = interpolate_domain_hdl->write_weight.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+     return isDefined;
+  }
 }
Index: /XIOS/dev/dev_olga/src/interface/fortran_attr/field_interface_attr.F90
===================================================================
--- /XIOS/dev/dev_olga/src/interface/fortran_attr/field_interface_attr.F90	(revision 1020)
+++ /XIOS/dev/dev_olga/src/interface/fortran_attr/field_interface_attr.F90	(revision 1021)
@@ -50,4 +50,46 @@
 
 
+    SUBROUTINE cxios_set_field_cell_methods(field_hdl, cell_methods, cell_methods_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods
+      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size
+    END SUBROUTINE cxios_set_field_cell_methods
+
+    SUBROUTINE cxios_get_field_cell_methods(field_hdl, cell_methods, cell_methods_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods
+      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size
+    END SUBROUTINE cxios_get_field_cell_methods
+
+    FUNCTION cxios_is_defined_field_cell_methods(field_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_cell_methods
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+    END FUNCTION cxios_is_defined_field_cell_methods
+
+
+    SUBROUTINE cxios_set_field_cell_methods_mode(field_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode
+      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size
+    END SUBROUTINE cxios_set_field_cell_methods_mode
+
+    SUBROUTINE cxios_get_field_cell_methods_mode(field_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode
+      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size
+    END SUBROUTINE cxios_get_field_cell_methods_mode
+
+    FUNCTION cxios_is_defined_field_cell_methods_mode(field_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_cell_methods_mode
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+    END FUNCTION cxios_is_defined_field_cell_methods_mode
+
+
     SUBROUTINE cxios_set_field_compression_level(field_hdl, compression_level) BIND(C)
       USE ISO_C_BINDING
@@ -147,4 +189,25 @@
 
 
+    SUBROUTINE cxios_set_field_expr(field_hdl, expr, expr_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr
+      INTEGER  (kind = C_INT)     , VALUE        :: expr_size
+    END SUBROUTINE cxios_set_field_expr
+
+    SUBROUTINE cxios_get_field_expr(field_hdl, expr, expr_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr
+      INTEGER  (kind = C_INT)     , VALUE        :: expr_size
+    END SUBROUTINE cxios_get_field_expr
+
+    FUNCTION cxios_is_defined_field_expr(field_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_expr
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+    END FUNCTION cxios_is_defined_field_expr
+
+
     SUBROUTINE cxios_set_field_field_ref(field_hdl, field_ref, field_ref_size) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/dev/dev_olga/src/interface/fortran_attr/fieldgroup_interface_attr.F90
===================================================================
--- /XIOS/dev/dev_olga/src/interface/fortran_attr/fieldgroup_interface_attr.F90	(revision 1020)
+++ /XIOS/dev/dev_olga/src/interface/fortran_attr/fieldgroup_interface_attr.F90	(revision 1021)
@@ -50,4 +50,46 @@
 
 
+    SUBROUTINE cxios_set_fieldgroup_cell_methods(fieldgroup_hdl, cell_methods, cell_methods_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods
+      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size
+    END SUBROUTINE cxios_set_fieldgroup_cell_methods
+
+    SUBROUTINE cxios_get_fieldgroup_cell_methods(fieldgroup_hdl, cell_methods, cell_methods_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods
+      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_size
+    END SUBROUTINE cxios_get_fieldgroup_cell_methods
+
+    FUNCTION cxios_is_defined_fieldgroup_cell_methods(fieldgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_cell_methods
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+    END FUNCTION cxios_is_defined_fieldgroup_cell_methods
+
+
+    SUBROUTINE cxios_set_fieldgroup_cell_methods_mode(fieldgroup_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode
+      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size
+    END SUBROUTINE cxios_set_fieldgroup_cell_methods_mode
+
+    SUBROUTINE cxios_get_fieldgroup_cell_methods_mode(fieldgroup_hdl, cell_methods_mode, cell_methods_mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: cell_methods_mode
+      INTEGER  (kind = C_INT)     , VALUE        :: cell_methods_mode_size
+    END SUBROUTINE cxios_get_fieldgroup_cell_methods_mode
+
+    FUNCTION cxios_is_defined_fieldgroup_cell_methods_mode(fieldgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_cell_methods_mode
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+    END FUNCTION cxios_is_defined_fieldgroup_cell_methods_mode
+
+
     SUBROUTINE cxios_set_fieldgroup_compression_level(fieldgroup_hdl, compression_level) BIND(C)
       USE ISO_C_BINDING
@@ -147,4 +189,25 @@
 
 
+    SUBROUTINE cxios_set_fieldgroup_expr(fieldgroup_hdl, expr, expr_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr
+      INTEGER  (kind = C_INT)     , VALUE        :: expr_size
+    END SUBROUTINE cxios_set_fieldgroup_expr
+
+    SUBROUTINE cxios_get_fieldgroup_expr(fieldgroup_hdl, expr, expr_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: expr
+      INTEGER  (kind = C_INT)     , VALUE        :: expr_size
+    END SUBROUTINE cxios_get_fieldgroup_expr
+
+    FUNCTION cxios_is_defined_fieldgroup_expr(fieldgroup_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_expr
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+    END FUNCTION cxios_is_defined_fieldgroup_expr
+
+
     SUBROUTINE cxios_set_fieldgroup_field_ref(fieldgroup_hdl, field_ref, field_ref_size) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/dev/dev_olga/src/interface/fortran_attr/ifield_attr.F90
===================================================================
--- /XIOS/dev/dev_olga/src/interface/fortran_attr/ifield_attr.F90	(revision 1020)
+++ /XIOS/dev/dev_olga/src/interface/fortran_attr/ifield_attr.F90	(revision 1021)
@@ -12,8 +12,8 @@
 
   SUBROUTINE xios(set_field_attr)  &
-    ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-    , unit, valid_max, valid_min )
+    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -22,4 +22,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -29,4 +31,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset
@@ -56,16 +59,16 @@
       (field_id,field_hdl)
       CALL xios(set_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-      , unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr)
 
   SUBROUTINE xios(set_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-    , unit, valid_max, valid_min )
+    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -73,4 +76,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -80,4 +85,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset
@@ -105,16 +111,17 @@
 
       CALL xios(set_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-      , unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr_hdl)
 
   SUBROUTINE xios(set_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_  &
-    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  &
-    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_  &
+    , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_  &
+    , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_  &
+    , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_  &
+     )
 
     IMPLICIT NONE
@@ -122,4 +129,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_
@@ -129,4 +138,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref_
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset_
@@ -163,4 +173,14 @@
       ENDIF
 
+      IF (PRESENT(cell_methods_)) THEN
+        CALL cxios_set_field_cell_methods &
+      (field_hdl%daddr, cell_methods_, len(cell_methods_))
+      ENDIF
+
+      IF (PRESENT(cell_methods_mode_)) THEN
+        CALL cxios_set_field_cell_methods_mode &
+      (field_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_set_field_compression_level &
@@ -190,4 +210,9 @@
       ENDIF
 
+      IF (PRESENT(expr_)) THEN
+        CALL cxios_set_field_expr &
+      (field_hdl%daddr, expr_, len(expr_))
+      ENDIF
+
       IF (PRESENT(field_ref_)) THEN
         CALL cxios_set_field_field_ref &
@@ -296,8 +321,8 @@
 
   SUBROUTINE xios(get_field_attr)  &
-    ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-    , unit, valid_max, valid_min )
+    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -306,4 +331,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -313,4 +340,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset
@@ -340,16 +368,16 @@
       (field_id,field_hdl)
       CALL xios(get_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-      , unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr)
 
   SUBROUTINE xios(get_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-    , unit, valid_max, valid_min )
+    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -357,4 +385,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -364,4 +394,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset
@@ -389,16 +420,17 @@
 
       CALL xios(get_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-      , unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr_hdl)
 
   SUBROUTINE xios(get_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_  &
-    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  &
-    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_  &
+    , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_  &
+    , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_  &
+    , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_  &
+     )
 
     IMPLICIT NONE
@@ -406,4 +438,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_
@@ -413,4 +447,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref_
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset_
@@ -447,4 +482,14 @@
       ENDIF
 
+      IF (PRESENT(cell_methods_)) THEN
+        CALL cxios_get_field_cell_methods &
+      (field_hdl%daddr, cell_methods_, len(cell_methods_))
+      ENDIF
+
+      IF (PRESENT(cell_methods_mode_)) THEN
+        CALL cxios_get_field_cell_methods_mode &
+      (field_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_get_field_compression_level &
@@ -474,4 +519,9 @@
       ENDIF
 
+      IF (PRESENT(expr_)) THEN
+        CALL cxios_get_field_expr &
+      (field_hdl%daddr, expr_, len(expr_))
+      ENDIF
+
       IF (PRESENT(field_ref_)) THEN
         CALL cxios_get_field_field_ref &
@@ -580,8 +630,8 @@
 
   SUBROUTINE xios(is_defined_field_attr)  &
-    ( field_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-    , unit, valid_max, valid_min )
+    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -592,4 +642,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods
+      LOGICAL(KIND=C_BOOL) :: cell_methods_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode
+      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -602,4 +656,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: expr
+      LOGICAL(KIND=C_BOOL) :: expr_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref
       LOGICAL(KIND=C_BOOL) :: field_ref_tmp
@@ -646,16 +702,16 @@
       (field_id,field_hdl)
       CALL xios(is_defined_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-      , unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_field_attr)
 
   SUBROUTINE xios(is_defined_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-    , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-    , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-    , unit, valid_max, valid_min )
+    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+    , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
     IMPLICIT NONE
@@ -665,4 +721,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods
+      LOGICAL(KIND=C_BOOL) :: cell_methods_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode
+      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -675,4 +735,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: expr
+      LOGICAL(KIND=C_BOOL) :: expr_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref
       LOGICAL(KIND=C_BOOL) :: field_ref_tmp
@@ -717,16 +779,17 @@
 
       CALL xios(is_defined_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value, domain_ref  &
-      , enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name  &
-      , name, operation, prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq  &
-      , unit, valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, indexed_output, level, long_name, name, operation, prec, read_access, scalar_ref  &
+      , scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min )
 
   END SUBROUTINE xios(is_defined_field_attr_hdl)
 
   SUBROUTINE xios(is_defined_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_  &
-    , level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_  &
-    , ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_, default_value_  &
+    , detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_, freq_op_, grid_path_  &
+    , grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_  &
+    , scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_  &
+     )
 
     IMPLICIT NONE
@@ -736,4 +799,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_
       LOGICAL(KIND=C_BOOL) :: axis_ref__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_
+      LOGICAL(KIND=C_BOOL) :: cell_methods__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_
+      LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_
       LOGICAL(KIND=C_BOOL) :: compression_level__tmp
@@ -746,4 +813,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL(KIND=C_BOOL) :: enabled__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: expr_
+      LOGICAL(KIND=C_BOOL) :: expr__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref_
       LOGICAL(KIND=C_BOOL) :: field_ref__tmp
@@ -799,4 +868,16 @@
       ENDIF
 
+      IF (PRESENT(cell_methods_)) THEN
+        cell_methods__tmp = cxios_is_defined_field_cell_methods &
+      (field_hdl%daddr)
+        cell_methods_ = cell_methods__tmp
+      ENDIF
+
+      IF (PRESENT(cell_methods_mode_)) THEN
+        cell_methods_mode__tmp = cxios_is_defined_field_cell_methods_mode &
+      (field_hdl%daddr)
+        cell_methods_mode_ = cell_methods_mode__tmp
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         compression_level__tmp = cxios_is_defined_field_compression_level &
@@ -829,4 +910,10 @@
       ENDIF
 
+      IF (PRESENT(expr_)) THEN
+        expr__tmp = cxios_is_defined_field_expr &
+      (field_hdl%daddr)
+        expr_ = expr__tmp
+      ENDIF
+
       IF (PRESENT(field_ref_)) THEN
         field_ref__tmp = cxios_is_defined_field_field_ref &
Index: /XIOS/dev/dev_olga/src/interface/fortran_attr/ifieldgroup_attr.F90
===================================================================
--- /XIOS/dev/dev_olga/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 1020)
+++ /XIOS/dev/dev_olga/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 1021)
@@ -12,8 +12,9 @@
 
   SUBROUTINE xios(set_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+     )
 
     IMPLICIT NONE
@@ -22,4 +23,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -29,4 +32,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset
@@ -57,16 +61,18 @@
       (fieldgroup_id,fieldgroup_hdl)
       CALL xios(set_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+       )
 
   END SUBROUTINE xios(set_fieldgroup_attr)
 
   SUBROUTINE xios(set_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+     )
 
     IMPLICIT NONE
@@ -74,4 +80,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -81,4 +89,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset
@@ -107,16 +116,18 @@
 
       CALL xios(set_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+       )
 
   END SUBROUTINE xios(set_fieldgroup_attr_hdl)
 
   SUBROUTINE xios(set_fieldgroup_attr_hdl_)   &
-    ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_  &
-    , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_  &
-    , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
+    ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_  &
+    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
+    , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_  &
+    , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -124,4 +135,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: add_offset_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: cell_methods_mode_
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_
@@ -131,4 +144,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: expr_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: field_ref_
       TYPE(txios(duration))  , OPTIONAL, INTENT(IN) :: freq_offset_
@@ -166,4 +180,14 @@
       ENDIF
 
+      IF (PRESENT(cell_methods_)) THEN
+        CALL cxios_set_fieldgroup_cell_methods &
+      (fieldgroup_hdl%daddr, cell_methods_, len(cell_methods_))
+      ENDIF
+
+      IF (PRESENT(cell_methods_mode_)) THEN
+        CALL cxios_set_fieldgroup_cell_methods_mode &
+      (fieldgroup_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_set_fieldgroup_compression_level &
@@ -193,4 +217,9 @@
       ENDIF
 
+      IF (PRESENT(expr_)) THEN
+        CALL cxios_set_fieldgroup_expr &
+      (fieldgroup_hdl%daddr, expr_, len(expr_))
+      ENDIF
+
       IF (PRESENT(field_ref_)) THEN
         CALL cxios_set_fieldgroup_field_ref &
@@ -304,8 +333,9 @@
 
   SUBROUTINE xios(get_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+     )
 
     IMPLICIT NONE
@@ -314,4 +344,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -321,4 +353,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset
@@ -349,16 +382,18 @@
       (fieldgroup_id,fieldgroup_hdl)
       CALL xios(get_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+       )
 
   END SUBROUTINE xios(get_fieldgroup_attr)
 
   SUBROUTINE xios(get_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+     )
 
     IMPLICIT NONE
@@ -366,4 +401,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -373,4 +410,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset
@@ -399,16 +437,18 @@
 
       CALL xios(get_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+       )
 
   END SUBROUTINE xios(get_fieldgroup_attr_hdl)
 
   SUBROUTINE xios(get_fieldgroup_attr_hdl_)   &
-    ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_  &
-    , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_  &
-    , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
+    ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_  &
+    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
+    , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_  &
+    , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -416,4 +456,6 @@
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: add_offset_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: cell_methods_mode_
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_
@@ -423,4 +465,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: expr_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: field_ref_
       TYPE(txios(duration))  , OPTIONAL, INTENT(OUT) :: freq_offset_
@@ -458,4 +501,14 @@
       ENDIF
 
+      IF (PRESENT(cell_methods_)) THEN
+        CALL cxios_get_fieldgroup_cell_methods &
+      (fieldgroup_hdl%daddr, cell_methods_, len(cell_methods_))
+      ENDIF
+
+      IF (PRESENT(cell_methods_mode_)) THEN
+        CALL cxios_get_fieldgroup_cell_methods_mode &
+      (fieldgroup_hdl%daddr, cell_methods_mode_, len(cell_methods_mode_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_get_fieldgroup_compression_level &
@@ -485,4 +538,9 @@
       ENDIF
 
+      IF (PRESENT(expr_)) THEN
+        CALL cxios_get_fieldgroup_expr &
+      (fieldgroup_hdl%daddr, expr_, len(expr_))
+      ENDIF
+
       IF (PRESENT(field_ref_)) THEN
         CALL cxios_get_fieldgroup_field_ref &
@@ -596,8 +654,9 @@
 
   SUBROUTINE xios(is_defined_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( fieldgroup_id, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+     )
 
     IMPLICIT NONE
@@ -608,4 +667,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods
+      LOGICAL(KIND=C_BOOL) :: cell_methods_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode
+      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -618,4 +681,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: expr
+      LOGICAL(KIND=C_BOOL) :: expr_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref
       LOGICAL(KIND=C_BOOL) :: field_ref_tmp
@@ -664,16 +729,18 @@
       (fieldgroup_id,fieldgroup_hdl)
       CALL xios(is_defined_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+       )
 
   END SUBROUTINE xios(is_defined_fieldgroup_attr)
 
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-    , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-    , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-    , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+    ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+    , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+    , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+     )
 
     IMPLICIT NONE
@@ -683,4 +750,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref
       LOGICAL(KIND=C_BOOL) :: axis_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods
+      LOGICAL(KIND=C_BOOL) :: cell_methods_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode
+      LOGICAL(KIND=C_BOOL) :: cell_methods_mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -693,4 +764,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: expr
+      LOGICAL(KIND=C_BOOL) :: expr_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref
       LOGICAL(KIND=C_BOOL) :: field_ref_tmp
@@ -737,16 +810,18 @@
 
       CALL xios(is_defined_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, compression_level, default_value, detect_missing_value  &
-      , domain_ref, enabled, field_ref, freq_offset, freq_op, grid_path, grid_ref, group_ref, indexed_output  &
-      , level, long_name, name, operation, prec, read_access, scalar_ref, scale_factor, standard_name  &
-      , ts_enabled, ts_split_freq, unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, compression_level, default_value  &
+      , detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op, grid_path  &
+      , grid_ref, group_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
+      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
+       )
 
   END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)
 
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl_)   &
-    ( fieldgroup_hdl, add_offset_, axis_ref_, compression_level_, default_value_, detect_missing_value_  &
-    , domain_ref_, enabled_, field_ref_, freq_offset_, freq_op_, grid_path_, grid_ref_, group_ref_  &
-    , indexed_output_, level_, long_name_, name_, operation_, prec_, read_access_, scalar_ref_, scale_factor_  &
-    , standard_name_, ts_enabled_, ts_split_freq_, unit_, valid_max_, valid_min_ )
+    ( fieldgroup_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, compression_level_  &
+    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
+    , freq_op_, grid_path_, grid_ref_, group_ref_, indexed_output_, level_, long_name_, name_, operation_  &
+    , prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -756,4 +831,8 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: axis_ref_
       LOGICAL(KIND=C_BOOL) :: axis_ref__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_
+      LOGICAL(KIND=C_BOOL) :: cell_methods__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: cell_methods_mode_
+      LOGICAL(KIND=C_BOOL) :: cell_methods_mode__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_
       LOGICAL(KIND=C_BOOL) :: compression_level__tmp
@@ -766,4 +845,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL(KIND=C_BOOL) :: enabled__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: expr_
+      LOGICAL(KIND=C_BOOL) :: expr__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: field_ref_
       LOGICAL(KIND=C_BOOL) :: field_ref__tmp
@@ -821,4 +902,16 @@
       ENDIF
 
+      IF (PRESENT(cell_methods_)) THEN
+        cell_methods__tmp = cxios_is_defined_fieldgroup_cell_methods &
+      (fieldgroup_hdl%daddr)
+        cell_methods_ = cell_methods__tmp
+      ENDIF
+
+      IF (PRESENT(cell_methods_mode_)) THEN
+        cell_methods_mode__tmp = cxios_is_defined_fieldgroup_cell_methods_mode &
+      (fieldgroup_hdl%daddr)
+        cell_methods_mode_ = cell_methods_mode__tmp
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         compression_level__tmp = cxios_is_defined_fieldgroup_compression_level &
@@ -851,4 +944,10 @@
       ENDIF
 
+      IF (PRESENT(expr_)) THEN
+        expr__tmp = cxios_is_defined_fieldgroup_expr &
+      (fieldgroup_hdl%daddr)
+        expr_ = expr__tmp
+      ENDIF
+
       IF (PRESENT(field_ref_)) THEN
         field_ref__tmp = cxios_is_defined_fieldgroup_field_ref &
Index: /XIOS/dev/dev_olga/src/interface/fortran_attr/iinterpolate_domain_attr.F90
===================================================================
--- /XIOS/dev/dev_olga/src/interface/fortran_attr/iinterpolate_domain_attr.F90	(revision 1020)
+++ /XIOS/dev/dev_olga/src/interface/fortran_attr/iinterpolate_domain_attr.F90	(revision 1021)
@@ -12,5 +12,5 @@
 
   SUBROUTINE xios(set_interpolate_domain_attr)  &
-    ( interpolate_domain_id, file, order, renormalize )
+    ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight )
 
     IMPLICIT NONE
@@ -18,43 +18,61 @@
       CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       INTEGER  , OPTIONAL, INTENT(IN) :: order
       LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename
+      LOGICAL  , OPTIONAL, INTENT(IN) :: write_weight
+      LOGICAL (KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(get_interpolate_domain_handle) &
       (interpolate_domain_id,interpolate_domain_hdl)
       CALL xios(set_interpolate_domain_attr_hdl_)   &
-      ( interpolate_domain_hdl, file, order, renormalize )
+      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(set_interpolate_domain_attr)
 
   SUBROUTINE xios(set_interpolate_domain_attr_hdl)  &
-    ( interpolate_domain_hdl, file, order, renormalize )
+    ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode
       INTEGER  , OPTIONAL, INTENT(IN) :: order
       LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename
+      LOGICAL  , OPTIONAL, INTENT(IN) :: write_weight
+      LOGICAL (KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(set_interpolate_domain_attr_hdl_)  &
-      ( interpolate_domain_hdl, file, order, renormalize )
+      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(set_interpolate_domain_attr_hdl)
 
   SUBROUTINE xios(set_interpolate_domain_attr_hdl_)   &
-    ( interpolate_domain_hdl, file_, order_, renormalize_ )
+    ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  &
+     )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_
       INTEGER  , OPTIONAL, INTENT(IN) :: order_
       LOGICAL  , OPTIONAL, INTENT(IN) :: renormalize_
       LOGICAL (KIND=C_BOOL) :: renormalize__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: weight_filename_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: write_weight_
+      LOGICAL (KIND=C_BOOL) :: write_weight__tmp
 
       IF (PRESENT(file_)) THEN
         CALL cxios_set_interpolate_domain_file &
       (interpolate_domain_hdl%daddr, file_, len(file_))
+      ENDIF
+
+      IF (PRESENT(mode_)) THEN
+        CALL cxios_set_interpolate_domain_mode &
+      (interpolate_domain_hdl%daddr, mode_, len(mode_))
       ENDIF
 
@@ -70,8 +88,19 @@
       ENDIF
 
+      IF (PRESENT(weight_filename_)) THEN
+        CALL cxios_set_interpolate_domain_weight_filename &
+      (interpolate_domain_hdl%daddr, weight_filename_, len(weight_filename_))
+      ENDIF
+
+      IF (PRESENT(write_weight_)) THEN
+        write_weight__tmp = write_weight_
+        CALL cxios_set_interpolate_domain_write_weight &
+      (interpolate_domain_hdl%daddr, write_weight__tmp)
+      ENDIF
+
   END SUBROUTINE xios(set_interpolate_domain_attr_hdl_)
 
   SUBROUTINE xios(get_interpolate_domain_attr)  &
-    ( interpolate_domain_id, file, order, renormalize )
+    ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight )
 
     IMPLICIT NONE
@@ -79,43 +108,61 @@
       CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: order
       LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: write_weight
+      LOGICAL (KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(get_interpolate_domain_handle) &
       (interpolate_domain_id,interpolate_domain_hdl)
       CALL xios(get_interpolate_domain_attr_hdl_)   &
-      ( interpolate_domain_hdl, file, order, renormalize )
+      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(get_interpolate_domain_attr)
 
   SUBROUTINE xios(get_interpolate_domain_attr_hdl)  &
-    ( interpolate_domain_hdl, file, order, renormalize )
+    ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode
       INTEGER  , OPTIONAL, INTENT(OUT) :: order
       LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL (KIND=C_BOOL) :: renormalize_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: write_weight
+      LOGICAL (KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(get_interpolate_domain_attr_hdl_)  &
-      ( interpolate_domain_hdl, file, order, renormalize )
+      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(get_interpolate_domain_attr_hdl)
 
   SUBROUTINE xios(get_interpolate_domain_attr_hdl_)   &
-    ( interpolate_domain_hdl, file_, order_, renormalize_ )
+    ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  &
+     )
 
     IMPLICIT NONE
       TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_
       INTEGER  , OPTIONAL, INTENT(OUT) :: order_
       LOGICAL  , OPTIONAL, INTENT(OUT) :: renormalize_
       LOGICAL (KIND=C_BOOL) :: renormalize__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: weight_filename_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: write_weight_
+      LOGICAL (KIND=C_BOOL) :: write_weight__tmp
 
       IF (PRESENT(file_)) THEN
         CALL cxios_get_interpolate_domain_file &
       (interpolate_domain_hdl%daddr, file_, len(file_))
+      ENDIF
+
+      IF (PRESENT(mode_)) THEN
+        CALL cxios_get_interpolate_domain_mode &
+      (interpolate_domain_hdl%daddr, mode_, len(mode_))
       ENDIF
 
@@ -131,8 +178,19 @@
       ENDIF
 
+      IF (PRESENT(weight_filename_)) THEN
+        CALL cxios_get_interpolate_domain_weight_filename &
+      (interpolate_domain_hdl%daddr, weight_filename_, len(weight_filename_))
+      ENDIF
+
+      IF (PRESENT(write_weight_)) THEN
+        CALL cxios_get_interpolate_domain_write_weight &
+      (interpolate_domain_hdl%daddr, write_weight__tmp)
+        write_weight_ = write_weight__tmp
+      ENDIF
+
   END SUBROUTINE xios(get_interpolate_domain_attr_hdl_)
 
   SUBROUTINE xios(is_defined_interpolate_domain_attr)  &
-    ( interpolate_domain_id, file, order, renormalize )
+    ( interpolate_domain_id, file, mode, order, renormalize, weight_filename, write_weight )
 
     IMPLICIT NONE
@@ -141,18 +199,24 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: file
       LOGICAL(KIND=C_BOOL) :: file_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mode
+      LOGICAL(KIND=C_BOOL) :: mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: order
       LOGICAL(KIND=C_BOOL) :: order_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL(KIND=C_BOOL) :: renormalize_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename
+      LOGICAL(KIND=C_BOOL) :: weight_filename_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight
+      LOGICAL(KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(get_interpolate_domain_handle) &
       (interpolate_domain_id,interpolate_domain_hdl)
       CALL xios(is_defined_interpolate_domain_attr_hdl_)   &
-      ( interpolate_domain_hdl, file, order, renormalize )
+      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(is_defined_interpolate_domain_attr)
 
   SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl)  &
-    ( interpolate_domain_hdl, file, order, renormalize )
+    ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
 
     IMPLICIT NONE
@@ -160,16 +224,23 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: file
       LOGICAL(KIND=C_BOOL) :: file_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mode
+      LOGICAL(KIND=C_BOOL) :: mode_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: order
       LOGICAL(KIND=C_BOOL) :: order_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize
       LOGICAL(KIND=C_BOOL) :: renormalize_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename
+      LOGICAL(KIND=C_BOOL) :: weight_filename_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight
+      LOGICAL(KIND=C_BOOL) :: write_weight_tmp
 
       CALL xios(is_defined_interpolate_domain_attr_hdl_)  &
-      ( interpolate_domain_hdl, file, order, renormalize )
+      ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight )
 
   END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl)
 
   SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_)   &
-    ( interpolate_domain_hdl, file_, order_, renormalize_ )
+    ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_  &
+     )
 
     IMPLICIT NONE
@@ -177,8 +248,14 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: file_
       LOGICAL(KIND=C_BOOL) :: file__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mode_
+      LOGICAL(KIND=C_BOOL) :: mode__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: order_
       LOGICAL(KIND=C_BOOL) :: order__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: renormalize_
       LOGICAL(KIND=C_BOOL) :: renormalize__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: weight_filename_
+      LOGICAL(KIND=C_BOOL) :: weight_filename__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: write_weight_
+      LOGICAL(KIND=C_BOOL) :: write_weight__tmp
 
       IF (PRESENT(file_)) THEN
@@ -188,4 +265,10 @@
       ENDIF
 
+      IF (PRESENT(mode_)) THEN
+        mode__tmp = cxios_is_defined_interpolate_domain_mode &
+      (interpolate_domain_hdl%daddr)
+        mode_ = mode__tmp
+      ENDIF
+
       IF (PRESENT(order_)) THEN
         order__tmp = cxios_is_defined_interpolate_domain_order &
@@ -200,4 +283,16 @@
       ENDIF
 
+      IF (PRESENT(weight_filename_)) THEN
+        weight_filename__tmp = cxios_is_defined_interpolate_domain_weight_filename &
+      (interpolate_domain_hdl%daddr)
+        weight_filename_ = weight_filename__tmp
+      ENDIF
+
+      IF (PRESENT(write_weight_)) THEN
+        write_weight__tmp = cxios_is_defined_interpolate_domain_write_weight &
+      (interpolate_domain_hdl%daddr)
+        write_weight_ = write_weight__tmp
+      ENDIF
+
   END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_)
 
Index: /XIOS/dev/dev_olga/src/interface/fortran_attr/interpolate_domain_interface_attr.F90
===================================================================
--- /XIOS/dev/dev_olga/src/interface/fortran_attr/interpolate_domain_interface_attr.F90	(revision 1020)
+++ /XIOS/dev/dev_olga/src/interface/fortran_attr/interpolate_domain_interface_attr.F90	(revision 1021)
@@ -29,4 +29,25 @@
       INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
     END FUNCTION cxios_is_defined_interpolate_domain_file
+
+
+    SUBROUTINE cxios_set_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode
+      INTEGER  (kind = C_INT)     , VALUE        :: mode_size
+    END SUBROUTINE cxios_set_interpolate_domain_mode
+
+    SUBROUTINE cxios_get_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: mode
+      INTEGER  (kind = C_INT)     , VALUE        :: mode_size
+    END SUBROUTINE cxios_get_interpolate_domain_mode
+
+    FUNCTION cxios_is_defined_interpolate_domain_mode(interpolate_domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_mode
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+    END FUNCTION cxios_is_defined_interpolate_domain_mode
 
 
@@ -68,4 +89,44 @@
     END FUNCTION cxios_is_defined_interpolate_domain_renormalize
 
+
+    SUBROUTINE cxios_set_interpolate_domain_weight_filename(interpolate_domain_hdl, weight_filename, weight_filename_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: weight_filename
+      INTEGER  (kind = C_INT)     , VALUE        :: weight_filename_size
+    END SUBROUTINE cxios_set_interpolate_domain_weight_filename
+
+    SUBROUTINE cxios_get_interpolate_domain_weight_filename(interpolate_domain_hdl, weight_filename, weight_filename_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: weight_filename
+      INTEGER  (kind = C_INT)     , VALUE        :: weight_filename_size
+    END SUBROUTINE cxios_get_interpolate_domain_weight_filename
+
+    FUNCTION cxios_is_defined_interpolate_domain_weight_filename(interpolate_domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_weight_filename
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+    END FUNCTION cxios_is_defined_interpolate_domain_weight_filename
+
+
+    SUBROUTINE cxios_set_interpolate_domain_write_weight(interpolate_domain_hdl, write_weight) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: write_weight
+    END SUBROUTINE cxios_set_interpolate_domain_write_weight
+
+    SUBROUTINE cxios_get_interpolate_domain_write_weight(interpolate_domain_hdl, write_weight) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+      LOGICAL (KIND=C_BOOL)             :: write_weight
+    END SUBROUTINE cxios_get_interpolate_domain_write_weight
+
+    FUNCTION cxios_is_defined_interpolate_domain_write_weight(interpolate_domain_hdl) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_write_weight
+      INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl
+    END FUNCTION cxios_is_defined_interpolate_domain_write_weight
+
   END INTERFACE
 
Index: /XIOS/dev/dev_olga/src/io/nc4_data_output.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/io/nc4_data_output.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/io/nc4_data_output.cpp	(revision 1021)
@@ -1675,4 +1675,35 @@
            for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) writeAttribute_(*it, fieldid) ;
 
+           bool alreadyAddCellMethod = false;
+           StdString cellMethodsPrefix(""), cellMethodsSuffix("");
+           if (!field->cell_methods.isEmpty())
+           {
+             StdString cellMethodString = field->cell_methods;
+             if (field->cell_methods_mode.isEmpty() ||
+                 (CField::cell_methods_mode_attr::overwrite == field->cell_methods_mode))
+             {
+               SuperClassWriter::addAttribute("cell_methods", cellMethodString, &fieldid);
+               alreadyAddCellMethod = true;
+             }
+             else
+             {
+               switch (field->cell_methods_mode)
+               {
+               case (CField::cell_methods_mode_attr::prefix):
+                 cellMethodsPrefix = cellMethodString;
+                 cellMethodsPrefix += " ";
+                 break;
+               case (CField::cell_methods_mode_attr::suffix):
+                 cellMethodsSuffix = " ";
+                 cellMethodsSuffix += cellMethodString;
+                 break;
+               case (CField::cell_methods_mode_attr::none):
+                 break;
+               default:
+                 break;
+               }
+             }
+           }
+
 
            if (wtime)
@@ -1687,5 +1718,5 @@
               SuperClassWriter::addAttribute("interval_write", freqOut.toStringUDUnits(), &fieldid);
 
-              StdString cellMethods = "time: ";
+              StdString cellMethods(cellMethodsPrefix + "time: ");
               if (field->operation.getValue() == "instant") cellMethods += "point";
               else if (field->operation.getValue() == "average") cellMethods += "mean";
@@ -1694,5 +1725,7 @@
               if (freqOp.resolve(*context->calendar) != freqOut.resolve(*context->calendar))
                 cellMethods += " (interval: " + freqOpStr + ")";
-              SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid);
+              cellMethods += cellMethodsSuffix;
+              if (!alreadyAddCellMethod)
+                SuperClassWriter::addAttribute("cell_methods", cellMethods, &fieldid);
            }
 
@@ -1928,5 +1961,6 @@
         if (!field->wasWritten())
         {
-          if (appendMode && field->file->record_offset.isEmpty())
+          if (appendMode && field->file->record_offset.isEmpty() &&
+               field->getOperationTimeType() != func::CFunctor::once)
           {
             field->resetNStep(getRecordFromTime(field->last_Write_srv) + 1);
Index: /XIOS/dev/dev_olga/src/node/context.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/context.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/context.cpp	(revision 1021)
@@ -247,13 +247,14 @@
 
      hasClient = true;
-     if (CXios::serverLevel != 1)  // initClient is called by client pool
+     if (CServer::serverLevel != 1)
+//     if (CXios::serverLevel != 1)
+     // initClient is called by client pool
      {
        client = new CContextClient(this, intraComm, interComm, cxtServer);
        server = new CContextServer(this, intraComm, interComm);
      }
-     else                         // initClient is called by primary server pool
-     {
-//       clientPrimServer = new CContextClient(this, intraComm, interComm);
-//       serverPrimServer = new CContextServer(this, 1, intraComm, interComm);  // just some int parameter to distinguish server from serverPrimServer on server1
+     else
+     // initClient is called by primary server pool
+     {
        clientPrimServer.push_back(new CContextClient(this, intraComm, interComm));
        serverPrimServer.push_back(new CContextServer(this, intraComm, interComm));
@@ -376,9 +377,9 @@
    bool CContext::eventLoop(void)
    {
-     if (CXios::serverLevel == 0)
+     if (CServer::serverLevel == 0)
      {
        return server->eventLoop();
      }
-     else if (CXios::serverLevel == 1)
+     else if (CServer::serverLevel == 1)
      {
        bool serverFinished = server->eventLoop();
@@ -399,10 +400,10 @@
    bool CContext::checkBuffersAndListen(void)
    {
-     if (CXios::serverLevel == 0)
+     if (CServer::serverLevel == 0)
      {
        client->checkBuffers();
        return server->eventLoop();
      }
-     else if (CXios::serverLevel == 1)
+     else if (CServer::serverLevel == 1)
      {
        client->checkBuffers();
@@ -417,5 +418,5 @@
        return ( serverFinished && serverPrimFinished);
      }
-     else if (CXios::serverLevel == 2)
+     else if (CServer::serverLevel == 2)
      {
        client->checkBuffers();
@@ -430,5 +431,5 @@
      {
        finalized = true;
-//        if (hasClient) sendRegistry() ;
+       if (hasClient) sendRegistry() ;
 
        if ((hasClient) && (hasServer))
@@ -487,5 +488,4 @@
      // There is nothing client need to send to server
      if (hasClient)
-//     if (hasClient && !hasServer)
      {
        // After xml is parsed, there are some more works with post processing
@@ -495,5 +495,4 @@
      setClientServerBuffer();
 
-//     if (hasClient && !hasServer)
      if (hasClient)
      {
@@ -505,35 +504,26 @@
 
       // We have enough information to send to server
-      if (!hasServer)
-      {
-        // First of all, send all enabled files
-       sendEnabledFiles();
-       // Then, send all enabled fields
-       sendEnabledFields();
-      }
-      else
-      {
-        sendEnabledFiles(clientPrimServer.size());
-        sendEnabledFields(clientPrimServer.size());
-      }
+      // First of all, send all enabled files
+      sendEnabledFiles();
+
+      // Then, send all enabled fields
+      sendEnabledFields();
 
       // At last, we have all info of domain and axis, then send them
        sendRefDomainsAxis();
-      // After that, send all grid (if any)
+
+       // After that, send all grid (if any)
        sendRefGrid();
+
        // We have a xml tree on the server side and now, it should be also processed
        sendPostProcessing();
      }
 
-    // We have a xml tree on the server side and now, it should be also processed
-   // if (hasClient && !hasServer) sendPostProcessing();
-
-//     // Now tell server that it can process all messages from client
-// //    if (hasClient && !hasServer) this->sendCloseDefinition();
+
+     // Now tell server that it can process all messages from client
      if (hasClient) this->sendCloseDefinition();
 
     // There are some processings that should be done after all of above. For example: check mask or index
      if (hasClient && !hasServer)
-//    if (hasClient)
     {
       this->buildFilterGraphOfEnabledFields();  // references are resolved here (access xml file)
@@ -692,4 +682,19 @@
          DEBUG(<<"Aucun fichier ne va Ãªtre sorti dans le contexte nommÃ© \""
                << getId() << "\" !");
+
+      // Assigning contextClient to each enabled file
+      if (hasClient)
+      {
+        for (int i = 0; i < enabledFiles.size(); ++i)
+        {
+          if (hasServer)
+          {
+            int srvId = i % clientPrimServer.size();
+            enabledFiles[i]->setContextClient(clientPrimServer[srvId]);
+          }
+          else
+            enabledFiles[i]->setContextClient(client);
+        }
+      }
    }
 
@@ -769,5 +774,4 @@
    {
      // Use correct context client to send message
-//     CContextClient* contextClientTmp = (hasServer) ? clientPrimServer[0] : client;
      int nbSrvPools = (hasServer) ? clientPrimServer.size() : 1;
      for (int i = 0; i < nbSrvPools; ++i)
@@ -883,5 +887,4 @@
    {
      // Use correct context client to send message
-//     CContextClient* contextClientTmp = (0 != clientPrimServer) ? clientPrimServer : client;
      int nbSrvPools = (hasServer) ? clientPrimServer.size() : 1;
      for (int i = 0; i < nbSrvPools; ++i)
@@ -958,5 +961,4 @@
    {
       // Use correct context client to send message
-//     CContextClient* contextClientTmp = (0 != clientPrimServer) ? clientPrimServer : client;
      int nbSrvPools = (hasServer) ? clientPrimServer.size() : 1;
      for (int i = 0; i < nbSrvPools; ++i)
@@ -1077,5 +1079,6 @@
       // Check if some automatic time series should be generated
       // Warning: This must be done after solving the inheritance and before the rest of post-processing
-      prepareTimeseries();
+      if (!hasServer)
+        prepareTimeseries();
 
       //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ã  sortir.
@@ -1204,29 +1207,7 @@
      for (int i = 0; i < size; ++i)
      {
-       cfgrpPtr->sendCreateChild(this->enabledFiles[i]->getId());
-       this->enabledFiles[i]->sendAllAttributesToServer();
-       this->enabledFiles[i]->sendAddAllVariables();
-     }
-   }
-
-   //! Client side: Send infomation of active files (files are enabled to write out)
-   void CContext::sendEnabledFiles(const int nbPools)
-   {
-     int size = this->enabledFiles.size();
-
-     // In a context, each type has a root definition, e.g: axis, domain, field.
-     // Every object must be a child of one of these root definition. In this case
-     // all new file objects created on server must be children of the root "file_definition"
-     StdString fileDefRoot("file_definition");
-     CFileGroup* cfgrpPtr = CFileGroup::get(fileDefRoot);
-
-     {
-       for (int i = 0; i < size; ++i)
-       {
-         int srvId = i % nbPools;
-         cfgrpPtr->sendCreateChild(this->enabledFiles[i]->getId(), srvId);
-         this->enabledFiles[i]->sendAllAttributesToServer(srvId);
-         this->enabledFiles[i]->sendAddAllVariables(srvId);
-       }
+       cfgrpPtr->sendCreateChild(this->enabledFiles[i]->getId(),enabledFiles[i]->getContextClient());
+       this->enabledFiles[i]->sendAllAttributesToServer(enabledFiles[i]->getContextClient());
+       this->enabledFiles[i]->sendAddAllVariables(enabledFiles[i]->getContextClient());
      }
    }
@@ -1238,15 +1219,5 @@
      for (int i = 0; i < size; ++i)
      {
-       this->enabledFiles[i]->sendEnabledFields();
-     }
-   }
-
-   void CContext::sendEnabledFields(const int nbPools)
-   {
-     int size = this->enabledFiles.size();
-     for (int i = 0; i < size; ++i)
-     {
-       int srvId = i % nbPools;
-       this->enabledFiles[i]->sendEnabledFields(srvId);
+       this->enabledFiles[i]->sendEnabledFields(enabledFiles[i]->getContextClient());
      }
    }
@@ -1361,65 +1332,4 @@
    //! Client side: Send information of reference domain and axis of active fields
    void CContext::sendRefDomainsAxis()
-   {
-     std::set<StdString> domainIds, axisIds, scalarIds;
-
-     // Find all reference domain and axis of all active fields
-     int numEnabledFiles = this->enabledFiles.size();
-     for (int i = 0; i < numEnabledFiles; ++i)
-     {
-       std::vector<CField*> enabledFields = this->enabledFiles[i]->getEnabledFields();
-       int numEnabledFields = enabledFields.size();
-       for (int j = 0; j < numEnabledFields; ++j)
-       {
-         const std::vector<StdString>& prDomAxisScalarId = enabledFields[j]->getRefDomainAxisIds();
-         if ("" != prDomAxisScalarId[0]) domainIds.insert(prDomAxisScalarId[0]);
-         if ("" != prDomAxisScalarId[1]) axisIds.insert(prDomAxisScalarId[1]);
-         if ("" != prDomAxisScalarId[2]) scalarIds.insert(prDomAxisScalarId[2]);
-       }
-     }
-
-     // Create all reference axis on server side
-     std::set<StdString>::iterator itDom, itAxis, itScalar;
-     std::set<StdString>::const_iterator itE;
-
-     StdString scalarDefRoot("scalar_definition");
-     CScalarGroup* scalarPtr = CScalarGroup::get(scalarDefRoot);
-     itE = scalarIds.end();
-     for (itScalar = scalarIds.begin(); itScalar != itE; ++itScalar)
-     {
-       if (!itScalar->empty())
-       {
-         scalarPtr->sendCreateChild(*itScalar);
-         CScalar::get(*itScalar)->sendAllAttributesToServer();
-       }
-     }
-
-     StdString axiDefRoot("axis_definition");
-     CAxisGroup* axisPtr = CAxisGroup::get(axiDefRoot);
-     itE = axisIds.end();
-     for (itAxis = axisIds.begin(); itAxis != itE; ++itAxis)
-     {
-       if (!itAxis->empty())
-       {
-         axisPtr->sendCreateChild(*itAxis);
-         CAxis::get(*itAxis)->sendAllAttributesToServer();
-       }
-     }
-
-     // Create all reference domains on server side
-     StdString domDefRoot("domain_definition");
-     CDomainGroup* domPtr = CDomainGroup::get(domDefRoot);
-     itE = domainIds.end();
-     for (itDom = domainIds.begin(); itDom != itE; ++itDom)
-     {
-       if (!itDom->empty()) {
-          domPtr->sendCreateChild(*itDom);
-          CDomain::get(*itDom)->sendAllAttributesToServer();
-       }
-     }
-   }
-
-   //! Client side: Send information of reference domain and axis of active fields
-   void CContext::sendRefDomainsAxis(const int nbPools)
    {
      std::set<StdString> domainIds, axisIds, scalarIds;
@@ -1569,5 +1479,4 @@
 
     // Use correct context client to send message
-//    CContextClient* contextClientTmp = (0 != clientPrimServer) ? clientPrimServer : client;
     int nbSrvPools = (hasServer) ? clientPrimServer.size() : 1;
     for (int i = 0; i < nbSrvPools; ++i)
@@ -1575,5 +1484,5 @@
       CContextClient* contextClientTmp = (hasServer) ? clientPrimServer[i] : client;
       CEventClient event(CContext::GetType(), CContext::EVENT_ID_SEND_REGISTRY);
-            if (contextClientTmp->isServerLeader())
+        if (contextClientTmp->isServerLeader())
         {
            CMessage msg ;
@@ -1583,5 +1492,5 @@
              msg<<this->getIdServer();
            if (contextClientTmp->clientRank==0) msg<<*registryOut ;
-           const std::list<int>& ranks = client->getRanksServerLeader();
+           const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
            for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
              event.push(*itRank,1,msg);
Index: /XIOS/dev/dev_olga/src/node/context.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/context.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/context.hpp	(revision 1021)
@@ -133,9 +133,6 @@
          void sendCreateFileHeader(void);
          void sendEnabledFiles();
-         void sendEnabledFiles(const int nbPools);
          void sendEnabledFields();
-         void sendEnabledFields(const int nbPools);
          void sendRefDomainsAxis();
-         void sendRefDomainsAxis(const int nbPools);
          void sendRefGrid();
          void sendPostProcessing();
Index: /XIOS/dev/dev_olga/src/node/field.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/field.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/field.cpp	(revision 1021)
@@ -36,5 +36,5 @@
       , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false)
       , useCompressedOutput(false)
-      , isReadDataRequestPending(false)
+      , wasDataAlreadyReceivedFromServer(false)
    { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); }
 
@@ -47,5 +47,5 @@
       , domAxisScalarIds_(vector<StdString>(3,"")), areAllReferenceSolved(false), isReferenceSolved(false)
       , useCompressedOutput(false)
-      , isReadDataRequestPending(false)
+      , wasDataAlreadyReceivedFromServer(false)
    { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); }
 
@@ -179,10 +179,7 @@
   }
 
-  void CField::sendUpdateData(const CArray<double,1>& data, const int srvPool)
+  void CField::sendUpdateData(const CArray<double,1>& data, CContextClient* client)
   {
     CTimer::get("XIOS Send Data").resume();
-
-    CContext* context = CContext::getCurrent();
-    CContextClient* client = context->clientPrimServer[srvPool];
 
     CEventClient event(getType(), EVENT_ID_UPDATE_DATA);
@@ -312,5 +309,5 @@
         int fileIdx = std::find(context->enabledFiles.begin(), context->enabledFiles.end(), this->file) - context->enabledFiles.begin();
         int srvId = fileIdx % context->clientPrimServer.size();
-        sendUpdateData(fieldData, srvId);
+        sendUpdateData(fieldData, context->clientPrimServer[srvId]);
     }
     if (!context->hasClient && context->hasServer)
@@ -348,11 +345,10 @@
   }
 
-  void CField::sendReadDataRequest(void)
+  void CField::sendReadDataRequest(const CDate& tsDataRequested)
   {
     CContext* context = CContext::getCurrent();
     CContextClient* client = context->client;
 
-    lastDataRequestedFromServer = context->getCalendar()->getCurrentDate();
-    isReadDataRequestPending = true;
+    lastDataRequestedFromServer = tsDataRequested;
 
     CEventClient event(getType(), EVENT_ID_READ_DATA);
@@ -377,17 +373,17 @@
     const CDate& currentDate = CContext::getCurrent()->getCalendar()->getCurrentDate();
 
-    bool requestData = (currentDate >= lastDataRequestedFromServer + file->output_freq.getValue());
-
-    if (requestData)
-    {
-      cout<<"currentDate : "<<currentDate<<endl ;
-      cout<<"lastDataRequestedFromServer : "<<lastDataRequestedFromServer<<endl ;
-      cout<<"file->output_freq.getValue() : "<<file->output_freq.getValue()<<endl ;
-      cout<<"lastDataRequestedFromServer + file->output_freq.getValue() : "<<lastDataRequestedFromServer + file->output_freq.getValue()<<endl ;
-
-      sendReadDataRequest();
-    }
-
-    return requestData;
+    bool dataRequested = false;
+    while (currentDate >= lastDataRequestedFromServer)
+    {
+      info(20) << "currentDate : " << currentDate << endl ;
+      info(20) << "lastDataRequestedFromServer : " << lastDataRequestedFromServer << endl ;
+      info(20) << "file->output_freq.getValue() : " << file->output_freq.getValue() << endl ;
+      info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ;
+
+      sendReadDataRequest(lastDataRequestedFromServer + file->output_freq);
+
+      dataRequested = true;
+    }
+    return dataRequested;
   }
 
@@ -411,16 +407,74 @@
 
     map<int, CArray<double,1> >::iterator it;
-    for (it = data_srv.begin(); it != data_srv.end(); it++)
-    {
-      msgs.push_back(CMessage());
-      CMessage& msg = msgs.back();
-      msg << getId();
-      if (hasData)
-        msg << getNStep() - 1 << it->second;
-      else
-        msg << int(-1);
-      event.push(it->first, grid->nbSenders[it->first], msg);
-    }
-    client->sendEvent(event);
+//    for (it = data_srv.begin(); it != data_srv.end(); it++)
+//    {
+//      msgs.push_back(CMessage());
+//      CMessage& msg = msgs.back();
+//      msg << getId();
+//      if (hasData)
+//        msg << getNStep() - 1 << it->second;
+//      else
+//        msg << int(-1);
+//      event.push(it->first, grid->nbSenders[it->first], msg);
+//    }
+//    client->sendEvent(event);
+    if (!grid->doGridHaveDataDistributed())
+    {
+       if (client->isServerLeader())
+       {
+          if (!data_srv.empty())
+          {
+            it = data_srv.begin();
+            const std::list<int>& ranks = client->getRanksServerLeader();
+            for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+            {
+              msgs.push_back(CMessage());
+              CMessage& msg = msgs.back();
+              msg << getId();
+              if (hasData)
+                msg << getNStep() - 1 << it->second;
+              else
+                msg << int(-1);
+              event.push(*itRank, 1, msg);
+            }
+          }
+          client->sendEvent(event);
+       }
+       else
+       {
+          // if (!data_srv.empty())
+          // {
+          //   it = data_srv.begin();
+          //   const std::list<int>& ranks = client->getRanksServerNotLeader();
+          //   for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+          //   {
+          //     msgs.push_back(CMessage());
+          //     CMessage& msg = msgs.back();
+          //     msg << getId();
+          //     if (hasData)
+          //       msg << getNStep() - 1 << it->second;
+          //     else
+          //       msg << int(-1);
+          //     event.push(*itRank, 1, msg);
+          //   }
+          // }
+          client->sendEvent(event);
+       }
+    }
+    else
+    {
+      for (it = data_srv.begin(); it != data_srv.end(); it++)
+      {
+        msgs.push_back(CMessage());
+        CMessage& msg = msgs.back();
+        msg << getId();
+        if (hasData)
+          msg << getNStep() - 1 << it->second;
+        else
+          msg << int(-1);
+        event.push(it->first, grid->nbSenders[it->first], msg);
+      }
+      client->sendEvent(event);
+    }
   }
 
@@ -494,10 +548,16 @@
     }
 
+    if (wasDataAlreadyReceivedFromServer)
+      lastDataReceivedFromServer = lastDataReceivedFromServer + file->output_freq;
+    else
+    {
+      lastDataReceivedFromServer = context->getCalendar()->getInitDate();
+      wasDataAlreadyReceivedFromServer = true;
+    }
+
     if (isEOF)
-      serverSourceFilter->signalEndOfStream(lastDataRequestedFromServer);
+      serverSourceFilter->signalEndOfStream(lastDataReceivedFromServer);
     else
-      serverSourceFilter->streamDataFromServer(lastDataRequestedFromServer, data);
-
-    isReadDataRequestPending = false;
+      serverSourceFilter->streamDataFromServer(lastDataReceivedFromServer, data);
   }
 
@@ -749,5 +809,5 @@
      solveGridDomainAxisRef(doSending2Server);
 
-     if (context->hasClient && !context->hasClient)
+     if (context->hasClient && !context->hasServer)
      {
        solveTransformedGrid();
@@ -831,8 +891,25 @@
      {
        // Check if we have an expression to parse
-       if (!content.empty())
-       {
-         boost::scoped_ptr<IFilterExprNode> expr(parseExpr(content + '\0'));
-         instantDataFilter = expr->reduce(gc, *this);
+       if (hasExpression())
+       {
+         boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0'));
+         boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this);
+
+         // Check if a spatial transformation is needed
+         if (!field_ref.isEmpty())
+         {
+           CGrid* gridRef = CField::get(field_ref)->grid;
+
+           if (grid && grid != gridRef && grid->hasTransform())
+           {
+             double defaultValue = !default_value.isEmpty() ? default_value : 0.0;
+             std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, defaultValue);
+
+             filter->connectOutput(filters.first, 0);
+             filter = filters.second;
+           }
+         }
+
+         instantDataFilter = filter;
        }
        // Check if we have a reference on another field
@@ -841,8 +918,9 @@
        // Check if the data is to be read from a file
        else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read)
-         instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid,
-                                                                                                     freq_offset.isEmpty() ? NoneDu : freq_offset));
+         instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,
+                                                                                                     freq_offset.isEmpty() ? NoneDu : freq_offset,
+                                                                                                     true));
        else // The data might be passed from the model
-         instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid));
+         instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid));
      }
 
@@ -863,4 +941,5 @@
      }
    }
+
 
    /*!
@@ -871,29 +950,27 @@
     * \return the output pin corresponding to the field reference
     */
-   boost::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc)
-   {
-     if (instantDataFilter || field_ref.isEmpty())
-       ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)",
-             "Impossible to get the field reference for a field which has already been parsed or which does not have a field_ref.");
-
-     CField* fieldRef = CField::get(field_ref);
-     fieldRef->buildFilterGraph(gc, false);
-
-     std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters;
-     // Check if a spatial transformation is needed
-     if (grid && grid != fieldRef->grid && grid->hasTransform())
-     {
-       double defaultValue = 0.0;
-       if (!default_value.isEmpty()) defaultValue = this->default_value;
-       filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, defaultValue);
-     }
-
-     else
-       filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc));
-
-     fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0);
-
-     return filters.second;
-   }
+     boost::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc)
+     {
+       if (instantDataFilter || field_ref.isEmpty())
+         ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)",
+               "Impossible to get the field reference for a field which has already been parsed or which does not have a field_ref.");
+
+       CField* fieldRef = CField::get(field_ref);
+       fieldRef->buildFilterGraph(gc, false);
+
+       std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters;
+       // Check if a spatial transformation is needed
+       if (grid && grid != fieldRef->grid && grid->hasTransform())
+       {
+         double defaultValue = !default_value.isEmpty() ? default_value : 0.0;
+         filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, defaultValue);
+       }
+       else
+         filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc));
+
+       fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0);
+
+       return filters.second;
+     }
 
    /*!
@@ -908,5 +985,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.");
@@ -917,15 +994,19 @@
        {
          if (!serverSourceFilter)
-           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid,
-                                                                                   freq_offset.isEmpty() ? NoneDu : freq_offset));
-
+           serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,
+                                                                                   freq_offset.isEmpty() ? NoneDu : freq_offset,
+                                                                                   true));
          selfReferenceFilter = serverSourceFilter;
        }
        else if (!field_ref.isEmpty())
-         selfReferenceFilter = getFieldReference(gc);
+       {
+         CField* fieldRef = CField::get(field_ref);
+         fieldRef->buildFilterGraph(gc, false);
+         selfReferenceFilter = fieldRef->getInstantDataFilter();
+       }
        else
        {
          if (!clientSourceFilter)
-           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(grid));
+           clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid));
 
          selfReferenceFilter = clientSourceFilter;
@@ -1126,5 +1207,6 @@
      else if (grid && grid->hasTransform() && !grid->isTransformed())
      {
-       grid->transformGrid(grid);
+       // Temporarily deactivate the self-transformation of grid
+       //grid->transformGrid(grid);
      }
    }
@@ -1325,5 +1407,5 @@
    }
 
-   void CField::sendAddAllVariables(const int srvPool)
+   void CField::sendAddAllVariables(CContextClient* client)
    {
      std::vector<CVariable*> allVar = getAllVariables();
@@ -1333,7 +1415,7 @@
      for (; it != itE; ++it)
      {
-       this->sendAddVariable((*it)->getId());
-       (*it)->sendAllAttributesToServer(srvPool);
-       (*it)->sendValue(srvPool);
+       this->sendAddVariable((*it)->getId(), client);
+       (*it)->sendAllAttributesToServer(client);
+       (*it)->sendValue(client);
      }
    }
@@ -1363,4 +1445,28 @@
    }
 
+   void CField::sendAddVariable(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client);
+    // CContext* context = CContext::getCurrent();
+
+    // if (!context->hasServer)
+    // {
+    //    CContextClient* client = context->client;
+
+    //    CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE);
+    //    if (client->isServerLeader())
+    //    {
+    //      CMessage msg;
+    //      msg << this->getId();
+    //      msg << id;
+    //      const std::list<int>& ranks = client->getRanksServerLeader();
+    //      for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+    //        event.push(*itRank,1,msg);
+    //      client->sendEvent(event);
+    //    }
+    //    else client->sendEvent(event);
+    // }
+   }
+
    void CField::sendAddVariableGroup(const string& id)
    {
@@ -1418,4 +1524,25 @@
    }
 
+   /*!
+    * 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.
+    */
+   const string& CField::getExpression(void)
+   {
+     if (!expr.isEmpty() && content.empty())
+     {
+       content = expr;
+       expr.reset();
+     }
+
+     return content;
+   }
+
+   bool CField::hasExpression(void) const
+   {
+     return (!expr.isEmpty() || !content.empty());
+   }
+
+
    DEFINE_REF_FUNC(Field,field)
 } // namespace xios
Index: /XIOS/dev/dev_olga/src/node/field.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/field.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/field.hpp	(revision 1021)
@@ -16,4 +16,5 @@
 #include "transformation_enum.hpp"
 #include "variable.hpp"
+#include "context_client.hpp"
 
 
@@ -124,4 +125,5 @@
          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);
@@ -139,9 +141,9 @@
         static bool dispatchEvent(CEventServer& event);
         void sendUpdateData(const CArray<double,1>& data);
-        void sendUpdateData(const CArray<double,1>& data, const int srvPool);
+        void sendUpdateData(const CArray<double,1>& data, CContextClient* client);
         static void recvUpdateData(CEventServer& event);
         void recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers);
         void writeField(void);
-        void sendReadDataRequest(void);
+        void sendReadDataRequest(const CDate& tsDataRequested);
         bool sendReadDataRequestIfNeeded(void);
         static void recvReadDataRequest(CEventServer& event);
@@ -169,5 +171,5 @@
         CVariableGroup* addVariableGroup(const string& id = "");
         void sendAddVariable(const string& id = "");
-        void sendAddVariable(const string& id, const int srvPool);
+        void sendAddVariable(const string& id, CContextClient* client);
         void sendAddVariableGroup(const string& id = "");
         static void recvAddVariable(CEventServer& event);
@@ -176,8 +178,10 @@
         void recvAddVariableGroup(CBufferIn& buffer);
         void sendAddAllVariables();
-        void sendAddAllVariables(const int srvPool);
-
+        void sendAddAllVariables(CContextClient* client);
 
         const std::vector<StdString>& getRefDomainAxisIds();
+
+        const string& getExpression(void);
+        bool hasExpression(void) const;
 
       public:
@@ -194,5 +198,6 @@
          bool isEOF;
          CDate lastlast_Write_srv, last_Write_srv, last_operation_srv;
-         CDate lastDataRequestedFromServer;
+         CDate lastDataRequestedFromServer, lastDataReceivedFromServer;
+         bool wasDataAlreadyReceivedFromServer;
 
          map<int,boost::shared_ptr<func::CFunctor> > foperation_srv;
@@ -204,6 +209,9 @@
          bool isReferenceSolved;
          std::vector<StdString> domAxisScalarIds_;
-         bool isReadDataRequestPending;
          bool useCompressedOutput;
+
+         // Two variables to identify the time_counter meta data written in file, which has no time_counter
+         bool hasTimeInstant;
+         bool hasTimeCentered;
 
          DECLARE_REF_FUNC(Field,field)
Index: /XIOS/dev/dev_olga/src/node/field_impl.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/field_impl.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/field_impl.hpp	(revision 1021)
@@ -20,5 +20,5 @@
     if (clientSourceFilter)
       clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);
-    else if (!field_ref.isEmpty() || !content.empty())
+    else if (instantDataFilter)
       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/dev/dev_olga/src/node/file.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/file.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/file.cpp	(revision 1021)
@@ -14,5 +14,4 @@
 #include "type.hpp"
 #include "xios_spl.hpp"
-#include "context_client.hpp"
 #include "mpi.hpp"
 
@@ -376,5 +375,4 @@
          {
            middlePart=filename.substr(pos1,pos2-pos1) ;
-           cout<<pos2<<endl ;
            pos2+=strEndDate.size() ;
            lastPart=filename.substr(pos2,filename.size()-pos2) ;
@@ -746,5 +744,5 @@
      int size = this->enabledFields.size();
      for (int i = 0; i < size; ++i)
-       this->enabledFields[i]->sendReadDataRequest();
+       this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate());
    }
 
@@ -822,4 +820,14 @@
    {
      return vVariableGroup->createChildGroup(id);
+   }
+
+   void CFile::setContextClient(CContextClient* newContextClient)
+   {
+     client = newContextClient;
+   }
+
+   CContextClient* CFile::getContextClient()
+   {
+     return client;
    }
 
@@ -853,7 +861,7 @@
    }
 
-   void CFile::sendAddField(const string& id, const int srvPool)
-   {
-      sendAddItem(id, EVENT_ID_ADD_FIELD, srvPool);
+   void CFile::sendAddField(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, EVENT_ID_ADD_FIELD, client);
     // CContext* context = CContext::getCurrent();
 
@@ -974,5 +982,5 @@
    }
 
-   void CFile::sendAddAllVariables(const int srvPool)
+   void CFile::sendAddAllVariables(CContextClient* client)
    {
      std::vector<CVariable*> allVar = getAllVariables();
@@ -982,7 +990,7 @@
      for (; it != itE; ++it)
      {
-       this->sendAddVariable((*it)->getId(), srvPool);
-       (*it)->sendAllAttributesToServer(srvPool);
-       (*it)->sendValue(srvPool);
+       this->sendAddVariable((*it)->getId(), client);
+       (*it)->sendAllAttributesToServer(client);
+       (*it)->sendValue(client);
      }
    }
@@ -1046,7 +1054,7 @@
    }
 
-   void CFile::sendAddVariable(const string& id, const int srvPool)
-   {
-      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, srvPool);
+   void CFile::sendAddVariable(const string& id, CContextClient* client)
+   {
+      sendAddItem(id, (int)EVENT_ID_ADD_VARIABLE, client);
     // CContext* context = CContext::getCurrent();
 
@@ -1126,5 +1134,23 @@
    Remark: This function must be called AFTER all active (enabled) files have been created on the server side
    */
-   void CFile::sendEnabledFields()
+//   void CFile::sendEnabledFields()
+//   {
+//     size_t size = this->enabledFields.size();
+//     for (size_t i = 0; i < size; ++i)
+//     {
+//       CField* field = this->enabledFields[i];
+//       this->sendAddField(field->getId());
+//       field->sendAllAttributesToServer();
+//       field->sendAddAllVariables();
+//     }
+//   }
+
+   /*!
+     \brief Sending all active (enabled) fields from client to server.
+   Each field is identified uniquely by its string identity. Not only should we
+   send the id to server but also we need to send ids of reference domain and reference axis.
+   With these two id, it's easier to make reference to grid where all data should be written.
+   Remark: This function must be called AFTER all active (enabled) files have been created on the server side
+   */   void CFile::sendEnabledFields(CContextClient* client)
    {
      size_t size = this->enabledFields.size();
@@ -1132,21 +1158,10 @@
      {
        CField* field = this->enabledFields[i];
-       this->sendAddField(field->getId());
-       field->sendAllAttributesToServer();
-       field->sendAddAllVariables();
+       this->sendAddField(field->getId(), client);
+       field->sendAllAttributesToServer(client);
+       field->sendAddAllVariables(client);
      }
    }
 
-   void CFile::sendEnabledFields(const int srvPool)
-   {
-     size_t size = this->enabledFields.size();
-     for (size_t i = 0; i < size; ++i)
-     {
-       CField* field = this->enabledFields[i];
-       this->sendAddField(field->getId(), srvPool);
-       field->sendAllAttributesToServer(srvPool);
-       field->sendAddAllVariables(srvPool);
-     }
-   }
 
    /*!
Index: /XIOS/dev/dev_olga/src/node/file.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/file.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/file.hpp	(revision 1021)
@@ -11,4 +11,5 @@
 #include "attribute_enum.hpp"
 #include "attribute_enum_impl.hpp"
+#include "context_client.hpp"
 #include "mpi.hpp"
 
@@ -114,15 +115,17 @@
          CVariable* addVariable(const string& id = "");
          CVariableGroup* addVariableGroup(const string& id = "");
+         void setContextClient(CContextClient* newContextClient);
+         CContextClient* getContextClient();
 
          // Send info to server
-         void sendEnabledFields();
-         void sendEnabledFields(const int srvPool);
+//         void sendEnabledFields();
+         void sendEnabledFields(CContextClient* client);
          void sendAddField(const string& id = "");
-         void sendAddField(const string& id, const int srvPool);
+         void sendAddField(const string& id, CContextClient* client);
          void sendAddFieldGroup(const string& id = "");
-         void sendAddAllVariables();
-         void sendAddAllVariables(const int srvPool);
-         void sendAddVariable(const string& id = "");
-         void sendAddVariable(const string& id, const int srvPool);
+         void sendAddAllVariables();                        // to be removed (?)
+         void sendAddAllVariables(CContextClient* client);
+         void sendAddVariable(const string& id = "");         // to be removed (?)
+         void sendAddVariable(const string& id, CContextClient* client);
          void sendAddVariableGroup(const string& id = "");
 
@@ -169,4 +172,5 @@
          boost::shared_ptr<CDataInput> data_in;
          std::vector<CField*> enabledFields;
+         CContextClient* client;
 
       public:
Index: /XIOS/dev/dev_olga/src/node/grid.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/grid.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/grid.cpp	(revision 1021)
@@ -299,5 +299,7 @@
          }
 
-         this->isChecked = true;
+//         this->isChecked = true;
+         if (!(this->hasTransform() && !this->isTransformed()))
+          this->isChecked = true;
          return;
        }
@@ -316,5 +318,10 @@
           this->computeIndex();
        }
-       this->isChecked = true;
+//       this->isChecked = true;
+       if (!(this->hasTransform() && !this->isTransformed()))
+        this->isChecked = true;
+
+       if (!(this->hasTransform() && (!this->isGenerated())))
+        this->isChecked = true;
      }
    }
@@ -1094,4 +1101,5 @@
           }
 
+          storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
           listMsg.push_back(CMessage());
           listMsg.back() << getId( )<< isDataDistributed_ << isCompressible_ << listOutIndex.back();
@@ -1102,5 +1110,19 @@
       }
       else
+      {
+        const std::list<int>& ranks = client->getRanksServerNotLeader();
+        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+        {
+          int rank = *itRank;
+          int nb = 1;
+          storeIndex_fromSrv.insert(std::make_pair(rank, CArray<int,1>(nb)));
+          CArray<int, 1>& outLocalIndexToServer = storeIndex_fromSrv[rank];
+          for (int k = 0; k < nb; ++k)
+          {
+            outLocalIndexToServer(k)  = 0;
+          }
+        }
         client->sendEvent(event);
+      }
     }
   }
@@ -1136,9 +1158,9 @@
           }
 
-          //int nbClient = client->clientSize; // This stupid variable signals the servers the number of client connect to them
           const std::list<int>& ranks = client->getRanksServerLeader();
           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
           {
             storeIndex_toSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+            storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
             listOutIndex.push_back(CArray<size_t,1>(outGlobalIndexOnServer));
 
@@ -1151,5 +1173,19 @@
         }
         else
-          client->sendEvent(event);
+        {
+           int indexSize = globalLocalIndexSendToServer.size();
+           CArray<int,1> outLocalIndexToServer(indexSize);
+           for (int idx = 0; itIndex != iteIndex; ++itIndex, ++idx)
+           {
+             outLocalIndexToServer(idx) = itIndex->second;
+           }
+
+           const std::list<int>& ranks = client->getRanksServerNotLeader();
+           for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
+           {
+             storeIndex_fromSrv.insert(std::make_pair(*itRank, CArray<int,1>(outLocalIndexToServer)));
+           }
+           client->sendEvent(event);
+         }
       }
       else
@@ -1177,6 +1213,6 @@
         }
 
-//        for (int ns = 0; ns < connectedServerRank_.size(); ++ns)
-        for (int ns = 0; ns < client->serverSize; ++ns)
+        for (int ns = 0; ns < connectedServerRank_.size(); ++ns)
+//        for (int ns = 0; ns < client->serverSize; ++ns)
         {
           rank = connectedServerRank_[ns];
@@ -1197,4 +1233,5 @@
           }
 
+          storeIndex_fromSrv.insert(make_pair(rank, CArray<int,1>(outLocalIndexToServer)));
           listMsg.push_back(CMessage());
           listMsg.back() << getId() << isDataDistributed_ << isCompressible_ << listOutIndex.back();
Index: /XIOS/dev/dev_olga/src/node/grid.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/grid.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/grid.hpp	(revision 1021)
@@ -221,4 +221,5 @@
 
          map<int, CArray<int, 1> > storeIndex_toSrv;
+         map<int, CArray<int, 1> > storeIndex_fromSrv;
          map<int,int> nbSenders;
 
Index: /XIOS/dev/dev_olga/src/node/interpolate_domain.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/interpolate_domain.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/interpolate_domain.cpp	(revision 1021)
@@ -47,4 +47,46 @@
              << "Please define a correct one") ;
     }
+
+    if (this->mode.isEmpty()) this->mode.setValue(mode_attr::compute);
+    if (this->write_weight.isEmpty()) this->write_weight.setValue(false);
+
+    StdString weightFile;
+    switch (this->mode)
+    {
+      case mode_attr::read:
+        if (this->file.isEmpty())
+        {
+          if (!this->write_weight)
+            ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
+                 << "Read mode is activated but there is no file specified." << std::endl
+                 << "Please define a correct file containing interpolation weights with option 'file'. ");
+        }
+        else
+        {
+          weightFile = this->file;
+          ifstream f(weightFile.c_str());
+          if (!f.good())
+            ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
+                  << "Read mode is activated but file "  << weightFile << " doesn't exist." << std::endl
+                  << "Please check this file ");
+        }
+        break;
+      case mode_attr::compute:
+        break;
+      case mode_attr::read_or_compute:
+        if (!this->file.isEmpty() && !this->write_weight)
+        {
+          weightFile = this->file;
+          ifstream f(weightFile.c_str());
+          if (!f.good())
+            ERROR("void CInterpolateDomain::checkValid(CDomain* domainSrc)",
+                  << "read_or_compute mode is activated but file "  << weightFile << " doesn't exist." << std::endl
+                  << "Please check this file ");
+        }
+        break;
+      default:
+        break;
+    }
+
   }
 
Index: /XIOS/dev/dev_olga/src/node/interpolate_domain.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/interpolate_domain.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/interpolate_domain.hpp	(revision 1021)
@@ -50,5 +50,5 @@
       virtual ~CInterpolateDomain(void);
 
-      virtual void checkValid(CDomain* axisDest);
+      virtual void checkValid(CDomain* domainSource);
 
       /// Accesseurs statiques ///
Index: /XIOS/dev/dev_olga/src/node/variable.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/variable.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/variable.cpp	(revision 1021)
@@ -127,20 +127,18 @@
    }
 
-   void CVariable::sendValue(const int srvPool)
-   {
-     CContext* context=CContext::getCurrent() ;
-     CContextClient* contextClientTmp = context->clientPrimServer[srvPool];
+   void CVariable::sendValue(CContextClient* client)
+   {
      CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ;
-     if (contextClientTmp->isServerLeader())
+     if (client->isServerLeader())
      {
        CMessage msg ;
        msg<<this->getId() ;
        msg<<content ;
-       const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+       const std::list<int>& ranks = client->getRanksServerLeader();
        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
          event.push(*itRank,1,msg);
-       contextClientTmp->sendEvent(event) ;
+       client->sendEvent(event) ;
      }
-     else contextClientTmp->sendEvent(event) ;
+     else client->sendEvent(event) ;
    }
 
Index: /XIOS/dev/dev_olga/src/node/variable.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/node/variable.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/node/variable.hpp	(revision 1021)
@@ -79,5 +79,5 @@
             //! Sending a request to set up variable data
             void sendValue();
-            void sendValue(const int srvPool);
+            void sendValue(CContextClient* client);
 
             static void recvValue(CEventServer& event) ;
Index: /XIOS/dev/dev_olga/src/object_template.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/object_template.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/object_template.hpp	(revision 1021)
@@ -9,4 +9,5 @@
 #include "event_server.hpp"
 #include "attribute.hpp"
+#include "context_client.hpp"
 
 namespace xios
@@ -56,11 +57,11 @@
          std::map<int, size_t> getMinimumBufferSizeForAttributes();
          void sendAttributToServer(const string& id);
-         void sendAttributToServer(const string& id, const int srvPool);
+         void sendAttributToServer(const string& id, CContextClient* client);
          void sendAttributToServer(CAttribute& attr) ;
-         void sendAttributToServer(CAttribute& attr, const int srvPool) ;
+         void sendAttributToServer(CAttribute& attr, CContextClient* client) ;
          void sendAllAttributesToServer();
-         void sendAllAttributesToServer(const int srvPool);
+         void sendAllAttributesToServer(CContextClient* client);
          void sendAddItem(const string& id, int itemType);
-         void sendAddItem(const string& id, int itemType, const int srvPool);
+         void sendAddItem(const string& id, int itemType, CContextClient* client);
          static void recvAttributFromClient(CEventServer& event) ;
          static bool dispatchEvent(CEventServer& event) ;
Index: /XIOS/dev/dev_olga/src/object_template_impl.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/object_template_impl.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/object_template_impl.hpp	(revision 1021)
@@ -164,9 +164,6 @@
    std::map<int, size_t> CObjectTemplate<T>::getMinimumBufferSizeForAttributes()
    {
-     // CContextClient* client = CContext::getCurrent()->client;
+     // Use correct context client to send message
      CContext* context = CContext::getCurrent();
-
-          // Use correct context client to send message
-//     CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
      int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
      for (int i = 0; i < nbSrvPools; ++i)
@@ -244,5 +241,5 @@
 
    template<typename T>
-   void CObjectTemplate<T>::sendAllAttributesToServer(const int srvPool)
+   void CObjectTemplate<T>::sendAllAttributesToServer(CContextClient* client)
    {
      CAttributeMap& attrMap = *this;
@@ -250,5 +247,5 @@
      for (; it != itE; ++it)
      {
-       if (!(it->second)->isEmpty()) sendAttributToServer(*(it->second), srvPool);
+       if (!(it->second)->isEmpty()) sendAttributToServer(*(it->second), client);
      }
    }
@@ -263,9 +260,9 @@
 
    template <class T>
-   void CObjectTemplate<T>::sendAttributToServer(const string& id, const int srvPool)
+   void CObjectTemplate<T>::sendAttributToServer(const string& id, CContextClient* client)
    {
       CAttributeMap & attrMap = *this;
       CAttribute* attr=attrMap[id];
-      sendAttributToServer(*attr, srvPool);
+      sendAttributToServer(*attr, client);
    }
 
@@ -273,8 +270,6 @@
   void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr)
   {
+     // Use correct context client to send message
     CContext* context=CContext::getCurrent();
-
-     // Use correct context client to send message
-//    CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
     if (context->hasClient)
     {
@@ -283,18 +278,9 @@
       {
         CContextClient* contextClientTmp = (context->hasServer) ? context->clientPrimServer[i] : context->client;
-        // CContextClient* contextClientTmp=context->contextClientTmp;
-
         CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE);
         if (contextClientTmp->isServerLeader())
         {
           CMessage msg;
-//          if (context->hasServer)
-//          {
-//            StdString tmp = this->getIdServer() + "_" +boost::lexical_cast<string>(i);
-//            msg<<tmp;
-//          }
-//          else
-            msg<<this->getIdServer();
-
+          msg<<this->getIdServer();
           msg << attr.getName();
           msg << attr;
@@ -331,10 +317,8 @@
 
   template <class T>
-  void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr, const int srvPool)
+  void CObjectTemplate<T>::sendAttributToServer(CAttribute& attr, CContextClient* client)
   {
-    CContext* context=CContext::getCurrent();
-    CContextClient* contextClientTmp = context->clientPrimServer[srvPool];
     CEventClient event(getType(),EVENT_ID_SEND_ATTRIBUTE);
-    if (contextClientTmp->isServerLeader())
+    if (client->isServerLeader())
     {
       CMessage msg;
@@ -342,12 +326,11 @@
       msg << attr.getName();
       msg << attr;
-      const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+      const std::list<int>& ranks = client->getRanksServerLeader();
       for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
         event.push(*itRank,1,msg);
-      contextClientTmp->sendEvent(event);
+      client->sendEvent(event);
     }
-    else contextClientTmp->sendEvent(event);
+    else client->sendEvent(event);
   }
-
 
   /*!
@@ -364,6 +347,5 @@
     if (context->hasClient)
     {
-       // Use correct context client to send message
-//      CContextClient* contextClientTmp = (0 != context->clientPrimServer) ? context->clientPrimServer : context->client;
+      // Use correct context client to send message
       int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;
       for (int i = 0; i < nbSrvPools; ++i)
@@ -387,22 +369,21 @@
 
   template<class T>
-  void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType, const int srvPool)
+  void CObjectTemplate<T>::sendAddItem(const StdString& id, int itemType, CContextClient* client)
   {
-    CContext* context = CContext::getCurrent();
     typedef typename T::EEventId ItemType;
-     CContextClient* contextClientTmp = context->clientPrimServer[srvPool];
      CEventClient event(this->getType(),ItemType(itemType));
-     if (contextClientTmp->isServerLeader())
+     if (client->isServerLeader())
      {
        CMessage msg;
        msg << this->getId();
        msg << id;
-       const std::list<int>& ranks = contextClientTmp->getRanksServerLeader();
+       const std::list<int>& ranks = client->getRanksServerLeader();
        for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)
          event.push(*itRank,1,msg);
-       contextClientTmp->sendEvent(event);
+       client->sendEvent(event);
      }
-     else contextClientTmp->sendEvent(event);
+     else client->sendEvent(event);
   }
+
 
   template <class T>
Index: /XIOS/dev/dev_olga/src/server.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/server.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/server.cpp	(revision 1021)
@@ -22,9 +22,10 @@
     list<MPI_Comm> CServer::interComm ;
     std::list<MPI_Comm> CServer::contextInterComms;
-    int CServer::nbSndSrvPools = (CXios::serverLevel == 0) ? 0 : 1;
-    int CServer::poolNb = 0;
+    int CServer::serverLevel = 0 ;
+    int CServer::nbPools = 0;
+    int CServer::poolId = 0;
+    int CServer::serverSize = 0;
     bool CServer::isRoot = false ;
     int CServer::rank = INVALID_RANK;
-    int CServer::rankSndServers = 0;
     StdOFStream CServer::m_infoStream;
     StdOFStream CServer::m_errorStream;
@@ -37,5 +38,5 @@
 /*!
  * \fn void CServer::initialize(void)
- * Function creates intra and inter comm for each initialized server pool
+ * Creates intraComm and interComm for a server pool (primary or secondary).
  */
     void CServer::initialize(void)
@@ -46,5 +47,4 @@
       else is_MPI_Initialized=false ;
 
-
       // Not using OASIS
       if (!CXios::usingOasis)
@@ -58,10 +58,11 @@
 
         boost::hash<string> hashString ;
-        unsigned long hashServer1 = hashString(CXios::xiosCodeIdPrm);
-        unsigned long hashServer2 = hashString(CXios::xiosCodeIdSnd);
-        unsigned long hashServer = (CXios::serverLevel < 2)  ? hashServer1 : hashServer2;
+//        unsigned long hashServer1 = hashString(CXios::xiosCodeIdPrm);
+//        unsigned long hashServer2 = hashString(CXios::xiosCodeIdSnd);
+//        unsigned long hashServer = (CXios::serverLevel < 2)  ? hashServer1 : hashServer2;
+        unsigned long hashServer = hashString(CXios::xiosCodeId);
 
         unsigned long* hashAll ;
-        unsigned long* hashAllServers ;
+//        unsigned long* hashAllServers ;
 
 //        int rank ;
@@ -69,5 +70,5 @@
         int myColor ;
         int i,c ;
-        MPI_Comm newComm, serversInterComm;
+        MPI_Comm newComm, serversComm;
 
         MPI_Comm_size(CXios::globalComm, &size) ;
@@ -77,9 +78,7 @@
         MPI_Allgather(&hashServer, 1, MPI_LONG, hashAll, 1, MPI_LONG, CXios::globalComm) ;
 
-        map<unsigned long, int> colors, colorsServers ;
+        map<unsigned long, int> colors ;
         map<unsigned long, int> leaders ;
         map<unsigned long, int>::iterator it ;
-//        map<unsigned long, int> leadersServers ;
-        vector<int> leadersServers;
 
         for(i=0,c=0;i<size;i++)
@@ -93,75 +92,26 @@
         }
 
-        nbSndSrvPools = size - leaders[hashServer2];    // one proc per secondary-server pool
-
-        // Taking into account multiple pools on secondary server
-        if (nbSndSrvPools > 1)
-        {
-          if (CXios::serverLevel > 1)
+        // Setting the number of secondary pools
+        myColor = colors[hashServer];
+        if (CXios::usingServer2)
+        {
+          int serverRank = rank - leaders[hashServer]; // server proc rank starting 0
+          serverSize = size - leaders[hashServer];
+          nbPools = serverSize * CXios::ratioServer2 / 100;
+          if ( serverRank < (serverSize - nbPools) )
           {
-            int nbProcs = size - leaders[hashServer2];
-            int remain = nbProcs % nbSndSrvPools;
-            int procsPerPool = nbProcs / nbSndSrvPools;
-            rankSndServers = rank - leaders[hashServer2];
-            StdString strTmp = CXios::xiosCodeIdSnd;
-
-            if (remain == 0)
-            {
-              poolNb = rankSndServers/procsPerPool;
-            }
-            else
-            {
-              if (rankSndServers <= (procsPerPool + 1) * remain)
-                poolNb = rankSndServers/(procsPerPool+1);
-              else
-              {
-                poolNb = remain + 1;
-                rankSndServers -= (procsPerPool + 1) * remain;
-                rankSndServers -= procsPerPool;
-                poolNb += rankSndServers/procsPerPool;
-              }
-            }
-            strTmp += boost::lexical_cast<string>(poolNb+1);  // add 1 to avoid hashing zero
-            hashServer = hashString(strTmp);
-            hashServer2 = hashString(strTmp);
+            serverLevel = 1;
+          }
+          else
+          {
+            serverLevel = 2;
+            poolId = serverRank - serverSize + nbPools;
+            myColor = rank;
           }
         }
 
-        if (nbSndSrvPools > 1)
-        {
-          myColor = size;
-          MPI_Comm_split(MPI_COMM_WORLD, myColor, rank, &serversInterComm) ;
-        }
-        else
-        {
-          myColor=colors[hashServer] ;
-          MPI_Comm_split(MPI_COMM_WORLD, myColor, rank, &intraComm) ;
-        }
-
-        if (nbSndSrvPools > 1)
-        {
-          int sizeServers;
-//          int rankServers;
-//          MPI_Comm_rank(serversInterComm, &rankServers) ;
-          MPI_Comm_size(serversInterComm, &sizeServers) ;
-          hashAllServers=new unsigned long[sizeServers] ;
-          MPI_Allgather(&hashServer, 1, MPI_LONG, hashAllServers, 1, MPI_LONG, serversInterComm) ;
-
-          for(i=0, c=0; i<sizeServers; i++)
-          {
-            if (colorsServers.find(hashAllServers[i])==colorsServers.end())
-            {
-              colorsServers[hashAllServers[i]]=c ;
-//              leadersServers[hashAllServers[i]]= leaders[hashServer1] + i ;
-              leadersServers.push_back( leaders[hashServer1] + i );
-              c++ ;
-            }
-          }
-          myColor=colorsServers[hashServer] ;
-          MPI_Comm_split(serversInterComm, myColor, rank, &intraComm) ;
-        }
-
-
-        if (CXios::serverLevel == 0)
+        MPI_Comm_split(CXios::globalComm, myColor, rank, &intraComm) ;
+
+        if (serverLevel == 0)
         {
           int clientLeader;
@@ -183,114 +133,49 @@
           }
         }
-        else
-        {
-          if ((CXios::serverLevel == 1))
+        else if (serverLevel == 1)
+        {
+          int clientLeader, srvPrmLeader, srvSndLeader;
+          for (it=leaders.begin();it!=leaders.end();it++)
           {
-            // Creating interComm with client (interCommLeft)
-            int clientLeader;
-            int srvSndLeader;
-            for(it=leaders.begin();it!=leaders.end();it++)
+            if (it->first != hashServer)
             {
-              if (it->first != hashServer2)
-              {
-                if (it->first != hashServer1)
-                {
-                  clientLeader=it->second ;
-                  int intraCommSize, intraCommRank ;
-                  MPI_Comm_size(intraComm, &intraCommSize) ;
-                  MPI_Comm_rank(intraComm, &intraCommRank) ;
-                  info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize
-                           <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
-                  MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ;
-                  interCommLeft.push_back(newComm) ;
-                  interComm.push_back(newComm) ;
-                }
-              }
-              else
-              {
-                srvSndLeader = it->second;
-              }
-            }
-
-            // Creating interComm with secondary server pool(s) (interCommRight)
-//            if (nbSndSrvPools < 1)
-            if (nbSndSrvPools < 2)
-            {
-              CClient::initializeClientOnServer(rank, intraComm, srvSndLeader);
-              interCommRight.push_back(CClient::getInterComm());
-              interComm.push_back(CClient::getInterComm());
+              clientLeader=it->second ;
+              int intraCommSize, intraCommRank ;
+              MPI_Comm_size(intraComm, &intraCommSize) ;
+              MPI_Comm_rank(intraComm, &intraCommRank) ;
+              info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize
+                       <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
+              MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ;
+              interCommLeft.push_back(newComm) ;
+              interComm.push_back(newComm) ;
             }
             else
-            {
-//              for(it=leadersServers.begin();it!=leadersServers.end();it++)
-//              {
-//                if (it->first != hashServer)
-//                {
-//                  srvSndLeader = it->second;
-//                  CClient::initializeClientOnServer(rank, intraComm, srvSndLeader);
-//                  interCommRight.push_back(CClient::getInterComm());
-//                  interComm.push_back(CClient::getInterComm());
-//                }
-//              }
-
-              for(int i = 1; i < leadersServers.size(); ++i)
-              {
-                srvSndLeader = leadersServers[i];
-                CClient::initializeClientOnServer(rank, intraComm, srvSndLeader);
-                interCommRight.push_back(CClient::getInterComm());
-                interComm.push_back(CClient::getInterComm());
-              }
-            }
-          } // primary server
-
-          else // secondary server pool(s)
+              srvPrmLeader = it->second;
+          }
+
+          for (int i = 0; i < nbPools; ++i)
           {
-            int clientLeader;
-            if (nbSndSrvPools < 2)
-//            if (nbSndSrvPools < 1)
-            {
-              for(it=leaders.begin();it!=leaders.end();it++)
-              {
-                if (it->first == hashServer1)
-                {
-                  clientLeader=it->second ;
-                  int intraCommSize, intraCommRank ;
-                  MPI_Comm_size(intraComm, &intraCommSize) ;
-                  MPI_Comm_rank(intraComm, &intraCommRank) ;
-                  info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize
-                           <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
-
-                  MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ;
-                  interCommLeft.push_back(newComm) ;
-                  interComm.push_back(newComm) ;
-
-                  break;
-                }
-              }
-            }
-            else
-            {
-//              for(it=leadersServers.begin();it!=leadersServers.end();it++)
-              {
- //               if (it->first == hashServer1)
-                {
-//                  clientLeader=it->second ;
-                  clientLeader = leadersServers[0];
-                  int intraCommSize, intraCommRank ;
-                  MPI_Comm_size(intraComm, &intraCommSize) ;
-                  MPI_Comm_rank(intraComm, &intraCommRank) ;
-                  info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize
-                           <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
-
-                  MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ;
-                  interCommLeft.push_back(newComm) ;
-                  interComm.push_back(newComm) ;
-                }
-              }
-            }
-          } // secondary server
-        } // CXios::serverLevel != 0
-
-        if (nbSndSrvPools > 1) delete [] hashAllServers;
+            srvSndLeader = srvPrmLeader + serverSize - nbPools + i;
+//            CClient::initializeClientOnServer(rank, serversComm, srvSndLeader);
+            CClient::initializeClientOnServer(rank, intraComm, srvSndLeader);
+            interCommRight.push_back(CClient::getInterComm());
+            interComm.push_back(CClient::getInterComm());
+          }
+        } // primary server
+        else
+        {
+          int clientLeader;
+          clientLeader = leaders[hashString(CXios::xiosCodeId)];
+          int intraCommSize, intraCommRank ;
+          MPI_Comm_size(intraComm, &intraCommSize) ;
+          MPI_Comm_rank(intraComm, &intraCommRank) ;
+          info(50)<<"intercommCreate::server "<<rank<<" intraCommSize : "<<intraCommSize
+                   <<" intraCommRank :"<<intraCommRank<<"  clientLeader "<< clientLeader<<endl ;
+
+          MPI_Intercomm_create(intraComm, 0, CXios::globalComm, clientLeader, 0, &newComm) ;
+          interCommLeft.push_back(newComm) ;
+          interComm.push_back(newComm) ;
+        } // secondary server
+
         delete [] hashAll ;
 
@@ -416,5 +301,4 @@
              {
                MPI_Send(&msg,1,MPI_INT,0,0,*itr) ;
-
 //               MPI_Comm_free(&(*itr));
 //               interCommRight.erase(itr) ;
@@ -612,8 +496,8 @@
        contextInterComms.push_back(contextInterComm);
 
-       if (CXios::serverLevel == 1)
+       if (serverLevel == 1)
        {
 //         CClient::registerContext(contextId, intraComm);
-         CClient::registerContextOnSrvPools(contextId, intraComm);
+         CClient::registerContextByClienOfServer(contextId, intraComm);
        }
 
@@ -657,5 +541,5 @@
       int numDigit = 0;
       int size = 0;
-      int mpiRank;
+      int id;
       MPI_Comm_size(CXios::globalComm, &size);
       while (size)
@@ -665,9 +549,14 @@
       }
 
-      if (nbSndSrvPools < 2)
-        mpiRank = getRank();
+      if (!CXios::usingServer2)
+        id = getRank();
       else
-        mpiRank = rankSndServers;
-      fileNameClient << fileName << "_" << std::setfill('0') << std::setw(numDigit) << mpiRank << ext;
+      {
+        if (serverLevel == 1)
+          id = getRank();
+        else
+          id = poolId;
+      }
+      fileNameClient << fileName << "_" << std::setfill('0') << std::setw(numDigit) << id << ext;
       fb->open(fileNameClient.str().c_str(), std::ios::out);
       if (!fb->is_open())
Index: /XIOS/dev/dev_olga/src/server.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/server.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/server.hpp	(revision 1021)
@@ -33,6 +33,8 @@
         static CEventScheduler* eventScheduler;
 
-        static int nbSndSrvPools;   // number of secondary server pools
-        static int poolNb;          // for secondary servers; stores the pool number
+        static int serverLevel ;
+
+//        static int nbSndSrvPools;   // number of secondary server pools
+//        static int poolNb;          // for secondary servers; stores the pool number
 
         struct contextMessage
@@ -68,5 +70,7 @@
       private:
         static int rank;
-        static int rankSndServers;
+        static int serverSize;  //!< Number of procs dedicated to server
+        static int nbPools;     //!< Number of secondary-server pools
+        static int poolId;      //!< ID of a secondary-server pool
         static StdOFStream m_infoStream;
         static StdOFStream m_errorStream;
Index: /XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.cpp
===================================================================
--- /XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.cpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.cpp	(revision 1021)
@@ -48,7 +48,40 @@
 
 CDomainAlgorithmInterpolate::CDomainAlgorithmInterpolate(CDomain* domainDestination, CDomain* domainSource, CInterpolateDomain* interpDomain)
-: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain)
-{
+: CDomainAlgorithmTransformation(domainDestination, domainSource), interpDomain_(interpDomain), writeToFile_(false), readFromFile_(false)
+{
+  CContext* context = CContext::getCurrent();
   interpDomain_->checkValid(domainSource);
+  fileToReadWrite_ = "xios_interpolation_weights_";
+
+  if (interpDomain_->weight_filename.isEmpty())
+  {
+    fileToReadWrite_ += context->getId() + "_" + 
+                    domainSource->getDomainOutputName() + "_" + 
+                    domainDestination->getDomainOutputName() + ".nc";    
+  }
+  else 
+    fileToReadWrite_ = interpDomain_->weight_filename;
+
+  ifstream f(fileToReadWrite_.c_str());  
+  switch (interpDomain_->mode)
+  {
+    case CInterpolateDomain::mode_attr::read:
+      readFromFile_ = true;      
+      break;
+    case CInterpolateDomain::mode_attr::compute:
+      readFromFile_ = false;
+      break;
+    case CInterpolateDomain::mode_attr::read_or_compute:      
+      if (!f.good())
+        readFromFile_ = false;
+      else
+        readFromFile_ = true;
+      break;
+    default:
+      break;
+  } 
+
+  writeToFile_ = interpDomain_->write_weight;  
+    
 }
 
@@ -351,4 +384,6 @@
   }
 
+  if (writeToFile_ && !readFromFile_)
+     writeRemapInfo(interpMapValue);
   exchangeRemapInfo(interpMapValue);
 
@@ -434,19 +469,21 @@
 void CDomainAlgorithmInterpolate::computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs)
 {
-  if (!interpDomain_->file.isEmpty())
+  if (readFromFile_ && !writeToFile_)  
     readRemapInfo();
   else
-    computeRemap();
+  {
+    computeRemap(); 
+  }
+}
+
+void CDomainAlgorithmInterpolate::writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
+{  
+  writeInterpolationInfo(fileToReadWrite_, interpMapValue);
 }
 
 void CDomainAlgorithmInterpolate::readRemapInfo()
-{
-  CContext* context = CContext::getCurrent();
-  CContextClient* client=context->client;
-  int clientRank = client->clientRank;
-
-  std::string filename = interpDomain_->file.getValue();
+{  
   std::map<int,std::vector<std::pair<int,double> > > interpMapValue;
-  readInterpolationInfo(filename, interpMapValue);
+  readInterpolationInfo(fileToReadWrite_, interpMapValue);
 
   exchangeRemapInfo(interpMapValue);
@@ -637,4 +674,107 @@
   delete [] recvBuff;
 }
+ 
+/*! Redefined some functions of CONetCDF4 to make use of them */
+CDomainAlgorithmInterpolate::WriteNetCdf::WriteNetCdf(const StdString& filename, const MPI_Comm comm)
+  : CNc4DataOutput(filename, false, false, true, comm, false, true) {}
+int CDomainAlgorithmInterpolate::WriteNetCdf::addDimensionWrite(const StdString& name, 
+                                                                const StdSize size)
+{
+  CONetCDF4::addDimension(name, size);  
+}
+
+int CDomainAlgorithmInterpolate::WriteNetCdf::addVariableWrite(const StdString& name, nc_type type,
+                                                               const std::vector<StdString>& dim)
+{
+  CONetCDF4::addVariable(name, type, dim);
+}
+
+void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<int,1>& data, const StdString& name,
+                                                              bool collective, StdSize record,
+                                                              const std::vector<StdSize>* start,
+                                                              const std::vector<StdSize>* count)
+{
+  CONetCDF4::writeData<int,1>(data, name, collective, record, start, count);
+}
+
+void CDomainAlgorithmInterpolate::WriteNetCdf::writeDataIndex(const CArray<double,1>& data, const StdString& name,
+                                                              bool collective, StdSize record,
+                                                              const std::vector<StdSize>* start,
+                                                              const std::vector<StdSize>* count)
+{
+  CONetCDF4::writeData<double,1>(data, name, collective, record, start, count);
+}
+
+/*
+   Write interpolation weights into a file
+   \param [in] filename name of output file
+   \param interpMapValue mapping of global index of domain destination and domain source as well as the corresponding weight
+*/
+void CDomainAlgorithmInterpolate::writeInterpolationInfo(std::string& filename,
+                                                         std::map<int,std::vector<std::pair<int,double> > >& interpMapValue)
+{
+  CContext* context = CContext::getCurrent();
+  CContextClient* client=context->client;
+
+  size_t n_src = domainSrc_->ni_glo * domainSrc_->nj_glo;
+  size_t n_dst = domainDest_->ni_glo * domainDest_->nj_glo;
+
+  long localNbWeight = 0;
+  long globalNbWeight;
+  long startIndex;
+  typedef std::map<int,std::vector<std::pair<int,double> > > IndexRemap;
+  IndexRemap::iterator itb = interpMapValue.begin(), it,
+                       ite = interpMapValue.end();
+  for (it = itb; it!=ite; ++it)
+  {
+    localNbWeight += (it->second).size();
+  }
+
+  CArray<int,1> src_idx(localNbWeight);
+  CArray<int,1> dst_idx(localNbWeight);
+  CArray<double,1> weights(localNbWeight);
+
+  int index = 0;
+  for (it = itb; it !=ite; ++it)
+  {
+    std::vector<std::pair<int,double> >& tmp = it->second;
+    for (int idx = 0; idx < tmp.size(); ++idx)
+    {
+      dst_idx(index) = it->first + 1;
+      src_idx(index) = tmp[idx].first + 1;
+      weights(index) = tmp[idx].second;
+      ++index;
+    }    
+  }
+
+  MPI_Allreduce(&localNbWeight, &globalNbWeight, 1, MPI_LONG, MPI_SUM, client->intraComm);
+  MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm);
+  
+  std::vector<StdSize> start(1, startIndex - localNbWeight);
+  std::vector<StdSize> count(1, localNbWeight);
+
+  WriteNetCdf netCdfWriter(filename, client->intraComm);
+
+  // netCdfWriter = CONetCDF4(filename, false, false, true, client->intraComm, false);
+
+  // Define some dimensions
+  netCdfWriter.addDimensionWrite("n_src", n_src);
+  netCdfWriter.addDimensionWrite("n_dst", n_dst);
+  netCdfWriter.addDimensionWrite("n_weight", globalNbWeight);
+  
+  std::vector<StdString> dims(1,"n_weight");
+
+  // Add some variables
+  netCdfWriter.addVariableWrite("src_idx", NC_INT, dims);
+  netCdfWriter.addVariableWrite("dst_idx", NC_INT, dims);
+  netCdfWriter.addVariableWrite("weight", NC_DOUBLE, dims);
+
+  // // Write variables
+  netCdfWriter.writeDataIndex(src_idx, "src_idx", true, 0, &start, &count);
+  netCdfWriter.writeDataIndex(dst_idx, "dst_idx", true, 0, &start, &count);
+  netCdfWriter.writeDataIndex(weights, "weight", true, 0, &start, &count);
+
+  netCdfWriter.closeFile();
+}
 
 /*!
Index: /XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.hpp
===================================================================
--- /XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.hpp	(revision 1020)
+++ /XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.hpp	(revision 1021)
@@ -12,4 +12,5 @@
 #include "domain_algorithm_transformation.hpp"
 #include "transformation.hpp"
+#include "nc4_data_output.hpp"
 
 namespace xios {
@@ -17,4 +18,5 @@
 class CDomain;
 class CInterpolateDomain;
+
 
 /*!
@@ -35,11 +37,36 @@
 private:
   void readInterpolationInfo(std::string& filename, std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
+  void writeInterpolationInfo(std::string& filename, std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
   void processPole(std::map<int,std::vector<std::pair<int,double> > >& interMapValuePole,
                    int nbGlobalPointOnPole);
   void computeRemap();
   void readRemapInfo();
+  void writeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >&);
   void exchangeRemapInfo(std::map<int,std::vector<std::pair<int,double> > >& interpMapValue);
+
 private:
   CInterpolateDomain* interpDomain_;
+  bool writeToFile_;
+  bool readFromFile_;
+  StdString fileToReadWrite_;
+
+  // class WriteNetCdf;
+  class WriteNetCdf : public CNc4DataOutput
+  {
+  public:
+    WriteNetCdf(const StdString& filename, const MPI_Comm comm);
+    int addDimensionWrite(const StdString& name, const StdSize size = UNLIMITED_DIM);
+    int addVariableWrite(const StdString& name, nc_type type,
+                         const std::vector<StdString>& dim);
+    void writeDataIndex(const CArray<int,1>& data, const StdString& name,
+                        bool collective, StdSize record,
+                        const std::vector<StdSize>* start = NULL,
+                        const std::vector<StdSize>* count = NULL);
+    void writeDataIndex(const CArray<double,1>& data, const StdString& name,
+                        bool collective, StdSize record,
+                        const std::vector<StdSize>* start = NULL,
+                        const std::vector<StdSize>* count = NULL);
+  };
+
 
 private:
