Index: XIOS/trunk/src/array.hpp
===================================================================
--- XIOS/trunk/src/array.hpp	(revision 351)
+++ XIOS/trunk/src/array.hpp	(revision 352)
@@ -16,14 +16,13 @@
 {
    template<size_t numDims>
-   detail::multi_array::extent_gen<numDims> getExtentNull(void) { return getExtentNull<numDims-1>()[0];}
+   inline detail::multi_array::extent_gen<numDims> getExtentNull(void) { return getExtentNull<numDims-1>()[0];}
    
    template<>
-   detail::multi_array::extent_gen<1> getExtentNull<1>(void) { return extents[0]; }
+   inline detail::multi_array::extent_gen<1> getExtentNull<1>(void) { return extents[0]; }
 
    /// ////////////////////// DÃ©clarations ////////////////////// ///
-   template <typename ValueType, StdSize  NumDims,
-             typename Allocator = std::allocator<ValueType> >
-      class CArray
-         : public boost::multi_array<ValueType, NumDims, Allocator>
+   
+   template <typename ValueType, StdSize  NumDims, typename Allocator = std::allocator<ValueType> >
+   class CArray : public boost::multi_array<ValueType, NumDims, Allocator>
    {
          /// DÃ©finition de type ///
@@ -35,11 +34,19 @@
 
          /// Constructeurs ///
-         template <typename ExtentList>
-            explicit CArray(const ExtentList & sizes);
+//         template <typename ExtentList>
+//            explicit CArray(const ExtentList & sizes);
+      template <typename ExtentList> CArray(const ExtentList & sizes)
+            : boost::multi_array<ValueType, NumDims, Allocator>
+                  (sizes, boost::fortran_storage_order())
+   { /* Ne rien faire de plus */ }
+
 
          explicit CArray();
 
-         template <typename ExtentList>
-            CArray(const ExtentList & sizes, const boost::general_storage_order<NumDims> & store);
+//         template <typename ExtentList>
+//            CArray(const ExtentList & sizes, const boost::general_storage_order<NumDims> & store);
+      template <typename ExtentList>  CArray(const ExtentList & sizes, const boost::general_storage_order<NumDims> & store)
+               : boost::multi_array<ValueType, NumDims, Allocator> (sizes, store)
+   { /* Ne rien faire de plus */ }
 
          CArray(const CArray & array);       // NEVER IMPLEMENTED.
@@ -71,5 +78,4 @@
 
    }; // class CArray
-   
 
    ///---------------------------------------------------------------
@@ -77,6 +83,11 @@
 } // namespace xios
 
-#include "array_impl.hpp"
+//#include "array_impl.hpp"
 #include "array_mac.hpp"
-
+namespace xios
+{
+   template <typename ValueType> void FromBinary(StdIStream & is, ARRAY(ValueType, 1) & array) ;
+   template <typename ValueType> void FromBinary(StdIStream & is, ARRAY(ValueType, 2) & array) ;
+   template <typename ValueType> void FromBinary(StdIStream & is, ARRAY(ValueType, 3) & array) ;
+}
 #endif // __XMLIO_CArray__
Index: XIOS/trunk/src/array_impl.cpp
===================================================================
--- XIOS/trunk/src/array_impl.cpp	(revision 352)
+++ XIOS/trunk/src/array_impl.cpp	(revision 352)
@@ -0,0 +1,206 @@
+#include "array.hpp"
+#include "array_mac.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+
+namespace xios
+{
+   
+   /// ////////////////////// 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())
+   { }
+*/
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+       CArray<ValueType, NumDims, Allocator>::CArray()
+            : boost::multi_array<ValueType, NumDims, Allocator>
+                  (getExtentNull<NumDims>(), 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)
+   {  }
+*/
+   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 << "CArray (" ;
+      for (StdSize i = 1; i < array.num_dimensions(); i++)
+         os << ", " << array.shape()[i];
+      os << ") = " ; 
+      for (StdSize i = 0; i < array.num_elements(); i++) os << (array.data()[i])<<"  ";
+      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> void FromBinary
+         (StdIStream & is, ARRAY(ValueType, 1) & array)
+   {
+      ARRAY_ASSIGN(array, ValueType, 1, [1]);
+      array->fromBinary(is);
+   }
+   
+   template <typename ValueType> void FromBinary
+         (StdIStream & is, ARRAY(ValueType, 2) & array)
+   {
+      ARRAY_ASSIGN(array, ValueType, 2, [1][1]);
+      array->fromBinary(is);
+   }
+
+   template <typename ValueType> void FromBinary
+         (StdIStream & is, ARRAY(ValueType, 3) & array)
+   {
+      ARRAY_ASSIGN(array, ValueType, 3, [1][1][1]);
+      array->fromBinary(is);
+   }
+   //----------------------------------------------------------------
+
+   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->resize(shape);
+      is.read (reinterpret_cast<char*>(&nelem), sizeof(LSize));
+      is.read (reinterpret_cast<char*>(this->data()), nelem * sizeof(ValueType));
+   }
+  
+    template <typename ValueType, StdSize NumDims, typename Allocator>
+    size_t CArray<ValueType, NumDims, Allocator>::getSize(void) 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();
+      size_t ret ;
+      ret=sizeof(ndim) ;
+      for (LSize i = 0; i < ndim; i++ ) ret+=sizeof(shape[i]) ;
+      ret+=sizeof(nelem) ;
+      ret+=sizeof(ValueType)*nelem ;
+      return ret ;
+   }
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+   bool CArray<ValueType, NumDims, Allocator>::toBuffer(CBufferOut& buffer) 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();
+      bool ret ;
+      
+      ret=buffer.put(ndim) ;
+      for (LSize i = 0; i < ndim; i++ ) ret&=buffer.put(shape[i]) ;
+      ret&=buffer.put(nelem) ;
+      ret&=buffer.put(data,nelem) ;
+      return ret ;
+  }
+
+   template <typename ValueType, StdSize NumDims, typename Allocator>
+   bool CArray<ValueType, NumDims, Allocator>::fromBuffer(CBufferIn& buffer)
+   {
+      typedef boost::multi_array_types::size_type LSize;
+      LSize ndim = 0, nelem = 0, temp = 0;
+      std::vector<LSize> shape;
+      bool ret ;
+      
+      ret=buffer.get(ndim) ;
+      for (LSize i = 0; i < ndim; i++ )
+      {
+         ret&=buffer.get(temp) ;
+         shape.push_back(temp);
+      }
+      this->resize(shape);
+      ret&=buffer.get(nelem) ;
+      ret&=buffer.get(this->data(),nelem) ;
+      return ret ;
+   }
+   
+  
+  
+  template class CArray<double,1> ;
+  template class CArray<double,2> ;
+  template class CArray<double,3> ;
+  template class CArray<double,4> ;
+  
+  template class CArray<float,1> ;
+  template class CArray<float,2> ;
+  template class CArray<float,3> ;
+  template class CArray<float,4> ;
+  
+  template class CArray<bool,1> ;
+  template class CArray<bool,2> ;
+  template class CArray<bool,3> ;
+  template class CArray<bool,4> ;
+  
+  template class CArray<int,1> ;
+  template class CArray<int,2> ;
+  template class CArray<int,3> ;
+  template class CArray<int,4> ;
+  
+  template class CArray<long int,1> ;
+  template class CArray<long int,2> ;
+  template class CArray<long int,3> ;
+  template class CArray<long int,4> ;
+  
+  template void FromBinary<double>(StdIStream & is, ARRAY(double, 1) & array) ;
+  template void FromBinary<int>(StdIStream & is, ARRAY(int, 1) & array) ;
+  template void FromBinary<double>(StdIStream & is, ARRAY(double, 2) & array) ;
+  template void FromBinary<bool>(StdIStream & is, ARRAY(bool, 2) & array) ;
+  
+   ///---------------------------------------------------------------
+   
+} // namespace xios
Index: XIOS/trunk/src/attribute.hpp
===================================================================
--- XIOS/trunk/src/attribute.hpp	(revision 351)
+++ XIOS/trunk/src/attribute.hpp	(revision 352)
@@ -40,5 +40,5 @@
             /// Test ///
             bool isEmpty(void) const;
-            template <typename T> inline bool isType(void);
+            template <typename T> inline bool isType(void) const;
 
             /// Destructeur ///
@@ -92,5 +92,5 @@
 
       template<typename T>
