Index: XMLIO_V2/dev/dev_rv/Makefile.wk
===================================================================
--- XMLIO_V2/dev/dev_rv/Makefile.wk	(revision 263)
+++ XMLIO_V2/dev/dev_rv/Makefile.wk	(revision 264)
@@ -411,5 +411,5 @@
 ifeq ($(VERSION), 4)
 	ELEMS_CPP = object exception xml_node xml_parser inetcdf4 inetcdf4_adv onetcdf4  mpi_interface\
-	attribute attribute_template attribute_map buffer
+	attribute attribute_template attribute_map buffer circular_buffer
                
 endif
Index: XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.hpp	(revision 263)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.hpp	(revision 264)
@@ -16,5 +16,4 @@
 #include <netcdf_par.h>
 }
->>>>>>> .r256
 
 
Index: XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/buffer.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/buffer.hpp	(revision 263)
+++ XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/buffer.hpp	(revision 264)
@@ -113,5 +113,4 @@
          //--------------------------------------------------------------
 
-            /// Mutateurs ///
             void setChar  (char     value, std::size_t position) ;
             void setBool  (bool     value, std::size_t position) ;
Index: XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/circular_buffer.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/circular_buffer.cpp	(revision 264)
+++ XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/circular_buffer.cpp	(revision 264)
@@ -0,0 +1,281 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+ 
+#ifndef __XIOS_NO_EXTERN
+
+// C++ standard headers
+#include <fstream>
+
+#endif // __XIOS_NO_EXTERN
+
+// XMLIOServer headers
+#include "circular_buffer.hpp" 
+#include "buffer_impl.hpp" 
+
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
+
+namespace xmlioserver {
+namespace comm {
+  
+   // ------------------------------ Constructeurs -----------------------------
+   
+   CCircularBuffer::CCircularBuffer(std::size_t _size)
+      : SuperClass(_size)
+      , p_write(0), p_read(0), p_unused(0)
+      , p_wait(0), locked_data(0)
+      , nbrequest(0)
+   { /* Ne rien faire de plus */ }
+
+   CCircularBuffer::CCircularBuffer(const CCircularBuffer & _cbuffer_ref)
+      : SuperClass(_cbuffer_ref)
+      , p_write(_cbuffer_ref.p_write), p_read(_cbuffer_ref.p_read), p_unused(_cbuffer_ref.p_unused)
+      , p_wait(_cbuffer_ref.p_wait), locked_data(_cbuffer_ref.locked_data)
+      , nbrequest(_cbuffer_ref.nbrequest)
+   { /* Ne rien faire de plus */ }
+   
+   CCircularBuffer::CCircularBuffer(const CCircularBuffer * const _cbuffer_ptr)
+      : SuperClass(_cbuffer_ptr)
+      , p_write(_cbuffer_ptr->p_write), p_read(_cbuffer_ptr->p_read), p_unused(_cbuffer_ptr->p_unused)
+      , p_wait(_cbuffer_ptr->p_wait), locked_data(_cbuffer_ptr->locked_data)
+      , nbrequest(_cbuffer_ptr->nbrequest)
+   { /* Ne rien faire de plus */ }
+   
+   // ------------------------------- Destructeur ------------------------------
+   
+   CCircularBuffer::~CCircularBuffer(void)
+   { /* Ne rien faire de plus */ }
+   
+   // ------------------------------ Remise Ã  zÃ©ro -----------------------------
+   
+   void CCircularBuffer::clear(void)
+   {
+      this-> p_write     = 0;
+      this-> p_read      = 0;
+      this-> p_unused    = 0;
+      this-> p_wait      = 0;
+      this-> locked_data = 0;
+      this-> nbrequest   = 0;
+   }
+
+   // ------------------------------- Accesseurs -------------------------------
+
+   std::size_t CCircularBuffer::getNextRequestSize(void) const
+   {
+      if (!this->hasRequest())
+         XIOS_ERROR("CCircularBuffer::getNextRequestSize()",
+                     << " invalid call !");
+      long int nbargs  = 0;
+      std::size_t startpos = this-> p_read;
+      std::size_t currsize = 2 * SuperClass::getRequestedSize(nbargs);
+      nbargs    = SuperClass::getInt(startpos + currsize);
+      currsize += SuperClass::getRequestedSize(nbargs);
+      
+      for (long int i = 0; i < nbargs; i++)
+      {
+         CBufferData bufdata;
+         SuperClass::getBufferData(bufdata, startpos + currsize);
+         currsize += (bufdata.size + DATA_HEADER_SIZE);
+      }
+      return (currsize);
+   }
+        
+   CLinearBuffer CCircularBuffer::getNextRequest(void)
+   {
+      std::size_t startpos = this-> p_read;
+      std::size_t currsize = this->getNextRequestSize();
+     
+      this->movePRead(currsize);
+      this->nbrequest--;
+      //std::cout <<  this->nbrequest << std::endl;
+     
+      return (CLinearBuffer(SuperClass::getData(startpos), currsize));
+   }
+   
+   // ------------------------------- Mutateurs --------------------------------
+   
+   void CCircularBuffer::appendRequest(const CLinearBuffer & _brequest)
+   {
+      std::size_t usedsize   = _brequest.getUsedSize();
+      if (!this->isAvailable(usedsize))
+         XIOS_ERROR("CCircularBuffer::appendRequest(brequest)",
+               << " invalid call !");
+      std::size_t data_begin = this->prepareNextDataPosition(usedsize);
+      SuperClass::setData(_brequest.getData(), usedsize, data_begin);
+      this->updateNbRequests(data_begin, data_begin + usedsize);
+   }
+
+   char * CCircularBuffer::prepareNextData(std::size_t data_size)
+   {
+      return (SuperClass::getData(this->prepareNextDataPosition(data_size)));
+   }
+   
+   std::size_t CCircularBuffer::prepareNextDataPosition(std::size_t data_size)
+   {
+      this->p_wait = this-> p_write;    
+      this->locked_data = data_size;   
+      if (!this->isAvailable(data_size))
+         XIOS_ERROR("CCircularBuffer::prepareNextDataPosition(data_size)",
+               << " invalid call !");
+      if ((this->p_write + this->locked_data) > SuperClass::getSize())
+           this->p_wait = 0;
+
+      this->movePWrite(this->locked_data);
+      return (this->p_wait);
+   }
+   
+   // ------------------ DÃ©placements de pointeurs internes -------------------
+   
+   void CCircularBuffer::movePRead(std::size_t data_size)
+   {
+      this-> p_read += data_size;
+      if ((this-> p_read == this-> p_unused) &&
+          (this-> p_read == this-> p_write))
+      {
+         this->clear();
+         return;
+      }
+      
+      if (this-> p_read == this-> p_unused)
+      {
+         this-> p_unused = this-> p_write;
+         this-> p_read   = 0;
+         return;
+      }
+      if (this-> p_read == this-> p_write)
+      {
+         this->clear();
+      }
+   }
+   
+   void CCircularBuffer::movePWrite(std::size_t data_size)
+   {
+      if ((this-> p_write + data_size) > SuperClass::getSize())
+      {
+         this-> p_unused = this-> p_write;
+         this-> p_write  = data_size;
+         if (this-> p_read < (data_size))
+            XIOS_ERROR("CCircularBuffer::movePWrite(data_size)",
+                       << " invalid position 1 !");
+      }
+      else
+      {
+         if ((this-> p_read > this-> p_write) &&
+             (this-> p_read < (this-> p_write + data_size)))
+            XIOS_ERROR("CCircularBuffer::movePWrite(data_size)",
+                        << " invalid position 2 !");
+         this-> p_write += data_size;
+         if (this->p_read < this->p_write)
+            this-> p_unused = this-> p_write;
+      }
+   }
+
+   // --------------------------- Tests sur le buffer --------------------------
+   
+   bool CCircularBuffer::hasRequest(void) const
+   { 
+      return (this->nbrequest != 0); 
+   }
+   
+   bool CCircularBuffer::isAvailable(std::size_t data_size) const
+   {
+      if (this->p_write == this->p_unused)
+         return (((SuperClass::getSize() - this->p_write) >= data_size) ||
+                (this->p_read >= data_size));
+      else
+         return ((this->p_read - this->p_write) >= data_size);
+   }
+
+   // ------------------------- Ecriture fichier -------------------------------
+
+   void CCircularBuffer::printToTextFile (const std::string & _filename)
+   {
+      std::ofstream ofs(_filename.c_str());
+      this->printToTextStream(ofs);
+      ofs.close();
+   }
+   
+   void CCircularBuffer::printToTextStream (std::ostream & _ostr)
+   {
+      std::size_t _p_write     = p_write,
+                  _p_read      = p_read,
+                  _p_unused    = p_unused,
+		  _p_wait      = p_wait,
+		  _locked_data = locked_data,
+                  _nbrequest   = nbrequest;
+
+      while (this->hasRequest())
+      {
+         this->getNextRequest().printToTextStream(_ostr);
+         _ostr << std::endl;
+      }
+
+      p_write     = _p_write;
+      p_read      = _p_read;
+      p_unused    = _p_unused;
+      p_wait      = _p_wait;
+      locked_data = _locked_data;
+      nbrequest   = _nbrequest;
+   }
+
+   // ------------------------------- Accesseurs -------------------------------
+   
+   std::size_t CCircularBuffer::getNumberOfRequest(void) const
+   { 
+      return (this->nbrequest); 
+   }
+
+   std::size_t CCircularBuffer::getReadPosition(void) const
+   { 
+      return (this->p_read); 
+   }
+
+   std::size_t CCircularBuffer::getWritePosition(void) const
+   { 
+      return (this->p_write); 
+   }
+
+   std::size_t CCircularBuffer::getUnusedPosition(void) const
+   { 
+      return (this->p_unused); 
+   }
+   
+   std::size_t CCircularBuffer::getWaitPosition(void) const
+   { 
+      return (this->p_wait); 
+   }
+
+
+   // ------------------------- Mise Ã  jour des donnÃ©es -----------------------
+   
+   void CCircularBuffer::updateNbRequests(void)
+   {
+      this->updateNbRequests(this->p_wait, this->p_wait + this->locked_data);
+   }
+
+   void CCircularBuffer::updateNbRequests(std::size_t _data_begin, std::size_t _data_end)
+   {
+      this-> p_wait        = 0;
+      this-> locked_data   = 0;
+      std::size_t position = _data_begin;        
+      while (position != _data_end)
+      {
+         this->nbrequest++;
+         position = SuperClass::getNextDataPosition(position); // manager id           
+         position = SuperClass::getNextDataPosition(position); // method id           
+         SuperClass::updateBufferData(position);
+         long int nbarg = SuperClass::getInt(position);
+         position = SuperClass::getNextDataPosition(position);
+         for (long int i = 0; i < nbarg; i++)
+            position = SuperClass::getNextDataPosition(position);
+            
+         if (position > _data_end)
+           XIOS_ERROR("CCircularBuffer::updateNbRequests(std::size_t data_begin, std::size_t data_end)",
+                      << "[ position courante" << position
+                      << ", fin de traitement" << _data_end << " ] "
+                      << "Impossible de mettre Ã  jour la liste des requÃªtes !");
+      }
+   }
+      
+} // namespace comm
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/circular_buffer.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/circular_buffer.hpp	(revision 264)
+++ XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/circular_buffer.hpp	(revision 264)
@@ -0,0 +1,91 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+ 
+#ifndef __CIRCULAR_BUFFER_HPP__
+#define __CIRCULAR_BUFFER_HPP__ 
+
+#ifndef __XIOS_NO_EXTERN
+
+// C++ standard headers
+#include <vector>
+
+#endif // __XIOS_NO_EXTERN
+
+// XMLIOServer headers
+#include "xmlioserver_spl.hpp"
+#include "buffer.hpp"
+#include "linear_buffer.hpp"
+
+// ////////////////////////////// DÃ©clarations ///////////////////////////// //
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      class CCircularBuffer : public CBuffer
+      {
+
+         public : // DÃ©finition de type
+
+            typedef CBuffer SuperClass;
+
+         public : // Construteurs
+
+            explicit CCircularBuffer(std::size_t _size = 1E6);
+            CCircularBuffer(const CCircularBuffer & _cbuffer_ref);
+            CCircularBuffer(const CCircularBuffer * const _cbuffer_ptr);
+
+         public : // Mutateurs
+
+            virtual void clear(void);
+
+            char * prepareNextData(std::size_t _data_size);
+            std::size_t prepareNextDataPosition(std::size_t _data_size);
+
+            void appendRequest(const CLinearBuffer & _brequest);
+
+	    void updateNbRequests(void);
+            void updateNbRequests(std::size_t _data_begin, std::size_t _data_end);
+
+         public : // Tests
+
+            bool hasRequest(void) const ;
+            bool isAvailable(std::size_t _data_size) const;
+
+         public : // Accesseurs
+
+            CLinearBuffer getNextRequest  (void);
+            std::size_t getNumberOfRequest(void) const;
+
+            std::size_t getReadPosition  (void) const;
+            std::size_t getWritePosition (void) const;
+            std::size_t getUnusedPosition(void) const;
+	    std::size_t getWaitPosition  (void) const;
+
+         public : // Sortie fichier ascii
+
+            virtual void printToTextFile   (const std::string & _filename);
+            virtual void printToTextStream (std::ostream & _ostr);
+
+         public : // Destructeur
+
+            virtual ~CCircularBuffer(void);
+
+         private : // Mutateurs privÃ©s
+
+            void movePWrite(std::size_t _data_size);
+            void movePRead (std::size_t _data_size);
+
+         private : // Accesseurs privÃ©s
+
+            std::size_t getNextRequestSize(void) const;
+
+         private : // PropriÃ©tÃ©s privÃ©es
+
+            std::size_t p_write, p_read, p_unused, p_wait, locked_data, nbrequest;
+
+      }; // class CCircularBuffer
+   } // namespace comm
+} // namespace xmlioserver
+#endif //__CIRCULAR_BUFFER_HPP__
Index: XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/linear_buffer.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/linear_buffer.hpp	(revision 264)
+++ XMLIO_V2/dev/dev_rv/src4/xmlio/buffer/linear_buffer.hpp	(revision 264)
@@ -0,0 +1,162 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+ 
+#ifndef __LINEAR_BUFFER_HPP__
+#define __LINEAR_BUFFER_HPP__ 
+
+#ifndef __XIOS_NO_EXTERN
+
+// C++ standard headers
+#include <vector>
+
+#endif // __XIOS_NO_EXTERN
+
+// XMLIOServer headers
+#include "xmlioserver_spl.hpp"
+#include "buffer.hpp"
+
+// ////////////////////////////// DÃ©clarations ///////////////////////////// //
+
+#define _NULL_ARG xmlioserver::comm::CLinearBuffer::NULL_ARG
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      class CLinearBuffer : public CBuffer
+      {
+         public : // DÃ©finition de type
+
+            typedef CBuffer SuperClass;
+
+         public :
+
+            static long int * NULL_ARG;
+            friend class CMPIManager;
+
+         public :// Construteurs
+
+
+            explicit CLinearBuffer(std::size_t size = 1E5);
+            CLinearBuffer(char * data, std::size_t _size);
+            CLinearBuffer(const CLinearBuffer & _lbuffer_ref);
+            CLinearBuffer(const CLinearBuffer * const _lbuffer_ptr);
+
+         public :// Accesseurs
+
+            std::size_t getUsedSize(void) const;
+            std::size_t getUnusedSize(void) const;
+
+            std::size_t getNumberOfStoredData(void) const;
+            std::vector<std::size_t> getPositionsOfStoredData(void) const;
+            std::vector<std::size_t> getSizesOfStoredData(void) const;
+            std::vector<std::pair<CBufferDataType, bool> > getTypesOfStoredData(void) const;
+
+         //--------------------------------------------------------------
+	    
+            char     getChar  (std::size_t _position) const;
+            bool     getBool  (std::size_t _position) const;
+            float    getFloat (std::size_t _position) const;
+            double   getDouble(std::size_t _position) const;
+            long int getInt   (std::size_t _position) const;
+
+            std::string getString(std::size_t _position) const;
+
+            boost::shared_ptr<boost::multi_array<char, 1> >
+	       getCharArray  (std::size_t _position) const;
+            boost::shared_ptr<boost::multi_array<bool, 1> >
+	        getBoolArray  (std::size_t _position) const;
+            boost::shared_ptr<boost::multi_array<float, 1> >
+	        getFloatArray (std::size_t _position) const;
+            boost::shared_ptr<boost::multi_array<double, 1> >
+	        getDoubleArray(std::size_t _position) const;
+            boost::shared_ptr<boost::multi_array<long int, 1> >
+	        getIntArray   (std::size_t _position) const;
+
+         //--------------------------------------------------------------
+
+            void getRequestInfos(std::size_t   _position,
+				 long int    & _managerId,
+				 long int    & _methodId,
+				 long int    & _nbargs);
+
+         //--------------------------------------------------------------
+         public : // Mutateurs
+
+            void appendChar  (char     _value) ;
+            void appendBool  (bool     _value) ;
+            void appendFloat (float    _value) ;
+            void appendDouble(double   _value) ;
+            void appendInt   (long int _value) ;
+
+            void appendString(const std::string & _value) ;
+
+            void appendCharArray  
+	       (boost::shared_ptr<boost::multi_array<char, 1> > _value) ;
+            void appendBoolArray  
+	       (boost::shared_ptr<boost::multi_array<bool, 1> > _value) ;
+            void appendFloatArray 
+	       (boost::shared_ptr<boost::multi_array<float, 1> > _value) ;
+            void appendDoubleArray
+	       (boost::shared_ptr<boost::multi_array<double, 1> > _value) ;
+            void appendIntArray  
+             (boost::shared_ptr<boost::multi_array<long int, 1> > _value) ;
+
+         //--------------------------------------------------------------
+
+            void appendRequestInfos(const long int & _managerId,
+                                    const long int & _methodId,
+                                    const long int & _nbargs);
+
+         //--------------------------------------------------------------
+	    
+            virtual void clear(void);
+
+         public :// Test ///
+            template <typename A1, typename A2, typename A3, typename A4>
+               inline std::size_t getRequestedSize(A1 * _arg1 = NULL_ARG,
+                                                   A2 * _arg2 = NULL_ARG,
+                                                   A3 * _arg3 = NULL_ARG,
+                                                   A4 * _arg4 = NULL_ARG) const;
+
+         public : // Sortie fichier ascii
+
+            virtual void printToTextFile (const std::string & _filename);
+            virtual void printToTextStream (std::ostream & _ostr);
+
+         public : // Destructeur
+
+            virtual ~CLinearBuffer(void);
+
+         protected : // Accesseurs protÃ©gÃ©s
+
+            template <class T>
+               inline void getLData
+		 (T & _data, std::size_t _position) const;
+		 
+            template <class T>
+               inline void getLDataArray
+		 (boost::shared_ptr<boost::multi_array<T, 1> > data, std::size_t _position) const;
+
+         protected : // Mutateurs protÃ©gÃ©s
+
+            template <class T>
+               inline void appendLData(const T & _data);
+            template <class T>
+               inline void appendLDataArray
+		 (boost::shared_ptr<boost::multi_array<T, 1> > _data);
+
+         private : // Traitement
+
+            void computeBufferData(void);
+
+         private : // PropriÃ©tÃ©s privÃ©es
+
+            std::vector<std::size_t> bdata;
+            std::size_t p_write;
+
+      }; // class CLinearBuffer
+   } // namespace comm
+} // namespace xmlioserver
+#endif //__LINEAR_BUFFER_HPP__
Index: XMLIO_V2/dev/dev_rv/src4/xmlio/config/node_type.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src4/xmlio/config/node_type.conf	(revision 263)
+++ XMLIO_V2/dev/dev_rv/src4/xmlio/config/node_type.conf	(revision 264)
@@ -1,34 +1,39 @@
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+//-----------------------------------------------------------------------------
 #ifdef __XMLIO_CAxis__
    DECLARE_NODE(Axis  , axis  )
 #endif //__XMLIO_CAxis__
