Index: XMLIO_V2/dev/dev_rv/src/xmlio/array.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/array.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/array.hpp	(revision 152)
@@ -0,0 +1,65 @@
+#ifndef __XMLIO_CArray__
+#define __XMLIO_CArray__
+
+/// boost headers ///
+#include <boost/cstdint.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/multi_array.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   template <typename ValueType, StdSize  NumDims,
+             typename Allocator = std::allocator<ValueType> >
+      class CArray
+         : public boost::multi_array<ValueType, NumDims, Allocator>
+   {
+         /// DÃ©finition de type ///
+         typedef boost::multi_array<ValueType, NumDims, Allocator> SuperClass;
+
+      public:
+
+         typedef ValueType ValType;
+
+         /// Constructeurs ///
+         template <typename ExtentList>
+            explicit CArray(const ExtentList & sizes);
+
+         template <typename ExtentList>
+            CArray(const ExtentList & sizes, const boost::general_storage_order<NumDims> & store);
+
+         CArray(const CArray & array);       // NEVER IMPLEMENTED.
+         CArray(const CArray * const array); // NEVER IMPLEMENTED.
+
+      public:
+
+         /// Flux ///
+         template <typename U, StdSize V, typename W>
+            friend StdOStream & operator << (StdOStream & os,
+                                             const CArray<U, V, W> & array);
+
+         template <typename U, StdSize V, typename W>
+            friend StdIStream & operator >> (StdIStream & is,
+                                             CArray<U, V, W> & array);
+
+      public:
+
+         void toBinary  (StdOStream & os) const;
+         void fromBinary(StdIStream & is);
+
+         /// Destructeur ///
+         virtual ~CArray(void);
+
+   }; // class CArray
+
+   ///---------------------------------------------------------------
+
+} // namespace xmlioserver
+
+#include "array_impl.hpp"
+#include "array_mac.hpp"
+
+#endif // __XMLIO_CArray__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/array_impl.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/array_impl.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/array_impl.hpp	(revision 152)
@@ -0,0 +1,88 @@
+#ifndef __XMLIO_CArray_impl__
+#define __XMLIO_CArray_impl__
+
+namespace xmlioserver
+{
+   
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      template <typename ExtentList>
+         CArray<ValueType, NumDims, Allocator>::CArray(const ExtentList & sizes)
+            : boost::multi_array<ValueType, NumDims, Allocator>
+                  (sizes, boost::fortran_storage_order())
+   { /* Ne rien faire de plus */ }
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      template <typename ExtentList>
+         CArray<ValueType, NumDims, Allocator>::CArray
+            (const ExtentList & sizes, const boost::general_storage_order<NumDims> & store)
+               : boost::multi_array<ValueType, NumDims, Allocator> (sizes, store)
+   { /* Ne rien faire de plus */ }
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      CArray<ValueType, NumDims, Allocator>::~CArray(void)
+   { /* Ne rien faire de plus */ }
+
+   //----------------------------------------------------------------
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      StdOStream & operator << (StdOStream & os,
+                                const CArray<ValueType, NumDims, Allocator> & array)
+   {
+      os << (array.data()[0]) << "(" << array.shape()[0];
+      for (StdSize i = 1; i < array.num_dimensions(); i++)
+         os << ", " << array.shape()[i];
+      os << ")" << (array.data()[array.num_elements()-1]);
+      return (os);
+   }
+
+   //----------------------------------------------------------------
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      StdOStream & operator << (StdOStream & os,
+                                const boost::shared_ptr<CArray<ValueType, NumDims, Allocator> > & array)
+   { os << *array; return (os); }
+
+   //----------------------------------------------------------------
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      void CArray<ValueType, NumDims, Allocator>::toBinary  (StdOStream & os) const
+   {
+      typedef boost::multi_array_types::size_type LSize;
+      LSize nelem = this->num_elements();
+      LSize ndim  = this->num_dimensions();
+      const LSize * shape = this->shape();
+      const ValueType * data = this->data();
+
+      os.write (reinterpret_cast<const char*>(&ndim) , sizeof(LSize));
+      for (LSize i = 0; i < ndim; i++ )
+         os.write (reinterpret_cast<const char*>(&(shape[i])), sizeof(LSize));
+      os.write (reinterpret_cast<const char*>(&nelem), sizeof(LSize));
+      os.write (reinterpret_cast<const char*>(data), nelem * sizeof(ValueType));
+   }
+
+   //----------------------------------------------------------------
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+      void CArray<ValueType, NumDims, Allocator>::fromBinary(StdIStream & is)
+   {
+      typedef boost::multi_array_types::size_type LSize;
+      LSize ndim = 0, nelem = 0, temp = 0;
+      std::vector<LSize> shape;
+      is.read (reinterpret_cast<char*>(&ndim) , sizeof(LSize));
+      for (LSize i = 0; i < ndim; i++ )
+      {
+         is.read (reinterpret_cast<char*>(&temp) , sizeof(LSize));
+         shape.push_back(temp);
+      }
+      this->reshape(shape);
+      is.read (reinterpret_cast<char*>(&nelem), sizeof(LSize));
+      is.read (reinterpret_cast<char*>(this->data()), nelem * sizeof(ValueType));
+   }
+
+   ///---------------------------------------------------------------
+   
+} // namespace xmlioserver
+
+#endif // __XMLIO_CArray_impl__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/array_mac.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/array_mac.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/array_mac.hpp	(revision 152)
@@ -0,0 +1,25 @@
+#ifndef __XMLIO_CArray_mac__
+#define __XMLIO_CArray_mac__
+
+/// ////////////////////// Macros ////////////////////// ///
+
+// Type Fortran
+#define ARRAY(valuetype, numdims) boost::shared_ptr<CArray<valuetype, numdims> >
+
+#define ARRAY_ASSIGN(value, valuetype, numdims, extent)\
+   value = ARRAY(valuetype, numdims)(new CArray<valuetype, numdims>(boost::extents extent))
+
+#define ARRAY_CREATE(value, valuetype, numdims, extent)\
+   ARRAY_ASSIGN(ARRAY(valuetype, numdims) value, valuetype, numdims, extent)
+
+// Type C
+#define ARRAY_C_ASSIGN(value, valuetype, numdims, extent)\
+   value = ARRAY(valuetype, numdims)                     \
+   (new CArray<valuetype, numdims>(boost::extents extent, c_storage_order()))
+
+#define ARRAY_C_CREATE(value, valuetype, numdims, extent)\
+   ARRAY_C_ASSIGN(ARRAY(valuetype, numdims) value, valuetype, numdims, extent)
+
+///---------------------------------------------------------------
+
+#endif // __XMLIO_CArray_mac__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/attribute.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/attribute.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/attribute.cpp	(revision 152)
@@ -0,0 +1,34 @@
+#include "attribute.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CAttribute::CAttribute(const StdString & id)
+         : CObject(id)
+         , value()
+      { /* Ne rien faire de plus */ }
+
+      CAttribute::CAttribute(const CAttribute & attribut)
+         : CObject(attribut.getId())
+      { this->value = attribut.getAnyValue(); }
+
+      const boost::any & CAttribute::getAnyValue(void) const
+      { return (this->value); }
+
+
+      void CAttribute::setAnyValue(const boost::any & value)
+      { this->value = value; }
+
+      CAttribute::~CAttribute(void)
+      { /* Ne rien faire de plus */ }
+
+      bool CAttribute::isEmpty(void) const
+      { return (this->value.empty()); }
+
+      const StdString & CAttribute::getName(void) const
+      { return (this->getId()); }
+
+   } // namespace tree
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/attribute.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/attribute.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/attribute.hpp	(revision 152)
@@ -0,0 +1,78 @@
+#ifndef __XMLIO_CAttribute__
+#define __XMLIO_CAttribute__
+
+/// boost headers ///
+#include <boost/any.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "object.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CAttribute : public CObject
+      {
+            typedef CObject SuperClass;
+
+         public :
+
+            /// Constructeurs ///
+            explicit CAttribute(const StdString & id);
+            CAttribute(const CAttribute & attribut);
+            CAttribute(const CAttribute * const attribut); // Not implemented.
+
+            /// Accesseurs ///
+            const StdString & getName(void) const;
+            const boost::any & getAnyValue(void) const;
+            template <typename T> inline T getValue(void) const;
+
+            /// Mutateurs ///
+            template <typename T> inline void setValue(const T & value);
+            void setAnyValue(const boost::any & value);
+
+            /// Test ///
+            bool isEmpty(void) const;
+            template <typename T> inline bool isType(void);
+
+            /// Destructeur ///
+            virtual ~CAttribute(void);
+
+            /// Autres ///
+            virtual StdString toString(void) const = 0;
+            virtual void fromString(const StdString & str) = 0;
+
+            virtual void toBinary  (StdOStream & os) const = 0;
+            virtual void fromBinary(StdIStream & is) = 0;
+
+         protected :
+
+            /// Constructeurs ///
+            CAttribute(void);  // Not implemented.
+
+         private :
+
+            /// PropriÃ©tÃ© ///
+            boost::any value;
+
+      }; // class CAttribute
+
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      template <typename T>
+         T CAttribute::getValue(void) const
+      { return (boost::any_cast<T>(this->value)); }
+
+      template <typename T>
+         void CAttribute::setValue(const T & value)
+      { this->value = value; }
+
+      template<typename T>
+         bool CAttribute::isType(void)
+      { return (this->value.type() == typeid(T)); }
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAttribute__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/attribute_map.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/attribute_map.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/attribute_map.cpp	(revision 152)
@@ -0,0 +1,94 @@
+#include "attribute_map.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CAttributeMap * CAttributeMap::Current = NULL;
+
+      CAttributeMap::CAttributeMap(void)
+         : xios_map<StdString, CAttribute*>()
+      { CAttributeMap::Current = this; }
+
+      CAttributeMap::~CAttributeMap(void)
+      { /* Ne rien faire de plus */ }
+
+      bool CAttributeMap::hasAttribute(const StdString & key) const
+      { return (this->find(key) != this->end()); }
+
+      void CAttributeMap::setAttribute(const StdString & key, CAttribute * const attr)
+      {
+         if (!this->hasAttribute(key))
+            ERROR("CAttributeMap::setAttribute(key, attr)",
+                   << "[ key = " << key << "] key not found !");
+         if (attr == NULL)
+            ERROR("CAttributeMap::setAttribute(key, attr)",
+                   << "[ key = " << key << "] attr is null !");
+         this->find(key)->second->setAnyValue(attr->getAnyValue());
+      }
+
+      CAttribute * CAttributeMap::operator[](const StdString & key)
+      {
+         if (!this->hasAttribute(key))
+            ERROR("CAttributeMap::operator[](const StdString & key)",
+                  << "[ key = " << key << "] key not found !");
+         return (SuperClassMap::operator[](key));
+      }
+
+      StdString CAttributeMap::toString(void) const
+      {
+         typedef std::pair<StdString, CAttribute*> StdStrAttPair;
+         StdOStringStream oss;
+         
+         SuperClassMap::const_iterator it = SuperClassMap::begin(), end = SuperClassMap::end();
+         for (; it != end; it++)
+         {
+            const StdStrAttPair & att = *it;
+            if (!att.second->isEmpty())
+               oss << *att.second << " ";
+         }
+         return (oss.str());
+      }
+
+      void CAttributeMap::fromString(const StdString & str)
+      { ERROR("CAttributeMap::fromString(const StdString & str)",
+             << "[ str = " << str << "] Not implemented yet !"); }
+
+      //StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap)
+      //{ os << attributmap.toString(); return (os); }
+
+      void CAttributeMap::setAttributes(const xml::THashAttributes & attributes)
+      {
+         for (xml::THashAttributes::const_iterator it  = attributes.begin();
+                                                   it != attributes.end();
+                                                   it ++)
+            if ((*it).first.compare(StdString("id")) != 0 &&
+                (*it).first.compare(StdString("src"))!= 0)
+            {
+               //if (CAttributeMap::operator[]((*it).first)->isEmpty())
+               CAttributeMap::operator[]((*it).first)->fromString((*it).second);
+            }
+      }
+
+      void CAttributeMap::setAttributes(const CAttributeMap * const _parent)
+      {
+         typedef std::pair<StdString, CAttribute*> StdStrAttPair;
+         
+         SuperClassMap::const_iterator it = _parent->begin(), end = _parent->end();
+         for (; it != end; it++)
+         {
+            const StdStrAttPair & el = *it;
+            if (this->hasAttribute(el.first))
+            {
+               CAttribute * currAtt = CAttributeMap::operator[](el.first);
+               if (currAtt->isEmpty() && !el.second->isEmpty())
+               {
+                  this->setAttribute(el.first, el.second);
+               }
+            }
+         }
+      }
+
+   } // namespace tree
+} // namespace xmlioser
Index: XMLIO_V2/dev/dev_rv/src/xmlio/attribute_map.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/attribute_map.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/attribute_map.hpp	(revision 152)
@@ -0,0 +1,61 @@
+#ifndef __XMLIO_CAttributeMap__
+#define __XMLIO_CAttributeMap__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "attribute.hpp"
+#include "attribute_template.hpp"
+#include "exception.hpp"
+#include "xml_node.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CAttributeMap
+         : public xios_map<StdString, CAttribute*>
+      {
+            typedef xios_map<StdString, CAttribute*> SuperClassMap;
+
+         public :
+
+            /// Tests ///
+            inline bool hasAttribute(const StdString & key) const;
+
+            /// Accesseurs ///
+            inline CAttribute * operator[](const StdString & key);
+
+            /// Mutateurs ///
+            void setAttribute(const StdString & key, CAttribute * const attr);
+
+            void setAttributes(const xml::THashAttributes & attributes);
+            void setAttributes(const CAttributeMap * const _parent);
+
+            /// Destructeur ///
+            virtual ~CAttributeMap(void);
+
+            /// Flux ///
+            // Debug only //
+            // friend StdOStream & operator << (StdOStream & os, const CAttributeMap & attributmap);
+
+            /// Autre ///
+            virtual StdString toString(void) const;
+            virtual void fromString(const StdString & str);
+
+         protected :
+
+            /// Constructeurs ///
+            CAttributeMap(void);
+            CAttributeMap(const xios_map<StdString, CAttribute*> & umap);       // Never implemented.
+            CAttributeMap(const xios_map<StdString, CAttribute*> * const umap); // Not implemented.
+
+            /// PropriÃ©tÃ© statique ///
+            static CAttributeMap * Current;
+
+      };  // class CAttributeMap
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAttributeMap__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template.cpp	(revision 152)
@@ -0,0 +1,174 @@
+#include "attribute_template.hpp"
+
+#include "attribute_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      /** SpÃ©cialisations des templates pour la fonction [toString] **/
+      template <>
+         StdString CAttributeTemplate<bool>::toString(void) const
+      {
+         StdOStringStream oss;
+         if (!this->isEmpty() && this->hasId())
+         {
+            if (this->getValue())
+               oss << this->getName() << "=\".TRUE.\"";
+            else
+               oss << this->getName() << "=\".FALSE.\"";
+         }
+         return (oss.str());
+      }
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [fromString] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::fromString(const StdString & str)
+      { this->setValue(str); }
+
+      template <> // Entier
+         void CAttributeTemplate<int>::fromString(const StdString & str)
+      {
+         try
+         {
+            this->setValue(boost::lexical_cast<int>(str));
+         }
+         catch(boost::bad_lexical_cast &)
+         {
+            ERROR("void CAttributeTemplate<int>::fromString(const StdString & str)",
+                  << "[ str = " << str << " ] Bad cast !");
+         }
+      }
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::fromString(const StdString & str)
+      {
+         if (str.find(".TRUE.") != StdString::npos)
+            this->setValue(true);
+         else
+            this->setValue(false);
+      }
+
+      //---------------------------------------------------------------
+
+      template<> // Tableau
+         void CAttributeTemplate<ARRAY(double, 1)>::fromString(const StdString & str)
+      {
+         ARRAY_CREATE(array_sptr, double, 1, [1]);
+         CArray<double, 1> & array = *array_sptr;
+         this->setValue(array_sptr);
+
+         StdIStringStream iss(str) ;
+         char c = '\0'; int size = 0;
+         double d = 0.,valsup = 0., valinf = 0.;
+         std::vector<double> vect;
+
+         iss >> d; vect.push_back(d);
+         if (!iss.eof ())
+         {
+            iss >> c;
+            switch (c)
+            {
+               case ',' : // Le tableau est gÃ©nÃ©rÃ© valeur par valeur.
+                  iss.unget();
+                  while(!iss.eof ())
+                  { // On rÃ©cupÃšre chacune des valeurs une par une jusqu'Ã  ce que le buffer soit vide.
+                     iss >> c >> d;
+                     if (c != ',')
+                        ERROR("CAttributeTemplate<ARRAY(...)>::fromString(const StdString & str)",
+                              << "[ str = " << str << " ] bad definition of array !");
+                     vect.push_back(d);
+                  }
+                  size = vect.size();
+                  break;
+               case '(' : // Le tableau est gÃ©nÃ©rÃ© automatiquement.
+                  if (!iss.eof ())
+                  { // on rÃ©cupÃšre la borne supÃ©rieure
+                     valinf = d;
+                     iss >> size >> c >> d;
+                     if ((c != ')') || (size <= 0))
+                        ERROR("CAttributeTemplate<ARRAY(...)>::fromString(const StdString & str)",
+                              << "[ str = " << str << " ] bad definition of array !");
+                     valsup = d;
+                  }
+                  d = (valsup - valinf) / (double)(size - 1);
+                  for (int j = 1; j <= size; j++)
+                     vect.push_back(valinf + j * d);
+                  break;
+               default :
+                  ERROR("CAttributeTemplate<ARRAY(...)>::fromString(const StdString & str)",
+                        << "[ str = " << str << " ] bad definition of array !");
+            }
+         }
+
+         array.resize(boost::extents[size]);
+         for (int i = 0; i < size; i++)
+            array[i] = vect[i];
+
+      }
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [toBinary] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::toBinary (StdOStream & os) const
+      {
+         StdString str = this->getValue();
+         StdSize size = str.size();
+         os.write (reinterpret_cast<const char*>(&size) , sizeof(StdSize));
+         os.write (str.data(), size * sizeof(char));
+      }
+
+      template <> // Entier
+         void CAttributeTemplate<int>::toBinary(StdOStream & os) const
+      {
+         int value = this->getValue();
+         os.write (reinterpret_cast<const char*>(&value) , sizeof(int));
+      }
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::toBinary(StdOStream & os) const
+      {
+         bool value = this->getValue();
+         os.write (reinterpret_cast<const char*>(&value) , sizeof(bool));
+      }
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [fromBinary] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::fromBinary(StdIStream & is)
+      {
+         StdSize size = 0;
+         is.read (reinterpret_cast<char*>(&size), sizeof(StdSize));
+         StdString value(size, ' ');
+         is.read (const_cast<char *>(value.data()), size * sizeof(char));
+         this->setValue(value);
+      }
+
+      template <> // Entier
+         void CAttributeTemplate<int>::fromBinary(StdIStream & is)
+      {
+         int value = 0;
+         is.read (reinterpret_cast<char*>(&value), sizeof(int));
+         this->setValue(value);
+      }
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::fromBinary(StdIStream & is)
+      {
+         bool value = false;
+         is.read (reinterpret_cast<char*>(&value), sizeof(bool));
+         this->setValue(value);
+      }
+
+      ///--------------------------------------------------------------
+   } // namespace tree
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template.hpp	(revision 152)
@@ -0,0 +1,67 @@
+#ifndef __XMLIO_CAttributeTemplate__
+#define __XMLIO_CAttributeTemplate__
+
+/// boost headers ///
+#include <boost/lexical_cast.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+#include "attribute.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      template <class T>
+         class CAttributeTemplate : public CAttribute
+      {
+            typedef CAttribute SuperClass;
+
+         public :
+
+            /// Typedef ///
+            typedef T ValueType;
+
+            /// Constructeurs ///
+            explicit CAttributeTemplate(const StdString & id);
+            CAttributeTemplate(const StdString & id,
+                               xios_map<StdString, CAttribute*> & umap);
+            CAttributeTemplate(const StdString & id, const ValueType & value);
+            CAttributeTemplate(const StdString & id, const ValueType & value,
+                               xios_map<StdString, CAttribute*> & umap);
+            CAttributeTemplate(const CAttribute & attribut) throw (CException);
+            CAttributeTemplate(const CAttribute * const attribut); // Not implemented.
+
+            /// Accesseur ///
+            inline ValueType getValue(void) const;
+
+            /// Mutateurs ///
+            inline void setValue(const ValueType & value);
+
+            /// Destructeur ///
+            virtual ~CAttributeTemplate(void);
+
+            /// Operateur ///
+            ValueType operator=(const ValueType & value);
+
+            /// Autre ///
+            virtual StdString toString(void) const;
+            virtual void fromString(const StdString & str);
+
+            virtual void toBinary  (StdOStream & os) const;
+            virtual void fromBinary(StdIStream & is);
+
+         protected :
+
+            /// Constructeurs ///
+            CAttributeTemplate(void); // Not implemented.
+
+      }; // class CAttribute
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAttributeTemplate__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template_impl.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template_impl.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/attribute_template_impl.hpp	(revision 152)
@@ -0,0 +1,160 @@
+#ifndef __XMLIO_CAttributeTemplate_impl__
+#define __XMLIO_CAttributeTemplate_impl__
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate(const StdString & id)
+         : CAttribute(id)
+      { /* Ne rien faire de plus */ }
+
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate(const StdString & id, const T & value)
+         : CAttribute(id)
+      {
+         this->setValue(value);
+      }
+
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate(const CAttribute & attribut)
+         throw (CException)
+         : CAttribute(attribut)
+      {
+         if (!attribut.isEmpty() && !attribut.isType<T>())
+            ERROR("CAttributeTemplate", << "Invalid instantiation !");
+      }
+
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate(const StdString & id,
+                              xios_map<StdString, CAttribute*> & umap)
+         : CAttribute(id)
+      {
+         umap.insert(umap.end(), std::make_pair(id, this));
+      }
+
+      template <class T>
+         CAttributeTemplate<T>::CAttributeTemplate
+            (const StdString & id, const T & value,
+             xios_map<StdString, CAttribute*> & umap)
+         : CAttribute(id)
+      {
+         this->setValue(value);
+         umap.insert(umap.end(), std::make_pair(id, this));
+      }
+
+      template <class T>
+         CAttributeTemplate<T>::~CAttributeTemplate(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      template <class T>
+         T CAttributeTemplate<T>::getValue(void) const
+      {
+         return (SuperClass::getValue<T>());
+      }
+
+      template <class T>
+         void CAttributeTemplate<T>::setValue(const T & value)
+      {
+         SuperClass::setValue<T>(value);
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         T CAttributeTemplate<T>::operator=(const T & value)
+      {
+         this->setValue(value);
+         return (this->getValue());
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         StdString CAttributeTemplate<T>::toString(void) const
+      {
+         StdOStringStream oss;
+         if (!this->isEmpty() && this->hasId())
+            oss << this->getName() << "=\"" << this->getValue() << "\"";
+         return (oss.str());
+      }
+
+      template <class T>
+         void CAttributeTemplate<T>::fromString(const StdString & str)
+      {
+         ERROR("CAttributeTemplate<T>::fromString(const StdString & str)",
+               << "[ str = " << str << " ] Not implemented yet !");
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         void CAttributeTemplate<T>::toBinary (StdOStream & os) const
+      {
+         this->getValue()->toBinary(os);
+      }
+
+      template <class T>
+         void CAttributeTemplate<T>::fromBinary(StdIStream & is)
+      {
+         this->getValue()->fromBinary(is);
+      }
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [toString] **/
+
+      template <>
+         StdString CAttributeTemplate<bool>::toString(void) const;
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [fromString] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::fromString(const StdString & str);
+
+      template <> // Entier
+         void CAttributeTemplate<int>::fromString(const StdString & str);
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::fromString(const StdString & str);
+
+      template<> // Tableau
+         void CAttributeTemplate<ARRAY(double, 1)>::fromString(const StdString & str);
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [toBinary] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::toBinary (StdOStream & os) const;
+
+      template <> // Entier
+         void CAttributeTemplate<int>::toBinary(StdOStream & os) const;
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::toBinary(StdOStream & os) const;
+
+      //---------------------------------------------------------------
+
+      /** SpÃ©cialisations des templates pour la fonction [fromBinary] **/
+
+      template <> // ChaÃ®ne de caractÃšres.
+         void CAttributeTemplate<StdString>::fromBinary(StdIStream & is);
+
+      template <> // Entier
+         void CAttributeTemplate<int>::fromBinary(StdIStream & is);
+
+      template <> // BoolÃ©en
+         void CAttributeTemplate<bool>::fromBinary(StdIStream & is);
+
+      ///--------------------------------------------------------------
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAttributeTemplate_impl__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/buffer.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/buffer.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/buffer.cpp	(revision 152)
@@ -0,0 +1,221 @@
+#include "buffer.hpp"
+
+#include "manager/mpi_manager.hpp"
+#include "buffer_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CBuffer::CBuffer(StdSize size)
+         : size(size), delIdata(true)
+      {
+         this->idata = new char[size]();
+         //CMPIManager::AllocMem(&idata, size);
+      }
+
+      CBuffer::CBuffer(char * data, StdSize size)
+         : size(size), delIdata(false)
+      {
+         this->idata = data;
+      }
+
+      CBuffer::~CBuffer(void)
+      {
+         if (delIdata) delete [] this->idata;
+         //CMPIManager::FreeMem(idata);
+      }
+
+      ///--------------------------------------------------------------
+
+      CBuffer::operator char * (void)
+      { return (this->getData()); }
+
+      char * CBuffer::operator[](StdSize position)
+      { return (this->getData(position)); }
+
+      //---------------------------------------------------------------
+
+      StdSize CBuffer::getSize(StdSize position) const
+      {
+         if (position > this->size)
+            ERROR("CBuffer::getSize(position)",
+                  << " Buffer size <  size + position !");
+         return (this->size - position);
+      }
+
+      char * CBuffer::getData(StdSize position) const
+      {
+         if (position > this->size)
+            ERROR("CBuffer::getData(position)",
+                   << " Buffer size < position !");
+         return &(this->idata[position]);
+      }
+
+      //---------------------------------------------------------------
+
+      void CBuffer::getData(char * data, StdSize size, StdSize position) const
+      {
+         if (this->size < (size + position))
+            ERROR("CBuffer::getData(data, size, position)",
+                   << " Buffer size <  size + position !");
+         std::copy(this->getData(position), this->getData(position + size), data);
+      }
+
+      void CBuffer::setData(const char * data, StdSize size, StdSize position)
+      {
+         if (this->size < (size + position))
+            ERROR("CBuffer::getData(data, size, position)",
+                   << " Buffer size <  size + position !");
+         std::copy(&(data[0]), &(data[size]), this->getData(position));
+      }
+
+      //---------------------------------------------------------------
+
+#define BufferDataTypeGetter(type, type_enum)\
+   template <> CBuffer::CBufferDataType \
+      CBuffer::getBufferDataType<type>(void) const { return (type_enum); }; \
+   template <> CBuffer::CBufferDataType \
+      CBuffer::getBufferDataType<ARRAY(type, 1)>(void) const { return (type_enum); };
+
+      BufferDataTypeGetter(bool, TBOOL8);
+      BufferDataTypeGetter(char, TCHAR8);
+      BufferDataTypeGetter(float, TFLOAT32);
+      BufferDataTypeGetter(double, TDOUBLE64);
+      BufferDataTypeGetter(long int, TINT32);
+
+#undef BufferDataTypeGetter
+
+
+      //---------------------------------------------------------------
+
+      void CBuffer::getBufferData(CBufferData & bufdata, StdSize position) const
+      {
+         StdSize currposition = position;
+         this->getData( reinterpret_cast<char*>(&(bufdata.type))
+                      , sizeof(CBufferDataType), currposition);
+         this->getData( reinterpret_cast<char*>(&(bufdata.isArray))
+                      , sizeof(bool), currposition += sizeof(CBufferDataType));
+         this->getData( reinterpret_cast<char*>(&(bufdata.size))
+                      , sizeof(StdSize), currposition += sizeof(bool));
+         this->getData( reinterpret_cast<char*>(&(bufdata.position))
+                      , sizeof(StdSize), currposition += sizeof(StdSize));
+      }
+
+      void CBuffer::setBufferData(const CBufferData & bufdata, StdSize position)
+      {
+         StdSize currposition = position;
+         this->setData( reinterpret_cast<const char*>(&(bufdata.type))
+                      , sizeof(CBufferDataType), currposition);
+         this->setData( reinterpret_cast<const char*>(&(bufdata.isArray))
+                      , sizeof(bool), currposition += sizeof(CBufferDataType));
+         this->setData( reinterpret_cast<const char*>(&(bufdata.size))
+                      , sizeof(StdSize), currposition += sizeof(bool));
+         this->setData( reinterpret_cast<const char*>(&(bufdata.position))
+                      , sizeof(StdSize), currposition += sizeof(StdSize));
+      }
+
+      //---------------------------------------------------------------
+
+#define CBufferGetter(type, Type)       \
+   type CBuffer::get##Type(StdSize position) const \
+   { type retvalue; this->getData<type>(retvalue, position); return (retvalue); }
+
+
+      CBufferGetter(char     , Char)
+      CBufferGetter(bool     , Bool)
+      CBufferGetter(float    , Float)
+      CBufferGetter(double   , Double)
+      CBufferGetter(long int , Int)
+
+#undef CBufferGetter
+
+      //---------------------------------------------------------------
+
+#define CBufferArrayGetter(type, Type) \
+   ARRAY(type, 1) CBuffer::get##Type##Array(StdSize position) const \
+   {  ARRAY_CREATE(retvalue, type, 1, [1]);                         \
+      this->getDataArray<type>(retvalue, position);                 \
+      return (retvalue); }
+
+      CBufferArrayGetter(char     , Char)
+      CBufferArrayGetter(bool     , Bool)
+      CBufferArrayGetter(float    , Float)
+      CBufferArrayGetter(double   , Double)
+      CBufferArrayGetter(long int , Int)
+
+#undef CBufferArrayGetter
+
+      StdString CBuffer::getString(StdSize position) const
+      {
+         ARRAY(char, 1) array = this->getCharArray(position);
+         return (StdString(array->data(), array->num_elements()));
+      }
+
+      //---------------------------------------------------------------
+
+#define CBufferSetter(type, Type) \
+      void  CBuffer::set##Type(type value, StdSize position) \
+      { this->setData(value, position); }
+
+      CBufferSetter(char     , Char)
+      CBufferSetter(bool     , Bool)
+      CBufferSetter(float    , Float)
+      CBufferSetter(double   , Double)
+      CBufferSetter(long int , Int)
+
+#undef CBufferSetter
+
+      //---------------------------------------------------------------
+
+#define CBufferArraySetter(type, Type) \
+      void  CBuffer::set##Type##Array(ARRAY(type, 1) value, StdSize position) \
+      { this->setDataArray(value, position); }
+
+      CBufferArraySetter(char     , Char)
+      CBufferArraySetter(bool     , Bool)
+      CBufferArraySetter(float    , Float)
+      CBufferArraySetter(double   , Double)
+      CBufferArraySetter(long int , Int)
+
+#undef CBufferArraySetter
+
+      void CBuffer::setString(const StdString & value, StdSize position)
+      {
+         ARRAY_CREATE(arr, char, 1, [value.size()]);
+         std::copy(value.data(), &(value.data()[value.size()]), arr->data());
+         this->setCharArray(arr, position);
+      }
+
+      //---------------------------------------------------------------
+
+      void CBuffer::printToBinaryFile (const StdString & filename)
+      {
+         StdOFStream ofs(filename.c_str());
+         this->printToBinaryStream(ofs);
+         ofs.close();
+      }
+
+      void CBuffer::printToBinaryStream (StdOStream & ostr)
+      {  ostr.write (this->getData(), this->getSize()); }
+
+
+      StdSize CBuffer::getNextDataPosition(StdSize position) const
+      {
+         CBufferData  bufdata;
+         this->getBufferData(bufdata, position);
+         return (bufdata.size + bufdata.position);
+      }
+
+      //---------------------------------------------------------------
+
+      template <>
+         StdSize CBuffer::getRequestedSize(StdString data) const
+      { return (DATA_HEADER_SIZE + data.size() * sizeof (char)); }
+
+      ///--------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/buffer.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/buffer.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/buffer.hpp	(revision 152)
@@ -0,0 +1,140 @@
+#ifndef __XMLIO_CBuffer__
+#define __XMLIO_CBuffer__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CBuffer
+      {
+         public :
+
+         //--------------------------------------------------------------
+
+            typedef enum buffer_data_type
+            { TBOOL8 = 0, TINT32, TCHAR8, TFLOAT32, TDOUBLE64
+            } CBufferDataType;
+
+            typedef struct  buffer_data
+            { CBufferDataType type; bool isArray; size_t size; size_t position;
+            } CBufferData;
+
+         //--------------------------------------------------------------
+
+            /// Operateurs ///
+            operator char * (void);
+            char * operator[](StdSize position);
+
+            /// Accesseurs ///
+            StdSize getSize(StdSize position = 0) const;
+            char * getData(StdSize position = 0) const;
+
+            template <class T>
+               inline StdSize getRequestedSize(T data) const;
+            template <class T>
+               inline StdSize getRequestedSize(ARRAY(T, 1) data) const;
+
+            StdSize getNextDataPosition(StdSize position) const;
+
+         //--------------------------------------------------------------
+
+            char     getChar  (StdSize position) const;
+            bool     getBool  (StdSize position) const;
+            float    getFloat (StdSize position) const;
+            double   getDouble(StdSize position) const;
+            long int getInt   (StdSize position) const;
+
+            StdString getString(StdSize position) const;
+
+            ARRAY(char,     1) getCharArray  (StdSize position) const;
+            ARRAY(bool,     1) getBoolArray  (StdSize position) const;
+            ARRAY(float,    1) getFloatArray (StdSize position) const;
+            ARRAY(double,   1) getDoubleArray(StdSize position) const;
+            ARRAY(long int, 1) getIntArray   (StdSize position) const;
+
+         //--------------------------------------------------------------
+
+            /// Mutateurs ///
+            void setChar  (char     value, StdSize position) ;
+            void setBool  (bool     value, StdSize position) ;
+            void setFloat (float    value, StdSize position) ;
+            void setDouble(double   value, StdSize position) ;
+            void setInt   (long int value, StdSize position) ;
+
+            void setString(const StdString & value, StdSize position) ;
+
+            void setCharArray  (ARRAY(char,     1) value, StdSize position) ;
+            void setBoolArray  (ARRAY(bool,     1) value, StdSize position) ;
+            void setFloatArray (ARRAY(float,    1) value, StdSize position) ;
+            void setDoubleArray(ARRAY(double,   1) value, StdSize position) ;
+            void setIntArray   (ARRAY(long int, 1) value, StdSize position) ;
+
+         //--------------------------------------------------------------
+
+            virtual void clear(void) = 0;
+
+            /// Sortie fichier binaire ///
+            void printToBinaryFile (const StdString & filename);
+            void printToBinaryStream (StdOStream & ostr);
+
+            /// Sortie fichier ascii ///
+            virtual void printToTextFile (const StdString & filename) = 0;
+            virtual void printToTextStream (StdOStream & ostr) = 0;
+
+            /// Destructeur ///
+            virtual ~CBuffer(void);
+
+         protected :
+
+            /// Construteurs ///
+            CBuffer(char * data, StdSize size);
+            explicit CBuffer(StdSize size);
+            CBuffer(const CBuffer & buffer);         // Not implemented yet.
+            CBuffer(const CBuffer * const buffer);   // Not implemented yet.
+
+            /// Accesseurs protÃ©gÃ©s ///
+            void getBufferData(CBufferData & bufdata, StdSize position) const;
+
+            template <class T>
+               inline void getData(T & data, StdSize position) const;
+            template <class T>
+               inline void getDataArray(ARRAY(T, 1) data, StdSize position) const;
+
+            /// Mutateurs protÃ©gÃ©s ///
+
+            template <class T>
+               inline void setData(const T & data, StdSize position);
+            template <class T>
+               inline void setDataArray(const ARRAY(T, 1) data, StdSize position);
+
+            void setData(const char * data, StdSize size, StdSize position);
+
+         private :
+
+         //--------------------------------------------------------------
+
+            /// Accesseurs privÃ©s ///
+            void getData(char * data, StdSize size, StdSize position) const;
+            template <class T>
+               CBufferDataType getBufferDataType(void) const;
+
+            /// Mutateurs privÃ©s ///
+            void setBufferData(const CBufferData & bufdata, StdSize position);
+         //--------------------------------------------------------------
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            StdSize size;
+            char * idata;
+            bool delIdata;
+
+      }; // class CBuffer
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CBuffer__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/buffer_impl.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/buffer_impl.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/buffer_impl.hpp	(revision 152)
@@ -0,0 +1,97 @@
+#ifndef __XMLIO_CBuffer_impl__
+#define __XMLIO_CBuffer_impl__
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////// DÃ©finitions (inline) /////////////////// ///
+
+#define DATA_HEADER_SIZE  sizeof(CBufferDataType) + 2 * sizeof(StdSize) + sizeof(bool)
+
+      template <class T>
+         StdSize CBuffer::getRequestedSize(T data) const
+      { return (DATA_HEADER_SIZE + sizeof (T)); }
+
+      template <class T>
+         StdSize CBuffer::getRequestedSize(ARRAY(T, 1) data) const
+      { return (DATA_HEADER_SIZE + data->num_elements() * sizeof (T)); }
+
+      template <>
+         StdSize CBuffer::getRequestedSize(StdString data) const;
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         void CBuffer::getData(T & data, StdSize position) const
+      {
+         if (this->size < (position + this->getRequestedSize(data)))
+            ERROR("CBuffer::getData<T>(data, size, position)",
+                   << " Buffer size <  size + position !");
+         CBufferData bufdata;
+         this->getBufferData(bufdata, position);
+         if (bufdata.type != this->getBufferDataType<T>())
+            ERROR("CBuffer::getData(data, position)", << " invalid type !");
+         if (bufdata.isArray != false)
+            ERROR("CBuffer::getData(data, position)",
+                   << " type should be an array !");
+
+         this->getData(reinterpret_cast<char*>(&data), bufdata.size , bufdata.position);
+      }
+
+      template <class T>
+         void CBuffer::getDataArray(ARRAY(T, 1) data, StdSize position) const
+      {
+         CBufferData bufdata;
+         this->getBufferData(bufdata, position);
+         if (bufdata.type != this->getBufferDataType<T>())
+            ERROR("CBuffer::getDataArray(data, position)", << " invalid type !");
+         if (bufdata.isArray != true)
+            ERROR("CBuffer::getDataArray(data, position)",
+                  << " type should not be an array !");
+         if (this->size < (position + (DATA_HEADER_SIZE + bufdata.size)))
+            ERROR("CBuffer::getData<T>(data, size, position)",
+                   << " Buffer size <  size + position !");
+         data->resize(boost::extents[bufdata.size/sizeof(T)]);
+         this->getData(reinterpret_cast<char*>(data->data()), bufdata.size , bufdata.position);
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         void CBuffer::setData(const T & data, StdSize position)
+      {
+         if (this->size < (position + this->getRequestedSize(data)))
+            ERROR("CBuffer::setData<T>(data, size, position)",
+                   << " Buffer size <  size + position !");
+         CBufferData bufdata;
+         bufdata.type     = this->getBufferDataType<T>();
+         bufdata.isArray  = false;
+         bufdata.size     = sizeof(T);
+         bufdata.position = position + DATA_HEADER_SIZE;
+         this->setBufferData(bufdata, position);
+         this->setData(reinterpret_cast<const char*>(&data), bufdata.size , bufdata.position);
+      }
+
+      template <class T>
+         void CBuffer::setDataArray(const ARRAY(T, 1) data, StdSize position)
+      {
+         if (this->size < (position + this->getRequestedSize(data)))
+            ERROR("CBuffer::setDataArray<T>(data, size, position)",
+                   << " Buffer size <  size + position !");
+         CBufferData bufdata;
+         bufdata.type     = this->getBufferDataType<T>();
+         bufdata.isArray  = true;
+         bufdata.size     = data->num_elements() * sizeof (T);
+         bufdata.position = position + DATA_HEADER_SIZE;
+
+         this->setBufferData(bufdata, position);
+         this->setData(reinterpret_cast<const char*>(data->data()),
+                       bufdata.size , bufdata.position);
+      }
+      ///----------------------------------------------------------------
+
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CBuffer_impl__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/buffer_list.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/buffer_list.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/buffer_list.cpp	(revision 152)
@@ -0,0 +1,62 @@
+#include "buffer_list.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CBufferList::CBufferList(MPIComm com_client_server)
+         : SuperClass()
+         , com_client_server(com_client_server)
+         , nbbuffer(CMPIManager::GetCommSize(com_client_server) - 1)
+      {
+         for (StdSize i = 0; i < this->nbbuffer; i++)
+            SuperClass::push_back(BufferType(BUFFER_SERVER_SIZE));
+      }
+
+      CBufferList::~CBufferList(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      bool CBufferList::hasRequests(void) const
+      {
+         bool retvalue = true;
+         for (StdSize i = 0; i < this->nbbuffer; i++)
+            retvalue = retvalue && SuperClass::operator[](i).hasRequest();
+         return (retvalue);
+      }
+
+      void CBufferList::recvRequests(void)
+      {
+         while (!this->hasRequests())
+         {
+            for (int i = 1; i < CMPIManager::GetCommSize(com_client_server); i++)
+            {
+               if (CMPIManager::HasReceivedData(com_client_server, i))
+               {
+                  StdSize size = CMPIManager::GetReceivedDataSize(com_client_server, i);
+                  if (SuperClass::operator[](i-1).isAvailable(size))
+                     CMPIManager::ReceiveCircularBuffer
+                        (com_client_server, i, SuperClass::operator[](i-1));
+               }
+            }
+         }
+      }
+
+      std::vector<CLinearBuffer> CBufferList::getRequests(void)
+      {
+         std::vector<CLinearBuffer> retvalue;
+         for (StdSize i = 0; i < this->nbbuffer; i++)
+            retvalue.push_back(SuperClass::operator[](i).getNextRequest());
+         return (retvalue);
+      }
+
+      StdSize CBufferList::getNumberOfBuffers(void) const
+      { return (this->nbbuffer) ; }
+
+      ///--------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/buffer_list.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/buffer_list.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/buffer_list.hpp	(revision 152)
@@ -0,0 +1,54 @@
+#ifndef __XMLIO_CBufferList__
+#define __XMLIO_CBufferList__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "buffer.hpp"
+#include "circular_buffer.hpp"
+#include "linear_buffer.hpp"
+#include "manager/mpi_manager.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CBufferList
+         : public std::vector<CCircularBuffer>   // << pas une liste
+      {
+
+            /// DÃ©finition de type ///
+            typedef std::vector<CCircularBuffer> SuperClass;
+            typedef CCircularBuffer BufferType;
+
+         public :
+
+            /// Construteurs ///
+            CBufferList(MPIComm com_client_server = CMPIManager::GetCommWorld());
+            CBufferList(const CBufferList & buffer_list);         // Not implemented yet.
+            CBufferList(const CBufferList * const buffer_list);   // Not implemented yet.
+
+            /// Test ///
+            bool hasRequests(void) const;
+
+            /// Traitement ///
+            void recvRequests(void);
+
+            /// Accesseurs ///
+            StdSize getNumberOfBuffers(void) const;
+            std::vector<CLinearBuffer> getRequests(void);
+
+            /// Destructeur ///
+            virtual ~CBufferList(void);
+
+
+         private :
+
+            MPIComm com_client_server;
+            StdSize nbbuffer;
+
+      }; // class CBufferList
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CBufferList__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.cpp	(revision 152)
@@ -0,0 +1,12 @@
+#include "buffer_pair.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+
+   } // namespace tree
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/buffer_pair.hpp	(revision 152)
@@ -0,0 +1,42 @@
+#ifndef __XMLIO_CBufferPair__
+#define __XMLIO_CBufferPair__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "buffer.hpp"
+#include "circular_buffer.hpp"
+#include "linear_buffer.hpp"
+#include "manager/mpi_manager.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CBufferPair
+         : public std::pair<CLinearBuffer, CLinearBuffer>   // << pas une liste
+      {
+
+            /// DÃ©finition de type ///
+            typedef std::pair<CLinearBuffer, CLinearBuffer> SuperClass;
+            typedef CLinearBuffer BufferType;
+
+         public :
+
+            /// Construteurs ///
+            CBufferPair(MPIComm com_client_server = CMPIManager::GetCommWorld());
+            CBufferPair(const CBufferPair & buffer_pair);       // Not implemented yet.
+            CBufferPair(const CBufferPair * const buffer_pair); // Not implemented yet.
+
+            /// Destructeur ///
+            virtual ~CBufferPair(void);
+
+         private :
+
+            MPIComm com_client_server;
+
+      }; // class CBufferPair
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CBufferPair__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/calendar.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/calendar.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/calendar.cpp	(revision 152)
@@ -0,0 +1,105 @@
+#include "calendar.hpp"
+#include "duration.hpp"
+#include "date.hpp"
+#include "calendar_util.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CCalendar::CCalendar(void)
+         : CObject()
+         , initDate(*this)
+         , currentDate(initDate)
+      { /* Ne rien faire de plus */ }
+
+      CCalendar::CCalendar(const StdString & id,
+                           int yr, int mth, int d  ,
+                           int hr, int min, int sec)
+               : CObject(id)
+               , initDate(*this, yr, mth, d, hr, min, sec)
+               , currentDate(initDate)
+      { /* Ne rien faire de plus */ }
+
+      CCalendar::CCalendar(const StdString & id, const StdString & dateStr)
+               : CObject(id)
+               , initDate(CDate::FromString(dateStr, *this))
+               , currentDate(initDate)
+      { /* Ne rien faire de plus */ }
+
+      CCalendar::~CCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      StdString CCalendar::toString(void) const
+      {
+         StdOStringStream oss;
+         oss <<   "[type: "   << this->getId()
+             << ", start: "   << this->initDate
+             << ", current: " << this->currentDate << "]";
+         return (oss.str());
+      }
+
+      void CCalendar::fromString(const StdString & str)
+      { ERROR("CCalendar::fromString(str)",
+               << "[ str = " << str << "] Not implemented yet !"); }
+
+      //-----------------------------------------------------------------
+
+      void CCalendar::setTimeStep(const CDuration & duration)
+      { this->timestep = duration; }
+
+      CDate & CCalendar::update(void)
+      { return (this->getCurrentDate() = this->getCurrentDate() + this->timestep); }
+
+      //-----------------------------------------------------------------
+
+      const CDuration & CCalendar::getTimeStep(void) const { return (this->timestep); }
+      const CDate & CCalendar::getInitDate(void) const     { return (this->initDate); }
+      CDate & CCalendar::getCurrentDate(void)              { return (this->currentDate); }
+
+      //-----------------------------------------------------------------
+
+      int CCalendar::getMonthLength(const CDate & date) const
+      { // Retourne la durÃ©e du mois en jour.
+         static const int NoLeapMonthLength[] =
+            {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+         return (NoLeapMonthLength[date.getMonth()-1]);
+      }
+
+      StdString CCalendar::getType(void) const { return (StdString(this->getId())); }
+
+      int CCalendar::getYearTotalLength(const CDate & date) const { return (365 * 86400); }
+
+      int CCalendar::getYearLength  (void) const { return (12); }
+      int CCalendar::getDayLength   (void) const { return (24); }
+      int CCalendar::getHourLength  (void) const { return (60); }
+      int CCalendar::getMinuteLength(void) const { return (60); }
+
+      int CCalendar::getNbSecond(const CDate & date) const
+      { // Retourne le nombre de secondes Ã©coulÃ©es depuis le dÃ©but de l'annÃ©e.
+         CDate _d0(date); int  nbday = 0;
+
+         for(_d0.setMonth(1); _d0.getMonth() < date.getMonth(); _d0.setMonth(_d0.getMonth()+1))
+            nbday += getMonthLength(_d0);
+         return ((((nbday + date.getDay()) * getDayLength() + date.getHour()) * getHourLength()
+                     + date.getMinute()) * getMinuteLength() + date.getSecond());
+      }
+
+      StdString CCalendar::getMonthName(int month_id) const
+      {
+         static const StdString Monthname_str[] =
+            { "january", "february", "march"    , "april"  , "may"     , "june"    ,
+              "july"   , "august"  , "september", "october", "november", "december" };
+         return(Monthname_str[month_id-1]);
+      }
+
+      const StdString CCalendar::getMonthShortName(int month_id) const
+      { StdString value = this->getMonthName(month_id); value.resize(3); return (value); }
+
+      ///----------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/calendar.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/calendar.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/calendar.hpp	(revision 152)
@@ -0,0 +1,96 @@
+#ifndef __XMLIO_CCalendar__
+#define __XMLIO_CCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "date.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      typedef enum _monthEnum
+      {  JAN = 1, FEB = 2, MAR = 3, APR = 4 , MAY = 5 , JUN = 6 ,
+         JUL = 7, AUG = 8, SEP = 9, OCT = 10, NOV = 11, DEC = 12  } MonthEnum;
+
+      ///---------------------------------------------------------------
+
+      class CDate;
+
+      class CCalendar : public CObject
+      {
+            /// Typedef ///
+            typedef CObject SuperClass;
+
+         public :
+
+            /// Destructeur ///
+            virtual ~CCalendar(void);
+
+         protected :
+
+            /// Constructeurs ///
+            CCalendar(void);
+            CCalendar(const StdString & id,
+                      int yr = 0, int mth = 1, int d   = 1,
+                      int hr = 0, int min = 0, int sec = 0);
+            CCalendar(const StdString & id, const StdString & dateStr);
+            CCalendar(const CCalendar & calendar);       // Not implemented yet.
+            CCalendar(const CCalendar * const calendar); // Not implemented yet.
+
+         public :
+
+            //------------------------------------------------------------
+
+            /// Autres ///
+            virtual StdString toString(void) const;
+            virtual void fromString(const StdString & str);
+
+            /// Mutateur ///
+            void setTimeStep(const CDuration & duration);
+
+            /// Traitemants ///
+            CDate & update(void);
+
+            /// Accesseurs ///
+
+            const CDuration& getTimeStep(void) const;
+
+            const CDate & getInitDate(void) const;
+            CDate & getCurrentDate(void);
+
+            //------------------------------------------------------------
+            virtual int getMonthLength(const CDate & date) const;
+
+            virtual StdString getType(void) const;
+
+            virtual int getYearTotalLength(const CDate & date) const ; // Retourne la durÃ©e d'une annÃ©e en seconde.
+
+            virtual int getYearLength  (void) const; // Retourne la durÃ©e d'une annÃ©e en mois.
+            virtual int getDayLength   (void) const; // Retourne la durÃ©e d'un jour en heures.
+            virtual int getHourLength  (void) const; // Retourne la durÃ©e d'une heure en minute.
+            virtual int getMinuteLength(void) const; // Retourne la durÃ©e d'une minute en secondes.
+
+            virtual int getNbSecond(const CDate & date) const;
+            virtual StdString getMonthName(int month_id) const;
+
+            virtual const StdString getMonthShortName(int month_id) const;
+
+            //------------------------------------------------------------
+
+         private :
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            const CDate initDate;
+            CDate currentDate;
+            CDuration timestep;
+
+      }; // class CCalendar
+   } // namespace date
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CCalendar__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/calendar_util.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/calendar_util.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/calendar_util.cpp	(revision 152)
@@ -0,0 +1,143 @@
+#include "calendar_util.hpp"
+
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CDuration operator*(const double & scal, const CDuration & ddr)
+      { return (ddr * scal); }
+
+      CDuration operator-(const CDuration & ddr , const CDuration & dr)
+      {
+         CDuration dur(ddr);
+         dur.year -= dr.year;  dur.month  -= dr.month ; dur.day    -= dr.day;
+         dur.hour -= dr.hour;  dur.minute -= dr.minute; dur.second -= dr.second;
+         return (dur);
+      }
+
+      CDuration operator+(const CDuration & ddr , const CDuration & dr)
+      {
+         CDuration dur(ddr);
+         dur.year += dr.year;  dur.month  += dr.month ; dur.day    += dr.day;
+         dur.hour += dr.hour;  dur.minute += dr.minute; dur.second += dr.second;
+         return (dur);
+      }
+
+      CDuration operator*(const CDuration & ddr , const double & scal)
+      {
+         CDuration dur(ddr);
+         dur.year *= scal;  dur.month  *= scal; dur.day    *= scal;
+         dur.hour *= scal;  dur.minute *= scal; dur.second *= scal;
+         return (dur);
+      }
+
+      CDuration operator-(const CDuration & ddr)
+      {
+         CDuration dur(ddr);
+         dur.year = -dur.year;  dur.month  = -dur.month ; dur.day    = -dur.day;
+         dur.hour = -dur.hour;  dur.minute = -dur.minute; dur.second = -dur.second;
+         return (dur);
+      }
+
+      //-----------------------------------------------------------------
+
+      CDate operator+(const CDate & dt, const CDuration & dr)
+      {
+         CDuration drr (dr);
+         int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
+         const CCalendar & c = dt.getRelCalendar();
+
+         drr.resolve(dt.getRelCalendar());
+
+         // Ajustement des minutes par rapport aux secondes.
+         second += dt.getSecond() + drr.second;
+         if (second <  0) { minute --; second += c.getMinuteLength(); }
+         if (second >= c.getMinuteLength()) { minute ++; second -= c.getMinuteLength(); }
+
+         // Ajustement des heures en fonction des minutes.
+         minute += dt.getMinute() + drr.minute;
+         if (minute < 0) { hour --; minute += c.getHourLength(); }
+         if (minute >= c.getHourLength()) { hour ++; minute -= c.getHourLength(); }
+
+         // Ajustement des jours en fonction des heures.
+         hour += dt.getHour() + drr.hour;
+         if (hour <  0) { drr.day --; hour += c.getDayLength(); }
+         if (hour >= c.getDayLength()) { drr.day ++; hour -= c.getDayLength(); }
+
+         // Ajustement des mois en fonction des jours.
+         int signVal = drr.day/fabs(drr.day);
+         CDate dtt(dt); dtt.addMonth (signVal);
+
+         for(; c.getMonthLength(dtt) < fabs(drr.day); dtt.addMonth (signVal))
+         { drr.day -= signVal * c.getMonthLength(dtt); drr.month += signVal; }
+
+         day += dt.getDay() + drr.day;
+         if (day <  0) { drr.month --; day += c.getMonthLength(dtt); }
+         if (day >= c.getMonthLength(dtt)) { drr.month ++; day -= c.getMonthLength(dtt); } // << ProblÃšme ici
+         if (day == 0) day = c.getMonthLength(dtt);
+
+         drr.resolve(dt.getRelCalendar());
+
+         // Ajustement des annÃ©es en fonction des mois.
+         month += dt.getMonth() + drr.month;
+         if (month <  0) { year --; month += c.getYearLength(); }
+         if (month >= c.getYearLength()) { year ++; month -= c.getYearLength(); }
+         if (month == 0) month = c.getYearLength();
+
+         year += dt.getYear() + drr.year;
+
+         return (CDate(dt.getRelCalendar(), year, month, day, hour, minute, second));
+      }
+
+      CDate operator-(const CDate & dt, const CDuration & dr) { return (dt + (-dr)); }
+
+      //-----------------------------------------------------------------
+
+      CDuration operator-(const CDate & dt0, const CDate & dt1)
+      {
+         // TODO :: VÃ©rifier que les deux dates (dt0 et dt1) ont une rÃ©fÃ©rence vers le mÃªme calendrier.
+         CDuration dur =
+         { dt0.getYear() - dt1.getYear(), dt0.getMonth()  - dt1.getMonth() , dt0.getDay()    - dt1.getDay(),
+           dt0.getHour() - dt1.getHour(), dt0.getMinute() - dt1.getMinute(), dt0.getSecond() - dt1.getSecond() };
+         return (dur.resolve(dt0.getRelCalendar()));
+      }
+
+      //-----------------------------------------------------------------
+
+      /// Les opÃ©rateurs de comparaison. (Non testÃ©s pour le moment)
+      bool operator==(const CDate& dt0, const CDate& dt1)
+      {
+         // TODO :: VÃ©rifier que les deux dates (dt0 et dt1) ont une rÃ©fÃ©rence vers le mÃªme calendrier.
+         return ((dt0.getYear() == dt1.getYear()) && (dt0.getMonth()  == dt1.getMonth())  && (dt1.getDay()    == dt0.getDay()) &&
+                 (dt0.getHour() == dt1.getHour()) && (dt0.getMinute() == dt1.getMinute()) && (dt1.getSecond() == dt0.getSecond()));
+      }
+
+      bool operator< (const CDate& dt0, const CDate& dt1)
+      {
+         // TODO :: VÃ©rifier que les deux dates (dt0 et dt1) ont une rÃ©fÃ©rence vers le mÃªme calendrier.
+         if (dt0.getYear()   < dt1.getYear())   return true; if (dt0.getMonth()  < dt1.getMonth())  return true;
+         if (dt0.getDay()    < dt1.getDay())    return true; if (dt0.getHour()   < dt1.getHour())   return true;
+         if (dt0.getMinute() < dt1.getMinute()) return true; if (dt0.getSecond() < dt1.getSecond()) return true;
+         return false;
+      }
+
+      //-----------------------------------------------------------------
+
+      bool operator!=(const CDate & dt0, const CDate & dt1){ return !(dt1 == dt0); }
+      bool operator> (const CDate & dt0, const CDate & dt1){ return (dt1 < dt0); }
+      bool operator>=(const CDate & dt0, const CDate & dt1){ return ((dt0 > dt1) || (dt1 == dt0)); }
+      bool operator<=(const CDate & dt0, const CDate & dt1){ return ((dt0 < dt1) || (dt1 == dt0)); }
+
+      ///----------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
+
+
+
+
+
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/calendar_util.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/calendar_util.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/calendar_util.hpp	(revision 152)
@@ -0,0 +1,40 @@
+#ifndef __XMLIO_CCalendar_util__
+#define __XMLIO_CCalendar_util__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      CDuration operator*(const double    & scal, const CDuration & ddr);
+      CDuration operator-(const CDuration & ddr , const CDuration & dr);
+      CDuration operator+(const CDuration & ddr , const CDuration & dr);
+      CDuration operator*(const CDuration & ddr , const double    & scal);
+      CDuration operator-(const CDuration & ddr);
+
+      CDate operator+(const CDate & dt, const CDuration & dr); // Non testÃ©e.
+      CDate operator-(const CDate & dt, const CDuration & dr);
+
+      CDuration operator-(const CDate & dt0, const CDate & dt1);
+
+      /// Les opÃ©rateurs de comparaison. (Non testÃ©s pour le moment)
+      bool operator==(const CDate& dt0, const CDate& dt1);
+      bool operator< (const CDate& dt0, const CDate& dt1);
+
+      bool operator!=(const CDate & dt0, const CDate & dt1);
+      bool operator> (const CDate & dt0, const CDate & dt1);
+      bool operator>=(const CDate & dt0, const CDate & dt1);
+      bool operator<=(const CDate & dt0, const CDate & dt1);
+
+      ///---------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif //__XMLIO_CCalendar_util__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.cpp	(revision 152)
@@ -0,0 +1,202 @@
+#include "circular_buffer.hpp"
+
+#include "linear_buffer_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CCircularBuffer::CCircularBuffer(StdSize size)
+         : SuperClass(size), p_write(0), p_read(0), p_unused(0), nbrequest(0)
+      { /* Ne rien faire de plus */ }
+
+      CCircularBuffer::~CCircularBuffer(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      void CCircularBuffer::clear(void)
+      {
+         this-> p_write  = 0;
+         this-> p_read   = 0;
+         this-> p_unused = 0;
+      }
+
+      //-------------------------------------------------------------
+
+      StdSize CCircularBuffer::getNextRequestSize(void) const
+      {
+         if (!this->hasRequest())
+            ERROR("CCircularBuffer::getNextRequestSize()",
+                  << " invalid call !");
+         long int nbargs  = 0;
+         StdSize startpos = this-> p_read;
+         StdSize 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, currsize);
+            currsize += (bufdata.size + DATA_HEADER_SIZE);
+         }
+         return (currsize);
+      }
+
+      CLinearBuffer CCircularBuffer::getNextRequest(void)
+      {
+         StdSize startpos = this-> p_read;
+         StdSize currsize = this->getNextRequestSize();
+         this->movePRead(currsize);
+         this->nbrequest--;
+         return (CLinearBuffer(SuperClass::getData(startpos), currsize));
+      }
+
+      //-------------------------------------------------------------
+
+      void CCircularBuffer::appendRequest(const CLinearBuffer & brequest)
+      {
+         StdSize usedsize   = brequest.getUsedSize();
+         if (!this->isAvailable(usedsize))
+            ERROR("CCircularBuffer::appendRequest(brequest)",
+                  << " invalid call !");
+         StdSize data_begin = this->prepareNextDataPosition(usedsize);
+         SuperClass::setData(brequest.getData(), usedsize, data_begin);
+         this->updateNbRequests(data_begin, data_begin + usedsize);
+      }
+
+      //-------------------------------------------------------------
+
+      char * CCircularBuffer::prepareNextData(StdSize data_size)
+      {
+         return (SuperClass::getData(this->prepareNextDataPosition(data_size)));
+      }
+
+
+      StdSize CCircularBuffer::prepareNextDataPosition(StdSize data_size)
+      {
+         StdSize startpos = this-> p_write;
+         if (!this->isAvailable(data_size))
+            ERROR("CCircularBuffer::prepareNextDataPosition(data_size)",
+                  << " invalid call !");
+         if ((this-> p_write + data_size) > SuperClass::getSize())
+            startpos = 0;
+
+         this->movePWrite(data_size);
+         return (startpos);
+      }
+
+      //-------------------------------------------------------------
+
+      void CCircularBuffer::movePRead(StdSize data_size)
+      {
+         this-> p_read += data_size;
+         if (this-> p_read == this-> p_unused)
+         {
+            this-> p_unused = this-> p_write;
+            this-> p_read   = 0;
+         }
+         if (this-> p_read == this-> p_write)
+            this->clear();
+      }
+
+      void CCircularBuffer::movePWrite(StdSize 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))
+               ERROR("CCircularBuffer::movePWrite(data_size)",
+                     << " invalid position 1 !");
+         }
+         else
+         {
+            if ((this-> p_read > this-> p_write) &&
+                (this-> p_read < (this-> p_write + data_size)))
+               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;
+         }
+      }
+
+      //-------------------------------------------------------------
+
+      bool CCircularBuffer::hasRequest(void) const
+      { return (this->nbrequest != 0); }
+
+      bool CCircularBuffer::isAvailable(StdSize 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);
+      }
+      //---------------------------------------------------------------
+
+      void CCircularBuffer::printToTextFile (const StdString & filename)
+      {
+         StdOFStream ofs(filename.c_str());
+         this->printToTextStream(ofs);
+         ofs.close();
+      }
+
+      void CCircularBuffer::printToTextStream (StdOStream & ostr)
+      {
+         StdSize _p_write   = p_write,
+                 _p_read    = p_read,
+                 _p_unused  = p_unused,
+                 _nbrequest = nbrequest;
+
+         while (this->hasRequest())
+         {
+            this->getNextRequest().printToTextStream(ostr);
+            ostr << std::endl;
+         }
+
+         p_write   = _p_write;
+         p_read    = _p_read;
+         p_unused  = _p_unused;
+         nbrequest = _nbrequest;
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CCircularBuffer::getNumberOfRequest(void) const
+      { return (this->nbrequest); }
+
+      StdSize CCircularBuffer::getReadPosition(void) const
+      { return (this->p_read); }
+
+      StdSize CCircularBuffer::getWritePosition(void) const
+      { return (this->p_write); }
+
+      StdSize CCircularBuffer::getUnusedPosition(void) const
+      { return (this->p_unused); }
+
+      //---------------------------------------------------------------
+
+      void CCircularBuffer::updateNbRequests(StdSize data_begin, StdSize data_end)
+      {
+         StdSize position = data_begin;
+         while (position != data_end)
+         {
+            this->nbrequest++;
+            position = SuperClass::getNextDataPosition(position); // manager id
+            position = SuperClass::getNextDataPosition(position); // method id
+            long int nbarg = SuperClass::getInt(position);
+            position = SuperClass::getNextDataPosition(position);
+            for (long int i = 0; i < nbarg; i++)
+               position = SuperClass::getNextDataPosition(position);
+         }
+      }
+
+      ///------------------------------------------------------------
+   } // namespace tree
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/circular_buffer.hpp	(revision 152)
@@ -0,0 +1,72 @@
+#ifndef __XMLIO_CCircularBuffer__
+#define __XMLIO_CCircularBuffer__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "linear_buffer.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CCircularBuffer
+         : public CBuffer
+      {
+
+            /// DÃ©finition de type ///
+            typedef CBuffer SuperClass;
+
+         public :
+
+            /// Construteurs ///
+            explicit CCircularBuffer(StdSize size);
+            CCircularBuffer(const CCircularBuffer & cbuffer);         // Not implemented yet.
+            CCircularBuffer(const CCircularBuffer * const cbuffer);   // Not implemented yet.
+
+            /// Mutateurs ///
+            virtual void clear(void);
+
+            char * prepareNextData(StdSize data_size);
+            StdSize prepareNextDataPosition(StdSize data_size);
+
+            void appendRequest(const CLinearBuffer & brequest);
+
+            void updateNbRequests(StdSize data_begin, StdSize data_end);
+
+            /// Test ///
+            bool hasRequest(void) const ;
+            bool isAvailable(StdSize data_size) const;
+
+            /// Accesseurs ///
+            CLinearBuffer getNextRequest(void);
+            StdSize getNumberOfRequest(void) const;
+
+            StdSize getReadPosition(void) const;
+            StdSize getWritePosition(void) const;
+            StdSize getUnusedPosition(void) const;
+
+            /// Sortie fichier ascii ///
+            virtual void printToTextFile (const StdString & filename);
+            virtual void printToTextStream (StdOStream & ostr);
+
+            /// Destructeur ///
+            virtual ~CCircularBuffer(void);
+
+         private :
+
+            /// Mutateurs privÃ©s ///
+            void movePWrite(StdSize data_size);
+            void movePRead(StdSize data_size);
+
+            /// Accesseurs privÃ©s ///
+            StdSize getNextRequestSize(void) const;
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            StdSize p_write, p_read, p_unused, nbrequest;
+
+      }; // class CCircularBuffer
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CCircularBuffer__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/config/axis_attribute.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/axis_attribute.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/axis_attribute.conf	(revision 152)
@@ -0,0 +1,10 @@
+DECLARE_ATTRIBUTE(StdString, name)
+DECLARE_ATTRIBUTE(StdString, standard_name)
+DECLARE_ATTRIBUTE(StdString, long_name)
+
+DECLARE_ATTRIBUTE(StdString, unit)
+
+DECLARE_ATTRIBUTE(int,       size)
+DECLARE_ATTRIBUTE(ARRAY(double, 1), zvalue)
+
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/config/context_attribute.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/context_attribute.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/context_attribute.conf	(revision 152)
@@ -0,0 +1,2 @@
+DECLARE_ATTRIBUTE(StdString, calendar_type)
+DECLARE_ATTRIBUTE(StdString, start_date)
Index: XMLIO_V2/dev/dev_rv/src/xmlio/config/domain_attribute.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/domain_attribute.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/domain_attribute.conf	(revision 152)
@@ -0,0 +1,30 @@
+DECLARE_ATTRIBUTE(StdString, name)
+DECLARE_ATTRIBUTE(StdString, standard_name)
+DECLARE_ATTRIBUTE(StdString, long_name)
+
+DECLARE_ATTRIBUTE(int,       ni_glo)
+DECLARE_ATTRIBUTE(int,       nj_glo)
+
+DECLARE_ATTRIBUTE(int,       ibegin)
+DECLARE_ATTRIBUTE(int,       iend)
+DECLARE_ATTRIBUTE(int,       ni)
+
+DECLARE_ATTRIBUTE(int,       jbegin)
+DECLARE_ATTRIBUTE(int,       jend)
+DECLARE_ATTRIBUTE(int,       nj)
+
+DECLARE_ATTRIBUTE(ARRAY(bool, 2), mask)
+
+DECLARE_ATTRIBUTE(int,       data_dim)
+DECLARE_ATTRIBUTE(int,       data_ni)
+DECLARE_ATTRIBUTE(int,       data_nj)
+DECLARE_ATTRIBUTE(int,       data_ibegin)
+DECLARE_ATTRIBUTE(int,       data_jbegin)
+
+DECLARE_ATTRIBUTE(int,           data_n_index)
+DECLARE_ATTRIBUTE(ARRAY(int, 1), data_i_index)
+DECLARE_ATTRIBUTE(ARRAY(int, 1), data_j_index)
+
+DECLARE_ATTRIBUTE(ARRAY(double, 1), lonvalue)
+DECLARE_ATTRIBUTE(ARRAY(double, 1), latvalue)
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/config/field_attribute.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/field_attribute.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/field_attribute.conf	(revision 152)
@@ -0,0 +1,18 @@
+DECLARE_ATTRIBUTE(StdString, name)
+DECLARE_ATTRIBUTE(StdString, standard_name)
+DECLARE_ATTRIBUTE(StdString, long_name)
+
+DECLARE_ATTRIBUTE(StdString, unit)
+DECLARE_ATTRIBUTE(StdString, operation)
+
+DECLARE_ATTRIBUTE(StdString, freq_op)
+DECLARE_ATTRIBUTE(int,       level)
+DECLARE_ATTRIBUTE(int,       prec)
+
+DECLARE_ATTRIBUTE(bool,      enabled)
+
+DECLARE_ATTRIBUTE(StdString, domain_ref)
+DECLARE_ATTRIBUTE(StdString, axis_ref)
+DECLARE_ATTRIBUTE(StdString, grid_ref)
+DECLARE_ATTRIBUTE(StdString, zoom_ref)
+DECLARE_ATTRIBUTE(StdString, field_ref)
Index: XMLIO_V2/dev/dev_rv/src/xmlio/config/file_attribute.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/file_attribute.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/file_attribute.conf	(revision 152)
@@ -0,0 +1,10 @@
+DECLARE_ATTRIBUTE(StdString, name)
+DECLARE_ATTRIBUTE(StdString, description)
+
+DECLARE_ATTRIBUTE(StdString, output_freq)
+
+DECLARE_ATTRIBUTE(int,       output_level)
+
+DECLARE_ATTRIBUTE(bool,      enabled)
+
+// DECLARE_ATTRIBUTE_DEF(bool, enabled, true)
Index: XMLIO_V2/dev/dev_rv/src/xmlio/config/grid_attribute.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/grid_attribute.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/grid_attribute.conf	(revision 152)
@@ -0,0 +1,5 @@
+DECLARE_ATTRIBUTE(StdString, name)
+DECLARE_ATTRIBUTE(StdString, description)
+DECLARE_ATTRIBUTE(StdString, domain_ref)
+DECLARE_ATTRIBUTE(StdString, axis_ref)
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/config/method_attribute.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/method_attribute.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/method_attribute.conf	(revision 152)
@@ -0,0 +1,1 @@
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/config/node_type.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/node_type.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/node_type.conf	(revision 152)
@@ -0,0 +1,34 @@
+#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/src/xmlio/config/properties.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/properties.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/properties.conf	(revision 152)
@@ -0,0 +1,20 @@
+/// Author ///
+DECLARE_PROPERTY  (StdString, AUTHOR, "OZDOBA HervÃ©, MEURDESOIF Yann")
+
+/// Version number ///
+DECLARE_PROPERTY  (StdString, VERSION, "0.1")
+
+/// Time name ///
+DECLARE_PROPERTY  (StdString, TIME_NAME, "time")
+
+/// Output config ///
+DECLARE_PROPERTY  (StdString, NETCDF_OUTPUT,  "MULTI_FILE") // (ONE_FILE, TWO_FILE, MULTI_FILE)
+DECLARE_PROPERTY  (StdString, FILE_SUFFIX,    "_node"   )
+DECLARE_PROPERTY  (StdString, FILE_EXTENSION, ".nc"     )
+DECLARE_PROPERTY  (StdString, OUTPUT_PATH,    "./data/" )
+
+/// Buffer Size ///
+DECLARE_PROPERTY (StdSize, BUFFER_CLIENT_SIZE, 1E6) // 1 Mo
+DECLARE_PROPERTY (StdSize, BUFFER_SERVER_SIZE, 1E6) // 10 Mo
+
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/config/var_attribute.conf
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/config/var_attribute.conf	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/config/var_attribute.conf	(revision 152)
@@ -0,0 +1,1 @@
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/configure.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/configure.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/configure.cpp	(revision 152)
@@ -0,0 +1,14 @@
+#define __XMLIO_Configure__ // < Ne pas supprimer
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+/// /////////// Macros /////////// ///
+#undef  DECLARE_PROPERTY
+#define DECLARE_PROPERTY(type, name, value) \
+   type name = value;
+
+namespace xmlioserver
+{
+#include "config/properties.conf"
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/configure.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/configure.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/configure.hpp	(revision 152)
@@ -0,0 +1,16 @@
+#ifndef __XMLIO_Configure__
+#define __XMLIO_Configure__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+/// /////////// Macros /////////// ///
+#define DECLARE_PROPERTY(type, name, value) \
+   extern type name; // = value
+
+namespace xmlioserver
+{
+#include "config/properties.conf"
+} // namespace xmlioserver
+
+#endif // __XMLIO_Configure__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/data_output.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/data_output.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/data_output.cpp	(revision 152)
@@ -0,0 +1,67 @@
+#include "data_output.hpp"
+
+#include "attribute_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CDataOutput::~CDataOutput(void)
+      { /* Ne rien faire de plus */ }
+
+      void CDataOutput::writeGrid
+         (const boost::shared_ptr<tree::CGrid> grid)
+      {
+         if (grid->domain_ref.isEmpty())
+            ERROR("CONetCDF4Adv::writeGrid(grid)",
+                   << " domain is not defined !");
+
+         if (grid->axis_ref.isEmpty())
+         {
+            this->writeGrid
+            (CObjectFactory::GetObject<tree::CDomain>(grid->domain_ref.getValue()));
+         }
+         else
+         {
+            this->writeGrid
+            (CObjectFactory::GetObject<tree::CDomain>(grid->domain_ref.getValue()),
+             CObjectFactory::GetObject<tree::CAxis>(grid->axis_ref.getValue()));
+         }
+      }
+
+      void CDataOutput::writeFile
+         (const boost::shared_ptr<tree::CFile>  file)
+      {
+         this->writeFile_(file);
+      }
+
+      void CDataOutput::writeGrid
+         (const boost::shared_ptr<tree::CDomain> domain,
+          const boost::shared_ptr<tree::CAxis> axis)
+      {
+         this->writeDomain_(domain);
+         this->writeAxis_(axis);
+      }
+
+      void CDataOutput::writeGrid
+         (const boost::shared_ptr<tree::CDomain> domain)
+      {
+         this->writeDomain_(domain);
+      }
+
+      void CDataOutput::writeField
+         (const boost::shared_ptr<tree::CField> field)
+      {
+         this->writeField_(field);
+      }
+
+      void CDataOutput::writeFieldGrid
+         (const boost::shared_ptr<tree::CField> field)
+      {
+         this->writeGrid(field->getRelGrid());
+      }
+
+   } // namespace io
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/data_output.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/data_output.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/data_output.hpp	(revision 152)
@@ -0,0 +1,57 @@
+#ifndef __XMLIO_DATA_OUTPUT__
+#define __XMLIO_DATA_OUTPUT__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "node/grid.hpp"
+#include "node/field.hpp"
+
+#include <mpi.h>
+#include <netcdf.h>
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CDataOutput
+      {
+         public :
+
+            /// DÃ©finition de type ///
+            typedef enum { ONE_FILE = 0, MULTI_GROUP, MULTI_FILE } EDataOutputType;
+
+            /// Ecriture ///
+            void writeFile     (const boost::shared_ptr<tree::CFile>  file);
+            void writeField    (const boost::shared_ptr<tree::CField> field);
+            void writeFieldGrid(const boost::shared_ptr<tree::CField> field);
+            void writeFieldData(const boost::shared_ptr<tree::CField> field);
+
+            virtual void definition_start(void) = 0;
+            virtual void definition_end(void)   = 0;
+
+            virtual ~CDataOutput(void);
+
+         protected:
+
+            /// Ecriture ///
+            void writeGrid(const boost::shared_ptr<tree::CGrid>   grid);
+            void writeGrid(const boost::shared_ptr<tree::CDomain> domain,
+                           const boost::shared_ptr<tree::CAxis>   axis);
+            void writeGrid(const boost::shared_ptr<tree::CDomain> domain);
+
+            virtual void writeFile_  (const boost::shared_ptr<tree::CFile>   file)   = 0;
+            virtual void writeField_ (const boost::shared_ptr<tree::CField>  field)  = 0;
+            virtual void writeDomain_(const boost::shared_ptr<tree::CDomain> domain) = 0;
+            virtual void writeAxis_  (const boost::shared_ptr<tree::CAxis>   axis)   = 0;
+
+            /// PropriÃ©tÃ©s protÃ©gÃ©es ///
+            EDataOutputType type;
+
+      }; // class CDataOutput
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_DATA_OUTPUT__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.cpp	(revision 152)
@@ -0,0 +1,111 @@
+#include "data_treatment.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+#include "object_factory_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace data
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CDataTreatment::CDataTreatment (boost::shared_ptr<CContext> _ctxt)
+         : currentContext(_ctxt), enabledFiles()
+      { this->doTreatment(); }
+
+      CDataTreatment::~CDataTreatment(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      const boost::shared_ptr<CContext>
+         CDataTreatment::getCurrentContext(void) const
+      {
+         return (this->currentContext);
+      }
+
+      const std::vector<boost::shared_ptr<CFile> > &
+         CDataTreatment::getEnabledFiles (void) const
+      {
+         return (this->enabledFiles);
+      }
+
+      //----------------------------------------------------------------
+
+      void CDataTreatment::doTreatment(void)
+      {
+         // RÃ©solution des hÃ©ritages pour le context actuel.
+         //std::cout << "(Message temporaire) RÃ©solution des hÃ©ritages ..." << std::endl;
+         this->solveAllInheritance();
+
+         //Initialisation du vecteur 'enabledFiles' contenant la liste des fichiers Ã  sortir.
+         //std::cout << "(Message temporaire) Initialisation du vecteur enabledFiles ..." << std::endl;
+         this->findEnabledFiles();
+
+         //Recherche des champs Ã  sortir (enable Ã  true + niveau de sortie correct)
+         // pour chaque fichier prÃ©cÃ©demment listÃ©.
+         //std::cout << "(Message temporaire) Recherche des champs Ã  sortir ..." << std::endl;
+         this->findAllEnabledFields();
+
+         // RÃ©solution des rÃ©fÃ©rences de grilles pour chacun des champs.
+         //std::cout << "(Message temporaire) RÃ©solution des rÃ©fÃ©rences de grilles ..." << std::endl;
+         this->solveAllGridRef();
+
+         // Traitement des opÃ©rations.
+         this->solveAllOperation();
+
+         //std::cout << "(Message temporaire) fin traitement sorties ..." << std::endl;
+      }
+
+      void CDataTreatment::findAllEnabledFields(void)
+      {
+         for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
+            (void)this->enabledFiles[i]->getEnabledFields();
+      }
+
+      void CDataTreatment::solveAllGridRef(void)
+      {
+         for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
+            this->enabledFiles[i]->solveEFGridRef();
+      }
+
+      void CDataTreatment::solveAllOperation(void)
+      {
+         for (unsigned int i = 0; i < this->enabledFiles.size(); i++)
+            this->enabledFiles[i]->solveEFOperation();
+      }
+
+      void CDataTreatment::solveAllInheritance(void) const
+      {
+         // RÃ©solution des hÃ©ritages descendants (cÃ d des hÃ©ritages de groupes)
+         // pour chacun des contextes.
+         this->currentContext->solveDescInheritance();
+
+         // RÃ©solution des hÃ©ritages par rÃ©fÃ©rence au niveau des fichiers.
+          const std::vector<boost::shared_ptr<CFile> > & allFiles
+            = CObjectFactory::GetObjectVector<CFile>();
+
+         for (unsigned int i = 0; i < allFiles.size(); i++)
+            allFiles[i]->solveFieldRefInheritance();
+      }
+
+      void CDataTreatment::findEnabledFiles(void)
+      {
+         const std::vector<boost::shared_ptr<CFile> > & allFiles
+            = CObjectFactory::GetObjectVector<CFile>();
+
+         for (unsigned int i = 0; i < allFiles.size(); i++)
+            if (!allFiles[i]->enabled.isEmpty()) // Si l'attribut 'enabled' est dÃ©fini.
+               if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixÃ© Ã  vrai.
+                  enabledFiles.push_back(allFiles[i]);
+
+         if (enabledFiles.size() == 0)
+            DEBUG(<<"Aucun fichier ne va Ãªtre sorti dans le contexte nommÃ© \""
+                  << this->currentContext->getId() << "\" !");
+      }
+
+      ///---------------------------------------------------------------
+
+   } // namespace data
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.hpp	(revision 152)
@@ -0,0 +1,78 @@
+#ifndef __XMLIO_CDataTreatment__
+#define __XMLIO_CDataTreatment__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "node/node_type.hpp"
+#include "manager/mpi_manager.hpp"
+#include "data_output.hpp"
+
+namespace xmlioserver
+{
+   namespace data
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CDataTreatment
+      {
+         public :
+
+            /// Construteurs ///
+            CDataTreatment
+               (boost::shared_ptr<CContext> _ctxt =
+                  CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId()));
+
+            CDataTreatment(const CDataTreatment & data_treatment);       // Not implemented yet.
+            CDataTreatment(const CDataTreatment * const data_treatment); // Not implemented yet.
+
+            /// Accesseurs ///
+            const boost::shared_ptr<CContext> getCurrentContext(void) const;
+            const std::vector<boost::shared_ptr<CFile> > & getEnabledFiles  (void) const;
+
+            /// Creation des sorties ///
+            template <class T> void createDataOutput(void);
+
+            /// Destructeur ///
+            ~CDataTreatment(void);
+
+         private :
+
+            /// Traitements ///
+            void doTreatment(void);
+
+            void findAllEnabledFields(void);
+            void solveAllGridRef(void);
+            void solveAllOperation(void);
+            void solveAllInheritance(void) const;
+            void findEnabledFiles(void);
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            boost::shared_ptr<CContext> currentContext;
+            std::vector<boost::shared_ptr<CFile> > enabledFiles;
+
+      }; // CDataTreatment
+
+      //----------------------------------------------------------------
+
+      template <class T>
+         void CDataTreatment::createDataOutput(void)
+      {
+         std::vector<boost::shared_ptr<CFile> >::const_iterator
+            it = this->enabledFiles.begin(), end = this->enabledFiles.end();
+         
+         for (; it != end; it++)
+         {
+            boost::shared_ptr<CFile> file = *it;
+            StdString filename = (!file->name.isEmpty())
+                               ? file->name.getValue() : file->getId();
+            StdOStringStream oss;
+            oss << "data/" << filename << "_node" << comm::CMPIManager::GetCommRank() << ".nc";
+            boost::shared_ptr<io::CDataOutput> dout(new T(oss.str(), false));
+            file->initializeDataOutput(dout);
+         }
+      }
+
+   } // namespace data
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CDataTreatment__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date.cpp	(revision 152)
@@ -0,0 +1,156 @@
+#include "date.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CDate::CDate(const CCalendar& calendar,
+                   int yr, int mth, int d,
+                   int hr, int min, int sec)
+         : relCalendar(calendar)
+         , year(yr), month(mth) , day(d)
+         , hour(hr), minute(min), second(sec)
+      {
+         if(!this->checkDate())
+            DEBUG(<< "La date initialisÃ©e a Ã©tÃ© modifiÃ©e "
+                  << "car elle Ã©tait incorrecte par rapport au calendrier souhaitÃ©.");
+      }
+
+      CDate::CDate(const CDate & date)
+            : relCalendar(date.getRelCalendar()),
+              year(date.year), month(date.month)  , day(date.day),
+              hour(date.hour), minute(date.minute), second(date.second)
+      {
+         if(!this->checkDate())
+            DEBUG(<< "La date initialisÃ©e a Ã©tÃ© modifiÃ©e "
+                  << "car elle Ã©tait incorrecte par rapport au calendrier souhaitÃ©.");
+      }
+
+      CDate::~CDate(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      CDate & CDate::operator=(const CDate & date)
+      {
+         // relCalendar = d.getRelCalendar(); << inutile si fonction bien utilisÃ©e
+         year = date.year; month  = date.month ; day    = date.day;
+         hour = date.hour; minute = date.minute; second = date.second;
+         return (*this);
+      }
+
+      StdOStream & operator<<(StdOStream & out, const CDate & date)
+      {
+         out << date.day  << '/' << date.month  << '/' << date.year   << '-'
+             << date.hour << ':' << date.minute << ':' << date.second;
+         return (out);
+      }
+
+      StdIStream & operator>>(StdIStream & in, CDate & date) // Non testÃ©e.
+      {
+         char c = '/'; // Le caractÃšre c est utilisÃ© pour "recueillir" les sÃ©parateurs "/" et ":".
+         in >> date.day  >> c >> date.month  >> c >> date.year   >> c;
+         in >> date.hour >> c >> date.minute >> c >> date.second;
+         if(!date.checkDate())
+            DEBUG("La date initialisÃ©e (depuis une chaÃ®ne de caractÃšres) "
+                  << "a Ã©tÃ© modifiÃ©e car elle Ã©tait incorrecte "
+                  << "par rapport au calendrier souhaitÃ©.");
+         return (in);
+      }
+
+      CDate::operator Time(void) // Non vÃ©rifiÃ©e, pas optimisÃ©e ...
+      {
+         // Todo : Tester si la date courante est supÃ©rieure Ã  la date initiale.
+         Time retvalue = - relCalendar.getNbSecond(relCalendar.getInitDate())
+                         + relCalendar.getNbSecond(*this);
+
+         if ((relCalendar.getId().compare("D360")    == 0) ||
+             (relCalendar.getId().compare("AllLeap") == 0) ||
+             (relCalendar.getId().compare("NoLeap")  == 0))
+         return (retvalue + (getYear() - relCalendar.getInitDate().getYear())
+                                       * relCalendar.getYearTotalLength(*this));
+
+         for(CDate _d(relCalendar.getInitDate());
+            _d.getYear() < getYear(); _d.setYear(_d.getYear()+1))
+            retvalue += relCalendar.getYearTotalLength(_d);
+         return (retvalue);
+      }
+
+      //----------------------------------------------------------------
+
+      bool CDate::checkDate(void)
+      {
+         bool retValue = true;
+
+         // VÃ©rificatio de la valeur du mois.
+         if (month  < 1) { retValue = false; month  = 1; }
+         if (month  > relCalendar.getYearLength())
+         { retValue = false; month = relCalendar.getYearLength(); }
+
+         // VÃ©rification de la valeur du jour.
+         if (day    < 1) { retValue = false; month  = 1; }
+         if (day    > relCalendar.getMonthLength(*this))
+         { retValue = false; day = relCalendar.getMonthLength(*this); }
+
+         // VÃ©rification de la valeur de l'heure.
+         if (hour   < 0) { retValue = false; hour  = 0; }
+         if (hour   >= relCalendar.getDayLength())
+         { retValue = false; hour = relCalendar.getDayLength()-1; }
+
+         // VÃ©rification de la valeur des minutes.
+         if (minute < 0) { retValue = false; minute = 0; }
+         if (minute >= relCalendar.getHourLength())
+         { retValue = false; minute = relCalendar.getHourLength()-1; }
+
+         // VÃ©rification de la valeur des secondes.
+         if (second < 0) { retValue = false; month  = 0; }
+         if (second >= relCalendar.getMinuteLength())
+         { retValue = false; second = relCalendar.getMinuteLength()-1; }
+
+         return retValue;
+      }
+
+      //----------------------------------------------------------------
+
+      int CDate::getYear  (void) const { return (this->year  ); }
+      int CDate::getMonth (void) const { return (this->month ); }
+      int CDate::getDay   (void) const { return (this->day   ); }
+      int CDate::getHour  (void) const { return (this->hour  ); }
+      int CDate::getMinute(void) const { return (this->minute); }
+      int CDate::getSecond(void) const { return (this->second); }
+
+      //----------------------------------------------------------------
+
+      const CCalendar & CDate::getRelCalendar(void) const
+      { return (this->relCalendar); }
+
+      //----------------------------------------------------------------
+
+      void CDate::setYear  (int newyear)  { this->year  = newyear; }
+      void CDate::setMonth (int newmonth) { this->month = newmonth; }
+
+      //----------------------------------------------------------------
+
+      void CDate::addMonth (int value)
+      {// Value doit Ãªtre Ã©gale Ã  1 ou -1.
+         this->month += value;
+         if (this->month == 13) { year++; this->month = 1 ; }
+         if (this->month == 0 ) { year--; this->month = 12; }
+      }
+
+      //----------------------------------------------------------------
+
+      CDate FromString(const StdString & str, const CCalendar & calendar)
+      {
+         CDate dt(calendar);
+         StdIStringStream iss(str);
+         iss >> dt;
+         return dt;
+      }
+
+      ///---------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date.hpp	(revision 152)
@@ -0,0 +1,76 @@
+#ifndef __XMLIO_CDate__
+#define __XMLIO_CDate__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "duration.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CCalendar;
+
+      class CDate
+      {
+         public :
+
+            /// Constructeurs ///
+            CDate(void);                      // Not implemented yet
+            CDate(const CCalendar & cal,
+                  int yr = 0, int mth = 1, int d   = 1,
+                  int hr = 0, int min = 0, int sec = 0);
+            CDate(const CDate & odate);
+            CDate(const CDate * const odate); // Not implemented yet
+
+            /// Destructeur ///
+            ~CDate(void);
+
+            /// OpÃ©rateurs ///
+            CDate & operator=(const CDate & date);
+            friend StdOStream & operator<<(StdOStream & out, const CDate & date);
+            friend StdIStream & operator>>(StdIStream & in, CDate & date); // Non testÃ©e.
+
+            operator Time(void);  // Retourne le nombre de secondes Ã©coulÃ©es depuis la date initiale dÃ©finie dans le calendrier.
+
+            /// Traitements ///
+            bool checkDate(void); // VÃ©rifie la validitÃ© de la date.
+
+            /// Divers accesseurs ///
+            int getYear  (void) const;
+            int getMonth (void) const;
+            int getDay   (void) const;
+            int getHour  (void) const;
+            int getMinute(void) const;
+            int getSecond(void) const;
+
+            const CCalendar & getRelCalendar(void) const;
+
+            /// Mutateurs ///
+            void setYear  (int newyear);
+            void setMonth (int newmonth);
+
+            void addMonth (int value);
+
+            /// Autres ///
+            StdString toString(void) const;
+
+         public : /* static */
+
+            static CDate FromString(const StdString & str, const CCalendar & calendar);
+
+         private :
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            const CCalendar & relCalendar; // Calendrier liÃ© Ã  la Date.
+            int year, month, day, hour, minute, second; // AnnÃ©e, mois, ...
+
+
+      }; // class CDate;
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CDate__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/allleap.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/allleap.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/allleap.cpp	(revision 152)
@@ -0,0 +1,38 @@
+#include "allleap.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CAllLeapCalendar::CAllLeapCalendar(const StdString & dateStr)
+         : CCalendar("AllLeap", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CAllLeapCalendar::CAllLeapCalendar(int yr, int mth, int d,
+                                         int hr, int min, int sec)
+         : CCalendar("AllLeap", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CAllLeapCalendar::~CAllLeapCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      int CAllLeapCalendar::getYearTotalLength(const CDate & date) const
+      { return (366 * 86400); }
+
+      int CAllLeapCalendar::getMonthLength(const CDate & date) const
+      {
+         if (date.getMonth() == 2) return (29);
+         return (CCalendar::getMonthLength(date));
+      }
+
+      StdString CAllLeapCalendar::getType(void) const
+      { return (StdString("allleap")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/allleap.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/allleap.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/allleap.hpp	(revision 152)
@@ -0,0 +1,41 @@
+#ifndef __XMLIO_CAllLeapCalendar__
+#define __XMLIO_CAllLeapCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CAllLeapCalendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CAllLeapCalendar(void);                                   // Not implemented yet.
+            CAllLeapCalendar(const StdString & dateStr);
+            CAllLeapCalendar(int yr = 0, int mth = 1, int d   = 1,
+                            int hr = 0, int min = 0, int sec = 0);
+            CAllLeapCalendar(const CAllLeapCalendar & calendar);       // Not implemented yet.
+            CAllLeapCalendar(const CAllLeapCalendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual int getYearTotalLength(const CDate & date) const;
+            virtual int getMonthLength(const CDate & date) const;
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CAllLeapCalendar(void);
+
+      }; // class CAllLeapCalendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAllLeapCalendar__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/d360.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/d360.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/d360.cpp	(revision 152)
@@ -0,0 +1,35 @@
+#include "d360.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CD360Calendar::CD360Calendar(const StdString & dateStr)
+         : CCalendar("D360", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CD360Calendar::CD360Calendar(int yr, int mth, int d,
+                                   int hr, int min, int sec)
+         : CCalendar("D360", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CD360Calendar::~CD360Calendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      int CD360Calendar::getYearTotalLength(const CDate & date) const
+      { return (360 * 86400); }
+
+      int CD360Calendar::getMonthLength(const CDate & date) const
+      { return (30); }
+
+      StdString CD360Calendar::getType(void) const
+      { return (StdString("d360")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/d360.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/d360.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/d360.hpp	(revision 152)
@@ -0,0 +1,42 @@
+#ifndef __XMLIO_CD360Calendar__
+#define __XMLIO_CD360Calendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CD360Calendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CD360Calendar(void);                                   // Not implemented yet.
+            CD360Calendar(const StdString & dateStr);
+            CD360Calendar(int yr = 0, int mth = 1, int d   = 1,
+                            int hr = 0, int min = 0, int sec = 0);
+            CD360Calendar(const CD360Calendar & calendar);       // Not implemented yet.
+            CD360Calendar(const CD360Calendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual int getYearTotalLength(const CDate & date) const;
+            virtual int getMonthLength(const CDate & date) const;
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CD360Calendar(void);
+
+      }; // class CD360Calendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CD360Calendar__
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/gregorian.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/gregorian.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/gregorian.cpp	(revision 152)
@@ -0,0 +1,51 @@
+#include "gregorian.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CGregorianCalendar::CGregorianCalendar(const StdString & dateStr)
+         : CCalendar("Gregorian", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CGregorianCalendar::CGregorianCalendar(int yr, int mth, int d,
+                                             int hr, int min, int sec)
+         : CCalendar("Gregorian", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CGregorianCalendar::~CGregorianCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      int CGregorianCalendar::getYearTotalLength(const CDate & date) const
+      { // Retourne la durÃ©e d'une annÃ©e en seconde.
+         if ((date.getYear() % 4   == 0) &&
+            ((date.getYear() % 100 != 0)  ||
+             (date.getYear() % 400 == 0)  ))
+            return (366 * 86400);
+         return (365 * 86400);
+      }
+
+      int CGregorianCalendar::getMonthLength(const CDate & date) const
+      { // Retourne la durÃ©e du mois en jour.
+         if (date.getMonth() == 2)
+         { // Traitement du cas particulier en FÃ©vrier.
+            if ((date.getYear() % 4   == 0) &&
+               ((date.getYear() % 100 != 0) ||
+                (date.getYear() % 400 == 0) ))
+               return (29);
+            return (28);
+         }
+         return (CCalendar::getMonthLength(date));
+      }
+
+      StdString CGregorianCalendar::getType(void) const
+      { return (StdString("gregorian")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/gregorian.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/gregorian.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/gregorian.hpp	(revision 152)
@@ -0,0 +1,41 @@
+#ifndef __XMLIO_CGregorianCalendar__
+#define __XMLIO_CGregorianCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CGregorianCalendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CGregorianCalendar(void);                                   // Not implemented yet.
+            CGregorianCalendar(const StdString & dateStr);
+            CGregorianCalendar(int yr = 0, int mth = 1, int d   = 1,
+                               int hr = 0, int min = 0, int sec = 0);
+            CGregorianCalendar(const CGregorianCalendar & calendar);       // Not implemented yet.
+            CGregorianCalendar(const CGregorianCalendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual int getYearTotalLength(const CDate & date) const;
+            virtual int getMonthLength(const CDate & date) const;
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CGregorianCalendar(void);
+
+      }; // class CGregorianCalendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CGregorianCalendar__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/julian.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/julian.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/julian.cpp	(revision 152)
@@ -0,0 +1,44 @@
+#include "julian.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CJulianCalendar::CJulianCalendar(const StdString & dateStr)
+         : CCalendar("Julian", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CJulianCalendar::CJulianCalendar(int yr, int mth, int d,
+                                       int hr, int min, int sec)
+         : CCalendar("Julian", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CJulianCalendar::~CJulianCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      int CJulianCalendar::getYearTotalLength(const CDate & date) const
+      { // Retourne la durÃ©e d'une annÃ©e en seconde.
+         if (date.getYear() % 4 == 0) return (366 * 86400);
+         return (365 * 86400);
+      }
+
+      int CJulianCalendar::getMonthLength(const CDate & date) const
+      { // Retourne la durÃ©e du mois en jour.
+         if (date.getMonth() == 2)
+         {
+            if (date.getYear()%4 == 0) return 29;
+               return 28;
+         }
+         return (CCalendar::getMonthLength(date));
+      }
+
+      StdString CJulianCalendar::getType(void) const
+      { return (StdString("julian")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/julian.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/julian.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/julian.hpp	(revision 152)
@@ -0,0 +1,41 @@
+#ifndef __XMLIO_CJulianCalendar__
+#define __XMLIO_CJulianCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CJulianCalendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CJulianCalendar(void);                                   // Not implemented yet.
+            CJulianCalendar(const StdString & dateStr);
+            CJulianCalendar(int yr = 0, int mth = 1, int d   = 1,
+                            int hr = 0, int min = 0, int sec = 0);
+            CJulianCalendar(const CJulianCalendar & calendar);       // Not implemented yet.
+            CJulianCalendar(const CJulianCalendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual int getYearTotalLength(const CDate & date) const;
+            virtual int getMonthLength(const CDate & date) const;
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CJulianCalendar(void);
+
+      }; // class CJulianCalendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CJulianCalendar__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/noleap.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/noleap.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/noleap.cpp	(revision 152)
@@ -0,0 +1,29 @@
+#include "noleap.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CNoLeapCalendar::CNoLeapCalendar(const StdString & dateStr)
+         : CCalendar("NoLeap", dateStr)
+      { /* Ne rien faire de plus */ }
+
+      CNoLeapCalendar::CNoLeapCalendar(int yr, int mth, int d,
+                                       int hr, int min, int sec)
+         : CCalendar("NoLeap", yr, mth, d, hr, min, sec)
+      { /* Ne rien faire de plus */ }
+
+      CNoLeapCalendar::~CNoLeapCalendar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      StdString CNoLeapCalendar::getType(void) const
+      { return (StdString("noleap")); }
+
+      ///--------------------------------------------------------------
+   } // namespace date
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/date/noleap.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/date/noleap.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/date/noleap.hpp	(revision 152)
@@ -0,0 +1,40 @@
+#ifndef __XMLIO_CNoLeapCalendar__
+#define __XMLIO_CNoLeapCalendar__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CNoLeapCalendar : public CCalendar
+      {
+            /// Typedef ///
+            typedef CCalendar SuperClass;
+
+         public :
+
+            /// Constructeur ///
+            CNoLeapCalendar(void);                                   // Not implemented yet.
+            CNoLeapCalendar(const StdString & dateStr);
+            CNoLeapCalendar(int yr = 0, int mth = 1, int d   = 1,
+                            int hr = 0, int min = 0, int sec = 0);
+            CNoLeapCalendar(const CNoLeapCalendar & calendar);       // Not implemented yet.
+            CNoLeapCalendar(const CNoLeapCalendar * calendar);       // Not implemented yet.
+
+            /// Accesseurs ///
+            virtual StdString getType(void) const;
+
+            /// Destructeur ///
+            virtual ~CNoLeapCalendar(void);
+
+      }; // class CNoLeapCalendar
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CNoLeapCalendar__
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/declare_attribute.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/declare_attribute.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/declare_attribute.hpp	(revision 152)
@@ -0,0 +1,43 @@
+#ifndef __XMLIO_DECLARE_ATTRIBUTE__
+#define __XMLIO_DECLARE_ATTRIBUTE__
+
+/// ///////////////////////////// Macros ///////////////////////////// ///
+
+#define DECLARE_ATTRIBUTE(type, name)                             \
+   class name##att : public CAttributeTemplate<type>{             \
+      public :                                                    \
+         name##att(void)                                          \
+            : CAttributeTemplate<type>                            \
+            (#name, *CAttributeMap::Current)                      \
+         { /* Ne rien faire de plus */ }                          \
+         type operator=(const type & value)                       \
+         { return (CAttributeTemplate<type>::operator=(value)); } \
+         virtual ~name##att(void)                                 \
+         { /* Ne rien faire de plus */ }                          \
+   } name;
+
+#define DECLARE_ATTRIBUTE_DEF(type, name, def)                     \
+   class name##att : public CAttributeTemplate<type>{              \
+      public :                                                     \
+         name##att(void)                                           \
+            : CAttributeTemplate<type>                             \
+            (#name, def, *CAttributeMap::Current)                  \
+         { /* Ne rien faire de plus */ }                           \
+         type operator=(const type & value)                        \
+         { return (CAttributeTemplate<type>::operator=(value)); }  \
+         virtual ~name##att(void)                                  \
+         { /* Ne rien faire de plus */ }                           \
+   } name
+
+#define BEGIN_DECLARE_ATTRIBUTE_MAP(type)                  \
+   class type##Attributes : public virtual CAttributeMap { \
+      public :
+
+#define END_DECLARE_ATTRIBUTE_MAP(type)            \
+         type##Attributes (void) : CAttributeMap() \
+         { /* Ne rien faire de plus */ }           \
+         virtual ~type##Attributes (void)          \
+         { /* Ne rien faire de plus */ }           \
+   };
+
+#endif // __XMLIO_DECLARE_ATTRIBUTE__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/declare_group.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/declare_group.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/declare_group.hpp	(revision 152)
@@ -0,0 +1,25 @@
+#ifndef __XMLIO_DECLARE_GROUP__
+#define __XMLIO_DECLARE_GROUP__
+
+/// ///////////////////////////// Macros ///////////////////////////// ///
+
+#define DECLARE_GROUP(type)                                           \
+   class type##Group                                                  \
+      : public CGroupTemplate<type, type##Group, type##Attributes>    \
+   {                                                                  \
+      public:                                                         \
+         typedef type              RelChild;                          \
+         typedef type##Group       RelGroup;                          \
+         typedef type##Attributes  RelAttributes;                     \
+         type##Group(void)                                            \
+            : CGroupTemplate<RelChild, RelGroup, RelAttributes> ()    \
+         { /* Ne rien faire de plus */ }                              \
+         type##Group(const StdString& _id)                            \
+            : CGroupTemplate<RelChild, RelGroup, RelAttributes> (_id) \
+         { /* Ne rien faire de plus */ }                              \
+         virtual ~type##Group(void)                                   \
+         { /* Ne rien faire de plus */ }                              \
+   };                                                                 \
+   typedef type##Group type##Definition
+
+#endif // __XMLIO_DECLARE_GROUP__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/duration.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/duration.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/duration.cpp	(revision 152)
@@ -0,0 +1,134 @@
+#include "duration.hpp"
+#include "date.hpp"
+#include "calendar.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      const CDuration Year   = {1.0, 0.0, 0.0, 0.0, 0.0, 0.0},
+                      Month  = {0.0, 1.0, 0.0, 0.0, 0.0, 0.0},
+                      Week   = {0.0, 0.0, 7.0, 0.0, 0.0, 0.0},
+                      Day    = {0.0, 0.0, 1.0, 0.0, 0.0, 0.0},
+                      Hour   = {0.0, 0.0, 0.0, 1.0, 0.0, 0.0},
+                      Minute = {0.0, 0.0, 0.0, 0.0, 1.0, 0.0},
+                      Second = {0.0, 0.0, 0.0, 0.0, 0.0, 1.0},
+                      NoneDu = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
+
+      ///---------------------------------------------------------------
+
+      CDuration & CDuration::operator=(const CDuration & duration)
+      {
+         year = duration.year;  month  = duration.month ; day    = duration.day;
+         hour = duration.hour;  minute = duration.minute; second = duration.second;
+         return (*this);
+      }
+
+      StdOStream & operator<<(StdOStream & out, const CDuration & duration)
+      {
+         StdOStringStream sout;
+         bool testValue = true;
+         if(duration.year   != 0.0) { testValue = false; sout << duration.year   << "y " ; }
+         if(duration.month  != 0.0) { testValue = false; sout << duration.month  << "mo "; }
+         if(duration.day    != 0.0) { testValue = false; sout << duration.day    << "d " ; }
+         if(duration.hour   != 0.0) { testValue = false; sout << duration.hour   << "h " ; }
+         if(duration.minute != 0.0) { testValue = false; sout << duration.minute << "mi "; }
+         if(duration.second != 0.0 || testValue)       { sout << duration.second << "s " ; }
+
+         // << suppression de l'espace en fin de chaÃ®ne.
+         out << (sout.str().substr(0, sout.str().size()-1));
+         return (out);
+      }
+
+      StdIStream & operator>>(StdIStream & in , CDuration & duration)
+      {
+         duration.year = duration.month  = duration.day    =
+         duration.hour = duration.minute = duration.second = 0.0;
+         double v = 1.0;
+         char   c = '/';
+         while (!in.eof())
+         {
+               in >> v >> c;
+               switch (c)
+               {
+                  case 'y': duration.year   = v; continue;
+                  case 'd': duration.day    = v; continue;
+                  case 'h': duration.hour   = v; continue;
+                  case 's': duration.second = v; continue;
+                  case 'm':
+                     in >> c;
+                     if     (c == 'i') duration.minute = v;
+                     else if(c == 'o') duration.month  = v;
+                     else
+                     {
+                        StdString valc("m"); valc.append(1, c);
+                        DEBUG("La chaine \"" << valc << "\" ne permet pas de dÃ©finir une unitÃ© de durÃ©e.");
+                        continue;
+                     }
+                     continue;
+                  default:
+                     StdString valc; valc.append(1, c);
+                     DEBUG("La chaine \"" << valc << "\" ne permet pas de dÃ©finir une unitÃ© de durÃ©e.");
+                     continue;
+               }
+            }
+            return (in);
+      }
+
+      //-----------------------------------------------------------------
+
+      bool CDuration::isNone(void) const
+      {
+         if ((year == 0) && (month  == 0) && (day    == 0) &&
+             (hour == 0) && (minute == 0) && (second == 0))
+            return (true);
+         return (false);
+      }
+
+      //-----------------------------------------------------------------
+
+      CDuration & CDuration::resolve(const CCalendar & c)
+      {
+         // Simplification de l'Ã©criture des minutes.
+         second += modf(minute, &minute) * (float)c.getMinuteLength();
+         minute += int(second)/c.getMinuteLength(); second = int(second)%c.getMinuteLength();
+
+         // Simplification de l'Ã©criture des heures.
+         minute += modf(hour , &hour) * (float)c.getHourLength();
+         hour   += int(minute)/c.getHourLength(); minute = int(minute)%c.getHourLength();
+
+         // Simplification de l'Ã©criture des jours.
+         hour   += modf(day, &day) * (float)c.getDayLength();
+         day    += int(hour)  /c.getDayLength(); hour   = int(hour)%c.getDayLength();
+
+         // > Aucune Ã©quivalence jour - mois fixÃ©e par avance. //
+
+         // Simplification de l'Ã©criture des annÃ©es.
+         month  += modf(year, &year) * (float)c.getYearLength();
+         year   += int(month) /c.getYearLength(); month  = int(month)%c.getYearLength();
+         return (*this);
+      }
+
+      //-----------------------------------------------------------------
+
+      StdString CDuration::toString(void) const
+      {
+         const  CDuration & own = *this;
+         StdOStringStream oss; oss << own;
+         return (oss.str());
+      }
+
+      CDuration CDuration::FromString(const StdString & str)
+      {
+         CDuration dr = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
+         StdIStringStream iss(str); iss >> dr;
+         return (dr);
+      }
+
+      ///---------------------------------------------------------------
+
+
+   } // namespace date
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/duration.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/duration.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/duration.hpp	(revision 152)
@@ -0,0 +1,54 @@
+#ifndef __XMLIO_CDuration__
+#define __XMLIO_CDuration__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+
+namespace xmlioserver
+{
+   namespace date
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      typedef long long int Time;
+      class CCalendar;
+
+      ///---------------------------------------------------------------
+      typedef struct _duration
+      {
+         public :
+
+            /// OpÃ©rateurs ///
+            struct _duration & operator=(const struct _duration& duration);
+
+            friend StdOStream & operator<<(StdOStream & out, const struct _duration& duration);
+            friend StdIStream & operator>>(StdIStream & in , struct _duration& duration);
+
+            /// Test ///
+            bool isNone(void) const;
+
+            /// Traitement ///
+            struct _duration & resolve(const CCalendar & calendar);
+
+            /// Autres ///
+            StdString toString(void) const;
+
+         public: /* static */
+
+            static struct _duration FromString(const StdString & str);
+
+            /// PropriÃ©tÃ©s publiques ///
+            double year, month, day, hour, minute, second;
+
+      } CDuration;
+
+      ///---------------------------------------------------------------
+
+      const extern CDuration Year, Month , Week  , Day    ,
+                             Hour, Minute, Second, NoneDu ;
+      ///---------------------------------------------------------------
+
+   } // namespace date
+} // namespace xmlioserver
+
+#endif // __XMLIO_CDuration__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/exception.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/exception.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/exception.cpp	(revision 152)
@@ -0,0 +1,47 @@
+#include "exception.hpp"
+
+/// boost headers ///
+#include <boost/cast.hpp>
+
+namespace xmlioserver
+{
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+   CException::CException(void)
+      : CObject(), desc_rethrow(true)
+   { /* Ne rien faire de plus */ }
+
+   CException::CException(const StdString & id)
+      : CObject(id), desc_rethrow(true)
+   { /* Ne rien faire de plus */ }
+
+   CException::CException(const CException & exception)
+      : std::basic_ios<char>()
+      , CObject(exception.getId())
+      , StdOStringStream()
+      , desc_rethrow(false)
+   { (*this) << exception.str(); }
+
+   CException::~CException(void)
+   { if (desc_rethrow) throw (*this); }
+
+   //---------------------------------------------------------------
+
+   StdString CException::getMessage(void) const
+   {
+      StdOStringStream oss;
+      oss << "> Error [" << this->getId() << "] : " << this->str();
+      return (oss.str());
+   }
+
+   StdOStringStream &  CException::getStream(void)
+   { return (*boost::polymorphic_cast<StdOStringStream*>(this)); }
+
+   StdString CException::toString(void) const
+   { return (StdString(this->getMessage())); }
+
+   void CException::fromString(const StdString & str)
+   { this->str(str); }
+
+   //---------------------------------------------------------------
+
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/exception.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/exception.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/exception.hpp	(revision 152)
@@ -0,0 +1,56 @@
+#ifndef __XMLIO_CException__
+#define __XMLIO_CException__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "object.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CException
+      : private CObject, public StdOStringStream
+   {
+         typedef CObject SuperClass;
+
+      public :
+
+         /// Constructeurs ///
+         CException(void);
+         explicit CException(const StdString & id);
+         CException(const CException & exception);
+         CException(const CException * const exception); // Not implemented.
+
+         /// Accesseurs ///
+         StdString getMessage(void) const;
+         StdOStringStream & getStream(void);
+
+         /// Destructeur ///
+         virtual ~CException(void);
+
+         /// Autre ///
+         virtual StdString toString(void) const;
+         virtual void fromString(const StdString & str);
+
+      private :
+
+         /// PropriÃ©tÃ©s ///
+         bool desc_rethrow; // throw destructor
+
+   }; // CException
+} // namespace xmlioserver
+
+/// //////////////////////////// Macros //////////////////////////// ///
+
+#define INFO(x) \
+   "In file \'" __FILE__ "\', line " << __LINE__ << " -> " x << std::endl;
+
+#ifdef XIOS_DEBUG
+   #define DEBUG(x) std::clog << "> Debug " << INFO(x)
+#else
+   #define DEBUG(x)
+#endif
+
+#define ERROR(id, x)  CException(id).getStream() << INFO(x)
+
+#endif // __XMLIO_CException__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake.hpp	(revision 152)
@@ -0,0 +1,29 @@
+#ifndef __XMLIO_FAKE__
+#define __XMLIO_FAKE__
+
+#ifdef __cplusplus
+extern"C"
+{
+#endif //__cplusplus
+
+   // Point d'entrÃ©e du faux client nemo (src/fake_client/fake_nemo.f90)
+   void nemo_fake_entry(MPIComm comm_client,
+                        MPIComm comm_client_grp,
+                        MPIComm comm_client_server);
+
+   // Point d'entrÃ©e du faux client nemo (src/fake_client/fake_lmdz.f90)
+   void lmdz_fake_entry(MPIComm comm_client,
+                        MPIComm comm_client_grp,
+                        MPIComm comm_client_server);
+
+   // Point d'entrÃ©e du faux client nemo (src/fake_client/fake_orchidee.f90)
+   void orchidee_fake_entry(MPIComm comm_client,
+                            MPIComm comm_client_grp,
+                            MPIComm comm_client_server);
+
+
+#ifdef __cplusplus
+}
+#endif //__cplusplus
+
+#endif //__XMLIO_FAKE__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_lmdz.f90
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_lmdz.f90	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_lmdz.f90	(revision 152)
@@ -0,0 +1,35 @@
+! --------------------------------------------------- !
+!          XMLIO SERVER MAIN TEST (LMDZ)              !
+! --------------------------------------------------- !
+
+MODULE LMDZ_FAKE
+
+   ! Modules de la bibliothÃšque xmlioserver
+   USE IXMLIOSERVER
+   USE ISO_C_BINDING
+
+include 'mpif.h'
+
+   CONTAINS
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE LMDZ_FAKE_ENTRY(comm_client, comm_client_grp, comm_client_server) BIND(C)
+      INTEGER(kind = C_INT), INTENT(IN), VALUE :: comm_client,       & ! communicateur des clients
+                                                  comm_client_grp,   & ! communicateur du groupe de clients
+                                                  comm_client_server   ! communicateur client-serveur
+      INTEGER                                  :: rankGrp, nbClientAll, nbClientGrp, error
+
+      CALL MPI_COMM_SIZE(comm_client, nbClientAll, err)
+      CALL MPI_COMM_SIZE(comm_client_grp, nbClientGrp, err)
+      CALL MPI_COMM_RANK(comm_client_server, rankGrp, err)
+
+      IF (rankGrp .EQ. 0) THEN
+         PRINT*," Starting LMDZ Tests"
+      END IF
+
+   END SUBROUTINE LMDZ_FAKE_ENTRY
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+END MODULE LMDZ_FAKE
Index: XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_nemo.f90
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_nemo.f90	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_nemo.f90	(revision 152)
@@ -0,0 +1,383 @@
+! --------------------------------------------------- !
+!          XMLIO SERVER MAIN TEST (NEMO)              !
+! --------------------------------------------------- !
+
+MODULE NEMO_FAKE
+
+   ! Modules de la bibliothÃšque xmlioserver
+   USE IXMLIOSERVER
+   USE ISO_C_BINDING
+
+include 'mpif.h'
+
+   CONTAINS
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE NEMO_FAKE_ENTRY(comm_client, comm_client_grp, comm_client_server) BIND(C)
+      INTEGER(kind = C_INT), INTENT(IN), VALUE :: comm_client,       & ! communicateur des clients
+                                                  comm_client_grp,   & ! communicateur du groupe de clients
+                                                  comm_client_server   ! communicateur client-serveur
+      REAL(kind = 8), DIMENSION(10000)   :: real_array
+      INTEGER                           :: rankGrp, nbClientAll, nbClientGrp, error
+      INTEGER                           :: ibegin, iend, jbegin, jend
+      TYPE(XDate)                       :: init_date_nemo  = XDate(1985, 03, 15, 17, 35, 00)
+      TYPE(XHandle)                     :: nemo_style_ctxt = NULLHANDLE
+      TYPE(XHandle)                     :: temp_mod   = NULLHANDLE, &
+                                           temp_mod_  = NULLHANDLE, &
+                                           temp_mod__ = NULLHANDLE
+
+      CALL MPI_COMM_SIZE(comm_client, nbClientAll, err)
+      CALL MPI_COMM_SIZE(comm_client_grp, nbClientGrp, err)
+      CALL MPI_COMM_RANK(comm_client_server, rankGrp, err)
+
+      IF (rankGrp .EQ. 0) THEN
+         PRINT*," Starting NEMO Tests"
+      END IF
+
+      ! Parsing du document xml de dÃ©finition Ã  partir d'une faire de caractÃšre.
+      CALL xml_parse_string ("<? xml version=1.0 ?><simulation></simulation>")
+
+      !!!!!!!!!!!!!!!!!!!! EXEMPLE RECONSTRUCTION !!!!!!!!!!!!!!!!!!!!!
+
+      ! On crÃ©e un nouveau context et on lui associe un handle.
+      CALL context_create(context_hdl   = nemo_style_ctxt, &
+                          context_id    = "nemo_style",    &
+                          calendar_type = GREGORIAN,       &
+                          init_date     = init_date_nemo)
+
+      ! ---------> field_definition
+      CALL handle_create(temp_mod, GFIELD,  "field_definition")
+
+      ! Ajout d'un groupe de champ anomyme
+      CALL xml_tree_add(parent_hdl  = temp_mod,        &
+                        parent_type = GFIELD,          &
+                        child_hdl   = temp_mod_,       &
+                        child_type  = GFIELD)
+
+      CALL set_field_attributes(field_hdl = temp_mod_, &
+                                ftype     = GFIELD,    &
+                                unit_     = "SI",      &
+                                prec_     = 8)
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,       &
+                        parent_type = GFIELD,          &
+                        child_hdl   = temp_mod,        &
+                        child_type  = GFIELD,          &
+                        child_id    = "field_enabled")
+
+      CALL set_field_attributes(field_hdl      = temp_mod,     &
+                                ftype          = GFIELD,       &
+                                operation_     = "instant",    &
+                                enabled_       = .TRUE._1)
+
+      CALL xml_tree_add(parent_hdl  = temp_mod,        &
+                        parent_type = GFIELD,          &
+                        child_hdl   = temp_mod__,      &
+                        child_type  = EFIELD,          &
+                        child_id    = "champ_2D_k8_inst")
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,   &
+                                ftype          = EFIELD,       &
+                                name_          = "champ1",     &
+                                standard_name_ = "lechamp1",   &
+                                long_name_     = "le champ 1", &
+                                domain_ref_    = "simple_domaine0")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod,        &
+                        parent_type = GFIELD,          &
+                        child_hdl   = temp_mod__,      &
+                        child_type  = EFIELD,          &
+                        child_id    = "champ_2D_k4_once_dis")
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,   &
+                                ftype          = EFIELD,       &
+                                prec_          = 4,            &
+                                operation_     = "once",       &
+                                enabled_       = .FALSE._1,    &
+                                name_          = "champ2",     &
+                                standard_name_ = "lechamp2",   &
+                                long_name_     = "le champ 2", &
+                                domain_ref_    = "simple_domaine1")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod,        &
+                        parent_type = GFIELD,          &
+                        child_hdl   = temp_mod__,      &
+                        child_type  = EFIELD,          &
+                        child_id    = "champ_3D_k4_once")
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,   &
+                                ftype          = EFIELD,       &
+                                prec_          = 4,            &
+                                operation_     = "once",       &
+                                name_          = "champ3",     &
+                                standard_name_ = "lechamp3",   &
+                                long_name_     = "le champ 3", &
+                                grid_ref_   = "simple_grille")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod,        &
+                        parent_type = GFIELD,          &
+                        child_hdl   = temp_mod__,      &
+                        child_type  = EFIELD,          &
+                        child_id    = "champ_3D_k8_average")
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,   &
+                                ftype          = EFIELD,       &
+                                prec_          = 8,            &
+                                operation_     = "average",    &
+                                name_          = "champ4",     &
+                                standard_name_ = "lechamp4",   &
+                                long_name_     = "le champ 4", &
+                                grid_ref_   = "simple_grille")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,       &
+                        parent_type = GFIELD,          &
+                        child_hdl   = temp_mod,        &
+                        child_type  = GFIELD,          &
+                        child_id    = "field_disabled")
+
+      CALL set_field_attributes(field_hdl  = temp_mod,  &
+                                ftype          = GFIELD,    &
+                                operation_     = "instant", &
+                                enabled_   = .FALSE._1)
+
+      CALL xml_tree_add(parent_hdl  = temp_mod,        &
+                        parent_type = GFIELD,          &
+                        child_hdl   = temp_mod__,      &
+                        child_type  = EFIELD,          &
+                        child_id    = "champ_3D_k8_inst")
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,       &
+                                ftype          = EFIELD,           &
+                                prec_          = 8,                &
+                                name_          = "champ5",         &
+                                standard_name_ = "lechamp5",       &
+                                long_name_     = "le champ 5",     &
+                                domain_ref_    = "simple_domaine", &
+                                axis_ref_      = "simple_axe")
+
+      ! ---------> axis_definition
+      CALL handle_create(temp_mod, GAXIS,  "axis_definition")
+      CALL xml_tree_add(parent_hdl  = temp_mod,   &
+                        parent_type = GAXIS,      &
+                        child_hdl   = temp_mod_,  &
+                        child_type  = GAXIS,      &
+                        child_id    = "all_axis")
+
+      CALL set_axis_attributes(axis_hdl = temp_mod_, &
+                               ftype    = GAXIS,     &
+                               unit_    = "km")
+
+      CALL xml_tree_add(parent_hdl     = temp_mod_,       &
+                        parent_type    = GAXIS,           &
+                        child_hdl      = temp_mod,        &
+                        child_type     = EAXIS,           &
+                        child_id       = "simple_axe")
+
+      CALL set_axis_attributes(axis_hdl       = temp_mod, &
+                               ftype          = EAXIS,    &
+                               name_          = "axe1",   &
+                               standard_name_ = "laxe1",  &
+                               long_name_     = "l axe1", &
+                               size_          = 30,       &
+                               zvalue_        = real_array(1:30))
+
+      ! ---------> domain_definition
+      CALL handle_create(temp_mod, GDOMAIN,  "domain_definition")
+      CALL xml_tree_add(parent_hdl  = temp_mod,   &
+                        parent_type = GDOMAIN,    &
+                        child_hdl   = temp_mod_,  &
+                        child_type  = GDOMAIN,    &
+                        child_id    = "all_domain")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,  &
+                        parent_type = GDOMAIN,    &
+                        child_hdl   = temp_mod,   &
+                        child_type  = EDOMAIN,    &
+                        child_id    = "simple_domaine0")
+
+      IF (rankGrp .EQ. 0) THEN
+         ibegin = 1
+         iend   = 50
+         jbegin = 1
+         jend   = 50
+      ELSE IF (rankGrp .EQ. 1) THEN
+         ibegin = 51
+         iend   = 100
+         jbegin = 1
+         jend   = 50
+      END IF
+
+      CALL set_domain_attributes(domain_hdl     = temp_mod,       &
+                                 ftype          = EDOMAIN,        &
+                                 name_          = "domaine0",     &
+                                 standard_name_ = "ledomaine0",   &
+                                 long_name_     = "le domaine 0", &
+                                 lonvalue_      = real_array(1:((jend-jbegin+1)*(iend-ibegin+1))), &
+                                 latvalue_      = real_array(1:((jend-jbegin+1)*(iend-ibegin+1))), &
+                                 data_dim_      = 2,              &
+                                 ni_glo_        = 100,            &
+                                 nj_glo_        = 50,             &
+                                 ibegin_        = ibegin,         &
+                                 iend_          = iend,           &
+                                 jbegin_        = jbegin,         &
+                                 jend_          = jend)
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,  &
+                        parent_type = GDOMAIN,    &
+                        child_hdl   = temp_mod,   &
+                        child_type  = EDOMAIN,    &
+                        child_id    = "simple_domaine1")
+
+      IF (rankGrp .EQ. 0) THEN
+         ibegin = 1
+         iend   = 90
+         jbegin = 1
+         jend   = 10
+      ELSE IF (rankGrp .EQ. 1) THEN
+         ibegin = 1
+         iend   = 90
+         jbegin = 11
+         jend   = 20
+      END IF
+
+      CALL set_domain_attributes(domain_hdl     = temp_mod,       &
+                                 ftype          = EDOMAIN,        &
+                                 name_          = "domaine1",     &
+                                 standard_name_ = "ledomaine0",   &
+                                 long_name_     = "le domaine 1", &
+                                 lonvalue_      = real_array(1:((jend-jbegin+1)*(iend-ibegin+1))), &
+                                 latvalue_      = real_array(1:((jend-jbegin+1)*(iend-ibegin+1))), &
+                                 data_dim_      = 2,              &
+                                 ni_glo_        = 90,             &
+                                 nj_glo_        = 40,             &
+                                 ibegin_        = ibegin,         &
+                                 iend_          = iend,           &
+                                 jbegin_        = jbegin,         &
+                                 jend_          = jend)
+
+      ! ---------> grid_definition
+      CALL handle_create(temp_mod, GGRID, "grid_definition")
+      CALL xml_tree_add(parent_hdl  = temp_mod,   &
+                        parent_type = GGRID,      &
+                        child_hdl   = temp_mod_,  &
+                        child_type  = EGRID,      &
+                        child_id    = "simple_grille")
+
+      CALL set_grid_attributes(grid_hdl     = temp_mod_,         &
+                               ftype        = EGRID,             &
+                               name_        = "grille1",         &
+                               description_ = "la grille 1",     &
+                               domain_ref_  = "simple_domaine1", &
+                               axis_ref_    = "simple_axe")
+
+      ! ---------> file_definition
+      CALL handle_create(temp_mod, GFILE, "file_definition")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod,   &
+                        parent_type = GFILE,      &
+                        child_hdl   = temp_mod_,  &
+                        child_type  = EFILE,      &
+                        child_id    = "simple_fichier1")
+
+      CALL set_file_attributes(file_hdl      = temp_mod_,        &
+                               ftype         = EFILE,            &
+                               name_         = "fichier1",       &
+                               description_  = "mon fichier 1 ", &
+                               output_freq_  = "12h",            &
+                               output_level_ = 3,                &
+                               enabled_      =  .TRUE._1)
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,  &
+                        parent_type = EFILE,      &
+                        child_hdl   = temp_mod__, &
+                        child_type  = EFIELD)
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,       &
+                                ftype          = EFIELD,           &
+                                field_ref_     = "champ_2D_k8_inst")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,  &
+                        parent_type = EFILE,      &
+                        child_hdl   = temp_mod__, &
+                        child_type  = EFIELD)
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,       &
+                                ftype          = EFIELD,           &
+                                field_ref_     = "champ_2D_k4_once_dis")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,  &
+                        parent_type = EFILE,      &
+                        child_hdl   = temp_mod__, &
+                        child_type  = EFIELD)
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,       &
+                                ftype          = EFIELD,           &
+                                field_ref_     = "champ_3D_k4_once")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,  &
+                        parent_type = EFILE,      &
+                        child_hdl   = temp_mod__, &
+                        child_type  = EFIELD)
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,       &
+                                ftype          = EFIELD,           &
+                                field_ref_     = "champ_3D_k8_average")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod,   &
+                        parent_type = GFILE,      &
+                        child_hdl   = temp_mod_,  &
+                        child_type  = EFILE,      &
+                        child_id    = "simple_fichier2")
+
+      CALL set_file_attributes(file_hdl      = temp_mod_,        &
+                               ftype         = EFILE,            &
+                               name_         = "fichier2",       &
+                               description_  = "mon fichier 2 ", &
+                               output_freq_  = "1d",             &
+                               output_level_ = 3,                &
+                               enabled_      =  .TRUE._1)
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,  &
+                        parent_type = EFILE,      &
+                        child_hdl   = temp_mod__, &
+                        child_type  = EFIELD)
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,       &
+                                ftype          = EFIELD,           &
+                                field_ref_     = "champ_2D_k8_inst")
+
+      CALL xml_tree_add(parent_hdl  = temp_mod,   &
+                        parent_type = GFILE,      &
+                        child_hdl   = temp_mod_,  &
+                        child_type  = EFILE,      &
+                        child_id    = "simple_fichier3")
+
+      CALL set_file_attributes(file_hdl      = temp_mod_,        &
+                               ftype         = EFILE,            &
+                               name_         = "fichier3",       &
+                               description_  = "mon fichier 3 ", &
+                               output_freq_  = "18h",            &
+                               output_level_ = 5,                &
+                               enabled_      =  .FALSE._1)
+
+      CALL xml_tree_add(parent_hdl  = temp_mod_,  &
+                        parent_type = EFILE,      &
+                        child_hdl   = temp_mod__, &
+                        child_type  = EFIELD)
+
+      CALL set_field_attributes(field_hdl      = temp_mod__,       &
+                                ftype          = EFIELD,           &
+                                field_ref_     = "champ_2D_k8_inst")
+
+      !!!!!!!!!!!!!!!!!!!!!!! DÃ©but du traitement !!!!!!!!!!!!!!!!!!!!!
+
+      ! On choisit le context dans lequel on va travailler
+      ! et on commence le traitement des donnÃ©es.
+      CALL dtreatment_start(nemo_style_ctxt, NETCDF4)
+
+   END SUBROUTINE NEMO_FAKE_ENTRY
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+END MODULE NEMO_FAKE
Index: XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_orchidee.f90
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_orchidee.f90	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/fake_client/fake_orchidee.f90	(revision 152)
@@ -0,0 +1,35 @@
+! --------------------------------------------------- !
+!        XMLIO SERVER MAIN TEST (ORCHIDEE)            !
+! --------------------------------------------------- !
+
+MODULE ORCHIDEE_FAKE
+
+   ! Modules de la bibliothÃšque xmlioserver
+   USE IXMLIOSERVER
+   USE ISO_C_BINDING
+
+include 'mpif.h'
+
+   CONTAINS
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+   SUBROUTINE ORCHIDEE_FAKE_ENTRY(comm_client, comm_client_grp, comm_client_server) BIND(C)
+      INTEGER(kind = C_INT), INTENT(IN), VALUE :: comm_client,       & ! communicateur des clients
+                                                  comm_client_grp,   & ! communicateur du groupe de clients
+                                                  comm_client_server   ! communicateur client-serveur
+      INTEGER                                  :: rankGrp, nbClientAll, nbClientGrp, error
+
+      CALL MPI_COMM_SIZE(comm_client, nbClientAll, err)
+      CALL MPI_COMM_SIZE(comm_client_grp, nbClientGrp, err)
+      CALL MPI_COMM_RANK(comm_client_server, rankGrp, err)
+
+      IF (rankGrp .EQ. 0) THEN
+         PRINT*," Starting ORCHIDEE Tests"
+      END IF
+
+   END SUBROUTINE ORCHIDEE_FAKE_ENTRY
+
+   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+END MODULE ORCHIDEE_FAKE
Index: XMLIO_V2/dev/dev_rv/src/xmlio/fortran/impi_interface.f90
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/fortran/impi_interface.f90	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/fortran/impi_interface.f90	(revision 152)
@@ -0,0 +1,174 @@
+MODULE IMPI_INTERFACE
+   USE ISO_C_BINDING
+
+include "mpif.h"
+
+   INTEGER (kind = C_INT ), BIND(C, NAME = "mpi_success" )     :: xios_mpi_success     = MPI_SUCCESS
+   INTEGER (kind = C_INT ), BIND(C, NAME = "mpi_comm_world" )  :: xios_mpi_comm_world  = MPI_COMM_WORLD
+   INTEGER (kind = C_INT ), BIND(C, NAME = "mpi_char" )        :: xios_mpi_char        = MPI_CHARACTER
+   INTEGER (kind = C_INT ), BIND(C, NAME = "mpi_status_size" ) :: xios_mpi_status_size = MPI_STATUS_SIZE
+   INTEGER (kind = C_INT ), BIND(C, NAME = "mpi_any_tag" )     :: xios_mpi_any_tag     = MPI_ANY_TAG
+
+   CONTAINS
+
+   ! Initialiser MPI
+   SUBROUTINE xios_mpi_init(err) BIND(C, NAME ="mpi_init")
+      INTEGER  (kind = C_INT) :: err
+      CALL MPI_INIT(err)
+   END SUBROUTINE xios_mpi_init
+
+   ! Quitter MPI
+   SUBROUTINE xios_mpi_finalize(err) BIND(C, NAME ="mpi_finalize")
+      INTEGER  (kind = C_INT) :: err
+      CALL MPI_FINALIZE(err)
+   END SUBROUTINE xios_mpi_finalize
+
+   ! Quitter brutalement MPI
+   SUBROUTINE xios_mpi_abort(comm, errcode, err) BIND(C, NAME ="mpi_abort")
+      INTEGER  (kind = C_INT) :: comm, errcode, err
+      CALL MPI_ABORT(comm, errcode, err)
+   END SUBROUTINE xios_mpi_abort
+
+   ! Savoir si un processus Ã  fait un MPI_INIT
+   SUBROUTINE xios_mpi_initialized(flag, err) BIND(C, NAME ="mpi_initialized")
+      LOGICAL (kind = C_BOOL) :: flag
+      INTEGER (kind = C_INT)  :: err
+      LOGICAL                 :: cflag
+      cflag = flag
+      CALL MPI_INITIALIZED(cflag, err)
+   END SUBROUTINE xios_mpi_initialized
+
+   ! RÃ©cupÃ©rer la chaine de caractÃšres associÃ©e au code d'erreur err
+   SUBROUTINE xios_mpi_error_string(errcode, chaine, taille_chaine, err) &
+                                    BIND(C, NAME ="mpi_error_string")
+      INTEGER (kind = C_INT)                 :: errcode, taille_chaine, err
+      CHARACTER(kind = C_CHAR), DIMENSION(*) :: chaine
+      CHARACTER(len = taille_chaine)         :: cchaine
+      CALL MPI_ERROR_STRING(errcode, cchaine, taille_chaine, err)
+      chaine(taille_chaine) = cchaine
+   END SUBROUTINE xios_mpi_error_string
+
+   ! Envoyer un message Ã  un processus
+   SUBROUTINE xios_mpi_send(buf, count, datatype, dest, tag, comm, err) &
+                            BIND(C, NAME ="mpi_send")
+      CHARACTER(kind = C_CHAR), DIMENSION(*) :: buf
+      INTEGER (kind = C_INT)                 :: dest, count, datatype, tag, comm, err
+      CALL MPI_SEND(buf, count, datatype, dest, tag, comm, err)
+   END SUBROUTINE xios_mpi_send
+
+   ! Recevoir un message d'un processus
+   SUBROUTINE xios_mpi_recv(buf, count, datatype, source, &
+                            tag, comm, status, err)       &
+                            BIND(C, NAME ="mpi_recv")
+      CHARACTER(kind = C_CHAR), DIMENSION(*)              :: buf
+      INTEGER (kind = C_INT)                              :: count, datatype, source, tag, comm, err
+      INTEGER (kind = C_INT) , DIMENSION(mpi_status_size) :: status
+      CALL MPI_RECV(buf, count, datatype, source, tag, comm, status, err)
+   END SUBROUTINE xios_mpi_recv
+
+   ! Envoyer et recevoir un message
+   SUBROUTINE xios_mpi_sendrecv(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, recvcount, &
+                                recvtype, source, recvtag, comm, status, err) &
+                                BIND(C, NAME ="mpi_sendrecv")
+      CHARACTER(kind = C_CHAR), DIMENSION(*) :: sendbuf, recvbuf
+      INTEGER (kind = C_INT)                 :: sendcount, sendtype, dest, sendtag, recvcount, &
+                                                recvtype, source, recvtag, comm, err
+      INTEGER (kind = C_INT) , DIMENSION(mpi_status_size) :: status
+      CALL MPI_SENDRECV(sendbuf, sendcount, sendtype, dest, sendtag, recvbuf, &
+                        recvcount, recvtype, source, recvtag, comm, status, err)
+   END SUBROUTINE xios_mpi_sendrecv
+
+   ! Compter le nombre d'Ã©lÃ©ments reÃ§us
+   SUBROUTINE xios_mpi_get_count(status, datatype, count, err) BIND(C, NAME ="mpi_get_count")
+      INTEGER (kind = C_INT)                 :: datatype, count, err
+      INTEGER (kind = C_INT) , DIMENSION(mpi_status_size) :: status
+      CALL MPI_GET_COUNT(status, datatype, count, err)
+   END SUBROUTINE xios_mpi_get_count
+
+   ! Tester l'arrivÃ©e d'un message
+   SUBROUTINE xios_mpi_iprobe(source, tag, comm, flag, status, err) BIND(C, NAME ="mpi_iprobe")
+      INTEGER (kind = C_INT) :: source, tag, comm, err
+      INTEGER (kind = C_INT) , DIMENSION(mpi_status_size) :: status
+      LOGICAL (kind = C_BOOL) :: flag
+      CALL MPI_IPROBE(source, tag, comm, flag, status, err)
+   END SUBROUTINE xios_mpi_iprobe
+
+   ! Nombre de processus dans un intracommunicateur
+   SUBROUTINE xios_mpi_comm_size(comm, nbre, err) BIND(C, NAME ="mpi_comm_size")
+      INTEGER (kind = C_INT)  :: comm, nbre, err
+      CALL MPI_COMM_SIZE(comm, nbre, err)
+   END SUBROUTINE xios_mpi_comm_size
+
+   ! Rang d'un processus dans un intracommunicateur
+   SUBROUTINE xios_mpi_comm_rank(comm, rang, err) BIND(C, NAME ="mpi_comm_rank")
+      INTEGER (kind = C_INT)  :: comm, rang, err
+      CALL MPI_COMM_RANK(comm, rang, err )
+   END SUBROUTINE xios_mpi_comm_rank
+
+   ! Partage d'un communicateur
+   SUBROUTINE xios_mpi_comm_split(comm, couleur, cle, newcomm, err) BIND(C, NAME ="mpi_comm_split")
+      INTEGER (kind = C_INT)  :: comm, couleur, cle, newcomm, err
+      CALL MPI_COMM_SPLIT(comm, couleur, cle, newcomm, err)
+   END SUBROUTINE xios_mpi_comm_split
+
+   ! Commencer Ã  envoyer un message
+   SUBROUTINE xios_mpi_issend(buf, count, datatype, dest, tag, comm, request, err) &
+                            BIND(C, NAME ="mpi_issend")
+      CHARACTER(kind = C_CHAR), DIMENSION(*) :: buf
+      INTEGER (kind = C_INT)                 :: count, datatype, tag, comm, request, err, dest
+      CALL MPI_ISSEND(buf, count, datatype, dest, tag, comm, request, err)
+   END SUBROUTINE xios_mpi_issend
+
+   ! Commencer Ã  recevoir un message
+   SUBROUTINE xios_mpi_irecv(buf, count, datatype, source, &
+                            tag, comm, request, err)       &
+                            BIND(C, NAME ="mpi_irecv")
+      CHARACTER(kind = C_CHAR), DIMENSION(*)              :: buf
+      INTEGER (kind = C_INT)                              :: count, datatype, source, tag, &
+                                                             comm, request, err
+      CALL MPI_IRECV(buf, count, datatype, source, tag, comm, request, err)
+   END SUBROUTINE xios_mpi_irecv
+
+   ! ComplÃ©ter une opÃ©ration non bloquante
+   SUBROUTINE xios_mpi_wait(request, status, err) BIND(C, NAME ="mpi_wait")
+      INTEGER (kind = C_INT)                              :: request, err
+      INTEGER (kind = C_INT) , DIMENSION(mpi_status_size) :: status
+      CALL MPI_WAIT(request, status, err)
+   END SUBROUTINE xios_mpi_wait
+
+   ! Tester une opÃ©ration non bloquante
+   SUBROUTINE xios_mpi_test(request, flag, status, err) BIND(C, NAME ="mpi_test")
+      INTEGER (kind = C_INT)                              :: request, err
+      INTEGER (kind = C_INT) , DIMENSION(mpi_status_size) :: status
+      LOGICAL (kind = C_BOOL)                             :: flag
+      LOGICAL                                             :: cflag
+      cflag = flag
+      CALL MPI_TEST(request, cflag, status, err)
+   END SUBROUTINE xios_mpi_test
+
+   ! CrÃ©ation d'un communicateur Ã  partir d'un groupe
+   SUBROUTINE xios_mpi_comm_create(comm, group, newcomm, err) BIND(C, NAME ="mpi_comm_create")
+      INTEGER (kind = C_INT) :: comm, group, newcomm, err
+      CALL MPI_COMM_CREATE(comm, group, newcomm, err)
+   END SUBROUTINE xios_mpi_comm_create
+
+   ! Obtention d'une groupe Ã  partir d'un communicateur
+   SUBROUTINE xios_mpi_comm_group(comm, group, err) BIND(C, NAME ="mpi_comm_group")
+      INTEGER (kind = C_INT) :: comm, group, err
+      CALL MPI_COMM_GROUP(comm, group, err)
+   END SUBROUTINE xios_mpi_comm_group
+
+   ! CrÃ©ation de sous-groupe
+   SUBROUTINE xios_mpi_group_incl(group, n, rank, newgroup, err) BIND(C, NAME ="mpi_group_incl")
+      INTEGER (kind = C_INT) :: group, n,  newgroup, err
+      INTEGER (kind = C_INT) , DIMENSION(*) :: rank
+      CALL MPI_GROUP_INCL(group, n, rank, newgroup, err)
+   END SUBROUTINE xios_mpi_group_incl
+
+   ! BarriÃšre
+   SUBROUTINE xios_mpi_barrier (comm, err) BIND (C, NAME ="mpi_barrier")
+      INTEGER (kind = C_INT) :: comm, err
+      CALL MPI_BARRIER(comm, err)
+   END SUBROUTINE xios_mpi_barrier
+
+END MODULE IMPI_INTERFACE
Index: XMLIO_V2/dev/dev_rv/src/xmlio/fortran/impi_interface.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/fortran/impi_interface.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/fortran/impi_interface.hpp	(revision 152)
@@ -0,0 +1,85 @@
+#ifndef __MPI_INTERFACE__
+#define __MPI_INTERFACE
+
+#ifdef __cplusplus
+extern"C"
+{
+#endif //__cplusplus
+
+/// Groupe ///
+extern int mpi_comm_world;
+extern int mpi_success;
+extern int mpi_char;
+extern int mpi_status_size;
+extern int mpi_any_tag;
+
+
+/// Initialisation / Finalisation ///
+void mpi_init(int * err);
+void mpi_finalize(int * err);
+
+/// Quitter brutalement MPI ///
+void mpi_abort(int * comm, int * errcode, int * err);
+
+/// Savoir si un processus Ã  fait un MPI_INIT ///
+void mpi_initialized(bool * flag, int * err);
+
+/// RÃ©cupÃ©rer la chaine de caractÃšres associÃ©e au code d'erreur err(non fonctionnelle) ///
+void mpi_error_string(int * errcode, char chaine[], int * taille_chaine, int * err);
+
+/// Envoyer un message Ã  un processus ///
+void mpi_send(char buf[], int * count, int * datatype, int * dest, int * tag, int * comm, int * err);
+
+/// Recevoir un message d'un processus ///
+void mpi_recv(char buf[], int * count, int * datatype, int * source,  int * tag, int * comm, int status[], int * err);
+
+/// Envoyer et recevoir un message ///
+void mpi_sendrecv(char sendbuf[], int * sendcount, int * sendtype, int * dest, int * sendtag, int recvbuf[], int * recvcount,
+                  int * recvtype, char source[], int * recvtag, int * comm, int status[], int * err) ;
+
+/// Compter le nombre d'Ã©lÃ©ments reÃ§us ///
+void mpi_get_count(int status[], int * datatype, int * count, int * err);
+
+/// Tester l'arrivÃ©e d'un message ///
+void mpi_iprobe(int * source, int * tag, int * comm, bool * flag, int status[], int * err);
+
+/// Nombre de processus dans un intracommunicateur ///
+void mpi_comm_size(int * comm, int * nbre, int * err);
+
+/// Rang d'un processus dans un intracommunicateur ///
+void mpi_comm_rank(int * comm, int * rang, int * err);
+
+/// Partage d'un communicateur ///
+void mpi_comm_split(int * comm, int * couleur, int * cle, int * newcomm, int * err);
+
+/// Commencer Ã  envoyer un message ///
+void mpi_issend(char * buf, int * count, int * datatype, int * dest,
+                int * tag, int * comm, int * request, int * err);
+
+/// Commencer Ã  recevoir un message ///
+void mpi_irecv(char buf[], int * count, int * datatype, int * source,
+                            int * tag, int * comm, int * request, int * err);
+
+/// ComplÃ©ter une opÃ©ration non bloquante ///
+void mpi_wait(int * request, int status[], int * err);
+
+/// Tester une opÃ©ration non bloquante ///
+void mpi_test(int * request, bool * flag, int status[], int * err);
+
+/// CrÃ©ation d'un communicateur Ã  partir d'un groupe ///
+void mpi_comm_create(int * comm, int * group, int * newcomm, int * err);
+
+/// Obtention d'un groupe Ã  partir d'un communicateur ///
+void mpi_comm_group(int * comm, int * group, int * err);
+
+/// CrÃ©ation de sous-groupe ///
+void mpi_group_incl(int * group, int * n, const int rank[], int * newgroup, int * err);
+
+/// BarriÃšre ///
+void mpi_barrier(int * comm, int * err);
+
+#ifdef __cplusplus
+}
+#endif //__cplusplus
+
+#endif //__MPI_INTERFACE__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/fortran/ixmlioserver.f03.in
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/fortran/ixmlioserver.f03.in	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/fortran/ixmlioserver.f03.in	(revision 152)
@@ -0,0 +1,384 @@
+! --------------------------------------------- !
+!                 IXMLIOSERVER                  !
+!          GESTION DES ENTREES-SORTIES          !
+! --------------------------------------------- !
+
+#include "macro.inc"
+
+MODULE IXMLIOSERVER
+   USE ISO_C_BINDING
+
+   ! Ne jamais modifier les valeurs internes de ce type dans le code fortran.
+   TYPE XHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XHandle
+
+   ! enum XDType
+   INTEGER(kind = C_INT), PARAMETER  :: NOTYPE = 0
+   INTEGER(kind = C_INT), PARAMETER  :: DTREATMENT = 1, DDATE = 2, CALENDAR = 3, ECONTEXT = 4
+   INTEGER(kind = C_INT), PARAMETER  :: EAXIS = 5 , EDOMAIN = 6 , EFIELD = 7 , EFILE = 8 , EGRID = 9
+   INTEGER(kind = C_INT), PARAMETER  :: GAXIS = 10, GDOMAIN = 11, GFIELD = 12, GFILE = 13, GGRID = 14
+
+   ! enum XCalendarType
+   INTEGER(kind = C_INT), PARAMETER  :: D360 = 0 , ALLLEAP = 1 , NOLEAP = 2 , JULIAN = 3 , GREGORIAN = 4
+
+   TYPE XDate
+      INTEGER :: year, month, day, hour, minute, second
+   END TYPE XDate
+
+   TYPE XDuration
+      REAL(kind = 8) :: year, month, day, hour, minute, second
+   END TYPE XDuration
+
+   ! Autres constantes
+   TYPE(XHandle)  , PARAMETER :: NULLHANDLE = XHandle(0)
+
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+
+      SUBROUTINE xios_handle_create(ret, dtype, idt, idt_size) BIND(C)
+         import C_CHAR, C_INTPTR_T, C_INT
+         INTEGER  (kind = C_INTPTR_T)             :: ret
+         INTEGER  (kind = C_INT), VALUE         :: dtype
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT), VALUE         :: idt_size
+      END SUBROUTINE xios_handle_create
+
+      SUBROUTINE xios_set_timestep(ts_year, ts_month, ts_day,          &
+                                   ts_hour, ts_minute, ts_second) BIND(C)
+         import C_DOUBLE
+         REAL (kind = C_DOUBLE), VALUE :: ts_year, ts_month, ts_day,   &
+                                          ts_hour, ts_minute, ts_second
+      END SUBROUTINE xios_set_timestep
+
+      SUBROUTINE xios_update_calendar(step) BIND(C)
+         import C_INT
+         INTEGER  (kind = C_INT), VALUE :: step
+      END SUBROUTINE xios_update_calendar
+
+      SUBROUTINE xios_xml_tree_add(parent_, parent_type, child_, child_type, child_id, child_id_size) BIND(C)
+         import C_CHAR, C_INT, C_INTPTR_T
+         INTEGER  (kind = C_INTPTR_T), VALUE    :: parent_
+         INTEGER  (kind = C_INT), VALUE         :: parent_type
+         INTEGER  (kind = C_INTPTR_T)           :: child_
+         INTEGER  (kind = C_INT), VALUE         :: child_type
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT), VALUE         :: child_id_size
+      END SUBROUTINE xios_xml_tree_add
+
+      SUBROUTINE  xios_xml_tree_show(filename, filename_size) BIND(C)
+         import C_CHAR, C_INT
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename
+         INTEGER  (kind = C_INT), VALUE         :: filename_size
+      END SUBROUTINE xios_xml_tree_show
+
+      SUBROUTINE xios_xml_parse_file(filename, filename_size) BIND(C)
+         import C_CHAR, C_INT
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename
+         INTEGER  (kind = C_INT), VALUE         :: filename_size
+      END SUBROUTINE xios_xml_Parse_File
+
+      SUBROUTINE xios_xml_parse_string(xmlcontent, xmlcontent_size) BIND(C)
+         import C_CHAR, C_INT
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: xmlcontent
+         INTEGER  (kind = C_INT), VALUE         :: xmlcontent_size
+      END SUBROUTINE xios_xml_Parse_String
+
+      SUBROUTINE xios_context_set_current(context, withswap) BIND(C)
+         import C_BOOL, C_INT, C_INTPTR_T
+         INTEGER  (kind = C_INTPTR_T), VALUE :: context
+         LOGICAL (kind = C_BOOL), VALUE      :: withswap
+      END SUBROUTINE xios_context_set_current
+
+      SUBROUTINE xios_context_create(context, context_id, context_id_size, calendar_type, &
+                                     year, month, day, hour, minute, second) BIND(C)
+         import C_CHAR, C_INT, C_INTPTR_T
+         INTEGER  (kind = C_INTPTR_T)           :: context
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: context_id
+         INTEGER  (kind = C_INT), VALUE         :: context_id_size
+         INTEGER  (kind = C_INT), VALUE         :: calendar_type, year, month, day, hour, minute, second
+      END SUBROUTINE xios_context_create
+
+      SUBROUTINE xios_dtreatment_start(context_hdl, filetype) BIND(C)
+         import C_INTPTR_T, C_INT
+         INTEGER  (kind = C_INTPTR_T), VALUE  :: context_hdl
+         INTEGER  (kind = C_INT), VALUE       :: filetype
+      END SUBROUTINE xios_dtreatment_start
+
+      SUBROUTINE xios_dtreatment_end() BIND(C)
+         ! Sans argument
+      END SUBROUTINE xios_dtreatment_end
+
+      SUBROUTINE xios_write_data(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize, data_Zsize) BIND(C)
+         import C_INT, C_CHAR, C_PTR, C_FLOAT, C_DOUBLE, C_BOOL
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: fieldid
+         INTEGER  (kind = C_INT),  VALUE        :: fieldid_size
+         REAL(kind = C_DOUBLE), DIMENSION(*)    :: data_k8
+         INTEGER  (kind = C_INT), VALUE         :: data_Xsize, data_Ysize, data_Zsize
+      END SUBROUTINE xios_write_data
+
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(axis, type, name)
+#include "../config/axis_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(field, type, name)
+#include "../config/field_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(context, type, name)
+#include "../config/context_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(domain, type, name)
+#include "../config/domain_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(file, type, name)
+#include "../config/file_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(grid, type, name)
+#include "../config/grid_attribute.conf"
+
+
+   END INTERFACE
+
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+   SUBROUTINE handle_create(ret, dtype, idt)
+      TYPE(XHandle), INTENT(OUT)     :: ret
+      INTEGER, INTENT(IN)            :: dtype
+      CHARACTER(len = *), INTENT(IN) :: idt
+      CALL xios_handle_create(ret%daddr, dtype, idt, len(idt))
+   END SUBROUTINE handle_create
+
+   SUBROUTINE set_timestep(timestep)
+      TYPE(XDuration), INTENT(IN):: timestep
+      CALL xios_set_timestep(timestep%year, timestep%month , timestep%day,   &
+                             timestep%hour, timestep%minute, timestep%second)
+   END SUBROUTINE set_timestep
+
+   SUBROUTINE update_calendar(step)
+      INTEGER, INTENT(IN):: step
+      IF (step < 1) THEN
+         PRINT *, "L'argument 'step' ne peut Ãªtre nÃ©gatif ou nul"
+         STOP
+      END IF
+      CALL xios_update_calendar(step)
+   END SUBROUTINE update_calendar
+
+   SUBROUTINE xml_tree_add(parent_hdl, parent_type, child_hdl, child_type, child_id)
+      TYPE(XHandle), INTENT(IN)                :: parent_hdl
+      TYPE(XHandle), INTENT(OUT)               :: child_hdl
+      INTEGER, INTENT(IN)                      :: child_type, parent_type
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      child_hdl = NULLHANDLE
+
+      IF (PRESENT(child_id)) THEN
+         CALL xios_xml_tree_add(parent_hdl%daddr, parent_type, child_hdl%daddr, child_type, child_id, len(child_id))
+      ELSE
+         CALL xios_xml_tree_add(parent_hdl%daddr, parent_type, child_hdl%daddr, child_type, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add
+
+   SUBROUTINE xml_tree_show(filename)
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: filename
+      IF (PRESENT(filename)) THEN
+         CALL xios_xml_tree_show(filename, len(filename))
+      ELSE
+         CALL xios_xml_tree_show("NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_show
+
+   SUBROUTINE xml_parse_file(filename)
+      CHARACTER(len = *), INTENT(IN) :: filename
+      CALL xios_xml_Parse_File(filename, len(filename))
+   END SUBROUTINE xml_Parse_File
+
+   SUBROUTINE xml_parse_string(xmlcontent)
+      CHARACTER(len = *), INTENT(IN) :: xmlcontent
+      CALL xios_xml_Parse_String(xmlcontent, len(xmlcontent))
+   END SUBROUTINE xml_Parse_String
+
+   SUBROUTINE context_set_current(context, withswap)
+      TYPE(XHandle), INTENT(IN)                :: context
+      LOGICAL (kind = 1), OPTIONAL, INTENT(IN) :: withswap
+      LOGICAL (kind = 1)                       :: wswap
+      IF (PRESENT(withswap)) THEN
+         wswap = withswap
+      ELSE
+         wswap = .FALSE.
+      END IF
+      CALL xios_context_set_current(context%daddr, wswap)
+   END SUBROUTINE context_set_current
+
+   SUBROUTINE context_create(context_hdl, context_id, calendar_type, init_date)
+      TYPE(XHandle), INTENT(OUT)        :: context_hdl
+      CHARACTER(len = *), INTENT(IN)    :: context_id
+      INTEGER, INTENT(IN)               :: calendar_type
+      TYPE(XDate), INTENT(IN), OPTIONAL :: init_date
+      IF (PRESENT(init_date)) THEN
+         CALL xios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, &
+                                  init_date%year, init_date%month, init_date%day,                &
+                                  init_date%hour, init_date%minute, init_date%second)
+      ELSE
+         CALL xios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, &
+                                 0, 1, 1, 0, 0, 0)
+      END IF
+   END SUBROUTINE context_create
+
+   SUBROUTINE dtreatment_start(context_hdl, filetype)
+      TYPE(XHandle), INTENT(IN), VALUE :: context_hdl
+      INTEGER, INTENT(IN), OPTIONAL    :: filetype
+      INTEGER                          :: filetype_
+      IF (PRESENT(filetype)) THEN
+         filetype_ = filetype
+      ELSE
+         filetype_ = NETCDF4
+      END IF
+         CALL context_set_current(context_hdl)
+         CALL xios_dtreatment_start(context_hdl%daddr, filetype_)
+   END SUBROUTINE dtreatment_start
+
+   SUBROUTINE dtreatment_end(context_hdl)
+      TYPE(XHandle), INTENT(IN), VALUE :: context_hdl
+      CALL context_set_current(context_hdl)
+      CALL xios_dtreatment_end()
+   END SUBROUTINE dtreatment_end
+
+   SUBROUTINE write_data (fieldid,                         &
+                          data1d_k8, data2d_k8, data3d_k8)
+      CHARACTER(len = *), INTENT(IN)                     :: fieldid
+      REAL(kind = 8), DIMENSION(*), OPTIONAL, INTENT(IN) :: data1d_k8(:), data2d_k8(:,:), data3d_k8(:,:,:)
+      IF((.NOT. PRESENT(data1d_k8)) .AND. &
+         (.NOT. PRESENT(data2d_k8)) .AND. &
+         (.NOT. PRESENT(data3d_k8))) THEN
+         PRINT *, "(F2003 interface) Veuillez spÃÂ©cifier des donnÃ©es Ã  Ã©crire !"
+         STOP
+      END IF
+      IF (PRESENT (data1d_k8)) THEN
+         CALL xios_write_data(fieldid, len(fieldid), data1d_k8, &
+                              size(data1d_k8, 1), -1, -1)
+      ELSE IF (PRESENT (data2d_k8)) THEN
+         CALL xios_write_data(fieldid, len(fieldid), data2d_k8, &
+                              size(data2d_k8, 1), size(data2d_k8, 2), -1)
+      ELSE IF (PRESENT (data3d_k8)) THEN
+         CALL xios_write_data(fieldid, len(fieldid), data3d_k8, &
+                              size(data3d_k8, 1), size(data3d_k8, 2), size(data3d_k8, 3))
+      END IF
+   END SUBROUTINE
+
+   SUBROUTINE  set_axis_attributes( axis_hdl, ftype &
+   #undef  DECLARE_ATTRIBUTE
+   #define DECLARE_ATTRIBUTE(type, name) arg_##type(name) &
+   #include "../config/axis_attribute.conf"
+   )
+
+      TYPE(XHandle) :: axis_hdl
+      INTEGER (kind = C_INT)      :: ftype
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) def_##type(name)
+      #include "../config/axis_attribute.conf"
+
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) ip_##type(axis, name)
+      #include "../config/axis_attribute.conf"
+
+   END SUBROUTINE set_axis_attributes
+
+   SUBROUTINE  set_field_attributes( field_hdl, ftype &
+   #undef  DECLARE_ATTRIBUTE
+   #define DECLARE_ATTRIBUTE(type, name) arg_##type(name) &
+   #include "../config/field_attribute.conf"
+   )
+
+      TYPE(XHandle) :: field_hdl
+      INTEGER (kind = C_INT)      :: ftype
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) def_##type(name)
+      #include "../config/field_attribute.conf"
+
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) ip_##type(field, name)
+      #include "../config/field_attribute.conf"
+
+   END SUBROUTINE set_field_attributes
+
+   SUBROUTINE  set_context_attributes( context_hdl, ftype &
+   #undef  DECLARE_ATTRIBUTE
+   #define DECLARE_ATTRIBUTE(type, name) arg_##type(name) &
+   #include "../config/context_attribute.conf"
+   )
+
+      TYPE(XHandle) :: context_hdl
+      INTEGER (kind = C_INT)      :: ftype
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) def_##type(name)
+      #include "../config/context_attribute.conf"
+
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) ip_##type(context, name)
+      #include "../config/context_attribute.conf"
+
+   END SUBROUTINE set_context_attributes
+
+   SUBROUTINE  set_domain_attributes( domain_hdl, ftype &
+   #undef  DECLARE_ATTRIBUTE
+   #define DECLARE_ATTRIBUTE(type, name) arg_##type(name) &
+   #include "../config/domain_attribute.conf"
+   )
+
+      TYPE(XHandle) :: domain_hdl
+      INTEGER (kind = C_INT)      :: ftype
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) def_##type(name)
+      #include "../config/domain_attribute.conf"
+
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) ip_##type(domain, name)
+      #include "../config/domain_attribute.conf"
+
+   END SUBROUTINE set_domain_attributes
+
+   SUBROUTINE  set_grid_attributes( grid_hdl, ftype &
+   #undef  DECLARE_ATTRIBUTE
+   #define DECLARE_ATTRIBUTE(type, name) arg_##type(name) &
+   #include "../config/grid_attribute.conf"
+   )
+
+      TYPE(XHandle) :: grid_hdl
+      INTEGER (kind = C_INT)      :: ftype
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) def_##type(name)
+      #include "../config/grid_attribute.conf"
+
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) ip_##type(grid, name)
+      #include "../config/grid_attribute.conf"
+
+   END SUBROUTINE set_grid_attributes
+
+   SUBROUTINE  set_file_attributes( file_hdl, ftype &
+   #undef  DECLARE_ATTRIBUTE
+   #define DECLARE_ATTRIBUTE(type, name) arg_##type(name) &
+   #include "../config/file_attribute.conf"
+   )
+
+      TYPE(XHandle) :: file_hdl
+      INTEGER (kind = C_INT)      :: ftype
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) def_##type(name)
+      #include "../config/file_attribute.conf"
+
+      #undef  DECLARE_ATTRIBUTE
+      #define DECLARE_ATTRIBUTE(type, name) ip_##type(file, name)
+      #include "../config/file_attribute.conf"
+
+   END SUBROUTINE set_file_attributes
+
+END MODULE IXMLIOSERVER
Index: XMLIO_V2/dev/dev_rv/src/xmlio/fortran/ixmlioserver.f90
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/fortran/ixmlioserver.f90	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/fortran/ixmlioserver.f90	(revision 152)
@@ -0,0 +1,983 @@
+! --------------------------------------------- !
+! IXMLIOSERVER !
+! GESTION DES ENTREES-SORTIES !
+! --------------------------------------------- !
+
+
+
+MODULE IXMLIOSERVER
+   USE ISO_C_BINDING
+
+   ! Ne jamais modifier les valeurs internes de ce type dans le code fortran.
+   TYPE XHandle
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE XHandle
+
+   ! enum XDType
+   INTEGER(kind = C_INT), PARAMETER :: NOTYPE = 0
+   INTEGER(kind = C_INT), PARAMETER :: DTREATMENT = 1, DDATE = 2, CALENDAR = 3, ECONTEXT = 4
+   INTEGER(kind = C_INT), PARAMETER :: EAXIS = 5 , EDOMAIN = 6 , EFIELD = 7 , EFILE = 8 , EGRID = 9
+   INTEGER(kind = C_INT), PARAMETER :: GAXIS = 10, GDOMAIN = 11, GFIELD = 12, GFILE = 13, GGRID = 14
+
+   ! enum XCalendarType
+   INTEGER(kind = C_INT), PARAMETER :: D360 = 0 , ALLLEAP = 1 , NOLEAP = 2 , JULIAN = 3 , GREGORIAN = 4
+
+   TYPE XDate
+      INTEGER :: year, month, day, hour, minute, second
+   END TYPE XDate
+
+   TYPE XDuration
+      REAL(kind = 8) :: year, month, day, hour, minute, second
+   END TYPE XDuration
+
+   ! Autres constantes
+   TYPE(XHandle) , PARAMETER :: NULLHANDLE = XHandle(0)
+
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+
+      SUBROUTINE xios_handle_create(ret, dtype, idt, idt_size) BIND(C)
+         import C_CHAR, C_INTPTR_T, C_INT
+         INTEGER (kind = C_INTPTR_T) :: ret
+         INTEGER (kind = C_INT), VALUE :: dtype
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: idt
+         INTEGER (kind = C_INT), VALUE :: idt_size
+      END SUBROUTINE xios_handle_create
+
+      SUBROUTINE xios_set_timestep(ts_year, ts_month, ts_day, &
+                                   ts_hour, ts_minute, ts_second) BIND(C)
+         import C_DOUBLE
+         REAL (kind = C_DOUBLE), VALUE :: ts_year, ts_month, ts_day, &
+                                          ts_hour, ts_minute, ts_second
+      END SUBROUTINE xios_set_timestep
+
+      SUBROUTINE xios_update_calendar(step) BIND(C)
+         import C_INT
+         INTEGER (kind = C_INT), VALUE :: step
+      END SUBROUTINE xios_update_calendar
+
+      SUBROUTINE xios_xml_tree_add(parent_, parent_type, child_, child_type, child_id, child_id_size) BIND(C)
+         import C_CHAR, C_INT, C_INTPTR_T
+         INTEGER (kind = C_INTPTR_T), VALUE :: parent_
+         INTEGER (kind = C_INT), VALUE :: parent_type
+         INTEGER (kind = C_INTPTR_T) :: child_
+         INTEGER (kind = C_INT), VALUE :: child_type
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: child_id
+         INTEGER (kind = C_INT), VALUE :: child_id_size
+      END SUBROUTINE xios_xml_tree_add
+
+      SUBROUTINE xios_xml_tree_show(filename, filename_size) BIND(C)
+         import C_CHAR, C_INT
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename
+         INTEGER (kind = C_INT), VALUE :: filename_size
+      END SUBROUTINE xios_xml_tree_show
+
+      SUBROUTINE xios_xml_parse_file(filename, filename_size) BIND(C)
+         import C_CHAR, C_INT
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: filename
+         INTEGER (kind = C_INT), VALUE :: filename_size
+      END SUBROUTINE xios_xml_Parse_File
+
+      SUBROUTINE xios_xml_parse_string(xmlcontent, xmlcontent_size) BIND(C)
+         import C_CHAR, C_INT
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: xmlcontent
+         INTEGER (kind = C_INT), VALUE :: xmlcontent_size
+      END SUBROUTINE xios_xml_Parse_String
+
+      SUBROUTINE xios_context_set_current(context, withswap) BIND(C)
+         import C_BOOL, C_INT, C_INTPTR_T
+         INTEGER (kind = C_INTPTR_T), VALUE :: context
+         LOGICAL (kind = C_BOOL), VALUE :: withswap
+      END SUBROUTINE xios_context_set_current
+
+      SUBROUTINE xios_context_create(context, context_id, context_id_size, calendar_type, &
+                                     year, month, day, hour, minute, second) BIND(C)
+         import C_CHAR, C_INT, C_INTPTR_T
+         INTEGER (kind = C_INTPTR_T) :: context
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: context_id
+         INTEGER (kind = C_INT), VALUE :: context_id_size
+         INTEGER (kind = C_INT), VALUE :: calendar_type, year, month, day, hour, minute, second
+      END SUBROUTINE xios_context_create
+
+      SUBROUTINE xios_dtreatment_start(context_hdl, filetype) BIND(C)
+         import C_INTPTR_T, C_INT
+         INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl
+         INTEGER (kind = C_INT), VALUE :: filetype
+      END SUBROUTINE xios_dtreatment_start
+
+      SUBROUTINE xios_dtreatment_end() BIND(C)
+         ! Sans argument
+      END SUBROUTINE xios_dtreatment_end
+
+      SUBROUTINE xios_write_data(fieldid, fieldid_size, data_k8, data_Xsize, data_Ysize, data_Zsize) BIND(C)
+         import C_INT, C_CHAR, C_PTR, C_FLOAT, C_DOUBLE, C_BOOL
+         CHARACTER(kind = C_CHAR), DIMENSION(*) :: fieldid
+         INTEGER (kind = C_INT), VALUE :: fieldid_size
+         REAL(kind = C_DOUBLE), DIMENSION(*) :: data_k8
+         INTEGER (kind = C_INT), VALUE :: data_Xsize, data_Ysize, data_Zsize
+      END SUBROUTINE xios_write_data
+SUBROUTINE xios_set_axis_name(axis_hdl, ftype ,name ,name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: name
+ INTEGER (kind = C_INT) :: name_size
+ END SUBROUTINE xios_set_axis_name
+
+SUBROUTINE xios_set_axis_standard_name(axis_hdl, ftype ,standard_name ,standard_name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: standard_name
+ INTEGER (kind = C_INT) :: standard_name_size
+ END SUBROUTINE xios_set_axis_standard_name
+
+SUBROUTINE xios_set_axis_long_name(axis_hdl, ftype ,long_name ,long_name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: long_name
+ INTEGER (kind = C_INT) :: long_name_size
+ END SUBROUTINE xios_set_axis_long_name
+
+SUBROUTINE xios_set_axis_unit(axis_hdl, ftype ,unit ,unit_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: unit
+ INTEGER (kind = C_INT) :: unit_size
+ END SUBROUTINE xios_set_axis_unit
+
+SUBROUTINE xios_set_axis_size(axis_hdl, ftype ,size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: size
+ END SUBROUTINE xios_set_axis_size
+
+SUBROUTINE xios_set_axis_zvalue(axis_hdl, ftype ,zvalue ,zvalue_extent1) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ REAL(kind = C_DOUBLE), DIMENSION(*) :: zvalue
+ INTEGER (kind = C_INT) :: zvalue_extent1
+ END SUBROUTINE xios_set_axis_zvalue
+
+SUBROUTINE xios_set_field_name(field_hdl, ftype ,name ,name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: name
+ INTEGER (kind = C_INT) :: name_size
+ END SUBROUTINE xios_set_field_name
+
+SUBROUTINE xios_set_field_standard_name(field_hdl, ftype ,standard_name ,standard_name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: standard_name
+ INTEGER (kind = C_INT) :: standard_name_size
+ END SUBROUTINE xios_set_field_standard_name
+
+SUBROUTINE xios_set_field_long_name(field_hdl, ftype ,long_name ,long_name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: long_name
+ INTEGER (kind = C_INT) :: long_name_size
+ END SUBROUTINE xios_set_field_long_name
+
+SUBROUTINE xios_set_field_unit(field_hdl, ftype ,unit ,unit_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: unit
+ INTEGER (kind = C_INT) :: unit_size
+ END SUBROUTINE xios_set_field_unit
+
+SUBROUTINE xios_set_field_operation(field_hdl, ftype ,operation ,operation_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: operation
+ INTEGER (kind = C_INT) :: operation_size
+ END SUBROUTINE xios_set_field_operation
+
+SUBROUTINE xios_set_field_freq_op(field_hdl, ftype ,freq_op ,freq_op_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: freq_op
+ INTEGER (kind = C_INT) :: freq_op_size
+ END SUBROUTINE xios_set_field_freq_op
+
+SUBROUTINE xios_set_field_level(field_hdl, ftype ,level) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: level
+ END SUBROUTINE xios_set_field_level
+
+SUBROUTINE xios_set_field_prec(field_hdl, ftype ,prec) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: prec
+ END SUBROUTINE xios_set_field_prec
+
+SUBROUTINE xios_set_field_enabled(field_hdl, ftype ,enabled) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ LOGICAL (kind = C_BOOL) :: enabled
+ END SUBROUTINE xios_set_field_enabled
+
+SUBROUTINE xios_set_field_domain_ref(field_hdl, ftype ,domain_ref ,domain_ref_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: domain_ref
+ INTEGER (kind = C_INT) :: domain_ref_size
+ END SUBROUTINE xios_set_field_domain_ref
+
+SUBROUTINE xios_set_field_axis_ref(field_hdl, ftype ,axis_ref ,axis_ref_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: axis_ref
+ INTEGER (kind = C_INT) :: axis_ref_size
+ END SUBROUTINE xios_set_field_axis_ref
+
+SUBROUTINE xios_set_field_grid_ref(field_hdl, ftype ,grid_ref ,grid_ref_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: grid_ref
+ INTEGER (kind = C_INT) :: grid_ref_size
+ END SUBROUTINE xios_set_field_grid_ref
+
+SUBROUTINE xios_set_field_zoom_ref(field_hdl, ftype ,zoom_ref ,zoom_ref_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: zoom_ref
+ INTEGER (kind = C_INT) :: zoom_ref_size
+ END SUBROUTINE xios_set_field_zoom_ref
+
+SUBROUTINE xios_set_field_field_ref(field_hdl, ftype ,field_ref ,field_ref_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: field_ref
+ INTEGER (kind = C_INT) :: field_ref_size
+ END SUBROUTINE xios_set_field_field_ref
+
+SUBROUTINE xios_set_context_calendar_type(context_hdl, ftype ,calendar_type ,calendar_type_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: calendar_type
+ INTEGER (kind = C_INT) :: calendar_type_size
+ END SUBROUTINE xios_set_context_calendar_type
+
+SUBROUTINE xios_set_context_start_date(context_hdl, ftype ,start_date ,start_date_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: context_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: start_date
+ INTEGER (kind = C_INT) :: start_date_size
+ END SUBROUTINE xios_set_context_start_date
+
+SUBROUTINE xios_set_domain_name(domain_hdl, ftype ,name ,name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: name
+ INTEGER (kind = C_INT) :: name_size
+ END SUBROUTINE xios_set_domain_name
+
+SUBROUTINE xios_set_domain_standard_name(domain_hdl, ftype ,standard_name ,standard_name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: standard_name
+ INTEGER (kind = C_INT) :: standard_name_size
+ END SUBROUTINE xios_set_domain_standard_name
+
+SUBROUTINE xios_set_domain_long_name(domain_hdl, ftype ,long_name ,long_name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: long_name
+ INTEGER (kind = C_INT) :: long_name_size
+ END SUBROUTINE xios_set_domain_long_name
+
+SUBROUTINE xios_set_domain_ni_glo(domain_hdl, ftype ,ni_glo) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: ni_glo
+ END SUBROUTINE xios_set_domain_ni_glo
+
+SUBROUTINE xios_set_domain_nj_glo(domain_hdl, ftype ,nj_glo) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: nj_glo
+ END SUBROUTINE xios_set_domain_nj_glo
+
+SUBROUTINE xios_set_domain_ibegin(domain_hdl, ftype ,ibegin) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: ibegin
+ END SUBROUTINE xios_set_domain_ibegin
+
+SUBROUTINE xios_set_domain_iend(domain_hdl, ftype ,iend) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: iend
+ END SUBROUTINE xios_set_domain_iend
+
+SUBROUTINE xios_set_domain_ni(domain_hdl, ftype ,ni) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: ni
+ END SUBROUTINE xios_set_domain_ni
+
+SUBROUTINE xios_set_domain_jbegin(domain_hdl, ftype ,jbegin) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: jbegin
+ END SUBROUTINE xios_set_domain_jbegin
+
+SUBROUTINE xios_set_domain_jend(domain_hdl, ftype ,jend) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: jend
+ END SUBROUTINE xios_set_domain_jend
+
+SUBROUTINE xios_set_domain_nj(domain_hdl, ftype ,nj) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: nj
+ END SUBROUTINE xios_set_domain_nj
+
+SUBROUTINE xios_set_domain_mask(domain_hdl, ftype ,mask ,mask_extent1 ,mask_extent2) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ LOGICAL(kind = C_BOOL), DIMENSION(*) :: mask
+ INTEGER (kind = C_INT) :: mask_extent1
+ INTEGER (kind = C_INT) :: mask_extent2
+ END SUBROUTINE xios_set_domain_mask
+
+SUBROUTINE xios_set_domain_data_dim(domain_hdl, ftype ,data_dim) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: data_dim
+ END SUBROUTINE xios_set_domain_data_dim
+
+SUBROUTINE xios_set_domain_data_ni(domain_hdl, ftype ,data_ni) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: data_ni
+ END SUBROUTINE xios_set_domain_data_ni
+
+SUBROUTINE xios_set_domain_data_nj(domain_hdl, ftype ,data_nj) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: data_nj
+ END SUBROUTINE xios_set_domain_data_nj
+
+SUBROUTINE xios_set_domain_data_ibegin(domain_hdl, ftype ,data_ibegin) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: data_ibegin
+ END SUBROUTINE xios_set_domain_data_ibegin
+
+SUBROUTINE xios_set_domain_data_jbegin(domain_hdl, ftype ,data_jbegin) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: data_jbegin
+ END SUBROUTINE xios_set_domain_data_jbegin
+
+SUBROUTINE xios_set_domain_data_n_index(domain_hdl, ftype ,data_n_index) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: data_n_index
+ END SUBROUTINE xios_set_domain_data_n_index
+
+SUBROUTINE xios_set_domain_data_i_index(domain_hdl, ftype ,data_i_index ,data_i_index_extent1) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER(kind = C_INT), DIMENSION(*) :: data_i_index
+ INTEGER (kind = C_INT) :: data_i_index_extent1
+ END SUBROUTINE xios_set_domain_data_i_index
+
+SUBROUTINE xios_set_domain_data_j_index(domain_hdl, ftype ,data_j_index ,data_j_index_extent1) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER(kind = C_INT), DIMENSION(*) :: data_j_index
+ INTEGER (kind = C_INT) :: data_j_index_extent1
+ END SUBROUTINE xios_set_domain_data_j_index
+
+SUBROUTINE xios_set_domain_lonvalue(domain_hdl, ftype ,lonvalue ,lonvalue_extent1) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ REAL(kind = C_DOUBLE), DIMENSION(*) :: lonvalue
+ INTEGER (kind = C_INT) :: lonvalue_extent1
+ END SUBROUTINE xios_set_domain_lonvalue
+
+SUBROUTINE xios_set_domain_latvalue(domain_hdl, ftype ,latvalue ,latvalue_extent1) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ REAL(kind = C_DOUBLE), DIMENSION(*) :: latvalue
+ INTEGER (kind = C_INT) :: latvalue_extent1
+ END SUBROUTINE xios_set_domain_latvalue
+
+SUBROUTINE xios_set_file_name(file_hdl, ftype ,name ,name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: name
+ INTEGER (kind = C_INT) :: name_size
+ END SUBROUTINE xios_set_file_name
+
+SUBROUTINE xios_set_file_description(file_hdl, ftype ,description ,description_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: description
+ INTEGER (kind = C_INT) :: description_size
+ END SUBROUTINE xios_set_file_description
+
+SUBROUTINE xios_set_file_output_freq(file_hdl, ftype ,output_freq ,output_freq_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: output_freq
+ INTEGER (kind = C_INT) :: output_freq_size
+ END SUBROUTINE xios_set_file_output_freq
+
+SUBROUTINE xios_set_file_output_level(file_hdl, ftype ,output_level) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ INTEGER (kind = C_INT) :: output_level
+ END SUBROUTINE xios_set_file_output_level
+
+SUBROUTINE xios_set_file_enabled(file_hdl, ftype ,enabled) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ LOGICAL (kind = C_BOOL) :: enabled
+ END SUBROUTINE xios_set_file_enabled
+
+SUBROUTINE xios_set_grid_name(grid_hdl, ftype ,name ,name_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: grid_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: name
+ INTEGER (kind = C_INT) :: name_size
+ END SUBROUTINE xios_set_grid_name
+
+SUBROUTINE xios_set_grid_description(grid_hdl, ftype ,description ,description_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: grid_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: description
+ INTEGER (kind = C_INT) :: description_size
+ END SUBROUTINE xios_set_grid_description
+
+SUBROUTINE xios_set_grid_domain_ref(grid_hdl, ftype ,domain_ref ,domain_ref_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: grid_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: domain_ref
+ INTEGER (kind = C_INT) :: domain_ref_size
+ END SUBROUTINE xios_set_grid_domain_ref
+
+SUBROUTINE xios_set_grid_axis_ref(grid_hdl, ftype ,axis_ref ,axis_ref_size) BIND(C)
+ USE ISO_C_BINDING
+ INTEGER (kind = C_INTPTR_T), VALUE :: grid_hdl
+ INTEGER (kind = C_INT), VALUE :: ftype
+ CHARACTER(kind = C_CHAR), DIMENSION(*) :: axis_ref
+ INTEGER (kind = C_INT) :: axis_ref_size
+ END SUBROUTINE xios_set_grid_axis_ref
+
+   END INTERFACE
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+   SUBROUTINE handle_create(ret, dtype, idt)
+      TYPE(XHandle), INTENT(OUT) :: ret
+      INTEGER, INTENT(IN) :: dtype
+      CHARACTER(len = *), INTENT(IN) :: idt
+      CALL xios_handle_create(ret%daddr, dtype, idt, len(idt))
+   END SUBROUTINE handle_create
+   SUBROUTINE set_timestep(timestep)
+      TYPE(XDuration), INTENT(IN):: timestep
+      CALL xios_set_timestep(timestep%year, timestep%month , timestep%day, &
+                             timestep%hour, timestep%minute, timestep%second)
+   END SUBROUTINE set_timestep
+   SUBROUTINE update_calendar(step)
+      INTEGER, INTENT(IN):: step
+      IF (step < 1) THEN
+         PRINT *, "L'argument 'step' ne peut Ãªtre nÃ©gatif ou nul"
+         STOP
+      END IF
+      CALL xios_update_calendar(step)
+   END SUBROUTINE update_calendar
+   SUBROUTINE xml_tree_add(parent_hdl, parent_type, child_hdl, child_type, child_id)
+      TYPE(XHandle), INTENT(IN) :: parent_hdl
+      TYPE(XHandle), INTENT(OUT) :: child_hdl
+      INTEGER, INTENT(IN) :: child_type, parent_type
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: child_id
+      child_hdl = NULLHANDLE
+      IF (PRESENT(child_id)) THEN
+         CALL xios_xml_tree_add(parent_hdl%daddr, parent_type, child_hdl%daddr, child_type, child_id, len(child_id))
+      ELSE
+         CALL xios_xml_tree_add(parent_hdl%daddr, parent_type, child_hdl%daddr, child_type, "NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_add
+   SUBROUTINE xml_tree_show(filename)
+      CHARACTER(len = *), OPTIONAL, INTENT(IN) :: filename
+      IF (PRESENT(filename)) THEN
+         CALL xios_xml_tree_show(filename, len(filename))
+      ELSE
+         CALL xios_xml_tree_show("NONE", -1)
+      END IF
+   END SUBROUTINE xml_tree_show
+   SUBROUTINE xml_parse_file(filename)
+      CHARACTER(len = *), INTENT(IN) :: filename
+      CALL xios_xml_Parse_File(filename, len(filename))
+   END SUBROUTINE xml_Parse_File
+   SUBROUTINE xml_parse_string(xmlcontent)
+      CHARACTER(len = *), INTENT(IN) :: xmlcontent
+      CALL xios_xml_Parse_String(xmlcontent, len(xmlcontent))
+   END SUBROUTINE xml_Parse_String
+   SUBROUTINE context_set_current(context, withswap)
+      TYPE(XHandle), INTENT(IN) :: context
+      LOGICAL (kind = 1), OPTIONAL, INTENT(IN) :: withswap
+      LOGICAL (kind = 1) :: wswap
+      IF (PRESENT(withswap)) THEN
+         wswap = withswap
+      ELSE
+         wswap = .FALSE.
+      END IF
+      CALL xios_context_set_current(context%daddr, wswap)
+   END SUBROUTINE context_set_current
+   SUBROUTINE context_create(context_hdl, context_id, calendar_type, init_date)
+      TYPE(XHandle), INTENT(OUT) :: context_hdl
+      CHARACTER(len = *), INTENT(IN) :: context_id
+      INTEGER, INTENT(IN) :: calendar_type
+      TYPE(XDate), INTENT(IN), OPTIONAL :: init_date
+      IF (PRESENT(init_date)) THEN
+         CALL xios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, &
+                                  init_date%year, init_date%month, init_date%day, &
+                                  init_date%hour, init_date%minute, init_date%second)
+      ELSE
+         CALL xios_context_create(context_hdl%daddr, context_id, len(context_id), calendar_type, &
+                                 0, 1, 1, 0, 0, 0)
+      END IF
+   END SUBROUTINE context_create
+   SUBROUTINE dtreatment_start(context_hdl, filetype)
+      TYPE(XHandle), INTENT(IN), VALUE :: context_hdl
+      INTEGER, INTENT(IN), OPTIONAL :: filetype
+      INTEGER :: filetype_
+      IF (PRESENT(filetype)) THEN
+         filetype_ = filetype
+      ELSE
+         filetype_ = NETCDF4
+      END IF
+         CALL context_set_current(context_hdl)
+         CALL xios_dtreatment_start(context_hdl%daddr, filetype_)
+   END SUBROUTINE dtreatment_start
+   SUBROUTINE dtreatment_end(context_hdl)
+      TYPE(XHandle), INTENT(IN), VALUE :: context_hdl
+      CALL context_set_current(context_hdl)
+      CALL xios_dtreatment_end()
+   END SUBROUTINE dtreatment_end
+   SUBROUTINE write_data (fieldid, &
+                          data1d_k8, data2d_k8, data3d_k8)
+      CHARACTER(len = *), INTENT(IN) :: fieldid
+      REAL(kind = 8), DIMENSION(*), OPTIONAL, INTENT(IN) :: data1d_k8(:), data2d_k8(:,:), data3d_k8(:,:,:)
+      IF((.NOT. PRESENT(data1d_k8)) .AND. &
+         (.NOT. PRESENT(data2d_k8)) .AND. &
+         (.NOT. PRESENT(data3d_k8))) THEN
+         PRINT *, "(F2003 interface) Veuillez spÃÂ©cifier des donnÃ©es Ã  Ã©crire !"
+         STOP
+      END IF
+      IF (PRESENT (data1d_k8)) THEN
+         CALL xios_write_data(fieldid, len(fieldid), data1d_k8, &
+                              size(data1d_k8, 1), -1, -1)
+      ELSE IF (PRESENT (data2d_k8)) THEN
+         CALL xios_write_data(fieldid, len(fieldid), data2d_k8, &
+                              size(data2d_k8, 1), size(data2d_k8, 2), -1)
+      ELSE IF (PRESENT (data3d_k8)) THEN
+         CALL xios_write_data(fieldid, len(fieldid), data3d_k8, &
+                              size(data3d_k8, 1), size(data3d_k8, 2), size(data3d_k8, 3))
+      END IF
+   END SUBROUTINE
+   SUBROUTINE set_axis_attributes( axis_hdl, ftype &
+,name_ &
+,standard_name_ &
+,long_name_ &
+,unit_ &
+,size_ &
+,zvalue_ &
+   )
+      TYPE(XHandle) :: axis_hdl
+      INTEGER (kind = C_INT) :: ftype
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: standard_name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: long_name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: unit_
+INTEGER, OPTIONAL, INTENT(IN) :: size_
+REAL(kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: zvalue_(:)
+IF (PRESENT(name_)) THEN
+ CALL xios_set_axis_name(axis_hdl%daddr, ftype, name_, len(name_))
+ END IF
+
+IF (PRESENT(standard_name_)) THEN
+ CALL xios_set_axis_standard_name(axis_hdl%daddr, ftype, standard_name_, len(standard_name_))
+ END IF
+
+IF (PRESENT(long_name_)) THEN
+ CALL xios_set_axis_long_name(axis_hdl%daddr, ftype, long_name_, len(long_name_))
+ END IF
+
+IF (PRESENT(unit_)) THEN
+ CALL xios_set_axis_unit(axis_hdl%daddr, ftype, unit_, len(unit_))
+ END IF
+
+IF (PRESENT(size_)) THEN
+ CALL xios_set_axis_size(axis_hdl%daddr, ftype, size_)
+ END IF
+
+IF (PRESENT(zvalue_)) THEN
+ CALL xios_set_axis_zvalue(axis_hdl%daddr, ftype, zvalue_, size(zvalue_, 1))
+ END IF
+
+   END SUBROUTINE set_axis_attributes
+   SUBROUTINE set_field_attributes( field_hdl, ftype &
+,name_ &
+,standard_name_ &
+,long_name_ &
+,unit_ &
+,operation_ &
+,freq_op_ &
+,level_ &
+,prec_ &
+,enabled_ &
+,domain_ref_ &
+,axis_ref_ &
+,grid_ref_ &
+,zoom_ref_ &
+,field_ref_ &
+   )
+      TYPE(XHandle) :: field_hdl
+      INTEGER (kind = C_INT) :: ftype
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: standard_name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: long_name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: unit_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: operation_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: freq_op_
+INTEGER, OPTIONAL, INTENT(IN) :: level_
+INTEGER, OPTIONAL, INTENT(IN) :: prec_
+LOGICAL(kind = 1), OPTIONAL, INTENT(IN) :: enabled_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: domain_ref_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: axis_ref_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: grid_ref_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: zoom_ref_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: field_ref_
+IF (PRESENT(name_)) THEN
+ CALL xios_set_field_name(field_hdl%daddr, ftype, name_, len(name_))
+ END IF
+
+IF (PRESENT(standard_name_)) THEN
+ CALL xios_set_field_standard_name(field_hdl%daddr, ftype, standard_name_, len(standard_name_))
+ END IF
+
+IF (PRESENT(long_name_)) THEN
+ CALL xios_set_field_long_name(field_hdl%daddr, ftype, long_name_, len(long_name_))
+ END IF
+
+IF (PRESENT(unit_)) THEN
+ CALL xios_set_field_unit(field_hdl%daddr, ftype, unit_, len(unit_))
+ END IF
+
+IF (PRESENT(operation_)) THEN
+ CALL xios_set_field_operation(field_hdl%daddr, ftype, operation_, len(operation_))
+ END IF
+
+IF (PRESENT(freq_op_)) THEN
+ CALL xios_set_field_freq_op(field_hdl%daddr, ftype, freq_op_, len(freq_op_))
+ END IF
+
+IF (PRESENT(level_)) THEN
+ CALL xios_set_field_level(field_hdl%daddr, ftype, level_)
+ END IF
+
+IF (PRESENT(prec_)) THEN
+ CALL xios_set_field_prec(field_hdl%daddr, ftype, prec_)
+ END IF
+
+IF (PRESENT(enabled_)) THEN
+ CALL xios_set_field_enabled(field_hdl%daddr, ftype, enabled_)
+ END IF
+
+IF (PRESENT(domain_ref_)) THEN
+ CALL xios_set_field_domain_ref(field_hdl%daddr, ftype, domain_ref_, len(domain_ref_))
+ END IF
+
+IF (PRESENT(axis_ref_)) THEN
+ CALL xios_set_field_axis_ref(field_hdl%daddr, ftype, axis_ref_, len(axis_ref_))
+ END IF
+
+IF (PRESENT(grid_ref_)) THEN
+ CALL xios_set_field_grid_ref(field_hdl%daddr, ftype, grid_ref_, len(grid_ref_))
+ END IF
+
+IF (PRESENT(zoom_ref_)) THEN
+ CALL xios_set_field_zoom_ref(field_hdl%daddr, ftype, zoom_ref_, len(zoom_ref_))
+ END IF
+
+IF (PRESENT(field_ref_)) THEN
+ CALL xios_set_field_field_ref(field_hdl%daddr, ftype, field_ref_, len(field_ref_))
+ END IF
+
+   END SUBROUTINE set_field_attributes
+   SUBROUTINE set_context_attributes( context_hdl, ftype &
+,calendar_type_ &
+,start_date_ &
+   )
+      TYPE(XHandle) :: context_hdl
+      INTEGER (kind = C_INT) :: ftype
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: calendar_type_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: start_date_
+IF (PRESENT(calendar_type_)) THEN
+ CALL xios_set_context_calendar_type(context_hdl%daddr, ftype, calendar_type_, len(calendar_type_))
+ END IF
+
+IF (PRESENT(start_date_)) THEN
+ CALL xios_set_context_start_date(context_hdl%daddr, ftype, start_date_, len(start_date_))
+ END IF
+
+   END SUBROUTINE set_context_attributes
+   SUBROUTINE set_domain_attributes( domain_hdl, ftype &
+,name_ &
+,standard_name_ &
+,long_name_ &
+,ni_glo_ &
+,nj_glo_ &
+,ibegin_ &
+,iend_ &
+,ni_ &
+,jbegin_ &
+,jend_ &
+,nj_ &
+,mask_ &
+,data_dim_ &
+,data_ni_ &
+,data_nj_ &
+,data_ibegin_ &
+,data_jbegin_ &
+,data_n_index_ &
+,data_i_index_ &
+,data_j_index_ &
+,lonvalue_ &
+,latvalue_ &
+   )
+      TYPE(XHandle) :: domain_hdl
+      INTEGER (kind = C_INT) :: ftype
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: standard_name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: long_name_
+INTEGER, OPTIONAL, INTENT(IN) :: ni_glo_
+INTEGER, OPTIONAL, INTENT(IN) :: nj_glo_
+INTEGER, OPTIONAL, INTENT(IN) :: ibegin_
+INTEGER, OPTIONAL, INTENT(IN) :: iend_
+INTEGER, OPTIONAL, INTENT(IN) :: ni_
+INTEGER, OPTIONAL, INTENT(IN) :: jbegin_
+INTEGER, OPTIONAL, INTENT(IN) :: jend_
+INTEGER, OPTIONAL, INTENT(IN) :: nj_
+LOGICAL(kind = 1), dimension(*), OPTIONAL, INTENT(IN) :: mask_(:,:)
+INTEGER, OPTIONAL, INTENT(IN) :: data_dim_
+INTEGER, OPTIONAL, INTENT(IN) :: data_ni_
+INTEGER, OPTIONAL, INTENT(IN) :: data_nj_
+INTEGER, OPTIONAL, INTENT(IN) :: data_ibegin_
+INTEGER, OPTIONAL, INTENT(IN) :: data_jbegin_
+INTEGER, OPTIONAL, INTENT(IN) :: data_n_index_
+INTEGER, dimension(*), OPTIONAL, INTENT(IN) :: data_i_index_(:)
+INTEGER, dimension(*), OPTIONAL, INTENT(IN) :: data_j_index_(:)
+REAL(kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: lonvalue_(:)
+REAL(kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: latvalue_(:)
+IF (PRESENT(name_)) THEN
+ CALL xios_set_domain_name(domain_hdl%daddr, ftype, name_, len(name_))
+ END IF
+
+IF (PRESENT(standard_name_)) THEN
+ CALL xios_set_domain_standard_name(domain_hdl%daddr, ftype, standard_name_, len(standard_name_))
+ END IF
+
+IF (PRESENT(long_name_)) THEN
+ CALL xios_set_domain_long_name(domain_hdl%daddr, ftype, long_name_, len(long_name_))
+ END IF
+
+IF (PRESENT(ni_glo_)) THEN
+ CALL xios_set_domain_ni_glo(domain_hdl%daddr, ftype, ni_glo_)
+ END IF
+
+IF (PRESENT(nj_glo_)) THEN
+ CALL xios_set_domain_nj_glo(domain_hdl%daddr, ftype, nj_glo_)
+ END IF
+
+IF (PRESENT(ibegin_)) THEN
+ CALL xios_set_domain_ibegin(domain_hdl%daddr, ftype, ibegin_)
+ END IF
+
+IF (PRESENT(iend_)) THEN
+ CALL xios_set_domain_iend(domain_hdl%daddr, ftype, iend_)
+ END IF
+
+IF (PRESENT(ni_)) THEN
+ CALL xios_set_domain_ni(domain_hdl%daddr, ftype, ni_)
+ END IF
+
+IF (PRESENT(jbegin_)) THEN
+ CALL xios_set_domain_jbegin(domain_hdl%daddr, ftype, jbegin_)
+ END IF
+
+IF (PRESENT(jend_)) THEN
+ CALL xios_set_domain_jend(domain_hdl%daddr, ftype, jend_)
+ END IF
+
+IF (PRESENT(nj_)) THEN
+ CALL xios_set_domain_nj(domain_hdl%daddr, ftype, nj_)
+ END IF
+
+IF (PRESENT(mask_)) THEN
+ CALL xios_set_domain_mask(domain_hdl%daddr, ftype, mask_, size(mask_, 1), size(mask_, 2))
+ END IF
+
+IF (PRESENT(data_dim_)) THEN
+ CALL xios_set_domain_data_dim(domain_hdl%daddr, ftype, data_dim_)
+ END IF
+
+IF (PRESENT(data_ni_)) THEN
+ CALL xios_set_domain_data_ni(domain_hdl%daddr, ftype, data_ni_)
+ END IF
+
+IF (PRESENT(data_nj_)) THEN
+ CALL xios_set_domain_data_nj(domain_hdl%daddr, ftype, data_nj_)
+ END IF
+
+IF (PRESENT(data_ibegin_)) THEN
+ CALL xios_set_domain_data_ibegin(domain_hdl%daddr, ftype, data_ibegin_)
+ END IF
+
+IF (PRESENT(data_jbegin_)) THEN
+ CALL xios_set_domain_data_jbegin(domain_hdl%daddr, ftype, data_jbegin_)
+ END IF
+
+IF (PRESENT(data_n_index_)) THEN
+ CALL xios_set_domain_data_n_index(domain_hdl%daddr, ftype, data_n_index_)
+ END IF
+
+IF (PRESENT(data_i_index_)) THEN
+ CALL xios_set_domain_data_i_index(domain_hdl%daddr, ftype, data_i_index_, size(data_i_index_, 1))
+ END IF
+
+IF (PRESENT(data_j_index_)) THEN
+ CALL xios_set_domain_data_j_index(domain_hdl%daddr, ftype, data_j_index_, size(data_j_index_, 1))
+ END IF
+
+IF (PRESENT(lonvalue_)) THEN
+ CALL xios_set_domain_lonvalue(domain_hdl%daddr, ftype, lonvalue_, size(lonvalue_, 1))
+ END IF
+
+IF (PRESENT(latvalue_)) THEN
+ CALL xios_set_domain_latvalue(domain_hdl%daddr, ftype, latvalue_, size(latvalue_, 1))
+ END IF
+
+   END SUBROUTINE set_domain_attributes
+   SUBROUTINE set_grid_attributes( grid_hdl, ftype &
+,name_ &
+,description_ &
+,domain_ref_ &
+,axis_ref_ &
+   )
+      TYPE(XHandle) :: grid_hdl
+      INTEGER (kind = C_INT) :: ftype
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: domain_ref_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: axis_ref_
+IF (PRESENT(name_)) THEN
+ CALL xios_set_grid_name(grid_hdl%daddr, ftype, name_, len(name_))
+ END IF
+
+IF (PRESENT(description_)) THEN
+ CALL xios_set_grid_description(grid_hdl%daddr, ftype, description_, len(description_))
+ END IF
+
+IF (PRESENT(domain_ref_)) THEN
+ CALL xios_set_grid_domain_ref(grid_hdl%daddr, ftype, domain_ref_, len(domain_ref_))
+ END IF
+
+IF (PRESENT(axis_ref_)) THEN
+ CALL xios_set_grid_axis_ref(grid_hdl%daddr, ftype, axis_ref_, len(axis_ref_))
+ END IF
+
+   END SUBROUTINE set_grid_attributes
+   SUBROUTINE set_file_attributes( file_hdl, ftype &
+,name_ &
+,description_ &
+,output_freq_ &
+,output_level_ &
+,enabled_ &
+   )
+      TYPE(XHandle) :: file_hdl
+      INTEGER (kind = C_INT) :: ftype
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: description_
+CHARACTER(len = *), OPTIONAL, INTENT(IN) :: output_freq_
+INTEGER, OPTIONAL, INTENT(IN) :: output_level_
+LOGICAL(kind = 1), OPTIONAL, INTENT(IN) :: enabled_
+IF (PRESENT(name_)) THEN
+ CALL xios_set_file_name(file_hdl%daddr, ftype, name_, len(name_))
+ END IF
+
+IF (PRESENT(description_)) THEN
+ CALL xios_set_file_description(file_hdl%daddr, ftype, description_, len(description_))
+ END IF
+
+IF (PRESENT(output_freq_)) THEN
+ CALL xios_set_file_output_freq(file_hdl%daddr, ftype, output_freq_, len(output_freq_))
+ END IF
+
+IF (PRESENT(output_level_)) THEN
+ CALL xios_set_file_output_level(file_hdl%daddr, ftype, output_level_)
+ END IF
+
+IF (PRESENT(enabled_)) THEN
+ CALL xios_set_file_enabled(file_hdl%daddr, ftype, enabled_)
+ END IF
+
+   END SUBROUTINE set_file_attributes
+END MODULE IXMLIOSERVER
Index: XMLIO_V2/dev/dev_rv/src/xmlio/fortran/macro.inc
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/fortran/macro.inc	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/fortran/macro.inc	(revision 152)
@@ -0,0 +1,136 @@
+#define iarg_bool(name) ,name
+#define iarg_int(name) ,name
+#define iarg_StdString(name) ,name iarg_int(name##_size)
+
+#define iarg_ARRAY1(name) ,name iarg_int(name##_extent1)
+#define iarg_ARRAY2(name) iarg_ARRAY1(name) iarg_int(name##_extent2)
+#define iarg_ARRAY3(name) iarg_ARRAY2(name) iarg_int(name##_extent3)
+#define iarg_ARRAY(type, numdim) iarg_ARRAY##numdim
+
+//--------------------------------
+
+#define arg_bool(name) ,name##_
+#define arg_int(name) ,name##_
+#define arg_StdString(name) ,name##_
+#define arg_ARRAY_(name) ,name##_
+#define arg_ARRAY(type, numdim) arg##_ARRAY_
+
+//---------------------------------
+
+#define dec_bool(name) \
+   LOGICAL (kind = C_BOOL) :: name;
+
+#define dec_int(name) \
+   INTEGER (kind = C_INT) :: name;
+
+#define dec_StdString(name) \
+   CHARACTER(kind = C_CHAR), DIMENSION(*) :: name; \
+   dec_int(name##_size)
+
+#define dec_double1(name) \
+   REAL(kind = C_DOUBLE), DIMENSION(*) :: name; \
+   dec_int(name##_extent1)
+#define dec_double2(name) dec_double1(name) dec_int(name##_extent2)
+#define dec_double3(name) dec_double2(name) dec_int(name##_extent3)
+
+#define dec_bool1(name) \
+   LOGICAL(kind = C_BOOL), DIMENSION(*) :: name; \
+   dec_int(name##_extent1)
+#define dec_bool2(name) dec_bool1(name) dec_int(name##_extent2)
+#define dec_bool3(name) dec_bool2(name) dec_int(name##_extent3)
+
+#define dec_int1(name) \
+   INTEGER(kind = C_INT), DIMENSION(*) :: name; \
+   dec_int(name##_extent1)
+#define dec_int2(name) dec_int1(name) dec_int(name##_extent2)
+#define dec_int3(name) dec_int2(name) dec_int(name##_extent3)
+
+#define dec_ARRAY(type, numdim) dec_##type##numdim
+
+//---------------------------------
+
+
+#define def_bool(name) \
+   LOGICAL(kind = 1),  OPTIONAL, INTENT(IN) :: name##_
+
+#define def_int(name) \
+   INTEGER,  OPTIONAL, INTENT(IN) :: name##_
+
+#define def_StdString(name) \
+   CHARACTER(len = *), OPTIONAL, INTENT(IN) :: name##_
+
+
+#define def_double1(name) \
+   REAL(kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: name##_(:)
+#define def_double2(name) \
+   REAL(kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: name##_(:,:)
+#define def_double3(name) \
+   REAL(kind = 8), dimension(*), OPTIONAL, INTENT(IN) :: name##_(:,:,:)
+
+//-
+
+#define def_bool1(name) \
+   LOGICAL(kind = 1), dimension(*), OPTIONAL, INTENT(IN) :: name##_(:)
+#define def_bool2(name) \
+   LOGICAL(kind = 1), dimension(*), OPTIONAL, INTENT(IN) :: name##_(:,:)
+#define def_bool3(name) \
+   LOGICAL(kind = 1), dimension(*), OPTIONAL, INTENT(IN) :: name##_(:,:,:)
+
+//-
+
+#define def_int1(name) \
+   INTEGER, dimension(*), OPTIONAL, INTENT(IN) :: name##_(:)
+#define def_int2(name) \
+   INTEGER, dimension(*), OPTIONAL, INTENT(IN) :: name##_(:,:)
+#define def_int3(name) \
+   INTEGER, dimension(*), OPTIONAL, INTENT(IN) :: name##_(:,:,:)
+
+#define def_ARRAY(type, numdim) def_##type##numdim
+
+//---------------------------------
+
+#define ip_simple(class, name) \
+   IF (PRESENT(name##_)) THEN; \
+      CALL xios_set_##class##_##name(class##_hdl%daddr, ftype, name##_); \
+   END IF;
+
+#define ip_bool(class, name) ip_simple(class, name)
+#define ip_int(class, name) ip_simple(class, name)
+
+#define ip_StdString(class, name) \
+   IF (PRESENT(name##_)) THEN; \
+      CALL xios_set_##class##_##name(class##_hdl%daddr, ftype, name##_, len(name##_)); \
+   END IF;
+
+#define ip_ARRAY1(class, name) \
+   IF (PRESENT(name##_)) THEN; \
+      CALL xios_set_##class##_##name(class##_hdl%daddr, ftype, name##_, size(name##_, 1)); \
+   END IF;
+
+#define ip_ARRAY2(class, name) \
+   IF (PRESENT(name##_)) THEN; \
+      CALL xios_set_##class##_##name(class##_hdl%daddr, ftype, name##_, size(name##_, 1), size(name##_, 2)); \
+   END IF;
+
+#define ip_ARRAY3(class, name) \
+    IF (PRESENT(name##_)) THEN; \
+      CALL xios_set_##class##_##name(class##_hdl%daddr, ftype, name##_, size(name##_, 1), size(name##_, 3), size(name##_, 3)); \
+   END IF;
+
+#define ip_ARRAY(type, numdim) ip_ARRAY##numdim
+
+//---------------------------------
+
+#define  DECLARE_INTERFACE(class, type, name)                                           \
+   SUBROUTINE xios_set_##class##_##name(class##_hdl, ftype iarg_##type(name)) BIND(C);  \
+   USE ISO_C_BINDING;                                                                   \
+   INTEGER  (kind = C_INTPTR_T), VALUE :: class##_hdl;                                  \
+   INTEGER  (kind = C_INT), VALUE      :: ftype;                                        \
+   dec_##type(name)                                                                     \
+   END SUBROUTINE xios_set_##class##_##name;                                            \
+//   SUBROUTINE xios_get_##class##_##name(class##_hdl iarg_##type(name)) BIND(C); \
+//   USE ISO_C_BINDING;                                                           \
+//   INTEGER  (kind = C_INTPTR_T), VALUE :: class##_hdl;                          \
+//   dec_##type(name)                                                             \
+//   END SUBROUTINE xios_get_##class##_##name
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/functor.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/functor.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/functor.cpp	(revision 152)
@@ -0,0 +1,100 @@
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CFunctor::CFunctor(const StdString & id, ARRAY(double, 1) doutput,
+                         const CFunData & data, CFuncType type)
+         : SuperClass(id)
+         , doutput(doutput), size()
+         , data(data), type(type)
+      { this->resize(size); }
+
+      CFunctor::CFunctor(const StdString & id, DoubleArray doutput,
+                         const std::vector<size_t> size,
+                         const CFunData & data, CFuncType type)
+         : SuperClass(id)
+         , doutput(doutput), size(size)
+         , data(data), type(type)
+      { this->resize(size); }
+
+      CFunctor::~CFunctor(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      const CFunctor::CFunData  & CFunctor::getData(void) const
+      { return (this->data); }
+
+      CFunctor::CFuncType CFunctor::getType(void) const
+      { return (this->type); }
+
+      ARRAY(double, 1) CFunctor::getDataOutput(void) const
+      { return (this->doutput); }
+
+      const std::vector<size_t> & CFunctor::getShape(void) const
+      { return (this->size); }
+
+      size_t CFunctor::getSize(void) const
+      { return (this->doutput->size()); }
+
+      //---------------------------------------------------------------
+
+      void CFunctor::resize(size_t x, size_t y, size_t z)
+      {
+         this->size.clear();
+         this->size.push_back(x);
+         if (y != 1) this->size.push_back(y);
+         if (z != 1) this->size.push_back(z);
+         this->doutput->resize(boost::extents[x * y * z]);
+      }
+
+      void CFunctor::resize(const std::vector<StdSize> & sizes)
+      {
+         size_t newsize = 1;
+         this->size.clear();
+         std::vector<StdSize>::const_iterator it = sizes.begin(), end = sizes.end();
+         
+         for (; it!=end; it++)
+         { 
+            StdSize size = *it;
+            newsize *= size;
+            this->size.push_back(size);
+         }
+         this->doutput->resize(boost::extents[newsize]);
+      }
+
+      //---------------------------------------------------------------
+
+      StdString CFunctor::toString(void) const
+      {
+         ERROR("CFunctor::toString()", << "Not implemented yet !");
+         return (SuperClass::getId());
+      }
+
+      void CFunctor::fromString(const StdString & str)
+      {
+         ERROR("CFunctor::fromString(str)",
+                << "[ str = " << str << "] Not implemented yet !");
+      }
+
+      //---------------------------------------------------------------
+
+      ARRAY(double, 1) CFunctor::operator ()(const ARRAY(double, 1) dinput)
+      {
+         if (dinput->size() != this->doutput->size())
+            ERROR("CFunctor::operator ()(dinput)",
+                   << "[ input size = "  << dinput->size()
+                   << ", output size = " << this->doutput->size() << " ]"
+                   << " size of input array !=  size of output array !");
+         this->apply(dinput, this->doutput, this->size, this->data);
+         return (this->doutput);
+      }
+
+      //---------------------------------------------------------------
+
+   } // namespace func
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/functor.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/functor.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/functor.hpp	(revision 152)
@@ -0,0 +1,82 @@
+#ifndef __XMLIO_CFunctor__
+#define __XMLIO_CFunctor__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CFunctor : private CObject
+      {
+         /// DÃ©finition de type ///
+         typedef CObject SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            typedef enum func_type { SPATIAL = 0, TEMPORAL } CFuncType;
+            typedef struct func_data
+            { int timestep; } CFunData;
+
+            /// Accesseurs ///
+            CFuncType getType(void) const;
+            StdSize   getSize(void) const;
+
+            const CFunData  & getData(void) const;
+            const std::vector<StdSize> & getShape(void) const;
+
+            DoubleArray getDataOutput(void) const;
+
+            /// Mutateur ///
+            void resize(StdSize x, StdSize y = 1, StdSize z = 1);
+            void resize(const std::vector<StdSize> & sizes);
+
+            /// OpÃ©rateur ///
+            DoubleArray operator ()(const DoubleArray dinput);
+
+            /// Destructeur ///
+            virtual ~CFunctor(void);
+
+         protected :
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput,
+                               const std::vector<StdSize> size, const CFunData & data) = 0;
+
+            /// Autres ///
+            virtual StdString toString(void) const;
+            virtual void fromString(const StdString & str);
+
+
+            /// Constructeurs ///
+            CFunctor(void);                             // Not implemented.
+
+            CFunctor(const StdString & id, DoubleArray doutput,
+                     const CFunData & data, CFuncType type = TEMPORAL);
+
+            CFunctor(const StdString & id, DoubleArray doutput,
+                     const std::vector<StdSize> size,
+                     const CFunData & data, CFuncType type = TEMPORAL);
+
+            CFunctor(const CFunctor & functor);         // Not implemented.
+            CFunctor(const CFunctor * const functor);   // Not implemented.
+
+         private :
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            DoubleArray doutput;
+            std::vector<StdSize> size;
+            CFunData data; CFuncType type;
+
+      }; // class CFunctor
+   } // namespace func
+} // namespace xmlioserver
+
+#include "functor/functor_type.hpp"
+
+#endif // __XMLIO_CFunctor__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/functor/average.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/functor/average.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/functor/average.cpp	(revision 152)
@@ -0,0 +1,31 @@
+#include "average.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CAverage::CAverage(DoubleArray doutput,
+                         const CFunData & data,
+                         const std::vector<size_t> size)
+         : SuperClass(StdString("average"), doutput, size, data)
+      { /* Ne rien faire de plus */ }
+
+      CAverage::~CAverage(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      void CAverage::apply(const DoubleArray         UNUSED(dinput),
+                              DoubleArray            UNUSED(doutput),
+                           const std::vector<size_t> UNUSED(size),
+                           const CFunData &          UNUSED(data))
+      {
+         ERROR("CAverage::apply(...)", << "Not implemented yet !");
+      }
+
+      //---------------------------------------------------------------
+
+   } // namespace func
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/functor/average.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/functor/average.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/functor/average.hpp	(revision 152)
@@ -0,0 +1,40 @@
+#ifndef __XMLIO_CAverage__
+#define __XMLIO_CAverage__
+
+/// xmlioserver headers ///
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CAverage : public CFunctor
+      {
+         /// DÃ©finition de type ///
+         typedef CFunctor SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            /// Constructeurs ///
+            CAverage(void);                             // Not implemented.
+            CAverage(const CFunData & data);
+            CAverage(DoubleArray doutput, const CFunData & data,
+                     const std::vector<size_t> size);
+            CAverage(const CAverage & average);         // Not implemented.
+            CAverage(const CAverage * const average);   // Not implemented.
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput,
+                               const std::vector<size_t> size, const CFunData & data);
+
+            /// Destructeur ///
+            virtual ~CAverage(void);
+
+      }; // class CAverage
+
+   } // namespace func
+} // namespace xmlioserver
+
+#endif //__XMLIO_CAverage__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/functor/functor_type.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/functor/functor_type.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/functor/functor_type.hpp	(revision 152)
@@ -0,0 +1,9 @@
+#ifndef __XMLIO_functor_type__
+#define __XMLIO_functor_type__
+
+#include "average.hpp"
+#include "instant.hpp"
+#include "once.hpp"
+
+#endif //__XMLIO_functor_type__
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/functor/instant.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/functor/instant.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/functor/instant.cpp	(revision 152)
@@ -0,0 +1,31 @@
+#include "instant.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CInstant::CInstant(DoubleArray doutput,
+                         const CFunData & data,
+                         const std::vector<size_t> size)
+         : SuperClass(StdString("instant"), doutput, size, data)
+      { /* Ne rien faire de plus */ }
+
+      CInstant::~CInstant(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      void CInstant::apply(const DoubleArray         UNUSED(dinput),
+                                 DoubleArray         UNUSED(doutput),
+                           const std::vector<size_t> UNUSED(size),
+                           const CFunData &          UNUSED(data))
+      {
+         ERROR("CInstant::apply(...)", << "Not implemented yet !");
+      }
+
+      //---------------------------------------------------------------
+
+   } // namespace func
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/functor/instant.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/functor/instant.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/functor/instant.hpp	(revision 152)
@@ -0,0 +1,40 @@
+#ifndef __XMLIO_CInstant__
+#define __XMLIO_CInstant__
+
+/// xmlioserver headers ///
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CInstant : public CFunctor
+      {
+         /// DÃ©finition de type ///
+         typedef CFunctor SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            /// Constructeurs ///
+            CInstant(void);                             // Not implemented.
+            CInstant(const CFunData & data);
+            CInstant(DoubleArray doutput, const CFunData & data,
+                     const std::vector<size_t> size);
+            CInstant(const CInstant & instant);         // Not implemented.
+            CInstant(const CInstant * const instant);   // Not implemented.
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput,
+                               const std::vector<size_t> size, const CFunData & data);
+
+            /// Destructeur ///
+            virtual ~CInstant(void);
+
+      }; // class CInstant
+
+   } // namespace func
+} // namespace xmlioserver
+
+#endif //__XMLIO_CInstant__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/functor/once.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/functor/once.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/functor/once.cpp	(revision 152)
@@ -0,0 +1,32 @@
+#include "once.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      COnce::COnce(DoubleArray doutput,
+                   const CFunData & data,
+                   const std::vector<size_t> size)
+         : SuperClass(StdString("once"), doutput, size, data)
+      { /* Ne rien faire de plus */ }
+
+      COnce::~COnce(void)
+      { /* Ne rien faire de plus */ }
+
+      //---------------------------------------------------------------
+
+      void COnce::apply(const DoubleArray         UNUSED(dinput),
+                              DoubleArray         UNUSED(doutput),
+                        const std::vector<size_t> UNUSED(size),
+                        const CFunData &          UNUSED(data))
+      {
+         ERROR("COnce::apply(...)", << "Not implemented yet !");
+      }
+
+      //---------------------------------------------------------------
+
+   } // namespace func
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/functor/once.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/functor/once.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/functor/once.hpp	(revision 152)
@@ -0,0 +1,40 @@
+#ifndef __XMLIO_COnce__
+#define __XMLIO_COnce__
+
+/// xmlioserver headers ///
+#include "functor.hpp"
+
+namespace xmlioserver
+{
+   namespace func
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class COnce : public CFunctor
+      {
+         /// DÃ©finition de type ///
+         typedef CFunctor SuperClass;
+         typedef ARRAY(double, 1) DoubleArray;
+
+         public :
+
+            /// Constructeurs ///
+            COnce(void);                       // Not implemented.
+            COnce(DoubleArray doutput, const CFunData & data,
+                  const std::vector<size_t> size);
+            COnce(const COnce & once);         // Not implemented.
+            COnce(const COnce * const once);   // Not implemented.
+
+            /// Traitement ///
+            virtual void apply(const DoubleArray dinput, DoubleArray doutput,
+                               const std::vector<size_t> size, const CFunData & data);
+
+            /// Destructeur ///
+            virtual ~COnce(void);
+
+      }; // class COnce
+
+   } // namespace func
+} // namespace xmlioserver
+
+#endif //__XMLIO_COnce__
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/group_factory.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/group_factory.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/group_factory.cpp	(revision 152)
@@ -0,0 +1,14 @@
+#include "group_factory.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   StdString CGroupFactory::CurrContext("");
+
+   void CGroupFactory::SetCurrentContextId(const StdString & context)
+   { CGroupFactory::CurrContext = context; }
+
+   StdString & CGroupFactory::GetCurrentContextId(void)
+   { return (CGroupFactory::CurrContext); }
+
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/group_factory.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/group_factory.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/group_factory.hpp	(revision 152)
@@ -0,0 +1,78 @@
+#ifndef __XMLIO_CGroupFactory__
+#define __XMLIO_CGroupFactory__
+
+/// boost headers ///
+#include <boost/shared_ptr.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "object_factory.hpp"
+#include "group_template.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CGroupFactory
+   {
+      public :
+
+         /// Mutateurs ///
+         static void SetCurrentContextId(const StdString & context);
+
+         template <typename U>
+            static inline void AddGroup(boost::shared_ptr<U> pgroup,
+                                        boost::shared_ptr<U> cgroup);
+
+         template <typename U>
+            static inline void AddChild(boost::shared_ptr<U> group,
+                                        boost::shared_ptr<typename U::RelChild> child);
+
+         /// Accesseurs ///
+         static StdString & GetCurrentContextId(void);
+
+         template <typename U>
+            static inline boost::shared_ptr<U>
+               GetGroup(boost::shared_ptr<U> group, const StdString & id);
+
+         template <typename U>
+            static inline boost::shared_ptr<typename U::RelChild>
+               GetChild(boost::shared_ptr<U> group, const StdString & id);
+
+         template <typename U>
+            static inline int GetGroupNum(boost::shared_ptr<U> group);
+         template <typename U>
+            static inline int GetGroupIdNum(boost::shared_ptr<U> group);
+         template <typename U>
+            static inline int GetChildNum(boost::shared_ptr<U> group);
+         template <typename U>
+            static inline int GetChildIdNum(boost::shared_ptr<U> group);
+
+         /// Tests ///
+         template <typename U>
+            static inline bool HasGroup(boost::shared_ptr<U> group, const StdString & id);
+
+         template <typename U>
+            static inline bool HasChild(boost::shared_ptr<U> group, const StdString & id);
+
+         /// Instanciateur ///
+         template <typename U>
+            static inline boost::shared_ptr<U>
+               CreateGroup(boost::shared_ptr<U> group, const StdString & id = StdString(""));
+
+         template <typename U>
+            static inline boost::shared_ptr<typename U::RelChild>
+               CreateChild(boost::shared_ptr<U> group, const StdString & id = StdString(""));
+
+      private :
+
+         /// PropriÃ©tÃ©s statiques ///
+         static StdString CurrContext;
+
+   }; // class CGroupFactory
+} // namespace xmlioserver
+
+#include "group_factory_impl.hpp"
+#include "group_parser.hpp"
+
+#endif // __XMLIO_CGroupFactory__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/group_factory_impl.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/group_factory_impl.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/group_factory_impl.hpp	(revision 152)
@@ -0,0 +1,136 @@
+#ifndef __XMLIO_CGroupFactory_impl__
+#define __XMLIO_CGroupFactory_impl__
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   template <typename U>
+      void CGroupFactory::AddGroup(boost::shared_ptr<U> pgroup,
+                                   boost::shared_ptr<U> cgroup)
+   {
+      if (cgroup.get() == NULL || pgroup.get() == NULL )
+         ERROR("CGroupFactory::AddGroup(boost::shared_ptr<U> pgroup, boost::shared_ptr<U> cgroup)",
+               << " pgroup or cgroup NULL !");
+      if (!cgroup->hasId())
+         pgroup->groupList.insert(pgroup->groupList.end(), cgroup);
+      else
+      {
+         pgroup->groupList.insert(pgroup->groupList.end(), cgroup);
+         pgroup->groupMap.insert(std::make_pair(cgroup->getId(), cgroup));
+      }
+   }
+
+   template <typename U>
+      void CGroupFactory::AddChild(boost::shared_ptr<U> group,
+                                   boost::shared_ptr<typename U::RelChild> child)
+   {
+      if (group.get() == NULL || child.get() == NULL )
+         ERROR("CGroupFactory::AddGroup(boost::shared_ptr<U> pgroup, boost::shared_ptr<U> cgroup)",
+               << " pgroup or cgroup NULL !");
+      if (!child->hasId())
+         group->childList.insert(group->childList.end(), child);
+      else
+      {
+         group->childList.insert(group->childList.end(), child);
+         group->childMap.insert(std::make_pair(child->getId(), child));
+      }
+   }
+
+   template <typename U>
+      boost::shared_ptr<U>
+         CGroupFactory::CreateGroup(boost::shared_ptr<U> group, const StdString & id)
+   {
+      CObjectFactory::SetCurrentContextId
+      (CGroupFactory::GetCurrentContextId());
+      if (id.size() == 0)
+      {
+         boost::shared_ptr<U> value = CObjectFactory::CreateObject<U>();
+         group->groupList.insert(group->groupList.end(), value);
+         return (value);
+      }
+      else if (CGroupFactory::HasGroup(group, id))
+         return (CGroupFactory::GetGroup(group, id));
+      else
+      {
+         boost::shared_ptr<U> value = CObjectFactory::CreateObject<U>(id);
+         group->groupList.insert(group->groupList.end(), value);
+         group->groupMap.insert(std::make_pair(id, value));
+         return (value);
+      }
+   }
+
+   template <typename U>
+      boost::shared_ptr<typename U::RelChild>
+         CGroupFactory::CreateChild(boost::shared_ptr<U> group, const StdString & id)
+   {
+      CObjectFactory::SetCurrentContextId
+      (CGroupFactory::GetCurrentContextId());
+      if (id.size() == 0)
+      {
+         boost::shared_ptr<typename U::RelChild> value =
+               CObjectFactory::CreateObject<typename U::RelChild>();
+         group->childList.insert(group->childList.end(), value);
+         return (value);
+      }
+      else if (CGroupFactory::HasChild(group, id))
+         return (CGroupFactory::GetChild(group, id));
+      else
+      {
+         boost::shared_ptr<typename U::RelChild> value =
+               CObjectFactory::CreateObject<typename U::RelChild>(id);
+         group->childList.insert(group->childList.end(), value);
+         group->childMap.insert(std::make_pair(id, value));
+         return (value);
+      }
+   }
+
+   template <typename U>
+      bool CGroupFactory::HasGroup(boost::shared_ptr<U> group, const StdString & id)
+   {  return (group->groupMap.find(id) != group->groupMap.end()); }
+
+   template <typename U>
+      bool CGroupFactory::HasChild(boost::shared_ptr<U> group, const StdString & id)
+   {  return (group->childMap.find(id) != group->childMap.end()); }
+
+   template <typename U>
+      int CGroupFactory::GetGroupNum(boost::shared_ptr<U> group)
+   { return (group->groupList.size()); }
+
+   template <typename U>
+      int CGroupFactory::GetGroupIdNum(boost::shared_ptr<U> group)
+   { return (group->groupMap.size()); }
+
+   template <typename U>
+      int CGroupFactory::GetChildNum(boost::shared_ptr<U> group)
+   { return (group->childList.size()); }
+
+   template <typename U>
+      int CGroupFactory::GetChildIdNum(boost::shared_ptr<U> group)
+   { return (group->childMap.size()); }
+
+   template <typename U>
+      boost::shared_ptr<U>
+         CGroupFactory::GetGroup(boost::shared_ptr<U> group, const StdString & id)
+   {
+      if (!CGroupFactory::HasGroup<U>(group, id))
+         ERROR("CGroupFactory::GetGroup(boost::shared_ptr<U> group, const StdString & id)",
+               << "[ id = " << id << ", U = " << U::GetName() << " ] "
+               << " group is not referenced !");
+      return (group->groupMap[id]);
+   }
+
+   template <typename U>
+      boost::shared_ptr<typename U::RelChild>
+         CGroupFactory::GetChild(boost::shared_ptr<U> group, const StdString & id)
+   {
+      if (!CGroupFactory::HasChild<U>(group, id))
+         ERROR("CGroupFactory::GetChild(boost::shared_ptr<U> group, const StdString & id)",
+               << "[ id = " << id << ", U = " << U::GetName() << " ] "
+               << " child is not referenced !");
+      return (group->childMap[id]);
+   }
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CGroupFactory_impl__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/group_parser.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/group_parser.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/group_parser.hpp	(revision 152)
@@ -0,0 +1,72 @@
+#ifndef __XMLIO_GroupParser__
+#define __XMLIO_GroupParser__
+
+/// boost headers ///
+#include <boost/cast.hpp>
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::parse(xml::CXMLNode & node, bool withAttr)
+   {
+
+      StdString name = node.getElementName();
+      if (withAttr)
+         CGroupTemplate<U, V, W>::SuperClass::parse(node);
+
+      // PARSING POUR GESTION DES ENFANTS
+      xml::THashAttributes attributes;
+      boost::shared_ptr<V> group_ptr = (this->hasId())
+         ? CObjectFactory::GetObject<V>(this->getId())
+         : CObjectFactory::GetObject(boost::polymorphic_downcast<V*>(this));
+
+      if (!(node.goToChildElement()))
+      {
+         if (this->hasId())
+         {
+            DEBUG(<< "L'objet de type \'" << V::GetName()
+                  << "\' nommÃ© \'" << this->getId()
+                  << "\' ne contient pas d\'enfant !");
+         }
+      }
+      else
+      {
+         do { // Parcours pour traitement.
+
+            StdString name = node.getElementName();
+            attributes.clear();
+            attributes = node.getAttributes();
+
+            if (name.compare(V::GetName()) == 0)
+            {
+               if (attributes.end() == attributes.find("id"))
+                  CGroupFactory::CreateGroup(group_ptr)->parse(node);
+               else
+                  CGroupFactory::CreateGroup(group_ptr, attributes["id"])->parse(node);
+               continue;
+            }
+
+            if (name.compare(U::GetName()) == 0)
+            {
+               if (attributes.end() == attributes.find("id"))
+                  CGroupFactory::CreateChild(group_ptr)->parse(node);
+               else
+                  CGroupFactory::CreateChild(group_ptr, attributes["id"])->parse(node);
+               continue;
+            }
+
+            DEBUG(<< "Dans le contexte \'" << CObjectFactory::GetCurrentContextId()
+                  << "\', un objet de type \'" << V::GetName()
+                  << "\' ne peut contenir qu'un objet de type \'" << V::GetName()
+                  << "\' ou de type \'" << U::GetName()
+                  << "\' !");
+
+         } while (node.goToNextElement());
+         node.goToParentElement(); // Retour au parent
+      }
+   }
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_GroupParser__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/group_template.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/group_template.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/group_template.hpp	(revision 152)
@@ -0,0 +1,81 @@
+#ifndef __XMLIO_CGroupTemplate__
+#define __XMLIO_CGroupTemplate__
+
+#include "declare_attribute.hpp"
+
+namespace xmlioserver
+{
+   using namespace tree;
+
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   template <class U, class V, class W>
+      class CGroupTemplate
+         : public CObjectTemplate<V>, public virtual W
+   {
+         /// Friend ///
+         friend class CGroupFactory;
+
+         /// Typedef ///
+         typedef U Child;
+         typedef V Derived, Group;
+         typedef W SuperClassAttribute;
+         typedef CObjectTemplate<V> SuperClass;
+
+      public :
+
+         /// SpÃ©cifique ///
+         DECLARE_ATTRIBUTE(StdString, group_ref)
+
+         /// Accesseurs ///
+         const xios_map<StdString,
+                           boost::shared_ptr<Group> >& getGroupMap(void) const;
+         const std::vector<boost::shared_ptr<Child> >& getChildList(void) const;
+
+         void getAllChildren(std::vector<boost::shared_ptr<Child> > & allc) const;
+         std::vector<boost::shared_ptr<Child> > getAllChildren(void) const;
+
+         /// Autres ///
+         virtual StdString toString(void) const;
+         virtual void fromString(const StdString & str);
+
+         virtual void parse(xml::CXMLNode & node);
+         inline void parse(xml::CXMLNode & node, bool withAttr);
+
+         /// Test ///
+         virtual bool hasChild(void) const;
+
+         /// Accesseurs statiques ///
+         static inline StdString GetName(void);
+         static inline StdString GetDefName(void);
+
+         /// Traitements ///
+         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
+         void solveRefInheritance(void);
+
+         /// Destructeur ///
+         virtual ~CGroupTemplate(void);
+
+      protected :
+
+         /// Constructeurs ///
+         CGroupTemplate(void);
+         CGroupTemplate(const StdString & id);
+         CGroupTemplate(const CGroupTemplate<U, V, W> & group,
+                        bool withAttrList = true, bool withId = true); // Not implemented yet.
+         CGroupTemplate(const CGroupTemplate<U, V, W> * const group);  // Not implemented yet.
+
+      private :
+
+         /// PropriÃ©tÃ©s ///
+         xios_map<StdString,
+                     boost::shared_ptr<Child> > childMap;
+         std::vector<boost::shared_ptr<Child> > childList;
+
+         xios_map<StdString,
+                     boost::shared_ptr<Group> > groupMap;
+         std::vector<boost::shared_ptr<Group> > groupList;
+
+   }; // class CGroupTemplate
+} // namespace xmlioserver
+
+#endif // __XMLIO_CGroupTemplate__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/group_template_impl.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/group_template_impl.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/group_template_impl.hpp	(revision 152)
@@ -0,0 +1,169 @@
+#ifndef __XMLIO_CGroupTemplate_impl__
+#define __XMLIO_CGroupTemplate_impl__
+
+namespace xmlioserver
+{
+   using namespace tree;
+
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   template <class U, class V, class W>
+      CGroupTemplate<U, V, W>::CGroupTemplate(void)
+         : CObjectTemplate<V>() //, V()
+         , childMap(), childList()
+         , groupMap(), groupList()
+   { /* Ne rien faire de plus */ }
+
+   template <class U, class V, class W>
+      CGroupTemplate<U, V, W>::CGroupTemplate(const StdString & id)
+         : CObjectTemplate<V>(id) //, V()
+         , childMap(), childList()
+         , groupMap(), groupList()
+   { /* Ne rien faire de plus */ }
+
+   template <class U, class V, class W>
+      CGroupTemplate<U, V, W>::~CGroupTemplate(void)
+   { /* Ne rien faire de plus */ }
+
+   template <class U, class V, class W>
+      StdString CGroupTemplate<U, V, W>::toString(void) const
+   {
+      StdOStringStream oss;
+      StdString name = (this->getId().compare(V::GetDefName()) != 0)
+                     ? V::GetName()
+                     : V::GetDefName();
+
+      oss << "< " << name << " ";
+      if (this->hasId() && (this->getId().compare(V::GetDefName()) != 0))
+         oss << " id=\"" << this->getId() << "\" ";
+         
+      if (this->hasChild())
+      {
+         oss << SuperClassAttribute::toString() << ">" << std::endl;
+         
+         typename std::vector<boost::shared_ptr<V> >::const_iterator 
+            itg = this->groupList.begin(), endg = this->groupList.end();
+         typename std::vector<boost::shared_ptr<U> >::const_iterator 
+            itc = this->childList.begin(), endc = this->childList.end();
+            
+         for (; itg != endg; itg++)
+         { 
+            boost::shared_ptr<V> group = *itg;
+            oss << *group << std::endl;
+         }
+            
+         for (; itc != endc; itc++)
+         { 
+            boost::shared_ptr<U> child = *itc;
+            oss << *child << std::endl;
+         }
+            
+         oss << "</ " << name << " >";
+      }
+      else
+      {
+         oss << SuperClassAttribute::toString() << "/>";
+      }
+      return (oss.str());
+   }
+
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::fromString(const StdString & str)
+   { 
+      ERROR("CGroupTemplate<U, V, W>::toString(void)",
+            << "[ str = " << str << "] Not implemented yet !");
+   }
+
+   template <class U, class V, class W>
+      StdString CGroupTemplate<U, V, W>::GetName(void)
+   { 
+      return (U::GetName().append("_group")); 
+   }
+
+   template <class U, class V, class W>
+      StdString CGroupTemplate<U, V, W>::GetDefName(void)
+   { 
+      return (U::GetName().append("_definition")); 
+   }
+
+   template <class U, class V, class W>
+      const std::vector<boost::shared_ptr<U> >&
+         CGroupTemplate<U, V, W>::getChildList(void) const
+   { 
+      return (this->childList); 
+   }
+
+   template <class U, class V, class W>
+      const xios_map<StdString, boost::shared_ptr<V> >&
+         CGroupTemplate<U, V, W>::getGroupMap(void) const
+   { 
+      return (this->groupList);
+   }
+
+   template <class U, class V, class W>
+      bool CGroupTemplate<U, V, W>::hasChild(void) const
+   { 
+      return ((groupList.size() + childList.size()) > 0); 
+   }
+
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::parse(xml::CXMLNode & node)
+   { 
+      this->parse(node, true); 
+   }
+
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::solveDescInheritance(const CAttributeMap * const parent)
+   {
+      if (parent != NULL)
+         SuperClassAttribute::setAttributes(parent);
+         
+      typename std::vector<boost::shared_ptr<U> >::const_iterator 
+         itc = this->childList.begin(), endc = this->childList.end();
+      typename std::vector<boost::shared_ptr<V> >::const_iterator 
+         itg = this->groupList.begin(), endg = this->groupList.end();
+             
+      for (; itc != endc; itc++)
+      { 
+         boost::shared_ptr<U> child = *itc;
+         child->solveDescInheritance(this);
+      }
+            
+      for (; itg != endg; itg++)
+      { 
+         boost::shared_ptr<V> group = *itg;
+         group->solveRefInheritance();
+         group->solveDescInheritance(this);
+      }
+   }
+
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::getAllChildren(std::vector<boost::shared_ptr<U> > & allc) const
+   {
+      allc.insert (allc.end(), childList.begin(), childList.end());
+      typename std::vector<boost::shared_ptr<V> >::const_iterator 
+         itg = this->groupList.begin(), endg = this->groupList.end();
+         
+      for (; itg != endg; itg++)
+      { 
+         boost::shared_ptr<V> group = *itg;
+         group->getAllChildren(allc);
+      }
+   }
+
+   template <class U, class V, class W>
+      std::vector<boost::shared_ptr<U> > CGroupTemplate<U, V, W>::getAllChildren(void) const
+   { 
+      std::vector<boost::shared_ptr<U> > allc;
+      this->getAllChildren(allc);
+      return (allc);
+   }
+
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::solveRefInheritance(void)
+   { /* Ne rien faire de plus */ }
+
+} // namespace xmlioserver
+
+
+#endif // __XMLIO_CGroupTemplate_impl__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/iface/interface.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/iface/interface.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/iface/interface.cpp	(revision 152)
@@ -0,0 +1,1836 @@
+
+
+#include "../xmlioserver.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+
+extern "C"
+{
+
+
+typedef xmlioserver::tree::CAxis caxis;
+typedef xmlioserver::tree::CField cfield;
+typedef xmlioserver::tree::CDomain cdomain;
+typedef xmlioserver::tree::CGrid cgrid;
+typedef xmlioserver::tree::CFile cfile;
+typedef xmlioserver::tree::CContext ccontext;
+
+typedef xmlioserver::tree::CAxisGroup caxisgroup;
+typedef xmlioserver::tree::CFieldGroup cfieldgroup;
+typedef xmlioserver::tree::CDomainGroup cdomaingroup;
+typedef xmlioserver::tree::CGridGroup cgridgroup;
+typedef xmlioserver::tree::CFileGroup cfilegroup;
+typedef xmlioserver::tree::CContextGroup ccontextgroup;
+
+
+typedef long int XInt, XSize;
+typedef bool XBool;
+typedef void * XPtr;
+typedef char * XString;
+
+typedef enum
+{
+   NOTYPE = 0,
+   DTREATMENT , DATE, CALENDAR, ECONTEXT,
+   EAXIS, EDOMAIN, EFIELD, EFILE, EGRID,
+   GAXIS, GDOMAIN, GFIELD, GFILE, GGRID
+} XDType;
+
+typedef enum
+{
+   NETCDF4 = 0
+} XFileType;
+
+typedef enum
+{ D360 = 0 , ALLLEAP, NOLEAP, JULIAN, GREGORIAN } XCalendarType ;
+
+ void xios_set_axis_name (void * axis_hdl, int ftype , const char * name , const int * name_size)
+ {
+ 
+ StdString name_valtemp; 
+ StdSize d, f = 0; 
+ if (*name_size != -1) 
+ { 
+ name_valtemp.append (name, *name_size); 
+ d = name_valtemp.find_first_not_of(' '); 
+ f = name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString name_val = (*name_size != -1) ? name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (axis_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ caxis * axis_hdl_ = (caxis *) axis_hdl; 
+ axis_hdl_->name.setValue(name_val); 
+ }
+ else
+ {
+ caxisgroup * axis_hdl_
+ = (caxisgroup *) axis_hdl; 
+ axis_hdl_->name.setValue(name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_axis_standard_name (void * axis_hdl, int ftype , const char * standard_name , const int * standard_name_size)
+ {
+ 
+ StdString standard_name_valtemp; 
+ StdSize d, f = 0; 
+ if (*standard_name_size != -1) 
+ { 
+ standard_name_valtemp.append (standard_name, *standard_name_size); 
+ d = standard_name_valtemp.find_first_not_of(' '); 
+ f = standard_name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString standard_name_val = (*standard_name_size != -1) ? standard_name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (axis_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ caxis * axis_hdl_ = (caxis *) axis_hdl; 
+ axis_hdl_->standard_name.setValue(standard_name_val); 
+ }
+ else
+ {
+ caxisgroup * axis_hdl_
+ = (caxisgroup *) axis_hdl; 
+ axis_hdl_->standard_name.setValue(standard_name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_axis_long_name (void * axis_hdl, int ftype , const char * long_name , const int * long_name_size)
+ {
+ 
+ StdString long_name_valtemp; 
+ StdSize d, f = 0; 
+ if (*long_name_size != -1) 
+ { 
+ long_name_valtemp.append (long_name, *long_name_size); 
+ d = long_name_valtemp.find_first_not_of(' '); 
+ f = long_name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString long_name_val = (*long_name_size != -1) ? long_name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (axis_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ caxis * axis_hdl_ = (caxis *) axis_hdl; 
+ axis_hdl_->long_name.setValue(long_name_val); 
+ }
+ else
+ {
+ caxisgroup * axis_hdl_
+ = (caxisgroup *) axis_hdl; 
+ axis_hdl_->long_name.setValue(long_name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_axis_unit (void * axis_hdl, int ftype , const char * unit , const int * unit_size)
+ {
+ 
+ StdString unit_valtemp; 
+ StdSize d, f = 0; 
+ if (*unit_size != -1) 
+ { 
+ unit_valtemp.append (unit, *unit_size); 
+ d = unit_valtemp.find_first_not_of(' '); 
+ f = unit_valtemp.find_last_not_of (' '); 
+ } 
+ StdString unit_val = (*unit_size != -1) ? unit_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (axis_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ caxis * axis_hdl_ = (caxis *) axis_hdl; 
+ axis_hdl_->unit.setValue(unit_val); 
+ }
+ else
+ {
+ caxisgroup * axis_hdl_
+ = (caxisgroup *) axis_hdl; 
+ axis_hdl_->unit.setValue(unit_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_axis_size (void * axis_hdl, int ftype , const int * size)
+ {
+ int size_val = *size; 
+ if (axis_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ caxis * axis_hdl_ = (caxis *) axis_hdl; 
+ axis_hdl_->size.setValue(size_val); 
+ }
+ else
+ {
+ caxisgroup * axis_hdl_
+ = (caxisgroup *) axis_hdl; 
+ axis_hdl_->size.setValue(size_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_axis_zvalue (void * axis_hdl, int ftype , const double * zvalue , const int * zvalue_extent1)
+ {
+ int zvalue_extent1_val = *zvalue_extent1; 
+ boost::shared_ptr<CArray<double, 1> > zvalue_val 
+ (new CArray<double, 1>(boost::extents [zvalue_extent1_val])); 
+ std::copy(zvalue, &(zvalue[zvalue_val->num_elements()]), zvalue_val->data()); 
+ 
+ if (axis_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ caxis * axis_hdl_ = (caxis *) axis_hdl; 
+ axis_hdl_->zvalue.setValue(zvalue_val); 
+ }
+ else
+ {
+ caxisgroup * axis_hdl_
+ = (caxisgroup *) axis_hdl; 
+ axis_hdl_->zvalue.setValue(zvalue_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_name (void * field_hdl, int ftype , const char * name , const int * name_size)
+ {
+ 
+ StdString name_valtemp; 
+ StdSize d, f = 0; 
+ if (*name_size != -1) 
+ { 
+ name_valtemp.append (name, *name_size); 
+ d = name_valtemp.find_first_not_of(' '); 
+ f = name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString name_val = (*name_size != -1) ? name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->name.setValue(name_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->name.setValue(name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_standard_name (void * field_hdl, int ftype , const char * standard_name , const int * standard_name_size)
+ {
+ 
+ StdString standard_name_valtemp; 
+ StdSize d, f = 0; 
+ if (*standard_name_size != -1) 
+ { 
+ standard_name_valtemp.append (standard_name, *standard_name_size); 
+ d = standard_name_valtemp.find_first_not_of(' '); 
+ f = standard_name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString standard_name_val = (*standard_name_size != -1) ? standard_name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->standard_name.setValue(standard_name_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->standard_name.setValue(standard_name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_long_name (void * field_hdl, int ftype , const char * long_name , const int * long_name_size)
+ {
+ 
+ StdString long_name_valtemp; 
+ StdSize d, f = 0; 
+ if (*long_name_size != -1) 
+ { 
+ long_name_valtemp.append (long_name, *long_name_size); 
+ d = long_name_valtemp.find_first_not_of(' '); 
+ f = long_name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString long_name_val = (*long_name_size != -1) ? long_name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->long_name.setValue(long_name_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->long_name.setValue(long_name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_unit (void * field_hdl, int ftype , const char * unit , const int * unit_size)
+ {
+ 
+ StdString unit_valtemp; 
+ StdSize d, f = 0; 
+ if (*unit_size != -1) 
+ { 
+ unit_valtemp.append (unit, *unit_size); 
+ d = unit_valtemp.find_first_not_of(' '); 
+ f = unit_valtemp.find_last_not_of (' '); 
+ } 
+ StdString unit_val = (*unit_size != -1) ? unit_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->unit.setValue(unit_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->unit.setValue(unit_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_operation (void * field_hdl, int ftype , const char * operation , const int * operation_size)
+ {
+ 
+ StdString operation_valtemp; 
+ StdSize d, f = 0; 
+ if (*operation_size != -1) 
+ { 
+ operation_valtemp.append (operation, *operation_size); 
+ d = operation_valtemp.find_first_not_of(' '); 
+ f = operation_valtemp.find_last_not_of (' '); 
+ } 
+ StdString operation_val = (*operation_size != -1) ? operation_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->operation.setValue(operation_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->operation.setValue(operation_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_freq_op (void * field_hdl, int ftype , const char * freq_op , const int * freq_op_size)
+ {
+ 
+ StdString freq_op_valtemp; 
+ StdSize d, f = 0; 
+ if (*freq_op_size != -1) 
+ { 
+ freq_op_valtemp.append (freq_op, *freq_op_size); 
+ d = freq_op_valtemp.find_first_not_of(' '); 
+ f = freq_op_valtemp.find_last_not_of (' '); 
+ } 
+ StdString freq_op_val = (*freq_op_size != -1) ? freq_op_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->freq_op.setValue(freq_op_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->freq_op.setValue(freq_op_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_level (void * field_hdl, int ftype , const int * level)
+ {
+ int level_val = *level; 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->level.setValue(level_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->level.setValue(level_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_prec (void * field_hdl, int ftype , const int * prec)
+ {
+ int prec_val = *prec; 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->prec.setValue(prec_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->prec.setValue(prec_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_enabled (void * field_hdl, int ftype , const bool * enabled)
+ {
+ bool enabled_val = *enabled; 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->enabled.setValue(enabled_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->enabled.setValue(enabled_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_domain_ref (void * field_hdl, int ftype , const char * domain_ref , const int * domain_ref_size)
+ {
+ 
+ StdString domain_ref_valtemp; 
+ StdSize d, f = 0; 
+ if (*domain_ref_size != -1) 
+ { 
+ domain_ref_valtemp.append (domain_ref, *domain_ref_size); 
+ d = domain_ref_valtemp.find_first_not_of(' '); 
+ f = domain_ref_valtemp.find_last_not_of (' '); 
+ } 
+ StdString domain_ref_val = (*domain_ref_size != -1) ? domain_ref_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->domain_ref.setValue(domain_ref_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->domain_ref.setValue(domain_ref_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_axis_ref (void * field_hdl, int ftype , const char * axis_ref , const int * axis_ref_size)
+ {
+ 
+ StdString axis_ref_valtemp; 
+ StdSize d, f = 0; 
+ if (*axis_ref_size != -1) 
+ { 
+ axis_ref_valtemp.append (axis_ref, *axis_ref_size); 
+ d = axis_ref_valtemp.find_first_not_of(' '); 
+ f = axis_ref_valtemp.find_last_not_of (' '); 
+ } 
+ StdString axis_ref_val = (*axis_ref_size != -1) ? axis_ref_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->axis_ref.setValue(axis_ref_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->axis_ref.setValue(axis_ref_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_grid_ref (void * field_hdl, int ftype , const char * grid_ref , const int * grid_ref_size)
+ {
+ 
+ StdString grid_ref_valtemp; 
+ StdSize d, f = 0; 
+ if (*grid_ref_size != -1) 
+ { 
+ grid_ref_valtemp.append (grid_ref, *grid_ref_size); 
+ d = grid_ref_valtemp.find_first_not_of(' '); 
+ f = grid_ref_valtemp.find_last_not_of (' '); 
+ } 
+ StdString grid_ref_val = (*grid_ref_size != -1) ? grid_ref_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->grid_ref.setValue(grid_ref_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->grid_ref.setValue(grid_ref_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_zoom_ref (void * field_hdl, int ftype , const char * zoom_ref , const int * zoom_ref_size)
+ {
+ 
+ StdString zoom_ref_valtemp; 
+ StdSize d, f = 0; 
+ if (*zoom_ref_size != -1) 
+ { 
+ zoom_ref_valtemp.append (zoom_ref, *zoom_ref_size); 
+ d = zoom_ref_valtemp.find_first_not_of(' '); 
+ f = zoom_ref_valtemp.find_last_not_of (' '); 
+ } 
+ StdString zoom_ref_val = (*zoom_ref_size != -1) ? zoom_ref_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->zoom_ref.setValue(zoom_ref_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->zoom_ref.setValue(zoom_ref_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_field_field_ref (void * field_hdl, int ftype , const char * field_ref , const int * field_ref_size)
+ {
+ 
+ StdString field_ref_valtemp; 
+ StdSize d, f = 0; 
+ if (*field_ref_size != -1) 
+ { 
+ field_ref_valtemp.append (field_ref, *field_ref_size); 
+ d = field_ref_valtemp.find_first_not_of(' '); 
+ f = field_ref_valtemp.find_last_not_of (' '); 
+ } 
+ StdString field_ref_val = (*field_ref_size != -1) ? field_ref_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (field_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfield * field_hdl_ = (cfield *) field_hdl; 
+ field_hdl_->field_ref.setValue(field_ref_val); 
+ }
+ else
+ {
+ cfieldgroup * field_hdl_
+ = (cfieldgroup *) field_hdl; 
+ field_hdl_->field_ref.setValue(field_ref_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_context_calendar_type (void * context_hdl, int ftype , const char * calendar_type , const int * calendar_type_size)
+ {
+ 
+ StdString calendar_type_valtemp; 
+ StdSize d, f = 0; 
+ if (*calendar_type_size != -1) 
+ { 
+ calendar_type_valtemp.append (calendar_type, *calendar_type_size); 
+ d = calendar_type_valtemp.find_first_not_of(' '); 
+ f = calendar_type_valtemp.find_last_not_of (' '); 
+ } 
+ StdString calendar_type_val = (*calendar_type_size != -1) ? calendar_type_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (context_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ ccontext * context_hdl_ = (ccontext *) context_hdl; 
+ context_hdl_->calendar_type.setValue(calendar_type_val); 
+ }
+ else
+ {
+ ccontextgroup * context_hdl_
+ = (ccontextgroup *) context_hdl; 
+ context_hdl_->calendar_type.setValue(calendar_type_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_context_start_date (void * context_hdl, int ftype , const char * start_date , const int * start_date_size)
+ {
+ 
+ StdString start_date_valtemp; 
+ StdSize d, f = 0; 
+ if (*start_date_size != -1) 
+ { 
+ start_date_valtemp.append (start_date, *start_date_size); 
+ d = start_date_valtemp.find_first_not_of(' '); 
+ f = start_date_valtemp.find_last_not_of (' '); 
+ } 
+ StdString start_date_val = (*start_date_size != -1) ? start_date_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (context_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ ccontext * context_hdl_ = (ccontext *) context_hdl; 
+ context_hdl_->start_date.setValue(start_date_val); 
+ }
+ else
+ {
+ ccontextgroup * context_hdl_
+ = (ccontextgroup *) context_hdl; 
+ context_hdl_->start_date.setValue(start_date_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_name (void * domain_hdl, int ftype , const char * name , const int * name_size)
+ {
+ 
+ StdString name_valtemp; 
+ StdSize d, f = 0; 
+ if (*name_size != -1) 
+ { 
+ name_valtemp.append (name, *name_size); 
+ d = name_valtemp.find_first_not_of(' '); 
+ f = name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString name_val = (*name_size != -1) ? name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->name.setValue(name_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->name.setValue(name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_standard_name (void * domain_hdl, int ftype , const char * standard_name , const int * standard_name_size)
+ {
+ 
+ StdString standard_name_valtemp; 
+ StdSize d, f = 0; 
+ if (*standard_name_size != -1) 
+ { 
+ standard_name_valtemp.append (standard_name, *standard_name_size); 
+ d = standard_name_valtemp.find_first_not_of(' '); 
+ f = standard_name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString standard_name_val = (*standard_name_size != -1) ? standard_name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->standard_name.setValue(standard_name_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->standard_name.setValue(standard_name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_long_name (void * domain_hdl, int ftype , const char * long_name , const int * long_name_size)
+ {
+ 
+ StdString long_name_valtemp; 
+ StdSize d, f = 0; 
+ if (*long_name_size != -1) 
+ { 
+ long_name_valtemp.append (long_name, *long_name_size); 
+ d = long_name_valtemp.find_first_not_of(' '); 
+ f = long_name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString long_name_val = (*long_name_size != -1) ? long_name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->long_name.setValue(long_name_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->long_name.setValue(long_name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_ni_glo (void * domain_hdl, int ftype , const int * ni_glo)
+ {
+ int ni_glo_val = *ni_glo; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->ni_glo.setValue(ni_glo_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->ni_glo.setValue(ni_glo_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_nj_glo (void * domain_hdl, int ftype , const int * nj_glo)
+ {
+ int nj_glo_val = *nj_glo; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->nj_glo.setValue(nj_glo_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->nj_glo.setValue(nj_glo_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_ibegin (void * domain_hdl, int ftype , const int * ibegin)
+ {
+ int ibegin_val = *ibegin; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->ibegin.setValue(ibegin_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->ibegin.setValue(ibegin_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_iend (void * domain_hdl, int ftype , const int * iend)
+ {
+ int iend_val = *iend; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->iend.setValue(iend_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->iend.setValue(iend_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_ni (void * domain_hdl, int ftype , const int * ni)
+ {
+ int ni_val = *ni; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->ni.setValue(ni_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->ni.setValue(ni_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_jbegin (void * domain_hdl, int ftype , const int * jbegin)
+ {
+ int jbegin_val = *jbegin; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->jbegin.setValue(jbegin_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->jbegin.setValue(jbegin_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_jend (void * domain_hdl, int ftype , const int * jend)
+ {
+ int jend_val = *jend; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->jend.setValue(jend_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->jend.setValue(jend_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_nj (void * domain_hdl, int ftype , const int * nj)
+ {
+ int nj_val = *nj; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->nj.setValue(nj_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->nj.setValue(nj_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_mask (void * domain_hdl, int ftype , const bool * mask , const int * mask_extent1 , const int * mask_extent2)
+ {
+ int mask_extent1_val = *mask_extent1; 
+ int mask_extent2_val = *mask_extent2; 
+ boost::shared_ptr<CArray<bool, 2> > mask_val 
+ (new CArray<bool, 2>(boost::extents [mask_extent1_val][mask_extent2_val])); 
+ std::copy(mask, &(mask[mask_val->num_elements()]), mask_val->data()); 
+ 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->mask.setValue(mask_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->mask.setValue(mask_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_data_dim (void * domain_hdl, int ftype , const int * data_dim)
+ {
+ int data_dim_val = *data_dim; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->data_dim.setValue(data_dim_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->data_dim.setValue(data_dim_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_data_ni (void * domain_hdl, int ftype , const int * data_ni)
+ {
+ int data_ni_val = *data_ni; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->data_ni.setValue(data_ni_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->data_ni.setValue(data_ni_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_data_nj (void * domain_hdl, int ftype , const int * data_nj)
+ {
+ int data_nj_val = *data_nj; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->data_nj.setValue(data_nj_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->data_nj.setValue(data_nj_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_data_ibegin (void * domain_hdl, int ftype , const int * data_ibegin)
+ {
+ int data_ibegin_val = *data_ibegin; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->data_ibegin.setValue(data_ibegin_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->data_ibegin.setValue(data_ibegin_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_data_jbegin (void * domain_hdl, int ftype , const int * data_jbegin)
+ {
+ int data_jbegin_val = *data_jbegin; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->data_jbegin.setValue(data_jbegin_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->data_jbegin.setValue(data_jbegin_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_data_n_index (void * domain_hdl, int ftype , const int * data_n_index)
+ {
+ int data_n_index_val = *data_n_index; 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->data_n_index.setValue(data_n_index_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->data_n_index.setValue(data_n_index_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_data_i_index (void * domain_hdl, int ftype , const int * data_i_index , const int * data_i_index_extent1)
+ {
+ int data_i_index_extent1_val = *data_i_index_extent1; 
+ boost::shared_ptr<CArray<int, 1> > data_i_index_val 
+ (new CArray<int, 1>(boost::extents [data_i_index_extent1_val])); 
+ std::copy(data_i_index, &(data_i_index[data_i_index_val->num_elements()]), data_i_index_val->data()); 
+ 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->data_i_index.setValue(data_i_index_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->data_i_index.setValue(data_i_index_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_data_j_index (void * domain_hdl, int ftype , const int * data_j_index , const int * data_j_index_extent1)
+ {
+ int data_j_index_extent1_val = *data_j_index_extent1; 
+ boost::shared_ptr<CArray<int, 1> > data_j_index_val 
+ (new CArray<int, 1>(boost::extents [data_j_index_extent1_val])); 
+ std::copy(data_j_index, &(data_j_index[data_j_index_val->num_elements()]), data_j_index_val->data()); 
+ 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->data_j_index.setValue(data_j_index_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->data_j_index.setValue(data_j_index_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_lonvalue (void * domain_hdl, int ftype , const double * lonvalue , const int * lonvalue_extent1)
+ {
+ int lonvalue_extent1_val = *lonvalue_extent1; 
+ boost::shared_ptr<CArray<double, 1> > lonvalue_val 
+ (new CArray<double, 1>(boost::extents [lonvalue_extent1_val])); 
+ std::copy(lonvalue, &(lonvalue[lonvalue_val->num_elements()]), lonvalue_val->data()); 
+ 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->lonvalue.setValue(lonvalue_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->lonvalue.setValue(lonvalue_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_domain_latvalue (void * domain_hdl, int ftype , const double * latvalue , const int * latvalue_extent1)
+ {
+ int latvalue_extent1_val = *latvalue_extent1; 
+ boost::shared_ptr<CArray<double, 1> > latvalue_val 
+ (new CArray<double, 1>(boost::extents [latvalue_extent1_val])); 
+ std::copy(latvalue, &(latvalue[latvalue_val->num_elements()]), latvalue_val->data()); 
+ 
+ if (domain_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cdomain * domain_hdl_ = (cdomain *) domain_hdl; 
+ domain_hdl_->latvalue.setValue(latvalue_val); 
+ }
+ else
+ {
+ cdomaingroup * domain_hdl_
+ = (cdomaingroup *) domain_hdl; 
+ domain_hdl_->latvalue.setValue(latvalue_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_file_name (void * file_hdl, int ftype , const char * name , const int * name_size)
+ {
+ 
+ StdString name_valtemp; 
+ StdSize d, f = 0; 
+ if (*name_size != -1) 
+ { 
+ name_valtemp.append (name, *name_size); 
+ d = name_valtemp.find_first_not_of(' '); 
+ f = name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString name_val = (*name_size != -1) ? name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (file_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfile * file_hdl_ = (cfile *) file_hdl; 
+ file_hdl_->name.setValue(name_val); 
+ }
+ else
+ {
+ cfilegroup * file_hdl_
+ = (cfilegroup *) file_hdl; 
+ file_hdl_->name.setValue(name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_file_description (void * file_hdl, int ftype , const char * description , const int * description_size)
+ {
+ 
+ StdString description_valtemp; 
+ StdSize d, f = 0; 
+ if (*description_size != -1) 
+ { 
+ description_valtemp.append (description, *description_size); 
+ d = description_valtemp.find_first_not_of(' '); 
+ f = description_valtemp.find_last_not_of (' '); 
+ } 
+ StdString description_val = (*description_size != -1) ? description_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (file_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfile * file_hdl_ = (cfile *) file_hdl; 
+ file_hdl_->description.setValue(description_val); 
+ }
+ else
+ {
+ cfilegroup * file_hdl_
+ = (cfilegroup *) file_hdl; 
+ file_hdl_->description.setValue(description_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_file_output_freq (void * file_hdl, int ftype , const char * output_freq , const int * output_freq_size)
+ {
+ 
+ StdString output_freq_valtemp; 
+ StdSize d, f = 0; 
+ if (*output_freq_size != -1) 
+ { 
+ output_freq_valtemp.append (output_freq, *output_freq_size); 
+ d = output_freq_valtemp.find_first_not_of(' '); 
+ f = output_freq_valtemp.find_last_not_of (' '); 
+ } 
+ StdString output_freq_val = (*output_freq_size != -1) ? output_freq_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (file_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfile * file_hdl_ = (cfile *) file_hdl; 
+ file_hdl_->output_freq.setValue(output_freq_val); 
+ }
+ else
+ {
+ cfilegroup * file_hdl_
+ = (cfilegroup *) file_hdl; 
+ file_hdl_->output_freq.setValue(output_freq_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_file_output_level (void * file_hdl, int ftype , const int * output_level)
+ {
+ int output_level_val = *output_level; 
+ if (file_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfile * file_hdl_ = (cfile *) file_hdl; 
+ file_hdl_->output_level.setValue(output_level_val); 
+ }
+ else
+ {
+ cfilegroup * file_hdl_
+ = (cfilegroup *) file_hdl; 
+ file_hdl_->output_level.setValue(output_level_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_file_enabled (void * file_hdl, int ftype , const bool * enabled)
+ {
+ bool enabled_val = *enabled; 
+ if (file_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cfile * file_hdl_ = (cfile *) file_hdl; 
+ file_hdl_->enabled.setValue(enabled_val); 
+ }
+ else
+ {
+ cfilegroup * file_hdl_
+ = (cfilegroup *) file_hdl; 
+ file_hdl_->enabled.setValue(enabled_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_grid_name (void * grid_hdl, int ftype , const char * name , const int * name_size)
+ {
+ 
+ StdString name_valtemp; 
+ StdSize d, f = 0; 
+ if (*name_size != -1) 
+ { 
+ name_valtemp.append (name, *name_size); 
+ d = name_valtemp.find_first_not_of(' '); 
+ f = name_valtemp.find_last_not_of (' '); 
+ } 
+ StdString name_val = (*name_size != -1) ? name_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (grid_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cgrid * grid_hdl_ = (cgrid *) grid_hdl; 
+ grid_hdl_->name.setValue(name_val); 
+ }
+ else
+ {
+ cgridgroup * grid_hdl_
+ = (cgridgroup *) grid_hdl; 
+ grid_hdl_->name.setValue(name_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_grid_description (void * grid_hdl, int ftype , const char * description , const int * description_size)
+ {
+ 
+ StdString description_valtemp; 
+ StdSize d, f = 0; 
+ if (*description_size != -1) 
+ { 
+ description_valtemp.append (description, *description_size); 
+ d = description_valtemp.find_first_not_of(' '); 
+ f = description_valtemp.find_last_not_of (' '); 
+ } 
+ StdString description_val = (*description_size != -1) ? description_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (grid_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cgrid * grid_hdl_ = (cgrid *) grid_hdl; 
+ grid_hdl_->description.setValue(description_val); 
+ }
+ else
+ {
+ cgridgroup * grid_hdl_
+ = (cgridgroup *) grid_hdl; 
+ grid_hdl_->description.setValue(description_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_grid_domain_ref (void * grid_hdl, int ftype , const char * domain_ref , const int * domain_ref_size)
+ {
+ 
+ StdString domain_ref_valtemp; 
+ StdSize d, f = 0; 
+ if (*domain_ref_size != -1) 
+ { 
+ domain_ref_valtemp.append (domain_ref, *domain_ref_size); 
+ d = domain_ref_valtemp.find_first_not_of(' '); 
+ f = domain_ref_valtemp.find_last_not_of (' '); 
+ } 
+ StdString domain_ref_val = (*domain_ref_size != -1) ? domain_ref_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (grid_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cgrid * grid_hdl_ = (cgrid *) grid_hdl; 
+ grid_hdl_->domain_ref.setValue(domain_ref_val); 
+ }
+ else
+ {
+ cgridgroup * grid_hdl_
+ = (cgridgroup *) grid_hdl; 
+ grid_hdl_->domain_ref.setValue(domain_ref_val); 
+ }
+ }
+ }
+ 
+
+
+ void xios_set_grid_axis_ref (void * grid_hdl, int ftype , const char * axis_ref , const int * axis_ref_size)
+ {
+ 
+ StdString axis_ref_valtemp; 
+ StdSize d, f = 0; 
+ if (*axis_ref_size != -1) 
+ { 
+ axis_ref_valtemp.append (axis_ref, *axis_ref_size); 
+ d = axis_ref_valtemp.find_first_not_of(' '); 
+ f = axis_ref_valtemp.find_last_not_of (' '); 
+ } 
+ StdString axis_ref_val = (*axis_ref_size != -1) ? axis_ref_valtemp.substr(d, f-d+1) : "" ; 
+ 
+ if (grid_hdl != NULL) 
+ {
+ if (ftype < GAXIS)
+ {
+ cgrid * grid_hdl_ = (cgrid *) grid_hdl; 
+ grid_hdl_->axis_ref.setValue(axis_ref_val); 
+ }
+ else
+ {
+ cgridgroup * grid_hdl_
+ = (cgridgroup *) grid_hdl; 
+ grid_hdl_->axis_ref.setValue(axis_ref_val); 
+ }
+ }
+ }
+ 
+
+void xios_handle_create (XPtr * const _ret, XDType _dtype, const XString _id, XSize _id_len)
+{
+   
+ StdString __idtemp; 
+ StdSize d, f = 0; 
+ if (_id_len != -1) 
+ { 
+ __idtemp.append (_id, _id_len); 
+ d = __idtemp.find_first_not_of(' '); 
+ f = __idtemp.find_last_not_of (' '); 
+ } 
+ StdString __id = (_id_len != -1) ? __idtemp.substr(d, f-d+1) : "" ; 
+
+   switch(_dtype)
+   {
+      case (ECONTEXT):
+         *_ret = (!CObjectFactory::HasObject<CContext>(__id))
+               ? 0 : CObjectFactory::GetObject<CContext>(__id).get();
+         return ;
+      case (EAXIS): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CAxis>(__id))
+ ? 0 : CObjectFactory::GetObject<CAxis>(__id).get(); 
+ return; 
+}
+ case (GAXIS): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CAxisGroup>(__id))
+ ? 0 : CObjectFactory::GetObject<CAxisGroup>(__id).get(); 
+ return; 
+}
+
+      case (EDOMAIN): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CDomain>(__id))
+ ? 0 : CObjectFactory::GetObject<CDomain>(__id).get(); 
+ return; 
+}
+ case (GDOMAIN): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CDomainGroup>(__id))
+ ? 0 : CObjectFactory::GetObject<CDomainGroup>(__id).get(); 
+ return; 
+}
+
+      case (EFIELD): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CField>(__id))
+ ? 0 : CObjectFactory::GetObject<CField>(__id).get(); 
+ return; 
+}
+ case (GFIELD): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CFieldGroup>(__id))
+ ? 0 : CObjectFactory::GetObject<CFieldGroup>(__id).get(); 
+ return; 
+}
+
+      case (EFILE): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CFile>(__id))
+ ? 0 : CObjectFactory::GetObject<CFile>(__id).get(); 
+ return; 
+}
+ case (GFILE): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CFileGroup>(__id))
+ ? 0 : CObjectFactory::GetObject<CFileGroup>(__id).get(); 
+ return; 
+}
+
+      case (EGRID): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CGrid>(__id))
+ ? 0 : CObjectFactory::GetObject<CGrid>(__id).get(); 
+ return; 
+}
+ case (GGRID): 
+ { 
+ *_ret = (!CObjectFactory::HasObject<CGridGroup>(__id))
+ ? 0 : CObjectFactory::GetObject<CGridGroup>(__id).get(); 
+ return; 
+}
+
+      default :
+         *_ret = 0;
+         return;
+   }
+}
+void xios_xml_parse_file (const XString _filename, XSize _filename_len)
+{
+   try
+   {
+      
+ StdString __filenametemp; 
+ StdSize d, f = 0; 
+ if (_filename_len != -1) 
+ { 
+ __filenametemp.append (_filename, _filename_len); 
+ d = __filenametemp.find_first_not_of(' '); 
+ f = __filenametemp.find_last_not_of (' '); 
+ } 
+ StdString __filename = (_filename_len != -1) ? __filenametemp.substr(d, f-d+1) : "" ; ;
+      CTreeManager::ParseFile(__filename);
+      StdOStringStream oss;
+      oss << StdString("data/def/def_client_pre.")
+          << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+      CTreeManager::PrintTreeToFile(oss.str());
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+void xios_xml_parse_string(const XString _xmlcontent, XSize _xmlcontent_len)
+{
+   try
+   {
+      
+ StdString __xmlcontenttemp; 
+ StdSize d, f = 0; 
+ if (_xmlcontent_len != -1) 
+ { 
+ __xmlcontenttemp.append (_xmlcontent, _xmlcontent_len); 
+ d = __xmlcontenttemp.find_first_not_of(' '); 
+ f = __xmlcontenttemp.find_last_not_of (' '); 
+ } 
+ StdString __xmlcontent = (_xmlcontent_len != -1) ? __xmlcontenttemp.substr(d, f-d+1) : "" ; ;
+      CTreeManager::ParseString(__xmlcontent);
+      StdOStringStream oss;
+      oss << StdString("data/def/def_client_pre.")
+          << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+      CTreeManager::PrintTreeToFile(oss.str());
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+void xios_context_set_current (XPtr const _ctx, bool _wswap)
+{
+   boost::shared_ptr<CContext> context = CObjectFactory::GetObject<CContext> ((CContext*)_ctx);
+   CTreeManager::SetCurrentContextId(context->getId());
+}
+void xios_context_create (XPtr * _ctxt, const XString _ctxt_id,
+                          XSize _ctxt_id_len, XCalendarType _calType,
+                          XInt yr, XInt mth, XInt dd,
+                          XInt hr, XInt min, XInt sec)
+{
+   try
+   {
+      
+ StdString __ctxt_idtemp; 
+ StdSize d, f = 0; 
+ if (_ctxt_id_len != -1) 
+ { 
+ __ctxt_idtemp.append (_ctxt_id, _ctxt_id_len); 
+ d = __ctxt_idtemp.find_first_not_of(' '); 
+ f = __ctxt_idtemp.find_last_not_of (' '); 
+ } 
+ StdString __ctxt_id = (_ctxt_id_len != -1) ? __ctxt_idtemp.substr(d, f-d+1) : "" ; ;
+      boost::shared_ptr<CContext> context = CTreeManager::CreateContext(__ctxt_id);
+      *_ctxt = context.get();
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+void xios_xml_tree_add(const XPtr _parent, XDType _parent_type, XPtr * _child,
+                       XDType _child_type, const XString _child_id, XSize _child_id_len)
+{
+   
+ StdString __child_idtemp; 
+ StdSize d, f = 0; 
+ if (_child_id_len != -1) 
+ { 
+ __child_idtemp.append (_child_id, _child_id_len); 
+ d = __child_idtemp.find_first_not_of(' '); 
+ f = __child_idtemp.find_last_not_of (' '); 
+ } 
+ StdString __child_id = (_child_id_len != -1) ? __child_idtemp.substr(d, f-d+1) : "" ; 
+
+   try
+   {
+      switch (_parent_type)
+      {
+         case (EFILE) :
+         {
+            CFile * _file = (CFile *) _parent;
+            boost::shared_ptr<CFile> file = CObjectFactory::GetObject<CFile>(_file);
+            if (!CObjectFactory::HasObject<CFieldGroup>(file->getId()))
+               file->setVirtualFieldGroup(file->getId());
+            xios_xml_tree_add (file->getVirtualFieldGroup().get(), GFIELD,
+                              _child, EFIELD, _child_id, _child_id_len);
+            return;
+         }
+         case (GAXIS) : 
+ { 
+ CAxisGroup * _group = (CAxisGroup *) _parent; boost::shared_ptr<CAxisGroup> group = 
+ CObjectFactory::GetObject<CAxisGroup>(_group); 
+ switch(_child_type) 
+ { 
+ case (GAXIS) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CAxisGroup>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateGroup(group, __child_id).get(); 
+ break; 
+ case (EAXIS) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CAxis>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateChild(group, __child_id).get(); 
+ break; 
+ default : 
+ std::cerr << "[xml_tree_add] Type enfant invalide" << std::endl; 
+ }; 
+ return; 
+ };
+         case (GGRID) : 
+ { 
+ CGridGroup * _group = (CGridGroup *) _parent; boost::shared_ptr<CGridGroup> group = 
+ CObjectFactory::GetObject<CGridGroup>(_group); 
+ switch(_child_type) 
+ { 
+ case (GGRID) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CGridGroup>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateGroup(group, __child_id).get(); 
+ break; 
+ case (EGRID) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CGrid>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateChild(group, __child_id).get(); 
+ break; 
+ default : 
+ std::cerr << "[xml_tree_add] Type enfant invalide" << std::endl; 
+ }; 
+ return; 
+ };
+         case (GDOMAIN) : 
+ { 
+ CDomainGroup * _group = (CDomainGroup *) _parent; boost::shared_ptr<CDomainGroup> group = 
+ CObjectFactory::GetObject<CDomainGroup>(_group); 
+ switch(_child_type) 
+ { 
+ case (GDOMAIN) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CDomainGroup>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateGroup(group, __child_id).get(); 
+ break; 
+ case (EDOMAIN) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CDomain>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateChild(group, __child_id).get(); 
+ break; 
+ default : 
+ std::cerr << "[xml_tree_add] Type enfant invalide" << std::endl; 
+ }; 
+ return; 
+ };
+         case (GFIELD) : 
+ { 
+ CFieldGroup * _group = (CFieldGroup *) _parent; boost::shared_ptr<CFieldGroup> group = 
+ CObjectFactory::GetObject<CFieldGroup>(_group); 
+ switch(_child_type) 
+ { 
+ case (GFIELD) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CFieldGroup>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateGroup(group, __child_id).get(); 
+ break; 
+ case (EFIELD) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CField>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateChild(group, __child_id).get(); 
+ break; 
+ default : 
+ std::cerr << "[xml_tree_add] Type enfant invalide" << std::endl; 
+ }; 
+ return; 
+ };
+         case (GFILE) : 
+ { 
+ CFileGroup * _group = (CFileGroup *) _parent; boost::shared_ptr<CFileGroup> group = 
+ CObjectFactory::GetObject<CFileGroup>(_group); 
+ switch(_child_type) 
+ { 
+ case (GFILE) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CFileGroup>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateGroup(group, __child_id).get(); 
+ break; 
+ case (EFILE) : 
+ if ((_child_id_len != -1) && 
+ (CObjectFactory::HasObject<CFile>(__child_id))) 
+ return; 
+ *_child = CGroupFactory::CreateChild(group, __child_id).get(); 
+ break; 
+ default : 
+ std::cerr << "[xml_tree_add] Type enfant invalide" << std::endl; 
+ }; 
+ return; 
+ };
+         default :
+            std::cerr << "[xml_tree_add] Type parent invalide" << std::endl;
+            return;
+      }
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+void xios_xml_tree_show(const XString _filename, XSize _filename_len)
+{
+   
+ StdString __filenametemp; 
+ StdSize d, f = 0; 
+ if (_filename_len != -1) 
+ { 
+ __filenametemp.append (_filename, _filename_len); 
+ d = __filenametemp.find_first_not_of(' '); 
+ f = __filenametemp.find_last_not_of (' '); 
+ } 
+ StdString __filename = (_filename_len != -1) ? __filenametemp.substr(d, f-d+1) : "" ; 
+
+   if (_filename_len != -1)
+      CTreeManager::PrintTreeToFile(__filename);
+   else
+      CTreeManager::PrintTreeToStream(std::clog);
+}
+void xios_dtreatment_start(XPtr const _context, XFileType filetype)
+{
+   try
+   {
+      StdOStringStream oss;
+      oss << StdString("data/def/def_client_next.")
+          << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+      CTreeManager::PrintTreeToFile(oss.str());
+      CDataTreatment dt;
+      dt.createDataOutput<CNc4DataOutput>();
+      oss.str("");
+      oss << StdString("data/def/def_client_end.")
+          << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+      CTreeManager::PrintTreeToFile(oss.str());
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+void xios_dtreatment_end(void)
+{
+}
+void xios_write_data(const XString _field_id, XSize _field_id_len, double * data_k8,
+                     XSize data_Xsize, XSize data_Ysize, XSize data_Zsize)
+{
+}
+void xios_update_calendar(int step)
+{
+}
+void xios_set_timestep(double ts_year, double ts_month, double ts_day,
+                       double ts_hour, double ts_minute, double ts_second)
+{
+}
+}
Index: XMLIO_V2/dev/dev_rv/src/xmlio/iface/interface.cpp.in
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/iface/interface.cpp.in	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/iface/interface.cpp.in	(revision 152)
@@ -0,0 +1,299 @@
+#include "macro.inc"
+
+INCLUDE "../xmlioserver.hpp"
+
+INCLUDE "attribute_template_impl.hpp"
+INCLUDE "object_template_impl.hpp"
+INCLUDE "group_template_impl.hpp"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif //__cplusplus
+
+typedef xmlioserver::tree::CAxis    caxis;
+typedef xmlioserver::tree::CField   cfield;
+typedef xmlioserver::tree::CDomain  cdomain;
+typedef xmlioserver::tree::CGrid    cgrid;
+typedef xmlioserver::tree::CFile    cfile;
+typedef xmlioserver::tree::CContext ccontext;
+
+typedef xmlioserver::tree::CAxisGroup    caxisgroup;
+typedef xmlioserver::tree::CFieldGroup   cfieldgroup;
+typedef xmlioserver::tree::CDomainGroup  cdomaingroup;
+typedef xmlioserver::tree::CGridGroup    cgridgroup;
+typedef xmlioserver::tree::CFileGroup    cfilegroup;
+typedef xmlioserver::tree::CContextGroup ccontextgroup;
+
+
+typedef long int XInt, XSize; // Integer
+typedef bool     XBool;       // Logical
+typedef void   * XPtr;        // Pointeur C non typÃÂ©
+typedef char   * XString;     // Pointeur C non typÃÂ©
+
+typedef enum
+{
+   NOTYPE = 0,
+   DTREATMENT/* UNUSED */, DATE, CALENDAR, ECONTEXT,
+   EAXIS, EDOMAIN, EFIELD, EFILE, EGRID,
+   GAXIS, GDOMAIN, GFIELD, GFILE, GGRID
+} XDType;
+
+typedef enum
+{
+   NETCDF4 = 0
+} XFileType;
+
+typedef enum
+{ D360 = 0 , ALLLEAP, NOLEAP, JULIAN, GREGORIAN } XCalendarType ;
+
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(axis, type, name)
+#include "../config/axis_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(field, type, name)
+#include "../config/field_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(context, type, name)
+#include "../config/context_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(domain, type, name)
+#include "../config/domain_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(file, type, name)
+#include "../config/file_attribute.conf"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name) \
+        DECLARE_INTERFACE(grid, type, name)
+#include "../config/grid_attribute.conf"
+
+#define CASE_ELEM(elem_enum, elem_class)                                         \
+   case (E##elem_enum): ;; { ;;                                                  \
+      *_ret = (!CObjectFactory::HasObject<C##elem_class>(__id));;                \
+            ? 0 : CObjectFactory::GetObject<C##elem_class>(__id).get(); ;;       \
+      return; ;;};;                                                              \
+   case (G##elem_enum): ;; { ;;                                                  \
+      *_ret = (!CObjectFactory::HasObject<C##elem_class##Group>(__id));;         \
+            ? 0 : CObjectFactory::GetObject<C##elem_class##Group>(__id).get(); ;;\
+      return; ;;};;
+
+
+void xios_handle_create (XPtr * const _ret, XDType _dtype, const XString _id, XSize _id_len)
+{
+   MAKE_STRING(__id, _id, _id_len);
+   switch(_dtype)
+   {
+      case (ECONTEXT):
+         // Si le context n'existe pas, on retourne un handle vide/nul.
+         *_ret = (!CObjectFactory::HasObject<CContext>(__id))
+               ? 0 : CObjectFactory::GetObject<CContext>(__id).get();
+         return ;
+      CASE_ELEM(AXIS   , Axis)
+      CASE_ELEM(DOMAIN , Domain)
+      CASE_ELEM(FIELD  , Field)
+      CASE_ELEM(FILE   , File)
+      CASE_ELEM(GRID   , Grid)
+      default :
+         *_ret = 0;
+         return;
+   }
+}
+
+#undef CASE_ELEM
+
+void xios_xml_parse_file  (const XString _filename, XSize _filename_len)
+{
+   try
+   {
+      MAKE_STRING(__filename, _filename, _filename_len)
+      CTreeManager::ParseFile(__filename);
+      StdOStringStream oss;
+      oss << StdString("data/def/def_client_pre.")
+          << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+      CTreeManager::PrintTreeToFile(oss.str());
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+
+void xios_xml_parse_string(const XString _xmlcontent, XSize _xmlcontent_len)
+{
+   try
+   {
+      MAKE_STRING(__xmlcontent, _xmlcontent, _xmlcontent_len)
+      CTreeManager::ParseString(__xmlcontent);
+      StdOStringStream oss;
+      oss << StdString("data/def/def_client_pre.")
+          << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+      CTreeManager::PrintTreeToFile(oss.str());
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+
+void xios_context_set_current (XPtr const _ctx, bool _wswap)
+{
+   boost::shared_ptr<CContext> context = CObjectFactory::GetObject<CContext> ((CContext*)_ctx);
+   CTreeManager::SetCurrentContextId(context->getId());
+}
+
+void xios_context_create (XPtr * _ctxt, const XString _ctxt_id,
+                          XSize _ctxt_id_len, XCalendarType _calType,
+                          XInt yr, XInt mth, XInt dd,
+                          XInt hr, XInt min, XInt sec)
+{
+   try
+   {
+      MAKE_STRING(__ctxt_id, _ctxt_id, _ctxt_id_len)
+      boost::shared_ptr<CContext> context = CTreeManager::CreateContext(__ctxt_id);
+      *_ctxt = context.get();
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+
+#define CASE_ELEM0(elem_enum, elem_class, group_enum, group_class)                     \
+      case (group_enum) : ;;                                                           \
+      { ;;                                                                             \
+         group_class * _group = (group_class *) _parent;                               \
+         boost::shared_ptr<group_class> group = ;;                                     \
+            CObjectFactory::GetObject<group_class>(_group); ;;                         \
+         switch(_child_type) ;;                                                        \
+         { ;;                                                                          \
+            case (group_enum) : ;;                                                     \
+               if ((_child_id_len != -1) && ;;                                         \
+                   (CObjectFactory::HasObject<group_class>(__child_id))) ;;            \
+                  return; ;;                                                           \
+               *_child = CGroupFactory::CreateGroup(group, __child_id).get(); ;;       \
+               break; ;;                                                               \
+            case (elem_enum) : ;;                                                      \
+               if ((_child_id_len != -1) && ;;                                         \
+                   (CObjectFactory::HasObject<elem_class>(__child_id))) ;;             \
+                  return; ;;                                                           \
+               *_child = CGroupFactory::CreateChild(group, __child_id).get(); ;;       \
+               break; ;;                                                               \
+            default : ;;                                                               \
+               std::cerr << "[xml_tree_add] Type enfant invalide" << std::endl; ;;     \
+         }; ;;                                                                         \
+         return; ;;                                                                    \
+      }
+
+
+
+void xios_xml_tree_add(const XPtr _parent, XDType _parent_type, XPtr * _child,
+                       XDType _child_type, const XString _child_id, XSize _child_id_len)
+{
+   MAKE_STRING(__child_id, _child_id, _child_id_len);
+   try
+   {
+      switch (_parent_type)
+      {
+         case (EFILE) :
+         {
+            CFile * _file = (CFile *) _parent;
+            boost::shared_ptr<CFile> file = CObjectFactory::GetObject<CFile>(_file);
+            if (!CObjectFactory::HasObject<CFieldGroup>(file->getId()))
+               file->setVirtualFieldGroup(file->getId());
+            xios_xml_tree_add (file->getVirtualFieldGroup().get(), GFIELD,
+                              _child, EFIELD, _child_id, _child_id_len);
+            return;
+         }
+         CASE_ELEM0(EAXIS  , CAxis  , GAXIS  , CAxisGroup);
+         CASE_ELEM0(EGRID  , CGrid  , GGRID  , CGridGroup);
+         CASE_ELEM0(EDOMAIN, CDomain, GDOMAIN, CDomainGroup);
+         CASE_ELEM0(EFIELD , CField , GFIELD , CFieldGroup);
+         CASE_ELEM0(EFILE  , CFile  , GFILE  , CFileGroup);
+         default :
+            std::cerr << "[xml_tree_add] Type parent invalide" << std::endl;
+            return;
+      }
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+
+#undef CASE_ELEM0
+
+void xios_xml_tree_show(const XString _filename, XSize _filename_len)
+{
+   MAKE_STRING(__filename, _filename, _filename_len);
+   if (_filename_len != -1)
+      CTreeManager::PrintTreeToFile(__filename);
+   else
+      CTreeManager::PrintTreeToStream(std::clog);
+}
+
+void xios_dtreatment_start(XPtr const _context, XFileType filetype)
+{
+   try
+   {
+      StdOStringStream oss;
+      oss << StdString("data/def/def_client_next.")
+          << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+      CTreeManager::PrintTreeToFile(oss.str());
+
+      CDataTreatment dt;
+      dt.createDataOutput<CNc4DataOutput>();
+
+      oss.str("");
+      oss << StdString("data/def/def_client_end.")
+          << CMPIManager::GetCommRank(CMPIManager::GetCommWorld());
+      CTreeManager::PrintTreeToFile(oss.str());
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      exit (EXIT_FAILURE);
+   }
+}
+
+void xios_dtreatment_end(void)
+{
+
+}
+
+void xios_write_data(const XString _field_id, XSize _field_id_len, double * data_k8,
+                     XSize data_Xsize, XSize data_Ysize, XSize data_Zsize)
+{
+
+}
+
+void xios_update_calendar(int step)
+{
+
+}
+
+void xios_set_timestep(double ts_year, double ts_month, double ts_day,
+                       double ts_hour, double ts_minute, double ts_second)
+{
+
+
+}
+
+
+
+
+#ifdef __cplusplus
+}
+#endif //__cplusplus
Index: XMLIO_V2/dev/dev_rv/src/xmlio/iface/macro.inc
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/iface/macro.inc	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/iface/macro.inc	(revision 152)
@@ -0,0 +1,114 @@
+#define MAKE_STRING(var_name, str_arg, int_arg) ;;     \
+   StdString var_name##temp; ;;                        \
+   StdSize d, f = 0; ;;                                \
+   if (int_arg != -1) ;;                               \
+   { ;;                                                \
+      var_name##temp.append (str_arg, int_arg); ;;     \
+      d = var_name##temp.find_first_not_of(' '); ;;    \
+      f = var_name##temp.find_last_not_of (' '); ;;    \
+   } ;;                                                \
+   StdString var_name = (int_arg != -1)                \
+                     ? var_name##temp.substr(d, f-d+1) \
+                     : "" ; ;
+
+#define MAKE_ARRAY(value, valuetype, numdims, extent)            \
+   boost::shared_ptr<CArray<valuetype, numdims> > value##_val ;; \
+   (new CArray<valuetype, numdims>(boost::extents extent));   ;; \
+   std::copy(value, &(value[value##_val->num_elements()]), value##_val->data()); ;
+
+
+//-------------------------------
+
+#define iarg_bool(name)      , const bool   * name
+#define iarg_int(name)       , const int    * name
+#define iarg_double(name)    , const double * name
+#define iarg_StdString(name) , const char   * name iarg_int(name##_size)
+
+#define iarg_ARRAY1(name) name iarg_int(name##_extent1)
+#define iarg_ARRAY2(name) iarg_ARRAY1(name) iarg_int(name##_extent2)
+#define iarg_ARRAY3(name) iarg_ARRAY2(name) iarg_int(name##_extent3)
+#define iarg_ARRAY(type, numdim) , const type *  iarg_ARRAY##numdim
+
+//--------------------------------
+#define dec_bool(name)      bool   name##_val = *name;
+#define dec_int(name)       int    name##_val = *name;
+#define dec_double(name)    double name##_val = *name;
+#define dec_StdString(name) MAKE_STRING(name##_val, name, *name##_size);
+
+//-
+
+#define dec_double1(name)     \
+   dec_int(name##_extent1) ;; \
+   MAKE_ARRAY(name, double, 1, [name##_extent1##_val]);
+
+#define dec_double2(name)     \
+   dec_int(name##_extent1) ;; \
+   dec_int(name##_extent2) ;; \
+   MAKE_ARRAY(name, double, 2, [name##_extent1##_val][name##_extent2##_val]);
+
+#define dec_double3(name)     \
+   dec_int(name##_extent1) ;; \
+   dec_int(name##_extent2) ;; \
+   dec_int(name##_extent3) ;; \
+   MAKE_ARRAY(name, double, 3, [name##_extent1##_val][name##_extent2##_val])[name##_extent3##_val]);
+
+//-
+
+#define dec_int1(name)        \
+   dec_int(name##_extent1) ;; \
+   MAKE_ARRAY(name, int, 1, [name##_extent1##_val]);
+
+#define dec_int2(name)        \
+   dec_int(name##_extent1) ;; \
+   dec_int(name##_extent2) ;; \
+   MAKE_ARRAY(name, int, 2, [name##_extent1##_val][name##_extent2##_val]);
+
+#define dec_int3(name)        \
+   dec_int(name##_extent1) ;; \
+   dec_int(name##_extent2) ;; \
+   dec_int(name##_extent3) ;; \
+   MAKE_ARRAY(name, int, 3, [name##_extent1##_val][name##_extent2##_val])[name##_extent3##_val]);
+
+//-
+
+#define dec_bool1(name)       \
+   dec_int(name##_extent1) ;; \
+   MAKE_ARRAY(name, bool, 1, [name##_extent1##_val]);
+
+#define dec_bool2(name)       \
+   dec_int(name##_extent1) ;; \
+   dec_int(name##_extent2) ;; \
+   MAKE_ARRAY(name, bool, 2, [name##_extent1##_val][name##_extent2##_val]);
+
+#define dec_bool3(name)       \
+   dec_int(name##_extent1) ;; \
+   dec_int(name##_extent2) ;; \
+   dec_int(name##_extent3) ;; \
+   MAKE_ARRAY(name, bool, 3, [name##_extent1##_val][name##_extent2##_val])[name##_extent3##_val]);
+
+//-
+
+#define dec_ARRAY(type, numdim) dec_##type##numdim
+
+//--------------------------------
+
+#define DECLARE_INTERFACE(class, type, name);;                    \
+   void xios_set_##class##_##name                                 \
+      (void * class##_hdl, int ftype iarg_##type(name));;         \
+   {;;                                                            \
+      dec_##type(name) ;;                                         \
+      if (class##_hdl != NULL) ;;                                 \
+      {;;                                                         \
+         if (ftype < GAXIS);;                                     \
+         {;;                                                      \
+            c##class * class##_hdl_ = (c##class *) class##_hdl; ;;\
+            class##_hdl_->name.setValue(name##_val); ;;           \
+         };;                                                      \
+         else;;                                                   \
+         {;;                                                      \
+            c##class##group * class##_hdl_;;                      \
+              = (c##class##group *) class##_hdl; ;;               \
+            class##_hdl_->name.setValue(name##_val); ;;           \
+         };;                                                      \
+      };;                                                         \
+   };; ;;
Index: XMLIO_V2/dev/dev_rv/src/xmlio/indent.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/indent.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/indent.cpp	(revision 152)
@@ -0,0 +1,53 @@
+#include "indent.hpp"
+
+/// boost headers ///
+#include <boost/algorithm/string.hpp>
+#include <boost/algorithm/string/split.hpp>
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   unsigned int CIndent::Indent   = 0;
+   StdString    CIndent::Increm   = StdString("   ");
+   bool         CIndent::WithLine = true;
+
+   StdOStream & CIndent::NIndent(StdOStream& out)
+   {
+      static unsigned int LineNB = 1;
+      if (CIndent::WithLine) out << LineNB++ << ". ";
+      for(unsigned int i = 0; i < CIndent::Indent; out << CIndent::Increm , i++){}
+      return (out);
+   }
+
+   StdOStream & CIndent::IncIndent(StdOStream& out)
+   { CIndent::Indent++; return (CIndent::NIndent(out)); }
+
+   StdOStream & CIndent::DecEndl  (StdOStream& out)
+   { CIndent::Indent--; return (out); }
+
+   ///----------------------------------------
+
+   StdString CIndentedXml::Indented(const StdString & content)
+   {
+      StdOStringStream retvalue;
+      std::vector<StdString> str;
+      boost::split(str, content, boost::is_any_of("\n"));
+      
+      std::vector<StdString>::iterator it = str.begin(), end = str.end();
+      
+      for (; it != end; it++)
+      {
+         StdString & line = *it;
+         if (line.find("<? ") != StdString::npos ||
+             line.find(xml::CXMLNode::GetRootName()) != StdString::npos)
+            retvalue << CIndent::NIndent << line <<  std::endl;
+         else if (line.find("</ ") != StdString::npos)
+            retvalue << CIndent::NIndent   << line << CIndent::DecEndl << std::endl;
+         else if (line.find(" />") != StdString::npos)
+            retvalue << CIndent::IncIndent << line << CIndent::DecEndl << std::endl;
+         else
+            retvalue << CIndent::IncIndent << line <<  std::endl;
+      }
+      return (retvalue.str());
+   }
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/indent.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/indent.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/indent.hpp	(revision 152)
@@ -0,0 +1,50 @@
+#ifndef __XMLIO_CIndent__
+#define __XMLIO_CIndent__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "xml_node.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CIndent
+   {
+      public :
+
+         /// MÃ©thodes statiques ///
+         static StdOStream & NIndent  (StdOStream & out);
+         static StdOStream & IncIndent(StdOStream & out);
+         static StdOStream & DecEndl  (StdOStream & out);
+
+      private :
+
+         /// PropriÃ©tÃ©s  statiques ///
+         static unsigned int Indent;
+         static StdString    Increm;
+         static bool         WithLine;
+
+   }; // class CIndent
+
+    ///--------------------------------------------------------------
+    
+   class CIndentedXml
+   {
+      public :
+
+         /// MÃ©thode statique ///
+         static StdString Indented(const StdString & content);
+
+   }; // class CIndentedXml
+
+    ///--------------------------------------------------------------
+
+} // namespace xmlioserver
+
+   /// ////////////////////// Macros ////////////////////// ///
+   
+#define NIndent   CIndent::NIndent
+#define IncIndent CIndent::IncIndent
+#define DecEndl   CIndent::DecEndl
+
+#endif // __XMLIO_CIndent__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/input/inetcdf4.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/input/inetcdf4.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/input/inetcdf4.cpp	(revision 152)
@@ -0,0 +1,791 @@
+#include "inetcdf4.hpp"
+
+#include <boost/algorithm/string.hpp>
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CINetCDF4::CINetCDF4(const StdString & filename)
+      {
+         CheckError(nc_open(filename.c_str(), NC_NOWRITE, &this->ncidp));
+      }
+
+      CINetCDF4::~CINetCDF4(void)
+      {
+          CheckError(nc_close(this->ncidp));
+      }
+
+      ///--------------------------------------------------------------
+
+      void CINetCDF4::CheckError(int status)
+      {
+         if (status != NC_NOERR)
+         {
+            StdString errormsg (nc_strerror(status)); // fuite mÃ©moire ici ?
+            ERROR("CINetCDF4::CheckError(int status)",
+                  << "[ status = " << status << " ] " << errormsg);
+         }
+      }
+
+      //---------------------------------------------------------------
+
+      int CINetCDF4::getGroup(const CVarPath * const path)
+      {
+         int retvalue = this->ncidp;
+         if (path == NULL) return (retvalue);
+         CVarPath::const_iterator it = path->begin(), end = path->end();
+         
+         for (; it != end; it++)
+         {
+            const StdString & groupid = *it;
+            CheckError(nc_inq_ncid(retvalue, const_cast<char*>(groupid.c_str()), &retvalue));
+         }       
+            
+         return (retvalue);
+      }
+
+      int CINetCDF4::getVariable(const StdString & varname,
+                                 const CVarPath * const path)
+      {
+         int varid = 0;
+         int grpid = this->getGroup(path);
+         CheckError(nc_inq_varid (grpid, varname.c_str(), &varid));
+         return (varid);
+      }
+
+      int CINetCDF4::getDimension(const StdString & dimname,
+                                  const CVarPath  * const path)
+      {
+         int dimid = 0;
+         int grpid = this->getGroup(path);
+         CheckError(nc_inq_dimid (grpid, dimname.c_str(), &dimid));
+         return (dimid);
+      }
+
+      std::pair<nc_type, StdSize> CINetCDF4::getAttribute
+                                 (const StdString & attname,
+                                  const StdString * const var,
+                                  const CVarPath  * const path)
+      {
+         std::pair<nc_type, StdSize> retvalue;
+         int grpid = this->getGroup(path);
+         int varid = (var != NULL)
+                   ? this->getVariable(*var, path) : NC_GLOBAL;
+         CheckError(nc_inq_att(grpid, varid, attname.c_str(),
+                              &retvalue.first, &retvalue.second));
+         return (retvalue);
+      }
+
+      int CINetCDF4::getUnlimitedDimension(const CVarPath  * const path)
+      {
+         int dimid = 0;
+         int grpid = this->getGroup(path);
+         CheckError(nc_inq_unlimdim (grpid, &dimid));
+         return (dimid);
+      }
+
+      StdString CINetCDF4::getUnlimitedDimensionName(const CVarPath  * const path)
+      {
+         char full_name_in[NC_MAX_NAME +1];
+         int grpid = this->getGroup(path);
+         int dimid = this->getUnlimitedDimension(path);
+         CheckError(nc_inq_dimname(grpid, dimid, full_name_in));
+
+         StdString dimname(full_name_in);
+         return (dimname);
+      }
+
+      //---------------------------------------------------------------
+      StdSize CINetCDF4::getNbVertex(const StdString & name,
+                                     const CVarPath  * const path)
+      {
+
+         if (this->isRectilinear(name, path) ||
+             this->isCurvilinear(name, path))
+         {
+            if (this->is3Dim(name, path)) return (8);
+            else return (4);
+         }
+         if (this->isUnstructured(name, path))
+         {
+            StdString bound = this->getBoundsId
+                     (this->getCoordinatesIdList(name, path).back(), path);
+            StdString dim = this->getDimensionsList(&bound, path).back();
+            return (this->getDimensions(&bound, path)[dim]);
+         }
+         return ((size_t)(-1));
+      }
+
+      //---------------------------------------------------------------
+
+      std::list<StdString> CINetCDF4::getGroups(const CVarPath * const path)
+      {
+         StdSize strlen = 0;
+         char full_name_in[NC_MAX_NAME +1];
+         int nbgroup = 0, *groupid = NULL;
+         int grpid = this->getGroup(path);
+         std::list<StdString> retvalue;
+
+         CheckError(nc_inq_grps(grpid, &nbgroup, NULL));
+         groupid = new int[nbgroup]();
+         CheckError(nc_inq_grps(grpid, NULL, groupid));
+
+         for (int i = 0; i < nbgroup; i++)
+         {
+            CheckError(nc_inq_grpname_full(groupid[i], &strlen, full_name_in));
+            StdString groupname(full_name_in, strlen);
+            retvalue.push_back(groupname);
+         }
+
+         delete [] groupid;
+         return (retvalue);
+      }
+
+      std::list<StdString> CINetCDF4::getVariables(const CVarPath * const path)
+      {
+         char full_name_in[NC_MAX_NAME +1];
+         int nbvar = 0, *varid = NULL;
+         int grpid = this->getGroup(path);
+         std::list<StdString> retvalue;
+
+         CheckError(nc_inq_varids(grpid, &nbvar, NULL));
+         varid = new int[nbvar]();
+         CheckError(nc_inq_varids(grpid, NULL, varid));
+
+         for (int i = 0; i < nbvar; i++)
+         {
+            CheckError(nc_inq_varname(grpid, varid[i], full_name_in));
+            StdString varname(full_name_in);
+            retvalue.push_back(varname);
+         }
+
+         delete [] varid;
+         return (retvalue);
+      }
+
+      StdSize CINetCDF4::getNbOfTimestep(const CVarPath * const path)
+      {
+         return (this->getDimensions(NULL, path)[this->getUnlimitedDimensionName(path)]);
+      }
+
+      std::set<StdString> CINetCDF4::getBoundVariables(const CVarPath * const path)
+      {
+         std::set<StdString> retvalue;         
+         std::list<StdString> variables = this->getVariables(path);
+         std::list<StdString>::const_iterator it = variables.begin(), end = variables.end();
+         for (; it != end; it++)
+         {
+            const StdString & var = *it;
+            if (this->hasBounds(var, path))
+               retvalue.insert(retvalue.end(), this->getBoundsId(var, path));
+         }
+         return (retvalue);
+      }
+
+      std::set<StdString> CINetCDF4::getCoordVariables(const CVarPath * const path)
+      {
+         std::set<StdString> retvalue;
+         std::list<StdString> variables = this->getVariables(path);
+         std::list<StdString>::const_iterator it = variables.begin(), end = variables.end();
+         for (; it != end; it++)
+         {
+            const StdString & var = *it;
+            std::list<StdString> coords = this->getCoordinatesIdList(var, path);
+            std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+            for (; it != end; it++)
+            {
+               const StdString & coord = *it;
+               if (this->hasVariable(coord, path))
+                  retvalue.insert(retvalue.end(), coord);
+            }
+         }
+         return (retvalue);
+      }
+
+      std::list<StdString> CINetCDF4::getDimensionsList
+                  (const StdString * const var, const CVarPath  * const path)
+      {
+         char full_name_in[NC_MAX_NAME +1];
+         int nbdim = 0, *dimid = NULL;
+         int grpid = this->getGroup(path);
+         int varid = (var != NULL)
+                   ? this->getVariable(*var, path) : NC_GLOBAL;
+         std::list<StdString> retvalue;
+
+         if (var != NULL)
+         {
+            CheckError(nc_inq_varndims(grpid, varid, &nbdim));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_vardimid(grpid, varid, dimid));
+         }
+         else
+         {
+            CheckError(nc_inq_dimids(grpid, &nbdim, NULL, 1));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_dimids(grpid, NULL, dimid, 1));
+         }
+
+         for (int i = 0; i < nbdim; i++)
+         {
+            CheckError(nc_inq_dimname(grpid, dimid[i], full_name_in));
+            StdString dimname(full_name_in);
+            retvalue.push_back(dimname);
+         }
+         delete [] dimid;
+
+         return (retvalue);
+      }
+
+      std::map<StdString, StdSize> CINetCDF4::getDimensions
+                  (const StdString * const var, const CVarPath  * const path)
+      {
+         StdSize size = 0;
+         char full_name_in[NC_MAX_NAME +1];
+         int nbdim = 0, *dimid = NULL;
+         int grpid = this->getGroup(path);
+         int varid = (var != NULL)
+                   ? this->getVariable(*var, path) : NC_GLOBAL;
+         std::map<StdString, StdSize> retvalue;
+
+         if (var != NULL)
+         {
+            CheckError(nc_inq_varndims(grpid, varid, &nbdim));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_vardimid(grpid, varid, dimid));
+         }
+         else
+         {
+            CheckError(nc_inq_dimids(grpid, &nbdim, NULL, 1));
+            dimid = new int[nbdim]();
+            CheckError(nc_inq_dimids(grpid, NULL, dimid, 1));
+         }
+
+         for (int i = 0; i < nbdim; i++)
+         {
+            CheckError(nc_inq_dimname(grpid, dimid[i], full_name_in));
+            CheckError(nc_inq_dimlen (grpid, dimid[i], &size));
+
+            StdString dimname(full_name_in);
+            retvalue.insert(retvalue.end(), std::make_pair(dimname, size));
+         }
+         delete [] dimid;
+
+         return (retvalue);
+      }
+
+      std::list<StdString> CINetCDF4::getAttributes
+               (const StdString * const var, const CVarPath  * const path )
+      {
+         int nbatt = 0;
+         char full_name_in[NC_MAX_NAME +1];
+         std::list<StdString> retvalue;
+         int grpid = this->getGroup(path);
+         int varid = (var != NULL)
+                   ? this->getVariable(*var, path) : NC_GLOBAL;
+
+         if (var != NULL)
+            CheckError(nc_inq_varnatts (grpid, varid, &nbatt));
+         else
+            CheckError(nc_inq_natts(grpid, &nbatt));
+
+         for (int i = 0; i < nbatt; i++)
+         {
+            CheckError(nc_inq_attname(grpid, varid, i, full_name_in));
+            StdString attname(full_name_in);
+            retvalue.push_back(attname);
+         }
+         return (retvalue);
+      }
+
+      int CINetCDF4::getAttributeId(const StdString & name,
+                                    const StdString * const var,
+                                    const CVarPath  * const path)
+      {
+         int retvalue = 0;
+         std::list<StdString> atts = this->getAttributes(var, path);
+         std::list<StdString>::const_iterator it = atts.begin(), end = atts.end();
+         for (; it != end; it++)
+         {
+            const StdString & attname = *it;
+            if (attname.compare(name) == 0)
+               return (retvalue);
+            retvalue++;
+         }
+         return (-1);
+      }
+
+      //---------------------------------------------------------------
+
+      bool CINetCDF4::hasMissingValue(const StdString & name,
+                                      const CVarPath  * const path)
+      {
+         return (this->hasAttribute("missing_value", &name, path) ||
+                 this->hasAttribute("_FillValue", &name, path));
+      }
+
+      bool CINetCDF4::hasAttribute(const StdString & name,
+                                   const StdString * const var ,
+                                   const CVarPath  * const path)
+      {
+         std::list<StdString> atts = this->getAttributes(var, path);
+         std::list<StdString>::const_iterator it = atts.begin(), end = atts.end();
+         for (; it != end; it++)
+         {
+            const StdString & attname = *it;
+            if (attname.compare(name) == 0) return (true);
+         }
+         return (false);
+      }
+
+      bool CINetCDF4::hasVariable(const StdString & name,
+                                  const CVarPath  * const path)
+      {
+         std::list<StdString> variables = this->getVariables(path);
+         std::list<StdString>::const_iterator it = variables.begin(), end = variables.end();
+         for (; it != end; it++)
+         {
+            const StdString & varname = *it;
+            if (varname.compare(name) == 0) return (true);
+         }
+         return (false);
+      }
+
+      bool CINetCDF4::hasCoordinates(const StdString & name,
+                                     const CVarPath  * const path)
+      {
+         return (this->hasAttribute("coordinates", &name, path));
+      }
+
+      bool CINetCDF4::hasBounds(const StdString & name,
+                                const CVarPath  * const path)
+      {
+         return (this->hasAttribute("bounds", &name, path));
+      }
+
+      bool CINetCDF4::hasTemporalDim(const CVarPath  * const path)
+      {
+         return (this->getUnlimitedDimension(path) != -1);
+      }
+
+      //---------------------------------------------------------------
+
+#define GET_ATTRIBUTE_VALUE(type, func_ext, type_enum)                     \
+      template <>                                                          \
+         std::vector<type> CINetCDF4::getAttributeValue                    \
+            (const StdString & name, const StdString * const var,          \
+                                     const CVarPath  * const path)         \
+      {                                                                    \
+         int grpid = this->getGroup(path);                                 \
+         int varid = (var != NULL)                                         \
+                   ? this->getVariable(*var, path) : NC_GLOBAL;            \
+         std::pair<nc_type , StdSize> attinfos =                           \
+                     this->getAttribute(name, var, path);                  \
+         std::vector<type> retvalue(attinfos.second);                      \
+         if (attinfos.first != type_enum)                                  \
+            ERROR("CINetCDF4::getAttributeValue<double>(name, var, path",  \
+                  << "[ name : "          << name                          \
+                  << ", type requested :" << attinfos.first                \
+                  << ", type stored : "   << type_enum      << "]"         \
+                  << " Invalid type !");                                   \
+         CheckError(nc_get_att_##func_ext                                  \
+                        (grpid, varid, name.c_str(), &(retvalue[0])));     \
+         return (retvalue);                                                \
+      }
+
+      GET_ATTRIBUTE_VALUE(double, double, NC_DOUBLE)
+      GET_ATTRIBUTE_VALUE(float , float , NC_FLOAT)
+      GET_ATTRIBUTE_VALUE(int   , int   , NC_INT)
+      GET_ATTRIBUTE_VALUE(char  , text  , NC_CHAR)
+
+      template <>
+         StdString CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path)
+      {
+         std::vector<char> chart = this->getAttributeValue
+                        <std::vector<char> >(name, var, path);
+         StdString retvalue(&(chart[0]), chart.size());
+         return (retvalue);
+      }
+
+      template <>
+         int CINetCDF4::getMissingValue(const StdString & name,
+                                        const CVarPath  * const path)
+      {
+         if (this->hasAttribute("missing_value", &name, path))
+            return (this->getAttributeValue<std::vector<int> >("missing_value", &name, path)[0]);
+         if (this->hasAttribute("_FillValue", &name, path))
+            return (this->getAttributeValue<std::vector<int> >("_FillValue", &name, path)[0]);
+         return (0);
+      }
+
+      template <>
+         double CINetCDF4::getMissingValue(const StdString & name,
+                                           const CVarPath  * const path)
+      {
+         if (this->hasAttribute("missing_value", &name, path))
+            return (this->getAttributeValue<std::vector<double> >("missing_value", &name, path)[0]);
+         if (this->hasAttribute("_FillValue", &name, path))
+            return (this->getAttributeValue<std::vector<double> >("_FillValue", &name, path)[0]);
+         return (0);
+      }
+
+      template <>
+         float CINetCDF4::getMissingValue(const StdString & name,
+                                          const CVarPath  * const path)
+      {
+         if (this->hasAttribute("missing_value", &name, path))
+            return (this->getAttributeValue<std::vector<float> >("missing_value", &name, path)[0]);
+         if (this->hasAttribute("_FillValue", &name, path))
+            return (this->getAttributeValue<std::vector<float> >("_FillValue", &name, path)[0]);
+         return (0);
+      }
+      
+      //---------------------------------------------------------------
+      
+      std::list<StdString> CINetCDF4::getCoordinatesIdList
+         (const StdString & name, const CVarPath  * const path)
+      {
+         std::list<StdString> retvalue;
+         StdString value = this->getCoordinatesId(name, path);
+         
+         boost::split(retvalue, value, boost::is_any_of(" "));
+         
+         std::list<StdString>::iterator it = retvalue.begin(), end = retvalue.end();
+         for (; it != end; it++)
+         {
+            StdString & coord = *it;
+            coord.assign(coord.data());
+         }
+         return (retvalue);
+      }
+
+      StdString CINetCDF4::getCoordinatesId
+         (const StdString & name, const CVarPath  * const path)
+      {
+         StdString retvalue;
+         if (this->hasAttribute("coordinates", &name, path))
+         {
+            return (this->getAttributeValue<StdString>("coordinates", &name, path));
+         }
+         else
+         {
+            std::list<StdString> dims = this->getDimensionsList(&name, path);
+            std::list<StdString>::const_iterator it = dims.begin(), end = dims.end();
+            for (; it != end; it++)
+            {
+               const StdString & value = *it;               
+               retvalue.append(value).push_back(' ');
+            }
+            retvalue.erase (retvalue.end()-1) ;
+         }
+
+         return (retvalue);
+      }
+
+      StdString CINetCDF4::getBoundsId(const StdString & name,
+                                       const CVarPath  * const path)
+      {
+         StdString retvalue;
+         if (this->hasAttribute("bounds", &name, path))
+            return (this->getAttributeValue<StdString>("bounds", &name, path));
+         return (retvalue);
+      }
+
+      //---------------------------------------------------------------
+
+      bool CINetCDF4::isBound(const StdString & name,
+                              const CVarPath  * const path)
+      {
+         std::set<StdString> bounds = this->getBoundVariables(path);
+         return (bounds.find(name) != bounds.end());
+      }
+
+      bool CINetCDF4::isCoordinate(const StdString & name,
+                                   const CVarPath  * const path)
+      {
+         std::set<StdString> coords = this->getCoordVariables(path);
+         return (coords.find(name) != coords.end());
+      }
+
+      bool CINetCDF4::isRectilinear(const StdString & name, const CVarPath  * const path)
+      {
+         std::list<StdString> coords = this->getCoordinatesIdList(name, path);
+         std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+         for (; it != end; it++)
+         {
+            const StdString & coord = *it;
+            if (this->hasVariable(coord, path) && !this->isTemporal(coord, path))
+            {
+               std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path);
+               if ((dimvar.size() == 1) && (dimvar.find(coord) != dimvar.end()))
+                  continue;
+               else
+                  return (false);
+            }
+         }
+         return (true);
+      }
+
+      bool CINetCDF4::isCurvilinear(const StdString & name, const CVarPath  * const path)
+      {
+         if (this->isRectilinear(name, path) ||
+            !this->hasCoordinates(name, path))
+            return (false);
+
+         std::list<StdString> coords = this->getCoordinatesIdList(name, path);
+         std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+         for (; it != end; it++)
+         {
+            const StdString & coord = *it;
+            if (this->hasVariable(coord, path))
+            {
+               std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path);
+               if (dimvar.size() != 2) return (false);
+            }
+            else return (false);
+         }
+         return (true);
+      }
+
+      bool CINetCDF4::isUnstructured(const StdString & name, const CVarPath  * const path)
+      {
+         if (this->isRectilinear(name, path)    ||
+             this->isCurvilinear(name, path)    ||
+             !this->hasCoordinates(name, path))
+             return (false);
+
+         StdString dimname = this->getDimensionsList(&name, path).back();
+
+         std::list<StdString> coords = this->getCoordinatesIdList(name, path);
+         std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+         for (; it != end; it++)
+         {
+            const StdString & coord = *it;
+            if (this->hasVariable(coord, path))
+            {
+               std::map<StdString, StdSize> dimvar = this->getDimensions(&coord, path);
+               if ((dimvar.size() == 1) &&
+                   (dimvar.find(dimname) != dimvar.end()))
+                  continue;
+               else
+                  return (false);
+            }
+            else return (false);
+         }
+
+         return (true);
+      }
+
+      bool CINetCDF4::isUnknown(const StdString & name, const CVarPath * const path)
+      {
+         return !(this->isRectilinear(name, path) ||
+                  this->isCurvilinear(name, path) ||
+                  this->isUnstructured(name, path));
+      }
+
+      bool CINetCDF4::isTemporal(const StdString & name, const CVarPath  * const path)
+      {
+         if (!this->hasTemporalDim(path)) return (false);
+         std::map<StdString, StdSize> dims = this->getDimensions(&name, path);
+         if (dims.find(this->getUnlimitedDimensionName(path)) != dims.end())
+            return (true);
+         return (false);
+      }
+
+      bool CINetCDF4::is3Dim(const StdString & name, const CVarPath  * const path)
+      {
+         int i = 0;
+         std::list<StdString> coords = this->getCoordinatesIdList(name, path);
+         std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+         for (; it != end; it++)
+         {
+            const StdString & coord = *it;
+            if (this->hasVariable(coord, path))
+            {
+               if (this->isTemporal(coord, path))
+                  continue;
+               i++;
+            }
+            else
+            {
+               if (coord.compare(this->getUnlimitedDimensionName()) == 0)
+                  continue;
+               i++;
+            }
+         }
+         return (i == 3);
+      }
+
+      bool CINetCDF4::isCellGrid(const StdString & name, const CVarPath  * const path)
+      {
+         if (this->isCoordinate(name, path))
+         {
+            return (this->hasBounds(name, path));
+         }
+         else
+         {
+            std::list<StdString> coords = this->getCoordinatesIdList(name, path);
+            std::list<StdString>::const_iterator it = coords.begin(), end = coords.end();
+            for (; it != end; it++)
+            {
+               const StdString & coord = *it;
+               if (this->hasVariable(coord, path))
+               {
+                  if (this->isTemporal(coord, path))
+                     continue;
+                  if (this->isCellGrid(coord, path))
+                     continue;
+                  return (false);
+               }
+               else
+               {
+                  if (coord.compare(this->getUnlimitedDimensionName()) == 0)
+                     continue;
+                  return (false);
+               }
+            }
+         }
+
+         return (true);
+      }
+
+      //---------------------------------------------------------------
+
+      std::list<StdString> CINetCDF4::getDataVariables(bool _is3D,       bool _isRecti,
+                                                       bool _isCurvi,    bool _isUnstr,
+                                                       bool _isCellData, bool _isTemporal,
+                                                       const CVarPath * const path)
+      {
+         std::list<StdString> retvalue;
+         std::list<StdString> allvars  = this->getVariables(path);
+         std::set<StdString> allcoords = this->getCoordVariables(path);
+
+         std::list<StdString>::const_iterator it = allvars.begin(), end = allvars.end();
+         for (; it != end; it++)
+         {
+            const StdString & var = *it;
+            if (this->isCoordinate(var, path)) continue;
+
+            if (!_isRecti && this->isRectilinear(var, path) ) continue;
+            if (!_isCurvi && this->isCurvilinear(var, path) ) continue;
+            if (!_isUnstr && this->isUnstructured(var, path)) continue;
+
+            if (!_isTemporal && this->isTemporal(var, path)) continue;
+            if (!_is3D       && this->is3Dim(var, path)    ) continue;
+            if (!_isCellData && this->isCellGrid(var, path)) continue;
+
+            if (this->isUnknown(var, path)) continue;
+
+            retvalue.push_back(var);
+         }
+         return (retvalue);
+      }
+
+      //---------------------------------------------------------------
+
+      void CINetCDF4::getDataInfo(const StdString & var, const CVarPath  * const path, StdSize record,
+                                  std::vector<StdSize> & start, std::vector<StdSize> & count,
+                                  StdSize & array_size)
+      {
+         std::list<StdString> dimlist        = this->getDimensionsList(&var, path);
+         std::map<StdString, StdSize> dimmap = this->getDimensions(&var, path);
+         std::list<StdString>::iterator it   = dimlist.begin();
+         if (this->isTemporal(var, path))
+         {
+            if (record != UNLIMITED_DIM)
+               start.push_back(record);
+            else
+               start.push_back(0);
+            count.push_back(1);
+            it++;
+         }
+         for (; it != dimlist.end(); it++)
+         {
+            start.push_back(0);
+            count.push_back(dimmap[*it]);
+            array_size *= dimmap[*it];
+         }
+      }
+
+      template <>
+         void CINetCDF4::getData(ARRAY(int, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record)
+      {
+
+         std::vector<StdSize> start, count;
+         int grpid = this->getGroup(path);
+         int varid = this->getVariable(var, path);
+         StdSize array_size = 1;
+         this->getDataInfo(var, path, record, start, count, array_size);
+         data->resize(boost::extents[array_size]);
+         CheckError(nc_get_vara_int (grpid, varid, &(start[0]), &(count[0]), data->data()));
+      }
+
+      template <>
+         void CINetCDF4::getData(ARRAY(double, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record)
+      {
+         std::vector<StdSize> start, count;
+         int grpid = this->getGroup(path);
+         int varid = this->getVariable(var, path);
+         StdSize array_size = 1;
+         this->getDataInfo(var, path, record, start, count, array_size);
+         data->resize(boost::extents[array_size]);
+         CheckError(nc_get_vara_double (grpid, varid, &(start[0]), &(count[0]), data->data()));
+      }
+
+      template <>
+         void CINetCDF4::getData(ARRAY(float, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record)
+      {
+         std::vector<StdSize> start, count;
+         int grpid = this->getGroup(path);
+         int varid = this->getVariable(var, path);
+         StdSize array_size = 1;
+         this->getDataInfo(var, path, record, start, count, array_size);
+         data->resize(boost::extents[array_size]);
+         CheckError(nc_get_vara_float (grpid, varid, &(start[0]), &(count[0]), data->data()));
+      }
+
+      //---------------------------------------------------------------
+      StdString CINetCDF4::getLonCoordName(const StdString & varname,
+                                           const CVarPath  * const path)
+      {
+         std::list<StdString> clist =
+            this->getCoordinatesIdList(varname, path);
+         if (this->hasCoordinates(varname, path))
+            return (*clist.begin());
+         else
+            return (*clist.rbegin());
+      }
+
+      StdString CINetCDF4::getLatCoordName(const StdString & varname,
+                                           const CVarPath  * const path)
+      {
+         std::list<StdString> clist =
+            this->getCoordinatesIdList(varname, path);
+         if (this->hasCoordinates(varname, path))
+            return (*(++clist.begin()));
+         else
+            return (*(++clist.rbegin()));
+      }
+
+      StdString CINetCDF4::getVertCoordName(const StdString & varname,
+                                            const CVarPath  * const path)
+      {
+         if (!this->is3Dim(varname, path)) return ("");
+         std::list<StdString> clist =
+            this->getCoordinatesIdList(varname, path);
+         if (this->hasCoordinates(varname, path))
+            return (*(++(++clist.begin())));
+         else
+            return (*(++(++clist.rbegin())));
+      }
+
+      ///--------------------------------------------------------------
+
+   } // namespace io
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/input/inetcdf4.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/input/inetcdf4.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/input/inetcdf4.hpp	(revision 152)
@@ -0,0 +1,239 @@
+#ifndef __XMLIO_INETCDF4__
+#define __XMLIO_INETCDF4__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+
+#include <mpi.h>
+#define MPI_INCLUDED
+#include <netcdf.h>
+
+#ifndef UNLIMITED_DIM
+   #define UNLIMITED_DIM (size_t)(-1)
+#endif  //UNLIMITED_DIM
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      typedef std::vector<StdString> CVarPath;
+
+      class CINetCDF4
+      {
+         public :
+
+            /// Constructeurs ///
+            CINetCDF4(void);                             // Not implemented.
+            CINetCDF4(const StdString & filename);
+            CINetCDF4(const CINetCDF4 & inetcdf4);       // Not implemented.
+            CINetCDF4(const CINetCDF4 * const inetcdf4); // Not implemented.
+
+         //-------------------------------------------------------------
+
+            /// Accesseurs ///
+            StdSize getNbOfTimestep(const CVarPath  * const path = NULL);
+
+            StdString getUnlimitedDimensionName(const CVarPath  * const path = NULL);
+
+            StdString getCoordinatesId(const StdString & name,
+                                       const CVarPath  * const path = NULL);
+
+            StdString getBoundsId(const StdString & name,
+                                  const CVarPath  * const path = NULL);
+
+            StdString getLonCoordName(const StdString & varname,
+                                      const CVarPath  * const path = NULL);
+            StdString getLatCoordName(const StdString & varname,
+                                       const CVarPath  * const path = NULL);
+            StdString getVertCoordName(const StdString & varname,
+                                       const CVarPath  * const path = NULL);
+
+            std::set<StdString> getCoordVariables(const CVarPath * const path = NULL);
+            std::set<StdString> getBoundVariables(const CVarPath * const path = NULL);
+
+            std::list<StdString> getGroups   (const CVarPath * const path = NULL);
+            std::list<StdString> getVariables(const CVarPath * const path = NULL);
+
+            std::list<StdString> getDataVariables(bool _is3D       = true,
+                                                  bool _isRecti    = true,
+                                                  bool _isCurvi    = true,
+                                                  bool _isUnstr    = true,
+                                                  bool _isCellData = true,
+                                                  bool _isTemporal = true,
+                                                  const CVarPath * const path = NULL);
+
+            std::list<StdString> getAttributes
+                                (const StdString * const var  = NULL,
+                                 const CVarPath  * const path = NULL);
+
+            std::list<StdString> getDimensionsList
+                                (const StdString * const var  = NULL,
+                                 const CVarPath  * const path = NULL);
+
+            std::list<StdString> getCoordinatesIdList(const StdString & name,
+                                                      const CVarPath  * const path = NULL);
+
+            std::map<StdString, StdSize> getDimensions (const StdString * const var  = NULL,
+                                 			const CVarPath  * const path = NULL);
+
+            StdSize getNbVertex(const StdString & name,
+                                const CVarPath  * const path = NULL);
+         //-------------------------------------------------------------
+
+            template <class T>
+               T getMissingValue(const StdString & name,
+                                 const CVarPath  * const path = NULL);
+
+            template <class T>
+               T getAttributeValue(const StdString & name,
+                                   const StdString * const var  = NULL,
+                                   const CVarPath  * const path = NULL);
+
+            template <class T>
+               void getData(ARRAY(T, 1) data,
+                            const StdString & var,
+                            const CVarPath  * const path = NULL,
+                            StdSize record   = UNLIMITED_DIM);
+
+         //-------------------------------------------------------------
+
+            /// Tests ///
+            bool hasMissingValue(const StdString & name,
+                                 const CVarPath  * const path = NULL);
+
+            bool hasAttribute(const StdString & name,
+                              const StdString * const var  = NULL,
+                              const CVarPath  * const path = NULL);
+
+            bool hasVariable(const StdString & name,
+                             const CVarPath  * const path = NULL);
+
+            bool hasCoordinates(const StdString & name,
+                                const CVarPath  * const path = NULL);
+
+            bool hasTemporalDim(const CVarPath  * const path = NULL);
+
+            bool hasBounds(const StdString & name,
+                           const CVarPath  * const path = NULL);
+
+         //-------------------------------------------------------------
+
+            bool isBound(const StdString & name,
+                         const CVarPath  * const path = NULL);
+            bool isCoordinate(const StdString & name,
+                              const CVarPath  * const path = NULL);
+            bool isRectilinear(const StdString & name,
+                               const CVarPath  * const path = NULL);
+            bool isCurvilinear(const StdString & name,
+                               const CVarPath  * const path = NULL);
+            bool isUnknown(const StdString & name,
+                               const CVarPath  * const path = NULL);
+            bool isUnstructured(const StdString & name,
+                                const CVarPath  * const path = NULL);
+
+            bool isTemporal(const StdString & name,
+                            const CVarPath  * const path = NULL);
+            bool is3Dim(const StdString & name,
+                        const CVarPath  * const path = NULL);
+            bool isCellGrid(const StdString & name,
+                            const CVarPath  * const path = NULL);
+
+         //-------------------------------------------------------------
+
+            /// Destructeur ///
+            virtual ~CINetCDF4(void);
+
+         protected :
+
+         //-------------------------------------------------------------
+
+            /// Accesseurs ///
+            int getGroup   (const CVarPath * const path = NULL);
+            int getVariable(const StdString & varname,
+                            const CVarPath * const path = NULL);
+            int getDimension(const StdString & dimname,
+                             const CVarPath  * const path = NULL);
+            int getUnlimitedDimension(const CVarPath  * const path = NULL);
+            int getAttributeId(const StdString & name,
+                               const StdString * const var  = NULL,
+                               const CVarPath  * const path = NULL);
+
+            std::pair<nc_type , StdSize> getAttribute(const StdString & attname,
+                                                      const StdString * const var  = NULL,
+                                                      const CVarPath  * const path = NULL);
+
+         //-------------------------------------------------------------
+
+            void getDataInfo(const StdString & var, const CVarPath  * const path, StdSize record,
+                             std::vector<StdSize> & start, std::vector<StdSize> & count,
+                             StdSize & array_size);
+
+         private :
+
+            /// VÃ©rification des erreurs NetCDF ///
+            static void CheckError(int status);
+
+            int ncidp; // Identifiant de fichier netcdf.
+
+      }; // class CINetCDF4
+
+      ///--------------------------------------------------------------
+      template <>
+         StdString CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      template <>
+         std::vector<double> CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      template <>
+         std::vector<float> CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      template <>
+         std::vector<int>  CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      template <>
+         std::vector<char>  CINetCDF4::getAttributeValue
+            (const StdString & name, const StdString * const var,
+                                     const CVarPath  * const path);
+
+      //---------------------------------------------------------------
+      template <>
+         int CINetCDF4::getMissingValue
+            (const StdString & name, const CVarPath  * const path);
+
+      template <>
+         double CINetCDF4::getMissingValue
+            (const StdString & name, const CVarPath  * const path);
+
+      template <>
+         float CINetCDF4::getMissingValue
+            (const StdString & name, const CVarPath  * const path);
+
+      //---------------------------------------------------------------
+      template <>
+         void CINetCDF4::getData(ARRAY(int, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record);
+
+      template <>
+         void CINetCDF4::getData(ARRAY(double, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record);
+
+      template <>
+         void CINetCDF4::getData(ARRAY(float, 1) data, const StdString & var,
+                                 const CVarPath  * const path, StdSize record);
+      ///--------------------------------------------------------------
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_INETCDF4__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/input/nc4_data_input.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/input/nc4_data_input.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/input/nc4_data_input.cpp	(revision 152)
@@ -0,0 +1,15 @@
+#include "nc4_data_input.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CNc4DataInput::CNc4DataInput(void)
+      { /* ne rien faire de plus */ }
+
+      CNc4DataInput::~CNc4DataInput(void)
+      { /* ne rien faire de plus */ }
+
+   } // namespace io
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/input/nc4_data_input.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/input/nc4_data_input.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/input/nc4_data_input.hpp	(revision 152)
@@ -0,0 +1,31 @@
+#ifndef __XMLIO_NC4_DATA_INPUT__
+#define __XMLIO_NC4_DATA_INPUT__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "inetcdf4.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CNc4DataInput
+      {
+         public :
+
+            /// Constructeurs ///
+            CNc4DataInput(void);
+            CNc4DataInput(const CNc4DataInput & datainput);       // Not implemented.
+            CNc4DataInput(const CNc4DataInput * const datainput); // Not implemented.
+
+            /// Destructeur ///
+            virtual ~CNc4DataInput(void);
+
+      }; // class CNc4DataInput
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_NC4_DATA_INPUT__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer.cpp	(revision 152)
@@ -0,0 +1,272 @@
+#include "linear_buffer.hpp"
+
+#include "linear_buffer_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CLinearBuffer::CLinearBuffer(char * data, StdSize size)
+         : SuperClass(data, size), p_write(size)
+      { this->computeBufferData(); }
+
+      CLinearBuffer::CLinearBuffer(StdSize size)
+         : SuperClass(size), p_write(0)
+      { /* Ne rien faire de plus */ }
+
+      CLinearBuffer::~CLinearBuffer(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      long int * CLinearBuffer::NULL_ARG = NULL;
+
+      //---------------------------------------------------------------
+
+      void CLinearBuffer::clear(void)
+      { this->bdata.clear(); this->p_write = 0; }
+
+      StdSize CLinearBuffer::getUsedSize(void) const
+      { return (this->p_write); }
+
+      StdSize CLinearBuffer::getUnusedSize(void) const
+      { return (SuperClass::getSize() - this->getUsedSize()); }
+
+      //---------------------------------------------------------------
+
+#define CLinearBufferGetter(type, Type) \
+   type CLinearBuffer::get##Type(StdSize position) const     \
+   {                                                         \
+      if (position >= bdata.size())                          \
+         ERROR("CLinearBuffer::get"#Type"(position)",        \
+               << " invalid position !");                    \
+      return (SuperClass::get##Type(this->bdata[position])); \
+   }
+
+
+      CLinearBufferGetter(char     , Char)
+      CLinearBufferGetter(bool     , Bool)
+      CLinearBufferGetter(float    , Float)
+      CLinearBufferGetter(double   , Double)
+      CLinearBufferGetter(long int , Int)
+
+#undef CLinearBufferGetter
+
+      //---------------------------------------------------------------
+
+#define CLinearBufferArrayGetter(type, Type) \
+   ARRAY(type, 1) CLinearBuffer::get##Type##Array(StdSize position) const \
+   {                                                                      \
+      if (position >= bdata.size())                                       \
+         ERROR("CLinearBuffer::get"#Type"Array(position)",                \
+               << " invalid position !");                                 \
+      return (SuperClass::get##Type##Array(this->bdata[position]));       \
+   }
+
+      CLinearBufferArrayGetter(char     , Char)
+      CLinearBufferArrayGetter(bool     , Bool)
+      CLinearBufferArrayGetter(float    , Float)
+      CLinearBufferArrayGetter(double   , Double)
+      CLinearBufferArrayGetter(long int , Int)
+
+#undef CLinearBufferArrayGetter
+
+      StdString CLinearBuffer::getString(StdSize position) const
+      { return (SuperClass::getString(this->bdata[position])); }
+
+      //---------------------------------------------------------------
+
+#define CLinearBufferSetter(type, Type)                        \
+      void  CLinearBuffer::append##Type(type value)            \
+      {                                                        \
+         this->bdata.push_back(this->p_write);                 \
+         SuperClass::set##Type(value, this->p_write);          \
+         this->p_write += SuperClass::getRequestedSize(value); \
+      }
+
+      CLinearBufferSetter(char     , Char)
+      CLinearBufferSetter(bool     , Bool)
+      CLinearBufferSetter(float    , Float)
+      CLinearBufferSetter(double   , Double)
+      CLinearBufferSetter(long int , Int)
+
+#undef CLinearBufferSetter
+
+      //---------------------------------------------------------------
+
+#define CLinearBufferArraySetter(type, Type) \
+      void  CLinearBuffer::append##Type##Array(ARRAY(type, 1) value) \
+      {                                                              \
+         this->bdata.push_back(this->p_write);                       \
+         SuperClass::set##Type##Array(value, this->p_write);         \
+         this->p_write += SuperClass::getRequestedSize(value);       \
+      }
+
+      CLinearBufferArraySetter(char     , Char)
+      CLinearBufferArraySetter(bool     , Bool)
+      CLinearBufferArraySetter(float    , Float)
+      CLinearBufferArraySetter(double   , Double)
+      CLinearBufferArraySetter(long int , Int)
+
+#undef CLinearBufferArrayAppend
+
+      void CLinearBuffer::appendString(const StdString & value)
+      {
+         ARRAY_CREATE(arr, char, 1, [value.size()]);
+         std::copy(value.data(), &(value.data()[value.size()]), arr->data());
+         this->appendCharArray(arr);
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CLinearBuffer::getNumberOfStoredData(void) const
+      { return (this->bdata.size()); }
+
+      std::vector<StdSize> CLinearBuffer::getPositionsOfStoredData(void) const
+      {
+         std::vector<StdSize> retvalue;
+         std::vector<StdSize>::const_iterator it = this->bdata.begin(), end = this->bdata.end();
+         for (;it != end; it++)
+         {
+            StdSize pos = *it;
+            CBufferData bufdata;
+            SuperClass::getBufferData(bufdata, pos);
+            retvalue.push_back(bufdata.position);
+         }
+
+         return (retvalue);
+      }
+
+      std::vector<StdSize> CLinearBuffer::getSizesOfStoredData(void) const
+      {
+         std::vector<StdSize> retvalue;
+         std::vector<StdSize>::const_iterator it = this->bdata.begin(), end = this->bdata.end();
+         for (;it != end; it++)
+         {
+            StdSize pos = *it;
+            CBufferData bufdata;
+            SuperClass::getBufferData(bufdata, pos);
+            retvalue.push_back(bufdata.size);
+         }
+         return (retvalue);
+      }
+
+      std::vector<std::pair<CBuffer::CBufferDataType, bool> >
+         CLinearBuffer::getTypesOfStoredData(void) const
+      {
+         std::vector<std::pair<CBufferDataType, bool> > retvalue;
+         std::vector<StdSize>::const_iterator it = this->bdata.begin(), end = this->bdata.end();
+         for (;it != end; it++)
+         {
+            StdSize pos = *it;
+            CBufferData bufdata;
+            SuperClass::getBufferData(bufdata, pos);
+            retvalue.push_back(std::make_pair(bufdata.type, bufdata.isArray));
+         }
+
+         return (retvalue);
+      }
+
+      //---------------------------------------------------------------
+
+      void CLinearBuffer::computeBufferData(void)
+      {
+
+         CBufferData bufdata; this->clear();
+         StdSize total_size = SuperClass::getSize();
+         int i = 0;
+         while ((1000 >= i++) && (p_write != total_size))
+         {
+            bdata.push_back(this->p_write);
+            SuperClass::getBufferData(bufdata, this->p_write);
+            this->p_write = (bufdata.size + bufdata.position);
+         }
+      }
+
+      //---------------------------------------------------------------
+
+      void CLinearBuffer::appendRequestInfos(const long int & managerId,
+                                             const long int & methodId,
+                                             const long int & nbargs)
+      {
+         this->appendInt(managerId);
+         this->appendInt(methodId);
+         this->appendInt(nbargs);
+      }
+
+      void CLinearBuffer::getRequestInfos(StdSize position,
+                           long int & managerId, long int & methodId, long int & nbargs)
+      {
+         managerId = this->getInt(position);
+         methodId  = this->getInt(position+1);
+         nbargs    = this->getInt(position+2);
+      }
+
+
+      //---------------------------------------------------------------
+
+      void CLinearBuffer::printToTextFile (const StdString & filename)
+      {
+         StdOFStream ofs(filename.c_str());
+         this->printToTextStream(ofs);
+         ofs.close();
+      }
+
+      void CLinearBuffer::printToTextStream (StdOStream & ostr)
+      { // A amÃ©liorer ....
+         StdSize position = 0;
+         typedef std::pair<CBufferDataType, bool> pairBufBool;
+         std::vector<pairBufBool> vect = this->getTypesOfStoredData();
+         ostr << "|";
+         
+         std::vector<pairBufBool>::const_iterator it = vect.begin(), end = vect.end();
+         for (;it != end; it++)
+         {
+            pairBufBool elm = *it;
+            ostr << "|";
+            if (!elm.second)
+            {
+               switch (elm.first)
+               {
+                  case (TBOOL8):    ostr << this->getBool(position);
+                     break;
+                  case (TINT32):    ostr << this->getInt(position);
+                     break;
+                  case (TCHAR8):    ostr << this->getChar(position);
+                     break;
+                  case (TFLOAT32):  ostr << this->getFloat(position);
+                     break;
+                  case (TDOUBLE64): ostr << this->getDouble(position);
+                     break;
+                  default :
+                     return;
+               }
+            }
+            else
+            {
+               switch (elm.first)
+               {
+                  case (TBOOL8):    ostr << this->getBoolArray(position);
+                     break;
+                  case (TINT32):    ostr << this->getIntArray(position);
+                     break;
+                  case (TCHAR8):    ostr << this->getCharArray(position);
+                     break;
+                  case (TFLOAT32):  ostr << this->getFloatArray(position);
+                     break;
+                  case (TDOUBLE64): ostr << this->getDoubleArray(position);
+                     break;
+                  default :
+                     return;
+               }
+            }
+            position++;
+         }
+      }
+
+      ///--------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer.hpp	(revision 152)
@@ -0,0 +1,133 @@
+#ifndef __XMLIO_CLinearBuffer__
+#define __XMLIO_CLinearBuffer__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "buffer.hpp"
+
+#define _NULL_ARG xmlioserver::comm::CLinearBuffer::NULL_ARG
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CLinearBuffer
+         : public CBuffer
+      {
+            /// DÃ©finition de type ///
+            typedef CBuffer SuperClass;
+
+         public /* static */ :
+
+            static long int * NULL_ARG;
+            friend class CMPIManager;
+
+         public :
+
+            /// Construteurs ///
+
+            explicit CLinearBuffer(StdSize size);
+            CLinearBuffer(char * data, StdSize size);
+            CLinearBuffer(const CLinearBuffer & lbuffer);         // Not implemented yet.
+            CLinearBuffer(const CLinearBuffer * const lbuffer);   // Not implemented yet.
+
+            /// Accesseurs ///
+            StdSize getUsedSize(void) const;
+            StdSize getUnusedSize(void) const;
+
+            StdSize getNumberOfStoredData(void) const;
+            std::vector<StdSize> getPositionsOfStoredData(void) const;
+            std::vector<StdSize> getSizesOfStoredData(void) const;
+            std::vector<std::pair<CBufferDataType, bool> > getTypesOfStoredData(void) const;
+
+         //--------------------------------------------------------------
+            char     getChar  (StdSize position) const;
+            bool     getBool  (StdSize position) const;
+            float    getFloat (StdSize position) const;
+            double   getDouble(StdSize position) const;
+            long int getInt   (StdSize position) const;
+
+            StdString getString(StdSize position) const;
+
+            ARRAY(char,     1) getCharArray  (StdSize position) const;
+            ARRAY(bool,     1) getBoolArray  (StdSize position) const;
+            ARRAY(float,    1) getFloatArray (StdSize position) const;
+            ARRAY(double,   1) getDoubleArray(StdSize position) const;
+            ARRAY(long int, 1) getIntArray   (StdSize position) const;
+
+         //--------------------------------------------------------------
+
+            void getRequestInfos(StdSize position,
+                     long int & managerId, long int & methodId, long int & nbargs);
+
+         //--------------------------------------------------------------
+            /// 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 StdString & value) ;
+
+            void appendCharArray  (ARRAY(char,     1) value) ;
+            void appendBoolArray  (ARRAY(bool,     1) value) ;
+            void appendFloatArray (ARRAY(float,    1) value) ;
+            void appendDoubleArray(ARRAY(double,   1) value) ;
+            void appendIntArray   (ARRAY(long int, 1) value) ;
+
+         //--------------------------------------------------------------
+
+            void appendRequestInfos(const long int & managerId,
+                                    const long int & methodId,
+                                    const long int & nbargs);
+
+         //--------------------------------------------------------------
+            virtual void clear(void);
+
+            /// Test ///
+            template <typename A1, typename A2, typename A3, typename A4>
+               inline StdSize getRequestedSize(A1 * arg1 = NULL_ARG,
+                                               A2 * arg2 = NULL_ARG,
+                                               A3 * arg3 = NULL_ARG,
+                                               A4 * arg4 = NULL_ARG) const;
+
+            /// Sortie fichier ascii ///
+            virtual void printToTextFile (const StdString & filename);
+            virtual void printToTextStream (StdOStream & ostr);
+
+            /// Destructeur ///
+            virtual ~CLinearBuffer(void);
+
+         protected :
+
+            /// Accesseurs protÃ©gÃ©s ///
+            template <class T>
+               inline void getLData(T & data, StdSize position) const;
+            template <class T>
+               inline void getLDataArray(ARRAY(T, 1) data, StdSize position) const;
+
+            /// Mutateurs protÃ©gÃ©s ///
+            template <class T>
+               inline void appendLData(const T & data);
+            template <class T>
+               inline void appendLDataArray(ARRAY(T, 1) data);
+
+         private :
+
+            /// Traitement ///
+            void computeBufferData(void);
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            std::vector<StdSize> bdata;
+            StdSize p_write;
+
+      }; // class CLinearBuffer
+
+      ///----------------------------------------------------------------
+
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CLinearBuffer__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer_impl.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer_impl.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/linear_buffer_impl.hpp	(revision 152)
@@ -0,0 +1,69 @@
+#ifndef __XMLIO_CLinearBuffer_impl__
+#define __XMLIO_CLinearBuffer_impl__
+
+#include "buffer_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////// DÃ©finitions (inline) /////////////////// ///
+
+      template <class T>
+         void CLinearBuffer::getLData(T & data, StdSize position) const
+      {
+         if (position >= bdata.size())
+            ERROR("CLinearBuffer::getData(position)",
+                  << " invalid position !");
+         SuperClass::getData(data, this->bdata[position]);
+      }
+
+      template <class T>
+          void CLinearBuffer::getLDataArray(ARRAY(T, 1) data, StdSize position) const
+      {
+         if (position >= bdata.size())
+            ERROR("CLinearBuffer::getDataArray(position)",
+                  << " invalid position !");
+         SuperClass::getDataArray(data, this->bdata[position]);
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         void CLinearBuffer::appendLData(const T & data)
+      {
+         this->bdata.push_back(this->p_write);
+         SuperClass::setData(data, this->p_write);
+         this->p_write += SuperClass::getRequestedSize(data);
+      }
+
+      template <class T>
+         void CLinearBuffer::appendLDataArray(ARRAY(T, 1) data)
+      {
+         this->bdata.push_back(this->p_write);
+         SuperClass::setDataArray(data, this->p_write);
+         this->p_write += SuperClass::getRequestedSize(data);
+      }
+      //---------------------------------------------------------------
+
+      template <typename A1, typename A2, typename A3, typename A4>
+         StdSize CLinearBuffer::getRequestedSize
+          ( A1 * arg1, A2 * arg2, A3 * arg3, A4 * arg4) const
+      {
+         StdSize retvalue = 0;
+         long int nbarg   = 0;
+         retvalue += 3 * SuperClass::getRequestedSize(nbarg);
+
+         if (arg1 != NULL) retvalue += SuperClass::getRequestedSize(*arg1);
+         if (arg2 != NULL) retvalue += SuperClass::getRequestedSize(*arg2);
+         if (arg3 != NULL) retvalue += SuperClass::getRequestedSize(*arg3);
+         if (arg4 != NULL) retvalue += SuperClass::getRequestedSize(*arg4);
+         return (retvalue);
+      }
+
+      ///----------------------------------------------------------------
+
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CLinearBuffer_impl__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/main_server.cpp	(revision 152)
@@ -0,0 +1,37 @@
+// XmlIOServer
+#include "xmlioserver.hpp"
+
+#include "fake_client/fake.hpp"
+#include "attribute_template_impl.hpp"
+#include "output/nc4_data_output.hpp"
+
+// Point d'entrÃ©e du programme principal
+int main(int argc, char ** argv, char ** UNUSED(env))
+{
+   try
+   {
+      comm::CMPIManager::Initialise(&argc, &argv); // < seulement en mode connectÃ©
+      CXIOSManager::Initialise(CXIOSManager::CLIENT, &argc, &argv);
+      CXIOSManager::AddClient("nemo",
+                              CMPIManager::GetCommSize(CMPIManager::GetCommWorld()),
+                              CMPIManager::GetCommSize(CMPIManager::GetCommWorld()),
+                              &nemo_fake_entry);
+      CXIOSManager::RunClient();
+      CXIOSManager::Finalize();
+
+      comm::CMPIManager::Finalize(); // < seulement en mode connectÃ©
+
+      //CXIOSManager::AddClient("orchidee", 1, 1, &orchidee_fake_entry);
+      //CXIOSManager::AddClient("lmdz"    , 2, 2, &lmdz_fake_entry);
+      //CXIOSManager::RunClientServer();
+
+   }
+   catch (CException & exc)
+   {
+      std::cerr << exc.getMessage() << std::endl;
+      CMPIManager::Finalize();
+      return (EXIT_FAILURE);
+   }
+   return (EXIT_SUCCESS);
+}
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/manager/mpi_manager.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/manager/mpi_manager.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/manager/mpi_manager.cpp	(revision 152)
@@ -0,0 +1,240 @@
+#include "mpi_manager.hpp"
+
+#include "fortran/impi_interface.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      void CMPIManager::Initialise(int * UNUSED(argc), char *** UNUSED(argv))
+      {
+         int error = 0;
+         bool flag = false;
+
+         mpi_initialized(&flag, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::Initialise(arc, argv)", << " MPI Error !");
+         if (!flag)
+         {
+            mpi_init(&error);
+            if (error != mpi_success)
+               ERROR("CMPIManager::Initialise(arc, argv)", << " MPI Error !");
+         }
+      }
+
+      void CMPIManager::Finalize(void)
+      {
+         int error = 0;
+         mpi_finalize(&error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::Initialise(arc, argv)", << " MPI Error !");
+      }
+
+      ///--------------------------------------------------------------
+
+      int CMPIManager::GetCommRank(MPIComm comm)
+      {
+         int rank = 0, error = 0;
+         mpi_comm_rank(&comm, &rank, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::GetCommRank(comm)", << " MPI Error !");
+         return (rank);
+      }
+
+      int CMPIManager::GetCommSize(MPIComm comm)
+      {
+         int size = 0, error = 0;
+         mpi_comm_size(&comm, &size, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::GetCommSize(comm)", << " MPI Error !");
+         return (size);
+      }
+
+      MPIComm CMPIManager::GetCommWorld(void)
+      { return (mpi_comm_world); }
+
+      bool CMPIManager::IsMaster(MPIComm comm)
+      { return (CMPIManager::GetCommRank(comm) == 0); }
+
+      bool CMPIManager::IsRank(MPIComm comm, int rank)
+      { return (CMPIManager::GetCommRank(comm) == rank); }
+
+      MPIComm CMPIManager::CreateComm(MPIGroup group, MPIComm pcomm)
+      {
+         MPIComm  commu = 0;
+         int error = 0;
+         mpi_comm_create(&pcomm, &group, &commu, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::CreateComm(group, pcomm)", << " MPI Error !");
+         return (commu);
+      }
+
+      //---------------------------------------------------------------
+
+      void CMPIManager::Barrier(MPIComm comm)
+      {
+         int error = 0;
+         mpi_barrier(&comm, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::Barrier(comm)", << " MPI Error !");
+      }
+
+      //---------------------------------------------------------------
+
+      MPIGroup CMPIManager::GetGroupWorld(void)
+      {
+         MPIGroup group = 0;
+         int error = 0;
+         MPIComm  commu = CMPIManager::GetCommWorld();
+         mpi_comm_group(&commu, &group, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::GetGroupWorld()", << " MPI Error !");
+         return (group);
+      }
+
+      MPIGroup CMPIManager::CreateSubGroup(MPIGroup pgroup, const std::vector<int> & ranks)
+      {
+         MPIGroup group = 0;
+         int size = ranks.size();
+         int error = 0;
+         mpi_group_incl(&pgroup, &size, &(ranks[0]), &group, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::CreateSubGroup(pgroup, ranks)", << " MPI Error !");
+         return (group);
+      }
+
+      MPIGroup CMPIManager::CreateSubGroup(MPIGroup pgroup, int min_rank, int max_rank, int intval)
+      {
+         std::vector<int> ranks;
+         for (int i = min_rank; i <= max_rank; i += intval)
+            ranks.push_back(i);
+         return (CMPIManager::CreateSubGroup(pgroup, ranks));
+      }
+
+      //---------------------------------------------------------------
+
+      void CMPIManager::AllocMem(void * data, StdSize size)
+      {
+         if (MPI_Alloc_mem(sizeof(char) * size, MPI_INFO_NULL, data) != MPI_SUCCESS)
+            ERROR("CMPIManager::AllocMem(data, size)", << " MPI Error !");
+      }
+
+      void CMPIManager::FreeMem(void * data)
+      { MPI_Free_mem(data); }
+
+      //--------------------------------------------------------------
+
+      void CMPIManager::Send (MPIComm comm, int dest_rank, char * data,
+                              StdSize size, MPIRequest & request)
+      {
+         MPIDataType type = mpi_char;
+         int nsize = size;
+         int tag = 0, error = 0;
+         mpi_issend(data, &nsize, &type, &dest_rank, &tag, &comm, &request, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::Send (comm, dest_rank, data, size, request)", << " MPI Error !");
+      }
+
+      void CMPIManager::Wait (MPIRequest & request)
+      {
+         MPIStatus status = new int[mpi_status_size]();
+         int error = 0;
+         mpi_wait(&request, status, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::Wait (request)", << " MPI Error !");
+         delete [] status;
+      }
+
+      bool CMPIManager::Test (MPIRequest & request)
+      {
+         MPIStatus status = new int[mpi_status_size]();
+         bool flag = false;
+         int error = 0;
+         mpi_test(&request, &flag, status, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::Test (request)", << " MPI Error !");
+         delete [] status;
+         return (flag);
+      }
+
+      bool CMPIManager::HasReceivedData(MPIComm comm, int src_rank)
+      {
+         MPIStatus status = new int[mpi_status_size]();
+         bool flag = false;
+         int error = 0, tag = mpi_any_tag;
+         mpi_iprobe(&src_rank, &tag, &comm, &flag, status, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::hasReceivedData (comm, rank)", << " MPI Error !");
+         delete [] status;
+         return (flag);
+      }
+
+      StdSize CMPIManager::GetReceivedDataSize(MPIComm comm, int src_rank)
+      {
+         MPIDataType type = mpi_char;
+         MPIStatus status = new int[mpi_status_size]();
+         bool flag = false;
+         int error = 0, size = 0, tag = mpi_any_tag;
+
+         mpi_iprobe(&src_rank, &tag, &comm, &flag, status, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::getReceivedDataSize (comm, rank)", << " MPI Error !");
+         if (flag == false) return (0);
+         mpi_get_count(status, &type, &size, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::getReceivedDataSize (comm, rank)", << " MPI Error !");
+         delete [] status;
+         return (size);
+      }
+
+      void CMPIManager::Receive(MPIComm comm, int src_rank, char * data)
+      {
+         MPIRequest req = 0;
+         MPIDataType type = mpi_char;
+         int error = 0, tag = mpi_any_tag;
+         int size = CMPIManager::GetReceivedDataSize(comm, src_rank);
+
+         mpi_irecv(data, &size, &type, &src_rank, &tag, &comm, &req, &error);
+         if (error != mpi_success)
+            ERROR("CMPIManager::Receive (comm, src_rank, data)", << " MPI Error !");
+         CMPIManager::Wait (req);
+      }
+
+      //--------------------------------------------------------------
+
+      void CMPIManager::SendLinearBuffer
+         (MPIComm comm, int dest_rank, CLinearBuffer & buff, MPIRequest & request)
+      {
+         CMPIManager::Send(comm, dest_rank, buff, buff.getUsedSize(), request);
+         buff.clear();
+      }
+
+      void CMPIManager::ReceiveLinearBuffer(MPIComm comm, int src_rank, CLinearBuffer & buff)
+      {
+         CMPIManager::Receive(comm, src_rank, buff);
+         buff.computeBufferData();
+      }
+
+      boost::shared_ptr<CLinearBuffer> CMPIManager::ReceiveLinearBuffer(MPIComm comm, int src_rank)
+      {
+         boost::shared_ptr<CLinearBuffer> buff_ptr
+            (new CLinearBuffer(CMPIManager::GetReceivedDataSize(comm, src_rank)));
+         CMPIManager::ReceiveLinearBuffer(comm, src_rank, *buff_ptr);
+         return (buff_ptr);
+      }
+
+      void CMPIManager::ReceiveCircularBuffer(MPIComm comm, int src_rank, CCircularBuffer & buff)
+      {
+         StdSize data_size  = CMPIManager::GetReceivedDataSize(comm, src_rank);
+         StdSize data_begin = buff.prepareNextDataPosition(data_size);
+         CMPIManager::Receive(comm, src_rank, buff.getData(data_begin));
+
+         buff.updateNbRequests(data_begin, data_begin + data_size);
+      }
+
+      ///--------------------------------------------------------------
+
+   } // namespace comm
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/manager/mpi_manager.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/manager/mpi_manager.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/manager/mpi_manager.hpp	(revision 152)
@@ -0,0 +1,76 @@
+#ifndef __XMLIO_CMPIManager__
+#define __XMLIO_CMPIManager__
+
+/// MPI headers ///
+#include <mpi.h>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "buffer.hpp"
+#include "circular_buffer.hpp"
+#include "linear_buffer.hpp"
+
+namespace xmlioserver
+{
+   namespace comm
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      typedef MPI_Fint     MPIComm;
+      typedef MPI_Fint    MPIGroup;
+      typedef MPI_Fint  MPIRequest;
+      typedef MPI_Fint  *MPIStatus;
+      typedef MPI_Fint MPIDataType;
+
+      class CMPIManager
+      {
+         public :
+
+            /// Initialisation & Finalisation ///
+            static void Initialise(int * argc, char *** argv);
+            static void Finalize(void);
+
+            /// Communicateurs ///
+            static int GetCommRank(MPIComm comm = CMPIManager::GetCommWorld());
+            static int GetCommSize(MPIComm comm = CMPIManager::GetCommWorld());
+            static MPIComm CreateComm(MPIGroup group, MPIComm pcomm = CMPIManager::GetCommWorld());
+            static MPIComm GetCommWorld(void);
+
+            /// Autre ///
+            static void Barrier(MPIComm comm = CMPIManager::GetCommWorld());
+
+            /// Groupes ///
+            static MPIGroup GetGroupWorld(void);
+            static MPIGroup CreateSubGroup(MPIGroup pgroup, const std::vector<int> & ranks);
+            static MPIGroup CreateSubGroup(MPIGroup pgroup, int min_rank, int max_rank, int intval = 1);
+
+            /// Tests ///
+            static bool IsMaster(MPIComm comm = CMPIManager::GetCommWorld());
+            static bool IsRank(MPIComm comm, int rank);
+
+            /// Communication simple///
+            static void Send (MPIComm comm, int dest_rank, char * data, StdSize size, MPIRequest & request);
+            static void Wait (MPIRequest & request);
+            static bool Test (MPIRequest & request);
+
+            static bool HasReceivedData(MPIComm comm, int src_rank);
+            static StdSize GetReceivedDataSize(MPIComm comm, int src_rank);
+            static void Receive(MPIComm comm, int src_rank, char * data);
+
+            /// Communication 'complexe' ///
+            static void SendLinearBuffer(MPIComm comm, int dest_rank, CLinearBuffer & buff, MPIRequest & request);
+            static void ReceiveLinearBuffer(MPIComm comm, int src_rank, CLinearBuffer & buff);
+            static boost::shared_ptr<CLinearBuffer> ReceiveLinearBuffer(MPIComm comm, int src_rank);
+            static void ReceiveCircularBuffer(MPIComm comm, int src_rank, CCircularBuffer & buff);
+
+            /// MÃ©moire (non fonctionnel ....)///
+            static void AllocMem(void * data, StdSize size);
+            static void FreeMem(void * data);
+
+      }; // class CMPIManager
+
+   } // namespace comm
+} // namespace xmlioserver
+
+#endif // __XMLIO_CMPIManager__
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.cpp	(revision 152)
@@ -0,0 +1,72 @@
+#include "tree_manager.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      void CTreeManager::SetCurrentContextId(const StdString & id)
+      {
+         CObjectFactory::SetCurrentContextId(id);
+         CGroupFactory::SetCurrentContextId(id);
+      }
+
+      boost::shared_ptr<CContext> CTreeManager::CreateContext(const StdString & id)
+      {
+         boost::shared_ptr<CContextGroup> group_context =
+                           CContext::GetContextGroup();
+         CTreeManager::SetCurrentContextId(id);
+         boost::shared_ptr<tree::CContext> context =
+               CObjectFactory::CreateObject<tree::CContext>(id);
+         CGroupFactory::AddChild(group_context, context);
+
+#define DECLARE_NODE(Name_, name_) \
+   CObjectFactory::CreateObject<C##Name_##Definition>(C##Name_##Definition::GetDefName());
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "../config/node_type.conf"
+
+         return (context);
+   }
+
+      //--------------------------------------------------------------
+      void CTreeManager::PrintTreeToFile(const StdString & path)
+      {
+         StdOFStream ofs(path.c_str());
+         CTreeManager::PrintTreeToStream(ofs);
+         ofs.close();
+      }
+
+      void CTreeManager::PrintTreeToString(StdString & content)
+      {
+         StdOStringStream ostrstream;
+         tree::CContext::ShowTree(ostrstream);
+         content.assign(CIndentedXml::Indented(ostrstream.str()));
+      }
+
+      void CTreeManager::PrintTreeToStream(StdOStream & out)
+      {
+         StdOStringStream ostrstream;
+         tree::CContext::ShowTree(ostrstream);
+         out << CIndentedXml::Indented(ostrstream.str());
+      }
+
+      //--------------------------------------------------------------
+
+      void CTreeManager::ParseFile(const StdString & filename)
+      { xml::CXMLParser::ParseFile(filename); }
+
+      void CTreeManager::ParseString(const StdString & xmlContent)
+      { xml::CXMLParser::ParseString(xmlContent); }
+
+      void CTreeManager::ParseStream(StdIStream & stream)
+      { xml::CXMLParser::ParseStream(stream); }
+
+      ///-------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.hpp	(revision 152)
@@ -0,0 +1,42 @@
+#ifndef __XMLIO_CTreeManager__
+#define __XMLIO_CTreeManager__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "node/node_type.hpp"
+#include "xml_parser.hpp"
+#include "indent.hpp"
+
+#undef  DECLARE_ATTRIBUTE
+#define DECLARE_ATTRIBUTE(type, name)  , type * name = NULL
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CTreeManager
+      {
+         public :
+
+            /// Mutateurs ///
+            static void SetCurrentContextId(const StdString & id);
+            static boost::shared_ptr<CContext> CreateContext(const StdString & id = StdString(""));
+
+            /// Sortie ///
+            static void PrintTreeToFile(const StdString & path);
+            static void PrintTreeToString(StdString & content);
+            static void PrintTreeToStream(StdOStream & out);
+
+            /// Parsing ///
+            static void ParseFile  (const StdString & filename);
+            static void ParseString(const StdString & xmlContent);
+            static void ParseStream(StdIStream & stream);
+
+      }; // class CTreeManager
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CTreeManager__
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.cpp	(revision 152)
@@ -0,0 +1,232 @@
+#include "xios_manager.hpp"
+
+namespace xmlioserver
+{
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      void CXIOSManager::Initialise(XIOSType type, int * argc, char *** argv)
+      {
+         CXIOSManager::Type = type;
+         if (type != CLIENT)
+         {
+            // Initialisation de la biliothÃšque MPI si nÃ©cessaire
+            comm::CMPIManager::Initialise(argc, argv);
+            ExeName = StdString((*argv)[0]);
+            for (int i = 1; i < *argc; i++)
+               ExeOptions.push_back(StdString((*argv)[i]));
+         }
+      }
+
+      void CXIOSManager::Finalize(void)
+      {
+         if (CXIOSManager::Type != CLIENT)
+         {
+            // Finalisation de la biliothÃšque MPI si nÃ©cessaire
+            comm::CMPIManager::Finalize();
+         }
+      }
+
+      ///-------------------------------------------------------------
+
+      StdString CXIOSManager::ExeName("unknown");
+      std::vector<StdString> CXIOSManager::ExeOptions;
+
+      CXIOSManager::XIOSType CXIOSManager::Type = CLIENT;
+
+      StdString     CXIOSManager::ClientName;
+      comm::MPIComm CXIOSManager::Comm_Client_Server;
+      comm::MPIComm CXIOSManager::Comm_Server;
+
+      xios_map<StdString, CXIOSManager::XIOSClient> CXIOSManager::Clients;
+
+      ///--------------------------------------------------------------
+
+      void CXIOSManager::RunClientServer(comm::MPIComm comm_client_server)
+      {
+         using namespace comm;
+         typedef std::pair<StdString, XIOSClient> StdPairStrClient;
+
+         MPIComm  world_comm  = CMPIManager::GetCommWorld();
+         MPIGroup world_group = CMPIManager::GetGroupWorld();
+
+         if (CMPIManager::IsMaster(comm_client_server))
+         {
+            std::cout << " *************************************** " << std::endl
+                      << " *     XmlIOServer (Client/Server)     * " << std::endl
+                      << " *************************************** " << std::endl;
+            std::cout << " > Nombre de processus : "
+                      << CMPIManager::GetCommSize(comm_client_server) << std::endl;
+            std::cout << " > Nombre de processus utilisÃ©s : "
+                      << (CXIOSManager::GetNbClient() + CXIOSManager::GetNbServer()) << std::endl;
+            std::cout << " > Nombre de clients : "
+                      << CXIOSManager::GetNbClient() << std::endl;
+            std::cout << " > Nombre de serveurs : "
+                      << CXIOSManager::GetNbServer() << std::endl;
+
+            xios_map<StdString, XIOSClient>::iterator
+               iit  = CXIOSManager::Clients.begin(),
+               eend = CXIOSManager::Clients.end();
+
+            for (;iit != eend; iit++)
+            {
+               const StdPairStrClient & elem = *iit;
+               std::cout << " - " << elem.first
+                         << " > nombre de clients : "             << elem.second.nbClient
+                         << " , nombre de clients par serveur : " << elem.second.nbClientPServer
+                         << " , nombre de serveurs : "            << elem.second.nbClient/elem.second.nbClientPServer
+                         << std::endl;
+            }
+
+            std::cout << " *************************************** " << std::endl;
+         }
+
+         comm::CMPIManager::Barrier();
+         StdSize start = 0, end   = 0;
+         
+         xios_map<StdString, XIOSClient>::iterator
+            iit  = CXIOSManager::Clients.begin(),
+            eend = CXIOSManager::Clients.end();
+
+         for (;iit != eend; iit++)
+         {
+            const StdPairStrClient & elem = *iit;
+            MPIComm comm_client = 0, comm_client_grp = 0; comm_client_server = 0;
+
+            int       currentRank     = CMPIManager::GetCommRank();
+            StdString clientName      = elem.first;
+            StdSize   nbClient        = elem.second.nbClient;
+            StdSize   nbClientPServer = elem.second.nbClientPServer;
+            StdSize   nbServer        = elem.second.nbClient/elem.second.nbClientPServer;
+            StdSize   totalproc       = nbClient + nbServer;
+
+            for (StdSize i = 0; i<nbServer; i++)
+            {
+               end = start + nbClientPServer;
+               // Pas encore implÃ©mentÃ© (interface de gestion de groupe/communicateur buggÃ©e)
+               start = start + nbClientPServer + 1;
+            }
+         }
+      }
+
+      void CXIOSManager::RunClient(comm::MPIComm comm_client)
+      {
+         (CXIOSManager::Clients.begin()->second.entry)(comm_client, comm_client, comm_client);
+      }
+
+      //---------------------------------------------------------------
+
+      void CXIOSManager::AddClient(StdString clientName, StdSize nbClient, StdSize nbClientPServer,
+                                   void (*entry_point)(comm::MPIComm, comm::MPIComm, comm::MPIComm))
+      {
+         StdSize nbprocess  = comm::CMPIManager::GetCommSize(comm::CMPIManager::GetCommWorld());
+         StdSize nbprocess_used = CXIOSManager::GetNbClient() + CXIOSManager::GetNbServer();
+
+         if (nbClient < nbClientPServer)
+            ERROR("CXIOSManager::AddClient(clientName, nbClient, nbClientPServer, entry_point)",
+                  << "nbClient < nbClientPServer");
+         if ((nbClient % nbClientPServer) != 0)
+            ERROR("CXIOSManager::AddClient(clientName, nbClient, nbClientPServer, entry_point)",
+                  << " (nbClient % nbClientPServer) != 0 !");
+         if ((nbprocess-nbprocess_used) < (nbClient + nbClient/nbClientPServer))
+            ERROR("CXIOSManager::AddClient(clientName, nbClient, nbClientPServer, entry_point)",
+                  << " Pas assez de processus disponibles !");
+         if (CXIOSManager::Clients.find(clientName) != CXIOSManager::Clients.end())
+            ERROR("CXIOSManager::AddClient(clientName, nbClient, nbClientPServer, entry_point)",
+                  << " Un client portant le mÃªme nom existe dÃ©jÃ  !");
+
+         XIOSClient client = {nbClient, nbClientPServer, entry_point };
+         CXIOSManager::Clients[clientName] = client;
+      }
+
+      //---------------------------------------------------------------
+
+      StdSize CXIOSManager::GetNbClient(void)
+      {
+         switch (CXIOSManager::Type)
+         {
+            case (CLIENT_SERVER):
+            {
+               StdSize retvalue = 0;
+               typedef std::pair<StdString, XIOSClient> StdPairStrClient;
+               xios_map<StdString, XIOSClient>::iterator
+                  iit  = CXIOSManager::Clients.begin(),
+                  eend = CXIOSManager::Clients.end();
+
+               for (;iit != eend; iit++)
+               {
+                  const StdPairStrClient & elem = *iit;
+                  retvalue += CXIOSManager::GetNbLocClient(elem.first);
+               }
+               
+               return (retvalue);
+            }
+            case (CLIENT):
+               return (comm::CMPIManager::GetCommSize(CXIOSManager::Comm_Server));
+            case (SERVER):
+               return (comm::CMPIManager::GetCommSize(CXIOSManager::Comm_Client_Server) - 1);
+            default:
+               return (0);
+         }
+      }
+
+      StdSize CXIOSManager::GetNbLocClient(const StdString & clientName)
+      {
+         switch (CXIOSManager::Type)
+         {
+            case (CLIENT_SERVER):
+               return (CXIOSManager::Clients[clientName].nbClient);
+            case (CLIENT):
+            case (SERVER):
+               return (CXIOSManager::GetNbClient());
+            default:
+               return (0);
+         }
+      }
+
+      StdSize CXIOSManager::GetNbServer(void)
+      {
+         switch (CXIOSManager::Type)
+         {
+            case (CLIENT_SERVER):
+            {
+               StdSize retvalue = 0;
+               typedef std::pair<StdString, XIOSClient> StdPairStrClient;              
+
+               xios_map<StdString, XIOSClient>::iterator
+                  iit  = CXIOSManager::Clients.begin(),
+                  eend = CXIOSManager::Clients.end();
+
+               for (;iit != eend; iit++)
+               {
+                  const StdPairStrClient & elem = *iit;
+                  retvalue += CXIOSManager::GetNbLocServer(elem.first);
+               }                  
+                  
+               return (retvalue);
+            }
+            case (CLIENT):
+               return (comm::CMPIManager::GetCommSize(CXIOSManager::Comm_Server));
+            case (SERVER):
+               return (1);
+            default:
+               return (0);
+         }
+      }
+
+      StdSize CXIOSManager::GetNbLocServer(const StdString & clientName)
+      {
+         switch (CXIOSManager::Type)
+         {
+            case (CLIENT_SERVER):
+               return (CXIOSManager::Clients[clientName].nbClient /
+                       CXIOSManager::Clients[clientName].nbClientPServer);
+            case (CLIENT):
+            case (SERVER):
+               return (CXIOSManager::GetNbServer());
+            default:
+               return (0);
+         }
+      }
+
+      ///--------------------------------------------------------------
+
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/manager/xios_manager.hpp	(revision 152)
@@ -0,0 +1,69 @@
+#ifndef __XMLIO_CXMLIOManager__
+#define __XMLIO_CXMLIOManager__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "mpi_manager.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CXIOSManager
+   {
+      public :
+
+         /// DÃ©finition de type ///
+         typedef enum _xios_type
+         { CLIENT_SERVER = 0 , CLIENT, SERVER } XIOSType;
+
+         typedef struct
+         {
+            StdSize nbClient;
+            StdSize nbClientPServer;
+            void (*entry)(comm::MPIComm, comm::MPIComm, comm::MPIComm) ;
+         } XIOSClient;
+
+         /// Initialisation et finalisation de la bibliothÃšque ///
+         static void Initialise(XIOSType type = CLIENT,
+                                int    * argc = NULL  ,
+                                char *** argv = NULL  );
+         static void Finalize(void);
+
+         /// Ajout de client en mode CLIENT_SERVER et CLIENT///
+         static void AddClient(StdString clientName, StdSize nbClient, StdSize nbClientPServer,
+                               void (*entry_point)(comm::MPIComm, comm::MPIComm, comm::MPIComm));
+
+         /// Lancement des serveurs et/ou des clients ///
+         static void RunServer(StdString clientName,
+                               comm::MPIComm comm_client_server, comm::MPIComm comm_server); // Not implemented yet.
+         static void RunClient(comm::MPIComm comm_client =
+                               comm::CMPIManager::GetCommWorld());                           // Not implemented yet.
+         static void RunClientServer(comm::MPIComm comm_client_server =
+                                     comm::CMPIManager::GetCommWorld());
+
+      protected :
+
+         /// Accesseurs statiques ///
+         static StdSize GetNbClient(void);
+         static StdSize GetNbLocClient(const StdString & clientName = CXIOSManager::ClientName);
+
+         static StdSize GetNbServer(void);
+         static StdSize GetNbLocServer(const StdString & clientName = CXIOSManager::ClientName);
+
+      private :
+
+         /// variables privÃ©es ///
+         static StdString ExeName;
+         static std::vector<StdString> ExeOptions;
+
+         static XIOSType Type;
+         static StdString ClientName;
+         static comm::MPIComm Comm_Client_Server;
+         static comm::MPIComm Comm_Server;
+         static xios_map<StdString, XIOSClient> Clients;
+
+   }; // class CXIOSManager
+} // namespace xmlioserver
+
+#endif //__XMLIO_CXMLIOManager__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/mask.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/mask.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/mask.cpp	(revision 152)
@@ -0,0 +1,29 @@
+#include "mask.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CMask::CMask(void)
+      : CArray<int, 2>(boost::extents[10][10])
+   { /* Ne rien faire de plus */ }
+
+   CMask::~CMask(void)
+   { /* Ne rien faire de plus */ }
+
+   //---------------------------------------------------------------
+
+   void CMask::resize(int ni, int nj)
+   {
+      SuperClass::resize(boost::extents[ni][nj]);
+      for (int i = 0; i < ni; i++)
+         for (int j = 0; j < nj; j++)
+            (*this)[i][j] = 1;
+   }
+
+   const int * CMask::getData(void) const
+   { return (SuperClass::data()); }
+
+   //---------------------------------------------------------------
+
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/mask.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/mask.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/mask.hpp	(revision 152)
@@ -0,0 +1,36 @@
+#ifndef __XMLIO_CMask__
+#define __XMLIO_CMask__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "array.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+   class CMask
+      : protected CArray<int, 2>
+   {
+         typedef CArray<int, 2> SuperClass;
+
+      public :
+
+         /// Constructeurs ///
+         CMask(void);
+         CMask(const CMask & mask);       // NEVER IMPLEMENTED.
+         CMask(const CMask * const mask); // NEVER IMPLEMENTED.
+
+         /// Accesseurs ///
+         const int * getData(void) const;
+
+         /// Mutateurs ///
+         void resize(int ni, int nj);
+
+         /// Destructeur ///
+         virtual ~CMask(void);
+
+   }; //class CMask
+} // namespace xmlioserver
+
+#endif // __XMLIO_CMask__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/axis.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/axis.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/axis.cpp	(revision 152)
@@ -0,0 +1,62 @@
+#include "axis.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CAxis::CAxis(void)
+         : CObjectTemplate<CAxis>()
+         , CAxisAttributes(), isChecked(false), relFiles()
+      { /* Ne rien faire de plus */ }
+
+      CAxis::CAxis(const StdString & id)
+         : CObjectTemplate<CAxis>(id)
+         , CAxisAttributes(), isChecked(false), relFiles()
+      { /* Ne rien faire de plus */ }
+
+      CAxis::~CAxis(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      const std::set<StdString> & CAxis::getRelFiles(void) const
+      {
+         return (this->relFiles);
+      }
+
+      bool CAxis::IsWritten(const StdString & filename) const
+      {
+         return (this->relFiles.find(filename) != this->relFiles.end());
+      }
+
+      void CAxis::addRelFile(const StdString & filename)
+      {
+         this->relFiles.insert(filename);
+      }
+
+      //----------------------------------------------------------------
+      StdString CAxis::GetName(void)   { return (StdString("axis")); }
+      StdString CAxis::GetDefName(void){ return (CAxis::GetName()); }
+
+      void CAxis::checkAttributes(void)
+      {
+         if (this->isChecked) return;
+         StdSize size = this->size.getValue();
+         StdSize true_size = zvalue.getValue()->num_elements();
+         if (size != true_size)
+            ERROR("CAxis::checkAttributes(void)",
+                  << "Le tableau \'zvalue\' a une taille diffÃ©rente de celle indiquÃ©e dans l'attribut \'size\'")
+
+         this->isChecked = true;
+      }
+
+      ///---------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/axis.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/axis.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/axis.hpp	(revision 152)
@@ -0,0 +1,83 @@
+#ifndef __XMLIO_CAxis__
+#define __XMLIO_CAxis__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "group_factory.hpp"
+
+#include "declare_group.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CAxisGroup;
+      class CAxisAttributes;
+      class CAxis;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CAxisAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CAxis)
+#include "../config/axis_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CAxis)
+
+      ///--------------------------------------------------------------
+
+      class CAxis
+         : public CObjectTemplate<CAxis>
+         , public CAxisAttributes
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CAxis>   SuperClass;
+            typedef CAxisAttributes SuperClassAttribute;
+
+         public :
+
+            typedef CAxisAttributes RelAttributes;
+            typedef CAxisGroup      RelGroup;
+
+            /// Constructeurs ///
+            CAxis(void);
+            explicit CAxis(const StdString & id);
+            CAxis(const CAxis & axis);       // Not implemented yet.
+            CAxis(const CAxis * const axis); // Not implemented yet.
+
+            /// Accesseurs ///
+            const std::set<StdString> & getRelFiles(void) const;
+
+            /// Test ///
+            bool IsWritten(const StdString & filename) const;
+
+            /// Mutateur ///
+            void addRelFile(const StdString & filename);
+
+            /// VÃ©rifications ///
+            void checkAttributes(void);
+
+            /// Destructeur ///
+            virtual ~CAxis(void);
+
+            /// Accesseurs statiques ///
+            static StdString GetName(void);
+            static StdString GetDefName(void);
+
+         private :
+
+            bool isChecked;
+            std::set<StdString> relFiles;
+
+
+      }; // class CAxis
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CAxisGroup and CAxisDefinition
+      DECLARE_GROUP(CAxis);
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CAxis__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/context.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/context.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/context.cpp	(revision 152)
@@ -0,0 +1,162 @@
+#include "context.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CContext::CContext(void)
+         : CObjectTemplate<CContext>(), CContextAttributes()
+      { /* Ne rien faire de plus */ }
+
+      CContext::CContext(const StdString & id)
+         : CObjectTemplate<CContext>(id), CContextAttributes()
+      { /* Ne rien faire de plus */ }
+
+      CContext::~CContext(void)
+      { /* Ne rien faire de plus */ }
+
+      StdString CContext::GetName(void)   { return (StdString("context")); }
+      StdString CContext::GetDefName(void){ return (CContext::GetName()); }
+
+      boost::shared_ptr<CContextGroup> CContext::GetContextGroup(void)
+      {  static boost::shared_ptr<CContextGroup> group_context
+                             (new CContextGroup(xml::CXMLNode::GetRootName()));
+         return (group_context); }
+
+      void CContext::parse(xml::CXMLNode & node)
+      {
+         CContext::SuperClass::parse(node);
+
+         // PARSING POUR GESTION DES ENFANTS
+         xml::THashAttributes attributes;
+
+         if (node.getElementName().compare(CContext::GetName()))
+            DEBUG("Le noeud est mal nommÃ© mais sera traitÃ© comme un contexte !");
+
+         if (!(node.goToChildElement()))
+         {
+            DEBUG("Le context ne contient pas d'enfant !");
+         }
+         else
+         {
+            do { // Parcours des contextes pour traitement.
+
+               StdString name = node.getElementName();
+               attributes.clear();
+               attributes = node.getAttributes();
+
+               if (attributes.end() != attributes.find("id"))
+               { DEBUG(<< "Le noeud de dÃ©finition possÃšde un identifiant,"
+                       << " ce dernier ne sera pas pris en compte lors du traitement !"); }
+
+#define DECLARE_NODE(Name_, name_)    \
+   if (name.compare(C##Name_##Definition::GetDefName()) == 0) \
+   { CObjectFactory::CreateObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) -> parse(node); \
+      continue; }
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "../config/node_type.conf"
+
+               DEBUG(<< "L'Ã©lÃ©ment nommÃ© \'"     << name
+                     << "\' dans le contexte \'" << CObjectFactory::GetCurrentContextId()
+                     << "\' ne reprÃ©sente pas une dÃ©finition !");
+
+            } while (node.goToNextElement());
+
+            node.goToParentElement(); // Retour au parent
+         }
+      }
+
+      void CContext::ShowTree(StdOStream & out)
+      {
+         StdString currentContextId =
+            CObjectFactory::GetCurrentContextId();
+         std::vector<boost::shared_ptr<CContext> > def_vector =
+            CContext::GetContextGroup()->getChildList();
+         std::vector<boost::shared_ptr<CContext> >::iterator
+            it = def_vector.begin(), end = def_vector.end();
+
+         out << "<? xml version=\"1.0\" ?>" << std::endl;
+         out << "< "  << xml::CXMLNode::GetRootName() << " >" << std::endl;
+         
+         for (; it != end; it++)
+         {
+            boost::shared_ptr<CContext> context = *it;
+            CObjectFactory::SetCurrentContextId(context->getId());
+            CGroupFactory::SetCurrentContextId(context->getId());
+            out << *context << std::endl;
+         }
+         
+         out << "</ " << xml::CXMLNode::GetRootName() << " >" << std::endl;
+
+         CObjectFactory::SetCurrentContextId(currentContextId);
+          CGroupFactory::SetCurrentContextId(currentContextId);
+      }
+
+      StdString CContext::toString(void) const
+      {
+         StdOStringStream oss;
+         oss << "< " << CContext::GetName()
+             << " id=\"" << this->getId() << "\" "
+             << SuperClassAttribute::toString() << ">" << std::endl;
+         if (!this->hasChild())
+         {
+            //oss << "<!-- No definition -->" << std::endl; // fait planter l'incrÃ©mentation
+         }
+         else
+         {
+
+#define DECLARE_NODE(Name_, name_)    \
+   if (CObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \
+      oss << *CObjectFactory::GetObject<C##Name_##Definition>(C##Name_##Definition::GetDefName()) << std::endl;
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "../config/node_type.conf"
+
+         }
+
+         oss << "</ " << CContext::GetName() << " >";
+
+         return (oss.str());
+      }
+
+      void CContext::solveDescInheritance(const CAttributeMap * const UNUSED(parent))
+      {
+#define DECLARE_NODE(Name_, name_)    \
+   if (CObjectFactory::HasObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())) \
+      CObjectFactory::GetObject<C##Name_##Definition>(C##Name_##Definition::GetDefName())->solveDescInheritance();
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "../config/node_type.conf"
+      }
+
+      bool CContext::hasChild(void) const
+      {
+         return (false ||
+#define DECLARE_NODE(Name_, name_)    \
+   CObjectFactory::HasObject<C##Name_##Definition>  (C##Name_##Definition::GetDefName())   ||
+#define DECLARE_NODE_PAR(Name_, name_)
+#include "../config/node_type.conf"
+         false);
+      }
+
+      void CContext::solveFieldRefInheritance(void)
+      {
+         if (!this->hasId()) return;
+         std::vector<boost::shared_ptr<CField> > allField
+                  = CObjectTemplate<CField>::GetAllVectobject(this->getId());
+         std::vector<boost::shared_ptr<CField> >::iterator 
+            it = allField.begin(), end = allField.end();
+               
+         for (; it != end; it++)
+         {
+            boost::shared_ptr<CField> field = *it;
+            field->solveRefInheritance();
+         }
+      }
+
+   } // namespace tree
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/context.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/context.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/context.hpp	(revision 152)
@@ -0,0 +1,85 @@
+#ifndef __XMLIO_CContext__
+#define __XMLIO_CContext__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "node_type.hpp"
+
+#include "declare_group.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CContextGroup;
+      class CContextAttributes;
+      class CContext;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CFileAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CContext)
+#include "../config/context_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CContext)
+
+      ///--------------------------------------------------------------
+
+      class CContext
+         : public CObjectTemplate<CContext>
+         , public CContextAttributes
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CContext>   SuperClass;
+            typedef CContextAttributes SuperClassAttribute;
+
+         public :
+
+            typedef CContextAttributes RelAttributes;
+            typedef CContext           RelGroup;
+
+            //---------------------------------------------------------
+
+            /// Constructeurs ///
+            CContext(void);
+            explicit CContext(const StdString & id);
+            CContext(const CContext & context);       // Not implemented yet.
+            CContext(const CContext * const context); // Not implemented yet.
+
+            /// Destructeur ///
+            virtual ~CContext(void);
+
+            //---------------------------------------------------------
+
+            /// Accesseurs statiques ///
+            static StdString GetName(void);
+            static StdString GetDefName(void);
+
+            static boost::shared_ptr<CContextGroup> GetContextGroup(void);
+
+            /// Traitements ///
+            virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
+            void solveFieldRefInheritance(void);
+
+            /// Autres mÃ©thodes statiques ///
+            static void ShowTree(StdOStream & out = std::clog);
+
+            /// Test ///
+            virtual bool hasChild(void) const;
+
+            /// Autres ///
+            virtual void parse(xml::CXMLNode & node);
+
+            virtual StdString toString(void) const;
+
+      }; // class CContext
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CContextGroup and CContextDefinition
+      DECLARE_GROUP(CContext);
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CContext__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.cpp	(revision 152)
@@ -0,0 +1,300 @@
+#include "domain.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CDomain::CDomain(void)
+         : CObjectTemplate<CDomain>(), CDomainAttributes()
+         , isChecked(false), local_mask(new CMask()), relFiles()
+      { /* Ne rien faire de plus */ }
+
+      CDomain::CDomain(const StdString & id)
+         : CObjectTemplate<CDomain>(id), CDomainAttributes()
+         , isChecked(false), local_mask(new CMask()), relFiles()
+      { /* Ne rien faire de plus */ }
+
+      CDomain::~CDomain(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      const std::set<StdString> & CDomain::getRelFiles(void) const
+      {
+         return (this->relFiles);
+      }
+
+      bool CDomain::IsWritten(const StdString & filename) const
+      {
+         return (this->relFiles.find(filename) != this->relFiles.end());
+      }
+
+      void CDomain::addRelFile(const StdString & filename)
+      {
+         this->relFiles.insert(filename);
+      }
+
+      //----------------------------------------------------------------
+
+      StdString CDomain::GetName(void)   { return (StdString("domain")); }
+      StdString CDomain::GetDefName(void){ return (CDomain::GetName()); }
+
+      //----------------------------------------------------------------
+
+      void CDomain::checkGlobalDomain(void)
+      {
+         if ((ni_glo.isEmpty() || ni_glo.getValue() <= 0 ) ||
+             (ni_glo.isEmpty() || nj_glo.getValue() <= 0 ))
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Le domaine global est mal dÃ©fini,"
+                  << " vÃ©rifiez les valeurs de \'ni_glo\' et \'nj_glo\' !") ;
+      }
+
+
+      //----------------------------------------------------------------
+
+      void CDomain::checkLocalIDomain(void)
+      {
+         if (!ni.isEmpty() && !ibegin.isEmpty() && iend.isEmpty())
+            iend.setValue(ibegin.getValue() + ni.getValue() - 1) ;
+
+         else if (!ni.isEmpty() && !iend.isEmpty()   && ibegin.isEmpty())
+            ibegin.setValue( - ni.getValue() + iend.getValue() + 1) ;
+
+         else if (!ibegin.isEmpty() && !iend.isEmpty() && ni.isEmpty())
+            ni.setValue(iend.getValue() - ibegin.getValue() + 1) ;
+
+         else if (!ibegin.isEmpty() && !iend.isEmpty() &&
+                  !ni.isEmpty() && (iend.getValue() != ibegin.getValue() + ni.getValue() - 1))
+         {
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Le domaine est mal dÃ©fini,"
+                  << " iend est diffÃ©rent de (ibegin + ni - 1) !") ;
+         }
+         else
+         {
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Le domaine est mal dÃ©fini,"
+                  << " deux valeurs au moins parmis iend, ibegin, ni doivent Ãªtre dÃ©finies !") ;
+         }
+
+
+         if (ni.getValue() < 0 || ibegin.getValue() > iend.getValue() ||
+             ibegin.getValue() < 1 || iend.getValue() > ni_glo.getValue())
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Domaine local mal dÃ©fini,"
+                  << " vÃ©rifiez les valeurs ni, ni_glo, ibegin, iend") ;
+
+      }
+
+      //----------------------------------------------------------------
+
+      void CDomain::checkLocalJDomain(void)
+      {
+         if (!nj.isEmpty() && !jbegin.isEmpty() && jend.isEmpty())
+            jend.setValue(jbegin.getValue() + nj.getValue() - 1) ;
+
+         else if (!nj.isEmpty() && !jend.isEmpty() && jbegin.isEmpty())
+            jbegin.setValue( - nj.getValue() + jend.getValue() + 1) ;
+
+         else if (!jbegin.isEmpty() && !jend.isEmpty() && nj.isEmpty())
+            nj.setValue(jend.getValue() - jbegin.getValue() + 1) ;
+
+         else if (!jbegin.isEmpty() && !jend.isEmpty() &&
+                  !nj.isEmpty() && (jend.getValue() != jbegin.getValue() + nj.getValue() - 1))
+         {
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Le domaine est mal dÃ©fini,"
+                  << " iend est diffÃ©rent de (jbegin + nj - 1) !") ;
+         }
+         else
+         {
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Le domaine est mal dÃ©fini,"
+                  << " deux valeurs au moins parmis jend, jbegin, nj doivent Ãªtre dÃ©finies !") ;
+         }
+
+         if (nj.getValue() < 0 || jbegin.getValue() > jend.getValue() ||
+             jbegin.getValue() < 1 || jend.getValue() > nj_glo.getValue())
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Domaine local mal dÃ©fini,"
+                  << " vÃ©rifiez les valeurs nj, nj_glo, jbegin, jend") ;
+      }
+
+
+      //----------------------------------------------------------------
+
+      void CDomain::checkMask(void)
+      {
+         if (!mask.isEmpty())
+         {
+            unsigned int niu = ni.getValue(), nju = nj.getValue();
+            if ((mask.getValue()->shape()[0] != niu) ||
+                (mask.getValue()->shape()[1] != nju))
+               ERROR("CDomain::checkAttributes(void)",
+                     <<"Le masque n'a pas la mÃªme taille que le domaine local") ;
+         }
+         else // (!mask.hasValue())
+         { // Si aucun masque n'est dÃ©fini,
+           // on en crÃ©e un nouveau qui valide l'intÃ©gralitÃ© du domaine.
+            ARRAY_CREATE(__arr, bool, 2, [ni.getValue()][nj.getValue()]);
+            for (int i = 0; i < ni.getValue(); i++)
+               for (int j = 0; j < nj.getValue(); j++)
+                  (*__arr)[i][j] = true;
+            mask.setValue(__arr);
+         }
+
+      }
+
+
+      //----------------------------------------------------------------
+
+      void CDomain::checkDomainData(void)
+      {
+         if (!data_dim.isEmpty() &&
+            !(data_dim.getValue() == 1 || data_dim.getValue() == 2))
+         {
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Dimension des donnÃ©es non comptatible (doit Ãªtre 1 ou 2) !") ;
+         }
+         else if (data_dim.isEmpty())
+         {
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Dimension des donnÃ©es non dÃ©finie !") ;
+         }
+
+         if (data_ibegin.isEmpty())
+            data_ibegin.setValue(0) ;
+         if (data_jbegin.isEmpty() && (data_dim.getValue() == 2))
+              data_jbegin.setValue(0) ;
+
+         if (!data_ni.isEmpty() && (data_ni.getValue() <= 0))
+         {
+            ERROR("CDomain::checkAttributes(void)",
+                  << "Dimension des donnÃ©es nÃ©gative (data_ni).") ;
+         }
+         else if (data_ni.isEmpty())
+         {
+            data_ni.setValue((data_dim.getValue() == 1)
+                              ? (ni.getValue() * nj.getValue())
+                              : ni.getValue());
+         }
+
+         if (data_dim.getValue() == 2)
+         {
+            if (!data_nj.isEmpty() && (data_nj.getValue() <= 0) )
+            {
+               ERROR("CDomain::checkAttributes(void)",
+                     << "Dimension des donnÃ©es nÃ©gative (data_nj).") ;
+            }
+            else if (data_nj.isEmpty())
+               data_nj.setValue(nj.getValue()) ;
+         }
+
+      }
+
+      //----------------------------------------------------------------
+
+      void CDomain::checkCompression(void)
+      {
+         if (!data_i_index.isEmpty())
+         {
+            int ssize = data_i_index.getValue()->size();
+            if (!data_n_index.isEmpty() &&
+               (data_n_index.getValue() != ssize))
+            {
+               ERROR("CDomain::checkAttributes(void)",
+                     <<"Dimension data_i_index incompatible avec data_n_index.") ;
+            }
+            else if (data_n_index.isEmpty())
+               data_n_index.setValue(ssize) ;
+
+            if (data_dim.getValue() == 2)
+            {
+               if (!data_j_index.isEmpty() &&
+                  (data_j_index.getValue()->size() != data_i_index.getValue()->size()))
+               {
+                  ERROR("CDomain::checkAttributes(void)",
+                        <<"Dimension data_j_index incompatible avec data_i_index.") ;
+               }
+               else if (data_j_index.isEmpty())
+               {
+                  ERROR("CDomain::checkAttributes(void)",
+                        <<"La donnÃ©e data_j_index doit Ãªtre renseignÃ©e !") ;
+               }
+            }
+         }
+         else
+         {
+            if (!data_n_index.isEmpty() ||
+               ((data_dim.getValue() == 2) && (!data_j_index.isEmpty())))
+               ERROR("CDomain::checkAttributes(void)", << "data_i_index non dÃ©fini") ;
+         }
+
+         if (data_n_index.isEmpty())
+         { // -> bloc re-vÃ©rifiÃ© OK
+            if (data_dim.getValue() == 1)
+            {
+               const int dni = data_ni.getValue();
+               ARRAY_CREATE(__arri, int, 1, [dni]);
+               data_n_index.setValue(dni);
+               for (int i = 0; i < dni; i++)
+                  (*__arri)[i] = i+1 ;
+               data_i_index.setValue(__arri) ;
+            }
+            else   // (data_dim == 2)
+            {
+               const int dni = data_ni.getValue() * data_nj.getValue();
+               ARRAY_CREATE(__arri, int, 1, [dni]);
+               ARRAY_CREATE(__arrj, int, 1, [dni]);
+               data_n_index.setValue(dni);
+               for(int count = 0, i = 0; i  < data_ni.getValue(); i++)
+                  for(int j = 0; j < data_nj.getValue(); j++, count++)
+               { (*__arri)[count] = i+1 ;  (*__arrj)[count] = j+1 ; }
+               data_i_index.setValue(__arri) ;
+               data_j_index.setValue(__arrj) ;
+            }
+         }
+      }
+
+      //----------------------------------------------------------------
+
+      void CDomain::checkAttributes(void)
+      {
+         if (this->isChecked) return;
+
+         this->checkGlobalDomain();
+         this->checkLocalIDomain();
+         this->checkLocalJDomain();
+
+         this->checkMask();
+         this->checkDomainData();
+         this->checkCompression();
+         this->completeMask();
+
+         this->isChecked = true;
+      }
+
+      void CDomain::completeMask(void)
+      {
+         this->local_mask->resize(data_ni.getValue(), data_nj.getValue());
+         /*this->local_mask->setDataPosition
+            (data_dim.getValue(), data_ni.getValue(), data_nj.getValue(),
+             data_ibegin.getValue(), data_jbegin.getValue(), data_n_index.getValue(),
+             data_i_index.getValue(), data_j_index.getValue());*/
+      }
+
+      boost::shared_ptr<CMask> CDomain::getLocalMask(void) const
+      {
+         return (this->local_mask);
+      }
+      ///---------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/domain.hpp	(revision 152)
@@ -0,0 +1,101 @@
+#ifndef __XMLIO_CDomain__
+#define __XMLIO_CDomain__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "group_factory.hpp"
+#include "mask.hpp"
+
+#include "declare_group.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CDomainGroup;
+      class CDomainAttributes;
+      class CDomain;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CDomainAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CDomain)
+#include "../config/domain_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CDomain)
+
+      ///--------------------------------------------------------------
+
+      class CDomain
+         : public CObjectTemplate<CDomain>
+         , public CDomainAttributes
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CDomain>   SuperClass;
+            typedef CDomainAttributes SuperClassAttribute;
+
+         public :
+
+            typedef CDomainAttributes RelAttributes;
+            typedef CDomainGroup      RelGroup;
+
+            /// Constructeurs ///
+            CDomain(void);
+            explicit CDomain(const StdString & id);
+            CDomain(const CDomain & domain);       // Not implemented yet.
+            CDomain(const CDomain * const domain); // Not implemented yet.
+
+            /// VÃ©rifications ///
+            void checkAttributes(void);
+
+         private :
+
+            virtual void checkGlobalDomain(void);
+
+            virtual void checkLocalIDomain(void);
+            virtual void checkLocalJDomain(void);
+
+            virtual void checkMask(void);
+            virtual void checkDomainData(void);
+            virtual void checkCompression(void);
+
+            virtual void completeMask(void);
+
+         public :
+
+            /// Accesseurs ///
+            boost::shared_ptr<CMask> getLocalMask(void) const;
+            const std::set<StdString> & getRelFiles(void) const;
+
+            /// Test ///
+            bool IsWritten(const StdString & filename) const;
+
+            /// Mutateur ///
+            void addRelFile(const StdString & filename);
+
+            /// Destructeur ///
+            virtual ~CDomain(void);
+
+            /// Accesseurs statiques ///
+            static StdString GetName(void);
+            static StdString GetDefName(void);
+
+          private :
+
+            /// ProriÃ©tÃ©s protÃ©gÃ©es ///
+            bool isChecked;
+            boost::shared_ptr<CMask> local_mask;
+            std::set<StdString> relFiles;
+
+      }; // class CDomain
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CDomainGroup and CDomainDefinition
+      DECLARE_GROUP(CDomain);
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CDomain__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/field.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/field.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/field.cpp	(revision 152)
@@ -0,0 +1,204 @@
+#include "field.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "node_type.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CField::CField(void)
+         : CObjectTemplate<CField>(), CFieldAttributes()
+         , baseRefObject(), refObject(), grid(), file(), foperation(NULL)
+      { /* Ne rien faire de plus */ }
+
+      CField::CField(const StdString & id)
+         : CObjectTemplate<CField>(id), CFieldAttributes()
+         , baseRefObject(), refObject(), foperation(NULL)
+      { /* Ne rien faire de plus */ }
+
+      CField::~CField(void)
+      {
+         if (this->foperation == NULL)
+            delete this->foperation;
+      }
+
+      void CField::setRelFile(const boost::shared_ptr<CFile> _file)
+      { this->file = _file; }
+
+      //----------------------------------------------------------------
+
+      StdString CField::GetName(void)   { return (StdString("field")); }
+      StdString CField::GetDefName(void){ return (CField::GetName()); }
+
+      boost::shared_ptr<CGrid> CField::getRelGrid(void) const
+      { return (this->grid); }
+
+      boost::shared_ptr<CFile> CField::getRelFile(void) const
+      { return (this->file); }
+
+      boost::shared_ptr<CField> CField::getDirectFieldReference(void) const
+      {
+         if (this->field_ref.isEmpty())
+            return (this->getBaseFieldReference());
+
+         if (! CObjectFactory::HasObject<CField>(this->field_ref.getValue()))
+            ERROR("CField::getDirectFieldReference(void)",
+                  << "[ ref_name = " << this->field_ref.getValue() << "]"
+                  << " invalid field name !");
+
+         return (CObjectFactory::GetObject<CField>(this->field_ref.getValue()));
+      }
+
+      const boost::shared_ptr<CField>
+         CField::getBaseFieldReference(void) const { return (baseRefObject); }
+
+      const std::vector<boost::shared_ptr<CField> > &
+         CField::getAllReference(void) const { return (refObject); }
+
+      const StdString & CField::getBaseFieldId(void) const
+      { return (this->getBaseFieldReference()->getId()); }
+
+      bool CField::hasDirectFieldReference(void) const
+      { return (!this->field_ref.isEmpty()); }
+
+      //----------------------------------------------------------------
+
+      void CField::solveRefInheritance(void)
+      {
+         std::set<CField *> sset;
+         boost::shared_ptr<CField> refer_sptr;
+         CField * refer_ptr = this;
+         this->baseRefObject = CObjectFactory::GetObject<CField>(this);
+         while (refer_ptr->hasDirectFieldReference())
+         {
+            refer_sptr = refer_ptr->getDirectFieldReference();
+            refer_ptr  = refer_sptr.get();
+
+            if(sset.end() != sset.find(refer_ptr))
+            {
+               DEBUG (<< "DÃ©pendance circulaire stoppÃ©e pour l'objet de type CField sur "
+                      << "\"" + refer_ptr->getId() + "\" !");
+               break;
+            }
+
+            SuperClassAttribute::setAttributes(refer_ptr);
+            sset.insert(refer_ptr);
+            baseRefObject = refer_sptr;
+            refObject.push_back(refer_sptr);
+         }
+      }
+
+      //----------------------------------------------------------------
+
+      void  CField::solveOperation(void)
+      {
+         // TODO : Ã  complÃ©ter;
+      }
+
+      //----------------------------------------------------------------
+
+      void CField::solveGridReference(void)
+      {
+         boost::shared_ptr<CDomain> domain;
+         boost::shared_ptr<CAxis> axis;
+
+         if (!domain_ref.isEmpty())
+         {
+            if (CObjectFactory::HasObject<CDomain>(domain_ref.getValue()))
+               domain = CObjectFactory::GetObject<CDomain>(domain_ref.getValue()) ;
+            else
+               ERROR("CField::solveGridReference(void)",
+                     << "RÃ©fÃ©rence au domaine nommÃ© \'"
+                     << domain_ref.getValue() << "\' incorrecte") ;
+         }
+
+         if (!axis_ref.isEmpty())
+         {
+            if (CObjectFactory::HasObject<CAxis>(axis_ref.getValue()))
+               axis = CObjectFactory::GetObject<CAxis>(axis_ref.getValue()) ;
+            else
+               ERROR("CField::solveGridReference(void)",
+                     << "RÃ©fÃ©rence Ã  l'axe nommÃ© \'"
+                     << axis_ref.getValue() <<"\' incorrecte") ;
+         }
+
+         if (!grid_ref.isEmpty())
+         {
+            if (CObjectFactory::HasObject<CGrid>(grid_ref.getValue()))
+               this->grid = CObjectFactory::GetObject<CGrid>(grid_ref.getValue()) ;
+            else
+               ERROR("CField::solveGridReference(void)",
+                     << "RÃ©fÃ©rence Ã  la grille nommÃ©e \'"
+                     << grid_ref.getValue() << "\' incorrecte");
+            if (!domain_ref.isEmpty())
+               DEBUG(<< "DÃ©finition conjointe de la grille "
+                     << "et du domaine, la grille prÃ©vaut..." );
+            if (!axis_ref.isEmpty())
+               DEBUG(<< "DÃ©finition conjointe de la grille "
+                     << "et de l'axe vertical, la grille prÃ©vaut...") ;
+         }
+         else
+         {
+            if (!domain_ref.isEmpty())
+            {
+               if (!axis_ref.isEmpty())
+               {
+                  this->grid = CGrid::CreateGrid(domain, axis) ;
+                  this->grid_ref.setValue(this->grid->getId());
+               }
+               else
+               {
+                  this->grid = CGrid::CreateGrid(domain) ;
+                  this->grid_ref.setValue(this->grid->getId());
+               }
+            }
+            else
+            {
+               ERROR("CField::solveGridReference(void)",
+                     << "Le domaine horizontal pour le champ X n'est pas dÃ©fini");
+            }
+         }
+         grid->solveReference() ;
+      }
+   } // namespace tree
+
+   ///-------------------------------------------------------------------
+
+   template <>
+      void CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void)
+   {
+      if (this->group_ref.isEmpty()) return;
+      StdString gref = this->group_ref.getValue();
+
+      if (!CObjectFactory::HasObject<CFieldGroup>(gref))
+         ERROR("CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void)",
+               << "[ gref = " << gref << "]"
+               << " invalid group name !");
+
+      boost::shared_ptr<CFieldGroup> group
+               = CObjectFactory::GetObject<CFieldGroup>(gref);
+      boost::shared_ptr<CFieldGroup> owner
+               = CObjectFactory::GetObject<CFieldGroup>
+                  (boost::polymorphic_downcast<CFieldGroup*>(this));
+
+      std::vector<boost::shared_ptr<CField> > allChildren  = group->getAllChildren();
+      std::vector<boost::shared_ptr<CField> >::iterator 
+         it = allChildren.begin(), end = allChildren.end();
+      
+      for (; it != end; it++)
+      {
+         boost::shared_ptr<CField> child = *it;
+         if (child->hasId())
+            CGroupFactory::CreateChild(owner)->field_ref.setValue(child->getId());
+      }
+   }
+
+   ///-------------------------------------------------------------------
+
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/field.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/field.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/field.hpp	(revision 152)
@@ -0,0 +1,113 @@
+#ifndef __XMLIO_CField__
+#define __XMLIO_CField__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "group_factory.hpp"
+
+#include "functor.hpp"
+#include "functor/functor_type.hpp"
+
+#include "declare_group.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CFieldGroup;
+      class CFieldAttributes;
+      class CField;
+
+      class CFile;
+      class CGrid;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CFieldAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CField)
+#include "../config/field_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CField)
+
+      ///--------------------------------------------------------------
+      class CField
+         : public CObjectTemplate<CField>
+         , public CFieldAttributes
+      {
+            /// friend ///
+            friend class CFile;
+
+            /// typedef ///
+            typedef CObjectTemplate<CField>   SuperClass;
+            typedef CFieldAttributes SuperClassAttribute;
+
+         public :
+
+            typedef CFieldAttributes RelAttributes;
+            typedef CFieldGroup      RelGroup;
+
+            /// Constructeurs ///
+            CField(void);
+            explicit CField(const StdString & id);
+            CField(const CField & field);       // Not implemented yet.
+            CField(const CField * const field); // Not implemented yet.
+
+            /// Accesseurs ///
+            boost::shared_ptr<CField> getDirectFieldReference(void) const;
+            const boost::shared_ptr<CField> getBaseFieldReference(void) const;
+            const std::vector<boost::shared_ptr<CField> > & getAllReference(void) const;
+
+            boost::shared_ptr<CGrid> getRelGrid(void) const ;
+            boost::shared_ptr<CFile> getRelFile(void) const ;
+
+            const StdString & getBaseFieldId(void) const;
+
+            /// Mutateur ///
+            void setRelFile(const boost::shared_ptr<CFile> _file);
+
+         public :
+
+            /// Test ///
+            bool hasDirectFieldReference(void) const;
+
+            /// Traitements ///
+            void solveRefInheritance(void);
+            void solveGridReference(void);
+            void solveOperation(void);
+
+            /// Destructeur ///
+            virtual ~CField(void);
+
+            /// Accesseurs statiques ///
+            static StdString GetName(void);
+            static StdString GetDefName(void);
+
+         private :
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            boost::shared_ptr<CField> baseRefObject;
+            std::vector<boost::shared_ptr<CField> > refObject;
+
+            boost::shared_ptr<CGrid> grid ;
+            boost::shared_ptr<CFile> file;
+
+            func::CFunctor * foperation;
+
+      }; // class CField
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CFieldGroup and CFieldDefinition
+      DECLARE_GROUP(CField);
+
+   } // namespace tree
+
+   ///-----------------------------------------------------------------
+
+   template <>
+      void CGroupTemplate<CField, CFieldGroup, CFieldAttributes>::solveRefInheritance(void);
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CField__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/file.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/file.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/file.cpp	(revision 152)
@@ -0,0 +1,177 @@
+#include "file.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+#include "object_factory.hpp"
+#include "object_factory_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CFile::CFile(void)
+         : CObjectTemplate<CFile>(), CFileAttributes()
+         , vFieldGroup(), data_out(), enabledFields()
+      { /* Ne rien faire de plus */ }
+
+      CFile::CFile(const StdString & id)
+         : CObjectTemplate<CFile>(id), CFileAttributes()
+         , vFieldGroup(), data_out(), enabledFields()
+      { /* Ne rien faire de plus */ }
+
+      CFile::~CFile(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      StdString CFile::GetName(void)   { return (StdString("file")); }
+      StdString CFile::GetDefName(void){ return (CFile::GetName()); }
+
+      boost::shared_ptr<CFieldGroup> CFile::getVirtualFieldGroup(void) const
+      {
+         return (this->vFieldGroup);
+      }
+
+      std::vector<boost::shared_ptr<CField> > CFile::getAllFields(void) const
+      {
+         return (this->vFieldGroup->getAllChildren());
+      }
+
+      //----------------------------------------------------------------
+
+      std::vector<boost::shared_ptr<CField> > CFile::getEnabledFields
+         (int default_outputlevel, int default_level, bool default_enabled)
+      {
+         if (!this->enabledFields.empty())
+            return (this->enabledFields);
+
+         const int _outputlevel =
+            (!output_level.isEmpty()) ? output_level.getValue() : default_outputlevel;
+         std::vector<boost::shared_ptr<CField> >::iterator it;
+         this->enabledFields = this->getAllFields();
+
+         for ( it = this->enabledFields.begin() ; it != this->enabledFields.end(); it++ )
+         {
+            if (!(*it)->enabled.isEmpty()) // Si l'attribut 'enabled' est dÃ©fini ...
+            {
+               if (! (*it)->enabled.getValue())
+               { it--; this->enabledFields.erase(it+1); continue; }
+            }
+            else // Si l'attribut 'enabled' n'est pas dÃ©fini ...
+            {
+               if (!default_enabled)
+               { it--; this->enabledFields.erase(it+1); continue; }
+            }
+
+            if (!(*it)->level.isEmpty()) // Si l'attribut 'level' est dÃ©fini ...
+            {
+               if ((*it)->level.getValue() > _outputlevel)
+               { it--; this->enabledFields.erase(it+1); continue; }
+            }
+            else // Si l'attribut 'level' n'est pas dÃ©fini ...
+            {
+               if (default_level > _outputlevel)
+               { it--; this->enabledFields.erase(it+1); continue; }
+            }
+
+            // Le champ est finalement actif, on ajoute la rÃ©fÃ©rence au champ de base.
+            (*it)->setRelFile(CObjectFactory::GetObject(this));
+            (*it)->baseRefObject->refObject.push_back(*it);
+         }
+
+         return (this->enabledFields);
+      }
+
+      //----------------------------------------------------------------
+
+      void CFile::setVirtualFieldGroup(boost::shared_ptr<CFieldGroup> newVFieldGroup)
+      { this->vFieldGroup = newVFieldGroup; }
+
+      void CFile::setVirtualFieldGroup(const StdString & newVFieldGroupId)
+      {
+         this->setVirtualFieldGroup
+            (CObjectFactory::CreateObject<CFieldGroup>(newVFieldGroupId));
+      }
+
+      void CFile::initializeDataOutput(boost::shared_ptr<io::CDataOutput> dout)
+      {
+         this->data_out = dout;
+         this->data_out->writeFile(CObjectFactory::GetObject<CFile>(this));
+         
+         std::vector<boost::shared_ptr<CField> >::iterator it, end = this->enabledFields.end();
+
+         for (it = this->enabledFields.begin() ;it != end; it++)
+         {
+            boost::shared_ptr<CField> field = *it;
+            this->data_out->writeFieldGrid(field);
+         }
+            
+         for (it = this->enabledFields.begin() ;it != end; it++)
+         {
+            boost::shared_ptr<CField> field = *it;
+            this->data_out->writeField(field);
+         }
+            
+         this->data_out->definition_end();
+      }
+
+      void CFile::parse(xml::CXMLNode & node)
+      {
+         SuperClass::parse(node);
+         if (node.goToChildElement() & this->hasId())
+         { // Si la dÃ©finition du fichier intÃ©gre des champs et si le fichier est identifiÃ©.
+            node.goToParentElement();
+            this->setVirtualFieldGroup(this->getId());
+            this->getVirtualFieldGroup()->parse(node, false);
+         }
+      }
+      //----------------------------------------------------------------
+
+      StdString CFile::toString(void) const
+      {
+         StdOStringStream oss;
+
+         oss << "< " << CFile::GetName() << " ";
+         if (this->hasId())
+            oss << " id=\"" << this->getId() << "\" ";
+         oss << SuperClassAttribute::toString() << ">" << std::endl;
+         if (this->getVirtualFieldGroup().get() != NULL)
+            oss << *this->getVirtualFieldGroup() << std::endl;
+         oss << "</ " << CFile::GetName() << " >";
+         return (oss.str());
+      }
+
+
+      void CFile::solveDescInheritance(const CAttributeMap * const parent)
+      {
+         SuperClassAttribute::setAttributes(parent);
+         this->getVirtualFieldGroup()->solveDescInheritance(NULL);
+      }
+
+      void CFile::solveFieldRefInheritance(void)
+      {
+         // RÃ©solution des hÃ©ritages par rÃ©fÃ©rence de chacun des champs contenus dans le fichier.
+         std::vector<boost::shared_ptr<CField> > allF = this->getAllFields();
+         for (unsigned int i = 0; i < allF.size(); i++)
+            allF[i]->solveRefInheritance();
+      }
+
+      void CFile::solveEFGridRef(void)
+      {
+         for (unsigned int i = 0; i < this->enabledFields.size(); i++)
+            this->enabledFields[i]->solveGridReference();
+      }
+
+      void CFile::solveEFOperation(void)
+      {
+         for (unsigned int i = 0; i < this->enabledFields.size(); i++)
+            this->enabledFields[i]->solveOperation();
+      }
+
+      ///---------------------------------------------------------------
+   } // namespace tree
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/file.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/file.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/file.hpp	(revision 152)
@@ -0,0 +1,98 @@
+#ifndef __XMLIO_CFile__
+#define __XMLIO_CFile__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "field.hpp"
+#include "declare_group.hpp"
+
+#include "data_output.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CFileGroup;
+      class CFileAttributes;
+      class CFile;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CFileAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CFile)
+#include "../config/file_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CFile)
+
+      ///--------------------------------------------------------------
+
+      class CFile
+         : public CObjectTemplate<CFile>
+         , public CFileAttributes
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CFile>   SuperClass;
+            typedef CFileAttributes SuperClassAttribute;
+
+         public :
+
+            typedef CFileAttributes RelAttributes;
+            typedef CFileGroup      RelGroup;
+
+            /// Constructeurs ///
+            CFile(void);
+            explicit CFile(const StdString & id);
+            CFile(const CFile & file);       // Not implemented yet.
+            CFile(const CFile * const file); // Not implemented yet.
+
+            /// Accesseurs ///
+            boost::shared_ptr<CFieldGroup> getVirtualFieldGroup(void) const;
+            std::vector<boost::shared_ptr<CField> > getAllFields(void) const;
+
+            std::vector<boost::shared_ptr<CField> >
+               getEnabledFields(int default_outputlevel = 5,
+                                int default_level = 1,
+                                bool default_enabled = true);
+
+            /// Mutateurs ///
+            void setVirtualFieldGroup(boost::shared_ptr<CFieldGroup> newVFieldGroup);
+            void setVirtualFieldGroup(const StdString & newVFieldGroupId);
+
+            void initializeDataOutput(boost::shared_ptr<io::CDataOutput> dout);
+
+            /// Traitements ///
+            virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
+            void solveFieldRefInheritance(void);
+            void solveEFGridRef(void);
+            void solveEFOperation(void);
+
+            /// Destructeur ///
+            virtual ~CFile(void);
+
+            /// Autres ///
+            virtual void parse(xml::CXMLNode & node);
+            virtual StdString toString(void) const;
+
+            /// Accesseurs statiques ///
+            static StdString GetName(void);
+            static StdString GetDefName(void);
+
+         private :
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            boost::shared_ptr<CFieldGroup> vFieldGroup;
+            boost::shared_ptr<io::CDataOutput> data_out;
+            std::vector<boost::shared_ptr<CField> > enabledFields;
+
+      }; // class CFile
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CFileGroup and CFileDefinition
+      DECLARE_GROUP(CFile);
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CFile__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.cpp	(revision 152)
@@ -0,0 +1,230 @@
+#include "grid.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CGrid::CGrid(void)
+         : CObjectTemplate<CGrid>(), CGridAttributes()
+         , withAxis(false), isChecked(false), axis(), domain()
+         , storeIndex(), out_i_index(), out_j_index(), out_l_index()
+      { /* Ne rien faire de plus */ }
+
+      CGrid::CGrid(const StdString & id)
+         : CObjectTemplate<CGrid>(id), CGridAttributes()
+         , withAxis(false), isChecked(false), axis(), domain()
+         , storeIndex(), out_i_index(), out_j_index(), out_l_index()
+      { /* Ne rien faire de plus */ }
+
+      CGrid::~CGrid(void)
+      { /* Ne rien faire de plus */ }
+
+      ///---------------------------------------------------------------
+
+      StdString CGrid::GetName(void)   { return (StdString("grid")); }
+      StdString CGrid::GetDefName(void){ return (CGrid::GetName()); }
+
+      const ARRAY(int, 1) & CGrid::getStoreIndex(void) const
+      { return (this->storeIndex ); }
+      const ARRAY(int, 1) & CGrid::getOutIIndex(void)  const
+      { return (this->out_i_index ); }
+      const ARRAY(int, 1) & CGrid::getOutJIndex(void)  const
+      { return (this->out_j_index ); }
+      const ARRAY(int, 1) & CGrid::getOutLIndex(void)  const
+      { return (this->out_l_index ); }
+
+      const boost::shared_ptr<CAxis>   CGrid::getRelAxis  (void) const
+      { return (this->axis ); }
+      const boost::shared_ptr<CDomain> CGrid::getRelDomain(void) const
+      { return (this->domain ); }
+
+      bool CGrid::hasAxis(void) const { return (this->withAxis); }
+
+      //---------------------------------------------------------------
+
+      void CGrid::solveReference(void)
+      {
+         if (this->isChecked) return;
+         this->solveDomainRef() ;
+         this->solveAxisRef() ;
+         this->computeIndex() ;
+         this->isChecked = true;
+      }
+
+      void CGrid::solveDomainRef(void)
+      {
+         if (!domain_ref.isEmpty())
+         {
+            if (CObjectFactory::HasObject<CDomain>(domain_ref.getValue()))
+            {
+               this->domain = CObjectFactory::GetObject<CDomain>(domain_ref.getValue()) ;
+               domain->checkAttributes() ;
+            }
+            else ERROR("CGrid::solveDomainRef(void)",
+                        << "RÃ©fÃ©rence au domaine incorrecte") ;
+         }
+         else ERROR("CGrid::solveDomainRef(void)",
+                     << "Domaine non dÃ©fini") ;
+      }
+
+      void CGrid::solveAxisRef(void)
+      {
+         if (!axis_ref.isEmpty())
+         {
+            this->withAxis = true ;
+            if (CObjectFactory::GetObject<CAxis>(axis_ref.getValue()))
+            {
+               this->axis = CObjectFactory::GetObject<CAxis>(axis_ref.getValue()) ;
+               axis->checkAttributes() ;
+            }
+            else ERROR("CGrid::solveAxisRef(void)",
+                       << "RÃ©fÃ©rence a l'axe incorrecte") ;
+         }
+         else withAxis = false ;
+      }
+
+
+      void CGrid::computeIndex(void)
+      {
+         const int ni   = domain->ni.getValue() ,
+                   nj   = domain->nj.getValue() ,
+                   size = (this->hasAxis()) ? axis->size.getValue() : 1 ;
+
+         /*std::cout << ni   << " : "
+                     << nj   << " : "
+                     << size << std::endl;*/
+
+         const int data_dim     = domain->data_dim.getValue() ,
+                   data_n_index = domain->data_n_index.getValue() ,
+                   data_ibegin  = domain->data_ibegin.getValue() ,
+                   data_jbegin  = (data_dim == 2)
+                                ? domain->data_jbegin.getValue() : -1;
+
+         ARRAY(int, 1) data_i_index = domain->data_i_index.getValue() ,
+                       data_j_index = domain->data_j_index.getValue() ;
+
+         /*std::cout << data_n_index        << " : "
+                     << data_i_index.size() << " : "
+                     << data_j_index.size() << std::endl;*/
+
+         ARRAY(bool, 2) mask = domain->mask.getValue() ;
+
+         int indexCount = 0;
+
+         for(int l = 0; l < size ; l++)
+         {
+            for(int n = 0, i = 0, j = 0; n < data_n_index; n++)
+            {
+               int temp_i = (*data_i_index)[n] + data_ibegin,
+                   temp_j = (data_dim == 1) ? -1
+                          : (*data_j_index)[n] + data_jbegin;
+               i = (data_dim == 1) ? (temp_i - 2) % ni
+                                   : (temp_i - 1) ;
+               j = (data_dim == 1) ? (temp_i - 2) / ni
+                                   : (temp_j - 1) ;
+
+               if ((i >= 0 && i < ni) &&
+                   (j >= 0 && j < nj) && (*mask)[i][j])
+                  indexCount++ ;
+            }
+         }
+         //std::cout << indexCount  << std::endl;
+         ARRAY_ASSIGN(this->storeIndex , int, 1, [indexCount]);
+         ARRAY_ASSIGN(this->out_l_index, int, 1, [indexCount]);
+         ARRAY_ASSIGN(this->out_i_index, int, 1, [indexCount]);
+         ARRAY_ASSIGN(this->out_j_index, int, 1, [indexCount]);
+
+         for(int count = 0, indexCount = 0,  l = 0; l < size; l++)
+         {
+            for(int n = 0, i = 0, j = 0; n < data_n_index; n++, count++)
+            {
+               int temp_i = (*data_i_index)[n] + data_ibegin,
+                   temp_j = (data_dim == 1) ? -1
+                          : (*data_j_index)[n] + data_jbegin;
+               i = (data_dim == 1) ? (temp_i - 2) % ni
+                                   : (temp_i - 1) ;
+               j = (data_dim == 1) ? (temp_i - 2) / ni
+                                   : (temp_j - 1) ;
+
+               if ((i >= 0 && i < ni) &&
+                   (j >= 0 && j < nj) && (*mask)[i][j])
+               {
+                  (*this->storeIndex)[indexCount]  = count ;
+                  (*this->out_l_index)[indexCount] = l ;
+                  (*this->out_i_index)[indexCount] = i ;
+                  (*this->out_j_index)[indexCount] = j ;
+                  indexCount++ ;
+               }
+            }
+         }
+      }
+
+      //----------------------------------------------------------------
+      boost::shared_ptr<CGrid>
+         CGrid::CreateGrid(boost::shared_ptr<CDomain> domain)
+      {
+         StdString new_id = StdString("__") + domain->getId() + StdString("__") ;
+         boost::shared_ptr<CGrid> grid =
+            CGroupFactory::CreateChild(CObjectFactory::GetObject<CGridGroup> ("grid_definition"), new_id);
+         grid->domain_ref.setValue(domain->getId());
+         return (grid);
+      }
+
+      boost::shared_ptr<CGrid>
+         CGrid::CreateGrid(boost::shared_ptr<CDomain> domain, boost::shared_ptr<CAxis> axis)
+      {
+         StdString new_id = StdString("__") + domain->getId() +
+                            StdString("_") + axis->getId() + StdString("__") ;
+         boost::shared_ptr<CGrid> grid =
+            CGroupFactory::CreateChild(CObjectFactory::GetObject<CGridGroup> ("grid_definition"), new_id);
+         grid->domain_ref.setValue(domain->getId());
+         grid->axis_ref.setValue(axis->getId());
+         return (grid);
+      }
+
+      //----------------------------------------------------------------
+
+      template <>
+         void CGrid::outputField
+            (const ARRAY(double, 1) stored,  ARRAY(double, 3) field) const
+      {
+         for(StdSize n = 0; n < storeIndex->num_elements(); n++)
+            (*field)[(*out_i_index)[n]][(*out_j_index)[n]][(*out_l_index)[n]] = (*stored)[n] ;
+      }
+
+      template <>
+         void CGrid::outputField
+            (const ARRAY(double, 1) stored,  ARRAY(double, 2) field) const
+      {
+         for(StdSize n = 0; n < storeIndex->num_elements(); n++)
+            (*field)[(*out_i_index)[n]][(*out_j_index)[n]] = (*stored)[n] ;
+      }
+
+      template <>
+         void CGrid::outputField
+            (const ARRAY(double, 1) stored,  ARRAY(double, 1) field) const
+      {
+         for(StdSize n = 0; n < storeIndex->num_elements(); n++)
+            (*field)[(*out_i_index)[n]] = (*stored)[n] ;
+      }
+
+      void CGrid::storeField_arr
+         (const double * const data, ARRAY(double, 1) stored) const
+      {
+         const StdSize size = storeIndex->num_elements() ;
+         stored->resize(boost::extents[size]) ;
+         for(StdSize i = 0; i < size; i++)
+            (*stored)[i] = data[(*storeIndex)[i]] ;
+      }
+
+      ///---------------------------------------------------------------
+
+   } // namespace tree
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/grid.hpp	(revision 152)
@@ -0,0 +1,127 @@
+#ifndef __XMLIO_CGrid__
+#define __XMLIO_CGrid__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "group_factory.hpp"
+
+#include "declare_group.hpp"
+#include "domain.hpp"
+#include "axis.hpp"
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CGridGroup;
+      class CGridAttributes;
+      class CGrid;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CGridAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CGrid)
+#include "../config/grid_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CGrid)
+
+      ///--------------------------------------------------------------
+
+      class CGrid
+         : public CObjectTemplate<CGrid>
+         , public CGridAttributes
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CGrid>   SuperClass;
+            typedef CGridAttributes SuperClassAttribute;
+
+         public :
+
+            typedef CGridAttributes RelAttributes;
+            typedef CGridGroup      RelGroup;
+
+            /// Constructeurs ///
+            CGrid(void);
+            explicit CGrid(const StdString & id);
+            CGrid(const CGrid & grid);       // Not implemented yet.
+            CGrid(const CGrid * const grid); // Not implemented yet.
+
+            /// Traitements ///
+            void solveReference(void);
+
+            /// Tests ///
+            bool hasAxis(void) const;
+
+         public :
+
+            /// Accesseurs ///
+            const ARRAY(int, 1) & getStoreIndex(void) const;
+            const ARRAY(int, 1) & getOutIIndex(void)  const;
+            const ARRAY(int, 1) & getOutJIndex(void)  const;
+            const ARRAY(int, 1) & getOutLIndex(void)  const;
+
+            const boost::shared_ptr<CAxis>   getRelAxis  (void) const;
+            const boost::shared_ptr<CDomain> getRelDomain(void) const;
+
+            /// EntrÃ©es-sorties de champs ///
+            template <StdSize n>
+               void inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored) const;
+
+            template <StdSize n>
+               void outputField(const ARRAY(double, 1) stored,  ARRAY(double, n) field) const;
+
+            /// Destructeur ///
+            virtual ~CGrid(void);
+
+         public :
+
+            /// Accesseurs statiques ///
+            static StdString GetName(void);
+            static StdString GetDefName(void);
+
+            /// Instanciateurs Statiques ///
+            static boost::shared_ptr<CGrid>
+               CreateGrid(boost::shared_ptr<CDomain> domain);
+            static boost::shared_ptr<CGrid>
+               CreateGrid(boost::shared_ptr<CDomain> domain, boost::shared_ptr<CAxis> axis);
+
+         protected :
+
+            /// EntrÃ©es-sorties de champs (interne) ///
+            void storeField_arr(const double * const data, ARRAY(double, 1) stored) const;
+
+            /// Traitements protÃ©gÃ©s ///
+            void computeIndex(void);
+            void solveDomainRef(void);
+            void solveAxisRef(void);
+
+         private:
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            bool withAxis ;
+            bool isChecked;
+
+            boost::shared_ptr<CAxis>   axis ;
+            boost::shared_ptr<CDomain> domain ;
+
+            ARRAY(int, 1) storeIndex ;
+            ARRAY(int, 1) out_i_index ;
+            ARRAY(int, 1) out_j_index ;
+            ARRAY(int, 1) out_l_index ;
+
+      }; // class CGrid
+
+      ///--------------------------------------------------------------
+
+      template <StdSize n>
+         void CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored) const
+      { this->storeField_arr(field.data(), stored) ; }
+
+      // Declare/Define CGridGroup and CGridDefinition
+      DECLARE_GROUP(CGrid);
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CGrid__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/method.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/method.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/method.hpp	(revision 152)
@@ -0,0 +1,102 @@
+#ifndef __XMLIO_CMethod__
+#define __XMLIO_CMethod__
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CMethodGroup;
+      class CMethodAttributes;
+      class CBaseMethod;
+      class CMethod;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CMethodAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CMethod)
+#include "../config/method_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CMethod)
+
+      ///--------------------------------------------------------------
+
+      class CBaseMethod
+      { // Declare CMethod functionalities
+         public :
+
+            /// Constructeur et Destructeur ///
+            CBaseMethod(void);
+            ~CBaseMethod(void);
+
+      }; // class CBaseMethod
+
+      ///--------------------------------------------------------------
+
+      class CMethod
+         : public CObjectTemplate<CMethod>
+         , public CMethodAttributes
+         , public CBaseMethod
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CMethod>   SuperClass;
+            typedef CMethodAttributes SuperClassAttribute;
+            typedef CBaseMethod       SuperClassBase;
+
+         public :
+
+            typedef CMethodAttributes RelAttributes;
+            typedef CMethodGroup      RelGroup;
+
+            /// Constructeurs ///
+            CMethod(void);
+            explicit CMethod(const StdString & id);
+            CMethod(const CMethod & method);       // Not implemented yet.
+            CMethod(const CMethod * const method); // Not implemented yet.
+
+            /// Destructeur ///
+            virtual ~CMethod(void);
+
+            /// Accesseurs statiques ///
+            static inline StdString GetName(void);
+            static inline StdString GetDefName(void);
+
+      }; // class CMethod
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CMethodGroup and CMethodDefinition
+      DECLARE_GROUP(CMethod);
+
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CBaseMethod::CBaseMethod(void)
+      { /* Ne rien faire de plus */ }
+
+      CBaseMethod::~CBaseMethod(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      CMethod::CMethod(void)
+         : CObjectTemplate<CMethod>()
+         , CMethodAttributes()
+         , CBaseMethod()
+      { /* Ne rien faire de plus */ }
+
+      CMethod::CMethod(const StdString & id)
+         : CObjectTemplate<CMethod>(id)
+         , CMethodAttributes()
+         , CBaseMethod()
+      { /* Ne rien faire de plus */ }
+
+      CMethod::~CMethod(void)
+      { /* Ne rien faire de plus */ }
+
+      StdString CMethod::GetName(void)   { return (StdString("method")); }
+      StdString CMethod::GetDefName(void){ return (CMethod::GetName()); }
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CMethod__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/node_enum.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/node_enum.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/node_enum.hpp	(revision 152)
@@ -0,0 +1,23 @@
+#ifndef __XMLIO_NODE_ENUM__
+#define __XMLIO_NODE_ENUM__
+
+#define DECLARE_NODE(Name_, name_)     ,e##Name_, g##Name_
+#define DECLARE_NODE_PAR(Name_, name_) ,e##Name_, g##Name_
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      typedef enum _node_type
+      {
+         Unknown = 0
+
+#include "config/node_type.conf"
+
+      } ENodeType;
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_NODE_ENUM__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/node_type.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/node_type.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/node_type.hpp	(revision 152)
@@ -0,0 +1,13 @@
+#ifndef __XMLIO_NODE_TYPE__
+#define __XMLIO_NODE_TYPE__
+
+#include "axis.hpp"
+#include "domain.hpp"
+#include "field.hpp"
+#include "file.hpp"
+#include "grid.hpp"
+//#include "method.hpp"
+//#include "var.hpp"
+#include "context.hpp"
+
+#endif // __XMLIO_NODE_TYPE__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/node/var.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/node/var.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/node/var.hpp	(revision 152)
@@ -0,0 +1,102 @@
+#ifndef __XMLIO_CVar__
+#define __XMLIO_CVar__
+
+namespace xmlioserver
+{
+   namespace tree
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CVarGroup;
+      class CVarAttributes;
+      class CBaseVar;
+      class CVar;
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CVarAttribute
+      BEGIN_DECLARE_ATTRIBUTE_MAP(CVar)
+#include "../config/var_attribute.conf"
+      END_DECLARE_ATTRIBUTE_MAP(CVar)
+
+      ///--------------------------------------------------------------
+
+      class CBaseVar
+      { // Declare CVar functionalities
+         public :
+
+            /// Constructeur et Destructeur ///
+            CBaseVar(void);
+            ~CBaseVar(void);
+
+      }; // class CBaseVar
+
+      ///--------------------------------------------------------------
+
+      class CVar
+         : public CObjectTemplate<CVar>
+         , public CVarAttributes
+         , public CBaseVar
+      {
+            /// typedef ///
+            typedef CObjectTemplate<CVar>   SuperClass;
+            typedef CVarAttributes SuperClassAttribute;
+            typedef CBaseVar       SuperClassBase;
+
+         public :
+
+            typedef CVarAttributes RelAttributes;
+            typedef CVarGroup      RelGroup;
+
+            /// Constructeurs ///
+            CVar(void);
+            explicit CVar(const StdString & id);
+            CVar(const CVar & var);       // Not implemented yet.
+            CVar(const CVar * const var); // Not implemented yet.
+
+            /// Destructeur ///
+            virtual ~CVar(void);
+
+            /// Accesseurs statiques ///
+            static inline StdString GetName(void);
+            static inline StdString GetDefName(void);
+
+      }; // class CVar
+
+      ///--------------------------------------------------------------
+
+      // Declare/Define CVarGroup and CVarDefinition
+      DECLARE_GROUP(CVar);
+
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CBaseVar::CBaseVar(void)
+      { /* Ne rien faire de plus */ }
+
+      CBaseVar::~CBaseVar(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      CVar::CVar(void)
+         : CObjectTemplate<CVar>()
+         , CVarAttributes()
+         , CBaseVar()
+      { /* Ne rien faire de plus */ }
+
+      CVar::CVar(const StdString & id)
+         : CObjectTemplate<CVar>(id)
+         , CVarAttributes()
+         , CBaseVar()
+      { /* Ne rien faire de plus */ }
+
+      CVar::~CVar(void)
+      { /* Ne rien faire de plus */ }
+
+      StdString CVar::GetName(void)   { return (StdString("var")); }
+      StdString CVar::GetDefName(void){ return (CVar::GetName()); }
+
+   } // namespace tree
+} // namespace xmlioserver
+
+#endif // __XMLIO_CVar__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/object.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/object.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/object.cpp	(revision 152)
@@ -0,0 +1,44 @@
+#include "object.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   CObject::CObject(void)
+      : id(), IdDefined(false)
+   { /* Ne rien faire de plus */ }
+
+   CObject::CObject(const StdString & id)
+      : id(id), IdDefined(true)
+   { /* Ne rien faire de plus */ }
+
+   CObject::CObject(const CObject & object)
+      : id(object.id), IdDefined(object.IdDefined)
+   { /* Ne rien faire de plus */ }
+
+   CObject::~CObject(void)
+   { /* Ne rien faire de plus */ }
+
+   const StdString & CObject::getId(void) const { return (this->id); }
+
+   bool CObject::hasId(void) const  { return (this->IdDefined); }
+
+   void CObject::resetId(void) { this->IdDefined = false ;}
+
+   void CObject::setId(const StdString & id)
+   { this->id = id ; this->IdDefined = true ; }
+
+   bool CObject::operator==(const CObject & other) const
+   {
+      if(!this->hasId() || !other.hasId())
+         return (false);
+      return (this->id.compare(other.id) == 0);
+   }
+
+   bool CObject::operator!=(const CObject & other) const
+   { return (!(*this == other)); }
+
+   StdOStream & operator << (StdOStream & os, const CObject & object)
+   { os << object.toString(); return (os); }
+
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/object.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/object.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/object.hpp	(revision 152)
@@ -0,0 +1,58 @@
+#ifndef __XMLIO_CObject__
+#define __XMLIO_CObject__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+   class CObject
+   {
+      public :
+
+         /// Destructeur ///
+         virtual ~CObject(void);
+
+         /// Accesseurs ///
+         const StdString & getId(void) const;
+
+         /// Mutateurs ///
+         void resetId(void);
+         void setId(const StdString & id);
+
+         /// Tests ///
+         bool hasId(void) const;
+
+         /// OpÃ©rateurs ///
+         bool operator==(const CObject & other) const;
+         bool operator!=(const CObject & other) const;
+
+         /// Flux ///
+         friend StdOStream & operator << (StdOStream & os, const CObject & object);
+
+         /// Autres ///
+         virtual StdString toString(void) const = 0;
+         virtual void fromString(const StdString & str) = 0;
+
+      protected :
+
+         /// Constructeurs ///
+         CObject(void);
+         explicit CObject(const StdString & id);
+         CObject(const CObject & object);
+         CObject(const CObject * const object); // Not implemented.
+
+      private :
+
+         /// PropriÃ©tÃ©s ///
+         StdString id ;    // identifiant de l'Object
+         bool IdDefined ;  // true si l'object est identifiÃ©, false sinon.
+
+   }; // class CObject
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CObject__
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/object_factory.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/object_factory.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/object_factory.cpp	(revision 152)
@@ -0,0 +1,15 @@
+#include "object_factory.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+   StdString CObjectFactory::CurrContext("");
+
+   void CObjectFactory::SetCurrentContextId(const StdString & context)
+   { CObjectFactory::CurrContext = context; }
+
+   StdString & CObjectFactory::GetCurrentContextId(void)
+   { return (CObjectFactory::CurrContext); }
+
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/object_factory.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/object_factory.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/object_factory.hpp	(revision 152)
@@ -0,0 +1,59 @@
+#ifndef __XMLIO_CObjectFactory__
+#define __XMLIO_CObjectFactory__
+
+/// boost headers ///
+#include <boost/shared_ptr.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "object_template.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   class CObjectFactory
+   {
+      public :
+
+         /// Mutateurs ///
+         static void SetCurrentContextId(const StdString & context);
+
+         /// Accesseurs ///
+         static StdString & GetCurrentContextId(void);
+
+         template <typename U>
+            static inline boost::shared_ptr<U> GetObject(const StdString & id);
+
+         template <typename U>
+            static inline boost::shared_ptr<U> GetObject(const U * const object);
+
+         template <typename U>
+            static inline int GetObjectNum(void);
+         template <typename U>
+            static inline int GetObjectIdNum(void);
+
+         template <typename U>
+            static inline const std::vector<boost::shared_ptr<U> > &
+               GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId());
+
+         /// Tests ///
+         template <typename U>
+            static inline bool HasObject(const StdString & id);
+
+         /// Instanciateur ///
+         template <typename U>
+            static inline boost::shared_ptr<U> CreateObject(const StdString & id = StdString(""));
+
+
+      private :
+
+         /// PropriÃ©tÃ©s statiques ///
+         static StdString CurrContext;
+
+   }; // class CObjectFactory
+} // namespace xmlioserver
+
+#include "object_factory_impl.hpp"
+
+#endif // __XMLIO_CObjectFactory__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/object_factory_impl.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/object_factory_impl.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/object_factory_impl.hpp	(revision 152)
@@ -0,0 +1,107 @@
+#ifndef __XMLIO_CObjectFactory_impl__
+#define __XMLIO_CObjectFactory_impl__
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   template <typename U>
+       int CObjectFactory::GetObjectNum(void)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::GetObjectNum(void)",
+               << "please define current context id !");
+      return (U::AllVectObj[CObjectFactory::CurrContext].size());
+   }
+
+   template <typename U>
+      int CObjectFactory::GetObjectIdNum(void)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::GetObjectIdNum(void)",
+               << "please define current context id !");
+      return (U::AllMapObj[CObjectFactory::CurrContext].size());
+   }
+
+   template <typename U>
+      bool CObjectFactory::HasObject(const StdString & id)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::HasObject(const StdString & id)",
+               << "[ id = " << id << " ] please define current context id !");
+      return (U::AllMapObj[CObjectFactory::CurrContext].find(id) !=
+              U::AllMapObj[CObjectFactory::CurrContext].end());
+   }
+
+   template <typename U>
+      boost::shared_ptr<U> CObjectFactory::GetObject(const U * const object)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::GetObject(const U * const object)",
+               << "please define current context id !");
+      std::vector<boost::shared_ptr<U> > & vect =
+                     U::AllVectObj[CObjectFactory::CurrContext];
+                     
+      typename std::vector<boost::shared_ptr<U> >::const_iterator 
+         it = vect.begin(), end = vect.end();
+      
+      for (; it != end; it++)
+      {
+         boost::shared_ptr<U> ptr = *it;
+         if (ptr.get() == object)
+            return (ptr);
+      }
+      
+      ERROR("CObjectFactory::GetObject(const U * const object)",
+               << "[type = " << U::GetName() << "]"
+               << " object was not found !");
+      return (boost::shared_ptr<U>()); // jamais atteint
+   }
+
+   template <typename U>
+      boost::shared_ptr<U> CObjectFactory::GetObject(const StdString & id)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::GetObject(const StdString & id)",
+               << "[ id = " << id << " ] please define current context id !");
+      if (!CObjectFactory::HasObject<U>(id))
+         ERROR("CObjectFactory::GetObject(const StdString & id)",
+               << "[ id = " << id << ", U = " << U::GetName() << " ] "
+               << " object is not referenced !");
+      return (U::AllMapObj[CObjectFactory::CurrContext][id]);
+   }
+
+   template <typename U>
+      boost::shared_ptr<U> CObjectFactory::CreateObject(const StdString & id)
+   {
+      if (CurrContext.size() == 0)
+         ERROR("CObjectFactory::CreateObject(const StdString & id)",
+               << "[ id = " << id << " ] please define current context id !");
+      if (id.size() == 0)
+      {
+         boost::shared_ptr<U> value(new U);
+         U::AllVectObj[CObjectFactory::CurrContext].insert
+            (U::AllVectObj[CObjectFactory::CurrContext].end(), value);
+         return (value);
+      }
+      else if (CObjectFactory::HasObject<U>(id))
+         return (CObjectFactory::GetObject<U>(id));
+      else
+      {
+         boost::shared_ptr<U> value(new U(id));
+         U::AllVectObj[CObjectFactory::CurrContext].insert
+            (U::AllVectObj[CObjectFactory::CurrContext].end(), value);
+         U::AllMapObj[CObjectFactory::CurrContext].insert(std::make_pair(id, value));
+         return (value);
+      }
+   }
+
+   template <typename U>
+      const std::vector<boost::shared_ptr<U> > &
+         CObjectFactory::GetObjectVector(const StdString & context)
+   {
+      return (U::AllVectObj[context]);
+   }
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CObjectFactory_impl__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/object_template.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/object_template.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/object_template.hpp	(revision 152)
@@ -0,0 +1,67 @@
+#ifndef __XMLIO_CObjectTemplate__
+#define __XMLIO_CObjectTemplate__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "attribute_map.hpp"
+#include "node/node_enum.hpp"
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©clarations ////////////////////// ///
+   template <class T>
+      class CObjectTemplate
+         : public CObject
+         , public virtual tree::CAttributeMap
+   {
+
+         /// Friend ///
+         friend class CObjectFactory;
+
+         /// Typedef ///
+         typedef tree::CAttributeMap SuperClassMap;
+         typedef CObject SuperClass;
+         typedef T DerivedType;
+
+      public :
+
+         /// Autres ///
+         virtual StdString toString(void) const;
+         virtual void fromString(const StdString & str);
+
+         virtual void parse(xml::CXMLNode & node);
+
+         /// Test ///
+         virtual bool hasChild(void) const;
+
+         /// Traitements ///
+         virtual void solveDescInheritance(const CAttributeMap * const parent = 0);
+
+         /// Accesseur statique ///
+         static std::vector<boost::shared_ptr<DerivedType> > & GetAllVectobject(const StdString & contextId);
+
+         /// Destructeur ///
+         virtual ~CObjectTemplate(void);
+
+      protected :
+
+         /// Constructeurs ///
+         CObjectTemplate(void);
+         explicit CObjectTemplate(const StdString & id);
+         CObjectTemplate(const CObjectTemplate<T> & object,
+                         bool withAttrList = true, bool withId = true);
+         CObjectTemplate(const CObjectTemplate<T> * const object); // Not implemented.
+
+      private :
+
+         /// PropriÃ©tÃ©s statiques ///
+         static xios_map<StdString,
+                xios_map<StdString,
+                boost::shared_ptr<DerivedType> > > AllMapObj;
+         static xios_map<StdString,
+                std::vector<boost::shared_ptr<DerivedType> > > AllVectObj;
+
+   }; // class CObjectTemplate
+} // namespace xmlioserver
+
+#endif // __XMLIO_CObjectTemplate__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/object_template_impl.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/object_template_impl.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/object_template_impl.hpp	(revision 152)
@@ -0,0 +1,81 @@
+#ifndef __XMLIO_CObjectTemplate_impl__
+#define __XMLIO_CObjectTemplate_impl__
+
+namespace xmlioserver
+{
+   /// ////////////////////// DÃ©finitions ////////////////////// ///
+   template <class T>
+      xios_map<StdString,
+      xios_map<StdString,
+      boost::shared_ptr<T> > > CObjectTemplate<T>::AllMapObj;
+
+   template <class T>
+      xios_map<StdString,
+      std::vector<boost::shared_ptr<T> > > CObjectTemplate<T>::AllVectObj;
+
+   template <class T>
+      CObjectTemplate<T>::CObjectTemplate(void)
+         : tree::CAttributeMap()
+         , CObject()
+   { /* Ne rien faire de plus */ }
+
+   template <class T>
+      CObjectTemplate<T>::CObjectTemplate(const StdString & id)
+         : tree::CAttributeMap()
+         , CObject(id)
+   { /* Ne rien faire de plus */ }
+
+   template <class T>
+      CObjectTemplate<T>::CObjectTemplate(const CObjectTemplate<T> & object,
+                                          bool withAttrList, bool withId)
+         : tree::CAttributeMap()
+         , CObject()
+   {
+      if (object.hasId() && withId)
+         this->setId(object.getId());
+      ERROR("CObjectTemplate<T> construtor 3", << "Not completly implemented yet !");
+   }
+
+   template <class T>
+      std::vector<boost::shared_ptr<T> > &
+         CObjectTemplate<T>::GetAllVectobject(const StdString & contextId)
+   { return (CObjectTemplate<T>::AllVectObj[contextId]); }
+
+   template <class T>
+      CObjectTemplate<T>::~CObjectTemplate(void)
+   { /* Ne rien faire de plus */ }
+
+   template <class T>
+      StdString CObjectTemplate<T>::toString(void) const
+   {
+      StdOStringStream oss;
+      oss << "< " << T::GetName();
+      if (this->hasId())
+         oss << " id=\"" << this->getId() << "\"";
+      oss << " " << SuperClassMap::toString() << "/>";
+      return (oss.str());
+   }
+
+   template <class T>
+      void CObjectTemplate<T>::fromString(const StdString & str)
+   { ERROR("CObjectTemplate<T>::fromString(str)",
+            << "[ str = " << str << "] Not implemented yet !"); }
+
+   template <class T>
+      void CObjectTemplate<T>::parse(xml::CXMLNode & node)
+   {
+      xml::THashAttributes attributes = node.getAttributes();
+      CAttributeMap::setAttributes(attributes);
+   }
+
+   template <class T>
+      bool CObjectTemplate<T>::hasChild(void) const
+   { return (false); }
+
+   template <class T>
+      void CObjectTemplate<T>::solveDescInheritance(const CAttributeMap * const parent)
+   { SuperClassMap::setAttributes(parent); }
+
+} // namespace xmlioserver
+
+#endif // __XMLIO_CObjectTemplate_impl__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.cpp	(revision 152)
@@ -0,0 +1,381 @@
+#include "nc4_data_output.hpp"
+
+#include <boost/lexical_cast.hpp>
+#include "attribute_template_impl.hpp"
+
+#include "node/file.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      CNc4DataOutput::CNc4DataOutput
+         (const StdString & filename, bool exist)
+            : SuperClass()
+            , SuperClassWriter(filename, exist)
+            , filename(filename)
+      {
+         StdString timeid = StdString("time_counter");
+         SuperClass::type = MULTI_FILE;
+         if (!exist)
+            SuperClassWriter::addDimension(timeid);
+      }
+
+      CNc4DataOutput::CNc4DataOutput
+         (const StdString & filename, bool exist, bool multigroup, MPI_Comm comm_server)
+            : SuperClass()
+            , SuperClassWriter(filename, exist, &comm_server)
+            , comm_server(comm_server)
+            , filename(filename)
+      {
+         StdString timeid = StdString("time_counter");
+         SuperClass::type = (multigroup) ? MULTI_GROUP : ONE_FILE;
+         if (!exist)
+            SuperClassWriter::addDimension(timeid);
+      }
+
+      CNc4DataOutput::CNc4DataOutput
+         (const StdString & filename, bool exist, bool multigroup, comm::MPIComm comm_server, bool)
+            : SuperClass()
+            , SuperClassWriter(filename, exist, &comm_server, true)
+            , filename(filename)
+      {
+         StdString timeid = StdString("time_counter");
+         SuperClass::type = (multigroup) ? MULTI_GROUP : ONE_FILE;
+         if (!exist)
+            SuperClassWriter::addDimension(timeid);
+      }
+
+      CNc4DataOutput::~CNc4DataOutput(void)
+      { /* Ne rien faire de plus */ }
+
+      ///--------------------------------------------------------------
+
+      const StdString & CNc4DataOutput::getFileName(void) const
+      {
+         return (this->filename);
+      }
+
+      //---------------------------------------------------------------
+
+      void CNc4DataOutput::writeDomain_(const boost::shared_ptr<tree::CDomain> domain)
+      {
+         if (domain->IsWritten(this->filename)) return;
+         domain->checkAttributes();
+
+         std::vector<StdString> dim0, dim1;
+         StdString domid     = (!domain->name.isEmpty())
+                             ? domain->name.getValue() : domain->getId();
+         StdString lonid     = StdString("lon_").append(domid);
+         StdString latid     = StdString("lat_").append(domid);
+         StdString lonid_loc = StdString("lon_").append(domid).append("_local");
+         StdString latid_loc = StdString("lat_").append(domid).append("_local");
+         StdString maskid    = StdString("mask_").append(domid).append("_local");
+
+         boost::shared_ptr<CMask> mask = domain->getLocalMask();
+
+         unsigned int ssize = domain->ni.getValue() * domain->nj.getValue();
+         bool isCurvilinear = (domain->lonvalue.getValue()->size() == ssize);
+
+         SuperClassWriter::addDimension(lonid, domain->ni_glo.getValue());
+         SuperClassWriter::addDimension(latid, domain->nj_glo.getValue());
+
+         if (isCurvilinear)
+         {
+            dim0.push_back(latid_loc); dim0.push_back(lonid_loc);
+            lonid = StdString("nav_lon_").append(domid);
+            latid = StdString("nav_lat_").append(domid);
+         }
+         else
+         {
+            dim0.push_back(latid_loc);
+            dim1.push_back(lonid_loc);
+         }
+         switch (SuperClass::type)
+         {
+            case (MULTI_FILE) :
+            {
+               SuperClassWriter::addDimension(lonid_loc, domain->ni.getValue());
+               SuperClassWriter::addDimension(latid_loc, domain->nj.getValue());
+               this->writeLocalAttributes(domain->ibegin.getValue(), domain->iend.getValue(),
+                                          domain->jbegin.getValue(), domain->jend.getValue(),
+                                          domid);
+               if (isCurvilinear)
+               {
+                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);
+               }
+               else
+               {
+                  SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);
+                  SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1);
+               }
+               this->writeAxisAttributes
+                  (latid, "X", "longitude", "Longitude", "degrees_east", domid);
+               this->writeAxisAttributes
+                  (lonid, "Y", "latitude", "Latitude", "degrees_north", domid);
+
+               dim0.clear();
+               dim0.push_back(latid_loc);
+               dim0.push_back(lonid_loc);
+
+               SuperClassWriter::addVariable(maskid, NC_INT, dim0);
+
+               this->writeMaskAttributes(maskid,
+                  domain->data_dim.getValue(),
+                  domain->data_ni.getValue(),
+                  domain->data_nj.getValue(),
+                  domain->data_ibegin.getValue(),
+                  domain->data_jbegin.getValue());
+
+               SuperClassWriter::definition_end();
+               SuperClassWriter::writeData(domain->latvalue.getValue(), latid, true, 0);
+               SuperClassWriter::writeData(domain->lonvalue.getValue(), lonid, true, 0);
+               SuperClassWriter::writeData(mask, maskid);
+               SuperClassWriter::definition_start();
+
+               break;
+            }
+            default :
+               ERROR("CNc4DataOutput::writeDomain(domain)",
+                     << "[ type = " << SuperClass::type << "]"
+                     << " not implemented yet !");
+         }
+         domain->addRelFile(this->filename);
+      }
+
+      //--------------------------------------------------------------
+
+      void CNc4DataOutput::writeAxis_(const boost::shared_ptr<tree::CAxis> axis)
+      {
+         if (axis->IsWritten(this->filename)) return;
+         axis->checkAttributes();
+         std::vector<StdString> dims;
+         StdString axisid = (!axis->name.isEmpty())
+                           ? axis->name.getValue() : axis->getId();
+         SuperClassWriter::addDimension(axisid, axis->size.getValue());
+         dims.push_back(axisid);
+
+         switch (SuperClass::type)
+         {
+            case (MULTI_FILE) :
+            {
+               SuperClassWriter::addVariable(axisid, NC_FLOAT, dims);
+
+               SuperClassWriter::addAttribute("axis", StdString("Z"), &axisid);
+
+               if (!axis->standard_name.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("standard_name",  axis->standard_name.getValue(), &axisid);
+
+               if (!axis->long_name.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("long_name", axis->long_name.getValue(), &axisid);
+
+               if (!axis->unit.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("units", axis->unit.getValue(), &axisid);
+
+               SuperClassWriter::definition_end();
+               SuperClassWriter::writeData(axis->zvalue.getValue(), axisid, true, 0);
+               SuperClassWriter::definition_start();
+
+               break;
+            }
+            default :
+               ERROR("CNc4DataOutput::writeDomain(domain)",
+                     << "[ type = " << SuperClass::type << "]"
+                     << " not implemented yet !");
+         }
+         axis->addRelFile(this->filename);
+      }
+
+      //--------------------------------------------------------------
+
+      void CNc4DataOutput::writeField_(const boost::shared_ptr<tree::CField> field)
+      {
+         std::vector<StdString> dims, coodinates;
+         boost::shared_ptr<CGrid> grid =
+            CObjectFactory::GetObject<CGrid>(field->grid_ref.getValue());
+         boost::shared_ptr<CDomain> domain =
+            CObjectFactory::GetObject<CDomain>(grid->domain_ref.getValue());
+
+         StdString timeid    = StdString("time_counter");
+         StdString domid     = (!domain->name.isEmpty())
+                             ? domain->name.getValue() : domain->getId();
+         StdString lonid     = StdString("lon_").append(domid);
+         StdString latid     = StdString("lat_").append(domid);
+         StdString lonid_loc = StdString("lon_").append(domid).append("_local");
+         StdString latid_loc = StdString("lat_").append(domid).append("_local");
+         StdString fieldid   = (!field->name.isEmpty())
+                             ? field->name.getValue() : field->getBaseFieldReference()->getId();
+
+         unsigned int ssize = domain->ni.getValue() * domain->nj.getValue();
+         bool isCurvilinear = (domain->lonvalue.getValue()->size() == ssize);
+
+         nc_type type = (!field->prec.isEmpty() &&
+                        ( field->prec.getValue() == 4))
+                        ? NC_FLOAT : NC_DOUBLE;
+         bool wtime   = !(!field->operation.isEmpty() &&
+                         ( field->operation.getValue().compare("once") == 0));
+
+         if (wtime) dims.push_back(timeid);
+
+         if (!grid->axis_ref.isEmpty())
+         {
+            boost::shared_ptr<CAxis> axis =
+               CObjectFactory::GetObject<CAxis>(grid->axis_ref.getValue());
+            StdString axisid = (!axis->name.isEmpty())
+                             ? axis->name.getValue() : axis->getId();
+            dims.push_back(axisid);
+            coodinates.push_back(axisid);
+         }
+
+         if (isCurvilinear)
+         {
+            coodinates.push_back(StdString("nav_lat_").append(domid));
+            coodinates.push_back(StdString("nav_lon_").append(domid));
+         }
+         else
+         {
+            coodinates.push_back(latid);
+            coodinates.push_back(lonid);
+         }
+
+         switch (SuperClass::type)
+         {
+            case (MULTI_FILE) :
+            {
+               dims.push_back(latid_loc);
+               dims.push_back(lonid_loc);
+               SuperClassWriter::addVariable(fieldid, type, dims);
+
+               if (!field->standard_name.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("standard_name",  field->standard_name.getValue(), &fieldid);
+
+               if (!field->long_name.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("long_name", field->long_name.getValue(), &fieldid);
+
+               if (!field->unit.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("units", field->unit.getValue(), &fieldid);
+
+               if (!field->operation.isEmpty())
+                  SuperClassWriter::addAttribute
+                     ("online_operation", field->operation.getValue(), &fieldid);
+
+               { 
+                  StdString coordstr; //boost::algorithm::join(coodinates, " ")
+                  std::vector<StdString>::iterator 
+                     itc = coodinates.begin(), endc = coodinates.end();
+                  
+                  for (; itc!= endc; itc++)
+                  {
+                     StdString & coord = *itc;
+                     if (itc+1 != endc)
+                           coordstr.append(coord).append(" ");
+                     else  coordstr.append(coord);
+                  }
+
+                  SuperClassWriter::addAttribute("coordinates", coordstr, &fieldid);
+
+               }
+
+               break;
+            }
+            default :
+               ERROR("CNc4DataOutput::writeDomain(domain)",
+                     << "[ type = " << SuperClass::type << "]"
+                     << " not implemented yet !");
+         }
+      }
+
+      //--------------------------------------------------------------
+
+      void CNc4DataOutput::writeFile_ (const boost::shared_ptr<tree::CFile> file)
+      {
+         StdString filename = (!file->name.isEmpty())
+                            ? file->name.getValue() : file->getId();
+         StdString description = (!file->description.isEmpty())
+                               ? file->description.getValue()
+                               : StdString("Created by xmlioserver");
+         this->writeFileAttributes(filename, description,
+                                   StdString ("CF-1.1"),
+                                   StdString("An IPSL model"),
+                                   this->getTimeStamp());
+      }
+
+      //---------------------------------------------------------------
+
+      StdString CNc4DataOutput::getTimeStamp(void) const
+      {
+         const int buffer_size = 100;
+         time_t rawtime;
+         struct tm * timeinfo = NULL;
+         char buffer [buffer_size];
+
+         time ( &rawtime );
+         timeinfo = localtime ( &rawtime );
+         strftime (buffer, buffer_size, "%Y-%b-%d %H:%M:%S %Z", timeinfo);
+
+         return (StdString(buffer));
+      }
+
+      //---------------------------------------------------------------
+      void CNc4DataOutput::writeAxisAttributes(const StdString & axis_name,
+                                               const StdString & axis,
+                                               const StdString & standard_name,
+                                               const StdString & long_name,
+                                               const StdString & units,
+                                               const StdString & nav_model)
+      {
+         SuperClassWriter::addAttribute("axis"         , axis         , &axis_name);
+         SuperClassWriter::addAttribute("standard_name", standard_name, &axis_name);
+         SuperClassWriter::addAttribute("long_name"    , long_name    , &axis_name);
+         SuperClassWriter::addAttribute("units"        , units        , &axis_name);
+         SuperClassWriter::addAttribute("nav_model"    , nav_model    , &axis_name);
+      }
+
+      void CNc4DataOutput::writeLocalAttributes
+         (int ibegin, int iend, int jbegin, int jend, StdString domid)
+      {
+         SuperClassWriter::addAttribute(StdString("ibegin_").append(domid), ibegin);
+         SuperClassWriter::addAttribute(StdString("iend_"  ).append(domid), iend);
+         SuperClassWriter::addAttribute(StdString("jbegin_").append(domid), jbegin);
+         SuperClassWriter::addAttribute(StdString("jend_"  ).append(domid), jend);
+      }
+
+      void CNc4DataOutput:: writeFileAttributes(const StdString & name,
+                                                const StdString & description,
+                                                const StdString & conventions,
+                                                const StdString & production,
+                                                const StdString & timeStamp)
+      {
+         SuperClassWriter::addAttribute("name"       , name);
+         SuperClassWriter::addAttribute("description", description);
+         SuperClassWriter::addAttribute("conventions", conventions);
+         SuperClassWriter::addAttribute("production" , production);
+         SuperClassWriter::addAttribute("timeStamp"  , timeStamp);
+      }
+
+      void CNc4DataOutput::writeMaskAttributes(const StdString & mask_name,
+                                               int data_dim,
+                                               int data_ni,
+                                               int data_nj,
+                                               int data_ibegin,
+                                               int data_jbegin)
+      {
+         SuperClassWriter::addAttribute("data_dim"   , data_dim   , &mask_name);
+         SuperClassWriter::addAttribute("data_ni"    , data_ni    , &mask_name);
+         SuperClassWriter::addAttribute("data_nj"    , data_nj    , &mask_name);
+         SuperClassWriter::addAttribute("data_ibegin", data_ibegin, &mask_name);
+         SuperClassWriter::addAttribute("data_jbegin", data_jbegin, &mask_name);
+      }
+
+      ///--------------------------------------------------------------
+
+   } // namespace io
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/output/nc4_data_output.hpp	(revision 152)
@@ -0,0 +1,92 @@
+#ifndef __XMLIO_NC4_DATA_OUTPUT__
+#define __XMLIO_NC4_DATA_OUTPUT__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "onetcdf4.hpp"
+#include "../data_output.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class CNc4DataOutput
+         : protected CONetCDF4
+         , public virtual CDataOutput
+      {
+         public :
+
+            /// DÃ©finition de type ///
+            typedef CONetCDF4   SuperClassWriter;
+            typedef CDataOutput SuperClass;
+
+            /// Constructeurs ///
+            CNc4DataOutput
+               (const StdString & filename, bool exist);
+            CNc4DataOutput
+               (const StdString & filename, bool exist, bool multigroup, MPI_Comm comm_server);
+            CNc4DataOutput
+               (const StdString & filename, bool exist, bool multigroup, comm::MPIComm comm_server, bool);
+
+            CNc4DataOutput(const CNc4DataOutput & dataoutput);       // Not implemented.
+            CNc4DataOutput(const CNc4DataOutput * const dataoutput); // Not implemented.
+
+            /// Accesseur ///
+            const StdString & getFileName(void) const;
+
+            /// Destructeur ///
+            virtual ~CNc4DataOutput(void);
+
+         protected :
+
+            /// Ecriture ///
+            virtual void writeDomain_(const boost::shared_ptr<tree::CDomain> domain);
+            virtual void writeAxis_  (const boost::shared_ptr<tree::CAxis>   axis);
+            virtual void writeField_ (const boost::shared_ptr<tree::CField>  field);
+            virtual void writeFile_  (const boost::shared_ptr<tree::CFile>   file);
+
+            void writeLocalAttributes(int ibegin, int iend, int jbegin, int jend, StdString domid);
+
+            void writeFileAttributes(const StdString & name,
+                                     const StdString & description,
+                                     const StdString & conventions,
+                                     const StdString & production,
+                                     const StdString & timeStamp);
+
+            void writeMaskAttributes(const StdString & mask_name,
+                                     int data_dim,
+                                     int data_ni,
+                                     int data_nj,
+                                     int data_ibegin,
+                                     int data_jbegin);
+
+            void writeAxisAttributes(const StdString & axis_name,
+                                     const StdString & axis,
+                                     const StdString & standard_name,
+                                     const StdString & long_name,
+                                     const StdString & units,
+                                     const StdString & nav_model);
+            template <class T>
+               void writeAxisData(const StdString & axis_name,
+                                  const ARRAY(T, 1) data,
+                                  bool collective, StdSize record,
+                                  const std::vector<StdSize> * start = NULL,
+                                  const std::vector<StdSize> * count = NULL);
+
+         private :
+
+            /// Traitement ///
+            StdString getTimeStamp(void) const;
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            MPI_Comm comm_server;
+            const StdString filename;
+
+      }; // class CNc4DataOutput
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_NC4_DATA_OUTPUT__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.cpp	(revision 152)
@@ -0,0 +1,356 @@
+#include "onetcdf4.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CONetCDF4::CONetCDF4
+         (const StdString & filename, bool exist, const MPI_Comm * comm)
+            : path()
+      {
+         this->wmpi = (comm != NULL);
+         this->initialize(filename, exist, comm);
+      }
+
+      CONetCDF4::CONetCDF4
+         (const StdString & filename, bool exist, const comm::MPIComm * comm, bool)
+         : path()
+      {
+         this->wmpi = (comm != NULL);
+         MPI_Comm * null_comm = NULL;
+         if (comm == NULL)
+            this->initialize(filename, exist, null_comm);
+         else
+         {
+            MPI_Comm comm_c = MPI_Comm_f2c(*comm);
+            this->initialize(filename, exist, &comm_c);
+         }
+      }
+
+      CONetCDF4::~CONetCDF4(void)
+      {
+         CheckError(nc_close(this->ncidp));
+      }
+
+      ///--------------------------------------------------------------
+
+      void CONetCDF4::initialize
+         (const StdString & filename, bool exist, const MPI_Comm * comm)
+      {
+         if (!exist)
+         {
+            if (comm != NULL)
+            {
+               CheckError(nc_create_par
+                  (filename.c_str(), NC_NETCDF4|NC_MPIPOSIX, *comm, MPI_INFO_NULL, &this->ncidp));
+            }
+            else CheckError(nc_create(filename.c_str(), NC_NETCDF4, &this->ncidp));
+         }
+         else
+         {
+            if (comm != NULL)
+               CheckError(nc_open_par
+                  (filename.c_str(), NC_NETCDF4|NC_MPIIO, *comm, MPI_INFO_NULL, &this->ncidp));
+            else  CheckError(nc_open(filename.c_str(), NC_NETCDF4, &this->ncidp));
+         }
+      }
+
+      void CONetCDF4::definition_start(void)
+      { CheckError(nc_redef(this->ncidp)); }
+
+      void CONetCDF4::definition_end(void)
+      { CheckError(nc_enddef(this->ncidp)); }
+
+      void CONetCDF4::CheckError(int status)
+      {
+         if (status != NC_NOERR)
+         {
+            StdString errormsg (nc_strerror(status)); // fuite mÃ©moire ici ?
+            ERROR("CONetCDF4::CheckError(int status)",
+                  << "[ status = " << status << " ] " << errormsg);
+         }
+      }
+
+      //---------------------------------------------------------------
+      int CONetCDF4::getCurrentGroup(void)
+      {
+         return (this->getGroup(this->getCurrentPath()));
+      }
+
+      int CONetCDF4::getGroup(const CONetCDF4Path & path)
+      {
+         int retvalue = this->ncidp;
+         
+         CONetCDF4Path::const_iterator
+            it  = path.begin(), end = path.end();
+
+         for (;it != end; it++)
+         {
+            const StdString & groupid = *it;
+            CheckError(nc_inq_ncid(retvalue, const_cast<char*>(groupid.c_str()), &retvalue));
+         }
+         return (retvalue);
+      }
+
+      int CONetCDF4::getVariable(const StdString & varname)
+      {
+         int varid = 0;
+         int grpid = this->getCurrentGroup();
+         CheckError(nc_inq_varid (grpid, varname.c_str(), &varid));
+         return (varid);
+      }
+
+      int CONetCDF4::getDimension(const StdString & dimname)
+      {
+         int dimid = 0;
+         int grpid = this->getCurrentGroup();
+         CheckError(nc_inq_dimid (grpid, dimname.c_str(), &dimid));
+         return (dimid);
+      }
+
+      int CONetCDF4::getUnlimitedDimension(void)
+      {
+         int dimid = 0;
+         int grpid = this->getCurrentGroup();
+         CheckError(nc_inq_unlimdim (grpid, &dimid));
+         return (dimid);
+      }
+
+      std::vector<StdSize> CONetCDF4::getDimensions(const StdString & varname)
+      {
+         StdSize size = 0;
+         std::vector<StdSize> retvalue;
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(varname);
+         int nbdim = 0, *dimid = NULL;
+
+         CheckError(nc_inq_varndims(grpid, varid, &nbdim));
+         dimid = new int[nbdim]();
+         CheckError(nc_inq_vardimid(grpid, varid, dimid));
+
+         for (int i = 0; i < nbdim; i++)
+         {
+            CheckError(nc_inq_dimlen (grpid, dimid[i], &size));
+            if (size == NC_UNLIMITED)
+                size = UNLIMITED_DIM;
+            retvalue.push_back(size);
+         }
+
+         return (retvalue);
+      }
+
+      //---------------------------------------------------------------
+
+      const CONetCDF4::CONetCDF4Path & CONetCDF4::getCurrentPath(void) const
+      { return (this->path); }
+
+      void CONetCDF4::setCurrentPath(const CONetCDF4Path & path)
+      { this->path = path; }
+
+      //---------------------------------------------------------------
+
+      int CONetCDF4::addGroup(const StdString & name)
+      {
+         int retvalue = 0;
+         int grpid = this->getCurrentGroup();
+         CheckError(nc_def_grp(grpid, const_cast<char*>(name.c_str()), &retvalue));
+         return (retvalue);
+      }
+
+      int CONetCDF4::addDimension(const StdString& name, const StdSize size)
+      {
+         int retvalue = 0;
+         int grpid = this->getCurrentGroup();
+         if (size != UNLIMITED_DIM)
+            CheckError(nc_def_dim (grpid, name.c_str(), size, &retvalue));
+         else
+            CheckError(nc_def_dim (grpid, name.c_str(), NC_UNLIMITED, &retvalue));
+         return (retvalue);
+      }
+
+      int CONetCDF4::addVariable(const StdString & name, nc_type type,
+                                  const std::vector<StdString> & dim)
+      {
+         int retvalue = 0;
+         std::vector<int> dimids;
+         int grpid = this->getCurrentGroup();
+         
+         std::vector<StdString>::const_iterator
+            it  = dim.begin(), end = dim.end();
+
+         for (;it != end; it++)
+         {
+            const StdString & dimid = *it;
+            dimids.push_back(this->getDimension(dimid));
+         }
+         CheckError(nc_def_var (grpid, name.c_str(), type, dimids.size(), &(dimids[0]), &retvalue));
+         return (retvalue);
+      }
+
+      //---------------------------------------------------------------
+
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const StdString & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att(grpid, varid, name.c_str(), NC_CHAR, value.size()+1, value.c_str()));
+         //CheckError(nc_put_att_string(grpid, varid, name.c_str(), 1, &str));
+      }
+
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const double & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_double(grpid, varid, name.c_str(), NC_DOUBLE,1, &value));
+      }
+
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const float & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_float(grpid, varid, name.c_str(), NC_FLOAT, 1, &value));
+      }
+
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const int & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_int(grpid, varid, name.c_str(), NC_INT,1, &value));
+      }
+
+      //---------------------------------------------------------------
+
+      void CONetCDF4::getWriteDataInfos(const StdString & name, StdSize record, StdSize & array_size,
+                                        std::vector<StdSize> & sstart,
+                                        std::vector<StdSize> & scount,
+                                        const std::vector<StdSize> * start,
+                                        const std::vector<StdSize> * count)
+      {
+         std::vector<StdSize> sizes = this->getDimensions(name);       
+         std::vector<StdSize>::const_iterator
+            it  = sizes.begin(), end = sizes.end();
+         int i = 0;
+
+         for (;it != end; it++)
+         {
+            StdSize  s = *it;
+            if ((start != NULL) && (count != NULL))
+            {
+               if (s == UNLIMITED_DIM)
+               {
+                  sstart.push_back(record);
+                  scount.push_back(1);
+               }
+               else
+               {
+                  sstart.push_back((*start)[i]);
+                  scount.push_back((*count)[i]);
+                  array_size *= (*count)[i];
+                  i++;
+               }
+            }
+            else
+            {
+               if (s == UNLIMITED_DIM)
+               {
+                  sstart.push_back(record);
+                  scount.push_back(1);
+               }
+               else
+               {
+                  sstart.push_back(0);
+                  scount.push_back(sizes[i]);
+                  array_size *= sizes[i];
+               }
+               i++;
+            }
+         }
+      }
+
+      template <>
+         void CONetCDF4::writeData(const ARRAY(double, 1) data, const StdString & name,
+                                   bool collective, StdSize record,
+                                   const std::vector<StdSize> * start,
+                                   const std::vector<StdSize> * count)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(name);
+         StdSize array_size = 1;
+         std::vector<StdSize> sstart, scount;
+
+         if (this->wmpi && collective)
+            CheckError(nc_var_par_access(grpid, varid, NC_COLLECTIVE));
+         if (this->wmpi && !collective)
+            CheckError(nc_var_par_access(grpid, varid, NC_INDEPENDENT));
+
+         this->getWriteDataInfos
+         (name, record, array_size,  sstart, scount, start, count);
+         CheckError(nc_put_vara_double(grpid, varid, &(sstart[0]), &(scount[0]), data->data()));
+      }
+
+      template <>
+         void CONetCDF4::writeData(const ARRAY(int, 1) data, const StdString & name,
+                                   bool collective, StdSize record,
+                                   const std::vector<StdSize> * start,
+                                   const std::vector<StdSize> * count)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(name);
+         StdSize array_size = 1;
+         std::vector<StdSize> sstart, scount;
+
+         if (this->wmpi && collective)
+            CheckError(nc_var_par_access(grpid, varid, NC_COLLECTIVE));
+         if (this->wmpi && !collective)
+            CheckError(nc_var_par_access(grpid, varid, NC_INDEPENDENT));
+
+         this->getWriteDataInfos
+         (name, record, array_size,  sstart, scount, start, count);
+          CheckError(nc_put_vara_int(grpid, varid, &(sstart[0]), &(scount[0]), data->data()));
+      }
+
+      template <>
+         void CONetCDF4::writeData(const ARRAY(float, 1) data, const StdString & name,
+                                   bool collective, StdSize record,
+                                   const std::vector<StdSize> * start,
+                                   const std::vector<StdSize> * count)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(name);
+         StdSize array_size = 1;
+         std::vector<StdSize> sstart, scount;
+
+         if (this->wmpi && collective)
+            CheckError(nc_var_par_access(grpid, varid, NC_COLLECTIVE));
+         if (this->wmpi && !collective)
+            CheckError(nc_var_par_access(grpid, varid, NC_INDEPENDENT));
+
+         this->getWriteDataInfos
+         (name, record, array_size,  sstart, scount, start, count);
+          CheckError(nc_put_vara_float(grpid, varid, &(sstart[0]), &(scount[0]), data->data()));
+      }
+
+      void CONetCDF4::writeData(const boost::shared_ptr<CMask> data, const StdString & name)
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = this->getVariable(name);
+         StdSize array_size = 1;
+         std::vector<StdSize> sstart, scount;
+
+         this->getWriteDataInfos(name, 0, array_size,  sstart, scount, NULL, NULL);
+          CheckError(nc_put_vara_int(grpid, varid, &(sstart[0]), &(scount[0]), data->getData()));
+      }
+
+      ///--------------------------------------------------------------
+   } // namespace io
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/output/onetcdf4.hpp	(revision 152)
@@ -0,0 +1,108 @@
+#ifndef __XMLIO_INETCDF4__
+#define __XMLIO_INETCDF4__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "array.hpp"
+#include "mask.hpp"
+#include "../data_output.hpp"
+#include "manager/mpi_manager.hpp"
+
+#include <mpi.h>
+#define MPI_INCLUDED
+#include <netcdf.h>
+
+#ifndef UNLIMITED_DIM
+   #define UNLIMITED_DIM (size_t)(-1)
+#endif  //UNLIMITED_DIM
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CONetCDF4
+         : public virtual CDataOutput
+      {
+         public :
+
+            /// DÃ©finition de type ///
+            typedef std::vector<StdString> CONetCDF4Path;
+
+            /// Constructeurs ///
+            CONetCDF4(const StdString & filename, bool exist, const MPI_Comm * comm = NULL);
+            CONetCDF4(const StdString & filename, bool exist, const comm::MPIComm * comm, bool);
+
+            CONetCDF4(const CONetCDF4 & onetcdf4);       // Not implemented.
+            CONetCDF4(const CONetCDF4 * const onetcdf4); // Not implemented.
+
+
+            /// Initialisation ///
+            void initialize(const StdString & filename, bool exist, const MPI_Comm * comm);
+            void definition_start(void);
+            void definition_end(void);
+
+            /// Mutateurs ///
+            void setCurrentPath(const CONetCDF4Path & path);
+
+            int addGroup(const StdString & name);
+            int addDimension(const StdString& name, const StdSize size = UNLIMITED_DIM);
+            int addVariable(const StdString & name, nc_type type,
+                                    const std::vector<StdString> & dim);
+            template <class T>
+               void addAttribute
+                  (const StdString & name, const T & value, const StdString * varname = NULL);
+
+            /// Ecriture des donnÃ©es ///
+            template <class T>
+               void writeData(const ARRAY(T, 1) data, const StdString & name,
+                              bool collective, StdSize record,
+                              const std::vector<StdSize> * start = NULL,
+                              const std::vector<StdSize> * count = NULL);
+
+            void writeData(const boost::shared_ptr<CMask> data, const StdString & name);
+
+            /// Accesseur ///
+            const CONetCDF4Path & getCurrentPath(void) const;
+
+            /// Destructeur ///
+            virtual ~CONetCDF4(void);
+
+         protected :
+
+            /// Ecriture ///
+            virtual void writeField_ (const boost::shared_ptr<tree::CField>  field)  = 0;
+            virtual void writeDomain_(const boost::shared_ptr<tree::CDomain> domain) = 0;
+            virtual void writeAxis_  (const boost::shared_ptr<tree::CAxis>   axis)   = 0;
+
+            /// Accesseurs ///
+            int getCurrentGroup(void);
+            int getGroup(const CONetCDF4Path & path);
+            int getVariable(const StdString & varname);
+            int getDimension(const StdString & dimname);
+            std::vector<StdSize> getDimensions(const StdString & varname);
+            int getUnlimitedDimension(void);
+
+         private :
+
+            void getWriteDataInfos(const StdString & name, StdSize record, StdSize & array_size,
+                                   std::vector<StdSize> & sstart,
+                                   std::vector<StdSize> & scount,
+                                   const std::vector<StdSize> * start,
+                                   const std::vector<StdSize> * count);
+
+            /// VÃ©rification des erreurs NetCDF ///
+            void CheckError(int status);
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            CONetCDF4Path path;
+            int ncidp;
+            bool wmpi;
+
+      }; // class CONetCDF4
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif //__XMLIO_INETCDF4__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/qt/!VIDE!
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/qt/!VIDE!	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/qt/!VIDE!	(revision 152)
@@ -0,0 +1,1 @@
+ 
Index: XMLIO_V2/dev/dev_rv/src/xmlio/rebuild.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/rebuild.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/rebuild.cpp	(revision 152)
@@ -0,0 +1,17 @@
+#include "rebuild.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      CRebuild::CRebuild(const StdString & filename)
+      { /* Ne rien faire de plus */ }
+
+      CRebuild::~CRebuild(void)
+      { /* Ne rien faire de plus */ }
+
+
+   } // namespace io
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/rebuild.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/rebuild.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/rebuild.hpp	(revision 152)
@@ -0,0 +1,30 @@
+#ifndef __XMLIO_CRebuild__
+#define __XMLIO_CRebuild__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+   namespace io
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CRebuild
+      {
+         public :
+
+            /// Construteurs ///
+            CRebuild(void);                            // Never implemented.
+            explicit CRebuild(const StdString & filename);
+            CRebuild(const CRebuild  & rebuild);       // Never implemented.
+            CRebuild(const CRebuild  * const rebuild); // Never implemented.
+
+            /// Destructeur ///
+            virtual ~CRebuild(void);
+
+      }; // class CRebuild
+
+   } // namespace io
+} // namespace xmlioserver
+
+#endif // __XMLIO_CRebuild__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/vtk/lscereader.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/vtk/lscereader.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/vtk/lscereader.cpp	(revision 152)
@@ -0,0 +1,697 @@
+#include "lscereader.hpp"
+
+// BibliothÃšque VTK
+#include "vtkObjectFactory.h"
+#include "vtkInformation.h"
+#include "vtkInformationVector.h"
+#include "vtkStreamingDemandDrivenPipeline.h"
+
+#include <vtkProperty.h>
+#include <vtkDataSetMapper.h>
+#include <vtkActor.h>
+#include <vtkRenderWindow.h>
+#include <vtkRenderer.h>
+#include <vtkRenderWindowInteractor.h>
+#include <vtkLegendScaleActor.h>
+
+#include "vtkMath.h"
+
+namespace xmlioserver
+{
+   namespace vtk
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      vtkStandardNewMacro(vtkLSCEReader);
+
+      vtkLSCEReader::vtkLSCEReader(void)
+         : FileName(), CurGridType(RECTILINEAR), VarNames()
+         , A3D(true), ATemporal(true), ACell(true)
+         , Reader()
+      {
+         this->SetNumberOfInputPorts (0);
+         this->SetNumberOfOutputPorts(1);
+      }
+
+      vtkLSCEReader::~vtkLSCEReader(void)
+      {
+
+      }
+
+      ///---------------------------------------------------------------
+
+      void vtkLSCEReader::SetFileName(const StdString & fileName)
+      {
+         this->FileName = fileName;
+         this->Reader   = boost::shared_ptr<io::CINetCDF4>(new io::CINetCDF4(fileName));
+         this->Modified();
+      }
+
+      const StdString & vtkLSCEReader::GetFileName(void) const
+      {
+         return (this->FileName);
+      }
+
+      void vtkLSCEReader::PrintSelf(ostream& os, vtkIndent indent)
+      {
+        this->Superclass::PrintSelf(os,indent);
+      }
+
+      //----------------------------------------------------------------
+      void vtkLSCEReader::AddVariableToSelection(const StdString & varName)
+      {
+         if (this->Reader->isRectilinear(varName))
+            this->SetGridType (RECTILINEAR);
+         else if (this->Reader->isCurvilinear(varName))
+            this->SetGridType (CURVILINEAR);
+         else
+            this->SetGridType (UNSTRUCTURED);
+
+         this->VarNames.insert(varName);
+      }
+
+      void vtkLSCEReader::RemoveSelectedVariable(const StdString & varName)
+      {
+         std::set<StdString>::iterator it = this->VarNames.find(varName);
+         if (it != this->VarNames.end()) this->VarNames.erase(it);
+      }
+
+      void vtkLSCEReader::RemoveAllSelectedVariables(void)
+      {
+         this->VarNames.clear();
+      }
+
+      const std::set<StdString> &
+            vtkLSCEReader::GetSelectedVariables(void) const
+      {
+         return (this->VarNames);
+      }
+
+      bool vtkLSCEReader::HasSelectedVariable(void) const
+      {
+         return (this->VarNames.size() != 0);
+      }
+
+      //----------------------------------------------------------------
+
+      void vtkLSCEReader::SetGridType (GridType type)
+      {
+         if ((this->IsUnstructured() && (type == CURVILINEAR)) ||
+             (this->IsUnstructured() && (type == RECTILINEAR)) ||
+             (this->IsCurvilinear()  && (type == RECTILINEAR)))
+            this->RemoveAllSelectedVariables();
+         this->CurGridType = type;
+      }
+
+      bool vtkLSCEReader::IsUnstructured(void) const
+      {
+         return (this->CurGridType == UNSTRUCTURED);
+      }
+
+      bool vtkLSCEReader::IsCurvilinear(void) const
+      {
+         return (this->CurGridType == CURVILINEAR);
+      }
+
+      bool vtkLSCEReader::IsRectilinear(void) const
+      {
+         return (this->CurGridType == RECTILINEAR);
+      }
+
+      //----------------------------------------------------------------
+
+      void vtkLSCEReader::AcceptTemporalOnly(bool value)
+      {
+         this->ATemporal = value;
+      }
+
+      void vtkLSCEReader::Accept3DOnly(bool value)
+      {
+         this->A3D = value;
+      }
+
+      void vtkLSCEReader::AcceptCellOnly(bool value)
+      {
+         this->ACell = value;
+      }
+
+      //----------------------------------------------------------------
+
+      int vtkLSCEReader::ProcessRequest
+                           (vtkInformation       *  request,
+                            vtkInformationVector ** vtkNotUsed(inputVector),
+                            vtkInformationVector *  outputVector)
+      {
+         if(request->Has(vtkDemandDrivenPipeline::REQUEST_DATA()))
+            return (this->RequestData(NULL, NULL, outputVector));
+
+         //if(request->Has(vtkDemandDrivenPipeline::REQUEST_DATA_OBJECT()))
+         //   return (this->RequestDataObject(NULL, NULL, outputVector));
+
+         //if(request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION()))
+         //   return (this->RequestInformation(NULL, NULL, outputVector));
+
+         if(request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
+            return (this->RequestUpdateExtent(NULL, NULL, outputVector));
+
+         return (1);
+      }
+
+      //----------------------------------------------------------------
+
+      void vtkLSCEReader::ShowVariable(const vtkStdString & filename,
+                                       const vtkStdString & varname)
+      {
+         vtkSmartPointer<vtkLSCEReader> lscereader =
+               vtkSmartPointer<vtkLSCEReader>::New();
+
+         lscereader->SetFileName(filename);
+         lscereader->AddVariableToSelection(varname);
+         lscereader->Update();
+
+         // CrÃ©ation d'un mappeur et d'un acteur.
+         vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New();
+         mapper->SetInputConnection(lscereader->GetOutput()->GetProducerPort());
+         mapper->SetScalarRange  (1000, 10000);
+
+         vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();
+         actor->SetMapper(mapper);
+         actor->GetProperty()->SetRepresentationToWireframe();
+
+         // CrÃ©ation d'une fenÃªtre de rendu.
+         vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
+         vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
+         renderWindow->AddRenderer(renderer);
+         vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
+            vtkSmartPointer<vtkRenderWindowInteractor>::New();
+         renderWindowInteractor->SetRenderWindow(renderWindow);
+
+
+         vtkSmartPointer<vtkLegendScaleActor> legendScaleActor =
+            vtkSmartPointer<vtkLegendScaleActor>::New();
+
+         // Ajout de l'acteur Ã  la scÃšne.
+         renderer->AddActor(actor);
+         renderer->AddActor(legendScaleActor);
+
+         renderer->GradientBackgroundOn();
+         renderer->SetBackground(1,1,1);
+         renderer->SetBackground2(0,0,0);
+
+         // Rendu et intÃ©raction
+         renderWindow->Render();
+         renderWindowInteractor->Start();
+      }
+
+      //----------------------------------------------------------------
+
+      void vtkLSCEReader::CreateRectilinearGrid(vtkRectilinearGrid * grid,
+                                                vtkInformation     * outInfo,
+                                                vtkFloatArray      * xspacing,
+                                                vtkFloatArray      * yspacing,
+                                                vtkFloatArray      * zspacing,
+                                                vtkIntArray        * dimensions)
+      {
+            int extent[6] = { 0, dimensions->GetValue(0) - 1
+                            , 0, dimensions->GetValue(1) - 1
+                            , 0, dimensions->GetValue(2) - 1};
+            outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),extent,6);
+            grid->SetExtent (extent);
+            grid->SetDimensions (dimensions->GetValue(0),
+                                 dimensions->GetValue(1),
+                                 dimensions->GetValue(2));
+            grid->SetXCoordinates (xspacing);
+            grid->SetYCoordinates (yspacing);
+            grid->SetZCoordinates (zspacing);
+      }
+
+      void vtkLSCEReader::CreateStructuredGrid(vtkStructuredGrid * grid,
+                                               vtkInformation    * outInfo,
+                                               vtkPoints         * points,
+                                               vtkIntArray       * dimensions)
+      {
+            int extent[6] = { 0, dimensions->GetValue(0) - 1
+                            , 0, dimensions->GetValue(1) - 1
+                            , 0, dimensions->GetValue(2) - 1};
+            outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),extent,6);
+            grid->SetExtent (extent);
+            grid->SetDimensions (dimensions->GetValue(0),
+                                 dimensions->GetValue(1),
+                                 dimensions->GetValue(2));
+            grid->SetPoints(points);
+      }
+
+      void vtkLSCEReader::CreateUnstructuredGrid(vtkUnstructuredGrid * grid,
+                                                 vtkInformation      * outInfo,
+                                                 vtkPoints           * points,
+                                                 vtkCellArray        * cells,
+                                                 int                   celltype)
+      {
+         grid->SetPoints(points);
+         grid->SetCells(celltype, cells);
+      }
+
+      //----------------------------------------------------------------
+
+      void vtkLSCEReader::GetRectilinearConnectivity(int dimZ, int dimY, int dimX, vtkCellArray * cells)
+      {
+         if (dimZ == 1 && dimY >  1 && dimX >  1) // 2D
+         {
+            vtkIdType pts[4] ;
+
+            for (int i = 0, k = 0; i < (dimX - 1); i++)
+               for (int j = 0; j < (dimY - 1); j++, k++)
+            {
+               pts[0] =  i * dimY + j;
+               pts[1] =  i * dimY + j + 1;
+               pts[2] =  (i+1) * dimY + j + 1;
+               pts[3] =  (i+1) * dimY + j;
+               cells->InsertNextCell(4,  pts);
+            }
+         }
+         else if (dimZ > 1 && dimY >  1 && dimX >  1) // 3D
+         {
+            vtkIdType pts[8];
+            for (int i = 0, l = 0; i < (dimX - 1); i++)
+               for (int j = 0; j < (dimY - 1); j++)
+                  for (int k = 0; k < (dimZ - 1); k++, l++)
+            {
+               pts[0] =  i * dimY * dimZ + j * dimZ + k;
+               pts[1] =  i * dimY * dimZ + j * dimZ + k + 1;
+               pts[2] =  (i+1) * dimY * dimZ + j * dimZ + k + 1;
+               pts[3] =  (i+1) * dimY * dimZ + j * dimZ + k;
+
+               pts[4] =  i * dimY * dimZ  + (j + 1) * dimZ + k ;
+               pts[5] =  i * dimY * dimZ  + (j + 1) * dimZ + k +1;
+               pts[6] =  (i+1) * dimY * dimZ + (j + 1) * dimZ + k + 1;
+               pts[7] =  (i+1) * dimY * dimZ + (j + 1) * dimZ + k ;
+               cells->InsertNextCell(8,  pts);
+            }
+         }
+      }
+
+      //----------------------------------------------------------------
+
+      void vtkLSCEReader::CreateSimpleGrid (int xi, int xf,
+                                            int yi, int yf,
+                                            int zi, int zf,
+                                            vtkFloatArray * xspacing,
+                                            vtkFloatArray * yspacing,
+                                            vtkFloatArray * zspacing,
+                                            vtkIntArray   * dimensions)
+      {
+         dimensions->InsertNextValue (xf - xi + 1); // X
+         dimensions->InsertNextValue (yf - yi + 1); // Y
+         dimensions->InsertNextValue (zf - zi + 1); // Z
+         for (int i = xi; i <= xf; i++)
+            xspacing->InsertNextValue (i);
+         for (int j = yi; j <= yf; j++)
+            yspacing->InsertNextValue (j);
+         for (int k = zi; k <= zf; k++)
+            zspacing->InsertNextValue (k);
+      }
+
+      void vtkLSCEReader::CreateSimpleGrid (int xi, int xf,
+                                            int yi, int yf,
+                                            int zi, int zf,
+                                            vtkPoints   * points,
+                                            vtkIntArray * dimensions)
+      {
+         dimensions->InsertNextValue (xf - xi + 1); // X
+         dimensions->InsertNextValue (yf - yi + 1); // Y
+         dimensions->InsertNextValue (zf - zi + 1); // Z
+         for (int i = xi; i <= xf; i++)
+            for (int j = yi; j <= yf; j++)
+               for (int k = zi; k <= zf; k++)
+                  points->InsertNextPoint(i, j, k);
+      }
+
+      void vtkLSCEReader::CreateSimpleGrid (int xi, int xf,
+                                            int yi, int yf,
+                                            int zi, int zf,
+                                            vtkPoints    * points,
+                                            vtkCellArray * cells,
+                                            vtkIntArray  * dimensions)
+      {
+         this->CreateSimpleGrid (xi, xf, yi, yf, zi, zf, points, dimensions);
+         int dimX = dimensions->GetValue(0),
+             dimY = dimensions->GetValue(1),
+             dimZ = dimensions->GetValue(2);
+         this->GetRectilinearConnectivity(dimZ, dimY, dimX, cells);
+      }
+
+      //----------------------------------------------------------------
+      void vtkLSCEReader::GetSpacings(const vtkStdString & coordinate,
+                                      bool bounds, vtkFloatArray * spacing)
+      {
+         StdSize size = (Reader->getDimensions(&coordinate).begin())->second;
+         ARRAY_CREATE(data_arr, float, 1, [1]);
+         if (Reader->hasVariable(coordinate))
+         {
+            if (bounds)
+            {
+               if (Reader->hasBounds(coordinate))
+               { // CellData, variable de coordonnÃ©e avec attributes bounds.
+                  StdString boundid = Reader->getBoundsId(coordinate);
+                  float f;
+                  Reader->getData(data_arr, boundid);
+                  spacing->InsertNextValue (f = (*data_arr)[0]);
+                  for (StdSize j = 1; j < (2 * size); j++) // << Super laid
+                     if (f != (*data_arr)[j])
+                        spacing->InsertNextValue (f = (*data_arr)[j]);
+               }
+               else
+               { // CellData, variable de coordonnÃ©e sans attributes bounds.
+                  Reader->getData(data_arr, coordinate);
+                  spacing->InsertNextValue ((*data_arr)[0] - ((*data_arr)[1] - (*data_arr)[0])/2);
+                  for (StdSize j = 0; j < (size-1); j++)
+                     spacing->InsertNextValue ((*data_arr)[j] + ((*data_arr)[j+1]-(*data_arr)[j])/2);
+                  spacing->InsertNextValue ((*data_arr)[size-2] + ((*data_arr)[size-1] - (*data_arr)[size-2])/2);
+               }
+            }
+            else
+            { // PointData, variable de coordonnÃ©e.
+               Reader->getData(data_arr, coordinate);
+               for (StdSize j = 0; j < (size-1); j++)
+                  spacing->InsertNextValue ((*data_arr)[j]);
+            }
+         }
+         else
+         {
+            if (bounds) // CellData, dimension de coordonnÃ©e.
+               for (float i = -0.5; i < ((float)size + 1.); i = i + 1.)
+                  spacing->InsertNextValue (i);
+            else // PointData, dimension de coordonnÃ©e.
+               for (float j = 0.; j < (float)size; j = j + 1.)
+                  spacing->InsertNextValue (j);
+         }
+      }
+      //----------------------------------------------------------------
+
+      void vtkLSCEReader::AddPoint(vtkPoints * points, float *  value, bool proj)
+      {
+         if (proj)
+         {
+            double h = 1.0;
+            double cartesianCoord[3];
+            value[0] =  0.017453292519943295 * value[0];
+            value[1] =  0.017453292519943295 * value[1];
+
+            cartesianCoord[0] = h * cos(value[0]) * cos(value[1]);
+            cartesianCoord[1] = h * sin(value[0]) * cos(value[1]);
+            cartesianCoord[2] = h * sin(value[1]);
+            points->InsertNextPoint (cartesianCoord);
+         }
+         else
+         {
+            points->InsertNextPoint (value);
+         }
+      }
+
+      //----------------------------------------------------------------
+      void vtkLSCEReader::GetPoints(const vtkStdString & xcoordinate,
+                                    const vtkStdString & ycoordinate,
+                                    const vtkStdString & zcoordinate,
+                                    bool bounds, bool proj,
+                                    vtkPoints * points, vtkIntArray * dimensions)
+      {
+         float value[3];
+         bool is2D = true;
+         ARRAY_CREATE(xvalue, float, 1, [1]);
+         ARRAY_CREATE(yvalue, float, 1, [1]);
+         vtkSmartPointer<vtkFloatArray> zspacing = vtkSmartPointer<vtkFloatArray>::New();
+         if (zcoordinate.size() > 0)
+         {
+            GetSpacings(zcoordinate, bounds, zspacing);
+            is2D = false;
+         }
+         else
+            zspacing->InsertNextValue(0);
+
+         dimensions->InsertNextValue
+            (Reader->getDimensions(&xcoordinate)[Reader->getLonCoordName(xcoordinate)]);
+         dimensions->InsertNextValue
+            (Reader->getDimensions(&xcoordinate)[Reader->getLatCoordName(xcoordinate)]);
+         dimensions->InsertNextValue(zspacing->GetNumberOfTuples());
+
+         if (!bounds)
+         {
+            Reader->getData(xvalue, xcoordinate);
+            Reader->getData(yvalue, ycoordinate);
+
+            for (int i = 0; i < dimensions->GetValue(0); i++)
+               for (int j = 0; j < dimensions->GetValue(1); j++)
+                  for (int k = 0; k < dimensions->GetValue(2); k++)
+                  {
+                     value[0] = (*xvalue)[i*dimensions->GetValue(1) + j];
+                     value[1] = (*yvalue)[i*dimensions->GetValue(1) + j];
+                     value[2] = zspacing->GetValue(k);
+                     AddPoint(points, value, proj);
+                  }
+            return;
+         }
+
+         dimensions->SetValue(0, dimensions->GetValue(0)+1);
+         dimensions->SetValue(1, dimensions->GetValue(1)+1);
+
+         if (Reader->hasBounds(xcoordinate))
+         {
+            StdString boundid = Reader->getBoundsId(xcoordinate);
+            Reader->getData(xvalue, boundid);
+         }
+         if (Reader->hasBounds(ycoordinate))
+         {
+            StdString boundid = Reader->getBoundsId(ycoordinate);
+            Reader->getData(yvalue, boundid);
+         }
+         int ydim = dimensions->GetValue(0) - 1 ,
+             xdim = dimensions->GetValue(1) - 1;
+
+         for (int i = 0; i <= xdim; i++)
+            for (int j = 0; j <= ydim; j++)
+               for (int k = 0; k < dimensions->GetValue(2); k++)
+               {
+                  if ((j != ydim) && (i != xdim))
+                  {
+                     value[0] = (*xvalue)[4 * (i * ydim + j) + 0];
+                     value[1] = (*yvalue)[4 * (i * ydim + j) + 0];
+                     value[2] = zspacing->GetValue(k);
+                     AddPoint(points, value, proj);
+
+                     continue;
+                  }
+                  else if ((j == ydim) && (i != xdim))
+                  {
+                     value[0] = (*xvalue)[4 * (i * ydim + j - 1) + 1];
+                     value[1] = (*yvalue)[4 * (i * ydim + j - 1) + 1];
+                     value[2] = zspacing->GetValue(k);
+                     AddPoint(points, value, proj);
+
+                     continue;
+                  }
+                  else if ((j != ydim) && (i == xdim))
+                  {
+                     value[0] = (*xvalue)[4 * ((i-1) * ydim + j) + 3];
+                     value[1] = (*yvalue)[4 * ((i-1) * ydim + j) + 3];
+                     value[2] = zspacing->GetValue(k);
+                     AddPoint(points, value, proj);
+
+                     continue;
+                  }
+                  else if ((j == ydim) && (i == xdim))
+                  {
+                     value[0] = (*xvalue)[4 * ((i-1) * ydim + j - 1) + 2];
+                     value[1] = (*yvalue)[4 * ((i-1) * ydim + j - 1) + 2];
+                     value[2] = zspacing->GetValue(k);
+                     AddPoint(points, value, proj);
+
+                     continue;
+                  }
+               }
+      }
+
+      //----------------------------------------------------------------
+
+      void vtkLSCEReader::GetCellsAndPoints(const vtkStdString & xcoordinate,
+                                            const vtkStdString & ycoordinate,
+                                            const vtkStdString & zcoordinate,
+                                            bool bounds, bool proj, StdSize nbvertex,
+                                            vtkCellArray * cells, vtkPoints * points,
+                                            vtkIntArray * dimensions)
+      {
+         float value[3];
+         double h = 1.0;
+         double cartesianCoord[3];
+         vtkIdType pts[nbvertex] ;
+         bool is2D = true;
+         ARRAY_CREATE(xvalue, float, 1, [1]);
+         ARRAY_CREATE(yvalue, float, 1, [1]);
+         vtkSmartPointer<vtkFloatArray> zspacing = vtkSmartPointer<vtkFloatArray>::New();
+         if (zcoordinate.size() > 0)
+         {
+            GetSpacings(zcoordinate, bounds, zspacing);
+            is2D = false;
+         }
+         else
+            zspacing->InsertNextValue(0);
+
+         StdSize size = (*Reader->getDimensions(&xcoordinate).begin()).second;
+         if (Reader->hasBounds(xcoordinate))
+         {
+            StdString boundid = Reader->getBoundsId(xcoordinate);
+            Reader->getData(xvalue, boundid);
+         }
+         if (Reader->hasBounds(ycoordinate))
+         {
+            StdString boundid = Reader->getBoundsId(ycoordinate);
+            Reader->getData(yvalue, boundid);
+         }
+
+         for (StdSize u = 0; u < size; u++)
+         {
+            for (int v = 0; v < zspacing->GetNumberOfTuples(); v++)
+            {
+               for (StdSize w = 0; w < nbvertex; w++)
+               {
+                  value[0] = (*xvalue)[nbvertex * u + w];
+                  value[1] = (*yvalue)[nbvertex * u + w];
+                  value[2] = zspacing->GetValue(v);
+                  pts[w] = nbvertex * u + w;
+
+                  if (proj)
+                  {
+                     value[0] = 0.017453292519943295 * value[0];
+                     value[1] = 0.017453292519943295 * value[1];
+
+                     cartesianCoord[0] = h * cos(value[0]) * cos(value[1]);
+                     cartesianCoord[1] = h * sin(value[0]) * cos(value[1]);
+                     cartesianCoord[2] = h * sin(value[1]);
+                     points->InsertPoint (pts[w], cartesianCoord);
+                  }
+                  else
+                  {
+                     points->InsertPoint (pts[w], value);
+                  }
+               }
+               cells->InsertNextCell(nbvertex,  pts);
+            }
+         }
+      }
+
+      //----------------------------------------------------------------
+
+      void vtkLSCEReader::AddScalarData(vtkDataSet * output,
+                                        const StdString & varname,
+                                        StdSize record, bool bounds)
+      {
+         vtkSmartPointer<vtkDoubleArray> data = vtkDoubleArray::New();
+         data->SetName(varname.c_str());
+         ARRAY_CREATE(data_arr, double, 1, [1]);
+         Reader->getData(data_arr, varname);
+
+         data->SetNumberOfValues (data_arr->size());
+         for (StdSize i = 0; i < data_arr->size(); i++)
+            data->SetValue (i, (*data_arr)[i]);
+
+         if (bounds)
+         {
+            output->GetCellData()->AddArray(data);
+            output->GetCellData()->SetActiveScalars (varname.c_str());
+         }
+         else
+         {
+            output->GetPointData()->AddArray(data);
+            output->GetPointData()->SetActiveScalars (varname.c_str());
+         }
+      }
+
+      //----------------------------------------------------------------
+
+      int vtkLSCEReader::RequestData
+                           (vtkInformation       *  vtkNotUsed(request),
+                            vtkInformationVector ** vtkNotUsed(inputVector),
+                            vtkInformationVector *  outputVector)
+      {
+         vtkInformation *  outInfo = outputVector->GetInformationObject(0);
+         vtkDataSet     *  output  = vtkDataSet::GetData(outInfo);
+
+         if (!output)
+         {
+            switch (this->CurGridType)
+            {
+               case(RECTILINEAR)  :
+                  output = vtkRectilinearGrid::New();
+                  break;
+               case(CURVILINEAR)  :
+                  output = vtkStructuredGrid::New();
+                  break;
+               default :
+                  output = vtkUnstructuredGrid::New();
+                  break;
+            }
+            output->SetPipelineInformation(outInfo);
+            output->Delete();
+         }
+
+         vtkUnstructuredGrid * uoutput  = vtkUnstructuredGrid::SafeDownCast(output);
+         vtkRectilinearGrid  * routput  = vtkRectilinearGrid::SafeDownCast(output);
+         vtkStructuredGrid   * soutput  = vtkStructuredGrid::SafeDownCast(output);
+
+         if (routput)
+         { // Grille rectiliniÃ©aire
+            vtkSmartPointer<vtkFloatArray>
+                           xspacing = vtkSmartPointer<vtkFloatArray>::New(),
+                           yspacing = vtkSmartPointer<vtkFloatArray>::New(),
+                           zspacing = vtkSmartPointer<vtkFloatArray>::New();
+            vtkSmartPointer<vtkIntArray> dims = vtkSmartPointer<vtkIntArray>::New();
+
+            //CreateSimpleGrid (-1, 10, -1, 10, -1, 10, xspacing, yspacing, zspacing, dims);
+            GetSpacings(Reader->getLonCoordName(*VarNames.begin()), true, xspacing);
+            GetSpacings(Reader->getLatCoordName(*VarNames.begin()), true, yspacing);
+            GetSpacings(Reader->getVertCoordName(*VarNames.begin()), true, zspacing);
+            /*std::cout << zspacing->GetNumberOfTuples() << std::endl;*/
+
+            dims->InsertNextValue(xspacing->GetNumberOfTuples());
+            dims->InsertNextValue(yspacing->GetNumberOfTuples());
+            dims->InsertNextValue(zspacing->GetNumberOfTuples());
+
+            CreateRectilinearGrid(routput, outInfo, xspacing, yspacing, zspacing, dims);
+         }
+
+         if (soutput)
+         { // Grille structurÃ©e
+            vtkSmartPointer<vtkPoints>   pts  = vtkSmartPointer<vtkPoints>::New();
+            vtkSmartPointer<vtkIntArray> dims = vtkSmartPointer<vtkIntArray>::New();
+
+            //CreateSimpleGrid (-1, 10, -1, 10, -1, 10, pts, dims);
+            GetPoints(Reader->getLonCoordName(*VarNames.begin()),
+                      Reader->getLatCoordName(*VarNames.begin()),
+                      Reader->getVertCoordName(*VarNames.begin()), false, true, pts, dims);
+            CreateStructuredGrid(soutput, outInfo, pts, dims);
+         }
+
+         if (uoutput)
+         { // Grille non-structurÃ©e
+            vtkSmartPointer<vtkPoints>    pts   = vtkSmartPointer<vtkPoints>::New();
+            vtkSmartPointer<vtkIntArray>  dims  = vtkSmartPointer<vtkIntArray>::New();
+            vtkSmartPointer<vtkCellArray> cells = vtkSmartPointer<vtkCellArray>::New();
+            // VTK_QUAD, VTK_HEXAHEDRON, VTK_POLYGON
+
+            //CreateSimpleGrid (0, 12, 0, 12, 0, 12, pts, cells, dims);
+            GetCellsAndPoints(Reader->getLonCoordName(*VarNames.begin()),
+                              Reader->getLatCoordName(*VarNames.begin()),
+                              Reader->getVertCoordName(*VarNames.begin()), true, true,
+                              Reader->getNbVertex(*VarNames.begin()), cells, pts, dims);
+
+            AddScalarData(uoutput, *VarNames.begin(), 0, true);
+            CreateUnstructuredGrid(uoutput, outInfo, pts, cells, VTK_POLYGON);
+
+         }
+         return (1);
+      }
+
+      ///---------------------------------------------------------------
+
+
+   } // namespace vtk
+} // namespace xmlioserver
+
Index: XMLIO_V2/dev/dev_rv/src/xmlio/vtk/lscereader.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/vtk/lscereader.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/vtk/lscereader.hpp	(revision 152)
@@ -0,0 +1,192 @@
+#ifndef __XMLIO_LSCE_READER__
+#define __XMLIO_LSCE_READER__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "input/inetcdf4.hpp"
+
+/// VTK headers ///
+#include "vtkDataObjectAlgorithm.h"
+
+#include "vtkStdString.h"
+
+#include "vtkUnstructuredGrid.h"
+#include "vtkStructuredGrid.h"
+#include "vtkRectilinearGrid.h"
+
+#include "vtkSmartPointer.h"
+
+#include "vtkStringArray.h"
+#include "vtkFloatArray.h"
+#include "vtkIntArray.h"
+#include "vtkDoubleArray.h"
+#include "vtkCellArray.h"
+
+#include "vtkCellData.h"
+#include "vtkPointData.h"
+
+namespace xmlioserver
+{
+   namespace vtk
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+
+      class VTK_EXPORT vtkLSCEReader
+         : public vtkDataObjectAlgorithm
+      {
+         public :
+
+         //-------------------------------------------------------------
+            typedef enum _gridtype
+            { RECTILINEAR = 0, CURVILINEAR, UNSTRUCTURED } GridType;
+         //-------------------------------------------------------------
+
+            /// SpÃ©cifique VTK ///
+            static vtkLSCEReader * New(void);
+            vtkTypeMacro(vtkLSCEReader, vtkDataObjectAlgorithm);
+            void PrintSelf(ostream& os, vtkIndent indent);
+
+         //-------------------------------------------------------------
+
+            /// Mutateurs ///
+            void SetFileName(const StdString & fileName);
+
+            void AddVariableToSelection(const StdString & varName);
+            void RemoveSelectedVariable(const StdString & varName);
+            void RemoveAllSelectedVariables(void);
+
+            void SetGridType (GridType type);
+
+            void AcceptTemporalOnly(bool value);
+            void Accept3DOnly(bool value);
+            void AcceptCellOnly(bool value);
+
+         //-------------------------------------------------------------
+
+            /// Accesseurs ///
+            const StdString & GetFileName(void) const;
+
+            const std::set<StdString> & GetSelectedVariables(void) const;
+
+         //-------------------------------------------------------------
+
+            /// Tests ///
+            bool IsUnstructured(void) const;
+            bool IsCurvilinear(void) const;
+            bool IsRectilinear(void) const;
+
+            bool HasSelectedVariable(void) const;
+
+            /// Visualisation ///
+            static void ShowVariable(const vtkStdString & filename,
+                                     const vtkStdString & varname);
+
+         protected:
+
+            /// Constructeur ///
+            vtkLSCEReader(void);
+
+            /// Destructeur ///
+            virtual ~vtkLSCEReader(void);
+
+         //-------------------------------------------------------------
+            void GetSpacings(const vtkStdString & coordinate,
+                             bool bounds, vtkFloatArray * spacing);
+
+         //-------------------------------------------------------------
+
+            void CreateRectilinearGrid(vtkRectilinearGrid *, vtkInformation *,
+                                        vtkFloatArray *, vtkFloatArray *, vtkFloatArray *,
+                                        vtkIntArray *);
+
+            void CreateStructuredGrid(vtkStructuredGrid *, vtkInformation *,
+                                      vtkPoints *, vtkIntArray *);
+
+            void CreateUnstructuredGrid(vtkUnstructuredGrid *, vtkInformation *,
+                                        vtkPoints *, vtkCellArray *, int);
+
+         //-------------------------------------------------------------
+
+            void CreateSimpleGrid (int xi, int xf, int yi, int yf, int zi, int zf,
+                                   vtkFloatArray *, vtkFloatArray *, vtkFloatArray *,
+                                   vtkIntArray *);
+
+            void CreateSimpleGrid (int xi, int xf, int yi, int yf, int zi, int zf,
+                                   vtkPoints *, vtkIntArray *);
+
+            void CreateSimpleGrid (int xi, int xf, int yi, int yf, int zi, int zf,
+                                   vtkPoints *, vtkCellArray *, vtkIntArray *);
+
+         //-------------------------------------------------------------
+
+            void GetRectilinearConnectivity(int, int, int, vtkCellArray *);
+
+         //-------------------------------------------------------------
+
+            void AddPoint(vtkPoints * points, float *  value, bool proj);
+
+            void GetPoints(const vtkStdString & xcoordinate,
+                           const vtkStdString & ycoordinate,
+                           const vtkStdString & zcoordinate,
+                           bool bounds, bool proj,
+                           vtkPoints * points, vtkIntArray * dimensions);
+
+         //-------------------------------------------------------------
+
+            void GetCellsAndPoints(const vtkStdString & xcoordinate,
+                                   const vtkStdString & ycoordinate,
+                                   const vtkStdString & zcoordinate,
+                                   bool bounds, bool proj, StdSize nbvertex,
+                                   vtkCellArray * cells, vtkPoints * points,
+                                   vtkIntArray * dimensions);
+
+         //-------------------------------------------------------------
+
+            void AddScalarData(vtkDataSet * output, const StdString & varname,
+                               StdSize record, bool bounds);
+
+         //-------------------------------------------------------------
+
+            /// Traitements ///
+            virtual int RequestData
+               (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+            //virtual int RequestInformation
+            //   (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+            //virtual int RequestDataObject
+            //   (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+            virtual int ProcessRequest
+               (vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+         //-------------------------------------------------------------
+
+         private:
+
+            /// Constructeurs ///
+            vtkLSCEReader(const vtkLSCEReader &);        // Not implemented
+            vtkLSCEReader(const vtkLSCEReader * const);  // Not implemented
+
+            /// OpÃ©rateur ///
+            void operator=(const vtkLSCEReader &);       // Not implemented
+
+         //-------------------------------------------------------------
+
+            /// PropriÃ©tÃ©s privÃ©es ///
+            StdString FileName;
+
+            GridType CurGridType;
+            std::set<StdString> VarNames;
+            bool A3D, ATemporal, ACell;
+
+            boost::shared_ptr<io::CINetCDF4> Reader;
+
+      }; // class vtkLSCEReader
+
+      ///----------------------------------------------------------------
+
+   } // namespace vtk
+} // namespace xmlioserver
+
+#endif //__XMLIO_LSCE_READER__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xml/license.txt
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xml/license.txt	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xml/license.txt	(revision 152)
@@ -0,0 +1,52 @@
+Use of this software is granted under one of the following two licenses,
+to be chosen freely by the user.
+
+1. Boost Software License - Version 1.0 - August 17th, 2003
+===============================================================================
+
+Copyright (c) 2006, 2007 Marcin Kalicinski
+
+Permission is hereby granted, free of charge, to any person or organization
+obtaining a copy of the software and accompanying documentation covered by
+this license (the "Software") to use, reproduce, display, distribute,
+execute, and transmit the Software, and to prepare derivative works of the
+Software, and to permit third-parties to whom the Software is furnished to
+do so, all subject to the following:
+
+The copyright notices in the Software and this entire statement, including
+the above license grant, this restriction and the following disclaimer,
+must be included in all copies of the Software, in whole or in part, and
+all derivative works of the Software, unless such copies or derivative
+works are solely in the form of machine-executable object code generated by
+a source language processor.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
+SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
+FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+2. The MIT License
+===============================================================================
+
+Copyright (c) 2006, 2007 Marcin Kalicinski
+
+Permission is hereby granted, free of charge, to any person obtaining a copy 
+of this software and associated documentation files (the "Software"), to deal 
+in the Software without restriction, including without limitation the rights 
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
+of the Software, and to permit persons to whom the Software is furnished to do so, 
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all 
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 
+IN THE SOFTWARE.
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml.hpp	(revision 152)
@@ -0,0 +1,2596 @@
+#ifndef RAPIDXML_HPP_INCLUDED
+#define RAPIDXML_HPP_INCLUDED
+
+// Copyright (C) 2006, 2009 Marcin Kalicinski
+// Version 1.13
+// Revision $DateTime: 2009/05/13 01:46:17 $
+//! \file rapidxml.hpp This file contains rapidxml parser and DOM implementation
+
+// If standard library is disabled, user must provide implementations of required functions and typedefs
+#if !defined(RAPIDXML_NO_STDLIB)
+    #include <cstdlib>      // For std::size_t
+    #include <cassert>      // For assert
+    #include <new>          // For placement new
+#endif
+
+// On MSVC, disable "conditional expression is constant" warning (level 4). 
+// This warning is almost impossible to avoid with certain types of templated code
+#ifdef _MSC_VER
+    #pragma warning(push)
+    #pragma warning(disable:4127)   // Conditional expression is constant
+#endif
+
+///////////////////////////////////////////////////////////////////////////
+// RAPIDXML_PARSE_ERROR
+    
+#if defined(RAPIDXML_NO_EXCEPTIONS)
+
+#define RAPIDXML_PARSE_ERROR(what, where) { parse_error_handler(what, where); assert(0); }
+
+namespace rapidxml
+{
+    //! When exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, 
+    //! this function is called to notify user about the error.
+    //! It must be defined by the user.
+    //! <br><br>
+    //! This function cannot return. If it does, the results are undefined.
+    //! <br><br>
+    //! A very simple definition might look like that:
+    //! <pre>
+    //! void %rapidxml::%parse_error_handler(const char *what, void *where)
+    //! {
+    //!     std::cout << "Parse error: " << what << "\n";
+    //!     std::abort();
+    //! }
+    //! </pre>
+    //! \param what Human readable description of the error.
+    //! \param where Pointer to character data where error was detected.
+    void parse_error_handler(const char *what, void *where);
+}
+
+#else
+    
+#include <exception>    // For std::exception
+
+#define RAPIDXML_PARSE_ERROR(what, where) throw parse_error(what, where)
+
+namespace rapidxml
+{
+
+    //! Parse error exception. 
+    //! This exception is thrown by the parser when an error occurs. 
+    //! Use what() function to get human-readable error message. 
+    //! Use where() function to get a pointer to position within source text where error was detected.
+    //! <br><br>
+    //! If throwing exceptions by the parser is undesirable, 
+    //! it can be disabled by defining RAPIDXML_NO_EXCEPTIONS macro before rapidxml.hpp is included.
+    //! This will cause the parser to call rapidxml::parse_error_handler() function instead of throwing an exception.
+    //! This function must be defined by the user.
+    //! <br><br>
+    //! This class derives from <code>std::exception</code> class.
+    class parse_error: public std::exception
+    {
+    
+    public:
+    
+        //! Constructs parse error
+        parse_error(const char *what, void *where)
+            : m_what(what)
+            , m_where(where)
+        {
+        }
+
+        //! Gets human readable description of error.
+        //! \return Pointer to null terminated description of the error.
+        virtual const char *what() const throw()
+        {
+            return m_what;
+        }
+
+        //! Gets pointer to character data where error happened.
+        //! Ch should be the same as char type of xml_document that produced the error.
+        //! \return Pointer to location within the parsed string where error occured.
+        template<class Ch>
+        Ch *where() const
+        {
+            return reinterpret_cast<Ch *>(m_where);
+        }
+
+    private:  
+
+        const char *m_what;
+        void *m_where;
+
+    };
+}
+
+#endif
+
+///////////////////////////////////////////////////////////////////////////
+// Pool sizes
+
+#ifndef RAPIDXML_STATIC_POOL_SIZE
+    // Size of static memory block of memory_pool.
+    // Define RAPIDXML_STATIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value.
+    // No dynamic memory allocations are performed by memory_pool until static memory is exhausted.
+    #define RAPIDXML_STATIC_POOL_SIZE (64 * 1024)
+#endif
+
+#ifndef RAPIDXML_DYNAMIC_POOL_SIZE
+    // Size of dynamic memory block of memory_pool.
+    // Define RAPIDXML_DYNAMIC_POOL_SIZE before including rapidxml.hpp if you want to override the default value.
+    // After the static block is exhausted, dynamic blocks with approximately this size are allocated by memory_pool.
+    #define RAPIDXML_DYNAMIC_POOL_SIZE (64 * 1024)
+#endif
+
+#ifndef RAPIDXML_ALIGNMENT
+    // Memory allocation alignment.
+    // Define RAPIDXML_ALIGNMENT before including rapidxml.hpp if you want to override the default value, which is the size of pointer.
+    // All memory allocations for nodes, attributes and strings will be aligned to this value.
+    // This must be a power of 2 and at least 1, otherwise memory_pool will not work.
+    #define RAPIDXML_ALIGNMENT sizeof(void *)
+#endif
+
+namespace rapidxml
+{
+    // Forward declarations
+    template<class Ch> class xml_node;
+    template<class Ch> class xml_attribute;
+    template<class Ch> class xml_document;
+    
+    //! Enumeration listing all node types produced by the parser.
+    //! Use xml_node::type() function to query node type.
+    enum node_type
+    {
+        node_document,      //!< A document node. Name and value are empty.
+        node_element,       //!< An element node. Name contains element name. Value contains text of first data node.
+        node_data,          //!< A data node. Name is empty. Value contains data text.
+        node_cdata,         //!< A CDATA node. Name is empty. Value contains data text.
+        node_comment,       //!< A comment node. Name is empty. Value contains comment text.
+        node_declaration,   //!< A declaration node. Name and value are empty. Declaration parameters (version, encoding and standalone) are in node attributes.
+        node_doctype,       //!< A DOCTYPE node. Name is empty. Value contains DOCTYPE text.
+        node_pi             //!< A PI node. Name contains target. Value contains instructions.
+    };
+
+    ///////////////////////////////////////////////////////////////////////
+    // Parsing flags
+
+    //! Parse flag instructing the parser to not create data nodes. 
+    //! Text of first data node will still be placed in value of parent element, unless rapidxml::parse_no_element_values flag is also specified.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_no_data_nodes = 0x1;            
+
+    //! Parse flag instructing the parser to not use text of first data node as a value of parent element.
+    //! Can be combined with other flags by use of | operator.
+    //! Note that child data nodes of element node take precendence over its value when printing. 
+    //! That is, if element has one or more child data nodes <em>and</em> a value, the value will be ignored.
+    //! Use rapidxml::parse_no_data_nodes flag to prevent creation of data nodes if you want to manipulate data using values of elements.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_no_element_values = 0x2;
+    
+    //! Parse flag instructing the parser to not place zero terminators after strings in the source text.
+    //! By default zero terminators are placed, modifying source text.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_no_string_terminators = 0x4;
+    
+    //! Parse flag instructing the parser to not translate entities in the source text.
+    //! By default entities are translated, modifying source text.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_no_entity_translation = 0x8;
+    
+    //! Parse flag instructing the parser to disable UTF-8 handling and assume plain 8 bit characters.
+    //! By default, UTF-8 handling is enabled.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_no_utf8 = 0x10;
+    
+    //! Parse flag instructing the parser to create XML declaration node.
+    //! By default, declaration node is not created.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_declaration_node = 0x20;
+    
+    //! Parse flag instructing the parser to create comments nodes.
+    //! By default, comment nodes are not created.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_comment_nodes = 0x40;
+    
+    //! Parse flag instructing the parser to create DOCTYPE node.
+    //! By default, doctype node is not created.
+    //! Although W3C specification allows at most one DOCTYPE node, RapidXml will silently accept documents with more than one.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_doctype_node = 0x80;
+    
+    //! Parse flag instructing the parser to create PI nodes.
+    //! By default, PI nodes are not created.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_pi_nodes = 0x100;
+    
+    //! Parse flag instructing the parser to validate closing tag names. 
+    //! If not set, name inside closing tag is irrelevant to the parser.
+    //! By default, closing tags are not validated.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_validate_closing_tags = 0x200;
+    
+    //! Parse flag instructing the parser to trim all leading and trailing whitespace of data nodes.
+    //! By default, whitespace is not trimmed. 
+    //! This flag does not cause the parser to modify source text.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_trim_whitespace = 0x400;
+
+    //! Parse flag instructing the parser to condense all whitespace runs of data nodes to a single space character.
+    //! Trimming of leading and trailing whitespace of data is controlled by rapidxml::parse_trim_whitespace flag.
+    //! By default, whitespace is not normalized. 
+    //! If this flag is specified, source text will be modified.
+    //! Can be combined with other flags by use of | operator.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_normalize_whitespace = 0x800;
+
+    // Compound flags
+    
+    //! Parse flags which represent default behaviour of the parser. 
+    //! This is always equal to 0, so that all other flags can be simply ored together.
+    //! Normally there is no need to inconveniently disable flags by anding with their negated (~) values.
+    //! This also means that meaning of each flag is a <i>negation</i> of the default setting. 
+    //! For example, if flag name is rapidxml::parse_no_utf8, it means that utf-8 is <i>enabled</i> by default,
+    //! and using the flag will disable it.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_default = 0;
+    
+    //! A combination of parse flags that forbids any modifications of the source text. 
+    //! This also results in faster parsing. However, note that the following will occur:
+    //! <ul>
+    //! <li>names and values of nodes will not be zero terminated, you have to use xml_base::name_size() and xml_base::value_size() functions to determine where name and value ends</li>
+    //! <li>entities will not be translated</li>
+    //! <li>whitespace will not be normalized</li>
+    //! </ul>
+    //! See xml_document::parse() function.
+    const int parse_non_destructive = parse_no_string_terminators | parse_no_entity_translation;
+    
+    //! A combination of parse flags resulting in fastest possible parsing, without sacrificing important data.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_fastest = parse_non_destructive | parse_no_data_nodes;
+    
+    //! A combination of parse flags resulting in largest amount of data being extracted. 
+    //! This usually results in slowest parsing.
+    //! <br><br>
+    //! See xml_document::parse() function.
+    const int parse_full = parse_declaration_node | parse_comment_nodes | parse_doctype_node | parse_pi_nodes | parse_validate_closing_tags;
+
+    ///////////////////////////////////////////////////////////////////////
+    // Internals
+
+    //! \cond internal
+    namespace internal
+    {
+
+        // Struct that contains lookup tables for the parser
+        // It must be a template to allow correct linking (because it has static data members, which are defined in a header file).
+        template<int Dummy>
+        struct lookup_tables
+        {
+            static const unsigned char lookup_whitespace[256];              // Whitespace table
+            static const unsigned char lookup_node_name[256];               // Node name table
+            static const unsigned char lookup_text[256];                    // Text table
+            static const unsigned char lookup_text_pure_no_ws[256];         // Text table
+            static const unsigned char lookup_text_pure_with_ws[256];       // Text table
+            static const unsigned char lookup_attribute_name[256];          // Attribute name table
+            static const unsigned char lookup_attribute_data_1[256];        // Attribute data table with single quote
+            static const unsigned char lookup_attribute_data_1_pure[256];   // Attribute data table with single quote
+            static const unsigned char lookup_attribute_data_2[256];        // Attribute data table with double quotes
+            static const unsigned char lookup_attribute_data_2_pure[256];   // Attribute data table with double quotes
+            static const unsigned char lookup_digits[256];                  // Digits
+            static const unsigned char lookup_upcase[256];                  // To uppercase conversion table for ASCII characters
+        };
+
+        // Find length of the string
+        template<class Ch>
+        inline std::size_t measure(const Ch *p)
+        {
+            const Ch *tmp = p;
+            while (*tmp) 
+                ++tmp;
+            return tmp - p;
+        }
+
+        // Compare strings for equality
+        template<class Ch>
+        inline bool compare(const Ch *p1, std::size_t size1, const Ch *p2, std::size_t size2, bool case_sensitive)
+        {
+            if (size1 != size2)
+                return false;
+            if (case_sensitive)
+            {
+                for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2)
+                    if (*p1 != *p2)
+                        return false;
+            }
+            else
+            {
+                for (const Ch *end = p1 + size1; p1 < end; ++p1, ++p2)
+                    if (lookup_tables<0>::lookup_upcase[static_cast<unsigned char>(*p1)] != lookup_tables<0>::lookup_upcase[static_cast<unsigned char>(*p2)])
+                        return false;
+            }
+            return true;
+        }
+    }
+    //! \endcond
+
+    ///////////////////////////////////////////////////////////////////////
+    // Memory pool
+    
+    //! This class is used by the parser to create new nodes and attributes, without overheads of dynamic memory allocation.
+    //! In most cases, you will not need to use this class directly. 
+    //! However, if you need to create nodes manually or modify names/values of nodes, 
+    //! you are encouraged to use memory_pool of relevant xml_document to allocate the memory. 
+    //! Not only is this faster than allocating them by using <code>new</code> operator, 
+    //! but also their lifetime will be tied to the lifetime of document, 
+    //! possibly simplyfing memory management. 
+    //! <br><br>
+    //! Call allocate_node() or allocate_attribute() functions to obtain new nodes or attributes from the pool. 
+    //! You can also call allocate_string() function to allocate strings.
+    //! Such strings can then be used as names or values of nodes without worrying about their lifetime.
+    //! Note that there is no <code>free()</code> function -- all allocations are freed at once when clear() function is called, 
+    //! or when the pool is destroyed.
+    //! <br><br>
+    //! It is also possible to create a standalone memory_pool, and use it 
+    //! to allocate nodes, whose lifetime will not be tied to any document.
+    //! <br><br>
+    //! Pool maintains <code>RAPIDXML_STATIC_POOL_SIZE</code> bytes of statically allocated memory. 
+    //! Until static memory is exhausted, no dynamic memory allocations are done.
+    //! When static memory is exhausted, pool allocates additional blocks of memory of size <code>RAPIDXML_DYNAMIC_POOL_SIZE</code> each,
+    //! by using global <code>new[]</code> and <code>delete[]</code> operators. 
+    //! This behaviour can be changed by setting custom allocation routines. 
+    //! Use set_allocator() function to set them.
+    //! <br><br>
+    //! Allocations for nodes, attributes and strings are aligned at <code>RAPIDXML_ALIGNMENT</code> bytes.
+    //! This value defaults to the size of pointer on target architecture.
+    //! <br><br>
+    //! To obtain absolutely top performance from the parser,
+    //! it is important that all nodes are allocated from a single, contiguous block of memory.
+    //! Otherwise, cache misses when jumping between two (or more) disjoint blocks of memory can slow down parsing quite considerably.
+    //! If required, you can tweak <code>RAPIDXML_STATIC_POOL_SIZE</code>, <code>RAPIDXML_DYNAMIC_POOL_SIZE</code> and <code>RAPIDXML_ALIGNMENT</code> 
+    //! to obtain best wasted memory to performance compromise.
+    //! To do it, define their values before rapidxml.hpp file is included.
+    //! \param Ch Character type of created nodes. 
+    template<class Ch = char>
+    class memory_pool
+    {
+        
+    public:
+
+        //! \cond internal
+        typedef void *(alloc_func)(std::size_t);       // Type of user-defined function used to allocate memory
+        typedef void (free_func)(void *);              // Type of user-defined function used to free memory
+        //! \endcond
+        
+        //! Constructs empty pool with default allocator functions.
+        memory_pool()
+            : m_alloc_func(0)
+            , m_free_func(0)
+        {
+            init();
+        }
+
+        //! Destroys pool and frees all the memory. 
+        //! This causes memory occupied by nodes allocated by the pool to be freed.
+        //! Nodes allocated from the pool are no longer valid.
+        ~memory_pool()
+        {
+            clear();
+        }
+
+        //! Allocates a new node from the pool, and optionally assigns name and value to it. 
+        //! If the allocation request cannot be accomodated, this function will throw <code>std::bad_alloc</code>.
+        //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function
+        //! will call rapidxml::parse_error_handler() function.
+        //! \param type Type of node to create.
+        //! \param name Name to assign to the node, or 0 to assign no name.
+        //! \param value Value to assign to the node, or 0 to assign no value.
+        //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string.
+        //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string.
+        //! \return Pointer to allocated node. This pointer will never be NULL.
+        xml_node<Ch> *allocate_node(node_type type, 
+                                    const Ch *name = 0, const Ch *value = 0, 
+                                    std::size_t name_size = 0, std::size_t value_size = 0)
+        {
+            void *memory = allocate_aligned(sizeof(xml_node<Ch>));
+            xml_node<Ch> *node = new(memory) xml_node<Ch>(type);
+            if (name)
+            {
+                if (name_size > 0)
+                    node->name(name, name_size);
+                else
+                    node->name(name);
+            }
+            if (value)
+            {
+                if (value_size > 0)
+                    node->value(value, value_size);
+                else
+                    node->value(value);
+            }
+            return node;
+        }
+
+        //! Allocates a new attribute from the pool, and optionally assigns name and value to it.
+        //! If the allocation request cannot be accomodated, this function will throw <code>std::bad_alloc</code>.
+        //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function
+        //! will call rapidxml::parse_error_handler() function.
+        //! \param name Name to assign to the attribute, or 0 to assign no name.
+        //! \param value Value to assign to the attribute, or 0 to assign no value.
+        //! \param name_size Size of name to assign, or 0 to automatically calculate size from name string.
+        //! \param value_size Size of value to assign, or 0 to automatically calculate size from value string.
+        //! \return Pointer to allocated attribute. This pointer will never be NULL.
+        xml_attribute<Ch> *allocate_attribute(const Ch *name = 0, const Ch *value = 0, 
+                                              std::size_t name_size = 0, std::size_t value_size = 0)
+        {
+            void *memory = allocate_aligned(sizeof(xml_attribute<Ch>));
+            xml_attribute<Ch> *attribute = new(memory) xml_attribute<Ch>;
+            if (name)
+            {
+                if (name_size > 0)
+                    attribute->name(name, name_size);
+                else
+                    attribute->name(name);
+            }
+            if (value)
+            {
+                if (value_size > 0)
+                    attribute->value(value, value_size);
+                else
+                    attribute->value(value);
+            }
+            return attribute;
+        }
+
+        //! Allocates a char array of given size from the pool, and optionally copies a given string to it.
+        //! If the allocation request cannot be accomodated, this function will throw <code>std::bad_alloc</code>.
+        //! If exceptions are disabled by defining RAPIDXML_NO_EXCEPTIONS, this function
+        //! will call rapidxml::parse_error_handler() function.
+        //! \param source String to initialize the allocated memory with, or 0 to not initialize it.
+        //! \param size Number of characters to allocate, or zero to calculate it automatically from source string length; if size is 0, source string must be specified and null terminated.
+        //! \return Pointer to allocated char array. This pointer will never be NULL.
+        Ch *allocate_string(const Ch *source = 0, std::size_t size = 0)
+        {
+            assert(source || size);     // Either source or size (or both) must be specified
+            if (size == 0)
+                size = internal::measure(source) + 1;
+            Ch *result = static_cast<Ch *>(allocate_aligned(size * sizeof(Ch)));
+            if (source)
+                for (std::size_t i = 0; i < size; ++i)
+                    result[i] = source[i];
+            return result;
+        }
+
+        //! Clones an xml_node and its hierarchy of child nodes and attributes.
+        //! Nodes and attributes are allocated from this memory pool.
+        //! Names and values are not cloned, they are shared between the clone and the source.
+        //! Result node can be optionally specified as a second parameter, 
+        //! in which case its contents will be replaced with cloned source node.
+        //! This is useful when you want to clone entire document.
+        //! \param source Node to clone.
+        //! \param result Node to put results in, or 0 to automatically allocate result node
+        //! \return Pointer to cloned node. This pointer will never be NULL.
+        xml_node<Ch> *clone_node(const xml_node<Ch> *source, xml_node<Ch> *result = 0)
+        {
+            // Prepare result node
+            if (result)
+            {
+                result->remove_all_attributes();
+                result->remove_all_nodes();
+                result->type(source->type());
+            }
+            else
+                result = allocate_node(source->type());
+
+            // Clone name and value
+            result->name(source->name(), source->name_size());
+            result->value(source->value(), source->value_size());
+
+            // Clone child nodes and attributes
+            for (xml_node<Ch> *child = source->first_node(); child; child = child->next_sibling())
+                result->append_node(clone_node(child));
+            for (xml_attribute<Ch> *attr = source->first_attribute(); attr; attr = attr->next_attribute())
+                result->append_attribute(allocate_attribute(attr->name(), attr->value(), attr->name_size(), attr->value_size()));
+
+            return result;
+        }
+
+        //! Clears the pool. 
+        //! This causes memory occupied by nodes allocated by the pool to be freed.
+        //! Any nodes or strings allocated from the pool will no longer be valid.
+        void clear()
+        {
+            while (m_begin != m_static_memory)
+            {
+                char *previous_begin = reinterpret_cast<header *>(align(m_begin))->previous_begin;
+                if (m_free_func)
+                    m_free_func(m_begin);
+                else
+                    delete[] m_begin;
+                m_begin = previous_begin;
+            }
+            init();
+        }
+
+        //! Sets or resets the user-defined memory allocation functions for the pool.
+        //! This can only be called when no memory is allocated from the pool yet, otherwise results are undefined.
+        //! Allocation function must not return invalid pointer on failure. It should either throw,
+        //! stop the program, or use <code>longjmp()</code> function to pass control to other place of program. 
+        //! If it returns invalid pointer, results are undefined.
+        //! <br><br>
+        //! User defined allocation functions must have the following forms:
+        //! <br><code>
+        //! <br>void *allocate(std::size_t size);
+        //! <br>void free(void *pointer);
+        //! </code><br>
+        //! \param af Allocation function, or 0 to restore default function
+        //! \param ff Free function, or 0 to restore default function
+        void set_allocator(alloc_func *af, free_func *ff)
+        {
+            assert(m_begin == m_static_memory && m_ptr == align(m_begin));    // Verify that no memory is allocated yet
+            m_alloc_func = af;
+            m_free_func = ff;
+        }
+
+    private:
+
+        struct header
+        {
+            char *previous_begin;
+        };
+
+        void init()
+        {
+            m_begin = m_static_memory;
+            m_ptr = align(m_begin);
+            m_end = m_static_memory + sizeof(m_static_memory);
+        }
+        
+        char *align(char *ptr)
+        {
+            std::size_t alignment = ((RAPIDXML_ALIGNMENT - (std::size_t(ptr) & (RAPIDXML_ALIGNMENT - 1))) & (RAPIDXML_ALIGNMENT - 1));
+            return ptr + alignment;
+        }
+        
+        char *allocate_raw(std::size_t size)
+        {
+            // Allocate
+            void *memory;   
+            if (m_alloc_func)   // Allocate memory using either user-specified allocation function or global operator new[]
+            {
+                memory = m_alloc_func(size);
+                assert(memory); // Allocator is not allowed to return 0, on failure it must either throw, stop the program or use longjmp
+            }
+            else
+            {
+                memory = new char[size];
+#ifdef RAPIDXML_NO_EXCEPTIONS
+                if (!memory)            // If exceptions are disabled, verify memory allocation, because new will not be able to throw bad_alloc
+                    RAPIDXML_PARSE_ERROR("out of memory", 0);
+#endif
+            }
+            return static_cast<char *>(memory);
+        }
+        
+        void *allocate_aligned(std::size_t size)
+        {
+            // Calculate aligned pointer
+            char *result = align(m_ptr);
+
+            // If not enough memory left in current pool, allocate a new pool
+            if (result + size > m_end)
+            {
+                // Calculate required pool size (may be bigger than RAPIDXML_DYNAMIC_POOL_SIZE)
+                std::size_t pool_size = RAPIDXML_DYNAMIC_POOL_SIZE;
+                if (pool_size < size)
+                    pool_size = size;
+                
+                // Allocate
+                std::size_t alloc_size = sizeof(header) + (2 * RAPIDXML_ALIGNMENT - 2) + pool_size;     // 2 alignments required in worst case: one for header, one for actual allocation
+                char *raw_memory = allocate_raw(alloc_size);
+                    
+                // Setup new pool in allocated memory
+                char *pool = align(raw_memory);
+                header *new_header = reinterpret_cast<header *>(pool);
+                new_header->previous_begin = m_begin;
+                m_begin = raw_memory;
+                m_ptr = pool + sizeof(header);
+                m_end = raw_memory + alloc_size;
+
+                // Calculate aligned pointer again using new pool
+                result = align(m_ptr);
+            }
+
+            // Update pool and return aligned pointer
+            m_ptr = result + size;
+            return result;
+        }
+
+        char *m_begin;                                      // Start of raw memory making up current pool
+        char *m_ptr;                                        // First free byte in current pool
+        char *m_end;                                        // One past last available byte in current pool
+        char m_static_memory[RAPIDXML_STATIC_POOL_SIZE];    // Static raw memory
+        alloc_func *m_alloc_func;                           // Allocator function, or 0 if default is to be used
+        free_func *m_free_func;                             // Free function, or 0 if default is to be used
+    };
+
+    ///////////////////////////////////////////////////////////////////////////
+    // XML base
+
+    //! Base class for xml_node and xml_attribute implementing common functions: 
+    //! name(), name_size(), value(), value_size() and parent().
+    //! \param Ch Character type to use
+    template<class Ch = char>
+    class xml_base
+    {
+
+    public:
+        
+        ///////////////////////////////////////////////////////////////////////////
+        // Construction & destruction
+    
+        // Construct a base with empty name, value and parent
+        xml_base()
+            : m_name(0)
+            , m_value(0)
+            , m_parent(0)
+        {
+        }
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Node data access
+    
+        //! Gets name of the node. 
+        //! Interpretation of name depends on type of node.
+        //! Note that name will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.
+        //! <br><br>
+        //! Use name_size() function to determine length of the name.
+        //! \return Name of node, or empty string if node has no name.
+        Ch *name() const
+        {
+            return m_name ? m_name : nullstr();
+        }
+
+        //! Gets size of node name, not including terminator character.
+        //! This function works correctly irrespective of whether name is or is not zero terminated.
+        //! \return Size of node name, in characters.
+        std::size_t name_size() const
+        {
+            return m_name ? m_name_size : 0;
+        }
+
+        //! Gets value of node. 
+        //! Interpretation of value depends on type of node.
+        //! Note that value will not be zero-terminated if rapidxml::parse_no_string_terminators option was selected during parse.
+        //! <br><br>
+        //! Use value_size() function to determine length of the value.
+        //! \return Value of node, or empty string if node has no value.
+        Ch *value() const
+        {
+            return m_value ? m_value : nullstr();
+        }
+
+        //! Gets size of node value, not including terminator character.
+        //! This function works correctly irrespective of whether value is or is not zero terminated.
+        //! \return Size of node value, in characters.
+        std::size_t value_size() const
+        {
+            return m_value ? m_value_size : 0;
+        }
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Node modification
+    
+        //! Sets name of node to a non zero-terminated string.
+        //! See \ref ownership_of_strings.
+        //! <br><br>
+        //! Note that node does not own its name or value, it only stores a pointer to it. 
+        //! It will not delete or otherwise free the pointer on destruction.
+        //! It is reponsibility of the user to properly manage lifetime of the string.
+        //! The easiest way to achieve it is to use memory_pool of the document to allocate the string -
+        //! on destruction of the document the string will be automatically freed.
+        //! <br><br>
+        //! Size of name must be specified separately, because name does not have to be zero terminated.
+        //! Use name(const Ch *) function to have the length automatically calculated (string must be zero terminated).
+        //! \param name Name of node to set. Does not have to be zero terminated.
+        //! \param size Size of name, in characters. This does not include zero terminator, if one is present.
+        void name(const Ch *name, std::size_t size)
+        {
+            m_name = const_cast<Ch *>(name);
+            m_name_size = size;
+        }
+
+        //! Sets name of node to a zero-terminated string.
+        //! See also \ref ownership_of_strings and xml_node::name(const Ch *, std::size_t).
+        //! \param name Name of node to set. Must be zero terminated.
+        void name(const Ch *name)
+        {
+            this->name(name, internal::measure(name));
+        }
+
+        //! Sets value of node to a non zero-terminated string.
+        //! See \ref ownership_of_strings.
+        //! <br><br>
+        //! Note that node does not own its name or value, it only stores a pointer to it. 
+        //! It will not delete or otherwise free the pointer on destruction.
+        //! It is reponsibility of the user to properly manage lifetime of the string.
+        //! The easiest way to achieve it is to use memory_pool of the document to allocate the string -
+        //! on destruction of the document the string will be automatically freed.
+        //! <br><br>
+        //! Size of value must be specified separately, because it does not have to be zero terminated.
+        //! Use value(const Ch *) function to have the length automatically calculated (string must be zero terminated).
+        //! <br><br>
+        //! If an element has a child node of type node_data, it will take precedence over element value when printing.
+        //! If you want to manipulate data of elements using values, use parser flag rapidxml::parse_no_data_nodes to prevent creation of data nodes by the parser.
+        //! \param value value of node to set. Does not have to be zero terminated.
+        //! \param size Size of value, in characters. This does not include zero terminator, if one is present.
+        void value(const Ch *value, std::size_t size)
+        {
+            m_value = const_cast<Ch *>(value);
+            m_value_size = size;
+        }
+
+        //! Sets value of node to a zero-terminated string.
+        //! See also \ref ownership_of_strings and xml_node::value(const Ch *, std::size_t).
+        //! \param value Vame of node to set. Must be zero terminated.
+        void value(const Ch *value)
+        {
+            this->value(value, internal::measure(value));
+        }
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Related nodes access
+    
+        //! Gets node parent.
+        //! \return Pointer to parent node, or 0 if there is no parent.
+        xml_node<Ch> *parent() const
+        {
+            return m_parent;
+        }
+
+    protected:
+
+        // Return empty string
+        static Ch *nullstr()
+        {
+            static Ch zero = Ch('\0');
+            return &zero;
+        }
+
+        Ch *m_name;                         // Name of node, or 0 if no name
+        Ch *m_value;                        // Value of node, or 0 if no value
+        std::size_t m_name_size;            // Length of node name, or undefined of no name
+        std::size_t m_value_size;           // Length of node value, or undefined if no value
+        xml_node<Ch> *m_parent;             // Pointer to parent node, or 0 if none
+
+    };
+
+    //! Class representing attribute node of XML document. 
+    //! Each attribute has name and value strings, which are available through name() and value() functions (inherited from xml_base).
+    //! Note that after parse, both name and value of attribute will point to interior of source text used for parsing. 
+    //! Thus, this text must persist in memory for the lifetime of attribute.
+    //! \param Ch Character type to use.
+    template<class Ch = char>
+    class xml_attribute: public xml_base<Ch>
+    {
+
+        friend class xml_node<Ch>;
+    
+    public:
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Construction & destruction
+    
+        //! Constructs an empty attribute with the specified type. 
+        //! Consider using memory_pool of appropriate xml_document if allocating attributes manually.
+        xml_attribute()
+        {
+        }
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Related nodes access
+    
+        //! Gets document of which attribute is a child.
+        //! \return Pointer to document that contains this attribute, or 0 if there is no parent document.
+        xml_document<Ch> *document() const
+        {
+            if (xml_node<Ch> *node = this->parent())
+            {
+                while (node->parent())
+                    node = node->parent();
+                return node->type() == node_document ? static_cast<xml_document<Ch> *>(node) : 0;
+            }
+            else
+                return 0;
+        }
+
+        //! Gets previous attribute, optionally matching attribute name. 
+        //! \param name Name of attribute to find, or 0 to return previous attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+        //! \return Pointer to found attribute, or 0 if not found.
+        xml_attribute<Ch> *previous_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+        {
+            if (name)
+            {
+                if (name_size == 0)
+                    name_size = internal::measure(name);
+                for (xml_attribute<Ch> *attribute = m_prev_attribute; attribute; attribute = attribute->m_prev_attribute)
+                    if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
+                        return attribute;
+                return 0;
+            }
+            else
+                return this->m_parent ? m_prev_attribute : 0;
+        }
+
+        //! Gets next attribute, optionally matching attribute name. 
+        //! \param name Name of attribute to find, or 0 to return next attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+        //! \return Pointer to found attribute, or 0 if not found.
+        xml_attribute<Ch> *next_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+        {
+            if (name)
+            {
+                if (name_size == 0)
+                    name_size = internal::measure(name);
+                for (xml_attribute<Ch> *attribute = m_next_attribute; attribute; attribute = attribute->m_next_attribute)
+                    if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
+                        return attribute;
+                return 0;
+            }
+            else
+                return this->m_parent ? m_next_attribute : 0;
+        }
+
+    private:
+
+        xml_attribute<Ch> *m_prev_attribute;        // Pointer to previous sibling of attribute, or 0 if none; only valid if parent is non-zero
+        xml_attribute<Ch> *m_next_attribute;        // Pointer to next sibling of attribute, or 0 if none; only valid if parent is non-zero
+    
+    };
+
+    ///////////////////////////////////////////////////////////////////////////
+    // XML node
+
+    //! Class representing a node of XML document. 
+    //! Each node may have associated name and value strings, which are available through name() and value() functions. 
+    //! Interpretation of name and value depends on type of the node.
+    //! Type of node can be determined by using type() function.
+    //! <br><br>
+    //! Note that after parse, both name and value of node, if any, will point interior of source text used for parsing. 
+    //! Thus, this text must persist in the memory for the lifetime of node.
+    //! \param Ch Character type to use.
+    template<class Ch = char>
+    class xml_node: public xml_base<Ch>
+    {
+
+    public:
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Construction & destruction
+    
+        //! Constructs an empty node with the specified type. 
+        //! Consider using memory_pool of appropriate document to allocate nodes manually.
+        //! \param type Type of node to construct.
+        xml_node(node_type type)
+            : m_type(type)
+            , m_first_node(0)
+            , m_first_attribute(0)
+        {
+        }
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Node data access
+    
+        //! Gets type of node.
+        //! \return Type of node.
+        node_type type() const
+        {
+            return m_type;
+        }
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Related nodes access
+    
+        //! Gets document of which node is a child.
+        //! \return Pointer to document that contains this node, or 0 if there is no parent document.
+        xml_document<Ch> *document() const
+        {
+            xml_node<Ch> *node = const_cast<xml_node<Ch> *>(this);
+            while (node->parent())
+                node = node->parent();
+            return node->type() == node_document ? static_cast<xml_document<Ch> *>(node) : 0;
+        }
+
+        //! Gets first child node, optionally matching node name.
+        //! \param name Name of child to find, or 0 to return first child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+        //! \return Pointer to found child, or 0 if not found.
+        xml_node<Ch> *first_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+        {
+            if (name)
+            {
+                if (name_size == 0)
+                    name_size = internal::measure(name);
+                for (xml_node<Ch> *child = m_first_node; child; child = child->next_sibling())
+                    if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
+                        return child;
+                return 0;
+            }
+            else
+                return m_first_node;
+        }
+
+        //! Gets last child node, optionally matching node name. 
+        //! Behaviour is undefined if node has no children.
+        //! Use first_node() to test if node has children.
+        //! \param name Name of child to find, or 0 to return last child regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+        //! \return Pointer to found child, or 0 if not found.
+        xml_node<Ch> *last_node(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+        {
+            assert(m_first_node);  // Cannot query for last child if node has no children
+            if (name)
+            {
+                if (name_size == 0)
+                    name_size = internal::measure(name);
+                for (xml_node<Ch> *child = m_last_node; child; child = child->previous_sibling())
+                    if (internal::compare(child->name(), child->name_size(), name, name_size, case_sensitive))
+                        return child;
+                return 0;
+            }
+            else
+                return m_last_node;
+        }
+
+        //! Gets previous sibling node, optionally matching node name. 
+        //! Behaviour is undefined if node has no parent.
+        //! Use parent() to test if node has a parent.
+        //! \param name Name of sibling to find, or 0 to return previous sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+        //! \return Pointer to found sibling, or 0 if not found.
+        xml_node<Ch> *previous_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+        {
+            assert(this->m_parent);     // Cannot query for siblings if node has no parent
+            if (name)
+            {
+                if (name_size == 0)
+                    name_size = internal::measure(name);
+                for (xml_node<Ch> *sibling = m_prev_sibling; sibling; sibling = sibling->m_prev_sibling)
+                    if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
+                        return sibling;
+                return 0;
+            }
+            else
+                return m_prev_sibling;
+        }
+
+        //! Gets next sibling node, optionally matching node name. 
+        //! Behaviour is undefined if node has no parent.
+        //! Use parent() to test if node has a parent.
+        //! \param name Name of sibling to find, or 0 to return next sibling regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+        //! \return Pointer to found sibling, or 0 if not found.
+        xml_node<Ch> *next_sibling(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+        {
+            assert(this->m_parent);     // Cannot query for siblings if node has no parent
+            if (name)
+            {
+                if (name_size == 0)
+                    name_size = internal::measure(name);
+                for (xml_node<Ch> *sibling = m_next_sibling; sibling; sibling = sibling->m_next_sibling)
+                    if (internal::compare(sibling->name(), sibling->name_size(), name, name_size, case_sensitive))
+                        return sibling;
+                return 0;
+            }
+            else
+                return m_next_sibling;
+        }
+
+        //! Gets first attribute of node, optionally matching attribute name.
+        //! \param name Name of attribute to find, or 0 to return first attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+        //! \return Pointer to found attribute, or 0 if not found.
+        xml_attribute<Ch> *first_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+        {
+            if (name)
+            {
+                if (name_size == 0)
+                    name_size = internal::measure(name);
+                for (xml_attribute<Ch> *attribute = m_first_attribute; attribute; attribute = attribute->m_next_attribute)
+                    if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
+                        return attribute;
+                return 0;
+            }
+            else
+                return m_first_attribute;
+        }
+
+        //! Gets last attribute of node, optionally matching attribute name.
+        //! \param name Name of attribute to find, or 0 to return last attribute regardless of its name; this string doesn't have to be zero-terminated if name_size is non-zero
+        //! \param name_size Size of name, in characters, or 0 to have size calculated automatically from string
+        //! \param case_sensitive Should name comparison be case-sensitive; non case-sensitive comparison works properly only for ASCII characters
+        //! \return Pointer to found attribute, or 0 if not found.
+        xml_attribute<Ch> *last_attribute(const Ch *name = 0, std::size_t name_size = 0, bool case_sensitive = true) const
+        {
+            if (name)
+            {
+                if (name_size == 0)
+                    name_size = internal::measure(name);
+                for (xml_attribute<Ch> *attribute = m_last_attribute; attribute; attribute = attribute->m_prev_attribute)
+                    if (internal::compare(attribute->name(), attribute->name_size(), name, name_size, case_sensitive))
+                        return attribute;
+                return 0;
+            }
+            else
+                return m_first_attribute ? m_last_attribute : 0;
+        }
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Node modification
+    
+        //! Sets type of node.
+        //! \param type Type of node to set.
+        void type(node_type type)
+        {
+            m_type = type;
+        }
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Node manipulation
+
+        //! Prepends a new child node.
+        //! The prepended child becomes the first child, and all existing children are moved one position back.
+        //! \param child Node to prepend.
+        void prepend_node(xml_node<Ch> *child)
+        {
+            assert(child && !child->parent() && child->type() != node_document);
+            if (first_node())
+            {
+                child->m_next_sibling = m_first_node;
+                m_first_node->m_prev_sibling = child;
+            }
+            else
+            {
+                child->m_next_sibling = 0;
+                m_last_node = child;
+            }
+            m_first_node = child;
+            child->m_parent = this;
+            child->m_prev_sibling = 0;
+        }
+
+        //! Appends a new child node. 
+        //! The appended child becomes the last child.
+        //! \param child Node to append.
+        void append_node(xml_node<Ch> *child)
+        {
+            assert(child && !child->parent() && child->type() != node_document);
+            if (first_node())
+            {
+                child->m_prev_sibling = m_last_node;
+                m_last_node->m_next_sibling = child;
+            }
+            else
+            {
+                child->m_prev_sibling = 0;
+                m_first_node = child;
+            }
+            m_last_node = child;
+            child->m_parent = this;
+            child->m_next_sibling = 0;
+        }
+
+        //! Inserts a new child node at specified place inside the node. 
+        //! All children after and including the specified node are moved one position back.
+        //! \param where Place where to insert the child, or 0 to insert at the back.
+        //! \param child Node to insert.
+        void insert_node(xml_node<Ch> *where, xml_node<Ch> *child)
+        {
+            assert(!where || where->parent() == this);
+            assert(child && !child->parent() && child->type() != node_document);
+            if (where == m_first_node)
+                prepend_node(child);
+            else if (where == 0)
+                append_node(child);
+            else
+            {
+                child->m_prev_sibling = where->m_prev_sibling;
+                child->m_next_sibling = where;
+                where->m_prev_sibling->m_next_sibling = child;
+                where->m_prev_sibling = child;
+                child->m_parent = this;
+            }
+        }
+
+        //! Removes first child node. 
+        //! If node has no children, behaviour is undefined.
+        //! Use first_node() to test if node has children.
+        void remove_first_node()
+        {
+            assert(first_node());
+            xml_node<Ch> *child = m_first_node;
+            m_first_node = child->m_next_sibling;
+            if (child->m_next_sibling)
+                child->m_next_sibling->m_prev_sibling = 0;
+            else
+                m_last_node = 0;
+            child->m_parent = 0;
+        }
+
+        //! Removes last child of the node. 
+        //! If node has no children, behaviour is undefined.
+        //! Use first_node() to test if node has children.
+        void remove_last_node()
+        {
+            assert(first_node());
+            xml_node<Ch> *child = m_last_node;
+            if (child->m_prev_sibling)
+            {
+                m_last_node = child->m_prev_sibling;
+                child->m_prev_sibling->m_next_sibling = 0;
+            }
+            else
+                m_first_node = 0;
+            child->m_parent = 0;
+        }
+
+        //! Removes specified child from the node
+        // \param where Pointer to child to be removed.
+        void remove_node(xml_node<Ch> *where)
+        {
+            assert(where && where->parent() == this);
+            assert(first_node());
+            if (where == m_first_node)
+                remove_first_node();
+            else if (where == m_last_node)
+                remove_last_node();
+            else
+            {
+                where->m_prev_sibling->m_next_sibling = where->m_next_sibling;
+                where->m_next_sibling->m_prev_sibling = where->m_prev_sibling;
+                where->m_parent = 0;
+            }
+        }
+
+        //! Removes all child nodes (but not attributes).
+        void remove_all_nodes()
+        {
+            for (xml_node<Ch> *node = first_node(); node; node = node->m_next_sibling)
+                node->m_parent = 0;
+            m_first_node = 0;
+        }
+
+        //! Prepends a new attribute to the node.
+        //! \param attribute Attribute to prepend.
+        void prepend_attribute(xml_attribute<Ch> *attribute)
+        {
+            assert(attribute && !attribute->parent());
+            if (first_attribute())
+            {
+                attribute->m_next_attribute = m_first_attribute;
+                m_first_attribute->m_prev_attribute = attribute;
+            }
+            else
+            {
+                attribute->m_next_attribute = 0;
+                m_last_attribute = attribute;
+            }
+            m_first_attribute = attribute;
+            attribute->m_parent = this;
+            attribute->m_prev_attribute = 0;
+        }
+
+        //! Appends a new attribute to the node.
+        //! \param attribute Attribute to append.
+        void append_attribute(xml_attribute<Ch> *attribute)
+        {
+            assert(attribute && !attribute->parent());
+            if (first_attribute())
+            {
+                attribute->m_prev_attribute = m_last_attribute;
+                m_last_attribute->m_next_attribute = attribute;
+            }
+            else
+            {
+                attribute->m_prev_attribute = 0;
+                m_first_attribute = attribute;
+            }
+            m_last_attribute = attribute;
+            attribute->m_parent = this;
+            attribute->m_next_attribute = 0;
+        }
+
+        //! Inserts a new attribute at specified place inside the node. 
+        //! All attributes after and including the specified attribute are moved one position back.
+        //! \param where Place where to insert the attribute, or 0 to insert at the back.
+        //! \param attribute Attribute to insert.
+        void insert_attribute(xml_attribute<Ch> *where, xml_attribute<Ch> *attribute)
+        {
+            assert(!where || where->parent() == this);
+            assert(attribute && !attribute->parent());
+            if (where == m_first_attribute)
+                prepend_attribute(attribute);
+            else if (where == 0)
+                append_attribute(attribute);
+            else
+            {
+                attribute->m_prev_attribute = where->m_prev_attribute;
+                attribute->m_next_attribute = where;
+                where->m_prev_attribute->m_next_attribute = attribute;
+                where->m_prev_attribute = attribute;
+                attribute->m_parent = this;
+            }
+        }
+
+        //! Removes first attribute of the node. 
+        //! If node has no attributes, behaviour is undefined.
+        //! Use first_attribute() to test if node has attributes.
+        void remove_first_attribute()
+        {
+            assert(first_attribute());
+            xml_attribute<Ch> *attribute = m_first_attribute;
+            if (attribute->m_next_attribute)
+            {
+                attribute->m_next_attribute->m_prev_attribute = 0;
+            }
+            else
+                m_last_attribute = 0;
+            attribute->m_parent = 0;
+            m_first_attribute = attribute->m_next_attribute;
+        }
+
+        //! Removes last attribute of the node. 
+        //! If node has no attributes, behaviour is undefined.
+        //! Use first_attribute() to test if node has attributes.
+        void remove_last_attribute()
+        {
+            assert(first_attribute());
+            xml_attribute<Ch> *attribute = m_last_attribute;
+            if (attribute->m_prev_attribute)
+            {
+                attribute->m_prev_attribute->m_next_attribute = 0;
+                m_last_attribute = attribute->m_prev_attribute;
+            }
+            else
+                m_first_attribute = 0;
+            attribute->m_parent = 0;
+        }
+
+        //! Removes specified attribute from node.
+        //! \param where Pointer to attribute to be removed.
+        void remove_attribute(xml_attribute<Ch> *where)
+        {
+            assert(first_attribute() && where->parent() == this);
+            if (where == m_first_attribute)
+                remove_first_attribute();
+            else if (where == m_last_attribute)
+                remove_last_attribute();
+            else
+            {
+                where->m_prev_attribute->m_next_attribute = where->m_next_attribute;
+                where->m_next_attribute->m_prev_attribute = where->m_prev_attribute;
+                where->m_parent = 0;
+            }
+        }
+
+        //! Removes all attributes of node.
+        void remove_all_attributes()
+        {
+            for (xml_attribute<Ch> *attribute = first_attribute(); attribute; attribute = attribute->m_next_attribute)
+                attribute->m_parent = 0;
+            m_first_attribute = 0;
+        }
+        
+    private:
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Restrictions
+
+        // No copying
+        xml_node(const xml_node &);
+        void operator =(const xml_node &);
+    
+        ///////////////////////////////////////////////////////////////////////////
+        // Data members
+    
+        // Note that some of the pointers below have UNDEFINED values if certain other pointers are 0.
+        // This is required for maximum performance, as it allows the parser to omit initialization of 
+        // unneded/redundant values.
+        //
+        // The rules are as follows:
+        // 1. first_node and first_attribute contain valid pointers, or 0 if node has no children/attributes respectively
+        // 2. last_node and last_attribute are valid only if node has at least one child/attribute respectively, otherwise they contain garbage
+        // 3. prev_sibling and next_sibling are valid only if node has a parent, otherwise they contain garbage
+
+        node_type m_type;                       // Type of node; always valid
+        xml_node<Ch> *m_first_node;             // Pointer to first child node, or 0 if none; always valid
+        xml_node<Ch> *m_last_node;              // Pointer to last child node, or 0 if none; this value is only valid if m_first_node is non-zero
+        xml_attribute<Ch> *m_first_attribute;   // Pointer to first attribute of node, or 0 if none; always valid
+        xml_attribute<Ch> *m_last_attribute;    // Pointer to last attribute of node, or 0 if none; this value is only valid if m_first_attribute is non-zero
+        xml_node<Ch> *m_prev_sibling;           // Pointer to previous sibling of node, or 0 if none; this value is only valid if m_parent is non-zero
+        xml_node<Ch> *m_next_sibling;           // Pointer to next sibling of node, or 0 if none; this value is only valid if m_parent is non-zero
+
+    };
+
+    ///////////////////////////////////////////////////////////////////////////
+    // XML document
+    
+    //! This class represents root of the DOM hierarchy. 
+    //! It is also an xml_node and a memory_pool through public inheritance.
+    //! Use parse() function to build a DOM tree from a zero-terminated XML text string.
+    //! parse() function allocates memory for nodes and attributes by using functions of xml_document, 
+    //! which are inherited from memory_pool.
+    //! To access root node of the document, use the document itself, as if it was an xml_node.
+    //! \param Ch Character type to use.
+    template<class Ch = char>
+    class xml_document: public xml_node<Ch>, public memory_pool<Ch>
+    {
+    
+    public:
+
+        //! Constructs empty XML document
+        xml_document()
+            : xml_node<Ch>(node_document)
+        {
+        }
+
+        //! Parses zero-terminated XML string according to given flags.
+        //! Passed string will be modified by the parser, unless rapidxml::parse_non_destructive flag is used.
+        //! The string must persist for the lifetime of the document.
+        //! In case of error, rapidxml::parse_error exception will be thrown.
+        //! <br><br>
+        //! If you want to parse contents of a file, you must first load the file into the memory, and pass pointer to its beginning.
+        //! Make sure that data is zero-terminated.
+        //! <br><br>
+        //! Document can be parsed into multiple times. 
+        //! Each new call to parse removes previous nodes and attributes (if any), but does not clear memory pool.
+        //! \param text XML data to parse; pointer is non-const to denote fact that this data may be modified by the parser.
+        template<int Flags>
+        void parse(Ch *text)
+        {
+            assert(text);
+            
+            // Remove current contents
+            this->remove_all_nodes();
+            this->remove_all_attributes();
+            
+            // Parse BOM, if any
+            parse_bom<Flags>(text);
+            
+            // Parse children
+            while (1)
+            {
+                // Skip whitespace before node
+                skip<whitespace_pred, Flags>(text);
+                if (*text == 0)
+                    break;
+
+                // Parse and append new child
+                if (*text == Ch('<'))
+                {
+                    ++text;     // Skip '<'
+                    if (xml_node<Ch> *node = parse_node<Flags>(text))
+                        this->append_node(node);
+                }
+                else
+                    RAPIDXML_PARSE_ERROR("expected <", text);
+            }
+
+        }
+
+        //! Clears the document by deleting all nodes and clearing the memory pool.
+        //! All nodes owned by document pool are destroyed.
+        void clear()
+        {
+            this->remove_all_nodes();
+            this->remove_all_attributes();
+            memory_pool<Ch>::clear();
+        }
+        
+    private:
+
+        ///////////////////////////////////////////////////////////////////////
+        // Internal character utility functions
+        
+        // Detect whitespace character
+        struct whitespace_pred
+        {
+            static unsigned char test(Ch ch)
+            {
+                return internal::lookup_tables<0>::lookup_whitespace[static_cast<unsigned char>(ch)];
+            }
+        };
+
+        // Detect node name character
+        struct node_name_pred
+        {
+            static unsigned char test(Ch ch)
+            {
+                return internal::lookup_tables<0>::lookup_node_name[static_cast<unsigned char>(ch)];
+            }
+        };
+
+        // Detect attribute name character
+        struct attribute_name_pred
+        {
+            static unsigned char test(Ch ch)
+            {
+                return internal::lookup_tables<0>::lookup_attribute_name[static_cast<unsigned char>(ch)];
+            }
+        };
+
+        // Detect text character (PCDATA)
+        struct text_pred
+        {
+            static unsigned char test(Ch ch)
+            {
+                return internal::lookup_tables<0>::lookup_text[static_cast<unsigned char>(ch)];
+            }
+        };
+
+        // Detect text character (PCDATA) that does not require processing
+        struct text_pure_no_ws_pred
+        {
+            static unsigned char test(Ch ch)
+            {
+                return internal::lookup_tables<0>::lookup_text_pure_no_ws[static_cast<unsigned char>(ch)];
+            }
+        };
+
+        // Detect text character (PCDATA) that does not require processing
+        struct text_pure_with_ws_pred
+        {
+            static unsigned char test(Ch ch)
+            {
+                return internal::lookup_tables<0>::lookup_text_pure_with_ws[static_cast<unsigned char>(ch)];
+            }
+        };
+
+        // Detect attribute value character
+        template<Ch Quote>
+        struct attribute_value_pred
+        {
+            static unsigned char test(Ch ch)
+            {
+                if (Quote == Ch('\''))
+                    return internal::lookup_tables<0>::lookup_attribute_data_1[static_cast<unsigned char>(ch)];
+                if (Quote == Ch('\"'))
+                    return internal::lookup_tables<0>::lookup_attribute_data_2[static_cast<unsigned char>(ch)];
+                return 0;       // Should never be executed, to avoid warnings on Comeau
+            }
+        };
+
+        // Detect attribute value character
+        template<Ch Quote>
+        struct attribute_value_pure_pred
+        {
+            static unsigned char test(Ch ch)
+            {
+                if (Quote == Ch('\''))
+                    return internal::lookup_tables<0>::lookup_attribute_data_1_pure[static_cast<unsigned char>(ch)];
+                if (Quote == Ch('\"'))
+                    return internal::lookup_tables<0>::lookup_attribute_data_2_pure[static_cast<unsigned char>(ch)];
+                return 0;       // Should never be executed, to avoid warnings on Comeau
+            }
+        };
+
+        // Insert coded character, using UTF8 or 8-bit ASCII
+        template<int Flags>
+        static void insert_coded_character(Ch *&text, unsigned long code)
+        {
+            if (Flags & parse_no_utf8)
+            {
+                // Insert 8-bit ASCII character
+                // Todo: possibly verify that code is less than 256 and use replacement char otherwise?
+                text[0] = static_cast<unsigned char>(code);
+                text += 1;
+            }
+            else
+            {
+                // Insert UTF8 sequence
+                if (code < 0x80)    // 1 byte sequence
+                {
+	                text[0] = static_cast<unsigned char>(code);
+                    text += 1;
+                }
+                else if (code < 0x800)  // 2 byte sequence
+                {
+	                text[1] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+	                text[0] = static_cast<unsigned char>(code | 0xC0);
+                    text += 2;
+                }
+	            else if (code < 0x10000)    // 3 byte sequence
+                {
+	                text[2] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+	                text[1] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+	                text[0] = static_cast<unsigned char>(code | 0xE0);
+                    text += 3;
+                }
+	            else if (code < 0x110000)   // 4 byte sequence
+                {
+	                text[3] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+	                text[2] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+	                text[1] = static_cast<unsigned char>((code | 0x80) & 0xBF); code >>= 6;
+	                text[0] = static_cast<unsigned char>(code | 0xF0);
+                    text += 4;
+                }
+                else    // Invalid, only codes up to 0x10FFFF are allowed in Unicode
+                {
+                    RAPIDXML_PARSE_ERROR("invalid numeric character entity", text);
+                }
+            }
+        }
+
+        // Skip characters until predicate evaluates to true
+        template<class StopPred, int Flags>
+        static void skip(Ch *&text)
+        {
+            Ch *tmp = text;
+            while (StopPred::test(*tmp))
+                ++tmp;
+            text = tmp;
+        }
+
+        // Skip characters until predicate evaluates to true while doing the following:
+        // - replacing XML character entity references with proper characters (&apos; &amp; &quot; &lt; &gt; &#...;)
+        // - condensing whitespace sequences to single space character
+        template<class StopPred, class StopPredPure, int Flags>
+        static Ch *skip_and_expand_character_refs(Ch *&text)
+        {
+            // If entity translation, whitespace condense and whitespace trimming is disabled, use plain skip
+            if (Flags & parse_no_entity_translation && 
+                !(Flags & parse_normalize_whitespace) &&
+                !(Flags & parse_trim_whitespace))
+            {
+                skip<StopPred, Flags>(text);
+                return text;
+            }
+            
+            // Use simple skip until first modification is detected
+            skip<StopPredPure, Flags>(text);
+
+            // Use translation skip
+            Ch *src = text;
+            Ch *dest = src;
+            while (StopPred::test(*src))
+            {
+                // If entity translation is enabled    
+                if (!(Flags & parse_no_entity_translation))
+                {
+                    // Test if replacement is needed
+                    if (src[0] == Ch('&'))
+                    {
+                        switch (src[1])
+                        {
+
+                        // &amp; &apos;
+                        case Ch('a'): 
+                            if (src[2] == Ch('m') && src[3] == Ch('p') && src[4] == Ch(';'))
+                            {
+                                *dest = Ch('&');
+                                ++dest;
+                                src += 5;
+                                continue;
+                            }
+                            if (src[2] == Ch('p') && src[3] == Ch('o') && src[4] == Ch('s') && src[5] == Ch(';'))
+                            {
+                                *dest = Ch('\'');
+                                ++dest;
+                                src += 6;
+                                continue;
+                            }
+                            break;
+
+                        // &quot;
+                        case Ch('q'): 
+                            if (src[2] == Ch('u') && src[3] == Ch('o') && src[4] == Ch('t') && src[5] == Ch(';'))
+                            {
+                                *dest = Ch('"');
+                                ++dest;
+                                src += 6;
+                                continue;
+                            }
+                            break;
+
+                        // &gt;
+                        case Ch('g'): 
+                            if (src[2] == Ch('t') && src[3] == Ch(';'))
+                            {
+                                *dest = Ch('>');
+                                ++dest;
+                                src += 4;
+                                continue;
+                            }
+                            break;
+
+                        // &lt;
+                        case Ch('l'): 
+                            if (src[2] == Ch('t') && src[3] == Ch(';'))
+                            {
+                                *dest = Ch('<');
+                                ++dest;
+                                src += 4;
+                                continue;
+                            }
+                            break;
+
+                        // &#...; - assumes ASCII
+                        case Ch('#'): 
+                            if (src[2] == Ch('x'))
+                            {
+                                unsigned long code = 0;
+                                src += 3;   // Skip &#x
+                                while (1)
+                                {
+                                    unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)];
+                                    if (digit == 0xFF)
+                                        break;
+                                    code = code * 16 + digit;
+                                    ++src;
+                                }
+                                insert_coded_character<Flags>(dest, code);    // Put character in output
+                            }
+                            else
+                            {
+                                unsigned long code = 0;
+                                src += 2;   // Skip &#
+                                while (1)
+                                {
+                                    unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)];
+                                    if (digit == 0xFF)
+                                        break;
+                                    code = code * 10 + digit;
+                                    ++src;
+                                }
+                                insert_coded_character<Flags>(dest, code);    // Put character in output
+                            }
+                            if (*src == Ch(';'))
+                                ++src;
+                            else
+                                RAPIDXML_PARSE_ERROR("expected ;", src);
+                            continue;
+
+                        // Something else
+                        default:
+                            // Ignore, just copy '&' verbatim
+                            break;
+
+                        }
+                    }
+                }
+                
+                // If whitespace condensing is enabled
+                if (Flags & parse_normalize_whitespace)
+                {
+                    // Test if condensing is needed                 
+                    if (whitespace_pred::test(*src))
+                    {
+                        *dest = Ch(' '); ++dest;    // Put single space in dest
+                        ++src;                      // Skip first whitespace char
+                        // Skip remaining whitespace chars
+                        while (whitespace_pred::test(*src))
+                            ++src;
+                        continue;
+                    }
+                }
+
+                // No replacement, only copy character
+                *dest++ = *src++;
+
+            }
+
+            // Return new end
+            text = src;
+            return dest;
+
+        }
+
+        ///////////////////////////////////////////////////////////////////////
+        // Internal parsing functions
+        
+        // Parse BOM, if any
+        template<int Flags>
+        void parse_bom(Ch *&text)
+        {
+            // UTF-8?
+            if (static_cast<unsigned char>(text[0]) == 0xEF && 
+                static_cast<unsigned char>(text[1]) == 0xBB && 
+                static_cast<unsigned char>(text[2]) == 0xBF)
+            {
+                text += 3;      // Skup utf-8 bom
+            }
+        }
+
+        // Parse XML declaration (<?xml...)
+        template<int Flags>
+        xml_node<Ch> *parse_xml_declaration(Ch *&text)
+        {
+            // If parsing of declaration is disabled
+            if (!(Flags & parse_declaration_node))
+            {
+                // Skip until end of declaration
+                while (text[0] != Ch('?') || text[1] != Ch('>'))
+                {
+                    if (!text[0])
+                        RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                    ++text;
+                }
+                text += 2;    // Skip '?>'
+                return 0;
+            }
+
+            // Create declaration
+            xml_node<Ch> *declaration = this->allocate_node(node_declaration);
+
+            // Skip whitespace before attributes or ?>
+            skip<whitespace_pred, Flags>(text);
+
+            // Parse declaration attributes
+            parse_node_attributes<Flags>(text, declaration);
+            
+            // Skip ?>
+            if (text[0] != Ch('?') || text[1] != Ch('>'))
+                RAPIDXML_PARSE_ERROR("expected ?>", text);
+            text += 2;
+            
+            return declaration;
+        }
+
+        // Parse XML comment (<!--...)
+        template<int Flags>
+        xml_node<Ch> *parse_comment(Ch *&text)
+        {
+            // If parsing of comments is disabled
+            if (!(Flags & parse_comment_nodes))
+            {
+                // Skip until end of comment
+                while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>'))
+                {
+                    if (!text[0])
+                        RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                    ++text;
+                }
+                text += 3;     // Skip '-->'
+                return 0;      // Do not produce comment node
+            }
+
+            // Remember value start
+            Ch *value = text;
+
+            // Skip until end of comment
+            while (text[0] != Ch('-') || text[1] != Ch('-') || text[2] != Ch('>'))
+            {
+                if (!text[0])
+                    RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                ++text;
+            }
+
+            // Create comment node
+            xml_node<Ch> *comment = this->allocate_node(node_comment);
+            comment->value(value, text - value);
+            
+            // Place zero terminator after comment value
+            if (!(Flags & parse_no_string_terminators))
+                *text = Ch('\0');
+            
+            text += 3;     // Skip '-->'
+            return comment;
+        }
+
+        // Parse DOCTYPE
+        template<int Flags>
+        xml_node<Ch> *parse_doctype(Ch *&text)
+        {
+            // Remember value start
+            Ch *value = text;
+
+            // Skip to >
+            while (*text != Ch('>'))
+            {
+                // Determine character type
+                switch (*text)
+                {
+                
+                // If '[' encountered, scan for matching ending ']' using naive algorithm with depth
+                // This works for all W3C test files except for 2 most wicked
+                case Ch('['):
+                {
+                    ++text;     // Skip '['
+                    int depth = 1;
+                    while (depth > 0)
+                    {
+                        switch (*text)
+                        {
+                            case Ch('['): ++depth; break;
+                            case Ch(']'): --depth; break;
+                            case 0: RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                        }
+                        ++text;
+                    }
+                    break;
+                }
+                
+                // Error on end of text
+                case Ch('\0'):
+                    RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                
+                // Other character, skip it
+                default:
+                    ++text;
+
+                }
+            }
+            
+            // If DOCTYPE nodes enabled
+            if (Flags & parse_doctype_node)
+            {
+                // Create a new doctype node
+                xml_node<Ch> *doctype = this->allocate_node(node_doctype);
+                doctype->value(value, text - value);
+                
+                // Place zero terminator after value
+                if (!(Flags & parse_no_string_terminators))
+                    *text = Ch('\0');
+
+                text += 1;      // skip '>'
+                return doctype;
+            }
+            else
+            {
+                text += 1;      // skip '>'
+                return 0;
+            }
+
+        }
+
+        // Parse PI
+        template<int Flags>
+        xml_node<Ch> *parse_pi(Ch *&text)
+        {
+            // If creation of PI nodes is enabled
+            if (Flags & parse_pi_nodes)
+            {
+                // Create pi node
+                xml_node<Ch> *pi = this->allocate_node(node_pi);
+
+                // Extract PI target name
+                Ch *name = text;
+                skip<node_name_pred, Flags>(text);
+                if (text == name)
+                    RAPIDXML_PARSE_ERROR("expected PI target", text);
+                pi->name(name, text - name);
+                
+                // Skip whitespace between pi target and pi
+                skip<whitespace_pred, Flags>(text);
+
+                // Remember start of pi
+                Ch *value = text;
+                
+                // Skip to '?>'
+                while (text[0] != Ch('?') || text[1] != Ch('>'))
+                {
+                    if (*text == Ch('\0'))
+                        RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                    ++text;
+                }
+
+                // Set pi value (verbatim, no entity expansion or whitespace normalization)
+                pi->value(value, text - value);     
+                
+                // Place zero terminator after name and value
+                if (!(Flags & parse_no_string_terminators))
+                {
+                    pi->name()[pi->name_size()] = Ch('\0');
+                    pi->value()[pi->value_size()] = Ch('\0');
+                }
+                
+                text += 2;                          // Skip '?>'
+                return pi;
+            }
+            else
+            {
+                // Skip to '?>'
+                while (text[0] != Ch('?') || text[1] != Ch('>'))
+                {
+                    if (*text == Ch('\0'))
+                        RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                    ++text;
+                }
+                text += 2;    // Skip '?>'
+                return 0;
+            }
+        }
+
+        // Parse and append data
+        // Return character that ends data.
+        // This is necessary because this character might have been overwritten by a terminating 0
+        template<int Flags>
+        Ch parse_and_append_data(xml_node<Ch> *node, Ch *&text, Ch *contents_start)
+        {
+            // Backup to contents start if whitespace trimming is disabled
+            if (!(Flags & parse_trim_whitespace))
+                text = contents_start;     
+            
+            // Skip until end of data
+            Ch *value = text, *end;
+            if (Flags & parse_normalize_whitespace)
+                end = skip_and_expand_character_refs<text_pred, text_pure_with_ws_pred, Flags>(text);   
+            else
+                end = skip_and_expand_character_refs<text_pred, text_pure_no_ws_pred, Flags>(text);
+
+            // Trim trailing whitespace if flag is set; leading was already trimmed by whitespace skip after >
+            if (Flags & parse_trim_whitespace)
+            {
+                if (Flags & parse_normalize_whitespace)
+                {
+                    // Whitespace is already condensed to single space characters by skipping function, so just trim 1 char off the end
+                    if (*(end - 1) == Ch(' '))
+                        --end;
+                }
+                else
+                {
+                    // Backup until non-whitespace character is found
+                    while (whitespace_pred::test(*(end - 1)))
+                        --end;
+                }
+            }
+            
+            // If characters are still left between end and value (this test is only necessary if normalization is enabled)
+            // Create new data node
+            if (!(Flags & parse_no_data_nodes))
+            {
+                xml_node<Ch> *data = this->allocate_node(node_data);
+                data->value(value, end - value);
+                node->append_node(data);
+            }
+
+            // Add data to parent node if no data exists yet
+            if (!(Flags & parse_no_element_values)) 
+                if (*node->value() == Ch('\0'))
+                    node->value(value, end - value);
+
+            // Place zero terminator after value
+            if (!(Flags & parse_no_string_terminators))
+            {
+                Ch ch = *text;
+                *end = Ch('\0');
+                return ch;      // Return character that ends data; this is required because zero terminator overwritten it
+            }
+
+            // Return character that ends data
+            return *text;
+        }
+
+        // Parse CDATA
+        template<int Flags>
+        xml_node<Ch> *parse_cdata(Ch *&text)
+        {
+            // If CDATA is disabled
+            if (Flags & parse_no_data_nodes)
+            {
+                // Skip until end of cdata
+                while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>'))
+                {
+                    if (!text[0])
+                        RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                    ++text;
+                }
+                text += 3;      // Skip ]]>
+                return 0;       // Do not produce CDATA node
+            }
+
+            // Skip until end of cdata
+            Ch *value = text;
+            while (text[0] != Ch(']') || text[1] != Ch(']') || text[2] != Ch('>'))
+            {
+                if (!text[0])
+                    RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                ++text;
+            }
+
+            // Create new cdata node
+            xml_node<Ch> *cdata = this->allocate_node(node_cdata);
+            cdata->value(value, text - value);
+
+            // Place zero terminator after value
+            if (!(Flags & parse_no_string_terminators))
+                *text = Ch('\0');
+
+            text += 3;      // Skip ]]>
+            return cdata;
+        }
+        
+        // Parse element node
+        template<int Flags>
+        xml_node<Ch> *parse_element(Ch *&text)
+        {
+            // Create element node
+            xml_node<Ch> *element = this->allocate_node(node_element);
+
+            // Extract element name
+            Ch *name = text;
+            skip<node_name_pred, Flags>(text);
+            if (text == name)
+                RAPIDXML_PARSE_ERROR("expected element name", text);
+            element->name(name, text - name);
+            
+            // Skip whitespace between element name and attributes or >
+            skip<whitespace_pred, Flags>(text);
+
+            // Parse attributes, if any
+            parse_node_attributes<Flags>(text, element);
+
+            // Determine ending type
+            if (*text == Ch('>'))
+            {
+                ++text;
+                parse_node_contents<Flags>(text, element);
+            }
+            else if (*text == Ch('/'))
+            {
+                ++text;
+                if (*text != Ch('>'))
+                    RAPIDXML_PARSE_ERROR("expected >", text);
+                ++text;
+            }
+            else
+                RAPIDXML_PARSE_ERROR("expected >", text);
+
+            // Place zero terminator after name
+            if (!(Flags & parse_no_string_terminators))
+                element->name()[element->name_size()] = Ch('\0');
+
+            // Return parsed element
+            return element;
+        }
+
+        // Determine node type, and parse it
+        template<int Flags>
+        xml_node<Ch> *parse_node(Ch *&text)
+        {
+            // Parse proper node type
+            switch (text[0])
+            {
+
+            // <...
+            default: 
+                // Parse and append element node
+                return parse_element<Flags>(text);
+
+            // <?...
+            case Ch('?'): 
+                ++text;     // Skip ?
+                if ((text[0] == Ch('x') || text[0] == Ch('X')) &&
+                    (text[1] == Ch('m') || text[1] == Ch('M')) && 
+                    (text[2] == Ch('l') || text[2] == Ch('L')) &&
+                    whitespace_pred::test(text[3]))
+                {
+                    // '<?xml ' - xml declaration
+                    text += 4;      // Skip 'xml '
+                    return parse_xml_declaration<Flags>(text);
+                }
+                else
+                {
+                    // Parse PI
+                    return parse_pi<Flags>(text);
+                }
+            
+            // <!...
+            case Ch('!'): 
+
+                // Parse proper subset of <! node
+                switch (text[1])    
+                {
+                
+                // <!-
+                case Ch('-'):
+                    if (text[2] == Ch('-'))
+                    {
+                        // '<!--' - xml comment
+                        text += 3;     // Skip '!--'
+                        return parse_comment<Flags>(text);
+                    }
+                    break;
+
+                // <![
+                case Ch('['):
+                    if (text[2] == Ch('C') && text[3] == Ch('D') && text[4] == Ch('A') && 
+                        text[5] == Ch('T') && text[6] == Ch('A') && text[7] == Ch('['))
+                    {
+                        // '<![CDATA[' - cdata
+                        text += 8;     // Skip '![CDATA['
+                        return parse_cdata<Flags>(text);
+                    }
+                    break;
+
+                // <!D
+                case Ch('D'):
+                    if (text[2] == Ch('O') && text[3] == Ch('C') && text[4] == Ch('T') && 
+                        text[5] == Ch('Y') && text[6] == Ch('P') && text[7] == Ch('E') && 
+                        whitespace_pred::test(text[8]))
+                    {
+                        // '<!DOCTYPE ' - doctype
+                        text += 9;      // skip '!DOCTYPE '
+                        return parse_doctype<Flags>(text);
+                    }
+
+                }   // switch
+
+                // Attempt to skip other, unrecognized node types starting with <!
+                ++text;     // Skip !
+                while (*text != Ch('>'))
+                {
+                    if (*text == 0)
+                        RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+                    ++text;
+                }
+                ++text;     // Skip '>'
+                return 0;   // No node recognized
+
+            }
+        }
+
+        // Parse contents of the node - children, data etc.
+        template<int Flags>
+        void parse_node_contents(Ch *&text, xml_node<Ch> *node)
+        {
+            // For all children and text
+            while (1)
+            {
+                // Skip whitespace between > and node contents
+                Ch *contents_start = text;      // Store start of node contents before whitespace is skipped
+                skip<whitespace_pred, Flags>(text);
+                Ch next_char = *text;
+
+            // After data nodes, instead of continuing the loop, control jumps here.
+            // This is because zero termination inside parse_and_append_data() function
+            // would wreak havoc with the above code.
+            // Also, skipping whitespace after data nodes is unnecessary.
+            after_data_node:    
+                
+                // Determine what comes next: node closing, child node, data node, or 0?
+                switch (next_char)
+                {
+                
+                // Node closing or child node
+                case Ch('<'):
+                    if (text[1] == Ch('/'))
+                    {
+                        // Node closing
+                        text += 2;      // Skip '</'
+                        if (Flags & parse_validate_closing_tags)
+                        {
+                            // Skip and validate closing tag name
+                            Ch *closing_name = text;
+                            skip<node_name_pred, Flags>(text);
+                            if (!internal::compare(node->name(), node->name_size(), closing_name, text - closing_name, true))
+                                RAPIDXML_PARSE_ERROR("invalid closing tag name", text);
+                        }
+                        else
+                        {
+                            // No validation, just skip name
+                            skip<node_name_pred, Flags>(text);
+                        }
+                        // Skip remaining whitespace after node name
+                        skip<whitespace_pred, Flags>(text);
+                        if (*text != Ch('>'))
+                            RAPIDXML_PARSE_ERROR("expected >", text);
+                        ++text;     // Skip '>'
+                        return;     // Node closed, finished parsing contents
+                    }
+                    else
+                    {
+                        // Child node
+                        ++text;     // Skip '<'
+                        if (xml_node<Ch> *child = parse_node<Flags>(text))
+                            node->append_node(child);
+                    }
+                    break;
+
+                // End of data - error
+                case Ch('\0'):
+                    RAPIDXML_PARSE_ERROR("unexpected end of data", text);
+
+                // Data node
+                default:
+                    next_char = parse_and_append_data<Flags>(node, text, contents_start);
+                    goto after_data_node;   // Bypass regular processing after data nodes
+
+                }
+            }
+        }
+        
+        // Parse XML attributes of the node
+        template<int Flags>
+        void parse_node_attributes(Ch *&text, xml_node<Ch> *node)
+        {
+            // For all attributes 
+            while (attribute_name_pred::test(*text))
+            {
+                // Extract attribute name
+                Ch *name = text;
+                ++text;     // Skip first character of attribute name
+                skip<attribute_name_pred, Flags>(text);
+                if (text == name)
+                    RAPIDXML_PARSE_ERROR("expected attribute name", name);
+
+                // Create new attribute
+                xml_attribute<Ch> *attribute = this->allocate_attribute();
+                attribute->name(name, text - name);
+                node->append_attribute(attribute);
+
+                // Skip whitespace after attribute name
+                skip<whitespace_pred, Flags>(text);
+
+                // Skip =
+                if (*text != Ch('='))
+                    RAPIDXML_PARSE_ERROR("expected =", text);
+                ++text;
+
+                // Add terminating zero after name
+                if (!(Flags & parse_no_string_terminators))
+                    attribute->name()[attribute->name_size()] = 0;
+
+                // Skip whitespace after =
+                skip<whitespace_pred, Flags>(text);
+
+                // Skip quote and remember if it was ' or "
+                Ch quote = *text;
+                if (quote != Ch('\'') && quote != Ch('"'))
+                    RAPIDXML_PARSE_ERROR("expected ' or \"", text);
+                ++text;
+
+                // Extract attribute value and expand char refs in it
+                Ch *value = text, *end;
+                const int AttFlags = Flags & ~parse_normalize_whitespace;   // No whitespace normalization in attributes
+                if (quote == Ch('\''))
+                    end = skip_and_expand_character_refs<attribute_value_pred<Ch('\'')>, attribute_value_pure_pred<Ch('\'')>, AttFlags>(text);
+                else
+                    end = skip_and_expand_character_refs<attribute_value_pred<Ch('"')>, attribute_value_pure_pred<Ch('"')>, AttFlags>(text);
+                
+                // Set attribute value
+                attribute->value(value, end - value);
+                
+                // Make sure that end quote is present
+                if (*text != quote)
+                    RAPIDXML_PARSE_ERROR("expected ' or \"", text);
+                ++text;     // Skip quote
+
+                // Add terminating zero after value
+                if (!(Flags & parse_no_string_terminators))
+                    attribute->value()[attribute->value_size()] = 0;
+
+                // Skip whitespace after attribute value
+                skip<whitespace_pred, Flags>(text);
+            }
+        }
+
+    };
+
+    //! \cond internal
+    namespace internal
+    {
+
+        // Whitespace (space \n \r \t)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_whitespace[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  1,  1,  0,  0,  1,  0,  0,  // 0
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // 1
+             1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // 2
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // 3
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // 4
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // 5
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // 6
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // 7
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // 8
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // 9
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // A
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // B
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // C
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // D
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  // E
+             0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0   // F
+        };
+
+        // Node name (anything but space \n \r \t / > ? \0)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_node_name[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  1,  1,  0,  1,  1,  // 0
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 1
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  // 2
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  // 3
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 4
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 5
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 6
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 7
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 8
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 9
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // A
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // B
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // C
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // D
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // E
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1   // F
+        };
+
+        // Text (i.e. PCDATA) (anything but < \0)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_text[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 0
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 1
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 2
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  1,  1,  1,  // 3
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 4
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 5
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 6
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 7
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 8
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 9
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // A
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // B
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // C
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // D
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // E
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1   // F
+        };
+
+        // Text (i.e. PCDATA) that does not require processing when ws normalization is disabled 
+        // (anything but < \0 &)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_text_pure_no_ws[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 0
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 1
+             1,  1,  1,  1,  1,  1,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 2
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  1,  1,  1,  // 3
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 4
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 5
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 6
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 7
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 8
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 9
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // A
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // B
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // C
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // D
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // E
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1   // F
+        };
+
+        // Text (i.e. PCDATA) that does not require processing when ws normalizationis is enabled
+        // (anything but < \0 & space \n \r \t)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_text_pure_with_ws[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  1,  1,  0,  1,  1,  // 0
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 1
+             0,  1,  1,  1,  1,  1,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 2
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  1,  1,  1,  // 3
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 4
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 5
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 6
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 7
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 8
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 9
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // A
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // B
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // C
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // D
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // E
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1   // F
+        };
+
+        // Attribute name (anything but space \n \r \t / < > = ? ! \0)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_attribute_name[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  1,  1,  0,  1,  1,  // 0
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 1
+             0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  // 2
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  0,  0,  0,  0,  // 3
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 4
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 5
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 6
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 7
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 8
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 9
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // A
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // B
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // C
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // D
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // E
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1   // F
+        };
+
+        // Attribute data with single quote (anything but ' \0)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_attribute_data_1[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 0
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 1
+             1,  1,  1,  1,  1,  1,  1,  0,  1,  1,  1,  1,  1,  1,  1,  1,  // 2
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 3
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 4
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 5
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 6
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 7
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 8
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 9
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // A
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // B
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // C
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // D
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // E
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1   // F
+        };
+
+        // Attribute data with single quote that does not require processing (anything but ' \0 &)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_attribute_data_1_pure[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 0
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 1
+             1,  1,  1,  1,  1,  1,  0,  0,  1,  1,  1,  1,  1,  1,  1,  1,  // 2
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 3
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 4
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 5
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 6
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 7
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 8
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 9
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // A
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // B
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // C
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // D
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // E
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1   // F
+        };
+
+        // Attribute data with double quote (anything but " \0)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_attribute_data_2[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 0
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 1
+             1,  1,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 2
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 3
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 4
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 5
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 6
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 7
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 8
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 9
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // A
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // B
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // C
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // D
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // E
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1   // F
+        };
+
+        // Attribute data with double quote that does not require processing (anything but " \0 &)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_attribute_data_2_pure[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+             0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 0
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 1
+             1,  1,  0,  1,  1,  1,  0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 2
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 3
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 4
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 5
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 6
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 7
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 8
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // 9
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // A
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // B
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // C
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // D
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  // E
+             1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1   // F
+        };
+
+        // Digits (dec and hex, 255 denotes end of numeric character reference)
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_digits[256] = 
+        {
+          // 0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // 0
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // 1
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // 2
+             0,  1,  2,  3,  4,  5,  6,  7,  8,  9,255,255,255,255,255,255,  // 3
+           255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255,  // 4
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // 5
+           255, 10, 11, 12, 13, 14, 15,255,255,255,255,255,255,255,255,255,  // 6
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // 7
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // 8
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // 9
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // A
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // B
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // C
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // D
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,  // E
+           255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255   // F
+        };
+    
+        // Upper case conversion
+        template<int Dummy>
+        const unsigned char lookup_tables<Dummy>::lookup_upcase[256] = 
+        {
+          // 0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  A   B   C   D   E   F
+           0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,   // 0
+           16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,   // 1
+           32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,   // 2
+           48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,   // 3
+           64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,   // 4
+           80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,   // 5
+           96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,   // 6
+           80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 123,124,125,126,127,  // 7
+           128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,  // 8
+           144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,  // 9
+           160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,  // A
+           176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,  // B
+           192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,  // C
+           208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,  // D
+           224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,  // E
+           240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255   // F
+        };
+    }
+    //! \endcond
+
+}
+
+// Undefine internal macros
+#undef RAPIDXML_PARSE_ERROR
+
+// On MSVC, restore warnings state
+#ifdef _MSC_VER
+    #pragma warning(pop)
+#endif
+
+#endif
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml_iterators.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml_iterators.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml_iterators.hpp	(revision 152)
@@ -0,0 +1,174 @@
+#ifndef RAPIDXML_ITERATORS_HPP_INCLUDED
+#define RAPIDXML_ITERATORS_HPP_INCLUDED
+
+// Copyright (C) 2006, 2009 Marcin Kalicinski
+// Version 1.13
+// Revision $DateTime: 2009/05/13 01:46:17 $
+//! \file rapidxml_iterators.hpp This file contains rapidxml iterators
+
+#include "rapidxml.hpp"
+
+namespace rapidxml
+{
+
+    //! Iterator of child nodes of xml_node
+    template<class Ch>
+    class node_iterator
+    {
+    
+    public:
+
+        typedef typename xml_node<Ch> value_type;
+        typedef typename xml_node<Ch> &reference;
+        typedef typename xml_node<Ch> *pointer;
+        typedef std::ptrdiff_t difference_type;
+        typedef std::bidirectional_iterator_tag iterator_category;
+        
+        node_iterator()
+            : m_node(0)
+        {
+        }
+
+        node_iterator(xml_node<Ch> *node)
+            : m_node(node->first_node())
+        {
+        }
+        
+        reference operator *() const
+        {
+            assert(m_node);
+            return *m_node;
+        }
+
+        pointer operator->() const
+        {
+            assert(m_node);
+            return m_node;
+        }
+
+        node_iterator& operator++()
+        {
+            assert(m_node);
+            m_node = m_node->next_sibling();
+            return *this;
+        }
+
+        node_iterator operator++(int)
+        {
+            node_iterator tmp = *this;
+            ++this;
+            return tmp;
+        }
+
+        node_iterator& operator--()
+        {
+            assert(m_node && m_node->previous_sibling());
+            m_node = m_node->previous_sibling();
+            return *this;
+        }
+
+        node_iterator operator--(int)
+        {
+            node_iterator tmp = *this;
+            ++this;
+            return tmp;
+        }
+
+        bool operator ==(const node_iterator<Ch> &rhs)
+        {
+            return m_node == rhs.m_node;
+        }
+
+        bool operator !=(const node_iterator<Ch> &rhs)
+        {
+            return m_node != rhs.m_node;
+        }
+
+    private:
+
+        xml_node<Ch> *m_node;
+
+    };
+
+    //! Iterator of child attributes of xml_node
+    template<class Ch>
+    class attribute_iterator
+    {
+    
+    public:
+
+        typedef typename xml_attribute<Ch> value_type;
+        typedef typename xml_attribute<Ch> &reference;
+        typedef typename xml_attribute<Ch> *pointer;
+        typedef std::ptrdiff_t difference_type;
+        typedef std::bidirectional_iterator_tag iterator_category;
+        
+        attribute_iterator()
+            : m_attribute(0)
+        {
+        }
+
+        attribute_iterator(xml_node<Ch> *node)
+            : m_attribute(node->first_attribute())
+        {
+        }
+        
+        reference operator *() const
+        {
+            assert(m_attribute);
+            return *m_attribute;
+        }
+
+        pointer operator->() const
+        {
+            assert(m_attribute);
+            return m_attribute;
+        }
+
+        attribute_iterator& operator++()
+        {
+            assert(m_attribute);
+            m_attribute = m_attribute->next_attribute();
+            return *this;
+        }
+
+        attribute_iterator operator++(int)
+        {
+            attribute_iterator tmp = *this;
+            ++this;
+            return tmp;
+        }
+
+        attribute_iterator& operator--()
+        {
+            assert(m_attribute && m_attribute->previous_attribute());
+            m_attribute = m_attribute->previous_attribute();
+            return *this;
+        }
+
+        attribute_iterator operator--(int)
+        {
+            attribute_iterator tmp = *this;
+            ++this;
+            return tmp;
+        }
+
+        bool operator ==(const attribute_iterator<Ch> &rhs)
+        {
+            return m_attribute == rhs.m_attribute;
+        }
+
+        bool operator !=(const attribute_iterator<Ch> &rhs)
+        {
+            return m_attribute != rhs.m_attribute;
+        }
+
+    private:
+
+        xml_attribute<Ch> *m_attribute;
+
+    };
+
+}
+
+#endif
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml_print.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml_print.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml_print.hpp	(revision 152)
@@ -0,0 +1,421 @@
+#ifndef RAPIDXML_PRINT_HPP_INCLUDED
+#define RAPIDXML_PRINT_HPP_INCLUDED
+
+// Copyright (C) 2006, 2009 Marcin Kalicinski
+// Version 1.13
+// Revision $DateTime: 2009/05/13 01:46:17 $
+//! \file rapidxml_print.hpp This file contains rapidxml printer implementation
+
+#include "rapidxml.hpp"
+
+// Only include streams if not disabled
+#ifndef RAPIDXML_NO_STREAMS
+    #include <ostream>
+    #include <iterator>
+#endif
+
+namespace rapidxml
+{
+
+    ///////////////////////////////////////////////////////////////////////
+    // Printing flags
+
+    const int print_no_indenting = 0x1;   //!< Printer flag instructing the printer to suppress indenting of XML. See print() function.
+
+    ///////////////////////////////////////////////////////////////////////
+    // Internal
+
+    //! \cond internal
+    namespace internal
+    {
+        
+        ///////////////////////////////////////////////////////////////////////////
+        // Internal character operations
+    
+        // Copy characters from given range to given output iterator
+        template<class OutIt, class Ch>
+        inline OutIt copy_chars(const Ch *begin, const Ch *end, OutIt out)
+        {
+            while (begin != end)
+                *out++ = *begin++;
+            return out;
+        }
+        
+        // Copy characters from given range to given output iterator and expand
+        // characters into references (&lt; &gt; &apos; &quot; &amp;)
+        template<class OutIt, class Ch>
+        inline OutIt copy_and_expand_chars(const Ch *begin, const Ch *end, Ch noexpand, OutIt out)
+        {
+            while (begin != end)
+            {
+                if (*begin == noexpand)
+                {
+                    *out++ = *begin;    // No expansion, copy character
+                }
+                else
+                {
+                    switch (*begin)
+                    {
+                    case Ch('<'):
+                        *out++ = Ch('&'); *out++ = Ch('l'); *out++ = Ch('t'); *out++ = Ch(';');
+                        break;
+                    case Ch('>'): 
+                        *out++ = Ch('&'); *out++ = Ch('g'); *out++ = Ch('t'); *out++ = Ch(';');
+                        break;
+                    case Ch('\''): 
+                        *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('p'); *out++ = Ch('o'); *out++ = Ch('s'); *out++ = Ch(';');
+                        break;
+                    case Ch('"'): 
+                        *out++ = Ch('&'); *out++ = Ch('q'); *out++ = Ch('u'); *out++ = Ch('o'); *out++ = Ch('t'); *out++ = Ch(';');
+                        break;
+                    case Ch('&'): 
+                        *out++ = Ch('&'); *out++ = Ch('a'); *out++ = Ch('m'); *out++ = Ch('p'); *out++ = Ch(';'); 
+                        break;
+                    default:
+                        *out++ = *begin;    // No expansion, copy character
+                    }
+                }
+                ++begin;    // Step to next character
+            }
+            return out;
+        }
+
+        // Fill given output iterator with repetitions of the same character
+        template<class OutIt, class Ch>
+        inline OutIt fill_chars(OutIt out, int n, Ch ch)
+        {
+            for (int i = 0; i < n; ++i)
+                *out++ = ch;
+            return out;
+        }
+
+        // Find character
+        template<class Ch, Ch ch>
+        inline bool find_char(const Ch *begin, const Ch *end)
+        {
+            while (begin != end)
+                if (*begin++ == ch)
+                    return true;
+            return false;
+        }
+
+        ///////////////////////////////////////////////////////////////////////////
+        // Internal printing operations
+    
+        // Print node
+        template<class OutIt, class Ch>
+        inline OutIt print_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+        {
+            // Print proper node type
+            switch (node->type())
+            {
+
+            // Document
+            case node_document:
+                out = print_children(out, node, flags, indent);
+                break;
+
+            // Element
+            case node_element:
+                out = print_element_node(out, node, flags, indent);
+                break;
+            
+            // Data
+            case node_data:
+                out = print_data_node(out, node, flags, indent);
+                break;
+            
+            // CDATA
+            case node_cdata:
+                out = print_cdata_node(out, node, flags, indent);
+                break;
+
+            // Declaration
+            case node_declaration:
+                out = print_declaration_node(out, node, flags, indent);
+                break;
+
+            // Comment
+            case node_comment:
+                out = print_comment_node(out, node, flags, indent);
+                break;
+            
+            // Doctype
+            case node_doctype:
+                out = print_doctype_node(out, node, flags, indent);
+                break;
+
+            // Pi
+            case node_pi:
+                out = print_pi_node(out, node, flags, indent);
+                break;
+
+                // Unknown
+            default:
+                assert(0);
+                break;
+            }
+            
+            // If indenting not disabled, add line break after node
+            if (!(flags & print_no_indenting))
+                *out = Ch('\n'), ++out;
+
+            // Return modified iterator
+            return out;
+        }
+        
+        // Print children of the node                               
+        template<class OutIt, class Ch>
+        inline OutIt print_children(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+        {
+            for (xml_node<Ch> *child = node->first_node(); child; child = child->next_sibling())
+                out = print_node(out, child, flags, indent);
+            return out;
+        }
+
+        // Print attributes of the node
+        template<class OutIt, class Ch>
+        inline OutIt print_attributes(OutIt out, const xml_node<Ch> *node, int flags)
+        {
+            for (xml_attribute<Ch> *attribute = node->first_attribute(); attribute; attribute = attribute->next_attribute())
+            {
+                if (attribute->name() && attribute->value())
+                {
+                    // Print attribute name
+                    *out = Ch(' '), ++out;
+                    out = copy_chars(attribute->name(), attribute->name() + attribute->name_size(), out);
+                    *out = Ch('='), ++out;
+                    // Print attribute value using appropriate quote type
+                    if (find_char<Ch, Ch('"')>(attribute->value(), attribute->value() + attribute->value_size()))
+                    {
+                        *out = Ch('\''), ++out;
+                        out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('"'), out);
+                        *out = Ch('\''), ++out;
+                    }
+                    else
+                    {
+                        *out = Ch('"'), ++out;
+                        out = copy_and_expand_chars(attribute->value(), attribute->value() + attribute->value_size(), Ch('\''), out);
+                        *out = Ch('"'), ++out;
+                    }
+                }
+            }
+            return out;
+        }
+
+        // Print data node
+        template<class OutIt, class Ch>
+        inline OutIt print_data_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+        {
+            assert(node->type() == node_data);
+            if (!(flags & print_no_indenting))
+                out = fill_chars(out, indent, Ch('\t'));
+            out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out);
+            return out;
+        }
+
+        // Print data node
+        template<class OutIt, class Ch>
+        inline OutIt print_cdata_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+        {
+            assert(node->type() == node_cdata);
+            if (!(flags & print_no_indenting))
+                out = fill_chars(out, indent, Ch('\t'));
+            *out = Ch('<'); ++out;
+            *out = Ch('!'); ++out;
+            *out = Ch('['); ++out;
+            *out = Ch('C'); ++out;
+            *out = Ch('D'); ++out;
+            *out = Ch('A'); ++out;
+            *out = Ch('T'); ++out;
+            *out = Ch('A'); ++out;
+            *out = Ch('['); ++out;
+            out = copy_chars(node->value(), node->value() + node->value_size(), out);
+            *out = Ch(']'); ++out;
+            *out = Ch(']'); ++out;
+            *out = Ch('>'); ++out;
+            return out;
+        }
+
+        // Print element node
+        template<class OutIt, class Ch>
+        inline OutIt print_element_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+        {
+            assert(node->type() == node_element);
+
+            // Print element name and attributes, if any
+            if (!(flags & print_no_indenting))
+                out = fill_chars(out, indent, Ch('\t'));
+            *out = Ch('<'), ++out;
+            out = copy_chars(node->name(), node->name() + node->name_size(), out);
+            out = print_attributes(out, node, flags);
+            
+            // If node is childless
+            if (node->value_size() == 0 && !node->first_node())
+            {
+                // Print childless node tag ending
+                *out = Ch('/'), ++out;
+                *out = Ch('>'), ++out;
+            }
+            else
+            {
+                // Print normal node tag ending
+                *out = Ch('>'), ++out;
+
+                // Test if node contains a single data node only (and no other nodes)
+                xml_node<Ch> *child = node->first_node();
+                if (!child)
+                {
+                    // If node has no children, only print its value without indenting
+                    out = copy_and_expand_chars(node->value(), node->value() + node->value_size(), Ch(0), out);
+                }
+                else if (child->next_sibling() == 0 && child->type() == node_data)
+                {
+                    // If node has a sole data child, only print its value without indenting
+                    out = copy_and_expand_chars(child->value(), child->value() + child->value_size(), Ch(0), out);
+                }
+                else
+                {
+                    // Print all children with full indenting
+                    if (!(flags & print_no_indenting))
+                        *out = Ch('\n'), ++out;
+                    out = print_children(out, node, flags, indent + 1);
+                    if (!(flags & print_no_indenting))
+                        out = fill_chars(out, indent, Ch('\t'));
+                }
+
+                // Print node end
+                *out = Ch('<'), ++out;
+                *out = Ch('/'), ++out;
+                out = copy_chars(node->name(), node->name() + node->name_size(), out);
+                *out = Ch('>'), ++out;
+            }
+            return out;
+        }
+
+        // Print declaration node
+        template<class OutIt, class Ch>
+        inline OutIt print_declaration_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+        {
+            // Print declaration start
+            if (!(flags & print_no_indenting))
+                out = fill_chars(out, indent, Ch('\t'));
+            *out = Ch('<'), ++out;
+            *out = Ch('?'), ++out;
+            *out = Ch('x'), ++out;
+            *out = Ch('m'), ++out;
+            *out = Ch('l'), ++out;
+
+            // Print attributes
+            out = print_attributes(out, node, flags);
+            
+            // Print declaration end
+            *out = Ch('?'), ++out;
+            *out = Ch('>'), ++out;
+            
+            return out;
+        }
+
+        // Print comment node
+        template<class OutIt, class Ch>
+        inline OutIt print_comment_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+        {
+            assert(node->type() == node_comment);
+            if (!(flags & print_no_indenting))
+                out = fill_chars(out, indent, Ch('\t'));
+            *out = Ch('<'), ++out;
+            *out = Ch('!'), ++out;
+            *out = Ch('-'), ++out;
+            *out = Ch('-'), ++out;
+            out = copy_chars(node->value(), node->value() + node->value_size(), out);
+            *out = Ch('-'), ++out;
+            *out = Ch('-'), ++out;
+            *out = Ch('>'), ++out;
+            return out;
+        }
+
+        // Print doctype node
+        template<class OutIt, class Ch>
+        inline OutIt print_doctype_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+        {
+            assert(node->type() == node_doctype);
+            if (!(flags & print_no_indenting))
+                out = fill_chars(out, indent, Ch('\t'));
+            *out = Ch('<'), ++out;
+            *out = Ch('!'), ++out;
+            *out = Ch('D'), ++out;
+            *out = Ch('O'), ++out;
+            *out = Ch('C'), ++out;
+            *out = Ch('T'), ++out;
+            *out = Ch('Y'), ++out;
+            *out = Ch('P'), ++out;
+            *out = Ch('E'), ++out;
+            *out = Ch(' '), ++out;
+            out = copy_chars(node->value(), node->value() + node->value_size(), out);
+            *out = Ch('>'), ++out;
+            return out;
+        }
+
+        // Print pi node
+        template<class OutIt, class Ch>
+        inline OutIt print_pi_node(OutIt out, const xml_node<Ch> *node, int flags, int indent)
+        {
+            assert(node->type() == node_pi);
+            if (!(flags & print_no_indenting))
+                out = fill_chars(out, indent, Ch('\t'));
+            *out = Ch('<'), ++out;
+            *out = Ch('?'), ++out;
+            out = copy_chars(node->name(), node->name() + node->name_size(), out);
+            *out = Ch(' '), ++out;
+            out = copy_chars(node->value(), node->value() + node->value_size(), out);
+            *out = Ch('?'), ++out;
+            *out = Ch('>'), ++out;
+            return out;
+        }
+
+    }
+    //! \endcond
+
+    ///////////////////////////////////////////////////////////////////////////
+    // Printing
+
+    //! Prints XML to given output iterator.
+    //! \param out Output iterator to print to.
+    //! \param node Node to be printed. Pass xml_document to print entire document.
+    //! \param flags Flags controlling how XML is printed.
+    //! \return Output iterator pointing to position immediately after last character of printed text.
+    template<class OutIt, class Ch> 
+    inline OutIt print(OutIt out, const xml_node<Ch> &node, int flags = 0)
+    {
+        return internal::print_node(out, &node, flags, 0);
+    }
+
+#ifndef RAPIDXML_NO_STREAMS
+
+    //! Prints XML to given output stream.
+    //! \param out Output stream to print to.
+    //! \param node Node to be printed. Pass xml_document to print entire document.
+    //! \param flags Flags controlling how XML is printed.
+    //! \return Output stream.
+    template<class Ch> 
+    inline std::basic_ostream<Ch> &print(std::basic_ostream<Ch> &out, const xml_node<Ch> &node, int flags = 0)
+    {
+        print(std::ostream_iterator<Ch>(out), node, flags);
+        return out;
+    }
+
+    //! Prints formatted XML to given output stream. Uses default printing flags. Use print() function to customize printing process.
+    //! \param out Output stream to print to.
+    //! \param node Node to be printed.
+    //! \return Output stream.
+    template<class Ch> 
+    inline std::basic_ostream<Ch> &operator <<(std::basic_ostream<Ch> &out, const xml_node<Ch> &node)
+    {
+        return print(out, node);
+    }
+
+#endif
+
+}
+
+#endif
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml_utils.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml_utils.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xml/rapidxml_utils.hpp	(revision 152)
@@ -0,0 +1,122 @@
+#ifndef RAPIDXML_UTILS_HPP_INCLUDED
+#define RAPIDXML_UTILS_HPP_INCLUDED
+
+// Copyright (C) 2006, 2009 Marcin Kalicinski
+// Version 1.13
+// Revision $DateTime: 2009/05/13 01:46:17 $
+//! \file rapidxml_utils.hpp This file contains high-level rapidxml utilities that can be useful
+//! in certain simple scenarios. They should probably not be used if maximizing performance is the main objective.
+
+#include "rapidxml.hpp"
+#include <vector>
+#include <string>
+#include <fstream>
+#include <stdexcept>
+
+namespace rapidxml
+{
+
+    //! Represents data loaded from a file
+    template<class Ch = char>
+    class file
+    {
+        
+    public:
+        
+        //! Loads file into the memory. Data will be automatically destroyed by the destructor.
+        //! \param filename Filename to load.
+        file(const char *filename)
+        {
+            using namespace std;
+
+            // Open stream
+            basic_ifstream<Ch> stream(filename, ios::binary);
+            if (!stream)
+                throw runtime_error(string("cannot open file ") + filename);
+            stream.unsetf(ios::skipws);
+            
+            // Determine stream size
+            stream.seekg(0, ios::end);
+            size_t size = stream.tellg();
+            stream.seekg(0);   
+            
+            // Load data and add terminating 0
+            m_data.resize(size + 1);
+            stream.read(&m_data.front(), static_cast<streamsize>(size));
+            m_data[size] = 0;
+        }
+
+        //! Loads file into the memory. Data will be automatically destroyed by the destructor
+        //! \param stream Stream to load from
+        file(std::basic_istream<Ch> &stream)
+        {
+            using namespace std;
+
+            // Load data and add terminating 0
+            stream.unsetf(ios::skipws);
+            m_data.assign(istreambuf_iterator<Ch>(stream), istreambuf_iterator<Ch>());
+            if (stream.fail() || stream.bad())
+                throw runtime_error("error reading stream");
+            m_data.push_back(0);
+        }
+        
+        //! Gets file data.
+        //! \return Pointer to data of file.
+        Ch *data()
+        {
+            return &m_data.front();
+        }
+
+        //! Gets file data.
+        //! \return Pointer to data of file.
+        const Ch *data() const
+        {
+            return &m_data.front();
+        }
+
+        //! Gets file data size.
+        //! \return Size of file data, in characters.
+        std::size_t size() const
+        {
+            return m_data.size();
+        }
+
+    private:
+
+        std::vector<Ch> m_data;   // File data
+
+    };
+
+    //! Counts children of node. Time complexity is O(n).
+    //! \return Number of children of node
+    template<class Ch>
+    inline std::size_t count_children(xml_node<Ch> *node)
+    {
+        xml_node<Ch> *child = node->first_node();
+        std::size_t count = 0;
+        while (child)
+        {
+            ++count;
+            child = child->next_sibling();
+        }
+        return count;
+    }
+
+    //! Counts attributes of node. Time complexity is O(n).
+    //! \return Number of attributes of node
+    template<class Ch>
+    inline std::size_t count_attributes(xml_node<Ch> *node)
+    {
+        xml_attribute<Ch> *attr = node->first_attribute();
+        std::size_t count = 0;
+        while (attr)
+        {
+            ++count;
+            attr = attr->next_attribute();
+        }
+        return count;
+    }
+
+}
+
+#endif
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xml_node.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xml_node.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xml_node.cpp	(revision 152)
@@ -0,0 +1,74 @@
+#include "xml_node.hpp"
+
+namespace xmlioserver
+{
+   namespace xml
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      StdString CXMLNode::RootName("simulation");
+
+      CXMLNode::CXMLNode(rapidxml::xml_node<char> * const root)
+         : node(root)
+      { /* Ne rien faire de plus */ }
+
+      CXMLNode::~CXMLNode(void)
+      { /* Ne rien faire de plus */ }
+
+      StdString CXMLNode::getElementName(void) const
+      { return (this->node->name()); }
+
+      bool CXMLNode::goToNextElement(void)
+      {
+         bool retvalue = false;
+         for(rapidxml::xml_node<char> * nextElement = this->node->next_sibling();
+                                      ; nextElement = this->node->next_sibling())
+            if (nextElement == NULL) break;
+            else if (nextElement->type() == rapidxml::node_element)
+            { node = nextElement; return (!retvalue); }
+         return (retvalue);
+      }
+
+      bool CXMLNode::goToChildElement(void)
+      {
+         bool retvalue = false;
+         rapidxml::xml_node<char> * nextElement = this->node->first_node();
+         if (nextElement != NULL)
+         {
+            for(;;nextElement = this->node->next_sibling())
+               if (nextElement == NULL) break;
+               else if (nextElement->type() == rapidxml::node_element)
+               { node = nextElement; return (!retvalue); }
+         }
+         return (retvalue);
+      }
+
+      bool CXMLNode::goToParentElement(void)
+      {
+         bool retvalue = false;
+         if (!(this->getElementName().compare(CXMLNode::RootName)))
+            return (retvalue);
+         node = node->parent();
+         return (!retvalue);
+      }
+
+      const StdString & CXMLNode::GetRootName(void)
+      { return (CXMLNode::RootName); }
+
+      THashAttributes CXMLNode::getAttributes(void) const
+      {
+         THashAttributes attributes;
+         rapidxml::xml_attribute<char> *currentAttr = NULL;
+
+         if ((currentAttr = this->node->first_attribute()) != NULL)
+            do {
+               attributes.insert(std::pair<StdString, StdString>
+                                (StdString(currentAttr->name()),
+                                 StdString(currentAttr->value())));
+            } while ((currentAttr = currentAttr->next_attribute()) != NULL);
+
+         return (attributes) ;
+      }
+
+   }// namespace xml
+} // namespace xmlioserve
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xml_node.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xml_node.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xml_node.hpp	(revision 152)
@@ -0,0 +1,55 @@
+#ifndef __XMLIO_CXMLNode__
+#define __XMLIO_CXMLNode__
+
+/// rapidXML headers ///
+#include <xml/rapidxml.hpp>
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+
+namespace xmlioserver
+{
+   namespace xml
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      typedef xios_map<StdString, StdString> THashAttributes;
+
+      class CXMLNode
+      {
+         public :
+
+            /// Constructeurs ///
+            CXMLNode(rapidxml::xml_node<char> * const root);
+
+            /// Destructeur ///
+            ~CXMLNode(void);
+
+            /// Accesseurs ///
+            StdString getElementName(void) const;
+            THashAttributes getAttributes(void) const;
+
+            /// Mutateurs ///
+            bool goToNextElement(void);
+            bool goToChildElement(void);
+            bool goToParentElement(void);
+
+            /// Accesseurs statiques ///
+            static const StdString & GetRootName(void);
+
+         private :
+
+            /// Constructeurs ///
+            CXMLNode(void);                        // Not implemented yet.
+            CXMLNode(const CXMLNode & node);       // Not implemented yet.
+            CXMLNode(const CXMLNode * const node); // Not implemented yet.
+
+            rapidxml::xml_node<char> * node;
+
+            static StdString RootName;
+
+      }; //class CXMLParser
+
+   }// namespace xml
+} // namespace xmlioserver
+
+#endif // __XMLIO_CXMLNode__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xml_parser.cpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xml_parser.cpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xml_parser.cpp	(revision 152)
@@ -0,0 +1,82 @@
+#include "xml_parser.hpp"
+
+#include "attribute_template_impl.hpp"
+#include "object_template_impl.hpp"
+#include "group_template_impl.hpp"
+
+namespace xmlioserver
+{
+   namespace xml
+   {
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+
+      void CXMLParser::ParseFile(const StdString & filename)
+      { StdIFStream ifs ( filename.c_str() , StdIFStream::in );
+        CXMLParser::ParseStream(ifs); }
+
+      void CXMLParser::ParseString(const StdString & xmlContent)
+      {
+         StdIStringStream iss ( xmlContent /*, StdIStringStream::in*/ );
+         CXMLParser::ParseStream(iss);
+      }
+
+      void CXMLParser::ParseStream(StdIStream & stream)
+      {
+         if (!stream.good())
+            ERROR("CXMLParser::ParseStream(const StdIStream & stream)",
+                  << "Bad xml stream !");
+         StdOStringStream oss;
+         while(!stream.eof() && !stream.fail ())
+            oss.put(stream.get());
+         try
+         {
+            //const StdString xmlcontent( oss.str(), 0, oss.str().size()-2); //<POURQUOI ?
+            const StdString xmlcontent( oss.str(), 0, oss.str().size()-1 );
+            rapidxml::xml_document<char> doc;
+            doc.parse<0>(const_cast<char*>(xmlcontent.c_str()));
+
+            CXMLNode node(doc.first_node());
+            THashAttributes attributes;
+
+            if (node.getElementName().compare(CXMLNode::GetRootName()) != 0)
+               ERROR("CXMLParser::ParseStream(StdIStream & stream)",
+                     << "Root element should be named simulation (actual = \'"
+                     << node.getElementName() << "\')!");
+
+            if (node.goToChildElement())
+            {
+               do
+               {
+                  boost::shared_ptr<tree::CContextGroup> group_context =
+                                    tree::CContext::GetContextGroup();
+                  attributes = node.getAttributes();
+
+                  if (attributes.end() == attributes.find("id"))
+                  {  DEBUG("Le context ne sera pas traitÃ© car il n'est pas identifiÃ© !");
+                     continue; }
+
+                  CObjectFactory::SetCurrentContextId(attributes["id"]);
+                  CGroupFactory::SetCurrentContextId(attributes["id"]);
+
+                  if(CObjectFactory::HasObject<tree::CContext>(attributes["id"]))
+                  {  DEBUG("Le context ne sera pas traitÃ© car il existe dÃ©jÃ  un autre context possÃ©dant le mÃªme nom !");
+                     continue; }
+
+                  boost::shared_ptr<tree::CContext> context =
+                     CObjectFactory::CreateObject<tree::CContext>(attributes["id"]);
+                  CGroupFactory::AddChild(group_context, context);
+                  context->parse(node);
+
+                  attributes.clear();
+
+               } while (node.goToNextElement());
+            }
+         }
+         catch (rapidxml::parse_error & exc)
+         {
+            ERROR("CXMLParser::ParseStream(StdIStream & stream)",
+                  << "RapidXML error : " << exc.what() << " !");
+         }
+      }
+   }// namespace xml
+} // namespace xmlioserver
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xml_parser.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xml_parser.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xml_parser.hpp	(revision 152)
@@ -0,0 +1,27 @@
+#ifndef __XMLIO_CXMLParser__
+#define __XMLIO_CXMLParser__
+
+/// xmlioserver headers ///
+#include "xmlioserver_spl.hpp"
+#include "xml_node.hpp"
+#include "node/context.hpp"
+
+namespace xmlioserver
+{
+   namespace xml
+   {
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      class CXMLParser
+      {
+         public :
+
+            static void ParseFile(const StdString & filename);
+            static void ParseString(const StdString & xmlContent);
+            static void ParseStream(StdIStream & stream);
+
+      }; //class CXMLParser
+
+   }// namespace xml
+} // namespace xmlioserver
+
+#endif // __XMLIO_CXMLParser__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xmlioserver.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xmlioserver.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xmlioserver.hpp	(revision 152)
@@ -0,0 +1,24 @@
+#ifndef __XMLIO__
+#define __XMLIO__
+
+#include "xmlioserver_spl.hpp"
+
+/// xmlioserver headers ///
+#include "manager/mpi_manager.hpp"
+#include "manager/tree_manager.hpp"
+#include "manager/xios_manager.hpp"
+#include "data_treatment.hpp"
+#include "output/nc4_data_output.hpp"
+
+//#include "data_manager.hpp"
+//#include "time_manager.hpp"
+
+using namespace xmlioserver;
+using namespace xmlioserver::data;
+using namespace xmlioserver::io;
+using namespace xmlioserver::tree;
+using namespace xmlioserver::xml;
+using namespace xmlioserver::comm;
+using namespace xmlioserver::func;
+
+#endif //__XMLIO__
Index: XMLIO_V2/dev/dev_rv/src/xmlio/xmlioserver_spl.hpp
===================================================================
--- XMLIO_V2/dev/dev_rv/src/xmlio/xmlioserver_spl.hpp	(revision 152)
+++ XMLIO_V2/dev/dev_rv/src/xmlio/xmlioserver_spl.hpp	(revision 152)
@@ -0,0 +1,49 @@
+#ifndef __XMLIO_SPL__
+#define __XMLIO_SPL__
+
+/// standard C++ headers ///
+#include <utility>
+#include <string>
+#include <algorithm>
+
+// standard C
+#include <cstring>
+#include <cstdlib>
+#include <cmath>
+#include <ctime>
+
+// Conteneurs.
+#include <vector>
+#include <set>
+#include <stack>
+#include <list>
+#include <map>
+
+// Flux.
+#include <iostream>
+#include <fstream>
+#include <sstream>
+
+/// boost headers ///
+//#include <boost/unordered_map.hpp>
+
+/// Map ///
+#define xios_map std::map
+
+/// Macro ///
+#define UNUSED(parameter)
+
+/// DÃ©finition de types (issus de la bibliothÃšque standard)///
+typedef std::ostringstream StdOStringStream;
+typedef std::istringstream StdIStringStream;
+typedef std::ofstream      StdOFStream;
+typedef std::ifstream      StdIFStream;
+typedef std::ostream       StdOStream;
+typedef std::istream       StdIStream;
+typedef std::string        StdString;
+typedef std::size_t        StdSize;
+
+/// xmlioserver headers ///
+#include "configure.hpp"
+
+#endif //__XMLIO_SPL__