-         bool CAttribute::isType(void)
+         bool CAttribute::isType(void) const
       { 
          return (this->value.type() == typeid(T)); 
Index: XIOS/trunk/src/attribute_template.cpp
===================================================================
--- XIOS/trunk/src/attribute_template.cpp	(revision 351)
+++ 	(revision )
@@ -1,216 +1,0 @@
-#include "attribute_template.hpp"
-#include "attribute_template_impl.hpp"
-
-#include <cfloat>
-
-namespace xios
-{
-      /// ////////////////////// 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 <> // Double
-         void CAttributeTemplate<double>::fromString(const StdString & str)
-      {
-         if (str.find("max") != StdString::npos)
-         {
-            this->setValue(DBL_MAX);
-            return;
-         }
-         if (str.find("min") != StdString::npos)
-         {
-            this->setValue(DBL_MIN);
-            return;
-         }
-         
-         try
-         {
-            this->setValue(boost::lexical_cast<double>(str));
-         }
-         catch(boost::bad_lexical_cast &)
-         {
-            ERROR("void CAttributeTemplate<double>::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);
-         size = vect.size();
-         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));
-      }
-
-      template <> // Double
-         void CAttributeTemplate<double>::toBinary(StdOStream & os) const
-      {
-         double value = this->getValue();
-         os.write (reinterpret_cast<const char*>(&value) , sizeof(double));
-      }
-
-      //---------------------------------------------------------------
-
-      /** 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);
-      }
-
-      template <> // Double
-         void CAttributeTemplate<double>::fromBinary(StdIStream & is)
-      {
-         double value = 0.;
-         is.read (reinterpret_cast<char*>(&value), sizeof(double));
-         this->setValue(value);
-      }
-
-      ///--------------------------------------------------------------
-} // namespace xios
Index: XIOS/trunk/src/attribute_template_decl.cpp
===================================================================
--- XIOS/trunk/src/attribute_template_decl.cpp	(revision 352)
+++ XIOS/trunk/src/attribute_template_decl.cpp	(revision 352)
@@ -0,0 +1,13 @@
+#include "attribute_template_impl.hpp"
+#include "attribute_template_specialisation.hpp"
+#include <string>
+
+namespace xios
+{
+  template class CAttributeTemplate<int> ;
+  template class CAttributeTemplate<double> ;
+  template class CAttributeTemplate<bool> ;
+  template class CAttributeTemplate<string> ;
+  template class CAttributeTemplate< ARRAY(double,1) > ;
+  template class CAttributeTemplate< ARRAY(int,1) > ;
+  template class CAttributeTemplate< ARRAY(bool,2) > ;}
Index: XIOS/trunk/src/attribute_template_impl.hpp
===================================================================
--- XIOS/trunk/src/attribute_template_impl.hpp	(revision 351)
+++ XIOS/trunk/src/attribute_template_impl.hpp	(revision 352)
@@ -6,6 +6,6 @@
 #include "buffer_in.hpp"
 #include "buffer_out.hpp"
-#include "generate_interface_impl.hpp"
-
+#include "generate_interface.hpp"
+#include "attribute_template.hpp"
 
   
Index: XIOS/trunk/src/attribute_template_specialisation.hpp
===================================================================
--- XIOS/trunk/src/attribute_template_specialisation.hpp	(revision 352)
+++ XIOS/trunk/src/attribute_template_specialisation.hpp	(revision 352)
@@ -0,0 +1,216 @@
+#include "attribute_template.hpp"
+#include "attribute_template_impl.hpp"
+
+#include <cfloat>
+
+namespace xios
+{
+      /// ////////////////////// 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 <> // Double
+         void CAttributeTemplate<double>::fromString(const StdString & str)
+      {
+         if (str.find("max") != StdString::npos)
+         {
+            this->setValue(DBL_MAX);
+            return;
+         }
+         if (str.find("min") != StdString::npos)
+         {
+            this->setValue(DBL_MIN);
+            return;
+         }
+         
+         try
+         {
+            this->setValue(boost::lexical_cast<double>(str));
+         }
+         catch(boost::bad_lexical_cast &)
+         {
+            ERROR("void CAttributeTemplate<double>::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);
+         size = vect.size();
+         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));
+      }
+
+      template <> // Double
+         void CAttributeTemplate<double>::toBinary(StdOStream & os) const
+      {
+         double value = this->getValue();
+         os.write (reinterpret_cast<const char*>(&value) , sizeof(double));
+      }
+
+      //---------------------------------------------------------------
+
+      /** 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);
+      }
+
+      template <> // Double
+         void CAttributeTemplate<double>::fromBinary(StdIStream & is)
+      {
+         double value = 0.;
+         is.read (reinterpret_cast<char*>(&value), sizeof(double));
+         this->setValue(value);
+      }
+
+      ///--------------------------------------------------------------
+} // namespace xios
Index: XIOS/trunk/src/buffer.hpp
===================================================================
--- XIOS/trunk/src/buffer.hpp	(revision 351)
+++ XIOS/trunk/src/buffer.hpp	(revision 352)
@@ -73,5 +73,5 @@
 }
 
-#include "buffer_impl.hpp" 
+//#include "buffer_impl.hpp" 
 
 
Index: XIOS/trunk/src/buffer_decl.cpp
===================================================================
--- XIOS/trunk/src/buffer_decl.cpp	(revision 352)
+++ XIOS/trunk/src/buffer_decl.cpp	(revision 352)
@@ -0,0 +1,25 @@
+#include "buffer.hpp"
+#include "buffer_impl.hpp"
+
+namespace xios
+{
+#  define macro(T) \
+    template bool CBuffer::put_template<T>(const T& data) ; \
+    template bool CBuffer::put_template<T>(const T* data, size_t n) ; \
+    template bool CBuffer::put_ptr_template<T>(const T*& data, size_t n) ; \
+    template bool CBuffer::get_template<T>(T& data) ; \
+    template bool CBuffer::get_template<T>(T* data, size_t n) ; \
+    template bool CBuffer::get_ptr_template<T>(T*& data, size_t n) ;
+  
+  
+  macro(char)
+  macro(int)
+  macro(short)
+  macro(long)
+  macro(uint)
+  macro(ushort)
+  macro(ulong)
+  macro(float)
+  macro(double)
+  macro(long double)
+}
Index: XIOS/trunk/src/buffer_in.hpp
===================================================================
--- XIOS/trunk/src/buffer_in.hpp	(revision 351)
+++ XIOS/trunk/src/buffer_in.hpp	(revision 352)
@@ -59,5 +59,5 @@
 }
 
-#include "buffer_in_impl.hpp" 
+//#include "buffer_in_impl.hpp" 
 
 
Index: XIOS/trunk/src/buffer_in_decl.cpp
===================================================================
--- XIOS/trunk/src/buffer_in_decl.cpp	(revision 352)
+++ XIOS/trunk/src/buffer_in_decl.cpp	(revision 352)
@@ -0,0 +1,23 @@
+#include "buffer_in.hpp"
+#include "buffer_in_impl.hpp"
+
+namespace xios
+{
+# define macro(T) \
+  template bool CBufferIn::get_template<T>(T& data); \
+  template bool CBufferIn::get_template<T>(T* data, size_t n); \
+  template bool CBufferIn::advance_template<T>(size_t n);
+ 
+
+  macro(char)
+  macro(int)
+  macro(short)
+  macro(long)
+  macro(uint)
+  macro(ushort)
+  macro(ulong)
+  macro(float)
+  macro(double)
+  macro(long double)
+}
+
Index: XIOS/trunk/src/buffer_out.hpp
===================================================================
--- XIOS/trunk/src/buffer_out.hpp	(revision 351)
+++ XIOS/trunk/src/buffer_out.hpp	(revision 352)
@@ -61,5 +61,5 @@
 }
 
-#include "buffer_out_impl.hpp" 
+//#include "buffer_out_impl.hpp" 
 
 
Index: XIOS/trunk/src/buffer_out_decl.cpp
===================================================================
--- XIOS/trunk/src/buffer_out_decl.cpp	(revision 352)
+++ XIOS/trunk/src/buffer_out_decl.cpp	(revision 352)
@@ -0,0 +1,23 @@
+#include "buffer_out.hpp"
+#include "buffer_out_impl.hpp"
+
+
+namespace xios
+{
+# define macro(T) \
+  template bool CBufferOut::put_template<T>(const T& data) ; \
+  template bool CBufferOut::put_template<T>(const T* data, size_t n) ; \
+  template bool CBufferOut::advance_template<T>(size_t n) ; \
+ 
+
+  macro(char)
+  macro(int)
+  macro(short)
+  macro(long)
+  macro(uint)
+  macro(ushort)
+  macro(ulong)
+  macro(float)
+  macro(double)
+  macro(long double)
+}
Index: XIOS/trunk/src/context_server.cpp
===================================================================
--- XIOS/trunk/src/context_server.cpp	(revision 351)
+++ XIOS/trunk/src/context_server.cpp	(revision 352)
@@ -3,9 +3,11 @@
 #include "type.hpp"
 #include "context.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
-#include "attribute_template_impl.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "attribute_template.hpp"
 #include "domain.hpp"
-
+#include "field.hpp"
+#include "file.hpp"
+#include "grid.hpp"
 #include <mpi.h>
 #include "tracer.hpp"
Index: XIOS/trunk/src/cxios.hpp
===================================================================
--- XIOS/trunk/src/cxios.hpp	(revision 351)
+++ XIOS/trunk/src/cxios.hpp	(revision 352)
@@ -41,7 +41,8 @@
         
   } ;
+
 }
 
-#include "cxios_impl.hpp"
+//#include "cxios_impl.hpp"
 
 
Index: XIOS/trunk/src/cxios_decl.cpp
===================================================================
--- XIOS/trunk/src/cxios_decl.cpp	(revision 352)
+++ XIOS/trunk/src/cxios_decl.cpp	(revision 352)
@@ -0,0 +1,16 @@
+#include "cxios_impl.hpp"
+#include "xmlioserver_spl.hpp"
+#include <string>
+
+namespace xios
+{
+# define macro(T) \
+  template T CXios::getin<T>(const string& id) ; \
+  template T CXios::getin<T>(const string& id, const T& defaultValue) ;
+  
+  macro(int)
+  macro(double)
+  macro(bool)
+  macro(StdSize)
+  macro(string)
+}
Index: XIOS/trunk/src/cxios_impl.hpp
===================================================================
--- XIOS/trunk/src/cxios_impl.hpp	(revision 351)
+++ XIOS/trunk/src/cxios_impl.hpp	(revision 352)
@@ -4,5 +4,6 @@
 #include "xmlioserver_spl.hpp"
 #include "variable.hpp"
-#include "object_template_impl.hpp"
+#include "object_template.hpp"
+#include "cxios.hpp"
 
 namespace xios
Index: XIOS/trunk/src/data_output.cpp
===================================================================
--- XIOS/trunk/src/data_output.cpp	(revision 351)
+++ XIOS/trunk/src/data_output.cpp	(revision 352)
@@ -1,6 +1,6 @@
 #include "data_output.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "group_template.hpp"
 #include "context.hpp"
 
Index: XIOS/trunk/src/field_impl.hpp
===================================================================
--- XIOS/trunk/src/field_impl.hpp	(revision 351)
+++ 	(revision )
@@ -1,66 +1,0 @@
-
-#ifndef __FIELD_IMPL_HPP__
-#define __FIELD_IMPL_HPP__
-
-#include "xmlioserver_spl.hpp"
-#include "field.hpp"
-#include "context.hpp"
-#include "grid.hpp"
-#include "timer.hpp"
-
-
-namespace xios {
-
-   template <StdSize N>
-   void CField::setData(const ARRAY(double, N) _data)
-   {
-     const std::vector<CField*>& refField=getAllReference();
-     std::vector<CField*>::const_iterator  it = refField.begin(), end = refField.end();
-     
-     for (; it != end; it++) (*it)->updateData(_data) ;
-    }
-    
-   template <StdSize N>
-      bool CField::updateData(const ARRAY(double, N) _data)
-   {        
-      CContext* context=CContext::getCurrent();
-      const CDate & currDate = context->getCalendar()->getCurrentDate();
-      const CDate opeDate      = *last_operation + freq_operation;
-      const CDate writeDate    = *last_Write     + freq_write;       
-
-   
-      info(50) << "CField::updateData " << currDate <<  " : send data to " << this->getBaseFieldId() << std::endl;
-      info(50) << "Next operation "  << opeDate<<std::endl;
-
-      if (opeDate <= currDate)
-      {
-         if (this->data->num_elements() != this->grid->storeIndex_client->num_elements())
-         {
-            this->data->resize(boost::extents[this->grid->storeIndex_client ->num_elements()]);
-         }
-            
-         ARRAY_CREATE(input, double, 1, [this->data->num_elements()]);
-         this->grid->inputField(_data, input);          
-         (*this->foperation)(input);
-         
-         *last_operation = currDate;
-         info(50) << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl; 
-      }
-      
-      if (writeDate < (currDate + freq_operation))
-      {
-         this->foperation->final();
-         *last_Write = writeDate;
-         info(50) << "(*last_Write = currDate) : " << *last_Write << " = " << currDate	<< std::endl;
-         CTimer::get("XIOS Send Data").resume() ;
-         sendUpdateData() ;
-         CTimer::get("XIOS Send Data").suspend() ;
-         return (true);        
-      }
-
-      return (false);
-   }
-
-} // namespace xios
-
-#endif
Index: XIOS/trunk/src/functor.hpp
===================================================================
--- XIOS/trunk/src/functor.hpp	(revision 351)
+++ XIOS/trunk/src/functor.hpp	(revision 352)
@@ -58,5 +58,5 @@
 } // namespace xios
 
-#include "functor_type.hpp"
+//#include "functor_type.hpp"
 
 #endif // __XMLIO_CFunctor__
Index: XIOS/trunk/src/generate_fortran_interface.cpp
===================================================================
--- XIOS/trunk/src/generate_fortran_interface.cpp	(revision 351)
+++ XIOS/trunk/src/generate_fortran_interface.cpp	(revision 352)
@@ -1,8 +1,8 @@
 #include "xmlioserver.hpp"
-#include "generate_interface_impl.hpp"
+#include "generate_interface.hpp"
 #include "indent.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 int main (int argc, char ** argv, char ** UNUSED (env))
Index: XIOS/trunk/src/generate_interface.hpp
===================================================================
--- XIOS/trunk/src/generate_interface.hpp	(revision 351)
+++ XIOS/trunk/src/generate_interface.hpp	(revision 352)
@@ -42,5 +42,5 @@
 
   };
-  
+/*  
   template<> string CInterface::getStrFortranType<int>(void) {return string("INTEGER") ;}
   template<> string CInterface::getStrFortranType<bool>(void) {return string("LOGICAL") ;}
@@ -62,5 +62,5 @@
   template<> bool CInterface::matchingTypeCFortran<double>(void) { return true; }
   template<> bool CInterface::matchingTypeCFortran<float>(void) { return true; }
-  
+*/
 }
 #endif
Index: XIOS/trunk/src/generate_interface_decl.cpp
===================================================================
--- XIOS/trunk/src/generate_interface_decl.cpp	(revision 352)
+++ XIOS/trunk/src/generate_interface_decl.cpp	(revision 352)
@@ -0,0 +1,21 @@
+#include "generate_interface_impl.hpp"
+
+namespace xios
+{
+
+#define macro(T) \
+  template void CInterface::AttributeCInterface<T>(ostream& oss,const string& className,const string& name) ; \
+  template void CInterface::AttributeFortran2003Interface<T>(ostream& oss,const string& className,const string& name) ; \
+  template void CInterface::AttributeFortranInterfaceDeclaration<T>(ostream& oss,const string& className,const string& name) ; \
+  template void CInterface::AttributeFortranInterfaceGetDeclaration<T>(ostream& oss,const string& className,const string& name) ; \
+  template void CInterface::AttributeFortranInterfaceBody<T>(ostream& oss,const string& className,const string& name) ; \
+  template void CInterface::AttributeFortranInterfaceGetBody<T>(ostream& oss,const string& className,const string& name) ; \
+  template string CInterface::getStrFortranType<T>(void) ; \
+  template string CInterface::getStrFortranKind<T>(void) ; \
+  template string CInterface::getStrFortranKindC<T>(void) ; \
+  template bool CInterface::matchingTypeCFortran<T>(void) ; 
+  
+  macro(bool)
+  macro(int)
+  macro(double)
+}
Index: XIOS/trunk/src/generate_interface_impl.hpp
===================================================================
--- XIOS/trunk/src/generate_interface_impl.hpp	(revision 351)
+++ XIOS/trunk/src/generate_interface_impl.hpp	(revision 352)
@@ -6,8 +6,28 @@
 #include "type_util.hpp"
 #include "indent.hpp"
+#include "array.hpp"
 
 namespace xios
 { 
-
+  template<> string CInterface::getStrFortranType<int>(void) {return string("INTEGER") ;}
+  template<> string CInterface::getStrFortranType<bool>(void) {return string("LOGICAL") ;}
+  template<> string CInterface::getStrFortranType<double>(void) {return string("REAL") ;}
+  template<> string CInterface::getStrFortranType<float>(void) {return string("REAL") ;}
+  
+  template<> string CInterface::getStrFortranKind<int>(void) {return string("") ;}
+  template<> string CInterface::getStrFortranKind<bool>(void) {return string("") ;}
+  template<> string CInterface::getStrFortranKind<double>(void) {return string("(KIND=8)") ;}
+  template<> string CInterface::getStrFortranKind<float>(void) {return string("(KIND=4)") ;}
+  
+  template<> string CInterface::getStrFortranKindC<int>(void) {return string("(KIND=C_INT)") ;}
+  template<> string CInterface::getStrFortranKindC<bool>(void) {return string("(KIND=C_BOOL)") ;}
+  template<> string CInterface::getStrFortranKindC<double>(void) {return string("(KIND=C_DOUBLE)") ;}
+  template<> string CInterface::getStrFortranKindC<float>(void) {return string("(KIND=C_FLOAT)") ;}
+  
+  template<> bool CInterface::matchingTypeCFortran<int>(void) { return true ; } 
+  template<> bool CInterface::matchingTypeCFortran<bool>(void) { return false ;} 
+  template<> bool CInterface::matchingTypeCFortran<double>(void) { return true; }
+  template<> bool CInterface::matchingTypeCFortran<float>(void) { return true; }
+  
 
 // /////////////////////////////////////////////////
@@ -15,4 +35,5 @@
 // /////////////////////////////////////////////////
 
+  
   template <class T>
   void CInterface::AttributeCInterface(ostream& oss, const string& className,const string& name)
Index: XIOS/trunk/src/group_factory.hpp
===================================================================
--- XIOS/trunk/src/group_factory.hpp	(revision 351)
+++ XIOS/trunk/src/group_factory.hpp	(revision 352)
@@ -74,6 +74,6 @@
 } // namespace xios
 
-#include "group_factory_impl.hpp"
-#include "group_parser.hpp"
+//#include "group_factory_impl.hpp"
+//#include "group_parser.hpp"
 
 #endif // __XMLIO_CGroupFactory__
Index: XIOS/trunk/src/group_factory_decl.cpp
===================================================================
--- XIOS/trunk/src/group_factory_decl.cpp	(revision 352)
+++ XIOS/trunk/src/group_factory_decl.cpp	(revision 352)
@@ -0,0 +1,27 @@
+#include "group_factory_impl.hpp"
+#include "node_type.hpp"
+
+namespace xios
+{
+# define  macro(U) \
+  template void CGroupFactory::AddGroup<U>(shared_ptr<U> pgroup,shared_ptr<U> cgroup); \
+  template void CGroupFactory::AddChild<U>(shared_ptr<U> group, shared_ptr<U::RelChild> child); \
+  template shared_ptr<U>  CGroupFactory::GetGroup<U>(shared_ptr<U> group, const StdString & id); \
+  template shared_ptr<U::RelChild> CGroupFactory::GetChild<U>(shared_ptr<U> group, const StdString & id); \
+  template int CGroupFactory::GetGroupNum<U>(shared_ptr<U> group); \
+  template int CGroupFactory::GetGroupIdNum<U>(shared_ptr<U> group); \
+  template int CGroupFactory::GetChildNum<U>(shared_ptr<U> group); \
+  template int CGroupFactory::GetChildIdNum<U>(boost::shared_ptr<U> group); \
+  template bool CGroupFactory::HasGroup<U>(shared_ptr<U> group, const StdString & id); \
+  template bool CGroupFactory::HasChild<U>(boost::shared_ptr<U> group, const StdString & id); \
+  template shared_ptr<U> CGroupFactory::CreateGroup<U>(shared_ptr<U> group, const StdString & id ); \
+  template shared_ptr<U::RelChild>  CGroupFactory::CreateChild<U>(shared_ptr<U> group, const StdString & id);
+
+  macro(CFieldGroup)
+  macro(CFileGroup)
+  macro(CGridGroup)
+  macro(CAxisGroup)
+  macro(CDomainGroup)
+  macro(CContextGroup)
+  macro(CVariableGroup)
+}
Index: XIOS/trunk/src/group_factory_impl.hpp
===================================================================
--- XIOS/trunk/src/group_factory_impl.hpp	(revision 351)
+++ XIOS/trunk/src/group_factory_impl.hpp	(revision 352)
@@ -1,4 +1,6 @@
 #ifndef __XMLIO_CGroupFactory_impl__
 #define __XMLIO_CGroupFactory_impl__
+
+#include "group_factory.hpp"
 
 namespace xios
@@ -14,9 +16,9 @@
                << " pgroup or cgroup NULL !");
       if (!cgroup->hasId())