-
+//-----------------------------------------------------------------------------
 #ifdef __XMLIO_CDomain__
    DECLARE_NODE(Domain, domain)
 #endif //__XMLIO_CDomain__
-
+//-----------------------------------------------------------------------------
 #ifdef __XMLIO_CField__
    DECLARE_NODE(Field , field )
 #endif //__XMLIO_CField__
-
+//-----------------------------------------------------------------------------
 #ifdef __XMLIO_CFile__
    DECLARE_NODE(File  , file  )
 #endif //__XMLIO_CFile__
-
+//-----------------------------------------------------------------------------
 #ifdef __XMLIO_CGrid__
    DECLARE_NODE(Grid  , grid  )
 #endif //__XMLIO_CGrid__
-
+//-----------------------------------------------------------------------------
 #ifdef __XMLIO_CMethod__
    DECLARE_NODE(Method, method)
 #endif //__XMLIO_CMethod__
-
+//-----------------------------------------------------------------------------
 #ifdef __XMLIO_CVar__
    DECLARE_NODE(Var   , var   )
 #endif //__XMLIO_CVar__
-
+//-----------------------------------------------------------------------------
 #ifdef __XMLIO_CContext__
    DECLARE_NODE_PAR(Context, context)
 #endif //__XMLIO_CContext__
-
+//-----------------------------------------------------------------------------
 #undef DECLARE_NODE
 #undef DECLARE_NODE_PAR
Index: XMLIO_V2/dev/dev_rv/src4/xmlio/node/node_enum.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src4/xmlio/node/node_enum.hpp	(revision 263)
+++ XMLIO_V2/dev/dev_rv/src4/xmlio/node/node_enum.hpp	(revision 264)
@@ -1,7 +1,13 @@
-#ifndef __XMLIO_NODE_ENUM__
-#define __XMLIO_NODE_ENUM__
+/* ************************************************************************** *
+ *      Copyright Â© IPSL/LSCE, XMLIOServer, Avril 2010 - Octobre 2011         *
+ * ************************************************************************** */
+
+#ifndef __NODE_ENUM_HPP__
+#define __NODE_ENUM_HPP__
 
 #define DECLARE_NODE(Name_, name_)     ,e##Name_, g##Name_
 #define DECLARE_NODE_PAR(Name_, name_) ,e##Name_, g##Name_
+
+// /////////////////////////////// DÃ©finitions ////////////////////////////// //
 
 namespace xmlioserver
@@ -9,5 +15,4 @@
    namespace tree
    {
-      /// ////////////////////// DÃ©finitions ////////////////////// ///
       typedef enum _node_type
       {
@@ -21,3 +26,3 @@
 } // namespace xmlioserver
 
-#endif // __XMLIO_NODE_ENUM__
+#endif // __NODE_ENUM_HPP__