-         pgroup->groupList.insert(pgroup->groupList.end(), cgroup);
+         pgroup->groupList.insert(pgroup->groupList.end(), cgroup.get());
       else
       {
-         pgroup->groupList.insert(pgroup->groupList.end(), cgroup);
-         pgroup->groupMap.insert(std::make_pair(cgroup->getId(), cgroup));
+         pgroup->groupList.insert(pgroup->groupList.end(), cgroup.get());
+         pgroup->groupMap.insert(std::make_pair(cgroup->getId(), cgroup.get()));
       }
    }
Index: XIOS/trunk/src/group_template_decl.cpp
===================================================================
--- XIOS/trunk/src/group_template_decl.cpp	(revision 352)
+++ XIOS/trunk/src/group_template_decl.cpp	(revision 352)
@@ -0,0 +1,18 @@
+#include "group_template_impl.hpp"
+#include "node_type.hpp"
+
+namespace xios
+{
+#  define macro(T) \
+  template class CGroupTemplate<C##T, C##T##Group, C##T##Attributes> ;
+  
+  macro(Context) 
+  macro(Field) 
+  macro(File) 
+  macro(Domain) 
+  macro(Grid) 
+  macro(Axis) 
+  macro(Variable) 
+  
+
+}
Index: XIOS/trunk/src/group_template_impl.hpp
===================================================================
--- XIOS/trunk/src/group_template_impl.hpp	(revision 351)
+++ XIOS/trunk/src/group_template_impl.hpp	(revision 352)
@@ -4,9 +4,12 @@
 #include "xmlioserver_spl.hpp"
 #include "event_server.hpp"
-#include "object_template_impl.hpp"
+#include "object_template.hpp"
 #include "group_template.hpp"
 #include "context.hpp"
 #include "event_client.hpp"
 #include "context_client.hpp"
+#include "message.hpp"
+#include "type.hpp"
+#include "type_util.hpp"
 
 
@@ -238,5 +241,5 @@
          CGroupTemplate<U, V, W>::getGroupMap(void) const
    { 
-      return (this->groupList);
+      return (this->groupMap);
    }
 
@@ -351,5 +354,5 @@
    void CGroupTemplate<U, V, W>::addChild(U* child) 
   {
-    return CGroupFactory::AddChild<V>(this->getShared,child->getShared()) ;
+    return CGroupFactory::AddChild<V>(this->getShared(),child->getShared()) ;
   }
   
@@ -475,4 +478,73 @@
    }
 
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::parse(xml::CXMLNode & node, bool withAttr)
+   {
+
+      StdString name = node.getElementName();
+      xml::THashAttributes attributes = node.getAttributes();
+      if (withAttr)
+      {
+         CGroupTemplate<U, V, W>::SuperClass::parse(node);
+         if (attributes.end() != attributes.find("src"))
+         {
+            StdIFStream ifs ( attributes["src"].c_str() , StdIFStream::in );
+            if (!ifs.good())
+               ERROR("CGroupTemplate<U, V, W>::parse(xml::CXMLNode & node, bool withAttr)",
+                     << "[ filename = " << attributes["src"] << " ] Bad xml stream !");
+            xml::CXMLParser::ParseInclude(ifs, *this);
+         }
+      }
+
+      // PARSING POUR GESTION DES ENFANTS
+           V* group_ptr = (this->hasId()) 
+         ? V::get(this->getId())
+         : 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->getShared())->parse(node);
+               else
+                  CGroupFactory::CreateGroup(group_ptr->getShared(), attributes["id"])->parse(node);
+               continue;
+            }
+
+            if (name.compare(U::GetName()) == 0)
+            {
+               if (attributes.end() == attributes.find("id"))
+                  CGroupFactory::CreateChild(group_ptr->getShared())->parse(node);
+               else
+                  CGroupFactory::CreateChild(group_ptr->getShared(), attributes["id"])->parse(node);
+               continue;
+            }
+
+            DEBUG(<< "Dans le contexte \'" << CContext::getCurrent()->getId()
+                  << "\', un objet de type \'" << V::GetName()
+                  << "\' ne peut contenir qu'un objet de type \'" << V::GetName()
+                  << "\' ou de type \'" << U::GetName()
+                  << "\' (reÃ§u : " << name << ") !");
+
+         } while (node.goToNextElement());
+         node.goToParentElement(); // Retour au parent
+      }
+   }
 } // namespace xios
 
Index: XIOS/trunk/src/interface/c/icaxis.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icaxis.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c/icaxis.cpp	(revision 352)
@@ -8,10 +8,11 @@
 #include "xmlioserver.hpp"
 
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
-#include "attribute_template_impl.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "attribute_template.hpp"
 
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "axis.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c/iccontext.cpp
===================================================================
--- XIOS/trunk/src/interface/c/iccontext.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c/iccontext.cpp	(revision 352)
@@ -8,7 +8,7 @@
 #include "xmlioserver.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "calendar_type.hpp"
@@ -16,4 +16,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "context.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c/icdata.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icdata.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c/icdata.cpp	(revision 352)
@@ -12,7 +12,7 @@
 #include "oasis_cinterface.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "icutil.hpp"
@@ -20,5 +20,5 @@
 #include "client.hpp"
 #include "field.hpp"
-#include "field_impl.hpp"
+#include "context.hpp"
 #include <mpi.h>
 #include "timer.hpp"
Index: XIOS/trunk/src/interface/c/icdate.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icdate.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c/icdate.cpp	(revision 352)
@@ -8,7 +8,7 @@
 #include "xmlioserver.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "calendar_type.hpp"
@@ -16,4 +16,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "context.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c/icdomain.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icdomain.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c/icdomain.cpp	(revision 352)
@@ -8,10 +8,11 @@
 #include "xmlioserver.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "domain.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c/icfield.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icfield.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c/icfield.cpp	(revision 352)
@@ -8,10 +8,11 @@
 #include "xmlioserver.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "field.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c/icfile.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icfile.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c/icfile.cpp	(revision 352)
@@ -8,10 +8,11 @@
 #include "xmlioserver.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "file.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c/icgrid.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icgrid.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c/icgrid.cpp	(revision 352)
@@ -8,10 +8,11 @@
 #include "xmlioserver.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "grid.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c/icxml_tree.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icxml_tree.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c/icxml_tree.cpp	(revision 352)
@@ -8,10 +8,16 @@
 #include "xmlioserver.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "context.hpp"
+#include "grid.hpp"
+#include "file.hpp"
+#include "field.hpp"
+#include "axis.hpp"
+#include "domain.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "axis.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icaxisgroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icaxisgroup_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icaxisgroup_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "axis.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "context.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "domain.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "domain.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icfield_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "field.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "field.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icfile_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "file.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "file.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "grid.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp	(revision 351)
+++ XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp	(revision 352)
@@ -6,9 +6,10 @@
 #include <boost/shared_ptr.hpp>
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "icutil.hpp"
 #include "timer.hpp"
+#include "grid.hpp"
 
 extern "C"
Index: XIOS/trunk/src/node/axis.cpp
===================================================================
--- XIOS/trunk/src/node/axis.cpp	(revision 351)
+++ XIOS/trunk/src/node/axis.cpp	(revision 352)
@@ -1,7 +1,10 @@
 #include "axis.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "message.hpp"
+#include "type.hpp"
+#include "xmlioserver_spl.hpp"
 
 namespace xios {
Index: XIOS/trunk/src/node/context.cpp
===================================================================
--- XIOS/trunk/src/node/context.cpp	(revision 351)
+++ XIOS/trunk/src/node/context.cpp	(revision 352)
@@ -1,6 +1,6 @@
 #include "context.hpp"
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "calendar_type.hpp"
@@ -11,4 +11,7 @@
 #include "nc4_data_output.hpp"
 #include "node_type.hpp"
+#include "message.hpp"
+#include "type.hpp"
+#include "xmlioserver_spl.hpp"
 
 namespace xios {
Index: XIOS/trunk/src/node/context.hpp
===================================================================
--- XIOS/trunk/src/node/context.hpp	(revision 351)
+++ XIOS/trunk/src/node/context.hpp	(revision 352)
@@ -4,5 +4,5 @@
 /// xios headers ///
 #include "xmlioserver_spl.hpp"
-#include "node_type.hpp"
+//#include "node_type.hpp"
 #include "calendar.hpp"
 
@@ -24,5 +24,5 @@
    class CContextAttributes;
    class CContext;
-  
+   class CFile;
    ///--------------------------------------------------------------
 
Index: XIOS/trunk/src/node/domain.cpp
===================================================================
--- XIOS/trunk/src/node/domain.cpp	(revision 351)
+++ XIOS/trunk/src/node/domain.cpp	(revision 352)
@@ -1,7 +1,7 @@
 #include "domain.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "xmlioserver_spl.hpp"
@@ -9,4 +9,8 @@
 #include "event_server.hpp"
 #include "buffer_in.hpp"
+#include "message.hpp"
+#include "type.hpp"
+#include "context.hpp"
+#include "context_client.hpp"
 
 namespace xios {
Index: XIOS/trunk/src/node/field.cpp
===================================================================
--- XIOS/trunk/src/node/field.cpp	(revision 351)
+++ XIOS/trunk/src/node/field.cpp	(revision 352)
@@ -1,10 +1,14 @@
 #include "field.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 #include "node_type.hpp"
 #include "calendar_util.hpp"
+#include "message.hpp"
+#include "xmlioserver_spl.hpp"
+#include "type.hpp"
+#include "context_client.hpp"
 
 namespace xios{
Index: XIOS/trunk/src/node/field_decl.cpp
===================================================================
--- XIOS/trunk/src/node/field_decl.cpp	(revision 352)
+++ XIOS/trunk/src/node/field_decl.cpp	(revision 352)
@@ -0,0 +1,9 @@
+#include "field_impl.hpp"
+
+namespace xios
+{
+  template void CField::setData<1>(const ARRAY(double, 1) _data) ;
+  template void CField::setData<2>(const ARRAY(double, 2) _data) ;
+  template void CField::setData<3>(const ARRAY(double, 3) _data) ;
+
+}
Index: XIOS/trunk/src/node/field_impl.hpp
===================================================================
--- XIOS/trunk/src/node/field_impl.hpp	(revision 352)
+++ XIOS/trunk/src/node/field_impl.hpp	(revision 352)
@@ -0,0 +1,66 @@
+
+#ifndef __FIELD_IMPL_HPP__
+#define __FIELD_IMPL_HPP__
+
+#include "xmlioserver_spl.hpp"
+#include "field.hpp"
+#include "context.hpp"
+#include "grid.hpp"
+#include "timer.hpp"
+#include "array.hpp"
+
+namespace xios {
+
+   template <StdSize N>
+   void CField::setData(const ARRAY(double, N) _data)
+   {
+     const std::vector<CField*>& refField=getAllReference();
+     std::vector<CField*>::const_iterator  it = refField.begin(), end = refField.end();
+     
+     for (; it != end; it++) (*it)->updateData(_data) ;
+    }
+    
+   template <StdSize N>
+      bool CField::updateData(const ARRAY(double, N) _data)
+   {        
+      CContext* context=CContext::getCurrent();
+      const CDate & currDate = context->getCalendar()->getCurrentDate();
+      const CDate opeDate      = *last_operation + freq_operation;
+      const CDate writeDate    = *last_Write     + freq_write;       
+
+   
+      info(50) << "CField::updateData " << currDate <<  " : send data to " << this->getBaseFieldId() << std::endl;
+      info(50) << "Next operation "  << opeDate<<std::endl;
+
+      if (opeDate <= currDate)
+      {
+         if (this->data->num_elements() != this->grid->storeIndex_client->num_elements())
+         {
+            this->data->resize(boost::extents[this->grid->storeIndex_client ->num_elements()]);
+         }
+            
+         ARRAY_CREATE(input, double, 1, [this->data->num_elements()]);
+         this->grid->inputField(_data, input);          
+         (*this->foperation)(input);
+         
+         *last_operation = currDate;
+         info(50) << "(*last_operation = currDate) : " << *last_operation << " = " << currDate << std::endl; 
+      }
+      
+      if (writeDate < (currDate + freq_operation))
+      {
+         this->foperation->final();
+         *last_Write = writeDate;
+         info(50) << "(*last_Write = currDate) : " << *last_Write << " = " << currDate	<< std::endl;
+         CTimer::get("XIOS Send Data").resume() ;
+         sendUpdateData() ;
+         CTimer::get("XIOS Send Data").suspend() ;
+         return (true);        
+      }
+
+      return (false);
+   }
+
+} // namespace xios
+
+#endif
Index: XIOS/trunk/src/node/file.cpp
===================================================================
--- XIOS/trunk/src/node/file.cpp	(revision 351)
+++ XIOS/trunk/src/node/file.cpp	(revision 352)
@@ -1,10 +1,8 @@
 #include "file.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
-
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "object_factory.hpp"
-#include "object_factory_impl.hpp"
 #include "data_output.hpp"
 #include "context.hpp"
@@ -13,5 +11,8 @@
 #include "calendar_util.hpp"
 #include "date.hpp"
-
+#include "message.hpp"
+#include "type.hpp"
+#include "xmlioserver_spl.hpp"
+#include "context_client.hpp"
 
 namespace xios {
Index: XIOS/trunk/src/node/grid.cpp
===================================================================
--- XIOS/trunk/src/node/grid.cpp	(revision 351)
+++ XIOS/trunk/src/node/grid.cpp	(revision 352)
@@ -2,8 +2,13 @@
 #include "grid.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "message.hpp"
 #include <iostream>
+#include "xmlioserver_spl.hpp"
+#include "type.hpp"
+#include "context.hpp"
+#include "context_client.hpp"
 
 namespace xios {
Index: XIOS/trunk/src/node/variable.cpp
===================================================================
--- XIOS/trunk/src/node/variable.cpp	(revision 351)
+++ XIOS/trunk/src/node/variable.cpp	(revision 352)
@@ -1,10 +1,10 @@
 #include "variable.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
-
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 #include "object_factory.hpp"
-#include "object_factory_impl.hpp"
+#include "xmlioserver_spl.hpp"
+#include "type.hpp"
 
 namespace xios {
Index: XIOS/trunk/src/node/variable.hpp
===================================================================
--- XIOS/trunk/src/node/variable.hpp	(revision 351)
+++ XIOS/trunk/src/node/variable.hpp	(revision 352)
@@ -64,4 +64,5 @@
             template <typename T> inline T getData(void) const;
 //            bool inline getData<bool>(void) const ;
+//            template <> getData<bool>(void) const ;
             
             template <typename T, StdSize N>
@@ -81,7 +82,16 @@
       }; // class CVar
 
-     
+      template<>
+      inline bool CVariable::getData(void) const
+      {
+         if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 
+         else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 
+         else ERROR("CVariable::getdata()",
+               << "Cannot convert string <" << content << "> into type required" );
+         return false ;
+      } 
+      
       template <typename T>
-      T CVariable::getData(void) const
+      inline T CVariable::getData(void) const
       {
          T retval ;
@@ -94,13 +104,5 @@
       } 
 
-      template<>
-      bool CVariable::getData<bool>(void) const
-      {
-         if (content.compare("true")==0 || content.compare(".true.")==0 || content.compare(".TRUE.")==0) return true ; 
-         else if (content.compare("false")==0 || content.compare(".false.")==0 || content.compare(".FALSE.")==0) return false ; 
-         else ERROR("CVariable::getdata()",
-               << "Cannot convert string <" << content << "> into type required" );
-         return false ;
-      } 
+
       ///--------------------------------------------------------------
 
Index: XIOS/trunk/src/object_factory.hpp
===================================================================
--- XIOS/trunk/src/object_factory.hpp	(revision 351)
+++ XIOS/trunk/src/object_factory.hpp	(revision 352)
@@ -24,33 +24,33 @@
 
          template <typename U>
-            static inline boost::shared_ptr<U> GetObject(const StdString & id);
+            static  boost::shared_ptr<U> GetObject(const StdString & id);
 
          template <typename U>
-            static inline boost::shared_ptr<U> GetObject(const StdString& context,const StdString & id);
+            static  boost::shared_ptr<U> GetObject(const StdString& context,const StdString & id);
 
          template <typename U>
-            static inline boost::shared_ptr<U> GetObject(const U * const object);
+            static  boost::shared_ptr<U> GetObject(const U * const object);
 
          template <typename U>
-            static inline int GetObjectNum(void);
+            static  int GetObjectNum(void);
          template <typename U>
-            static inline int GetObjectIdNum(void);
+            static  int GetObjectIdNum(void);
 
          template <typename U>
-            static inline const std::vector<boost::shared_ptr<U> > &
+            static  const std::vector<boost::shared_ptr<U> > &
                GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId());
 
          /// Tests ///
          template <typename U>
-            static inline bool HasObject(const StdString & id);
+            static  bool HasObject(const StdString & id);
 
          template <typename U>
-            static inline bool HasObject(const StdString& context,const StdString & id);
+            static  bool HasObject(const StdString& context,const StdString & id);
 
          /// Instanciateur ///
          template <typename U>
-            static inline boost::shared_ptr<U> CreateObject(const StdString & id = StdString(""));
+            static  boost::shared_ptr<U> CreateObject(const StdString & id = StdString(""));
 
-         template <typename U> static inline StdString GenUId(void) ; 
+         template <typename U> static  StdString GenUId(void) ; 
 
       private :
@@ -62,5 +62,5 @@
 } // namespace xios
 
-#include "object_factory_impl.hpp"
+//#include "object_factory_impl.hpp"
 
 #endif // __XMLIO_CObjectFactory__
Index: XIOS/trunk/src/object_factory_decl.cpp
===================================================================
--- XIOS/trunk/src/object_factory_decl.cpp	(revision 352)
+++ XIOS/trunk/src/object_factory_decl.cpp	(revision 352)
@@ -0,0 +1,33 @@
+#include "object_factory_impl.hpp"
+#include "node_type.hpp"
+
+namespace xios
+{
+#define macro(U) \
+  template shared_ptr<U> CObjectFactory::GetObject<U>(const StdString & id);  \
+  template shared_ptr<U> CObjectFactory::GetObject<U>(const StdString& context,const StdString & id); \
+  template shared_ptr<U> CObjectFactory::GetObject<U>(const U * const object); \
+  template int CObjectFactory::GetObjectNum<U>(void); \
+  template int CObjectFactory::GetObjectIdNum<U>(void); \
+  template const std::vector<shared_ptr<U> >& CObjectFactory::GetObjectVector<U>(const StdString & context ); \
+  template bool CObjectFactory::HasObject<U>(const StdString & id); \
+  template bool CObjectFactory::HasObject<U>(const StdString& context,const StdString & id); \
+  template boost::shared_ptr<U> CObjectFactory::CreateObject<U>(const StdString & id ); \
+  template  StdString CObjectFactory::GenUId<U>(void) ; 
+  
+  macro(CField)
+  macro(CFile)
+  macro(CGrid)
+  macro(CAxis)
+  macro(CDomain)
+  macro(CContext)
+  macro(CVariable)
+
+  macro(CFieldGroup)
+  macro(CFileGroup)
+  macro(CGridGroup)
+  macro(CAxisGroup)
+  macro(CDomainGroup)
+  macro(CContextGroup)
+  macro(CVariableGroup)
+}
Index: XIOS/trunk/src/object_factory_impl.hpp
===================================================================
--- XIOS/trunk/src/object_factory_impl.hpp	(revision 351)
+++ XIOS/trunk/src/object_factory_impl.hpp	(revision 352)
@@ -1,4 +1,6 @@
 #ifndef __XMLIO_CObjectFactory_impl__
 #define __XMLIO_CObjectFactory_impl__
+
+#include "object_factory.hpp"
 
 namespace xios
Index: XIOS/trunk/src/object_template_decl.cpp
===================================================================
--- XIOS/trunk/src/object_template_decl.cpp	(revision 352)
+++ XIOS/trunk/src/object_template_decl.cpp	(revision 352)
@@ -0,0 +1,29 @@
+#include "object_template_impl.hpp"
+#include "xmlioserver_spl.hpp"
+#include "field.hpp"
+#include "context.hpp"
+#include "file.hpp"
+#include "domain.hpp"
+#include "grid.hpp"
+#include "axis.hpp"
+#include "variable.hpp"
+
+
+namespace xios
+{
+  template class CObjectTemplate<CContext> ;
+  template class CObjectTemplate<CField> ;
+  template class CObjectTemplate<CFile> ;
+  template class CObjectTemplate<CDomain> ;
+  template class CObjectTemplate<CGrid> ;
+  template class CObjectTemplate<CAxis> ;
+  template class CObjectTemplate<CVariable> ;
+  
+  template class CObjectTemplate<CContextGroup> ;
+  template class CObjectTemplate<CFieldGroup> ;
+  template class CObjectTemplate<CFileGroup> ;
+  template class CObjectTemplate<CDomainGroup> ;
+  template class CObjectTemplate<CGridGroup> ;
+  template class CObjectTemplate<CAxisGroup> ;
+  template class CObjectTemplate<CVariableGroup> ;
+  }
Index: XIOS/trunk/src/object_template_impl.hpp
===================================================================
--- XIOS/trunk/src/object_template_impl.hpp	(revision 351)
+++ XIOS/trunk/src/object_template_impl.hpp	(revision 352)
@@ -15,4 +15,6 @@
 #include "message.hpp"
 #include "type.hpp"
+#include "type_util.hpp"
+#include "group_template.hpp"
 
 namespace xios
@@ -314,7 +316,7 @@
      oss<<"#include <boost/shared_ptr.hpp>"<<iendl ;
      oss<<"#include \"xmlioserver.hpp\""<<iendl;
-     oss<<"#include \"attribute_template_impl.hpp\""<<iendl ;
-     oss<<"#include \"object_template_impl.hpp\""<<iendl;
-     oss<<"#include \"group_template_impl.hpp\""<<iendl ;
+     oss<<"#include \"attribute_template.hpp\""<<iendl ;
+     oss<<"#include \"object_template.hpp\""<<iendl;
+     oss<<"#include \"group_template.hpp\""<<iendl ;
      oss<<"#include \"icutil.hpp\""<<iendl ;
      oss<<"#include \"timer.hpp\""<<iendl ;
Index: XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- XIOS/trunk/src/output/nc4_data_output.cpp	(revision 351)
+++ XIOS/trunk/src/output/nc4_data_output.cpp	(revision 352)
@@ -3,6 +3,6 @@
 
 #include <boost/lexical_cast.hpp>
-#include "attribute_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "group_template.hpp"
 
 #include "file.hpp"
Index: XIOS/trunk/src/output/nc4_data_output.hpp
===================================================================
--- XIOS/trunk/src/output/nc4_data_output.hpp	(revision 351)
+++ XIOS/trunk/src/output/nc4_data_output.hpp	(revision 352)
@@ -81,4 +81,5 @@
                                      const StdString & units,
                                      const StdString & nav_model);
+/*
             template <class T>
                void writeAxisData(const StdString & axis_name,
@@ -87,5 +88,5 @@
                                   const std::vector<StdSize> * start = NULL,
                                   const std::vector<StdSize> * count = NULL);
-
+*/
          private :
 
Index: XIOS/trunk/src/output/onetcdf4.cpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4.cpp	(revision 351)
+++ XIOS/trunk/src/output/onetcdf4.cpp	(revision 352)
@@ -1,4 +1,4 @@
 #include "onetcdf4.hpp"
-#include "group_template_impl.hpp"
+#include "group_template.hpp"
 
 namespace xios
Index: XIOS/trunk/src/output/onetcdf4.hpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4.hpp	(revision 351)
+++ XIOS/trunk/src/output/onetcdf4.hpp	(revision 352)
@@ -126,51 +126,5 @@
       ///---------------------------------------------------------------
            
-      template <class T, StdSize ndim>
-         void CONetCDF4::writeData(const ARRAY(T, ndim) 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);
-         if (data->num_elements() != array_size)
-         {
-            ERROR("CONetCDF4::writeData(...)",
-                  << "[ input array size = "  << data->num_elements()
-                  << ", intern array size = " << array_size
-                  << " ] Invalid input data !" );
-         }
-         
-         this->writeData_(grpid, varid, sstart, scount, data->data());
-      }
-      
-      //----------------------------------------------------------------
-           
-      template <class T>
-         void CONetCDF4::setDefaultValue(const StdString & varname, const T * value)
-      {
-         int grpid = this->getCurrentGroup();
-         int varid = this->getVariable(varname);
-         
-         if (value != NULL)
-         {
-            CheckError(nc_def_var_fill(grpid, varid, 0, value));
-            this->addAttribute(StdString("missing_value"), *value, &varname);
-         }
-         else
-            CheckError(nc_def_var_fill(grpid, varid, 1, NULL));         
-      }
-     
-      ///---------------------------------------------------------------
 
 } // namespace xios
Index: XIOS/trunk/src/output/onetcdf4_decl.cpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4_decl.cpp	(revision 352)
+++ XIOS/trunk/src/output/onetcdf4_decl.cpp	(revision 352)
@@ -0,0 +1,17 @@
+#include "onetcdf4_impl.hpp"
+
+namespace xios
+{
+# define  macro(type,size) \
+  template void CONetCDF4::writeData<type,size>(const ARRAY(type, size) data, const StdString & name, \
+                                               bool collective, StdSize record, \
+                                               const std::vector<StdSize> * start, \
+                                               const std::vector<StdSize> * count) ;
+ 
+  macro(double,1)
+  macro(double,2)
+  macro(double,3)                                              
+ 
+  template void CONetCDF4::setDefaultValue<double>(const StdString & varname, const double* value) ;
+  template void CONetCDF4::setDefaultValue<float>(const StdString & varname, const float* value) ;
+}
Index: XIOS/trunk/src/output/onetcdf4_impl.hpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4_impl.hpp	(revision 352)
+++ XIOS/trunk/src/output/onetcdf4_impl.hpp	(revision 352)
@@ -0,0 +1,68 @@
+#ifndef __ONETCDF4_IMPL_HPP__
+#define __ONETCDF4_IMPL_HPP__
+
+#include "onetcdf4.hpp"
+
+namespace xios
+{
+  template <class T, StdSize ndim>
+  void CONetCDF4::writeData(const ARRAY(T, ndim) 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);
+    if (data->num_elements() != array_size)
+    {
+      ERROR("CONetCDF4::writeData(...)",
+      << "[ input array size = "  << data->num_elements()
+      << ", intern array size = " << array_size
+      << " ] Invalid input data !" );
+    }
+         
+    this->writeData_(grpid, varid, sstart, scount, data->data());
+  }
+      
+//----------------------------------------------------------------
+           
+  template <class T>
+  void CONetCDF4::setDefaultValue(const StdString & varname, const T * value)
+  {
+    int grpid = this->getCurrentGroup();
+    int varid = this->getVariable(varname);
+         
+    if (value != NULL)
+    {
+      CheckError(nc_def_var_fill(grpid, varid, 0, value));
+      this->addAttribute(StdString("missing_value"), *value, &varname);
+    }
+    else CheckError(nc_def_var_fill(grpid, varid, 1, NULL));         
+  }
+     
+  ///---------------------------------------------------------------
+
+}
+
+
+
+
+
+
+
+
+
+
+
+
+#endif
Index: XIOS/trunk/src/server.cpp
===================================================================
--- XIOS/trunk/src/server.cpp	(revision 351)
+++ XIOS/trunk/src/server.cpp	(revision 352)
@@ -4,5 +4,5 @@
 #include "type.hpp"
 #include "context.hpp"
-#include "object_template_impl.hpp"
+#include "object_template.hpp"
 #include "oasis_cinterface.hpp"
 #include <boost/functional/hash.hpp>
Index: XIOS/trunk/src/test/test_xios.cpp
===================================================================
--- XIOS/trunk/src/test/test_xios.cpp	(revision 351)
+++ XIOS/trunk/src/test/test_xios.cpp	(revision 352)
@@ -1,4 +1,4 @@
 #include "xmlioserver.hpp"
-#include "attribute_template_impl.hpp"
+#include "attribute_template.hpp"
 #include "buffer_out.hpp"
 #include "buffer_in.hpp"
@@ -10,5 +10,5 @@
 #include "context_client.hpp"
 #include "context_server.hpp"
-#include "object_template_impl.hpp"
+#include "object_template.hpp"
 #include <mpi.h>
 
Index: XIOS/trunk/src/type/type.hpp
===================================================================
--- XIOS/trunk/src/type/type.hpp	(revision 351)
+++ XIOS/trunk/src/type/type.hpp	(revision 352)
@@ -41,8 +41,41 @@
   } ;
 
+  class CMessage ;
+  
+  template <typename T>
+  CBufferOut& operator<<(CBufferOut& buffer, const CType<T>& type) ;
+  
+
+  template <typename T>
+  CBufferOut& operator<<(CBufferOut& buffer, T& type) ;
+  
+  template <typename T>
+  CBufferOut& operator<<(CBufferOut& buffer, const T& type) ;
+  
+  template <typename T>
+  CBufferIn& operator>>(CBufferIn& buffer, const CType<T>& type) ;
+  
+  template <typename T>
+  CBufferIn& operator>>(CBufferIn& buffer, T& type) ;
+  
+
+
+  template <typename T>
+  CMessage& operator<<(CMessage& msg, const CType<T>& type) ;
+  
+  template <typename T>
+  CMessage& operator<<(CMessage& msg,CType<T>& type) ;
+  
+  template <typename T>
+  CMessage& operator<<(CMessage& msg, const T& type) ;
+  
+  template <typename T>
+  CMessage& operator<<(CMessage& msg, T& type) ;
+  
 }
 
-#include "type_impl.hpp"
-#include "type_specialisation.hpp"
+
+//#include "type_impl.hpp"
+//#include "type_specialisation.hpp"
 
 #endif
Index: XIOS/trunk/src/type/type_decl.cpp
===================================================================
--- XIOS/trunk/src/type/type_decl.cpp	(revision 352)
+++ XIOS/trunk/src/type/type_decl.cpp	(revision 352)
@@ -0,0 +1,28 @@
+#include "type_impl.hpp"
+#include "type_specialisation.hpp"
+#include <string> ;
+#include "xmlioserver_spl.hpp"
+
+namespace xios
+{
+#define macro(decl_type)         \
+  template class CType<decl_type> ; \
+  template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType<decl_type>& type) ; \
+  template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, decl_type& type) ; \
+  template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const decl_type& type) ; \
+  template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, const CType<decl_type>& type) ; \
+  template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, decl_type& type) ; \
+  template CMessage& operator<< <decl_type> (CMessage& msg, const CType<decl_type>& type) ;\
+  template CMessage& operator<< <decl_type> (CMessage& msg,CType<decl_type>& type) ; \
+  template CMessage& operator<< <decl_type> (CMessage& msg, const decl_type& type) ; \
+  template CMessage& operator<< <decl_type> (CMessage& msg, decl_type& type) ;
+  
+  macro(string) 
+  macro(int) 
+  macro(double)
+  macro(bool)  
+  macro(StdSize) 
+  macro(ARRAY(double,1)) 
+  macro(ARRAY(int,1)) 
+  macro(ARRAY(bool,2))
+}
Index: XIOS/trunk/src/type/type_impl.hpp
===================================================================
--- XIOS/trunk/src/type/type_impl.hpp	(revision 351)
+++ XIOS/trunk/src/type/type_impl.hpp	(revision 352)
@@ -7,4 +7,5 @@
 #include "buffer_out.hpp"
 #include "message.hpp"
+#include "type.hpp"
 
 
Index: XIOS/trunk/src/type/type_util.hpp
===================================================================
--- XIOS/trunk/src/type/type_util.hpp	(revision 351)
+++ XIOS/trunk/src/type/type_util.hpp	(revision 352)
@@ -16,8 +16,9 @@
     class CFileGroup;
     class CContext;
-
+    class CContextGroup;
+    class CVariable ;
+    class CVariableGroup ;
         
-  template <typename T>
-  inline string getStrType(void) ;
+  template <typename T> inline string getStrType(void) ;
     
 #define macro(T) template <> inline string getStrType<T>(void) { return std::string(#T) ; }
@@ -50,5 +51,9 @@
   macro(CFileGroup)
   macro(CContext)
+  macro(CContextGroup)
+  macro(CVariable)
+  macro(CVariableGroup)
   
+ 
 #undef macro
 
Index: XIOS/trunk/src/xml_parser.cpp
===================================================================
--- XIOS/trunk/src/xml_parser.cpp	(revision 351)
+++ XIOS/trunk/src/xml_parser.cpp	(revision 352)
@@ -3,7 +3,7 @@
 #include "context.hpp"
 
-#include "attribute_template_impl.hpp"
-#include "object_template_impl.hpp"
-#include "group_template_impl.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
 
 namespace xios
Index: XIOS/trunk/src/xml_parser.hpp
===================================================================
--- XIOS/trunk/src/xml_parser.hpp	(revision 351)
+++ XIOS/trunk/src/xml_parser.hpp	(revision 352)
@@ -21,8 +21,8 @@
             static void ParseStream(StdIStream & stream);
             template <class T>
-               static inline void ParseInclude(StdIStream & stream, T & object);
+               static void ParseInclude(StdIStream & stream, T & object);
 
       }; //class CXMLParser
-
+/*
       template <class T>
          void CXMLParser::ParseInclude(StdIStream & stream, T& object)
@@ -45,5 +45,5 @@
          }
       }
-
+*/
    }// namespace xml
 } // namespace xios
Index: XIOS/trunk/src/xml_parser_decl.cpp
===================================================================
--- XIOS/trunk/src/xml_parser_decl.cpp	(revision 352)
+++ XIOS/trunk/src/xml_parser_decl.cpp	(revision 352)
@@ -0,0 +1,28 @@
+#include "xml_parser_impl.hpp"
+#include "group_template.hpp"
+#include "context.hpp"
+#include "axis.hpp"
+#include "domain.hpp"
+#include "field.hpp"
+#include "file.hpp"
+#include "variable.hpp"
+
+
+namespace xios
+{
+  namespace xml
+  {
+    template void CXMLParser::ParseInclude<CContext>(StdIStream & stream, CContext& object) ;
+ 
+ #   define macro(T) \
+    template void CXMLParser::ParseInclude< CGroupTemplate<C##T, C##T##Group, C##T##Attributes> >(StdIStream & stream, CGroupTemplate<C##T, C##T##Group, C##T##Attributes>& object) ;
+    
+    macro( Context ) 
+    macro( Axis ) 
+    macro( Domain ) 
+    macro( Grid ) 
+    macro( Field ) 
+    macro( File ) 
+    macro( Variable ) 
+  }
+}
Index: XIOS/trunk/src/xml_parser_impl.hpp
===================================================================
--- XIOS/trunk/src/xml_parser_impl.hpp	(revision 352)
+++ XIOS/trunk/src/xml_parser_impl.hpp	(revision 352)
@@ -0,0 +1,35 @@
+#ifndef __XMLIO_CXML_PARSER_IMPL__
+#define __XMLIO_CXML_PARSER_IMPL__
+
+/// xios headers ///
+#include "xml_parser.hpp"
+
+namespace xios
+{
+   namespace xml
+   {
+     template <class T> void CXMLParser::ParseInclude(StdIStream & stream, T& object)
+      {
+         StdOStringStream oss;
+         while(!stream.eof() && !stream.fail ())
+            oss.put(stream.get());
+         try
+         {
+            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());
+            object.parse(node);
+         }
+         catch (rapidxml::parse_error & exc)
+         {
+            ERROR("CXMLParser::ParseStream(StdIStream & stream)",
+                  << "RapidXML error : " << exc.what() << " !");
+         }
+      }
+
+   } // namespace xml
+} // namespace xios
+
+#endif // __XMLIO_CXML_PARSER_IMPL__
+
