Index: XIOS/trunk/src/array_impl.cpp
===================================================================
--- XIOS/trunk/src/array_impl.cpp	(revision 368)
+++ 	(revision )
@@ -1,206 +1,0 @@
-#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/array_impl.hpp
===================================================================
--- XIOS/trunk/src/array_impl.hpp	(revision 368)
+++ 	(revision )
@@ -1,179 +1,0 @@
-#ifndef __XMLIO_CArray_impl__
-#define __XMLIO_CArray_impl__
-
-#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())
-   { /* Ne rien faire de plus */ }
-
-   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)
-   { /* 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 << "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 ;
-   }
-   
-
-   ///---------------------------------------------------------------
-   
-} // namespace xios
-
-#endif // __XMLIO_CArray_impl__
Index: XIOS/trunk/src/array_new.hpp
===================================================================
--- XIOS/trunk/src/array_new.hpp	(revision 369)
+++ XIOS/trunk/src/array_new.hpp	(revision 369)
@@ -0,0 +1,224 @@
+#ifndef __XIOS_ARRAY_HPP__
+#define __XIOS_ARRAY_HPP__
+
+#define BZ_COLUMN_MAJOR_ARRAY
+#include <blitz/array.h>
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+#include "message.hpp"
+
+using namespace blitz ;
+namespace xios
+{
+
+    
+template <typename T_numtype,int N_rank>
+class CArray : public Array<T_numtype,N_rank>, public virtual CBaseType
+{
+  public :
+  using Array<T_numtype,N_rank>::operator = ;
+  typedef typename Array<T_numtype,N_rank>::T_default_storage T_default_storage;
+  
+    template<typename T_expr> explicit CArray(_bz_ArrayExpr<T_expr> expr) : Array<T_numtype,N_rank>(expr) {} 
+
+    CArray(GeneralArrayStorage<N_rank> storage=T_default_storage()) : Array<T_numtype,N_rank>(storage) {}
+
+    explicit CArray(int length0,GeneralArrayStorage<N_rank> storage=T_default_storage() ) : Array<T_numtype,N_rank>(length0,storage ) {}
+
+    CArray(int length0, int length1, GeneralArrayStorage<N_rank> storage=T_default_storage() ) : Array<T_numtype,N_rank>(length0, length1, storage ) {}
+
+    CArray(int length0, int length1, int length2, GeneralArrayStorage<N_rank> storage=T_default_storage() ) : Array<T_numtype,N_rank>(length0, length1, length2, storage ) {}
+
+    CArray(int length0, int length1, int length2, int length3, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+           : Array<T_numtype,N_rank>(length0, length1, length2, length3, storage ) {}
+    
+    CArray(int length0, int length1, int length2, int length3, int length4, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+           : Array<T_numtype,N_rank>(length0,length1, length2, length3, length4, storage ) {}
+
+    CArray(int length0, int length1, int length2, int length3, int length4, int length5, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+           : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, storage ) {}
+        
+    CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+           : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, storage ) {}
+
+    CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6, int length7,
+           GeneralArrayStorage<N_rank> storage=T_default_storage() ) : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, storage ) {}
+
+    CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6,
+           int length7, int length8, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+           : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, length8, storage ) {}
+
+    CArray(int length0, int length1, int length2, int length3, int length4,
+           int length5, int length6, int length7, int length8, int length9, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+          : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, length8, length9, storage ) {}
+          
+    CArray(int length0, int length1, int length2, int length3, int length4, int length5, int length6,
+           int length7, int length8, int length9, int length10, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+           : Array<T_numtype,N_rank>(length0, length1, length2, length3, length4, length5, length6, length7, length8,
+                   length9, length10, storage ) {}
+           
+
+    CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+          : Array<T_numtype,N_rank>(dataFirst, shape, storage ) {}
+
+    CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, TinyVector<diffType, N_rank> stride, 
+           GeneralArrayStorage<N_rank> storage=T_default_storage()) : Array<T_numtype,N_rank>(dataFirst, shape, stride, storage ) {}
+
+    CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, preexistingMemoryPolicy deletionPolicy,
+          GeneralArrayStorage<N_rank> storage=T_default_storage()) : Array<T_numtype,N_rank>(dataFirst, shape, deletionPolicy, storage) {}
+
+    CArray(T_numtype* restrict dataFirst, TinyVector<int, N_rank> shape, TinyVector<diffType, N_rank> stride,
+           preexistingMemoryPolicy deletionPolicy, GeneralArrayStorage<N_rank> storage=T_default_storage())
+          : Array<T_numtype,N_rank>(dataFirst, shape, stride, deletionPolicy, storage) {}
+
+    CArray(const TinyVector<int, N_rank>& extent, GeneralArrayStorage<N_rank> storage=T_default_storage())
+          : Array<T_numtype,N_rank>(extent, storage) {}
+
+    CArray(const TinyVector<int, N_rank>& lbounds, const TinyVector<int, N_rank>& extent,
+           const GeneralArrayStorage<N_rank>& storage ) : Array<T_numtype,N_rank>(lbounds, extent, storage ) {} 
+
+    CArray(Range r0, GeneralArrayStorage<N_rank> storage=T_default_storage() ) : CArray(r0, storage ) {}
+
+    CArray(Range r0, Range r1, GeneralArrayStorage<N_rank> storage=T_default_storage() ) : Array<T_numtype,N_rank>(r0, r1, storage ) {}
+
+    CArray(Range r0, Range r1, Range r2, GeneralArrayStorage<N_rank> storage=T_default_storage() ) 
+           : Array<T_numtype,N_rank>(r0, r1, r2, storage ) {}
+
+    CArray(Range r0, Range r1, Range r2, Range r3, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+          : Array<T_numtype,N_rank>(r0, r1, r2, r3, storage ) {}
+
+    CArray(Range r0, Range r1, Range r2, Range r3, Range r4, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+          : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, storage ) {}
+
+    CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+          : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, storage ) {}
+
+    CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6,
+           GeneralArrayStorage<N_rank> storage=T_default_storage() ) : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, storage ) {}
+
+    CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, Range r7,
+           GeneralArrayStorage<N_rank> storage=T_default_storage() ) : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, storage ) {}
+
+    CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5,
+           Range r6, Range r7, Range r8, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+          : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, r8, storage ) {}
+
+    CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5,
+           Range r6, Range r7, Range r8, Range r9, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+          : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, storage ) {}
+
+    CArray(Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6, Range r7,
+           Range r8, Range r9, Range r10, GeneralArrayStorage<N_rank> storage=T_default_storage() )
+          : Array<T_numtype,N_rank>(r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, storage ) {} 
+
+    CArray(const Array<T_numtype, N_rank>& array) : Array<T_numtype,N_rank>(array) {}
+
+    CArray(const TinyVector<int,N_rank-1>& shape, int lastExtent, const GeneralArrayStorage<N_rank>& storage)
+          : Array<T_numtype,N_rank>(shape, lastExtent, storage) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0) : Array<T_numtype,N_rank>(array, r0) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1) : Array<T_numtype,N_rank>(array, r0, r1) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2) : Array<T_numtype,N_rank>( array, r0, r1, r2) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3) : Array<T_numtype,N_rank>(array, r0, r1, r2, r3) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2,
+           Range r3, Range r4) : Array<T_numtype,N_rank>(array, r0, r1, r2, r3,  r4) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2,
+           Range r3, Range r4, Range r5) : Array<T_numtype,N_rank>( array, r0, r1, r2, r3, r4, r5) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, 
+           Range r4, Range r5, Range r6) : Array<T_numtype,N_rank>( array, r0, r1, r2, r3, r4, r5, r6) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4,
+           Range r5, Range r6, Range r7) : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, Range r5,
+           Range r6, Range r7, Range r8) : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7, r8) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, Range r5,
+           Range r6, Range r7, Range r8, Range r9) : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9) {}
+
+    CArray(Array<T_numtype, N_rank>& array, Range r0, Range r1, Range r2, Range r3, Range r4, Range r5, Range r6,
+           Range r7, Range r8, Range r9, Range r10) : Array<T_numtype,N_rank>(array, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10) {}
+
+    CArray(Array<T_numtype, N_rank>& array, const RectDomain<N_rank>& subdomain) : Array<T_numtype,N_rank>(array, subdomain) {}
+
+    CArray(Array<T_numtype, N_rank>& array, const StridedDomain<N_rank>& subdomain) : Array<T_numtype,N_rank>(array, subdomain) {} 
+
+    template<int N_rank2, typename R0, typename R1, typename R2, typename R3, typename R4, typename R5,
+                          typename R6, typename R7, typename R8, typename R9, typename R10>
+    CArray(Array<T_numtype,N_rank2>& array, R0 r0, R1 r1, R2 r2, R3 r3, R4 r4, R5 r5, R6 r6, R7 r7, R8 r8, R9 r9, R10 r10)
+          : Array<T_numtype,N_rank>(array, r0,r1, r2, r3, r4, r5, r6, r7, r8, r9, r10) {}
+
+    virtual ~CArray() {}
+    virtual void fromString(const string& str) { istringstream iss(str) ;  iss>>*this ; }
+    virtual string toString(void) const { ostringstream oss ; oss<<*this ; return oss.str() ; }
+    virtual void reset(void) { this->free(); }
+    virtual bool isEmpty(void) const { if (this->numElements()==0) return true; else return false; }
+    virtual size_t size(void) const { return (this->dimensions()+1)*sizeof(int)+sizeof(size_t) + this->numElements()*sizeof(T_numtype) ;}
+ 
+    virtual CArray* clone(void) const { return new CArray(*this); }
+       
+    virtual bool toBuffer(CBufferOut& buffer) const
+    {
+      bool ret ;
+      ret=buffer.put(this->dimensions()) ;
+      ret&=buffer.put(this->shape().data(),this->dimensions()) ;
+      ret&=buffer.put(this->numElements()) ;
+      ret&=buffer.put(this->dataFirst(),this->numElements()) ;
+      return ret ;
+    }
+    
+   
+   virtual bool fromBuffer(CBufferIn& buffer)
+   {
+
+    bool ret ;
+    int numDim ;
+    TinyVector<int,N_rank> vect;
+    size_t ne;
+      
+    ret=buffer.get(numDim) ;
+    ret&=buffer.get(vect.data(),N_rank) ;
+    resize(vect) ;
+    ret&=buffer.get(ne) ;
+    ret&=buffer.get(this->dataFirst(),ne) ;
+     return ret ;
+  }
+
+} ;
+ 
+  template <typename T_numtype,int N_rank> inline CBufferOut& operator<<(CBufferOut& buffer, const CArray<T_numtype,N_rank>& array)
+  {
+    if (!array.toBuffer(buffer)) ERROR(" template <typename T_numtype,int N_rank> inline CBufferOut& operator<<(CBufferOut& buffer, const CArray& array)",
+                                        << "Buffer remain size is to low for size type") ;
+    return buffer ;
+  }
+
+  template <typename T_numtype,int N_rank> inline CBufferIn& operator>>(CBufferIn& buffer, CArray<T_numtype, N_rank>& array)
+  {
+    if (!array.fromBuffer(buffer)) ERROR("template <typename T_numtype,int N_rank> inline CBufferIn& operator>>(CBufferIn& buffer, CArray& array)",
+                                        <<"Buffer remain size is to low for size type");
+    return buffer ;
+  }
+ 
+  template <typename T_numtype,int N_rank> inline CMessage& operator<<(CMessage& msg, const CArray<T_numtype, N_rank>& array)
+  {
+    msg.push(*array.clone()) ;
+    return msg ;
+  }
+
+  template <typename T_numtype,int N_rank> inline CMessage& operator<<(CMessage& msg, CArray<T_numtype, N_rank>& array)
+  {
+    msg.push(*array.clone()) ;
+    return msg ;
+  }
+
+ 
+}
+
+#endif
Index: XIOS/trunk/src/attribute.cpp
===================================================================
--- XIOS/trunk/src/attribute.cpp	(revision 368)
+++ XIOS/trunk/src/attribute.cpp	(revision 369)
@@ -7,18 +7,18 @@
       CAttribute::CAttribute(const StdString & id)
          : CObject(id), CBaseType()
-         , value()
+//         , value()
       { /* Ne rien faire de plus */ }
-
+/*
       CAttribute::CAttribute(const CAttribute & attribut)
          : CObject(attribut.getId()),CBaseType()
       { 
-         this->value = attribut.getAnyValue(); 
+ //        this->value = attribut.getAnyValue(); 
       }
-      
+*/      
       CAttribute::~CAttribute(void)
       { /* Ne rien faire de plus */ }
       
       ///--------------------------------------------------------------
-
+/*
       const boost::any & CAttribute::getAnyValue(void) const
       { 
@@ -43,5 +43,5 @@
          return (this->value.empty()); 
       }
-
+*/
       const StdString & CAttribute::getName(void) const
       { 
@@ -52,5 +52,5 @@
       ///--------------------------------------------------------------
 
-      
+
       CMessage& operator<<(CMessage& msg,CAttribute& type)
       {
@@ -61,5 +61,5 @@
      CMessage& operator<<(CMessage& msg, const CAttribute&  type)
      {
-       msg.push(*type.duplicate()) ;
+//       msg.push(*type.clone()) ;
        return msg ;
      }
Index: XIOS/trunk/src/attribute.hpp
===================================================================
--- XIOS/trunk/src/attribute.hpp	(revision 368)
+++ XIOS/trunk/src/attribute.hpp	(revision 369)
@@ -16,5 +16,5 @@
 {
       /// ////////////////////// DÃ©clarations ////////////////////// ///
-      class CAttribute : public CObject, public CBaseType
+      class CAttribute : public CObject, public virtual CBaseType
       {
             typedef CObject SuperClass;
@@ -24,22 +24,22 @@
             /// Constructeurs ///
             explicit CAttribute(const StdString & id);
-            CAttribute(const CAttribute & attribut);
-            CAttribute(const CAttribute * const attribut); // Not implemented.
+//            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;
-            template <typename T> inline T* getRef(void);
+//            const boost::any & getAnyValue(void) const;
+//            template <typename T> inline T getValue(void) const;
+//            template <typename T> inline T* getRef(void);
 
-            /// Mutateurs ///
-            template <typename T> inline void setValue(const T & value);
-            void setAnyValue(const boost::any & value);
-            void clear(void);
+//            /// Mutateurs ///
+//            template <typename T> inline void setValue(const T & value);
+//            void setAnyValue(const boost::any & value);
+//            void clear(void);
 
             /// Test ///
-            bool isEmpty(void) const;
-            template <typename T> inline bool isType(void) const;
-
+//            bool isEmpty(void) const;
+//            template <typename T> inline bool isType(void) const;
+            virtual void set(const CAttribute& ) =0 ;
             /// Destructeur ///
             virtual ~CAttribute(void);
@@ -49,6 +49,7 @@
             virtual void fromString(const StdString & str) = 0;
 
-            virtual void toBinary  (StdOStream & os) const = 0;
-            virtual void fromBinary(StdIStream & is) = 0;
+//            virtual void toBinary  (StdOStream & os) const = 0;
+//            virtual void fromBinary(StdIStream & is) = 0;
+
             virtual void generateCInterface(ostream& oss, const string& className) = 0 ;
             virtual void generateFortran2003Interface(ostream& oss, const string& className) = 0 ;
@@ -65,12 +66,13 @@
 
             /// Constructeurs ///
-            CAttribute(void);  // Not implemented.
+//            CAttribute(void);  // Not implemented.
 
             /// PropriÃ©tÃ© ///
-            boost::any value;
+//            boost::any value;
 
       }; // class CAttribute
 
       /// ////////////////////// DÃ©finitions ////////////////////// ///
+/*
       template <typename T>
          T CAttribute::getValue(void) const
@@ -96,5 +98,5 @@
          return (this->value.type() == typeid(T)); 
       }
-
+*/
  
    CMessage& operator<<(CMessage& msg,CAttribute& type) ;
@@ -103,4 +105,5 @@
    CBufferOut& operator<<(CBufferOut& buffer,CAttribute& type) ;
    CBufferIn& operator>>(CBufferIn& buffer, CAttribute&  type) ;
+
 }
   // namespace xios
Index: XIOS/trunk/src/attribute_array.hpp
===================================================================
--- XIOS/trunk/src/attribute_array.hpp	(revision 369)
+++ XIOS/trunk/src/attribute_array.hpp	(revision 369)
@@ -0,0 +1,71 @@
+#ifndef __XIOS_ATTRIBUTE_ARRAY__
+#define __XIOS_ATTRIBUTE_ARRAY__
+
+/// xios headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "attribute.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+#include "array_new.hpp"
+
+
+namespace xios
+{
+      /// ////////////////////// DÃ©clarations ////////////////////// ///
+      template <typename T_numtype, int N_rank>
+         class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank>
+      {
+        public :
+
+           using CArray<T_numtype,N_rank>::operator = ;
+           using Array<T_numtype,N_rank>::operator = ;
+           
+            /// Constructeurs ///
+            explicit CAttributeArray(const StdString & id);
+            CAttributeArray(const StdString & id, xios_map<StdString, CAttribute*> & umap);
+            CAttributeArray(const StdString & id, const CArray<T_numtype, N_rank>& value);
+            CAttributeArray(const StdString & id, const CArray<T_numtype, N_rank>& value, 
+                           xios_map<StdString, CAttribute*> & umap);
+
+            /// Accesseur ///
+            CArray<T_numtype, N_rank> getValue(void) const;
+
+            /// Mutateurs ///
+            void setValue(const CArray<T_numtype, N_rank>& value);
+            void set(const CAttribute& attr) ;
+            void set(const CAttributeArray& attr) ;
+            
+            /// Destructeur ///
+            virtual ~CAttributeArray(void) { }
+
+
+            /// Autre ///
+            virtual string toString(void) const { return _toString();}
+            virtual void fromString(const StdString & str) { _fromString(str);}
+            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);} 
+            virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } 
+            
+            virtual void generateCInterface(ostream& oss,const string& className) ;
+            virtual void generateFortran2003Interface(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceDeclaration_(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceBody_(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceDeclaration(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ;
+
+      
+         protected :
+
+            /// Constructeurs ///
+
+         private :
+          StdString _toString(void) const;
+          void _fromString(const StdString & str);
+          bool _toBuffer  (CBufferOut& buffer) const;
+          bool _fromBuffer(CBufferIn& buffer) ;
+      }; // class CAttributeEnum    
+} // namespace xios
+
+#endif // __XIOS_ATTRIBUTE_ARRAY__
Index: XIOS/trunk/src/attribute_array_decl.cpp
===================================================================
--- XIOS/trunk/src/attribute_array_decl.cpp	(revision 369)
+++ XIOS/trunk/src/attribute_array_decl.cpp	(revision 369)
@@ -0,0 +1,10 @@
+#include "attribute_array_impl.hpp"
+
+
+
+namespace xios
+{
+  template class CAttributeArray<double,1> ;
+  template class CAttributeArray<int,1> ;
+  template class CAttributeArray<bool,2> ;
+}
Index: XIOS/trunk/src/attribute_array_impl.hpp
===================================================================
--- XIOS/trunk/src/attribute_array_impl.hpp	(revision 369)
+++ XIOS/trunk/src/attribute_array_impl.hpp	(revision 369)
@@ -0,0 +1,143 @@
+#ifndef __XIOS_ATTRIBUTE_ARRAY_IMPL_HPP__
+#define __XIOS_ATTRIBUTE_ARRAY_IMPL_HPP__
+
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+#include "generate_interface.hpp"
+#include "attribute_array.hpp"
+
+  
+namespace xios
+{
+      /// ////////////////////// DÃ©finitions ////////////////////// ///
+      template <typename T_numtype, int N_rank>
+      CAttributeArray<T_numtype, N_rank>::CAttributeArray(const StdString & id)
+         : CAttribute(id)
+      { /* Ne rien faire de plus */ }
+
+      template <typename T_numtype, int N_rank>
+      CAttributeArray<T_numtype,N_rank>::CAttributeArray(const StdString & id, const CArray<T_numtype,N_rank>& value)
+         : CAttribute(id)
+      {
+         this->setValue(value);
+      }
+
+      template <typename T_numtype, int N_rank>
+      CAttributeArray<T_numtype, N_rank>::CAttributeArray(const StdString & id, xios_map<StdString, CAttribute*> & umap)
+         : CAttribute(id)
+      {
+         umap.insert(umap.end(), std::make_pair(id, this));
+      }
+
+      template <typename T_numtype, int N_rank>
+      CAttributeArray<T_numtype, N_rank>::CAttributeArray (const StdString & id, const CArray<T_numtype,N_rank>& value,
+                                                           xios_map<StdString, CAttribute*> & umap)
+         : CAttribute(id)
+      {
+         this->setValue(value);
+         umap.insert(umap.end(), std::make_pair(id, this));
+      }
+
+      ///--------------------------------------------------------------
+
+      template <typename T_numtype, int N_rank>
+      CArray<T_numtype,N_rank> CAttributeArray<T_numtype, N_rank>::getValue(void) const
+      {
+        return this->copy() ;
+      }
+
+      template <typename T_numtype, int N_rank>
+      void CAttributeArray<T_numtype,N_rank>::setValue(const CArray<T_numtype,N_rank>& value)
+      {
+        this->resize(value.shape()) ;
+        *this=value ;
+      }
+
+    template <typename T_numtype, int N_rank>
+    void CAttributeArray<T_numtype,N_rank>::set(const CAttribute& attr)
+    {
+      this->set(dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr)) ;
+    } 
+
+    template <typename T_numtype, int N_rank>
+    void CAttributeArray<T_numtype,N_rank>::set(const CAttributeArray& attr)
+    {
+      this->setValue(attr) ;
+    } 
+
+    template <typename T_numtype, int N_rank>
+    StdString CAttributeArray<T_numtype,N_rank>::_toString(void) const
+    {
+      StdOStringStream oss;
+      if (! isEmpty() && this->hasId()) oss << this->getName() << "=\"" << CArray<T_numtype, N_rank>::toString() << "\"";
+      return (oss.str());
+    }
+
+      template <typename T_numtype, int N_rank>
+         void CAttributeArray<T_numtype, N_rank>::_fromString(const StdString & str)
+      {
+        CArray<T_numtype, N_rank>::fromString(str) ;
+      }
+
+      template <typename T_numtype, int N_rank>
+      bool CAttributeArray<T_numtype, N_rank>::_toBuffer (CBufferOut& buffer) const
+      {
+         return CArray<T_numtype, N_rank>::toBuffer(buffer) ;
+      }
+
+      template <typename T_numtype, int N_rank>
+      bool CAttributeArray<T_numtype, N_rank>::_fromBuffer(CBufferIn& buffer)
+      {
+        return CArray<T_numtype, N_rank>::fromBuffer(buffer) ;
+      }
+
+      template <typename T_numtype, int N_rank>
+      void CAttributeArray<T_numtype, N_rank>::generateCInterface(ostream& oss,const string& className)
+      {
+        CInterface::AttributeCInterface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ;
+      }
+      
+      template <typename T_numtype, int N_rank>
+      void CAttributeArray<T_numtype, N_rank>::generateFortran2003Interface(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortran2003Interface<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ;
+      }
+      
+      template <typename T_numtype, int N_rank>
+      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceDeclaration_(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ;
+      }
+ 
+      template <typename T_numtype, int N_rank>
+      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceBody_(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ;
+      }
+
+      template <typename T_numtype, int N_rank>
+      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceDeclaration(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ;
+      }
+      
+      template <typename T_numtype, int N_rank>
+      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()+"_") ;
+      }
+ 
+      template <typename T_numtype, int N_rank>
+      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetBody_(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceGetBody<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ;
+      }
+
+      template <typename T_numtype, int N_rank>
+      void CAttributeArray<T_numtype, N_rank>::generateFortranInterfaceGetDeclaration(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T_numtype, N_rank> >(oss, className, this->getName()) ;
+      }
+} // namespace xios
+
+#endif // __XIOS_ATTRIBUTE_ENUM_IMPL_HPP__
Index: XIOS/trunk/src/attribute_enum.hpp
===================================================================
--- XIOS/trunk/src/attribute_enum.hpp	(revision 369)
+++ XIOS/trunk/src/attribute_enum.hpp	(revision 369)
@@ -0,0 +1,78 @@
+#ifndef __XIOS_ATTRIBUTE_ENUM__
+#define __XIOS_ATTRIBUTE_ENUM__
+
+/// xios headers ///
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "attribute.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+#include "type.hpp"
+#include "enum.hpp"
+
+
+namespace xios
+{
+      /// ////////////////////// Déclarations ////////////////////// ///
+      template <class T>
+         class CAttributeEnum : public CAttribute, public CEnum<T>
+      {
+        typedef typename T::t_enum T_enum ;
+        public :
+
+            /// Constructeurs ///
+            explicit CAttributeEnum(const StdString & id);
+            CAttributeEnum(const StdString & id,
+                               xios_map<StdString, CAttribute*> & umap);
+            CAttributeEnum(const StdString & id, const T_enum & value);
+            CAttributeEnum(const StdString & id, const T_enum & value,
+                               xios_map<StdString, CAttribute*> & umap);
+
+            /// Accesseur ///
+            T_enum getValue(void) const;
+            string getStringValue(void) const;
+
+
+            /// Mutateurs ///
+            void setValue(const T_enum & value);
+            
+            void set(const CAttribute& attr) ;
+            void set(const CAttributeEnum& attr) ;
+            
+            /// Destructeur ///
+            virtual ~CAttributeEnum(void) { }
+
+            /// Operateur ///
+            CAttributeEnum& operator=(const T_enum & value);
+
+            /// Autre ///
+            virtual StdString toString(void) const { return _toString();}
+            virtual void fromString(const StdString & str) { _fromString(str);}
+
+            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);} 
+            virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } 
+            
+            virtual void generateCInterface(ostream& oss,const string& className) ;
+            virtual void generateFortran2003Interface(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceDeclaration_(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceBody_(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceDeclaration(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceGetBody_(ostream& oss,const string& className) ;
+            virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ;
+
+      
+         protected :
+
+            /// Constructeurs ///
+//            CAttributeTemplate(void); // Not implemented.
+         private :
+          StdString _toString(void) const;
+          void _fromString(const StdString & str);
+          bool _toBuffer  (CBufferOut& buffer) const;
+          bool _fromBuffer(CBufferIn& buffer) ;
+      }; // class CAttributeEnum    
+   
+} // namespace xios
+
+#endif // __XIOS_ATTRIBUTE_ENUM__
Index: XIOS/trunk/src/attribute_enum_impl.hpp
===================================================================
--- XIOS/trunk/src/attribute_enum_impl.hpp	(revision 369)
+++ XIOS/trunk/src/attribute_enum_impl.hpp	(revision 369)
@@ -0,0 +1,166 @@
+#ifndef __XIOS_ATTRIBUTE_ENUM_IMPL_HPP__
+#define __XIOS_ATTRIBUTE_ENUM_IMPL_HPP__
+
+#include "enum.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+#include "generate_interface.hpp"
+#include "attribute_enum.hpp"
+
+  
+namespace xios
+{
+
+      /// ////////////////////// Définitions ////////////////////// ///
+      template <class T>
+         CAttributeEnum<T>::CAttributeEnum(const StdString & id)
+         : CAttribute(id)
+      { /* Ne rien faire de plus */ }
+
+      template <class T>
+         CAttributeEnum<T>::CAttributeEnum(const StdString & id, const T_enum & value)
+         : CAttribute(id)
+      {
+         this->setValue(value);
+      }
+
+      template <class T>
+      CAttributeEnum<T>::CAttributeEnum(const StdString & id,
+                              xios_map<StdString, CAttribute*> & umap)
+         : CAttribute(id)
+      {
+         umap.insert(umap.end(), std::make_pair(id, this));
+      }
+
+      template <class T>
+         CAttributeEnum<T>::CAttributeEnum
+            (const StdString & id, const T_enum & value,
+             xios_map<StdString, CAttribute*> & umap)
+         : CAttribute(id)
+      {
+         this->setValue(value);
+         umap.insert(umap.end(), std::make_pair(id, this));
+      }
+
+      ///--------------------------------------------------------------
+
+      template <class T>
+      typename T::t_enum CAttributeEnum<T>::getValue(void) const
+      {
+         return CEnum<T>::get() ;
+      }
+
+      template <class T>
+         string CAttributeEnum<T>::getStringValue(void) const
+      {
+         return CEnum<T>::toString() ;
+      }
+
+      template <class T>
+         void CAttributeEnum<T>::setValue(const typename T::t_enum & value)
+      {
+         CEnum<T>::set(value) ;
+      }
+
+    template <class T>
+    void CAttributeEnum<T>::set(const CAttribute& attr)
+    {
+      this->set(dynamic_cast<const CAttributeEnum<T>& >(attr)) ;
+    } 
+
+   template <class T>
+    void CAttributeEnum<T>::set(const CAttributeEnum& attr)
+    {
+      CEnum<T>::set(attr) ;
+    } 
+
+      //---------------------------------------------------------------
+
+      template <class T>
+      CAttributeEnum<T>& CAttributeEnum<T>::operator=(const T_enum & value)
+      {
+         cout<<"CAttributeEnum<T>& CAttributeEnum<T>::operator=(const T_enum & value)"<<endl ;
+         this->setValue(value);
+         return *this;
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         StdString CAttributeEnum<T>::_toString(void) const
+      {
+         StdOStringStream oss;
+         if (!CEnum<T>::isEmpty() && this->hasId())
+            oss << this->getName() << "=\"" << CEnum<T>::toString() << "\"";
+         return (oss.str());
+      }
+
+      template <class T>
+         void CAttributeEnum<T>::_fromString(const StdString & str)
+      {
+        CEnum<T>::fromString(str) ;
+      }
+
+      template <class T>
+      bool CAttributeEnum<T>::_toBuffer (CBufferOut& buffer) const
+      {
+         return CEnum<T>::toBuffer(buffer) ;
+      }
+
+      template <class T>
+      bool CAttributeEnum<T>::_fromBuffer(CBufferIn& buffer)
+      {
+        return CEnum<T>::fromBuffer(buffer) ;
+      }
+
+      template <typename T>
+      void CAttributeEnum<T>::generateCInterface(ostream& oss,const string& className)
+      {
+        CInterface::AttributeCInterface<CEnumBase>(oss, className, this->getName()) ;
+      }
+      
+      template <typename T>
+      void CAttributeEnum<T>::generateFortran2003Interface(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortran2003Interface<string>(oss, className, this->getName()) ;
+      }
+      
+      template <typename T>
+      void CAttributeEnum<T>::generateFortranInterfaceDeclaration_(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceDeclaration<string>(oss, className, this->getName()+"_") ;
+      }
+ 
+      template <typename T>
+      void CAttributeEnum<T>::generateFortranInterfaceBody_(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceBody<string>(oss, className, this->getName()) ;
+      }
+
+      template <typename T>
+      void CAttributeEnum<T>::generateFortranInterfaceDeclaration(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceDeclaration<string>(oss, className, this->getName()) ;
+      }
+      
+      template <typename T>
+      void CAttributeEnum<T>::generateFortranInterfaceGetDeclaration_(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceGetDeclaration<string>(oss, className, this->getName()+"_") ;
+      }
+ 
+      template <typename T>
+      void CAttributeEnum<T>::generateFortranInterfaceGetBody_(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceGetBody<string>(oss, className, this->getName()) ;
+      }
+
+      template <typename T>
+      void CAttributeEnum<T>::generateFortranInterfaceGetDeclaration(ostream& oss,const string& className)
+      {
+        CInterface::AttributeFortranInterfaceGetDeclaration<string>(oss, className, this->getName()) ;
+      }
+ 
+} // namespace xios
+
+#endif // __XIOS_ATTRIBUTE_ENUM_IMPL_HPP__
Index: XIOS/trunk/src/attribute_map.cpp
===================================================================
--- XIOS/trunk/src/attribute_map.cpp	(revision 368)
+++ XIOS/trunk/src/attribute_map.cpp	(revision 369)
@@ -23,6 +23,5 @@
          {
             const StdStrAttPair & att = *it;
-            if (!att.second->isEmpty())
-               att.second->clear();
+            att.second->reset();
          }
       }
@@ -45,5 +44,6 @@
             ERROR("CAttributeMap::setAttribute(key, attr)",
                    << "[ key = " << key << "] attr is null !");
-         this->find(key)->second->setAnyValue(attr->getAnyValue());
+         this->find(key)->second->set(*attr) ;
+//         this->find(key)->second->setAnyValue(attr->getAnyValue());
       }
       
@@ -127,5 +127,5 @@
       
       //---------------------------------------------------------------
-      
+/*      
       void CAttributeMap::toBinary(StdOStream & os) const
       {
@@ -184,5 +184,5 @@
          }
       }
-      
+ */     
       void CAttributeMap::generateCInterface(ostream& oss, const string& className)
       {
@@ -204,5 +204,5 @@
          }
       }      
-      
+ 
       ///--------------------------------------------------------------
 
Index: XIOS/trunk/src/attribute_map.hpp
===================================================================
--- XIOS/trunk/src/attribute_map.hpp	(revision 368)
+++ XIOS/trunk/src/attribute_map.hpp	(revision 369)
@@ -44,6 +44,6 @@
             virtual void fromString(const StdString & str);
             
-            virtual void toBinary  (StdOStream & os) const;
-            virtual void fromBinary(StdIStream & is);
+//            virtual void toBinary  (StdOStream & os) const;
+//            virtual void fromBinary(StdIStream & is);
             virtual void generateCInterface(ostream& oss, const string& className) ;
             virtual void generateFortran2003Interface(ostream& oss, const string& className) ;
Index: XIOS/trunk/src/attribute_template.hpp
===================================================================
--- XIOS/trunk/src/attribute_template.hpp	(revision 368)
+++ XIOS/trunk/src/attribute_template.hpp	(revision 369)
@@ -8,8 +8,8 @@
 #include "xmlioserver_spl.hpp"
 #include "exception.hpp"
-#include "array.hpp"
 #include "attribute.hpp"
 #include "buffer_in.hpp"
 #include "buffer_out.hpp"
+#include "type.hpp"
 
 
@@ -18,5 +18,5 @@
       /// ////////////////////// DÃ©clarations ////////////////////// ///
       template <class T>
-         class CAttributeTemplate : public CAttribute
+         class CAttributeTemplate : public CAttribute, public CType<T>
       {
             typedef CAttribute SuperClass;
@@ -34,6 +34,6 @@
             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.
+//            CAttributeTemplate(const CAttribute & attribut) throw (CException);
+//            CAttributeTemplate(const CAttribute * const attribut); // Not implemented.
 
           public :
@@ -41,25 +41,28 @@
             /// Accesseur ///
             ValueType getValue(void) const;
-            ValueType* getRef(void) ;
+//            ValueType* getRef(void) ;
 
             /// Mutateurs ///
             void setValue(const ValueType & value);
-
+            
+            void set(const CAttribute& attr) ;
+            void set(const CAttributeTemplate& attr) ;
+            
             /// Destructeur ///
-            virtual ~CAttributeTemplate(void);
+            virtual ~CAttributeTemplate(void) { }
 
             /// Operateur ///
-            ValueType operator=(const ValueType & value);
+            CAttributeTemplate& operator=(const ValueType & value);
 
             /// Autre ///
-            virtual StdString toString(void) const;
-            virtual void fromString(const StdString & str);
+            virtual StdString toString(void) const { return _toString();}
+            virtual void fromString(const StdString & str) { _fromString(str);}
+//            virtual CAttributeTemplate* clone() const {}
+//            virtual void toBinary  (StdOStream & os) const;
+//            virtual void fromBinary(StdIStream & is);            
 
-            virtual void toBinary  (StdOStream & os) const;
-            virtual void fromBinary(StdIStream & is);            
-
-            virtual bool toBuffer  (CBufferOut& buffer) const;
-            virtual bool fromBuffer(CBufferIn& buffer) ;
-            virtual size_t size(void) const;
+            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);} 
+            virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } 
+//            virtual size_t size(void) const;
             virtual void generateCInterface(ostream& oss,const string& className) ;
             virtual void generateFortran2003Interface(ostream& oss,const string& className) ;
@@ -75,6 +78,10 @@
 
             /// Constructeurs ///
-            CAttributeTemplate(void); // Not implemented.
-
+//            CAttributeTemplate(void); // Not implemented.
+         private :
+          StdString _toString(void) const;
+          void _fromString(const StdString & str);
+          bool _toBuffer  (CBufferOut& buffer) const;
+          bool _fromBuffer(CBufferIn& buffer) ;
       }; // class CAttribute    
       
Index: XIOS/trunk/src/attribute_template_decl.cpp
===================================================================
--- XIOS/trunk/src/attribute_template_decl.cpp	(revision 368)
+++ XIOS/trunk/src/attribute_template_decl.cpp	(revision 369)
@@ -9,5 +9,3 @@
   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 368)
+++ XIOS/trunk/src/attribute_template_impl.hpp	(revision 369)
@@ -2,5 +2,4 @@
 #define __XMLIO_CAttributeTemplate_impl__
 
-#include "array.hpp"
 #include "type.hpp"
 #include "buffer_in.hpp"
@@ -25,5 +24,5 @@
          this->setValue(value);
       }
-
+/*
       template <class T>
          CAttributeTemplate<T>::CAttributeTemplate(const CAttribute & attribut)
@@ -34,5 +33,5 @@
             ERROR("CAttributeTemplate", << "Invalid instantiation !");
       }
-
+*/
       template <class T>
          CAttributeTemplate<T>::CAttributeTemplate(const StdString & id,
@@ -52,11 +51,12 @@
          umap.insert(umap.end(), std::make_pair(id, this));
       }
-
-      template <class T>
-         CAttributeTemplate<T>::~CAttributeTemplate(void)
+/*
+      template <class T>
+      CAttributeTemplate<T>::~CAttributeTemplate(void)
       { 
-         this->clear();
-      }
-
+//         this->CType<T>::reset() ;
+//         this->clear();
+      }
+*/
       ///--------------------------------------------------------------
 
@@ -64,4 +64,6 @@
          T CAttributeTemplate<T>::getValue(void) const
       {
+         return CType<T>::get() ;
+/*
          if (SuperClass::isEmpty())
          {
@@ -71,6 +73,8 @@
           }
          return (SuperClass::getValue<T>());
-      }
-
+*/
+      }
+
+/*
       template <class T>
          T* CAttributeTemplate<T>::getRef(void)
@@ -84,40 +88,54 @@
          return (SuperClass::getRef<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)
+         CType<T>::set(value) ;
+//         SuperClass::setValue<T>(value);
+      }
+
+    template <class T>
+    void CAttributeTemplate<T>::set(const CAttribute& attr)
+    {
+      this->set(dynamic_cast<const CAttributeTemplate<T>& >(attr)) ;
+    } 
+
+   template <class T>
+    void CAttributeTemplate<T>::set(const CAttributeTemplate& attr)
+    {
+      CType<T>::set(attr) ;
+    } 
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         CAttributeTemplate<T>& CAttributeTemplate<T>::operator=(const T & value)
       {
          this->setValue(value);
-         return (this->getValue());
-      }
-
-      //---------------------------------------------------------------
-
-      template <class T>
-         StdString CAttributeTemplate<T>::toString(void) const
+//         return (this->getValue());
+         return *this;
+      }
+
+      //---------------------------------------------------------------
+
+      template <class T>
+         StdString CAttributeTemplate<T>::_toString(void) const
       {
          StdOStringStream oss;
-         if (!this->isEmpty() && this->hasId())
-            oss << this->getName() << "=\"" << this->getValue() << "\"";
+         if (!CType<T>::isEmpty() && this->hasId())
+            oss << this->getName() << "=\"" << CType<T>::toString() << "\"";
          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 !");
-      }
-
-      //---------------------------------------------------------------
-
+         void CAttributeTemplate<T>::_fromString(const StdString & str)
+      {
+        CType<T>::fromString(str) ;
+      }
+
+      //---------------------------------------------------------------
+/*
       template <class T>
          void CAttributeTemplate<T>::toBinary (StdOStream & os) const
@@ -133,8 +151,10 @@
          this->setValue(value);
       }
-
-      template <class T>
-         bool CAttributeTemplate<T>::toBuffer (CBufferOut& buffer) const
-      {
+*/
+      template <class T>
+         bool CAttributeTemplate<T>::_toBuffer (CBufferOut& buffer) const
+      {
+         return CType<T>::toBuffer(buffer) ;
+/*         
          if (isEmpty()) return buffer.put(true) ;
          else
@@ -146,9 +166,12 @@
            return ret ;
          }
-      }
-
-      template <class T>
-      bool CAttributeTemplate<T>::fromBuffer(CBufferIn& buffer)
-      {
+*/
+      }
+
+      template <class T>
+      bool CAttributeTemplate<T>::_fromBuffer(CBufferIn& buffer)
+      {
+        return CType<T>::fromBuffer(buffer) ;
+/*        
         bool empty ;
         bool ret=true ;
@@ -170,9 +193,12 @@
           return val.fromBuffer(buffer) ;
         }
-      }
-
+*/
+      }
+/*
       template <class T>
       size_t CAttributeTemplate<T>::size(void) const
-      {
+      { 
+        return CType<T>::size() ;*/
+/*        
         if (isEmpty()) return sizeof(bool) ;
         else
@@ -181,5 +207,6 @@
           return val.size()+sizeof(bool) ;
         }
-      }
+*/
+ /*     }*/
 
       template <typename T>
@@ -231,8 +258,8 @@
       }
  
-      
-      //---------------------------------------------------------------
-
-      /** SpÃ©cialisations des templates pour la fonction [toString] **/
+/*      
+      //---------------------------------------------------------------
+
+      // SpÃ©cialisations des templates pour la fonction [toString] 
 
       template <>
@@ -241,5 +268,5 @@
       //---------------------------------------------------------------
 
-      /** SpÃ©cialisations des templates pour la fonction [fromString] **/
+      // SpÃ©cialisations des templates pour la fonction [fromString] 
 
       template <> // ChaÃ®ne de caractÃšres.
@@ -260,5 +287,5 @@
       //---------------------------------------------------------------
 
-      /** SpÃ©cialisations des templates pour la fonction [toBinary] **/
+      // SpÃ©cialisations des templates pour la fonction [toBinary] //
 
       template <> // ChaÃ®ne de caractÃšres.
@@ -276,5 +303,5 @@
       //---------------------------------------------------------------
 
-      /** SpÃ©cialisations des templates pour la fonction [fromBinary] **/
+      // SpÃ©cialisations des templates pour la fonction [fromBinary] //
 
       template <> // ChaÃ®ne de caractÃšres.
@@ -291,4 +318,5 @@
 
       ///--------------------------------------------------------------
+*/      
 } // namespace xios
 
Index: XIOS/trunk/src/attribute_template_specialisation.hpp
===================================================================
--- XIOS/trunk/src/attribute_template_specialisation.hpp	(revision 368)
+++ XIOS/trunk/src/attribute_template_specialisation.hpp	(revision 369)
@@ -6,7 +6,8 @@
 namespace xios
 {
+/*
       /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-      /** SpÃ©cialisations des templates pour la fonction [toString] **/
+      /// SpÃ©cialisations des templates pour la fonction [toString] ///
       
       template <>
@@ -26,5 +27,5 @@
       //---------------------------------------------------------------
 
-      /** SpÃ©cialisations des templates pour la fonction [fromString] **/
+      /// SpÃ©cialisations des templates pour la fonction [fromString] ///
 
       template <> // ChaÃ®ne de caractÃšres.
@@ -143,5 +144,5 @@
       //---------------------------------------------------------------
 
-      /** SpÃ©cialisations des templates pour la fonction [toBinary] **/
+      /// SpÃ©cialisations des templates pour la fonction [toBinary] ///
 
       template <> // ChaÃ®ne de caractÃšres.
@@ -177,5 +178,5 @@
       //---------------------------------------------------------------
 
-      /** SpÃ©cialisations des templates pour la fonction [fromBinary] **/
+      /// SpÃ©cialisations des templates pour la fonction [fromBinary] ///
 
       template <> // ChaÃ®ne de caractÃšres.
@@ -212,5 +213,5 @@
          this->setValue(value);
       }
-
       ///--------------------------------------------------------------
+*/
 } // namespace xios
Index: XIOS/trunk/src/config/axis_attribute.conf
===================================================================
--- XIOS/trunk/src/config/axis_attribute.conf	(revision 368)
+++ XIOS/trunk/src/config/axis_attribute.conf	(revision 369)
@@ -9,5 +9,5 @@
 DECLARE_ATTRIBUTE(int,       zoom_end)
 DECLARE_ATTRIBUTE(int,       zoom_size)
-DECLARE_ATTRIBUTE(ARRAY(double, 1), value)
+DECLARE_ARRAY(double, 1, value)
 
 
Index: XIOS/trunk/src/config/domain_attribute.conf
===================================================================
--- XIOS/trunk/src/config/domain_attribute.conf	(revision 368)
+++ XIOS/trunk/src/config/domain_attribute.conf	(revision 369)
@@ -22,5 +22,5 @@
 
 /* LOCAL */
-DECLARE_ATTRIBUTE(ARRAY(bool, 2)  , mask)
+DECLARE_ARRAY(bool, 2 , mask)
 
 /* GLOBAL */
@@ -47,9 +47,9 @@
 /* LOCAL */
 DECLARE_ATTRIBUTE(int             , data_n_index)
-DECLARE_ATTRIBUTE(ARRAY(int, 1)   , data_i_index)
-DECLARE_ATTRIBUTE(ARRAY(int, 1)   , data_j_index)
+DECLARE_ARRAY(int, 1 , data_i_index)
+DECLARE_ARRAY(int, 1, data_j_index)
 
 /* LOCAL */
-DECLARE_ATTRIBUTE(ARRAY(double, 1), lonvalue)
-DECLARE_ATTRIBUTE(ARRAY(double, 1), latvalue)
+DECLARE_ARRAY(double, 1, lonvalue)
+DECLARE_ARRAY(double, 1, latvalue)
 
Index: XIOS/trunk/src/config/field_attribute.conf
===================================================================
--- XIOS/trunk/src/config/field_attribute.conf	(revision 368)
+++ XIOS/trunk/src/config/field_attribute.conf	(revision 369)
@@ -16,5 +16,4 @@
 DECLARE_ATTRIBUTE(StdString, axis_ref)
 DECLARE_ATTRIBUTE(StdString, grid_ref)
-//DECLARE_ATTRIBUTE(StdString, zoom_ref)
 DECLARE_ATTRIBUTE(StdString, field_ref)
 
Index: XIOS/trunk/src/config/file_attribute.conf
===================================================================
--- XIOS/trunk/src/config/file_attribute.conf	(revision 368)
+++ XIOS/trunk/src/config/file_attribute.conf	(revision 369)
@@ -9,5 +9,5 @@
 DECLARE_ATTRIBUTE(StdString, split_freq)
 DECLARE_ATTRIBUTE(bool,      enabled)
-DECLARE_ATTRIBUTE(StdString,      type)
+DECLARE_ENUM2(type,one_file,multiple_file)
 DECLARE_ATTRIBUTE(StdString,      par_access)
 
Index: XIOS/trunk/src/declare_attribute.hpp
===================================================================
--- XIOS/trunk/src/declare_attribute.hpp	(revision 368)
+++ XIOS/trunk/src/declare_attribute.hpp	(revision 369)
@@ -5,7 +5,8 @@
 
 #define DECLARE_ATTRIBUTE(type, name)                             \
-   class name##att : public CAttributeTemplate<type>{             \
+   class name##_attr : public CAttributeTemplate<type>            \
+   {                                                              \
       public :                                                    \
-         name##att(void)                                          \
+         name##_attr(void)                                          \
             : CAttributeTemplate<type>                            \
             (#name, *CAttributeMap::Current)                      \
@@ -13,23 +14,108 @@
          type operator=(const type & value)                       \
          { return (CAttributeTemplate<type>::operator=(value)); } \
-         virtual ~name##att(void)                                 \
+         virtual ~name##_attr(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 */ }                           \
+#define DECLARE_ARRAY(T_num, T_rank, name)                        \
+   class name##_attr : public CAttributeArray<T_num, T_rank>      \
+   {                                                              \
+      public :                                                    \
+         name##_attr(void) : CAttributeArray<T_num, T_rank> (#name, *CAttributeMap::Current) {} \
+         virtual ~name##_attr(void) {}                            \
    } name;
+   
+#define DECLARE_CLASS_ENUM(name)                                   \
+   class name##_attr : public CAttributeEnum<Enum_##name>          \
+   {                                                              \
+      public :                                                    \
+         name##_attr(void) : CAttributeEnum<Enum_##name>(#name, *CAttributeMap::Current) { } \
+         virtual ~name##_attr(void) {}                           \
+   } name;
+   
+#define DECLARE_ENUM2(name,arg1,arg2)                             \
+   class Enum_##name                                              \
+   {                                                              \
+     public:                                                      \
+     enum t_enum { arg1=0, arg2} ;                                \
+     const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2 } ; return enumStr ; }   \
+     int getSize(void) const { return 2 ; }                       \
+   } ;                                                            \
+   DECLARE_CLASS_ENUM(name)
+   
+#define DECLARE_ENUM3(name,arg1,arg2,arg3)                             \
+   class Enum_##name                                              \
+   {                                                              \
+     public:                                                      \
+     enum t_enum { arg1=0, arg2, arg3} ;                                \
+     const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3 } ; return enumStr ; }   \
+     int getSize(void) const { return 3 ; }                       \
+   } ;                                                            \
+   DECLARE_CLASS_ENUM(name)
+
+#define DECLARE_ENUM4(name,arg1,arg2,arg3,arg4)                             \
+   class Enum_##name                                              \
+   {                                                              \
+     public:                                                      \
+     enum t_enum { arg1=0, arg2, arg3,arg4} ;                                \
+     const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4 } ; return enumStr ; }   \
+     int getSize(void) const { return 4 ; }                       \
+   } ;                                                            \
+   DECLARE_CLASS_ENUM(name)
+
+#define DECLARE_ENUM5(name,arg1,arg2,arg3,arg4,arg5)                             \
+   class Enum_##name                                              \
+   {                                                              \
+     public:                                                      \
+     enum t_enum { arg1=0, arg2, arg3,arg4,arg5} ;                                \
+     const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4,#arg5 } ; return enumStr ; }   \
+     int getSize(void) const { return 5 ; }                       \
+   } ;                                                            \
+   DECLARE_CLASS_ENUM(name)
+
+#define DECLARE_ENUM6(name,arg1,arg2,arg3,arg4,arg5,arg6)                             \
+   class Enum_##name                                              \
+   {                                                              \
+     public:                                                      \
+     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6} ;                                \
+     const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4,#arg5,#arg6 } ; return enumStr ; }   \
+     int getSize(void) const { return 6 ; }                       \
+   } ;                                                            \
+   DECLARE_CLASS_ENUM(name)
+
+#define DECLARE_ENUM7(name,arg1,arg2,arg3,arg4,arg5,arg6,arg7)                             \
+   class Enum_##name                                              \
+   {                                                              \
+     public:                                                      \
+     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6,arg7} ;                                \
+     const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4,#arg5,#arg6,#arg7 } ; return enumStr ; }   \
+     int getSize(void) const { return 7 ; }                       \
+   } ;                                                            \
+   DECLARE_CLASS_ENUM(name)
+
+#define DECLARE_ENUM8(name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8)                             \
+   class Enum_##name                                              \
+   {                                                              \
+     public:                                                      \
+     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6,arg7,arg8} ;                                \
+     const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4,#arg5,#arg6,#arg7,#arg8 } ; return enumStr ; }   \
+     int getSize(void) const { return 8 ; }                       \
+   } ;                                                            \
+   DECLARE_CLASS_ENUM(name)
+
+  #define DECLARE_ENUM9(name,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9)                             \
+   class Enum_##name                                              \
+   {                                                              \
+     public:                                                      \
+     enum t_enum { arg1=0, arg2, arg3,arg4,arg5,arg6,arg7,arg8,arg9} ;                                \
+     const char** getStr(void) const { static const char * enumStr[] = { #arg1, #arg2, #arg3,#arg4,#arg5,#arg6,#arg7,#arg8,#arg9 } ; return enumStr ; }   \
+     int getSize(void) const { return 8 ; }                       \
+   } ;                                                            \
+   DECLARE_CLASS_ENUM(name) 
+
 
 #define BEGIN_DECLARE_ATTRIBUTE_MAP(type)                  \
-   class type##Attributes : public virtual CAttributeMap { \
+   class type##Attributes : public virtual CAttributeMap   \
+   {                                                       \
       public :
 
Index: XIOS/trunk/src/functor.cpp
===================================================================
--- XIOS/trunk/src/functor.cpp	(revision 368)
+++ XIOS/trunk/src/functor.cpp	(revision 369)
@@ -1,3 +1,4 @@
 #include "functor.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -7,5 +8,5 @@
       /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-      CFunctor::CFunctor(const StdString & id, ARRAY(double, 1) doutput)
+      CFunctor::CFunctor(const StdString & id, CArray<double, 1>& doutput)
          : SuperClass(id), doutput(doutput), nbcall(0)
       { /* Ne rien faire de plus */  }
@@ -16,5 +17,5 @@
       //---------------------------------------------------------------
 
-      ARRAY(double, 1) CFunctor::getDataOutput(void) const
+      CArray<double,1> CFunctor::getDataOutput(void) const
       { 
          return (this->doutput);
@@ -37,11 +38,11 @@
       //---------------------------------------------------------------
 
-      ARRAY(double, 1) CFunctor::operator ()(const ARRAY(double, 1) dinput)
+      CArray<double,1> CFunctor::operator ()(const CArray<double,1>& dinput)
       {
          this->nbcall++;
-         if (dinput->size() != this->doutput->size())
+         if (dinput.numElements() != this->doutput.numElements())
             ERROR("CFunctor::operator ()(dinput)",
-                   << "[ input size = "  << dinput->size()
-                   << ", output size = " << this->doutput->size() << " ]"
+                   << "[ input size = "  << dinput.numElements()
+                   << ", output size = " << this->doutput.numElements() << " ]"
                    << " size of input array !=  size of output array !");
          this->apply(dinput, this->doutput);
Index: XIOS/trunk/src/functor.hpp
===================================================================
--- XIOS/trunk/src/functor.hpp	(revision 368)
+++ XIOS/trunk/src/functor.hpp	(revision 369)
@@ -5,5 +5,5 @@
 #include "xmlioserver_spl.hpp"
 #include "exception.hpp"
-#include "array.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -16,12 +16,11 @@
          /// DÃ©finition de type ///
          typedef CObject SuperClass;
-         typedef ARRAY(double, 1) DoubleArray;
 
          public :
 
             /// Accesseurs ///
-            DoubleArray getDataOutput(void) const;
+            CArray<double,1> getDataOutput(void) const;
             /// OpÃ©rateur ///
-            DoubleArray operator ()(const DoubleArray dinput);
+            CArray<double,1> operator ()(const CArray<double,1>& dinput);
 
             /// Destructeur ///
@@ -34,5 +33,5 @@
 
             /// Traitement ///
-            virtual void apply(const DoubleArray dinput, DoubleArray doutput) = 0;
+            virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput) = 0;
 
             /// Autres ///
@@ -42,14 +41,11 @@
             /// Constructeurs ///
             CFunctor(void);                             // Not implemented.
-            CFunctor(const StdString & id, DoubleArray doutput);
+            CFunctor(const StdString & id, CArray<double,1>& doutput);
             CFunctor(const CFunctor & functor);         // Not implemented.
             CFunctor(const CFunctor * const functor);   // Not implemented.
 
-         private :
-
+         protected :
             /// PropriÃ©tÃ©s privÃ©es ///
-            DoubleArray doutput;
-            
-         protected :
+            CArray<double,1>& doutput;
             /// PropriÃ©tÃ©s protÃ©gÃ©es ///   
             int nbcall;            
Index: XIOS/trunk/src/functor/average.cpp
===================================================================
--- XIOS/trunk/src/functor/average.cpp	(revision 368)
+++ XIOS/trunk/src/functor/average.cpp	(revision 369)
@@ -1,3 +1,4 @@
 #include "average.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -7,7 +8,7 @@
       /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-      CAverage::CAverage(DoubleArray doutput)
+      CAverage::CAverage(CArray<double,1>& doutput)
          : SuperClass(StdString("average"), doutput)
-      { /* Ne rien faire de plus */ }
+      { doutput.dumpStructureInformation(cout) ;/* Ne rien faire de plus */ }
 
       CAverage::~CAverage(void)
@@ -16,7 +17,8 @@
       //---------------------------------------------------------------
 
-      void CAverage::apply(const DoubleArray _dinput,
-                                 DoubleArray _doutput)
+      void CAverage::apply(const CArray<double,1>& _dinput,
+                                 CArray<double,1>& _doutput)
       {
+/*
          const double * it1  = _dinput->data(),
                       * end1 = _dinput->data() + _dinput->num_elements(); 
@@ -25,12 +27,19 @@
               for (; it1 != end1; it1++, it++) *it  = *it1;
          else for (; it1 != end1; it1++, it++) *it += *it1;               
+*/
+        if (this->nbcall == 1) _doutput=_dinput ;
+        else _doutput+=_dinput ;
+      
       }
       
       void CAverage::final(void)
       {
-          double * it1  = this->getDataOutput()->data(),
+/*          double * it1  = this->getDataOutput()->data(),
                  * end1 = this->getDataOutput()->data() + this->getDataOutput()->num_elements();
           for (; it1 != end1; it1++) *it1 /= this->nbcall;
           this->nbcall = 0;                                                   
+*/
+        doutput/=this->nbcall; 
+        this->nbcall = 0; 
       }
    } // namespace func
Index: XIOS/trunk/src/functor/average.hpp
===================================================================
--- XIOS/trunk/src/functor/average.hpp	(revision 368)
+++ XIOS/trunk/src/functor/average.hpp	(revision 369)
@@ -4,4 +4,5 @@
 /// xmlioserver headers ///
 #include "functor.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -14,5 +15,4 @@
          /// DÃ©finition de type ///
          typedef CFunctor SuperClass;
-         typedef ARRAY(double, 1) DoubleArray;
 
          public :
@@ -21,10 +21,10 @@
             //CAverage(void);                             // Not implemented.
             //CAverage(const CFunData & data);
-            CAverage(DoubleArray doutput);
+            CAverage(CArray<double,1>& doutput);
             //CAverage(const CAverage & average);         // Not implemented.
             //CAverage(const CAverage * const average);   // Not implemented.
 
             /// Traitement ///
-            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+            virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
             virtual void final(void) ;
             
Index: XIOS/trunk/src/functor/instant.cpp
===================================================================
--- XIOS/trunk/src/functor/instant.cpp	(revision 368)
+++ XIOS/trunk/src/functor/instant.cpp	(revision 369)
@@ -1,3 +1,4 @@
 #include "instant.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -7,5 +8,5 @@
       /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-      CInstant::CInstant(DoubleArray doutput)
+      CInstant::CInstant(CArray<double,1>& doutput)
          : SuperClass(StdString("instant"), doutput)
       { /* Ne rien faire de plus */ }
@@ -16,11 +17,12 @@
       //---------------------------------------------------------------
 
-      void CInstant::apply(const DoubleArray _dinput,
-                                 DoubleArray _doutput)
+      void CInstant::apply(const CArray<double,1>& _dinput,
+                                 CArray<double,1>& _doutput)
       {
-       	 const double * it1  = _dinput->data(),
+/*       	 const double * it1  = _dinput->data(),
        	              * end1 = _dinput->data() + _dinput->num_elements();
        	 double * it   = _doutput->data();
-       	 for (; it1 != end1; it1++, it++) *it  = *it1;
+       	 for (; it1 != end1; it1++, it++) *it  = *it1;*/
+        _doutput=_dinput ;
       }
 
Index: XIOS/trunk/src/functor/instant.hpp
===================================================================
--- XIOS/trunk/src/functor/instant.hpp	(revision 368)
+++ XIOS/trunk/src/functor/instant.hpp	(revision 369)
@@ -4,4 +4,5 @@
 /// xios headers ///
 #include "functor.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -14,5 +15,4 @@
          /// DÃ©finition de type ///
          typedef CFunctor SuperClass;
-         typedef ARRAY(double, 1) DoubleArray;
 
          public :
@@ -21,10 +21,10 @@
             //CInstant(void);                             // Not implemented.
             //CInstant(const CFunData & data);
-            CInstant(DoubleArray doutput);
+            CInstant(CArray<double,1>& doutput);
             //CInstant(const CInstant & instant);         // Not implemented.
             //CInstant(const CInstant * const instant);   // Not implemented.
 
             /// Traitement ///
-            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+            virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
 
             /// Destructeur ///
Index: XIOS/trunk/src/functor/maximum.cpp
===================================================================
--- XIOS/trunk/src/functor/maximum.cpp	(revision 368)
+++ XIOS/trunk/src/functor/maximum.cpp	(revision 369)
@@ -1,4 +1,5 @@
 #include "maximum.hpp"
-#include <algorithm>
+#include "array_new.hpp"
+
 
 
@@ -9,5 +10,5 @@
       /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-      CMaximum::CMaximum(DoubleArray doutput)
+      CMaximum::CMaximum(CArray<double,1>& doutput)
          : SuperClass(StdString("maximum"), doutput)
       { /* Ne rien faire de plus */ }
@@ -18,19 +19,14 @@
       //---------------------------------------------------------------
 
-      void CMaximum::apply(const DoubleArray _dinput,
-                                 DoubleArray _doutput)
+      void CMaximum::apply(const CArray<double,1>& _dinput,
+                                 CArray<double,1>& _doutput)
       {
-       	 const double * it1  = _dinput->data(),
-       	              * end1 = _dinput->data() + _dinput->num_elements();
-       	       double * it   = _doutput->data();
-         if (this->nbcall == 1)
-              for (; it1 != end1; it1++, it++) *it = *it1;
+        const double * it1  = _dinput.dataFirst(),
+       	             * end1 = _dinput.dataFirst() + _dinput.numElements();
+              double * it   = _doutput.dataFirst();
+         if (this->nbcall == 1) for (; it1 != end1; it1++, it++) *it = *it1;
          else for (; it1 != end1; it1++, it++) *it = std::max(*it1, *it);
 
-         it1  = _dinput->data(),
-         end1 = _dinput->data() + _dinput->num_elements();
-       	 it  = _doutput->data();
-         double sum=0 ;
-         for (; it1 != end1; it1++, it++) sum+=*it;
+
       }
 
Index: XIOS/trunk/src/functor/maximum.hpp
===================================================================
--- XIOS/trunk/src/functor/maximum.hpp	(revision 368)
+++ XIOS/trunk/src/functor/maximum.hpp	(revision 369)
@@ -4,4 +4,5 @@
 /// xios headers ///
 #include "functor.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -14,5 +15,4 @@
          /// DÃ©finition de type ///
          typedef CFunctor SuperClass;
-         typedef ARRAY(double, 1) DoubleArray;
 
          public :
@@ -21,10 +21,10 @@
             //CMaximum(void);                             // Not implemented.
             //CMaximum(const CFunData & data);
-            CMaximum(DoubleArray doutput);
+            CMaximum(CArray<double,1>& doutput);
             //CMaximum(const CMaximum & Maximum);         // Not implemented.
             //CMaximum(const CMaximum * const Maximum);   // Not implemented.
 
             /// Traitement ///
-            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+            virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
 
             /// Destructeur ///
Index: XIOS/trunk/src/functor/minimum.cpp
===================================================================
--- XIOS/trunk/src/functor/minimum.cpp	(revision 368)
+++ XIOS/trunk/src/functor/minimum.cpp	(revision 369)
@@ -1,3 +1,5 @@
 #include "minimum.hpp"
+#include "array_new.hpp"
+#include <algorithm>
 
 namespace xios
@@ -7,5 +9,5 @@
       /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-      CMinimum::CMinimum(DoubleArray doutput)
+      CMinimum::CMinimum(CArray<double,1>& doutput)
          : SuperClass(StdString("minimum"), doutput)
       { /* Ne rien faire de plus */ }
@@ -16,13 +18,14 @@
       //---------------------------------------------------------------
 
-      void CMinimum::apply(const DoubleArray _dinput,
-                                 DoubleArray _doutput)
+      void CMinimum::apply(const CArray<double,1>& _dinput,
+                                 CArray<double,1>& _doutput)
       {
-         const double * it1  = _dinput->data(),
-                      * end1 = _dinput->data() + _dinput->num_elements();
-         double * it   = _doutput->data();
-         if (this->nbcall == 1)
-              for (; it1 != end1; it1++, it++) *it = *it1;
-         else for (; it1 != end1; it1++, it++) *it = std::min(*it1, *it);
+        const double * it1  = _dinput.dataFirst(),
+                      * end1 = _dinput.dataFirst() + _dinput.numElements();
+        double * it   = _doutput.dataFirst();
+        
+        if (this->nbcall == 1)  for (; it1 != end1; it1++, it++) *it = *it1;
+        else for (; it1 != end1; it1++, it++) *it = std::min(*it1, *it);
+
       }
 
Index: XIOS/trunk/src/functor/minimum.hpp
===================================================================
--- XIOS/trunk/src/functor/minimum.hpp	(revision 368)
+++ XIOS/trunk/src/functor/minimum.hpp	(revision 369)
@@ -4,4 +4,5 @@
 /// xmlioserver headers ///
 #include "functor.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -14,5 +15,4 @@
          /// DÃ©finition de type ///
          typedef CFunctor SuperClass;
-         typedef ARRAY(double, 1) DoubleArray;
 
          public :
@@ -21,10 +21,10 @@
             //CMinimum(void);                             // Not implemented.
             //CMinimum(const CFunData & data);
-            CMinimum(DoubleArray doutput);
+            CMinimum(CArray<double,1>& doutput);
             //CMinimum(const CMinimum & Minimum);         // Not implemented.
             //CMinimum(const CMinimum * const Minimum);   // Not implemented.
 
             /// Traitement ///
-            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+            virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
 
             /// Destructeur ///
Index: XIOS/trunk/src/functor/once.cpp
===================================================================
--- XIOS/trunk/src/functor/once.cpp	(revision 368)
+++ XIOS/trunk/src/functor/once.cpp	(revision 369)
@@ -1,3 +1,4 @@
 #include "once.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -7,5 +8,5 @@
       /// ////////////////////// DÃ©finitions ////////////////////// ///
 
-      COnce::COnce(DoubleArray doutput)
+      COnce::COnce(CArray<double,1>& doutput)
          : SuperClass(StdString("once"), doutput)
       { /* Ne rien faire de plus */ }
@@ -16,11 +17,12 @@
       //---------------------------------------------------------------
 
-      void COnce::apply(const DoubleArray _dinput,
-                              DoubleArray _doutput)
+      void COnce::apply(const CArray<double,1>& _dinput,
+                              CArray<double,1>& _doutput)
       {
-       	 const double * it1  = _dinput->data(),
+/*       	 const double * it1  = _dinput->data(),
        	              * end1 = _dinput->data() + _dinput->num_elements();
        	       double * it   = _doutput->data();
-        for (; it1 != end1; it1++, it++) *it  = *it1;
+        for (; it1 != end1; it1++, it++) *it  = *it1;*/
+        _doutput=_dinput ;
       }
 
Index: XIOS/trunk/src/functor/once.hpp
===================================================================
--- XIOS/trunk/src/functor/once.hpp	(revision 368)
+++ XIOS/trunk/src/functor/once.hpp	(revision 369)
@@ -4,4 +4,5 @@
 /// xios headers ///
 #include "functor.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -14,5 +15,4 @@
          /// DÃ©finition de type ///
          typedef CFunctor SuperClass;
-         typedef ARRAY(double, 1) DoubleArray;
 
          public :
@@ -20,10 +20,10 @@
             /// Constructeurs ///
             //COnce(void);                       // Not implemented.
-            COnce(DoubleArray doutput);
+            COnce(CArray<double,1>& doutput);
             //COnce(const COnce & once);         // Not implemented.
             //COnce(const COnce * const once);   // Not implemented.
 
             /// Traitement ///
-            virtual void apply(const DoubleArray dinput, DoubleArray doutput);
+            virtual void apply(const CArray<double,1>& dinput, CArray<double,1>& doutput);
 
             /// Destructeur ///
Index: XIOS/trunk/src/generate_fortran_interface.cpp
===================================================================
--- XIOS/trunk/src/generate_fortran_interface.cpp	(revision 368)
+++ XIOS/trunk/src/generate_fortran_interface.cpp	(revision 369)
@@ -5,4 +5,6 @@
 #include "object_template.hpp"
 #include "group_template.hpp"
+#include "context.hpp"
+#include "file.hpp"
 
 int main (int argc, char ** argv, char ** UNUSED (env))
Index: XIOS/trunk/src/generate_interface_impl.hpp
===================================================================
--- XIOS/trunk/src/generate_interface_impl.hpp	(revision 368)
+++ XIOS/trunk/src/generate_interface_impl.hpp	(revision 369)
@@ -6,5 +6,6 @@
 #include "type_util.hpp"
 #include "indent.hpp"
-#include "array.hpp"
+#include "enum.hpp"
+#include "array_new.hpp"
 
 namespace xios
@@ -83,8 +84,33 @@
   }
 
+  template<>
+  void CInterface::AttributeCInterface<CEnumBase>(ostream& oss, const string& className,const string& name)  
+  {
+    oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, const char * "<<name<<", int "<<name<<"_size)"<<iendl ;
+    oss<<"{"<<iendl ;
+    oss<<"  std::string "<<name<<"_str;"<<iendl;
+    oss<<"  if(!cstr2string("<<name<<", "<<name<<"_size, "<<name<<"_str)) return;"<<iendl ;
+    oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ;
+    oss<<"  "<<className<<"_hdl->"<<name<<".fromString("<<name<<"_str);"<<iendl ;
+    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;
+    oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;
+    oss<<"}"<<iendl ;
+    
+    oss<<iendl ;
+    
+    oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, char * "<<name<<", int "<<name<<"_size)"<<iendl ;
+    oss<<"{"<<iendl ;
+    oss<<"   CTimer::get(\"XIOS\").resume();"<<iendl ;
+    oss<<"  if(!string_copy("<<className<<"_hdl->"<<name<<".getStringValue(),"<<name<<" , "<<name<<"_size))"<<iendl ;
+    oss<<"    ERROR(\"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, char * "<<name<<", int "
+       <<name<<"_size)\", <<\"Input string is to short\");"<<iendl ;
+    oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;
+    oss<<"}"<<iendl ;
+  
+  }
 //     if (!array_copy(domain_hdl->mask.getValue(), mask, extent1, extent2))
 //        ERROR("cxios_get_domain_mask(XDomainPtr domain_hdl, bool * mask, int extent1, int extent2)",<<"Output array size is not conform to array size attribut") ;
 
-
+/*
 #define macro(T) \
   template <>\
@@ -160,4 +186,5 @@
 macro(double)
 macro(int)
+*/
 
 #undef macro  
@@ -206,5 +233,6 @@
      
    }
-    
+
+/*
 #define macro(T)\
    template <>\
@@ -280,7 +308,7 @@
   macro(double)
   macro(int)
-  
+
   #undef macro
-  
+*/  
    template <class T>
    void CInterface::AttributeFortranInterfaceDeclaration(ostream& oss,const string& className,const string& name)
@@ -309,4 +337,5 @@
    }
 
+/*
 #define macro(T)\
    template <> \
@@ -356,5 +385,5 @@
 
 #undef macro
-
+*/
    
    template <class T>
@@ -404,5 +433,5 @@
    }
 
-
+/*
 #define macro(T) \
    template <>  \
@@ -459,5 +488,7 @@
 
 #undef macro
-
+*/
+
+/*
 #define macro(T) \
    template <>  \
@@ -514,4 +545,358 @@
 
 #undef macro
+*/
+
+// declaration for CArray
+
+
+
+
+#define macro(T) \
+  template <>\
+  void CInterface::AttributeCInterface<CArray<T,1> >(ostream& oss, const string& className,const string& name)\
+  {\
+    string typeName=getStrType<T>() ;\
+\
+    oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1)"<<iendl ;\
+    oss<<"{"<<iendl ;\
+    oss<<"  CTimer::get(\"XIOS\").resume();"<<iendl ; \
+    oss<<"  CArray<"<<typeName<<",1> tmp("<<name<<",shape(extent1),neverDeleteData) ;"<<iendl ;\
+    oss<<"  "<<className<<"_hdl->"<<name<<".reference(tmp.copy());"<<iendl ;\
+    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;\
+    oss<<"}"<<iendl ;\
+    oss<<iendl; \
+    oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1)"<<iendl ;\
+    oss<<"{"<<iendl; \
+    oss<<"  CArray<"<<typeName<<",1> tmp("<<name<<",shape(extent1),neverDeleteData) ;"<<iendl ;\
+    oss<<"  tmp="<<className<<"_hdl->"<<name<<" ;"<<iendl ;\
+    oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\
+    oss<<"}"<<iendl ;\
+  }\
+\
+  template <> \
+  void CInterface::AttributeCInterface<CArray<T,2> >(ostream& oss, const string& className,const string& name)\
+  {\
+    string typeName=getStrType<T>() ;\
+\
+    oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2)"<<iendl ;\
+    oss<<"{"<<iendl ;\
+    oss<<"  CTimer::get(\"XIOS\").resume();"<<iendl ; \
+    oss<<"  CArray<"<<typeName<<",2> tmp("<<name<<",shape(extent1,extent2),neverDeleteData) ;"<<iendl ;\
+    oss<<"  "<<className<<"_hdl->"<<name<<".reference(tmp.copy());"<<iendl ;\
+    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;\
+    oss<<"}"<<iendl ;\
+    oss<<iendl; \
+    oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2)"<<iendl ;\
+    oss<<"{"<<iendl; \
+    oss<<"  CArray<"<<typeName<<",2> tmp("<<name<<",shape(extent1,extent2),neverDeleteData) ;"<<iendl ;\
+    oss<<"  tmp="<<className<<"_hdl->"<<name<<" ;"<<iendl ;\
+    oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\
+    oss<<"}"<<iendl ;\
+  }\
+\
+  template <>\
+  void CInterface::AttributeCInterface<CArray<T,3> >(ostream& oss, const string& className,const string& name)\
+  {\
+    string typeName=getStrType<T>() ;\
+\
+    oss<<"void cxios_set_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2, int extent3)"<<iendl ;\
+    oss<<"{"<<iendl ;\
+    oss<<"  CTimer::get(\"XIOS\").resume();"<<iendl ; \
+    oss<<"  CArray<"<<typeName<<",2> tmp("<<name<<",shape(extent1,extent2,extent3),neverDeleteData) ;"<<iendl ;\
+    oss<<"  "<<className<<"_hdl->"<<name<<".reference(tmp.copy());"<<iendl ;\
+    oss<<"  "<<className<<"_hdl->sendAttributToServer("<<className<<"_hdl->"<<name<<");"<<iendl ;\
+    oss<<"}"<<iendl ;\
+    oss<<iendl; \
+    oss<<"void cxios_get_"<<className<<"_"<<name<<"("<<className<<"_Ptr "<<className<<"_hdl, "<< typeName<<"* "<<name<<", int extent1, int extent2, int extent3)"<<iendl ;\
+    oss<<"{"<<iendl; \
+    oss<<"  CArray<"<<typeName<<",2> tmp("<<name<<",shape(extent1,extent2,extent3),neverDeleteData) ;"<<iendl ;\
+    oss<<"  tmp="<<className<<"_hdl->"<<name<<" ;"<<iendl ;\
+    oss<<"   CTimer::get(\"XIOS\").suspend();"<<iendl ;\
+    oss<<"}"<<iendl ;\
+  }
+
+macro(bool)
+macro(double)
+macro(int)
+
+#undef macro  
+
+// /////////////////////////////////////////////////
+// //          Fortran 2003 Interface             //
+// /////////////////////////////////////////////////
+
+
+    
+#define macro(T)\
+   template <>\
+   void CInterface::AttributeFortran2003Interface<CArray<T,1> >(ostream& oss,const string& className,const string& name) \
+   { \
+     string fortranType=getStrFortranType<T>() ; \
+     string fortranKindC=getStrFortranKindC<T>() ; \
+      \
+     oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1) BIND(C)"<<iendl ; \
+     oss<<"  USE ISO_C_BINDING"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \
+     oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \
+     oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; \
+     oss<<iendl; \
+     oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1) BIND(C)"<<iendl ; \
+     oss<<"  USE ISO_C_BINDING"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \
+     oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \
+     oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; \
+   } \
+ \
+   template <> \
+   void CInterface::AttributeFortran2003Interface<CArray<T,2> >(ostream& oss,const string& className,const string& name) \
+   { \
+     string fortranType=getStrFortranType<T>() ; \
+     string fortranKindC=getStrFortranKindC<T>() ; \
+      \
+     oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2) BIND(C)"<<iendl ; \
+     oss<<"  USE ISO_C_BINDING"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \
+     oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \
+     oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; \
+     oss<<iendl ; \
+     oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2) BIND(C)"<<iendl ; \
+     oss<<"  USE ISO_C_BINDING"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \
+     oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \
+     oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; \
+   } \
+     \
+   template <> \
+   void CInterface::AttributeFortran2003Interface<CArray<T,3> >(ostream& oss,const string& className,const string& name) \
+   { \
+     string fortranType=getStrFortranType<T>() ; \
+     string fortranKindC=getStrFortranKindC<T>() ; \
+      \
+     oss<<"SUBROUTINE cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2, extent3) BIND(C)"<<iendl ; \
+     oss<<"  USE ISO_C_BINDING"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \
+     oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent3"<<iendl ; \
+     oss<<"END SUBROUTINE cxios_set_"<<className<<"_"<<name<<iendl ; \
+     oss<<iendl ;\
+     oss<<"SUBROUTINE cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl, "<<name<<", extent1, extent2, extent3) BIND(C)"<<iendl ; \
+     oss<<"  USE ISO_C_BINDING"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INTPTR_T), VALUE       :: "<<className<<"_hdl"<<iendl ; \
+     oss<<"  "<<fortranType<<" "<<fortranKindC<<"     , DIMENSION(*) :: "<<name<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent1"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent2"<<iendl ; \
+     oss<<"  INTEGER (kind = C_INT), VALUE  :: extent3"<<iendl ; \
+     oss<<"END SUBROUTINE cxios_get_"<<className<<"_"<<name<<iendl ; \
+   }
+  
+  macro(bool)
+  macro(double)
+  macro(int)
+  
+  #undef macro
+  
+
+#define macro(T)\
+   template <> \
+   void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,1> >(ostream& oss,const string& className,const string& name) \
+   { \
+     oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<"(:)"<<iendl ; \
+     if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:)"<<iendl ; \
+   } \
+   template <> \
+   void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,1> >(ostream& oss,const string& className,const string& name) \
+   { \
+     oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<"(:)"<<iendl ; \
+     if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:)"<<iendl ; \
+   } \
+ \
+   template <> \
+   void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,2> >(ostream& oss,const string& className,const string& name) \
+   { \
+     oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<"(:,:)"<<iendl ; \
+     if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:)"<<iendl ; \
+   } \
+ \
+   template <> \
+   void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,2> >(ostream& oss,const string& className,const string& name) \
+   { \
+     oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<"(:,:)"<<iendl ; \
+     if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:)"<<iendl ; \
+   } \
+ \
+   template <> \
+   void CInterface::AttributeFortranInterfaceDeclaration<CArray<T,3> >(ostream& oss,const string& className,const string& name) \
+   { \
+     oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(IN) :: "<<name<<"(:,:,:)"<<iendl ; \
+     if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:,:)"<<iendl ; \
+   }\
+ \
+   template <> \
+   void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<T,3> >(ostream& oss,const string& className,const string& name) \
+   { \
+     oss<<getStrFortranType<T>()<<" "<<getStrFortranKind<T>() <<" , OPTIONAL, INTENT(OUT) :: "<<name<<"(:,:,:)"<<iendl ; \
+     if (!matchingTypeCFortran<T>()) oss<<getStrFortranType<T>()<<" "<<getStrFortranKindC<T>() <<" , ALLOCATABLE :: "<<name<<"_tmp(:,:,:)"<<iendl ; \
+   }     
+   
+  macro(bool)
+  macro(double)
+  macro(int)
+
+#undef macro
+
+   
+
+#define macro(T) \
+   template <>  \
+   void CInterface::AttributeFortranInterfaceBody< CArray<T,1> >(ostream& oss,const string& className,const string& name) \
+   {  \
+     string name_tmp=name+"__tmp" ; \
+      \
+     oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \
+     if (!matchingTypeCFortran<T>())  \
+     { \
+       oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1)))"<<iendl ; \
+       oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; \
+       oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1))"<<iendl ; \
+     } \
+     else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1))"<<iendl ; \
+     oss<<"ENDIF"<<iendl ; \
+   } \
+ \
+   template <>  \
+   void CInterface::AttributeFortranInterfaceBody< CArray<T,2> >(ostream& oss,const string& className,const string& name) \
+   {  \
+     string name_tmp=name+"__tmp" ; \
+      \
+     oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \
+     if (!matchingTypeCFortran<T>())  \
+     { \
+       oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2)))"<<iendl ; \
+       oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; \
+       oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \
+     } \
+     else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \
+     oss<<"ENDIF"<<iendl ; \
+   } \
+    \
+   template <>  \
+   void CInterface::AttributeFortranInterfaceBody< CArray<T,3> >(ostream& oss,const string& className,const string& name) \
+   {  \
+     string name_tmp=name+"__tmp" ; \
+      \
+     oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \
+     if (!matchingTypeCFortran<T>())  \
+     { \
+       oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3)))"<<iendl ; \
+       oss<<"  "<<name_tmp<<"="<<name<<"_"<<iendl ; \
+       oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \
+     } \
+     else oss<<"  CALL cxios_set_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \
+     oss<<"ENDIF"<<iendl ; \
+   }
+  
+  macro(bool)
+  macro(double)
+  macro(int)
+
+#undef macro
+
+#define macro(T) \
+   template <>  \
+   void CInterface::AttributeFortranInterfaceGetBody< CArray<T,1> >(ostream& oss,const string& className,const string& name) \
+   {  \
+     string name_tmp=name+"__tmp" ; \
+      \
+     oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \
+     if (!matchingTypeCFortran<T>())  \
+     { \
+       oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1)))"<<iendl ; \
+       oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1))"<<iendl ; \
+       oss<<"  "<<name<<"_="<<name_tmp<<"_"<<iendl ; \
+     } \
+     else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1))"<<iendl ; \
+     oss<<"ENDIF"<<iendl ; \
+   } \
+ \
+   template <>  \
+   void CInterface::AttributeFortranInterfaceGetBody< CArray<T,2> >(ostream& oss,const string& className,const string& name) \
+   {  \
+     string name_tmp=name+"__tmp" ; \
+      \
+     oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \
+     if (!matchingTypeCFortran<T>())  \
+     { \
+       oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2)))"<<iendl ; \
+       oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \
+       oss<<"  "<<name<<"_="<<name_tmp<<iendl ; \
+     } \
+     else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2))"<<iendl ; \
+     oss<<"ENDIF"<<iendl ; \
+   } \
+    \
+   template <>  \
+   void CInterface::AttributeFortranInterfaceGetBody< CArray<T,3> >(ostream& oss,const string& className,const string& name) \
+   {  \
+     string name_tmp=name+"__tmp" ; \
+      \
+     oss<<"IF (PRESENT("<<name<<"_)) THEN"<<iendl ; \
+     if (!matchingTypeCFortran<T>())  \
+     { \
+       oss<<"  ALLOCATE("<<name_tmp<<"(size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3)))"<<iendl ; \
+       oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name_tmp<<",size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \
+       oss<<"  "<<name<<"_="<<name_tmp<<iendl ; \
+      } \
+     else oss<<"  CALL cxios_get_"<<className<<"_"<<name<<"("<<className<<"_hdl%daddr, "<<name<<"_,size("<<name<<"_,1),size("<<name<<"_,2),size("<<name<<"_,3))"<<iendl ; \
+     oss<<"ENDIF"<<iendl ; \
+   }
+     
+  macro(bool)
+  macro(double)
+  macro(int)
+
+#undef macro
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 }
 
Index: XIOS/trunk/src/group_template.hpp
===================================================================
--- XIOS/trunk/src/group_template.hpp	(revision 368)
+++ XIOS/trunk/src/group_template.hpp	(revision 369)
@@ -45,6 +45,6 @@
          virtual void fromString(const StdString & str);
          
-         virtual void toBinary  (StdOStream & os) const;
-         virtual void fromBinary(StdIStream & is);
+//         virtual void toBinary  (StdOStream & os) const;
+//         virtual void fromBinary(StdIStream & is);
 
          virtual void parse(xml::CXMLNode & node);
Index: XIOS/trunk/src/group_template_impl.hpp
===================================================================
--- XIOS/trunk/src/group_template_impl.hpp	(revision 368)
+++ XIOS/trunk/src/group_template_impl.hpp	(revision 369)
@@ -38,5 +38,5 @@
    
    ///--------------------------------------------------------------
-   
+/*
    template <class U, class V, class W>
       void CGroupTemplate<U, V, W>::toBinary(StdOStream & os) const
@@ -161,5 +161,5 @@
       }
    }
-
+*/
    //--------------------------------------------------------------
 
Index: XIOS/trunk/src/input/inetcdf4.cpp
===================================================================
--- XIOS/trunk/src/input/inetcdf4.cpp	(revision 368)
+++ XIOS/trunk/src/input/inetcdf4.cpp	(revision 369)
@@ -710,5 +710,5 @@
 
       template <>
-         void CINetCDF4::getData(ARRAY(int, 1) data, const StdString & var,
+         void CINetCDF4::getData(CArray<int, 1>& data, const StdString & var,
                                  const CVarPath  * const path, StdSize record)
       {
@@ -719,10 +719,10 @@
          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()));
+         data.resize(array_size);
+         CheckError(nc_get_vara_int (grpid, varid, &(start[0]), &(count[0]), data.dataFirst()));
       }
 
       template <>
-         void CINetCDF4::getData(ARRAY(double, 1) data, const StdString & var,
+         void CINetCDF4::getData(CArray<double, 1>& data, const StdString & var,
                                  const CVarPath  * const path, StdSize record)
       {
@@ -732,10 +732,10 @@
          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()));
+         data.resize(array_size);
+         CheckError(nc_get_vara_double (grpid, varid, &(start[0]), &(count[0]), data.dataFirst()));
       }
 
       template <>
-         void CINetCDF4::getData(ARRAY(float, 1) data, const StdString & var,
+         void CINetCDF4::getData(CArray<float, 1>& data, const StdString & var,
                                  const CVarPath  * const path, StdSize record)
       {
@@ -745,6 +745,6 @@
          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()));
+         data.resize(array_size);
+         CheckError(nc_get_vara_float (grpid, varid, &(start[0]), &(count[0]), data.dataFirst()));
       }
 
Index: XIOS/trunk/src/input/inetcdf4.hpp
===================================================================
--- XIOS/trunk/src/input/inetcdf4.hpp	(revision 368)
+++ XIOS/trunk/src/input/inetcdf4.hpp	(revision 369)
@@ -5,5 +5,5 @@
 #include "xmlioserver_spl.hpp"
 #include "exception.hpp"
-#include "array.hpp"
+#include "array_new.hpp"
 
 #include <mpi.h>
@@ -92,5 +92,5 @@
 
             template <class T>
-               void getData(ARRAY(T, 1) data,
+               void getData(CArray<T, 1>& data,
                             const StdString & var,
                             const CVarPath  * const path = NULL,
@@ -220,13 +220,13 @@
       //---------------------------------------------------------------
       template <>
-         void CINetCDF4::getData(ARRAY(int, 1) data, const StdString & var,
+         void CINetCDF4::getData(CArray<int, 1>& data, const StdString & var,
                                  const CVarPath  * const path, StdSize record);
 
       template <>
-         void CINetCDF4::getData(ARRAY(double, 1) data, const StdString & var,
+         void CINetCDF4::getData(CArray<double, 1>& data, const StdString & var,
                                  const CVarPath  * const path, StdSize record);
 
       template <>
-         void CINetCDF4::getData(ARRAY(float, 1) data, const StdString & var,
+         void CINetCDF4::getData(CArray<float, 1>& data, const StdString & var,
                                  const CVarPath  * const path, StdSize record);
       ///--------------------------------------------------------------
Index: XIOS/trunk/src/interface/c/icdata.cpp
===================================================================
--- XIOS/trunk/src/interface/c/icdata.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c/icdata.cpp	(revision 369)
@@ -23,4 +23,5 @@
 #include <mpi.h>
 #include "timer.hpp"
+#include "array_new.hpp"
 
 extern "C"
@@ -111,12 +112,9 @@
       CTimer::get("XIOS send field").resume() ;
       CContext* context = CContext::getCurrent() ;
-//      boost::const_multi_array_ref<double, 1> array_(data_k8,
-//          boost::extents [data_Xsize],
-//          boost::fortran_storage_order());
-      ARRAY(double, 1) data(new CArray<double, 1>(boost::extents [data_Xsize]));
-      std::copy(data_k8, &(data_k8[data->num_elements()]), data->data());
-      
-//      dtreat->write_data(fieldid_str, data);
-      CField::get(fieldid_str)->setData(data) ;
+
+      CArray<double,(StdSize)1> data(data_k8,shape(data_Xsize),neverDeleteData) ;
+      CField::get(fieldid_str)->setData(data) ;
+      CField toto ;
+      toto.setData(data) ;
       CTimer::get("XIOS send field").suspend() ;
       CTimer::get("XIOS").suspend() ;
@@ -132,10 +130,5 @@
       CContext* context = CContext::getCurrent() ;
       
-//      boost::const_multi_array_ref<double, 2> array_(data_k8,
-//          boost::extents [data_Xsize][data_Ysize],
-//          boost::fortran_storage_order());
-      ARRAY(double, 2) data(new CArray<double, 2>(boost::extents [data_Xsize][data_Ysize]));
-      std::copy(data_k8, &(data_k8[data->num_elements()]), data->data());
-//      dtreat->write_data(fieldid_str, data);
+      CArray<double,2>data(data_k8,shape(data_Xsize,data_Ysize),neverDeleteData) ;
       CField::get(fieldid_str)->setData(data) ;
       CTimer::get("XIOS send field").suspend() ;
@@ -151,10 +144,6 @@
       CTimer::get("XIOS send field").resume() ;
       CContext* context = CContext::getCurrent() ;
-//      boost::const_multi_array_ref<double, 3> array_(data_k8,
-//          boost::extents [data_Xsize][data_Ysize][data_Zsize],
-//          boost::fortran_storage_order());
-      ARRAY(double, 3) data(new CArray<double, 3>(boost::extents [data_Xsize][data_Ysize][data_Zsize]));
-      std::copy(data_k8, &(data_k8[data->num_elements()]), data->data());
-//      dtreat->write_data(fieldid_str, data);
+
+      CArray<double,3>data(data_k8,shape(data_Xsize,data_Ysize,data_Zsize),neverDeleteData) ;
       CField::get(fieldid_str)->setData(data) ;
       CTimer::get("XIOS send field").suspend() ;
@@ -170,13 +159,7 @@
       CTimer::get("XIOS send field").resume() ;
       CContext* context = CContext::getCurrent() ;
-//      boost::const_multi_array_ref<float, 1> array_(data_k4,
-//          boost::extents [data_Xsize],
-//          boost::fortran_storage_order());
-//      ARRAY(float, 1) data(new CArray<float, 1>(boost::extents [data_Xsize]));
-//      std::copy(data_k4, &(data_k4[data->num_elements()]), data->data());
-//      dtreat->write_data(fieldid_str, data);
-      ARRAY(double, 1) data(new CArray<double, 1>(boost::extents [data_Xsize]));
-      double* ptr_data=data->data() ; 
-      for(int i=0;i<data->num_elements();i++) ptr_data[i]=data_k4[i];
+      CArray<float,1> data_tmp(data_k4,shape(data_Xsize),neverDeleteData) ;
+      CArray<double,1> data(data_Xsize) ;
+      data=data_tmp ;
       CField::get(fieldid_str)->setData(data) ;
       CTimer::get("XIOS send field").suspend() ;
@@ -192,13 +175,7 @@
       CTimer::get("XIOS send field").resume() ;
       CContext* context = CContext::getCurrent() ;
-//      boost::const_multi_array_ref<float, 2> array_(data_k4,
-//          boost::extents [data_Xsize][data_Ysize],
-//          boost::fortran_storage_order());
-//      ARRAY(float, 2) data(new CArray<float, 2>(boost::extents [data_Xsize][data_Ysize]));
-//      std::copy(data_k4, &(data_k4[data->num_elements()]), data->data());
-//      dtreat->write_data(fieldid_str, data);
-      ARRAY(double, 2) data(new CArray<double, 2>(boost::extents [data_Xsize][data_Ysize]));
-      double* ptr_data=data->data() ; 
-      for(int i=0;i<data->num_elements();i++) ptr_data[i]=data_k4[i];
+      CArray<float,2> data_tmp(data_k4,shape(data_Xsize,data_Ysize),neverDeleteData) ;
+      CArray<double,2> data(data_Xsize,data_Ysize) ;
+      data=data_tmp ;
       CField::get(fieldid_str)->setData(data) ;
       CTimer::get("XIOS send field").suspend() ;
@@ -215,14 +192,9 @@
       CTimer::get("XIOS send field").resume() ;
       CContext* context = CContext::getCurrent() ;
-     
-//      boost::const_multi_array_ref<float, 3> array_(data_k4,
-//          boost::extents [data_Xsize][data_Ysize][data_Zsize],
-//          boost::fortran_storage_order());
-//      ARRAY(float, 3) data(new CArray<float, 3>(boost::extents [data_Xsize][data_Ysize][data_Zsize]));
-//      std::copy(data_k4, &(data_k4[data->num_elements()]), data->data());
-//      dtreat->write_data(fieldid_str, data);
-      ARRAY(double, 3) data(new CArray<double, 3>(boost::extents [data_Xsize][data_Ysize][data_Zsize]));
-      double* ptr_data=data->data() ; 
-      for(int i=0;i<data->num_elements();i++) ptr_data[i]=data_k4[i];
+
+      CArray<float,3> data_tmp(data_k4,shape(data_Xsize,data_Ysize,data_Zsize),neverDeleteData) ;
+      CArray<double,3> data(data_Xsize,data_Ysize,data_Zsize) ;
+      data=data_tmp ;
+ 
       CField::get(fieldid_str)->setData(data) ;
       CTimer::get("XIOS send field").suspend() ;
Index: XIOS/trunk/src/interface/c/icutil.hpp
===================================================================
--- XIOS/trunk/src/interface/c/icutil.hpp	(revision 368)
+++ XIOS/trunk/src/interface/c/icutil.hpp	(revision 369)
@@ -40,4 +40,5 @@
   }
 }
+/*
   template<class T>
   inline  bool array_copy(ARRAY(T,1) array_in, T* array_out, size_t extent1)
@@ -63,5 +64,5 @@
     return true ;
   }        
-
+*/
 
 #endif // __ICUTIL_HPP__
Index: XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icaxis_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "axis.hpp"
+#include "node_type.hpp"
 
 extern "C"
@@ -109,8 +109,7 @@
   void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
-    std::copy(value, &(value[array_tmp->num_elements()]), array_tmp->data());
-    axis_hdl->value.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(value,shape(extent1),neverDeleteData) ;
+    axis_hdl->value.reference(tmp.copy());
     axis_hdl->sendAttributToServer(axis_hdl->value);
   }
@@ -118,7 +117,49 @@
   void cxios_get_axis_value(axis_Ptr axis_hdl, double* value, int extent1)
   {
-    if (!array_copy(axis_hdl->value.getValue(), value, extent1))
-     ERROR("void cxios_set_axis_value(axis_Ptr axis_hdl, double* value, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<double,1> tmp(value,shape(extent1),neverDeleteData) ;
+    tmp=axis_hdl->value ;
      CTimer::get("XIOS").suspend();
+  }
+  
+  
+  void cxios_set_axis_zoom_begin(axis_Ptr axis_hdl, int zoom_begin)
+  {
+     CTimer::get("XIOS").resume();
+    axis_hdl->zoom_begin.setValue(zoom_begin);
+    axis_hdl->sendAttributToServer(axis_hdl->zoom_begin);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_axis_zoom_begin(axis_Ptr axis_hdl, int* zoom_begin)
+  {
+    *zoom_begin = axis_hdl->zoom_begin.getValue();
+  }
+  
+  
+  void cxios_set_axis_zoom_end(axis_Ptr axis_hdl, int zoom_end)
+  {
+     CTimer::get("XIOS").resume();
+    axis_hdl->zoom_end.setValue(zoom_end);
+    axis_hdl->sendAttributToServer(axis_hdl->zoom_end);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_axis_zoom_end(axis_Ptr axis_hdl, int* zoom_end)
+  {
+    *zoom_end = axis_hdl->zoom_end.getValue();
+  }
+  
+  
+  void cxios_set_axis_zoom_size(axis_Ptr axis_hdl, int zoom_size)
+  {
+     CTimer::get("XIOS").resume();
+    axis_hdl->zoom_size.setValue(zoom_size);
+    axis_hdl->sendAttributToServer(axis_hdl->zoom_size);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_axis_zoom_size(axis_Ptr axis_hdl, int* zoom_size)
+  {
+    *zoom_size = axis_hdl->zoom_size.getValue();
   }
   
Index: XIOS/trunk/src/interface/c_attr/icaxisgroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icaxisgroup_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icaxisgroup_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "axis.hpp"
+#include "node_type.hpp"
 
 extern "C"
@@ -128,8 +128,7 @@
   void cxios_set_axisgroup_value(axisgroup_Ptr axisgroup_hdl, double* value, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
-    std::copy(value, &(value[array_tmp->num_elements()]), array_tmp->data());
-    axisgroup_hdl->value.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(value,shape(extent1),neverDeleteData) ;
+    axisgroup_hdl->value.reference(tmp.copy());
     axisgroup_hdl->sendAttributToServer(axisgroup_hdl->value);
   }
@@ -137,7 +136,49 @@
   void cxios_get_axisgroup_value(axisgroup_Ptr axisgroup_hdl, double* value, int extent1)
   {
-    if (!array_copy(axisgroup_hdl->value.getValue(), value, extent1))
-     ERROR("void cxios_set_axisgroup_value(axisgroup_Ptr axisgroup_hdl, double* value, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<double,1> tmp(value,shape(extent1),neverDeleteData) ;
+    tmp=axisgroup_hdl->value ;
      CTimer::get("XIOS").suspend();
+  }
+  
+  
+  void cxios_set_axisgroup_zoom_begin(axisgroup_Ptr axisgroup_hdl, int zoom_begin)
+  {
+     CTimer::get("XIOS").resume();
+    axisgroup_hdl->zoom_begin.setValue(zoom_begin);
+    axisgroup_hdl->sendAttributToServer(axisgroup_hdl->zoom_begin);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_axisgroup_zoom_begin(axisgroup_Ptr axisgroup_hdl, int* zoom_begin)
+  {
+    *zoom_begin = axisgroup_hdl->zoom_begin.getValue();
+  }
+  
+  
+  void cxios_set_axisgroup_zoom_end(axisgroup_Ptr axisgroup_hdl, int zoom_end)
+  {
+     CTimer::get("XIOS").resume();
+    axisgroup_hdl->zoom_end.setValue(zoom_end);
+    axisgroup_hdl->sendAttributToServer(axisgroup_hdl->zoom_end);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_axisgroup_zoom_end(axisgroup_Ptr axisgroup_hdl, int* zoom_end)
+  {
+    *zoom_end = axisgroup_hdl->zoom_end.getValue();
+  }
+  
+  
+  void cxios_set_axisgroup_zoom_size(axisgroup_Ptr axisgroup_hdl, int zoom_size)
+  {
+     CTimer::get("XIOS").resume();
+    axisgroup_hdl->zoom_size.setValue(zoom_size);
+    axisgroup_hdl->sendAttributToServer(axisgroup_hdl->zoom_size);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_axisgroup_zoom_size(axisgroup_Ptr axisgroup_hdl, int* zoom_size)
+  {
+    *zoom_size = axisgroup_hdl->zoom_size.getValue();
   }
   
Index: XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/iccontext_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "context.hpp"
+#include "node_type.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icdomain_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "domain.hpp"
+#include "node_type.hpp"
 
 extern "C"
@@ -33,8 +33,7 @@
   void cxios_set_domain_data_i_index(domain_Ptr domain_hdl, int* data_i_index, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(int,1) array_tmp(new CArray<int,1>(boost::extents[extent1]));
-    std::copy(data_i_index, &(data_i_index[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->data_i_index.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<int,1> tmp(data_i_index,shape(extent1),neverDeleteData) ;
+    domain_hdl->data_i_index.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->data_i_index);
   }
@@ -42,6 +41,6 @@
   void cxios_get_domain_data_i_index(domain_Ptr domain_hdl, int* data_i_index, int extent1)
   {
-    if (!array_copy(domain_hdl->data_i_index.getValue(), data_i_index, extent1))
-     ERROR("void cxios_set_domain_data_i_index(domain_Ptr domain_hdl, int* data_i_index, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<int,1> tmp(data_i_index,shape(extent1),neverDeleteData) ;
+    tmp=domain_hdl->data_i_index ;
      CTimer::get("XIOS").suspend();
   }
@@ -64,8 +63,7 @@
   void cxios_set_domain_data_j_index(domain_Ptr domain_hdl, int* data_j_index, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(int,1) array_tmp(new CArray<int,1>(boost::extents[extent1]));
-    std::copy(data_j_index, &(data_j_index[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->data_j_index.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<int,1> tmp(data_j_index,shape(extent1),neverDeleteData) ;
+    domain_hdl->data_j_index.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->data_j_index);
   }
@@ -73,6 +71,6 @@
   void cxios_get_domain_data_j_index(domain_Ptr domain_hdl, int* data_j_index, int extent1)
   {
-    if (!array_copy(domain_hdl->data_j_index.getValue(), data_j_index, extent1))
-     ERROR("void cxios_set_domain_data_j_index(domain_Ptr domain_hdl, int* data_j_index, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<int,1> tmp(data_j_index,shape(extent1),neverDeleteData) ;
+    tmp=domain_hdl->data_j_index ;
      CTimer::get("XIOS").suspend();
   }
@@ -212,8 +210,7 @@
   void cxios_set_domain_latvalue(domain_Ptr domain_hdl, double* latvalue, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
-    std::copy(latvalue, &(latvalue[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->latvalue.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(latvalue,shape(extent1),neverDeleteData) ;
+    domain_hdl->latvalue.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->latvalue);
   }
@@ -221,6 +218,6 @@
   void cxios_get_domain_latvalue(domain_Ptr domain_hdl, double* latvalue, int extent1)
   {
-    if (!array_copy(domain_hdl->latvalue.getValue(), latvalue, extent1))
-     ERROR("void cxios_set_domain_latvalue(domain_Ptr domain_hdl, double* latvalue, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<double,1> tmp(latvalue,shape(extent1),neverDeleteData) ;
+    tmp=domain_hdl->latvalue ;
      CTimer::get("XIOS").suspend();
   }
@@ -248,8 +245,7 @@
   void cxios_set_domain_lonvalue(domain_Ptr domain_hdl, double* lonvalue, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
-    std::copy(lonvalue, &(lonvalue[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->lonvalue.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(lonvalue,shape(extent1),neverDeleteData) ;
+    domain_hdl->lonvalue.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->lonvalue);
   }
@@ -257,6 +253,6 @@
   void cxios_get_domain_lonvalue(domain_Ptr domain_hdl, double* lonvalue, int extent1)
   {
-    if (!array_copy(domain_hdl->lonvalue.getValue(), lonvalue, extent1))
-     ERROR("void cxios_set_domain_lonvalue(domain_Ptr domain_hdl, double* lonvalue, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<double,1> tmp(lonvalue,shape(extent1),neverDeleteData) ;
+    tmp=domain_hdl->lonvalue ;
      CTimer::get("XIOS").suspend();
   }
@@ -265,8 +261,7 @@
   void cxios_set_domain_mask(domain_Ptr domain_hdl, bool* mask, int extent1, int extent2)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(bool,2) array_tmp(new CArray<bool,2>(boost::extents[extent1][extent2]));
-    std::copy(mask, &(mask[array_tmp->num_elements()]), array_tmp->data());
-    domain_hdl->mask.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<bool,2> tmp(mask,shape(extent1,extent2),neverDeleteData) ;
+    domain_hdl->mask.reference(tmp.copy());
     domain_hdl->sendAttributToServer(domain_hdl->mask);
   }
@@ -274,6 +269,6 @@
   void cxios_get_domain_mask(domain_Ptr domain_hdl, bool* mask, int extent1, int extent2)
   {
-    if (!array_copy(domain_hdl->mask.getValue(), mask, extent1, extent2))
-     ERROR("void cxios_set_domain_mask(domain_Ptr domain_hdl, bool* mask, int extent1, int extent2)",<<"Output array size is not conform to array size attribute") ;
+    CArray<bool,2> tmp(mask,shape(extent1,extent2),neverDeleteData) ;
+    tmp=domain_hdl->mask ;
      CTimer::get("XIOS").suspend();
   }
Index: XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icdomaingroup_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "domain.hpp"
+#include "node_type.hpp"
 
 extern "C"
@@ -33,8 +33,7 @@
   void cxios_set_domaingroup_data_i_index(domaingroup_Ptr domaingroup_hdl, int* data_i_index, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(int,1) array_tmp(new CArray<int,1>(boost::extents[extent1]));
-    std::copy(data_i_index, &(data_i_index[array_tmp->num_elements()]), array_tmp->data());
-    domaingroup_hdl->data_i_index.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<int,1> tmp(data_i_index,shape(extent1),neverDeleteData) ;
+    domaingroup_hdl->data_i_index.reference(tmp.copy());
     domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_i_index);
   }
@@ -42,6 +41,6 @@
   void cxios_get_domaingroup_data_i_index(domaingroup_Ptr domaingroup_hdl, int* data_i_index, int extent1)
   {
-    if (!array_copy(domaingroup_hdl->data_i_index.getValue(), data_i_index, extent1))
-     ERROR("void cxios_set_domaingroup_data_i_index(domaingroup_Ptr domaingroup_hdl, int* data_i_index, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<int,1> tmp(data_i_index,shape(extent1),neverDeleteData) ;
+    tmp=domaingroup_hdl->data_i_index ;
      CTimer::get("XIOS").suspend();
   }
@@ -64,8 +63,7 @@
   void cxios_set_domaingroup_data_j_index(domaingroup_Ptr domaingroup_hdl, int* data_j_index, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(int,1) array_tmp(new CArray<int,1>(boost::extents[extent1]));
-    std::copy(data_j_index, &(data_j_index[array_tmp->num_elements()]), array_tmp->data());
-    domaingroup_hdl->data_j_index.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<int,1> tmp(data_j_index,shape(extent1),neverDeleteData) ;
+    domaingroup_hdl->data_j_index.reference(tmp.copy());
     domaingroup_hdl->sendAttributToServer(domaingroup_hdl->data_j_index);
   }
@@ -73,6 +71,6 @@
   void cxios_get_domaingroup_data_j_index(domaingroup_Ptr domaingroup_hdl, int* data_j_index, int extent1)
   {
-    if (!array_copy(domaingroup_hdl->data_j_index.getValue(), data_j_index, extent1))
-     ERROR("void cxios_set_domaingroup_data_j_index(domaingroup_Ptr domaingroup_hdl, int* data_j_index, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<int,1> tmp(data_j_index,shape(extent1),neverDeleteData) ;
+    tmp=domaingroup_hdl->data_j_index ;
      CTimer::get("XIOS").suspend();
   }
@@ -231,8 +229,7 @@
   void cxios_set_domaingroup_latvalue(domaingroup_Ptr domaingroup_hdl, double* latvalue, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
-    std::copy(latvalue, &(latvalue[array_tmp->num_elements()]), array_tmp->data());
-    domaingroup_hdl->latvalue.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(latvalue,shape(extent1),neverDeleteData) ;
+    domaingroup_hdl->latvalue.reference(tmp.copy());
     domaingroup_hdl->sendAttributToServer(domaingroup_hdl->latvalue);
   }
@@ -240,6 +237,6 @@
   void cxios_get_domaingroup_latvalue(domaingroup_Ptr domaingroup_hdl, double* latvalue, int extent1)
   {
-    if (!array_copy(domaingroup_hdl->latvalue.getValue(), latvalue, extent1))
-     ERROR("void cxios_set_domaingroup_latvalue(domaingroup_Ptr domaingroup_hdl, double* latvalue, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<double,1> tmp(latvalue,shape(extent1),neverDeleteData) ;
+    tmp=domaingroup_hdl->latvalue ;
      CTimer::get("XIOS").suspend();
   }
@@ -267,8 +264,7 @@
   void cxios_set_domaingroup_lonvalue(domaingroup_Ptr domaingroup_hdl, double* lonvalue, int extent1)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(double,1) array_tmp(new CArray<double,1>(boost::extents[extent1]));
-    std::copy(lonvalue, &(lonvalue[array_tmp->num_elements()]), array_tmp->data());
-    domaingroup_hdl->lonvalue.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<double,1> tmp(lonvalue,shape(extent1),neverDeleteData) ;
+    domaingroup_hdl->lonvalue.reference(tmp.copy());
     domaingroup_hdl->sendAttributToServer(domaingroup_hdl->lonvalue);
   }
@@ -276,6 +272,6 @@
   void cxios_get_domaingroup_lonvalue(domaingroup_Ptr domaingroup_hdl, double* lonvalue, int extent1)
   {
-    if (!array_copy(domaingroup_hdl->lonvalue.getValue(), lonvalue, extent1))
-     ERROR("void cxios_set_domaingroup_lonvalue(domaingroup_Ptr domaingroup_hdl, double* lonvalue, int extent1)",<<"Output array size is not conform to array size attribute") ;
+    CArray<double,1> tmp(lonvalue,shape(extent1),neverDeleteData) ;
+    tmp=domaingroup_hdl->lonvalue ;
      CTimer::get("XIOS").suspend();
   }
@@ -284,8 +280,7 @@
   void cxios_set_domaingroup_mask(domaingroup_Ptr domaingroup_hdl, bool* mask, int extent1, int extent2)
   {
-     CTimer::get("XIOS").resume();
-    ARRAY(bool,2) array_tmp(new CArray<bool,2>(boost::extents[extent1][extent2]));
-    std::copy(mask, &(mask[array_tmp->num_elements()]), array_tmp->data());
-    domaingroup_hdl->mask.setValue(array_tmp);
+    CTimer::get("XIOS").resume();
+    CArray<bool,2> tmp(mask,shape(extent1,extent2),neverDeleteData) ;
+    domaingroup_hdl->mask.reference(tmp.copy());
     domaingroup_hdl->sendAttributToServer(domaingroup_hdl->mask);
   }
@@ -293,6 +288,6 @@
   void cxios_get_domaingroup_mask(domaingroup_Ptr domaingroup_hdl, bool* mask, int extent1, int extent2)
   {
-    if (!array_copy(domaingroup_hdl->mask.getValue(), mask, extent1, extent2))
-     ERROR("void cxios_set_domaingroup_mask(domaingroup_Ptr domaingroup_hdl, bool* mask, int extent1, int extent2)",<<"Output array size is not conform to array size attribute") ;
+    CArray<bool,2> tmp(mask,shape(extent1,extent2),neverDeleteData) ;
+    tmp=domaingroup_hdl->mask ;
      CTimer::get("XIOS").suspend();
   }
Index: XIOS/trunk/src/interface/c_attr/icfield_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "field.hpp"
+#include "node_type.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "field.hpp"
+#include "node_type.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icfile_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "file.hpp"
+#include "node_type.hpp"
 
 extern "C"
@@ -183,5 +183,5 @@
     if(!cstr2string(type, type_size, type_str)) return;
      CTimer::get("XIOS").resume();
-    file_hdl->type.setValue(type_str);
+    file_hdl->type.fromString(type_str);
     file_hdl->sendAttributToServer(file_hdl->type);
      CTimer::get("XIOS").suspend();
@@ -191,5 +191,5 @@
   {
      CTimer::get("XIOS").resume();
-    if(!string_copy(file_hdl->type.getValue(),type , type_size))
+    if(!string_copy(file_hdl->type.getStringValue(),type , type_size))
       ERROR("void cxios_get_file_type(file_Ptr file_hdl, char * type, int type_size)", <<"Input string is to short");
      CTimer::get("XIOS").suspend();
Index: XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "file.hpp"
+#include "node_type.hpp"
 
 extern "C"
@@ -202,5 +202,5 @@
     if(!cstr2string(type, type_size, type_str)) return;
      CTimer::get("XIOS").resume();
-    filegroup_hdl->type.setValue(type_str);
+    filegroup_hdl->type.fromString(type_str);
     filegroup_hdl->sendAttributToServer(filegroup_hdl->type);
      CTimer::get("XIOS").suspend();
@@ -210,5 +210,5 @@
   {
      CTimer::get("XIOS").resume();
-    if(!string_copy(filegroup_hdl->type.getValue(),type , type_size))
+    if(!string_copy(filegroup_hdl->type.getStringValue(),type , type_size))
       ERROR("void cxios_get_filegroup_type(filegroup_Ptr filegroup_hdl, char * type, int type_size)", <<"Input string is to short");
      CTimer::get("XIOS").suspend();
Index: XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icgrid_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "grid.hpp"
+#include "node_type.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp	(revision 368)
+++ XIOS/trunk/src/interface/c_attr/icgridgroup_attr.cpp	(revision 369)
@@ -11,5 +11,5 @@
 #include "icutil.hpp"
 #include "timer.hpp"
-#include "grid.hpp"
+#include "node_type.hpp"
 
 extern "C"
Index: XIOS/trunk/src/interface/fortran_attr/axis_interface_attr.f90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/axis_interface_attr.f90	(revision 368)
+++ XIOS/trunk/src/interface/fortran_attr/axis_interface_attr.f90	(revision 369)
@@ -97,4 +97,43 @@
     
     
+    SUBROUTINE cxios_set_axis_zoom_begin(axis_hdl, zoom_begin) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      INTEGER (KIND=C_INT)      , VALUE :: zoom_begin
+    END SUBROUTINE cxios_set_axis_zoom_begin
+    
+    SUBROUTINE cxios_get_axis_zoom_begin(axis_hdl, zoom_begin) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      INTEGER (KIND=C_INT)             :: zoom_begin
+    END SUBROUTINE cxios_get_axis_zoom_begin
+    
+    
+    SUBROUTINE cxios_set_axis_zoom_end(axis_hdl, zoom_end) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      INTEGER (KIND=C_INT)      , VALUE :: zoom_end
+    END SUBROUTINE cxios_set_axis_zoom_end
+    
+    SUBROUTINE cxios_get_axis_zoom_end(axis_hdl, zoom_end) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      INTEGER (KIND=C_INT)             :: zoom_end
+    END SUBROUTINE cxios_get_axis_zoom_end
+    
+    
+    SUBROUTINE cxios_set_axis_zoom_size(axis_hdl, zoom_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      INTEGER (KIND=C_INT)      , VALUE :: zoom_size
+    END SUBROUTINE cxios_set_axis_zoom_size
+    
+    SUBROUTINE cxios_get_axis_zoom_size(axis_hdl, zoom_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl
+      INTEGER (KIND=C_INT)             :: zoom_size
+    END SUBROUTINE cxios_get_axis_zoom_size
+    
+    
     END INTERFACE
   
Index: XIOS/trunk/src/interface/fortran_attr/axisgroup_interface_attr.f90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/axisgroup_interface_attr.f90	(revision 368)
+++ XIOS/trunk/src/interface/fortran_attr/axisgroup_interface_attr.f90	(revision 369)
@@ -112,4 +112,43 @@
     
     
+    SUBROUTINE cxios_set_axisgroup_zoom_begin(axisgroup_hdl, zoom_begin) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      INTEGER (KIND=C_INT)      , VALUE :: zoom_begin
+    END SUBROUTINE cxios_set_axisgroup_zoom_begin
+    
+    SUBROUTINE cxios_get_axisgroup_zoom_begin(axisgroup_hdl, zoom_begin) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      INTEGER (KIND=C_INT)             :: zoom_begin
+    END SUBROUTINE cxios_get_axisgroup_zoom_begin
+    
+    
+    SUBROUTINE cxios_set_axisgroup_zoom_end(axisgroup_hdl, zoom_end) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      INTEGER (KIND=C_INT)      , VALUE :: zoom_end
+    END SUBROUTINE cxios_set_axisgroup_zoom_end
+    
+    SUBROUTINE cxios_get_axisgroup_zoom_end(axisgroup_hdl, zoom_end) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      INTEGER (KIND=C_INT)             :: zoom_end
+    END SUBROUTINE cxios_get_axisgroup_zoom_end
+    
+    
+    SUBROUTINE cxios_set_axisgroup_zoom_size(axisgroup_hdl, zoom_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      INTEGER (KIND=C_INT)      , VALUE :: zoom_size
+    END SUBROUTINE cxios_set_axisgroup_zoom_size
+    
+    SUBROUTINE cxios_get_axisgroup_zoom_size(axisgroup_hdl, zoom_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl
+      INTEGER (KIND=C_INT)             :: zoom_size
+    END SUBROUTINE cxios_get_axisgroup_zoom_size
+    
+    
     END INTERFACE
   
Index: XIOS/trunk/src/interface/fortran_attr/iaxis_attr.F90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/iaxis_attr.F90	(revision 368)
+++ XIOS/trunk/src/interface/fortran_attr/iaxis_attr.F90	(revision 369)
@@ -12,5 +12,6 @@
   
   SUBROUTINE xios(set_axis_attr)  &
-    ( axis_id, long_name, name, size, standard_name, unit, value )
+    ( axis_id, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end, zoom_size  &
+     )
     
     IMPLICIT NONE
@@ -23,13 +24,18 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: value(:)
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_begin
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_end
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_size
       
       CALL xios(get_axis_handle)(axis_id,axis_hdl)
       CALL xios(set_axis_attr_hdl_)   &
-      ( axis_hdl, long_name, name, size, standard_name, unit, value )
+      ( axis_hdl, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end, zoom_size  &
+       )
     
   END SUBROUTINE xios(set_axis_attr)
   
   SUBROUTINE xios(set_axis_attr_hdl)  &
-    ( axis_hdl, long_name, name, size, standard_name, unit, value )
+    ( axis_hdl, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end, zoom_size  &
+     )
     
     IMPLICIT NONE
@@ -41,12 +47,17 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: value(:)
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_begin
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_end
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_size
       
       CALL xios(set_axis_attr_hdl_)  &
-      ( axis_hdl, long_name, name, size, standard_name, unit, value )
+      ( axis_hdl, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end, zoom_size  &
+       )
     
   END SUBROUTINE xios(set_axis_attr_hdl)
   
   SUBROUTINE xios(set_axis_attr_hdl_)   &
-    ( axis_hdl, long_name_, name_, size_, standard_name_, unit_, value_ )
+    ( axis_hdl, long_name_, name_, size_, standard_name_, unit_, value_, zoom_begin_, zoom_end_  &
+    , zoom_size_ )
     
     IMPLICIT NONE
@@ -58,4 +69,7 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: value_(:)
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_begin_
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_end_
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_size_
       
       IF (PRESENT(long_name_)) THEN
@@ -83,4 +97,16 @@
       ENDIF
       
+      IF (PRESENT(zoom_begin_)) THEN
+        CALL cxios_set_axis_zoom_begin(axis_hdl%daddr, zoom_begin_)
+      ENDIF
+      
+      IF (PRESENT(zoom_end_)) THEN
+        CALL cxios_set_axis_zoom_end(axis_hdl%daddr, zoom_end_)
+      ENDIF
+      
+      IF (PRESENT(zoom_size_)) THEN
+        CALL cxios_set_axis_zoom_size(axis_hdl%daddr, zoom_size_)
+      ENDIF
+      
       
     
@@ -88,5 +114,6 @@
   
   SUBROUTINE xios(get_axis_attr)  &
-    ( axis_id, long_name, name, size, standard_name, unit, value )
+    ( axis_id, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end, zoom_size  &
+     )
     
     IMPLICIT NONE
@@ -99,13 +126,18 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: value(:)
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_begin
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_end
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_size
       
       CALL xios(get_axis_handle)(axis_id,axis_hdl)
       CALL xios(get_axis_attr_hdl_)   &
-      ( axis_hdl, long_name, name, size, standard_name, unit, value )
+      ( axis_hdl, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end, zoom_size  &
+       )
     
   END SUBROUTINE xios(get_axis_attr)
   
   SUBROUTINE xios(get_axis_attr_hdl)  &
-    ( axis_hdl, long_name, name, size, standard_name, unit, value )
+    ( axis_hdl, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end, zoom_size  &
+     )
     
     IMPLICIT NONE
@@ -117,12 +149,17 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: value(:)
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_begin
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_end
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_size
       
       CALL xios(get_axis_attr_hdl_)  &
-      ( axis_hdl, long_name, name, size, standard_name, unit, value )
+      ( axis_hdl, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end, zoom_size  &
+       )
     
   END SUBROUTINE xios(get_axis_attr_hdl)
   
   SUBROUTINE xios(get_axis_attr_hdl_)   &
-    ( axis_hdl, long_name_, name_, size_, standard_name_, unit_, value_ )
+    ( axis_hdl, long_name_, name_, size_, standard_name_, unit_, value_, zoom_begin_, zoom_end_  &
+    , zoom_size_ )
     
     IMPLICIT NONE
@@ -134,4 +171,7 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: value_(:)
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_begin_
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_end_
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_size_
       
       IF (PRESENT(long_name_)) THEN
@@ -159,4 +199,16 @@
       ENDIF
       
+      IF (PRESENT(zoom_begin_)) THEN
+        CALL cxios_get_axis_zoom_begin(axis_hdl%daddr, zoom_begin_)
+      ENDIF
+      
+      IF (PRESENT(zoom_end_)) THEN
+        CALL cxios_get_axis_zoom_end(axis_hdl%daddr, zoom_end_)
+      ENDIF
+      
+      IF (PRESENT(zoom_size_)) THEN
+        CALL cxios_get_axis_zoom_size(axis_hdl%daddr, zoom_size_)
+      ENDIF
+      
       
     
Index: XIOS/trunk/src/interface/fortran_attr/iaxisgroup_attr.F90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/iaxisgroup_attr.F90	(revision 368)
+++ XIOS/trunk/src/interface/fortran_attr/iaxisgroup_attr.F90	(revision 369)
@@ -12,5 +12,6 @@
   
   SUBROUTINE xios(set_axisgroup_attr)  &
-    ( axisgroup_id, group_ref, long_name, name, size, standard_name, unit, value )
+    ( axisgroup_id, group_ref, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end  &
+    , zoom_size )
     
     IMPLICIT NONE
@@ -24,13 +25,18 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: value(:)
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_begin
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_end
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_size
       
       CALL xios(get_axisgroup_handle)(axisgroup_id,axisgroup_hdl)
       CALL xios(set_axisgroup_attr_hdl_)   &
-      ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value )
+      ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end  &
+      , zoom_size )
     
   END SUBROUTINE xios(set_axisgroup_attr)
   
   SUBROUTINE xios(set_axisgroup_attr_hdl)  &
-    ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value )
+    ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end  &
+    , zoom_size )
     
     IMPLICIT NONE
@@ -43,12 +49,17 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: value(:)
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_begin
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_end
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_size
       
       CALL xios(set_axisgroup_attr_hdl_)  &
-      ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value )
+      ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end  &
+      , zoom_size )
     
   END SUBROUTINE xios(set_axisgroup_attr_hdl)
   
   SUBROUTINE xios(set_axisgroup_attr_hdl_)   &
-    ( axisgroup_hdl, group_ref_, long_name_, name_, size_, standard_name_, unit_, value_ )
+    ( axisgroup_hdl, group_ref_, long_name_, name_, size_, standard_name_, unit_, value_, zoom_begin_  &
+    , zoom_end_, zoom_size_ )
     
     IMPLICIT NONE
@@ -61,4 +72,7 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: value_(:)
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_begin_
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_end_
+      INTEGER  , OPTIONAL, INTENT(IN) :: zoom_size_
       
       IF (PRESENT(group_ref_)) THEN
@@ -90,4 +104,16 @@
       ENDIF
       
+      IF (PRESENT(zoom_begin_)) THEN
+        CALL cxios_set_axisgroup_zoom_begin(axisgroup_hdl%daddr, zoom_begin_)
+      ENDIF
+      
+      IF (PRESENT(zoom_end_)) THEN
+        CALL cxios_set_axisgroup_zoom_end(axisgroup_hdl%daddr, zoom_end_)
+      ENDIF
+      
+      IF (PRESENT(zoom_size_)) THEN
+        CALL cxios_set_axisgroup_zoom_size(axisgroup_hdl%daddr, zoom_size_)
+      ENDIF
+      
       
     
@@ -95,5 +121,6 @@
   
   SUBROUTINE xios(get_axisgroup_attr)  &
-    ( axisgroup_id, group_ref, long_name, name, size, standard_name, unit, value )
+    ( axisgroup_id, group_ref, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end  &
+    , zoom_size )
     
     IMPLICIT NONE
@@ -107,13 +134,18 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: value(:)
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_begin
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_end
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_size
       
       CALL xios(get_axisgroup_handle)(axisgroup_id,axisgroup_hdl)
       CALL xios(get_axisgroup_attr_hdl_)   &
-      ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value )
+      ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end  &
+      , zoom_size )
     
   END SUBROUTINE xios(get_axisgroup_attr)
   
   SUBROUTINE xios(get_axisgroup_attr_hdl)  &
-    ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value )
+    ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end  &
+    , zoom_size )
     
     IMPLICIT NONE
@@ -126,12 +158,17 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: value(:)
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_begin
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_end
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_size
       
       CALL xios(get_axisgroup_attr_hdl_)  &
-      ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value )
+      ( axisgroup_hdl, group_ref, long_name, name, size, standard_name, unit, value, zoom_begin, zoom_end  &
+      , zoom_size )
     
   END SUBROUTINE xios(get_axisgroup_attr_hdl)
   
   SUBROUTINE xios(get_axisgroup_attr_hdl_)   &
-    ( axisgroup_hdl, group_ref_, long_name_, name_, size_, standard_name_, unit_, value_ )
+    ( axisgroup_hdl, group_ref_, long_name_, name_, size_, standard_name_, unit_, value_, zoom_begin_  &
+    , zoom_end_, zoom_size_ )
     
     IMPLICIT NONE
@@ -144,4 +181,7 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: value_(:)
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_begin_
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_end_
+      INTEGER  , OPTIONAL, INTENT(OUT) :: zoom_size_
       
       IF (PRESENT(group_ref_)) THEN
@@ -173,4 +213,16 @@
       ENDIF
       
+      IF (PRESENT(zoom_begin_)) THEN
+        CALL cxios_get_axisgroup_zoom_begin(axisgroup_hdl%daddr, zoom_begin_)
+      ENDIF
+      
+      IF (PRESENT(zoom_end_)) THEN
+        CALL cxios_get_axisgroup_zoom_end(axisgroup_hdl%daddr, zoom_end_)
+      ENDIF
+      
+      IF (PRESENT(zoom_size_)) THEN
+        CALL cxios_get_axisgroup_zoom_size(axisgroup_hdl%daddr, zoom_size_)
+      ENDIF
+      
       
     
Index: XIOS/trunk/src/interface/fortran_attr/icontext_attr.F90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/icontext_attr.F90	(revision 368)
+++ XIOS/trunk/src/interface/fortran_attr/icontext_attr.F90	(revision 369)
@@ -12,5 +12,5 @@
   
   SUBROUTINE xios(set_context_attr)  &
-    ( context_id, calendar_type, output_dir, start_date, timestep )
+    ( context_id, calendar_type, output_dir, start_date, time_origin, timestep )
     
     IMPLICIT NONE
@@ -20,14 +20,15 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_dir
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: start_date
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_origin
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timestep
       
       CALL xios(get_context_handle)(context_id,context_hdl)
       CALL xios(set_context_attr_hdl_)   &
-      ( context_hdl, calendar_type, output_dir, start_date, timestep )
+      ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep )
     
   END SUBROUTINE xios(set_context_attr)
   
   SUBROUTINE xios(set_context_attr_hdl)  &
-    ( context_hdl, calendar_type, output_dir, start_date, timestep )
+    ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep )
     
     IMPLICIT NONE
@@ -36,13 +37,14 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_dir
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: start_date
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_origin
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timestep
       
       CALL xios(set_context_attr_hdl_)  &
-      ( context_hdl, calendar_type, output_dir, start_date, timestep )
+      ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep )
     
   END SUBROUTINE xios(set_context_attr_hdl)
   
   SUBROUTINE xios(set_context_attr_hdl_)   &
-    ( context_hdl, calendar_type_, output_dir_, start_date_, timestep_ )
+    ( context_hdl, calendar_type_, output_dir_, start_date_, time_origin_, timestep_ )
     
     IMPLICIT NONE
@@ -51,4 +53,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_dir_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: start_date_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_origin_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timestep_
       
@@ -65,4 +68,8 @@
       ENDIF
       
+      IF (PRESENT(time_origin_)) THEN
+        CALL cxios_set_context_time_origin(context_hdl%daddr, time_origin_, len(time_origin_))
+      ENDIF
+      
       IF (PRESENT(timestep_)) THEN
         CALL cxios_set_context_timestep(context_hdl%daddr, timestep_, len(timestep_))
@@ -74,5 +81,5 @@
   
   SUBROUTINE xios(get_context_attr)  &
-    ( context_id, calendar_type, output_dir, start_date, timestep )
+    ( context_id, calendar_type, output_dir, start_date, time_origin, timestep )
     
     IMPLICIT NONE
@@ -82,14 +89,15 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_dir
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: start_date
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_origin
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timestep
       
       CALL xios(get_context_handle)(context_id,context_hdl)
       CALL xios(get_context_attr_hdl_)   &
-      ( context_hdl, calendar_type, output_dir, start_date, timestep )
+      ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep )
     
   END SUBROUTINE xios(get_context_attr)
   
   SUBROUTINE xios(get_context_attr_hdl)  &
-    ( context_hdl, calendar_type, output_dir, start_date, timestep )
+    ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep )
     
     IMPLICIT NONE
@@ -98,13 +106,14 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_dir
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: start_date
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_origin
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timestep
       
       CALL xios(get_context_attr_hdl_)  &
-      ( context_hdl, calendar_type, output_dir, start_date, timestep )
+      ( context_hdl, calendar_type, output_dir, start_date, time_origin, timestep )
     
   END SUBROUTINE xios(get_context_attr_hdl)
   
   SUBROUTINE xios(get_context_attr_hdl_)   &
-    ( context_hdl, calendar_type_, output_dir_, start_date_, timestep_ )
+    ( context_hdl, calendar_type_, output_dir_, start_date_, time_origin_, timestep_ )
     
     IMPLICIT NONE
@@ -113,4 +122,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_dir_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: start_date_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_origin_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timestep_
       
@@ -127,4 +137,8 @@
       ENDIF
       
+      IF (PRESENT(time_origin_)) THEN
+        CALL cxios_get_context_time_origin(context_hdl%daddr, time_origin_, len(time_origin_))
+      ENDIF
+      
       IF (PRESENT(timestep_)) THEN
         CALL cxios_get_context_timestep(context_hdl%daddr, timestep_, len(timestep_))
Index: XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90	(revision 368)
+++ XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90	(revision 369)
@@ -12,6 +12,6 @@
   
   SUBROUTINE xios(set_file_attr)  &
-    ( file_id, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq  &
-    , type )
+    ( file_id, description, enabled, name, name_suffix, output_freq, output_level, par_access, split_freq  &
+    , sync_freq, type )
     
     IMPLICIT NONE
@@ -25,4 +25,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq
@@ -31,12 +32,12 @@
       CALL xios(get_file_handle)(file_id,file_hdl)
       CALL xios(set_file_attr_hdl_)   &
-      ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq  &
-      , type )
+      ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, par_access, split_freq  &
+      , sync_freq, type )
     
   END SUBROUTINE xios(set_file_attr)
   
   SUBROUTINE xios(set_file_attr_hdl)  &
-    ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq  &
-    , type )
+    ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, par_access, split_freq  &
+    , sync_freq, type )
     
     IMPLICIT NONE
@@ -49,4 +50,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq
@@ -54,12 +56,12 @@
       
       CALL xios(set_file_attr_hdl_)  &
-      ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq  &
-      , type )
+      ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, par_access, split_freq  &
+      , sync_freq, type )
     
   END SUBROUTINE xios(set_file_attr_hdl)
   
   SUBROUTINE xios(set_file_attr_hdl_)   &
-    ( file_hdl, description_, enabled_, name_, name_suffix_, output_freq_, output_level_, split_freq_  &
-    , sync_freq_, type_ )
+    ( file_hdl, description_, enabled_, name_, name_suffix_, output_freq_, output_level_, par_access_  &
+    , split_freq_, sync_freq_, type_ )
     
     IMPLICIT NONE
@@ -72,4 +74,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq_
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq_
@@ -101,4 +104,8 @@
       ENDIF
       
+      IF (PRESENT(par_access_)) THEN
+        CALL cxios_set_file_par_access(file_hdl%daddr, par_access_, len(par_access_))
+      ENDIF
+      
       IF (PRESENT(split_freq_)) THEN
         CALL cxios_set_file_split_freq(file_hdl%daddr, split_freq_, len(split_freq_))
@@ -118,6 +125,6 @@
   
   SUBROUTINE xios(get_file_attr)  &
-    ( file_id, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq  &
-    , type )
+    ( file_id, description, enabled, name, name_suffix, output_freq, output_level, par_access, split_freq  &
+    , sync_freq, type )
     
     IMPLICIT NONE
@@ -131,4 +138,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq
@@ -137,12 +145,12 @@
       CALL xios(get_file_handle)(file_id,file_hdl)
       CALL xios(get_file_attr_hdl_)   &
-      ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq  &
-      , type )
+      ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, par_access, split_freq  &
+      , sync_freq, type )
     
   END SUBROUTINE xios(get_file_attr)
   
   SUBROUTINE xios(get_file_attr_hdl)  &
-    ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq  &
-    , type )
+    ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, par_access, split_freq  &
+    , sync_freq, type )
     
     IMPLICIT NONE
@@ -155,4 +163,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq
@@ -160,12 +169,12 @@
       
       CALL xios(get_file_attr_hdl_)  &
-      ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, split_freq, sync_freq  &
-      , type )
+      ( file_hdl, description, enabled, name, name_suffix, output_freq, output_level, par_access, split_freq  &
+      , sync_freq, type )
     
   END SUBROUTINE xios(get_file_attr_hdl)
   
   SUBROUTINE xios(get_file_attr_hdl_)   &
-    ( file_hdl, description_, enabled_, name_, name_suffix_, output_freq_, output_level_, split_freq_  &
-    , sync_freq_, type_ )
+    ( file_hdl, description_, enabled_, name_, name_suffix_, output_freq_, output_level_, par_access_  &
+    , split_freq_, sync_freq_, type_ )
     
     IMPLICIT NONE
@@ -178,4 +187,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq_
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq_
@@ -207,4 +217,8 @@
       ENDIF
       
+      IF (PRESENT(par_access_)) THEN
+        CALL cxios_get_file_par_access(file_hdl%daddr, par_access_, len(par_access_))
+      ENDIF
+      
       IF (PRESENT(split_freq_)) THEN
         CALL cxios_get_file_split_freq(file_hdl%daddr, split_freq_, len(split_freq_))
Index: XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90	(revision 368)
+++ XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90	(revision 369)
@@ -13,5 +13,5 @@
   SUBROUTINE xios(set_filegroup_attr)  &
     ( filegroup_id, description, enabled, group_ref, name, name_suffix, output_freq, output_level  &
-    , split_freq, sync_freq, type )
+    , par_access, split_freq, sync_freq, type )
     
     IMPLICIT NONE
@@ -26,4 +26,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq
@@ -33,5 +34,5 @@
       CALL xios(set_filegroup_attr_hdl_)   &
       ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level  &
-      , split_freq, sync_freq, type )
+      , par_access, split_freq, sync_freq, type )
     
   END SUBROUTINE xios(set_filegroup_attr)
@@ -39,5 +40,5 @@
   SUBROUTINE xios(set_filegroup_attr_hdl)  &
     ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level  &
-    , split_freq, sync_freq, type )
+    , par_access, split_freq, sync_freq, type )
     
     IMPLICIT NONE
@@ -51,4 +52,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq
@@ -57,5 +59,5 @@
       CALL xios(set_filegroup_attr_hdl_)  &
       ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level  &
-      , split_freq, sync_freq, type )
+      , par_access, split_freq, sync_freq, type )
     
   END SUBROUTINE xios(set_filegroup_attr_hdl)
@@ -63,5 +65,5 @@
   SUBROUTINE xios(set_filegroup_attr_hdl_)   &
     ( filegroup_hdl, description_, enabled_, group_ref_, name_, name_suffix_, output_freq_, output_level_  &
-    , split_freq_, sync_freq_, type_ )
+    , par_access_, split_freq_, sync_freq_, type_ )
     
     IMPLICIT NONE
@@ -75,4 +77,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: output_freq_
       INTEGER  , OPTIONAL, INTENT(IN) :: output_level_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: par_access_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: split_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: sync_freq_
@@ -108,4 +111,8 @@
       ENDIF
       
+      IF (PRESENT(par_access_)) THEN
+        CALL cxios_set_filegroup_par_access(filegroup_hdl%daddr, par_access_, len(par_access_))
+      ENDIF
+      
       IF (PRESENT(split_freq_)) THEN
         CALL cxios_set_filegroup_split_freq(filegroup_hdl%daddr, split_freq_, len(split_freq_))
@@ -126,5 +133,5 @@
   SUBROUTINE xios(get_filegroup_attr)  &
     ( filegroup_id, description, enabled, group_ref, name, name_suffix, output_freq, output_level  &
-    , split_freq, sync_freq, type )
+    , par_access, split_freq, sync_freq, type )
     
     IMPLICIT NONE
@@ -139,4 +146,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq
@@ -146,5 +154,5 @@
       CALL xios(get_filegroup_attr_hdl_)   &
       ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level  &
-      , split_freq, sync_freq, type )
+      , par_access, split_freq, sync_freq, type )
     
   END SUBROUTINE xios(get_filegroup_attr)
@@ -152,5 +160,5 @@
   SUBROUTINE xios(get_filegroup_attr_hdl)  &
     ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level  &
-    , split_freq, sync_freq, type )
+    , par_access, split_freq, sync_freq, type )
     
     IMPLICIT NONE
@@ -164,4 +172,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq
@@ -170,5 +179,5 @@
       CALL xios(get_filegroup_attr_hdl_)  &
       ( filegroup_hdl, description, enabled, group_ref, name, name_suffix, output_freq, output_level  &
-      , split_freq, sync_freq, type )
+      , par_access, split_freq, sync_freq, type )
     
   END SUBROUTINE xios(get_filegroup_attr_hdl)
@@ -176,5 +185,5 @@
   SUBROUTINE xios(get_filegroup_attr_hdl_)   &
     ( filegroup_hdl, description_, enabled_, group_ref_, name_, name_suffix_, output_freq_, output_level_  &
-    , split_freq_, sync_freq_, type_ )
+    , par_access_, split_freq_, sync_freq_, type_ )
     
     IMPLICIT NONE
@@ -188,4 +197,5 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: output_freq_
       INTEGER  , OPTIONAL, INTENT(OUT) :: output_level_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: par_access_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: split_freq_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: sync_freq_
@@ -221,4 +231,8 @@
       ENDIF
       
+      IF (PRESENT(par_access_)) THEN
+        CALL cxios_get_filegroup_par_access(filegroup_hdl%daddr, par_access_, len(par_access_))
+      ENDIF
+      
       IF (PRESENT(split_freq_)) THEN
         CALL cxios_get_filegroup_split_freq(filegroup_hdl%daddr, split_freq_, len(split_freq_))
Index: XIOS/trunk/src/log.hpp
===================================================================
--- XIOS/trunk/src/log.hpp	(revision 368)
+++ XIOS/trunk/src/log.hpp	(revision 369)
@@ -3,4 +3,5 @@
 #include <string>
 #include <iostream>
+#include <string>
 
 namespace xios
Index: XIOS/trunk/src/node/axis.cpp
===================================================================
--- XIOS/trunk/src/node/axis.cpp	(revision 368)
+++ XIOS/trunk/src/node/axis.cpp	(revision 369)
@@ -73,5 +73,5 @@
       this->zoom_size.setValue(zoom_size) ;
       
-      StdSize true_size = value.getValue()->num_elements();
+      StdSize true_size = value.numElements();
       if (size != true_size)
          ERROR("CAxis::checkAttributes(void)",
Index: XIOS/trunk/src/node/axis.hpp
===================================================================
--- XIOS/trunk/src/node/axis.hpp	(revision 368)
+++ XIOS/trunk/src/node/axis.hpp	(revision 369)
@@ -7,4 +7,5 @@
 
 #include "declare_group.hpp"
+#include "attribute_array.hpp"
 
 namespace xios {
Index: XIOS/trunk/src/node/context.cpp
===================================================================
--- XIOS/trunk/src/node/context.cpp	(revision 368)
+++ XIOS/trunk/src/node/context.cpp	(revision 369)
@@ -176,5 +176,5 @@
    
    //----------------------------------------------------------------
-   
+/*
    void CContext::toBinary(StdOStream & os) const
    {
@@ -192,7 +192,7 @@
 #include "node_type.conf"
    }
-   
-   //----------------------------------------------------------------
-   
+*/
+   //----------------------------------------------------------------
+/*
    void CContext::fromBinary(StdIStream & is)
    {
@@ -213,5 +213,5 @@
       
    }
-   
+ */
    
    //----------------------------------------------------------------
Index: XIOS/trunk/src/node/context.hpp
===================================================================
--- XIOS/trunk/src/node/context.hpp	(revision 368)
+++ XIOS/trunk/src/node/context.hpp	(revision 369)
@@ -138,6 +138,6 @@
 
          virtual StdString toString(void) const;
-         virtual void toBinary  (StdOStream & os) const;
-         virtual void fromBinary(StdIStream & is);
+//         virtual void toBinary  (StdOStream & os) const;
+//         virtual void fromBinary(StdIStream & is);
          
       public :
Index: XIOS/trunk/src/node/domain.cpp
===================================================================
--- XIOS/trunk/src/node/domain.cpp	(revision 368)
+++ XIOS/trunk/src/node/domain.cpp	(revision 369)
@@ -13,4 +13,5 @@
 #include "context.hpp"
 #include "context_client.hpp"
+#include "array_new.hpp"
 
 namespace xios {
@@ -20,28 +21,23 @@
    CDomain::CDomain(void)
       : CObjectTemplate<CDomain>(), CDomainAttributes()
-      , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles()
+      , isChecked(false),  relFiles()
       , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub()
       , ibegin_zoom_sub(), jbegin_zoom_sub(), ni_zoom_sub(), nj_zoom_sub()
-      , lonvalue_sub(), latvalue_sub(),lonvalue_srv(new CArray<double,1>())
-      , latvalue_srv(new CArray<double,1>())
+      , lonvalue_sub(), latvalue_sub()
    { /* Ne rien faire de plus */ }
 
    CDomain::CDomain(const StdString & id)
       : CObjectTemplate<CDomain>(id), CDomainAttributes()
-      , isChecked(false), local_mask(new CArray<int, 2>(boost::extents[0][0])), relFiles()
+      , isChecked(false), relFiles()
       , ibegin_sub(), iend_sub(), jbegin_sub(), jend_sub()
       , ibegin_zoom_sub(), jbegin_zoom_sub(),ni_zoom_sub(), nj_zoom_sub()
-      , lonvalue_sub(), latvalue_sub(),lonvalue_srv(new CArray<double,1>())
-      , latvalue_srv(new CArray<double,1>())
+      , lonvalue_sub(), latvalue_sub()
    { /* Ne rien faire de plus */ }
 
    CDomain::~CDomain(void)
    { 
-      this->local_mask.reset();
-      for (StdSize i = 0; i < this->lonvalue_sub.size(); i++)
-      {
-         this->lonvalue_sub[i].reset();
-         this->latvalue_sub[i].reset();
-      }     
+     vector<CArray<double,1>* >::iterator it;
+     for(it=lonvalue_sub.begin();it<lonvalue_sub.end();it++) delete *it;
+     for(it=latvalue_sub.begin();it<latvalue_sub.end();it++) delete *it;
    }
 
@@ -84,5 +80,5 @@
 
    //----------------------------------------------------------------
-
+/*
    void CDomain::fromBinary(StdIStream & is)
    {
@@ -112,5 +108,5 @@
       
 #define CLEAR_ATT(name_)\
-      SuperClassAttribute::operator[](#name_)->clear()
+      SuperClassAttribute::operator[](#name_)->reset()
 
          CLEAR_ATT(mask);
@@ -143,5 +139,5 @@
       }
    }
-
+*/
    //----------------------------------------------------------------
 
@@ -265,8 +261,7 @@
       if (!mask.isEmpty())
       {
-         ARRAY(bool, 2) mask_ = mask.getValue();
          unsigned int niu = ni.getValue(), nju = nj.getValue();
-         if ((mask_->shape()[0] != niu) ||
-             (mask_->shape()[1] != nju))
+         if ((mask.extent(0) != niu) ||
+             (mask.extent(1) != nju))
             ERROR("CDomain::checkAttributes(void)",
                   <<"Le masque n'a pas la mÃªme taille que le domaine local") ;
@@ -278,5 +273,5 @@
                if (i < ibegin_mask && i > iend_mask &&
                    j < jbegin_mask && j > jend_mask )
-                     (*mask_)[i][j] = false;
+                     mask(i,j) = false;
             }
          }
@@ -285,5 +280,5 @@
       { // 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()]);
+         mask.resize(ni,nj) ;
          for (int i = 0; i < ni.getValue(); i++)
          {
@@ -292,11 +287,8 @@
                if (i >= ibegin_mask && i <= iend_mask &&
                    j >= jbegin_mask && j <= jend_mask )
-                     (*__arr)[i][j] = true;
-               else  (*__arr)[i][j] = false;
+                     mask(i,j) = true;
+               else  mask(i,j) = false;
             }
          }
-               
-         mask.setValue(__arr);
-         __arr.reset();
       }
    }
@@ -355,5 +347,5 @@
       if (!data_i_index.isEmpty())
       {
-         int ssize = data_i_index.getValue()->size();
+         int ssize = data_i_index.numElements();
          if (!data_n_index.isEmpty() &&
             (data_n_index.getValue() != ssize))
@@ -368,5 +360,5 @@
          {
             if (!data_j_index.isEmpty() &&
-               (data_j_index.getValue()->size() != data_i_index.getValue()->size()))
+               (data_j_index.numElements() != data_i_index.numElements()))
             {
                ERROR("CDomain::checkAttributes(void)",
@@ -392,20 +384,15 @@
          {
             const int dni = data_ni.getValue();
-            ARRAY_CREATE(__arri, int, 1, [dni]);
+            data_i_index.resize(dni) ;
             data_n_index.setValue(dni);
-            for (int i = 0; i < dni; i++)
-               (*__arri)[i] = i+1 ;
-            data_i_index.setValue(__arri) ;
+            for (int i = 0; i < dni; i++) data_i_index(i) = i+1 ;
          }
          else   // (data_dim == 2)
          {
             const int dni = data_ni.getValue() * data_nj.getValue();
+            data_i_index.resize(dni) ;
+            data_j_index.resize(dni) ;
             
-            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++)
             
             for(int count = 0, j = 0; j  < data_nj.getValue(); j++)
@@ -413,12 +400,8 @@
                for(int i = 0; i < data_ni.getValue(); i++, count++)
                {
-                  (*__arri)[count] = i+1 ;
-                  (*__arrj)[count] = j+1 ;
+                  data_i_index(count) = i+1 ;
+                  data_j_index(count) = j+1 ;
                }
             }
-            data_i_index.setValue(__arri) ;
-            data_j_index.setValue(__arrj) ;            
-            __arri.reset();
-            __arrj.reset();
          }
       }
@@ -429,6 +412,6 @@
    void CDomain::completeLonLatClient(void)
    {
-      ARRAY_CREATE(lonvalue_temp, double, 1, [0]);
-      ARRAY_CREATE(latvalue_temp, double, 1, [0]);
+      CArray<double,1> lonvalue_temp ;
+      CArray<double,1> latvalue_temp ;
       
       const int zoom_ibegin_client  = zoom_ibegin_loc.getValue(),
@@ -437,13 +420,10 @@
                 zoom_nj_client      = zoom_nj_loc.getValue();
                 
-      ARRAY(double, 1) lonvalue_ = this->lonvalue.getValue(),
-                       latvalue_ = this->latvalue.getValue();
-                
       if (this->data_dim.getValue() == 2)
       {
          StdSize dm = zoom_ni_client * zoom_nj_client;
 
-         lonvalue_temp->resize(boost::extents[dm]);
-         latvalue_temp->resize(boost::extents[dm]);
+         lonvalue_temp.resize(dm);
+         latvalue_temp.resize(dm);
          
          for (int i = 0; i < zoom_ni_client; i++)
@@ -451,30 +431,31 @@
             for (int j = 0; j < zoom_nj_client; j++)
             {
-               (*lonvalue_temp)[i + j * zoom_ni_client] =
-               (*lonvalue_)[(i + zoom_ibegin_client -1)+(j + zoom_jbegin_client -1)*ni.getValue()];              
-               (*latvalue_temp)[i + j * zoom_ni_client] =
-               (*latvalue_)[(i + zoom_ibegin_client -1)+(j + zoom_jbegin_client -1)*ni.getValue()];
+               lonvalue_temp(i + j * zoom_ni_client) = lonvalue( (i + zoom_ibegin_client -1) + (j + zoom_jbegin_client -1)*ni.getValue() ); 
+               latvalue_temp(i + j * zoom_ni_client) = latvalue( (i + zoom_ibegin_client -1)+(j + zoom_jbegin_client -1)*ni.getValue() );
             }
          }
-         this->lonvalue.setValue(lonvalue_temp);
-         this->latvalue.setValue(latvalue_temp);
+         lonvalue.reference(lonvalue_temp.copy()) ;
+         latvalue.reference(latvalue_temp.copy()) ;
+         cout<<lonvalue<<endl ;
+         cout<<latvalue<<endl ;
       }
       else
       {
-         lonvalue_temp->resize(boost::extents[zoom_ni_client]);
-         latvalue_temp->resize(boost::extents[zoom_nj_client]);
-         
+         lonvalue_temp.resize(zoom_ni_client);
+         latvalue_temp.resize(zoom_nj_client);
+
+// Attention ici Ã  revoir, probablement faux         
          for (int i = zoom_ibegin_client - 1; i < (zoom_ni_client - zoom_ibegin_client + 1); i++)
          {
-            (*lonvalue_temp)[i] = (*lonvalue_)[i]; 
-         }
-         
-         for (int j = zoom_ibegin_client - 1; j < (zoom_nj_client - zoom_jbegin_client + 1); j++)
-         {
-            (*latvalue_temp)[j] = (*latvalue_)[j];
-         }
-         
-         this->lonvalue.setValue(lonvalue_temp);
-         this->latvalue.setValue(latvalue_temp);
+            lonvalue_temp(i) = lonvalue(i); 
+         }
+         
+         for (int j = zoom_jbegin_client - 1; j < (zoom_nj_client - zoom_jbegin_client + 1); j++)
+         {
+            latvalue_temp(j) = latvalue(j);
+         }
+         
+         lonvalue.reference(lonvalue_temp.copy()) ;
+         latvalue.reference(latvalue_temp.copy()) ;
       }  
    }
@@ -484,6 +465,6 @@
    void CDomain::completeLonLatServer(void)
    {
-      ARRAY_CREATE(lonvalue_temp, double, 1, [0]);
-      ARRAY_CREATE(latvalue_temp, double, 1, [0]);
+      CArray<double,1> lonvalue_temp ;
+      CArray<double,1> latvalue_temp ;
       
       const int ibegin_serv     = ibegin.getValue(),
@@ -499,11 +480,12 @@
          StdSize dm = zoom_ni_serv * zoom_nj_serv;      
          
-         lonvalue_temp->resize(boost::extents[dm]);
-         latvalue_temp->resize(boost::extents[dm]);
+         lonvalue_temp.resize(dm);
+         latvalue_temp.resize(dm);
          
          for (StdSize k = 0; k < lonvalue_sub.size(); k++)
          {
-            ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k],
-                             latvalue_loc = this->latvalue_sub[k];
+            CArray<double,1> lonvalue_loc(*(lonvalue_sub[k])) ;
+            CArray<double,1> latvalue_loc (*(latvalue_sub[k]));
+            
             const int zoom_ibegin_cl = ibegin_zoom_sub[k], zoom_ni_cl = ni_zoom_sub[k],
                       zoom_jbegin_cl = jbegin_zoom_sub[k], zoom_nj_cl = nj_zoom_sub[k],
@@ -518,36 +500,34 @@
                   int ii = i + (ibegin_cl-1) - (ibegin_serv - 1) + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1);
                   int jj = j + (jbegin_cl-1) - (jbegin_serv - 1) + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1);
-                  (*lonvalue_temp)[ii + jj * zoom_ni_serv] =
-                  (*lonvalue_loc)[i + j * zoom_ni_cl];
-                  (*latvalue_temp)[ii + jj * zoom_ni_serv] = 
-                  (*latvalue_loc)[i + j * zoom_ni_cl];
+                  lonvalue_temp(ii + jj * zoom_ni_serv) = lonvalue_loc(i + j * zoom_ni_cl);
+                  latvalue_temp(ii + jj * zoom_ni_serv) = latvalue_loc(i + j * zoom_ni_cl);
                }
             }
          }
-         this->lonvalue.setValue(lonvalue_temp);
-         this->latvalue.setValue(latvalue_temp);
+         
+         lonvalue.reference(lonvalue_temp.copy()) ;
+         latvalue.reference(latvalue_temp.copy()) ;
       }
       else
       {
-         lonvalue_temp->resize(boost::extents[zoom_ni_serv]);
-         latvalue_temp->resize(boost::extents[zoom_nj_serv]);
+         lonvalue_temp.resize(zoom_ni_serv);
+         latvalue_temp.resize(zoom_nj_serv);
          
          for (StdSize k = 0; k < lonvalue_sub.size(); k++)
          {
-            ARRAY(double, 1) lonvalue_loc = this->lonvalue_sub[k],
-                             latvalue_loc = this->latvalue_sub[k];
+            CArray<double,1> lonvalue_loc(*(lonvalue_sub[k]));
+            CArray<double,1> latvalue_loc(*(latvalue_sub[k]));
+            
             const int zoom_ibegin_cl = ibegin_zoom_sub[k], zoom_ni_cl = ni_zoom_sub[k],
                       zoom_jbegin_cl = jbegin_zoom_sub[k], zoom_nj_cl = nj_zoom_sub[k];
                       
             for (int i = 0; i < zoom_ni_cl; i++)
-               (*lonvalue_temp)[i /*- (ibegin_serv - 1)*/ + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1)] =
-               (*lonvalue_loc)[i];
+              lonvalue_temp(i /*- (ibegin_serv - 1)*/ + (zoom_ibegin_cl - 1) - (ibegin_zoom_srv - 1)) = lonvalue_loc(i);
                
             for (int j = 0; j < zoom_nj_cl; j++)
-               (*latvalue_temp)[j /*- (jbegin_serv - 1)*/ + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1)] =
-               (*latvalue_loc)[j];
+              latvalue_temp(j /*- (jbegin_serv - 1)*/ + (zoom_jbegin_cl - 1) - (jbegin_zoom_srv - 1)) = latvalue_loc(j);
          }       
-         this->lonvalue.setValue(lonvalue_temp);
-         this->latvalue.setValue(latvalue_temp);
+         lonvalue.reference(lonvalue_temp.copy()) ;
+         latvalue.reference(latvalue_temp.copy()) ;
       }
    }
@@ -662,6 +642,6 @@
          this->nj_zoom_sub.push_back(this->zoom_nj_loc.getValue());
       
-         this->latvalue_sub.push_back(this->latvalue.getValue());
-         this->lonvalue_sub.push_back(this->lonvalue.getValue());  
+         this->latvalue_sub.push_back(new CArray<double,1>(latvalue.copy()));
+         this->lonvalue_sub.push_back(new CArray<double,1>(lonvalue.copy()));  
 
 
@@ -855,12 +835,9 @@
     CEventClient event(getType(),EVENT_ID_LON_LAT) ;
     
-    ARRAY(double, 1) lonvalue_client = lonvalue.getValue(),
-                     latvalue_client = latvalue.getValue();
-    
     int ib,ie,in ;
     int jb,je,jn ;
   
     list<shared_ptr<CMessage> > list_msg ;    
-    list<ARRAY(double,1)> list_indi,list_indj,list_lon,list_lat ;
+    list<CArray<double,1>* > list_indi,list_indj,list_lon,list_lat ;
 
     for(int ns=0;ns<connectedServer.size();ns++)
@@ -869,8 +846,8 @@
       jb=jb_srv[ns] ; je=je_srv[ns] ; jn=jn_srv[ns] ;
       
-      ARRAY_CREATE(indi,double,1,[in*jn]) ;
-      ARRAY_CREATE(indj,double,1,[in*jn]) ;
-      ARRAY_CREATE(lon,double,1,[in*jn]) ;
-      ARRAY_CREATE(lat,double,1,[in*jn]) ;
+      CArray<double,1> indi(in*jn) ;
+      CArray<double,1> indj(in*jn) ;
+      CArray<double,1> lon(in*jn) ;
+      CArray<double,1> lat(in*jn) ;
 
           
@@ -882,20 +859,30 @@
           ind_client=(i-zoom_ibegin_client)+(j-zoom_jbegin_client)*zoom_ni_client ;
           ind_loc=(i-ib)+(j-jb)*in ;
-          (*lon)[ind_loc]=(*lonvalue_client)[ind_client] ;
-          (*lat)[ind_loc]=(*latvalue_client)[ind_client] ;
-          (*indi)[ind_loc]=i ;
-          (*indj)[ind_loc]=j ;
+          lon(ind_loc)=lonvalue(ind_client) ;
+          lat(ind_loc)=latvalue(ind_client) ;
+          indi(ind_loc)=i ;
+          indj(ind_loc)=j ;
         }
       
-      list_indi.push_back(indi) ; list_indj.push_back(indj) ;
-      list_lon.push_back(lon) ; list_lat.push_back(lat) ;
+      list_indi.push_back(new CArray<double,1>(indi.copy())) ;
+      list_indj.push_back(new CArray<double,1>(indj.copy())) ;
+      list_lon.push_back(new CArray<double,1>(lon.copy())) ;
+      list_lat.push_back(new CArray<double,1>(lat.copy())) ;
+
       list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ;
 
       *list_msg.back()<<this->getId() ;
-      *list_msg.back()<<list_indi.back()<<list_indj.back()<<list_lon.back()<<list_lat.back() ;
+      *list_msg.back()<<*list_indi.back()<<*list_indj.back()<<*list_lon.back()<<*list_lat.back() ;
       event.push(connectedServer[ns],nbSenders[ns],*list_msg.back()) ;
     }
 
     client->sendEvent(event) ;
+    
+    list<CArray<double,1>* >::iterator it;
+    for(it=list_indi.begin();it!=list_indi.end();it++) delete *it;
+    for(it=list_indj.begin();it!=list_indj.end();it++) delete *it;
+    for(it=list_lon.begin();it!=list_lon.end();it++)   delete *it;
+    for(it=list_lat.begin();it!=list_lat.end();it++)   delete *it;
+    
   }
   
@@ -953,6 +940,6 @@
     }
     
-    lonvalue_srv->resize(extents[zoom_ni_srv*zoom_nj_srv]) ;
-    latvalue_srv->resize(extents[zoom_ni_srv*zoom_nj_srv]) ;
+    lonvalue_srv.resize(zoom_ni_srv*zoom_nj_srv) ;
+    latvalue_srv.resize(zoom_ni_srv*zoom_nj_srv) ;
   }
     
@@ -971,18 +958,18 @@
   void CDomain::recvLonLat(CBufferIn& buffer)
   {
-    ARRAY_CREATE(indi,double,1,[0]) ;
-    ARRAY_CREATE(indj,double,1,[0]) ;
-    ARRAY_CREATE(lon,double,1,[0]) ;
-    ARRAY_CREATE(lat,double,1,[0]) ;
-    
+    CArray<double,1> indi ;
+    CArray<double,1> indj ;
+    CArray<double,1> lon ;
+    CArray<double,1> lat ;
+     
     buffer>>indi>>indj>>lon>>lat ;
     int i,j,ind_srv ;
 
-    for(int ind=0;ind<indi->num_elements();ind++)
+    for(int ind=0;ind<indi.numElements();ind++)
     {
-      i=(*indi)[ind] ; j=(*indj)[ind] ;
+      i=indi(ind) ; j=indj(ind) ;
       ind_srv=(i-zoom_ibegin_srv)+(j-zoom_jbegin_srv)*zoom_ni_srv ;
-      (*lonvalue_srv)[ind_srv]=(*lon)[ind] ;
-      (*latvalue_srv)[ind_srv]=(*lat)[ind] ;
+      lonvalue_srv(ind_srv)=lon(ind) ;
+      latvalue_srv(ind_srv)=lat(ind) ;
     }
   }
@@ -991,10 +978,10 @@
    void CDomain::completeMask(void)
    {
-      this->local_mask->resize(boost::extents[zoom_ni_loc.getValue()][zoom_nj_loc.getValue()]);
-   }
-
-   //----------------------------------------------------------------
-
-   ARRAY(int, 2) CDomain::getLocalMask(void) const
+      this->local_mask.resize(zoom_ni_loc,zoom_nj_loc);
+   }
+
+   //----------------------------------------------------------------
+
+   CArray<int,2> CDomain::getLocalMask(void) const
    {
       return (this->local_mask);
@@ -1056,5 +1043,5 @@
    //----------------------------------------------------------------
    
-   const std::vector<ARRAY(double, 1)> & CDomain::getLonValueSub(void) const
+   const std::vector<CArray<double, 1>* > & CDomain::getLonValueSub(void) const
    {
       return (this->lonvalue_sub);
@@ -1063,5 +1050,5 @@
    //----------------------------------------------------------------
    
-   const std::vector<ARRAY(double, 1)> & CDomain::getLatValueSub(void) const
+   const std::vector<CArray<double,1>*> & CDomain::getLatValueSub(void) const
    {
       return (this->latvalue_sub);
Index: XIOS/trunk/src/node/domain.hpp
===================================================================
--- XIOS/trunk/src/node/domain.hpp	(revision 368)
+++ XIOS/trunk/src/node/domain.hpp	(revision 369)
@@ -10,4 +10,6 @@
 #include "event_server.hpp"
 #include "buffer_in.hpp"
+#include "array_new.hpp"
+#include "attribute_array.hpp"
 
 namespace xios {
@@ -73,8 +75,8 @@
       
          /// Autres ///
-         virtual void fromBinary(StdIStream & is);
+//         virtual void fromBinary(StdIStream & is);
 
          /// Accesseurs ///
-         ARRAY(int, 2) getLocalMask(void) const;
+         CArray<int, 2> getLocalMask(void) const;
          
          const std::set<StdString> & getRelFiles(void) const;
@@ -90,6 +92,6 @@
          const std::vector<int> & getNjZoomSub(void) const;
          
-         const std::vector<ARRAY(double, 1)> & getLonValueSub(void) const;
-         const std::vector<ARRAY(double, 1)> & getLatValueSub(void) const;
+         const std::vector<CArray<double,1>* > & getLonValueSub(void) const;
+         const std::vector<CArray<double,1>* > & getLatValueSub(void) const;
 
          /// Test ///
@@ -111,5 +113,5 @@
          int zoom_nj_srv,zoom_jbegin_srv,zoom_jend_srv ;
 
-         ARRAY(double, 1) lonvalue_srv, latvalue_srv ;
+         CArray<double, 1> lonvalue_srv, latvalue_srv ;
          
          
@@ -142,14 +144,15 @@
          static ENodeType GetType(void);
 
+         CArray<int, 2> local_mask;
+
        private :
 
          /// ProriÃ©tÃ©s protÃ©gÃ©es ///
          bool isChecked;
-         ARRAY(int, 2) local_mask;
          std::set<StdString> relFiles;
 
          std::vector<int> ibegin_sub, iend_sub, jbegin_sub, jend_sub;
          std::vector<int> ibegin_zoom_sub, jbegin_zoom_sub, ni_zoom_sub, nj_zoom_sub;
-         std::vector<ARRAY(double, 1)> lonvalue_sub, latvalue_sub;
+         std::vector<CArray<double,1>* > lonvalue_sub, latvalue_sub;
          
 
Index: XIOS/trunk/src/node/field.cpp
===================================================================
--- XIOS/trunk/src/node/field.cpp	(revision 368)
+++ XIOS/trunk/src/node/field.cpp	(revision 369)
@@ -24,6 +24,5 @@
       , last_Write(), last_operation()
       , foperation()
-      , data(new CArray<double, 1>(boost::extents[0]))
-   { /* Ne rien faire de plus */ }
+      { /* Ne rien faire de plus */ }
 
    CField::CField(const StdString & id)
@@ -35,5 +34,4 @@
       , last_Write(), last_operation()
       , foperation()
-      , data(new CArray<double, 1>(boost::extents[0]))
    { /* Ne rien faire de plus */ }
 
@@ -43,5 +41,4 @@
 //      this->file.reset() ;
       this->foperation.reset() ;
-      this->data.reset() ;
    }
 
@@ -50,5 +47,5 @@
    bool CField::updateDataServer
       (const CDate & currDate,
-       const std::deque<ARRAY(double, 1)> storedClient)
+       const std::deque< CArray<double, 1>* > storedClient)
    {
       const CDate opeDate      = *last_operation + freq_operation;
@@ -57,9 +54,9 @@
       if (opeDate <= currDate)
       {
-         if (this->data->num_elements() != this->grid->storeIndex[0]->num_elements())
+         if (this->data.numElements() != this->grid->storeIndex[0]->numElements())
          {
-            this->data->resize(boost::extents[this->grid->storeIndex[0] ->num_elements()]);
+            this->data.resize(this->grid->storeIndex[0] ->numElements());
          }  
-         ARRAY_CREATE(input, double, 1, [this->data->num_elements()]);
+         CArray<double,1> input(data.numElements()) ;
          this->grid->inputFieldServer(storedClient, input);          
          (*this->foperation)(input);
@@ -103,20 +100,23 @@
     CEventClient event(getType(),EVENT_ID_UPDATE_DATA) ;
     
-    map<int,ARRAY(int, 1)>::iterator it ;
+    map<int,CArray<int, 1>* >::iterator it ;
     list<shared_ptr<CMessage> > list_msg ;
-    list<ARRAY(double,1) > list_data ;
+    list< CArray<double,1>* > list_data ;
     
     for(it=grid->storeIndex_toSrv.begin();it!=grid->storeIndex_toSrv.end();it++)
     {
       int rank=(*it).first ;
-      ARRAY(int,1) index=(*it).second ;
-      ARRAY_CREATE(data_tmp,double,1,[index->num_elements()]) ;
-      for(int n=0;n<data_tmp->num_elements();n++) (*data_tmp)[n]=(*data)[(*index)[n]] ;
+      CArray<int,1>& index = *(it->second) ;
+      CArray<double,1> data_tmp(index.numElements()) ;
+      
+      for(int n=0;n<data_tmp.numElements();n++) data_tmp(n)=data(index(n)) ;
       list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ;
-      list_data.push_back(data_tmp) ;
-      *list_msg.back()<<getId()<<list_data.back() ;
+      list_data.push_back(new CArray<double,1>(data_tmp)) ;
+      *list_msg.back()<<getId()<<*list_data.back() ;
       event.push(rank,grid->nbSenders[rank],*list_msg.back()) ;
     }
     client->sendEvent(event) ;
+    
+    for(list< CArray<double,1>* >::iterator it=list_data.begin();it!=list_data.end();it++) delete *it ;
   }
   
@@ -145,10 +145,10 @@
     if (data_srv.empty())
     {
-      for(map<int,ARRAY(int, 1)>::iterator it=grid->out_i_fromClient.begin();it!=grid->out_i_fromClient.end();it++)
+      for(map<int, CArray<int, 1>* >::iterator it=grid->out_i_fromClient.begin();it!=grid->out_i_fromClient.end();it++)
       {
         int rank=it->first ;
-        ARRAY_CREATE(data_tmp,double,1,[it->second->num_elements()]) ;
-        data_srv.insert(pair<int, ARRAY(double,1)>(rank,data_tmp)) ;
-        foperation_srv.insert(pair<int,boost::shared_ptr<func::CFunctor> >(rank,boost::shared_ptr<func::CFunctor>(new func::CInstant(data_srv[rank])))) ;
+        CArray<double,1> data_tmp(it->second->numElements()) ;
+        data_srv.insert( pair<int, CArray<double,1>* >(rank, new CArray<double,1>(data_tmp) ) ) ;
+        foperation_srv.insert(pair<int,boost::shared_ptr<func::CFunctor> >(rank,boost::shared_ptr<func::CFunctor>(new func::CInstant(*data_srv[rank])))) ;
       }
     }
@@ -165,5 +165,5 @@
       for(int n=0;n<ranks.size();n++)
       {
-        ARRAY_CREATE(data_tmp,double,1,[0]) ;
+        CArray<double,1> data_tmp ;
         *buffers[n]>>data_tmp ;
         (*foperation_srv[ranks[n]])(data_tmp) ;
@@ -187,5 +187,6 @@
   void CField::writeField(void)
   {
-    if (! grid->domain->isEmpty() || getRelFile()->type.getValue()=="one_file")
+//    if (! grid->domain->isEmpty() || getRelFile()->type.getValue()=="one_file")
+    if (! grid->domain->isEmpty() || getRelFile()->type == CFile::type_attr::one_file)
     {
       getRelFile()->checkFile();
@@ -305,5 +306,5 @@
    //----------------------------------------------------------------
    
-   ARRAY(double, 1) CField::getData(void) const
+   CArray<double, 1> CField::getData(void) const
    {
       return(this->data);
@@ -410,4 +411,5 @@
          const CDuration toffset = this->freq_operation - freq_offset_ - context->getCalendar()->getTimeStep(); 
          *this->last_operation   = *this->last_operation - toffset;  
+         cout<<operation<<endl ;
          
 #define DECLARE_FUNCTOR(MType, mtype)              \
@@ -429,10 +431,10 @@
    
    //----------------------------------------------------------------
-   
+/*
    void CField::fromBinary(StdIStream & is)
    {
       SuperClass::fromBinary(is);
 #define CLEAR_ATT(name_)\
-      SuperClassAttribute::operator[](#name_)->clear()
+      SuperClassAttribute::operator[](#name_)->reset()
 
          CLEAR_ATT(domain_ref);
@@ -441,5 +443,5 @@
 
    }
-
+*/
    //----------------------------------------------------------------
 
@@ -537,19 +539,19 @@
    }
    
-   void CField::outputField(ARRAY(double,3) fieldOut)
-   {
-      map<int,ARRAY(double,1)>::iterator it;
+   void CField::outputField(CArray<double,3>& fieldOut)
+   {
+      map<int, CArray<double,1>* >::iterator it;
       for(it=data_srv.begin();it!=data_srv.end();it++)
-         grid->outputField(it->first,it->second, fieldOut) ;
-      
-   }
-   
-   void CField::outputField(ARRAY(double,2) fieldOut)
-   {
-      map<int,ARRAY(double,1)>::iterator it;
+         grid->outputField(it->first,*it->second, fieldOut) ;
+      
+   }
+   
+   void CField::outputField(CArray<double,2>& fieldOut)
+   {
+      map<int, CArray<double,1>* >::iterator it;
 
       for(it=data_srv.begin();it!=data_srv.end();it++)
       {
-         grid->outputField(it->first,it->second, fieldOut) ;
+         grid->outputField(it->first,*it->second, fieldOut) ;
       }
    }
Index: XIOS/trunk/src/node/field.hpp
===================================================================
--- XIOS/trunk/src/node/field.hpp	(revision 368)
+++ XIOS/trunk/src/node/field.hpp	(revision 369)
@@ -11,4 +11,6 @@
 #include "declare_group.hpp"
 #include "calendar_util.hpp"
+#include "array_new.hpp"
+#include "attribute_array.hpp"
 //#include "context.hpp"
 
@@ -80,5 +82,5 @@
          boost::shared_ptr<func::CFunctor> getFieldOperation(void) const;
          
-         ARRAY(double, 1) getData(void) const;
+         CArray<double, 1> getData(void) const;
 
          const StdString & getBaseFieldId(void) const;
@@ -89,9 +91,9 @@
          void resetNStep() ;
 
-         template <StdSize N> bool updateData(const ARRAY(double, N)   data);
+         template <int N> bool updateData(const CArray<double, N>&   data);
          
          bool updateDataServer
                (const CDate & currDate,
-                const std::deque<ARRAY(double, 1)> storedClient);
+                const std::deque< CArray<double, 1>* > storedClient);
  
        public :
@@ -106,5 +108,5 @@
          void solveOperation(void);
 
-         virtual void fromBinary(StdIStream & is);
+//         virtual void fromBinary(StdIStream & is);
 
          /// Destructeur ///
@@ -117,5 +119,5 @@
          static ENodeType GetType(void);
          
-        template <StdSize N> void setData(const ARRAY(double, N) _data) ;
+        template <int N> void setData(const CArray<double, N>& _data) ;
         static bool dispatchEvent(CEventServer& event) ;
         void sendUpdateData(void) ;
@@ -123,6 +125,6 @@
         void recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers) ;
         void writeField(void) ;
-        void outputField(ARRAY(double,3) fieldOut) ;
-        void outputField(ARRAY(double,2) fieldOut) ;
+        void outputField(CArray<double,3>& fieldOut) ;
+        void outputField(CArray<double,2>& fieldOut) ;
         
       public :
@@ -145,6 +147,6 @@
          map<int,boost::shared_ptr<func::CFunctor> > foperation_srv;
          
-         ARRAY(double, 1) data;
-         map<int,ARRAY(double,1)> data_srv ;
+         CArray<double, 1> data;
+         map<int, CArray<double,1>* > data_srv ;
 
    }; // class CField
Index: XIOS/trunk/src/node/field_decl.cpp
===================================================================
--- XIOS/trunk/src/node/field_decl.cpp	(revision 368)
+++ XIOS/trunk/src/node/field_decl.cpp	(revision 369)
@@ -3,7 +3,7 @@
 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) ;
+  template void CField::setData<1>(const CArray<double, 1>& _data) ;
+  template void CField::setData<2>(const CArray<double, 2>& _data) ;
+  template void CField::setData<3>(const CArray<double, 3>& _data) ;
 
 }
Index: XIOS/trunk/src/node/field_impl.hpp
===================================================================
--- XIOS/trunk/src/node/field_impl.hpp	(revision 368)
+++ XIOS/trunk/src/node/field_impl.hpp	(revision 369)
@@ -8,10 +8,11 @@
 #include "grid.hpp"
 #include "timer.hpp"
-#include "array.hpp"
+#include "array_new.hpp"
+
 
 namespace xios {
 
-   template <StdSize N>
-   void CField::setData(const ARRAY(double, N) _data)
+   template <int N>
+   void CField::setData(const CArray<double, N>& _data)
    {
      const std::vector<CField*>& refField=getAllReference();
@@ -21,6 +22,6 @@
     }
     
-   template <StdSize N>
-      bool CField::updateData(const ARRAY(double, N) _data)
+   template <int N>
+      bool CField::updateData(const CArray<double, N>& _data)
    {        
       CContext* context=CContext::getCurrent();
@@ -35,10 +36,10 @@
       if (opeDate <= currDate)
       {
-         if (this->data->num_elements() != this->grid->storeIndex_client->num_elements())
+         if (this->data.numElements() != this->grid->storeIndex_client.numElements())
          {
-            this->data->resize(boost::extents[this->grid->storeIndex_client ->num_elements()]);
+            this->data.resize(this->grid->storeIndex_client.numElements());
          }
             
-         ARRAY_CREATE(input, double, 1, [this->data->num_elements()]);
+         CArray<double,1> input(data.numElements()) ;
          this->grid->inputField(_data, input);          
          (*this->foperation)(input);
Index: XIOS/trunk/src/node/file.cpp
===================================================================
--- XIOS/trunk/src/node/file.cpp	(revision 368)
+++ XIOS/trunk/src/node/file.cpp	(revision 369)
@@ -216,5 +216,5 @@
       nbDomain=setDomain.size() ;
 
-      if (!AllDomainEmpty ||  type.getValue()=="one_file")
+      if (!AllDomainEmpty ||  type == type_attr::one_file)
       {
          StdString filename = (!name.isEmpty()) ?   name.getValue() : getId();
@@ -228,6 +228,6 @@
          if (!type.isEmpty())
          {
-           if (type.getValue()=="one_file") multifile=false ;
-           else if (type.getValue()=="multi_file") multifile=true ;
+           if (type==type_attr::one_file) multifile=false ;
+           else if (type==type_attr::multiple_file) multifile=true ;
            else ERROR("void Context::createDataOutput(void)",
                       "incorrect file <type> attribut : must be <multi_file> or <one_file>, "
@@ -280,5 +280,5 @@
      delete lastSync ;
      delete lastSplit ;
-     if (!AllDomainEmpty ||  type.getValue()=="one_file")
+     if (!AllDomainEmpty ||  type==type_attr::one_file)
        if (isOpen) 
        {
@@ -349,5 +349,5 @@
    
    //---------------------------------------------------------------
-   
+/*
    void CFile::toBinary  (StdOStream & os) const
    {
@@ -382,5 +382,6 @@
       
    }
-   
+*/
+
    CField* CFile::addField(const string& id)
    {
Index: XIOS/trunk/src/node/file.hpp
===================================================================
--- XIOS/trunk/src/node/file.hpp	(revision 368)
+++ XIOS/trunk/src/node/file.hpp	(revision 369)
@@ -8,4 +8,6 @@
 #include "declare_group.hpp"
 #include "date.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
 
 
@@ -82,6 +84,6 @@
          virtual StdString toString(void) const;
          
-         virtual void toBinary  (StdOStream & os) const;
-         virtual void fromBinary(StdIStream & is);
+//         virtual void toBinary  (StdOStream & os) const;
+//         virtual void fromBinary(StdIStream & is);
 
          /// Accesseurs statiques ///
Index: XIOS/trunk/src/node/grid.cpp
===================================================================
--- XIOS/trunk/src/node/grid.cpp	(revision 368)
+++ XIOS/trunk/src/node/grid.cpp	(revision 369)
@@ -11,4 +11,5 @@
 #include "context.hpp"
 #include "context_client.hpp"
+#include "array_new.hpp"
 
 namespace xios {
@@ -32,12 +33,15 @@
  //     this->axis.reset() ;
 //      this->domain.reset() ;
-      
-      for (StdSize i = 0; i < this->storeIndex.size(); i++)
-      {
-         this->storeIndex[i].reset();
-         this->out_i_index[i].reset();
-         this->out_j_index[i].reset();
-         this->out_l_index[i].reset();
-      }
+    deque< CArray<int, 1>* >::iterator it ;
+    
+    for(deque< CArray<int,1>* >::iterator it=storeIndex.begin(); it!=storeIndex.end();it++)  delete *it ;
+    for(deque< CArray<int,1>* >::iterator it=out_i_index.begin();it!=out_i_index.end();it++) delete *it ;
+    for(deque< CArray<int,1>* >::iterator it=out_j_index.begin();it!=out_j_index.end();it++) delete *it ;
+    for(deque< CArray<int,1>* >::iterator it=out_l_index.begin();it!=out_l_index.end();it++) delete *it ;
+
+    for(map<int,CArray<int,1>* >::iterator it=out_i_fromClient.begin();it!=out_i_fromClient.end();it++) delete it->second ;
+    for(map<int,CArray<int,1>* >::iterator it=out_j_fromClient.begin();it!=out_j_fromClient.end();it++) delete it->second ;
+    for(map<int,CArray<int,1>* >::iterator it=out_l_fromClient.begin();it!=out_l_fromClient.end();it++) delete it->second ;
+
    }
 
@@ -50,5 +54,5 @@
    //----------------------------------------------------------------
 
-   const std::deque<ARRAY(int, 1)> & CGrid::getStoreIndex(void) const
+   const std::deque< CArray<int,1>* > & CGrid::getStoreIndex(void) const
    { 
       return (this->storeIndex );
@@ -57,5 +61,5 @@
    //---------------------------------------------------------------
 
-   const std::deque<ARRAY(int, 1)> & CGrid::getOutIIndex(void)  const
+   const std::deque< CArray<int,1>* > & CGrid::getOutIIndex(void)  const
    { 
       return (this->out_i_index ); 
@@ -64,5 +68,5 @@
    //---------------------------------------------------------------
 
-   const std::deque<ARRAY(int, 1)> & CGrid::getOutJIndex(void)  const
+   const std::deque< CArray<int,1>* > & CGrid::getOutJIndex(void)  const
    { 
       return (this->out_j_index ); 
@@ -71,5 +75,5 @@
    //---------------------------------------------------------------
 
-   const std::deque<ARRAY(int, 1)> & CGrid::getOutLIndex(void)  const
+   const std::deque< CArray<int,1>* > & CGrid::getOutLIndex(void)  const
    { 
       return (this->out_l_index ); 
@@ -155,6 +159,5 @@
    StdSize CGrid::getDataSize(void) const
    {
-      StdSize retvalue ;
-      retvalue=domain->data_ni.getValue() ;
+      StdSize retvalue=domain->data_ni.getValue() ;
       if (domain->data_dim.getValue()==2) retvalue*=domain->data_nj.getValue() ;
       if (this->withAxis) retvalue*=this->axis->size.getValue() ;
@@ -177,13 +180,9 @@
          
          this->computeIndex() ;
-         ARRAY_CREATE(storeIndex_ , int, 1, [0]);
-         ARRAY_CREATE(out_l_index_, int, 1, [0]);
-         ARRAY_CREATE(out_i_index_, int, 1, [0]);
-         ARRAY_CREATE(out_j_index_, int, 1, [0]);
-                 
-         this->storeIndex .push_front(storeIndex_);
-         this->out_i_index.push_front(out_i_index_);
-         this->out_j_index.push_front(out_j_index_);
-         this->out_l_index.push_front(out_l_index_);
+
+         this->storeIndex.push_front(new CArray<int,1>() );
+         this->out_i_index.push_front(new CArray<int,1>());
+         this->out_j_index.push_front(new CArray<int,1>());
+         this->out_l_index.push_front(new CArray<int,1>());
       }
 //      this->computeIndexServer();
@@ -245,10 +244,11 @@
                              ? domain->data_jbegin.getValue() : -1;
 
-      ARRAY(int, 1) data_i_index = domain->data_i_index.getValue() ,
-                    data_j_index = domain->data_j_index.getValue() ;
-
-
-      ARRAY(bool, 2) mask = domain->mask.getValue() ;
-      ARRAY(int, 2) local_mask =  this->domain->getLocalMask();
+      CArray<int,1> data_i_index = domain->data_i_index ;
+      CArray<int,1> data_j_index = domain->data_j_index ;
+      
+
+      CArray<bool,2>& mask = domain->mask ;
+      CArray<int,2>& local_mask = domain->local_mask ;
+      
 
       int indexCount = 0;
@@ -258,7 +258,7 @@
          for(int n = 0, i = 0, j = 0; n < data_n_index; n++)
          {
-            int temp_i = (*data_i_index)[n] + data_ibegin,
+            int temp_i = data_i_index(n) + data_ibegin,
                 temp_j = (data_dim == 1) ? -1
-                       : (*data_j_index)[n] + data_jbegin;
+                       : data_j_index(n) + data_jbegin;
             i = (data_dim == 1) ? (temp_i - 1) % ni
                                 : (temp_i - 1) ;
@@ -268,18 +268,18 @@
             if ((l >=lbegin && l<= lend) &&
                 (i >= 0 && i < ni) &&
-                (j >= 0 && j < nj) && (*mask)[i][j])
+                (j >= 0 && j < nj) && mask(i,j))
                indexCount++ ;
          }
       }
       
-      ARRAY_ASSIGN(this->storeIndex[0] , int, 1, [indexCount]);
-      ARRAY_ASSIGN(this->out_l_index[0], int, 1, [indexCount]);
-      ARRAY_ASSIGN(this->out_i_index[0], int, 1, [indexCount]);
-      ARRAY_ASSIGN(this->out_j_index[0], int, 1, [indexCount]);
-      
-      ARRAY_ASSIGN(storeIndex_client,int,1,[indexCount]);
-      ARRAY_ASSIGN(out_i_client,int,1,[indexCount]);
-      ARRAY_ASSIGN(out_j_client,int,1,[indexCount]);
-      ARRAY_ASSIGN(out_l_client,int,1,[indexCount]);
+      storeIndex[0]  = new CArray<int,1>(indexCount) ;
+      out_i_index[0] = new CArray<int,1>(indexCount) ;
+      out_j_index[0] = new CArray<int,1>(indexCount) ;
+      out_l_index[0] = new CArray<int,1>(indexCount) ;
+      
+      storeIndex_client.resize(indexCount) ;
+      out_i_client.resize(indexCount) ;
+      out_j_client.resize(indexCount) ;
+      out_l_client.resize(indexCount) ;
       
       
@@ -288,7 +288,7 @@
          for(int n = 0, i = 0, j = 0; n < data_n_index; n++, count++)
          {
-            int temp_i = (*data_i_index)[n] + data_ibegin,
+            int temp_i = data_i_index(n) + data_ibegin,
                 temp_j = (data_dim == 1) ? -1
-                       : (*data_j_index)[n] + data_jbegin;
+                       : data_j_index(n) + data_jbegin;
             i = (data_dim == 1) ? (temp_i - 1) % ni
                                 : (temp_i - 1) ;
@@ -298,15 +298,15 @@
             if ((l >= lbegin && l <= lend) &&
                 (i >= 0 && i < ni) &&
-                (j >= 0 && j < nj) && (*mask)[i][j])
+                (j >= 0 && j < nj) && mask(i,j))
             {
-               (*this->storeIndex[0]) [indexCount] = count ;
-               (*this->out_l_index[0])[indexCount] = l ;
-               (*this->out_i_index[0])[indexCount] = i ;
-               (*this->out_j_index[0])[indexCount] = j ;
+               (*storeIndex[0])(indexCount) = count ;
+               (*out_l_index[0])(indexCount) = l ;
+               (*out_i_index[0])(indexCount) = i ;
+               (*out_j_index[0])(indexCount) = j ;
                
-               (*storeIndex_client)[indexCount] = count ;
-               (*out_i_client)[indexCount]=i+domain->ibegin_client-1 ;
-               (*out_j_client)[indexCount]=j+domain->jbegin_client-1 ;
-               (*out_l_client)[indexCount]=l-lbegin ;
+               storeIndex_client(indexCount) = count ;
+               out_i_client(indexCount)=i+domain->ibegin_client-1 ;
+               out_j_client(indexCount)=j+domain->jbegin_client-1 ;
+               out_l_client(indexCount)=l-lbegin ;
                indexCount++ ;
             }
@@ -340,30 +340,30 @@
    //----------------------------------------------------------------
 
-   void CGrid::outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 3) field) 
-   {
-      ARRAY(int,1) out_i=out_i_fromClient[rank] ;
-      ARRAY(int,1) out_j=out_j_fromClient[rank] ;
-      ARRAY(int,1) out_l=out_l_fromClient[rank] ;
-      
-      for(StdSize n = 0; n < stored->num_elements(); n++)
-         (*field)[(*out_i)[n]][(*out_j)[n]][(*out_l)[n]] = (*stored)[n] ;
-   }
-
-   void CGrid::outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 2) field) 
-   {
-      ARRAY(int,1) out_i=out_i_fromClient[rank] ;
-      ARRAY(int,1) out_j=out_j_fromClient[rank] ;
-
-       for(StdSize n = 0; n < stored->num_elements(); n++)
-         (*field)[(*out_i)[n]][(*out_j)[n]] = (*stored)[n] ;
-   }
-
-   //---------------------------------------------------------------
-
-   void CGrid::outputField(int rank,const ARRAY(double, 1) stored,  ARRAY(double, 1) field)
-   {
-      ARRAY(int,1) out_i = out_i_fromClient[rank] ;
-      for(StdSize n = 0; n < stored->num_elements(); n++)
-         (*field)[(*out_i)[n]] = (*stored)[n] ;
+   void CGrid::outputField(int rank, const CArray<double, 1>& stored,  CArray<double, 3>& field) 
+   {
+      CArray<int,1>& out_i=*out_i_fromClient[rank] ;
+      CArray<int,1>& out_j=*out_j_fromClient[rank] ;
+      CArray<int,1>& out_l=*out_l_fromClient[rank] ;
+      
+      for(StdSize n = 0; n < stored.numElements(); n++)
+         field(out_i(n), out_j(n), out_l(n)) = stored(n) ;
+   }
+
+   void CGrid::outputField(int rank, const CArray<double, 1>& stored,  CArray<double, 2>& field) 
+   {
+      CArray<int,1>& out_i=*out_i_fromClient[rank] ;
+      CArray<int,1>& out_j=*out_j_fromClient[rank] ;
+      
+      for(StdSize n = 0; n < stored.numElements(); n++)
+         field(out_i(n), out_j(n)) = stored(n) ;   }
+
+   //---------------------------------------------------------------
+
+   void CGrid::outputField(int rank,const CArray<double, 1>& stored,  CArray<double, 1>& field)
+   {
+      CArray<int,1>& out_i=*out_i_fromClient[rank] ;
+ 
+      for(StdSize n = 0; n < stored.numElements(); n++)
+         field(out_i(n)) = stored(n) ;
    }
 
@@ -372,58 +372,14 @@
 
    void CGrid::storeField_arr
-      (const double * const data, ARRAY(double, 1) stored) const
-   {
-      const StdSize size = (this->storeIndex_client)->num_elements() ;
-
-      stored->resize(boost::extents[size]) ;
-      for(StdSize i = 0; i < size; i++)
-         (*stored)[i] = data[(*storeIndex_client)[i]] ;
+      (const double * const data, CArray<double, 1>& stored) const
+   {
+      const StdSize size = storeIndex_client.numElements() ;
+
+      stored.resize(size) ;
+      for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)] ;
    }
    
    //---------------------------------------------------------------
-   
-   void CGrid::toBinary  (StdOStream & os) const
-   {
-      SuperClass::toBinary(os);
-     
-      os.write (reinterpret_cast<const char*>(&this->isChecked), sizeof(bool)); 
-     
-      if (this->isChecked)
-      {
-         this->storeIndex [0]->toBinary(os);
-         this->out_i_index[0]->toBinary(os);
-         this->out_j_index[0]->toBinary(os);
-         this->out_l_index[0]->toBinary(os);
-      }
-   }
-
-   //---------------------------------------------------------------
-   
-   void CGrid::fromBinary(StdIStream & is)
-   {
-      bool hasIndex = false;
-      SuperClass::fromBinary(is);            
-      is.read (reinterpret_cast<char*>(&hasIndex), sizeof(bool)); 
-      
-      if (hasIndex)
-      {
-         ARRAY_CREATE(storeIndex_ , int, 1, [0]);
-         ARRAY_CREATE(out_l_index_, int, 1, [0]);
-         ARRAY_CREATE(out_i_index_, int, 1, [0]);
-         ARRAY_CREATE(out_j_index_, int, 1, [0]);
-         
-         storeIndex_ ->fromBinary(is);
-         out_i_index_->fromBinary(is);
-         out_j_index_->fromBinary(is);
-         out_l_index_->fromBinary(is);
-         
-         this->storeIndex .push_back(storeIndex_);
-         this->out_i_index.push_back(out_i_index_);
-         this->out_j_index.push_back(out_j_index_);
-         this->out_l_index.push_back(out_l_index_);
-      }
-   }
-   
-   //---------------------------------------------------------------
+
   void CGrid::sendIndex(void)
   {
@@ -434,5 +390,5 @@
     int rank ;
     list<shared_ptr<CMessage> > list_msg ;
-    list<ARRAY(int,1) > list_out_i,list_out_j,list_out_l ;
+    list< CArray<int,1>* > list_out_i,list_out_j,list_out_l ;
      
     for(int ns=0;ns<domain->connectedServer.size();ns++)
@@ -446,42 +402,48 @@
        int i,j ;
        int nb=0 ;
-       for(int k=0;k<storeIndex_client->num_elements();k++)
+       for(int k=0;k<storeIndex_client.numElements();k++)
        {
-         i=(*out_i_client)[k] ;
-         j=(*out_j_client)[k] ;
+         i=out_i_client(k) ;
+         j=out_j_client(k) ;
          if (i>=ib-1 && i<=ie-1 && j>=jb-1 && j<=je-1) nb++ ; 
        }
        
-       ARRAY_CREATE(storeIndex,int,1,[nb]) ;
-       ARRAY_CREATE(out_i,int,1,[nb]) ;
-       ARRAY_CREATE(out_j,int,1,[nb]) ;
-       ARRAY_CREATE(out_l,int,1,[nb]) ;
+       CArray<int,1> storeIndex(nb) ;
+       CArray<int,1> out_i(nb) ;
+       CArray<int,1> out_j(nb) ;
+       CArray<int,1> out_l(nb) ;
+ 
        
        nb=0 ;
-       for(int k=0;k<storeIndex_client->num_elements();k++)
+       for(int k=0;k<storeIndex_client.numElements();k++)
        {
-         i=(*out_i_client)[k] ;
-         j=(*out_j_client)[k] ;
+         i=out_i_client(k) ;
+         j=out_j_client(k) ;
          if (i>=ib-1 && i<=ie-1 && j>=jb-1 && j<=je-1) 
          {
-            (*storeIndex)[nb]=k ;
-            (*out_i)[nb]=(*out_i_client)[k] ;
-            (*out_j)[nb]=(*out_j_client)[k] ;
-            (*out_l)[nb]=(*out_l_client)[k] ;
+            storeIndex(nb)=k ;
+            out_i(nb)=out_i_client(k) ;
+            out_j(nb)=out_j_client(k) ;
+            out_l(nb)=out_l_client(k) ;
             nb++ ;
          }
        }
        
-       storeIndex_toSrv.insert(pair<int,ARRAY(int,1) >(rank,storeIndex)) ;
+       storeIndex_toSrv.insert( pair<int,CArray<int,1>* >(rank,new CArray<int,1>(storeIndex) )) ;
        nbSenders.insert(pair<int,int>(rank,domain->nbSenders[ns])) ;
        list_msg.push_back(shared_ptr<CMessage>(new CMessage)) ;
-       list_out_i.push_back(out_i) ;
-       list_out_j.push_back(out_j) ;
-       list_out_l.push_back(out_l) ;
-
-       *list_msg.back()<<getId()<<list_out_i.back()<<list_out_j.back()<<list_out_l.back() ;
+       list_out_i.push_back(new CArray<int,1>(out_i)) ;
+       list_out_j.push_back(new CArray<int,1>(out_j)) ;
+       list_out_l.push_back(new CArray<int,1>(out_l)) ;
+
+       *list_msg.back()<<getId()<<*list_out_i.back()<<*list_out_j.back()<<*list_out_l.back() ;
        event.push(rank,domain->nbSenders[ns],*list_msg.back()) ;
     }
     client->sendEvent(event) ;
+
+    for(list<CArray<int,1>* >::iterator it=list_out_i.begin();it!=list_out_i.end();it++) delete *it ;
+    for(list<CArray<int,1>* >::iterator it=list_out_j.begin();it!=list_out_j.end();it++) delete *it ;
+    for(list<CArray<int,1>* >::iterator it=list_out_l.begin();it!=list_out_l.end();it++) delete *it ;
+    
   }
   
@@ -501,20 +463,16 @@
   void CGrid::recvIndex(int rank, CBufferIn& buffer)
   {
-    ARRAY_CREATE(out_i,int,1,[0]) ;
-    ARRAY_CREATE(out_j,int,1,[0]) ;
-    ARRAY_CREATE(out_l,int,1,[0]) ;
+    CArray<int,1> out_i ;
+    CArray<int,1> out_j ;
+    CArray<int,1> out_l ;
     
     buffer>>out_i>>out_j>>out_l ;
-    int offset ;
     
-    offset=domain->zoom_ibegin_srv-1 ;
-    for(int k=0;k<out_i->num_elements();k++) (*out_i)[k]=(*out_i)[k]-offset ;
+    out_i -= domain->zoom_ibegin_srv-1 ;
+    out_j -= domain->zoom_jbegin_srv-1 ;
     
-    offset=domain->zoom_jbegin_srv-1 ;
-    for(int k=0;k<out_i->num_elements();k++) (*out_j)[k]=(*out_j)[k]-offset ;
-    
-    out_i_fromClient.insert(pair< int,ARRAY(int,1) >(rank,out_i)) ;
-    out_j_fromClient.insert(pair< int,ARRAY(int,1) >(rank,out_j)) ;
-    out_l_fromClient.insert(pair< int,ARRAY(int,1) >(rank,out_l)) ;
+    out_i_fromClient.insert(pair< int,CArray<int,1>* >(rank,new CArray<int,1>(out_i) )) ;
+    out_j_fromClient.insert(pair< int,CArray<int,1>* >(rank,new CArray<int,1>(out_j) )) ;
+    out_l_fromClient.insert(pair< int,CArray<int,1>* >(rank,new CArray<int,1>(out_l) )) ;
   }
 
@@ -540,169 +498,25 @@
   }
 
-
-/*
-   void CGrid::computeIndexServer(void)
-   {
-      ARRAY(int, 2) local_mask =  this->domain->getLocalMask();
-      
-      const std::vector<int> & ibegin = this->domain->getIBeginSub();
-      const std::vector<int> & jbegin = this->domain->getJBeginSub();
-      const std::vector<int> & iend = this->domain->getIEndSub();
-      const std::vector<int> & jend = this->domain->getJEndSub();
-      const std::vector<int> & ibegin_zoom = this->domain->getIBeginZoomSub();
-      const std::vector<int> & jbegin_zoom = this->domain->getJBeginZoomSub();
-      const std::vector<int> & ni_zoom = this->domain->getNiZoomSub();
-      const std::vector<int> & nj_zoom = this->domain->getNjZoomSub();
-      
-      const int ibegin_srv  = this->domain->ibegin.getValue();
-      const int jbegin_srv  = this->domain->jbegin.getValue();
-      const int iend_srv  = this->domain->iend.getValue();
-      const int jend_srv  = this->domain->jend.getValue();
-      const int zoom_ni_srv = this->domain->zoom_ni_loc.getValue();
-      const int zoom_nj_srv = this->domain->zoom_nj_loc.getValue();
-      
-      const int ibegin_zoom_srv = this->domain->zoom_ibegin_loc.getValue();
-      const int jbegin_zoom_srv = this->domain->zoom_jbegin_loc.getValue();
-       const int iend_zoom_srv = ibegin_zoom_srv + zoom_ni_srv-1 ;
-      const int  jend_zoom_srv = jbegin_zoom_srv + zoom_nj_srv-1 ;
-        
-      StdSize dn = 0;      
-      for (StdSize j = 1; j < this->out_i_index.size(); j++)
-         dn += this->out_i_index[j]->size();
-         
-      ARRAY_CREATE(storeIndex_srv , int, 1, [dn]);
-      ARRAY_CREATE(out_i_index_srv, int, 1, [dn]);
-      ARRAY_CREATE(out_j_index_srv, int, 1, [dn]);
-      ARRAY_CREATE(out_l_index_srv, int, 1, [dn]);
-      
-      for (StdSize i = 0, dn = 0; i < ibegin.size(); i++)
-      {
-         ARRAY(int, 1) storeIndex_cl   =  this->storeIndex [i + 1];
-         ARRAY(int, 1) out_i_index_cl  =  this->out_i_index[i + 1];
-         ARRAY(int, 1) out_j_index_cl  =  this->out_j_index[i + 1];
-         ARRAY(int, 1) out_l_index_cl  =  this->out_l_index[i + 1];
-                 
-         int ibegin_zoom_cl = ibegin[i]; //ibegin_zoom[i];
-         int jbegin_zoom_cl = jbegin[i]; //jbegin_zoom[i];
-         int iend_zoom_cl = iend[i]; //ibegin_zoom[i];
-         int jend_zoom_cl = jend[i]; //jbegin_zoom[i];
-
-         int ibegin_cl = ibegin[i]; //ibegin[i];
-         int jbegin_cl = jbegin[i]; //jbegin[i];
-         int iend_cl = iend[i]; //ibegin[i];
-         int jend_cl = jend[i]; //jbegin[i];
-         
-         if (ibegin_zoom.size() != 0)
-         {
-            ibegin_zoom_cl = ibegin_zoom[i];
-            jbegin_zoom_cl = jbegin_zoom[i];
-            iend_zoom_cl = ibegin_zoom[i]+ni_zoom[i]-1;
-            jend_zoom_cl = jbegin_zoom[i]+nj_zoom[i]-1;
-         }
-         
-
-         if (comm::CMPIManager::IsClient())
-         {
-           for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++)
-           {
-              (*storeIndex_srv)[n]  = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur.
-
-              (*out_i_index_srv)[n] = (*out_i_index_cl)[m] + ibegin_cl - 1 - (ibegin_srv + ibegin_zoom_srv - 1) + 1 ;
-              (*out_j_index_srv)[n] = (*out_j_index_cl)[m] + jbegin_cl - 1 - (jbegin_srv + jbegin_zoom_srv - 1) + 1 ;
-              (*out_l_index_srv)[n] = (*out_l_index_cl)[m];
-           }
-         }
-         else
-         {
-           for (StdSize n = dn, m = 0; n < (dn + storeIndex_cl->size()); n++, m++)
-           {
-              (*storeIndex_srv)[n]  = (*storeIndex_cl)[m]; // Faux mais inutile dans le cas serveur.
-            (*out_i_index_srv)[n] = (*out_i_index_cl)[m] 
-                                   + (ibegin_cl - 1) - (ibegin_srv - 1) + (ibegin_zoom_cl - 1) - (ibegin_zoom_srv - 1);
-            (*out_j_index_srv)[n] = (*out_j_index_cl)[m]
-                                   + (jbegin_cl - 1) - (jbegin_srv - 1) + (jbegin_zoom_cl - 1) - (jbegin_zoom_srv - 1);
-            (*out_l_index_srv)[n] = (*out_l_index_cl)[m];
-           }         
-            
-         }
-                  
-         dn += storeIndex_cl->size(); 
-      }
-      
-      if (storeIndex_srv->size() != 0)
-      {
-         const int ibegin_t = 
-            *std::min_element(out_i_index_srv->begin(), out_i_index_srv->end());
-         const int iend_t   =
-            *std::max_element(out_i_index_srv->begin(), out_i_index_srv->end());
-         const int jbegin_t =   
-            *std::min_element(out_j_index_srv->begin(), out_j_index_srv->end());
-         const int jend_t   =
-            *std::max_element(out_j_index_srv->begin(), out_j_index_srv->end());
-               
-                                 
-         if ((ibegin_t < 0) || (jbegin_t < 0) ||
-             (iend_t >= zoom_ni_srv) || (jend_t >= zoom_nj_srv))
-         {
-            ERROR("CGrid::computeIndexServer(void)",
-                  << "[ grille = "      << this->getId()
-                  << ", ibegin_t = "    << ibegin_t
-                  << ", jbegin_t = "    << jbegin_t
-                  << ", iend_t = "      << iend_t
-                  << ", jend_t = "      << jend_t
-                  << ", zoom_ni_srv = " << zoom_ni_srv
-                  << ", zoom_nj_srv = " << zoom_nj_srv
-                  << ", nb subdomain = "   << out_i_index.size()-1
-                  <<" ] Erreur d'indexation de la grille au niveau du serveur") ;
-         }
-      }
-
-      if (storeIndex_srv->size() != 0)
-         for (StdSize u = 0; u < storeIndex_srv->size(); u++)
-            (*local_mask)[(*out_i_index_srv)[u]][(*out_j_index_srv)[u]] = 1;
-
-//      StdOFStream ofs(("log_server_"+this->getId()).c_str());
-//      for (StdSize h = 0; h < storeIndex_srv->size(); h++)
-//      {
-//        ofs << "(" << (*storeIndex_srv)[h]  << ";"
-//            << (*out_i_index_srv)[h] << ","
-//            << (*out_j_index_srv)[h] << ","
-//            << (*out_l_index_srv)[h] << ")" << std::endl;
-//      }
-//       ofs.close();
-   
-      this->storeIndex [0] = storeIndex_srv ;
-      this->out_i_index[0] = out_i_index_srv;
-      this->out_j_index[0] = out_j_index_srv;
-      this->out_l_index[0] = out_l_index_srv;      
-   }
-*/
-   
-   void CGrid::inputFieldServer
-         (const std::deque<ARRAY(double, 1)> storedClient,
-                           ARRAY(double, 1)  storedServer) const
+   void CGrid::inputFieldServer(const std::deque< CArray<double, 1>* > storedClient, CArray<double, 1>&  storedServer) const
    {
       if ((this->storeIndex.size()-1 ) != storedClient.size())
-         ERROR("CGrid::inputFieldServer(...)",
+         ERROR("void CGrid::inputFieldServer(const std::deque< CArray<double, 1>* > storedClient, CArray<double, 1>&  storedServer) const",
                 << "[ Nombre de tableau attendu = " << (this->storeIndex.size()-1) << ", "
                 << "[ Nombre de tableau reÃ§u = "    << storedClient.size() << "] "
                 << "Les donnÃ©es d'un client sont manquantes !") ;
-      if (storedServer.get() != NULL)
-         storedServer->resize(boost::extents[this->storeIndex[0]->num_elements()]);
-      else 
-         ARRAY_ASSIGN(storedServer, double, 1, [this->storeIndex[0]->num_elements()]);
+      storedServer.resize(storeIndex[0]->numElements());
          
       for (StdSize i = 0, n = 0; i < storedClient.size(); i++)
-         for (StdSize j = 0; j < storedClient[i]->num_elements(); j++)
-            (*storedServer)[n++] = (*storedClient[i])[j];
-   }
-
-   void CGrid::outputFieldToServer(ARRAY(double, 1) fieldIn, int rank, ARRAY(double, 1) fieldOut)
-   {
-     ARRAY(int,1) index=storeIndex_toSrv[rank] ;
-     int nb=index->num_elements() ;
-     fieldOut->resize(extents[nb]) ;
+         for (StdSize j = 0; j < storedClient[i]->numElements(); j++)
+            storedServer(n++) = (*storedClient[i])(j);
+   }
+
+   void CGrid::outputFieldToServer(CArray<double,1>& fieldIn, int rank, CArray<double,1>& fieldOut)
+   {
+     CArray<int,1>& index = *storeIndex_toSrv[rank] ;
+     int nb=index.numElements() ;
+     fieldOut.resize(nb) ;
      
-     for(int k=0;k<nb;k++) (*fieldOut)[k]=(*fieldIn)[(*index)[k]] ;
+     for(int k=0;k<nb;k++) fieldOut(k)=fieldIn(index(k)) ;
     }
    ///---------------------------------------------------------------
Index: XIOS/trunk/src/node/grid.hpp
===================================================================
--- XIOS/trunk/src/node/grid.hpp	(revision 368)
+++ XIOS/trunk/src/node/grid.hpp	(revision 369)
@@ -9,4 +9,6 @@
 #include "domain.hpp"
 #include "axis.hpp"
+#include "array_new.hpp"
+#include "attribute_array.hpp"
 
 namespace xios {
@@ -54,6 +56,6 @@
          void solveReference(void);
 
-         virtual void toBinary  (StdOStream & os) const;
-         virtual void fromBinary(StdIStream & is);
+ //        virtual void toBinary  (StdOStream & os) const;
+//         virtual void fromBinary(StdIStream & is);
 
          /// Tests ///
@@ -63,8 +65,8 @@
 
          /// Accesseurs ///
-         const std::deque<ARRAY(int, 1)> & getStoreIndex(void) const;
-         const std::deque<ARRAY(int, 1)> & getOutIIndex(void)  const;
-         const std::deque<ARRAY(int, 1)> & getOutJIndex(void)  const;
-         const std::deque<ARRAY(int, 1)> & getOutLIndex(void)  const;
+         const std::deque< CArray<int, 1>* > & getStoreIndex(void) const;
+         const std::deque< CArray<int, 1>* > & getOutIIndex(void)  const;
+         const std::deque< CArray<int, 1>* > & getOutJIndex(void)  const;
+         const std::deque< CArray<int, 1>* > & getOutLIndex(void)  const;
 
          const CAxis*   getRelAxis  (void) const;
@@ -80,16 +82,13 @@
 
          /// EntrÃ©es-sorties de champs ///
-         template <StdSize n>
-            void inputField(const ARRAY(double, n) field, ARRAY(double, 1) stored) const;
+         template <int n>
+            void inputField(const CArray<double,n>& field, CArray<double,1>& stored) const;
             
-         void inputFieldServer(const std::deque<ARRAY(double, 1)> storedClient,
-                                                ARRAY(double, 1)  storedServer) const;
-/*
-         template <StdSize n>
-            void outputField(const ARRAY(double, 1) stored,  ARRAY(double, n) field) const;
-*/
-         void outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 3) field)  ;
-         void outputField(int rank, const ARRAY(double, 1) stored,  ARRAY(double, 2) field)  ;
-         void outputField(int rank,const ARRAY(double, 1) stored,  ARRAY(double, 1) field)  ; 
+         void inputFieldServer(const std::deque< CArray<double, 1>* > storedClient,
+                               CArray<double, 1>&  storedServer) const;
+
+         void outputField(int rank, const CArray<double,1>& stored,  CArray<double,3>& field)  ;
+         void outputField(int rank, const CArray<double,1>& stored,  CArray<double,2>& field)  ;
+         void outputField(int rank, const CArray<double,1>& stored,  CArray<double,1>& field)  ; 
    
          /// Destructeur ///
@@ -111,5 +110,5 @@
 
          /// EntrÃ©es-sorties de champs (interne) ///
-         void storeField_arr(const double * const data, ARRAY(double, 1) stored) const;
+         void storeField_arr(const double * const data, CArray<double,1>& stored) const;
 
          /// Traitements protÃ©gÃ©s ///
@@ -120,5 +119,5 @@
 
          static bool dispatchEvent(CEventServer& event) ;
-         void outputFieldToServer(ARRAY(double, 1) fieldIn, int rank, ARRAY(double, 1) fieldOut) ;
+         void outputFieldToServer(CArray<double,1>& fieldIn, int rank, CArray<double,1>& fieldOut) ;
          static void recvIndex(CEventServer& event) ;
          void recvIndex(int rank, CBufferIn& buffer) ;
@@ -134,14 +133,15 @@
          CDomain* domain ;
 
-         std::deque<ARRAY(int, 1)> storeIndex ;
-         std::deque<ARRAY(int, 1)> out_i_index ;
-         std::deque<ARRAY(int, 1)> out_j_index ;
-         std::deque<ARRAY(int, 1)> out_l_index ;
-         ARRAY(int, 1) storeIndex_client ;
-         ARRAY(int, 1) out_i_client ;
-         ARRAY(int, 1) out_j_client ;
-         ARRAY(int, 1) out_l_client ;
+         std::deque< CArray<int, 1>* > storeIndex ;
+         std::deque< CArray<int, 1>* > out_i_index ;
+         std::deque< CArray<int, 1>* > out_j_index ;
+         std::deque< CArray<int, 1>* > out_l_index ;
          
-         map<int,ARRAY(int, 1)>  storeIndex_toSrv ;
+        CArray<int, 1>  storeIndex_client ;
+        CArray<int, 1>  out_i_client ;
+        CArray<int, 1>  out_j_client ;
+        CArray<int, 1>  out_l_client ;
+         
+         map<int, CArray<int, 1>* >  storeIndex_toSrv ;
          map<int,int> nbSenders ;
 //         std::deque<ARRAY(int, 1)> out_i_toSrv ;
@@ -149,7 +149,7 @@
 //         std::deque<ARRAY(int, 1)> out_l_toSrv ;
          
-         map<int,ARRAY(int, 1)> out_i_fromClient ;
-         map<int,ARRAY(int, 1)> out_j_fromClient ;
-         map<int,ARRAY(int, 1)> out_l_fromClient ;
+         map<int, CArray<int, 1>* > out_i_fromClient ;
+         map<int, CArray<int, 1>* > out_j_fromClient ;
+         map<int, CArray<int, 1>* > out_l_fromClient ;
          
    }; // class CGrid
@@ -157,13 +157,13 @@
    ///--------------------------------------------------------------
 
-   template <StdSize n>
-      void CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored) const
+   template <int n>
+      void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const
    {
-      if (this->getDataSize() != field->num_elements())
-         ERROR("CGrid::inputField(const  ARRAY(double, n) field, ARRAY(double, 1) stored)",
+      if (this->getDataSize() != field.numElements())
+         ERROR("void CGrid::inputField(const  CArray<double,n>& field, CArray<double,1>& stored) const",
                 << "[ Taille des donnÃ©es attendue = " << this->getDataSize()       << ", "
-                << "Taille des donnÃ©es reÃ§ue = "      << field->num_elements() << " ] "
+                << "Taille des donnÃ©es reÃ§ue = "      << field.numElements() << " ] "
                 << "Le tableau de donnÃ©es n'a pas la bonne taille !") ;
-      this->storeField_arr(field->data(), stored) ;
+      this->storeField_arr(field.dataFirst(), stored) ;
    }
 
Index: XIOS/trunk/src/node/variable.cpp
===================================================================
--- XIOS/trunk/src/node/variable.cpp	(revision 368)
+++ XIOS/trunk/src/node/variable.cpp	(revision 369)
@@ -60,5 +60,5 @@
       return (oss.str());
    }
-
+/*
    void CVariable::toBinary(StdOStream & os) const
    {
@@ -79,5 +79,5 @@
       is.read (const_cast<char *>(this->content.data()), size * sizeof(char));
    }
-
+*/
    void CVariableGroup::parse(xml::CXMLNode & node, bool withAttr)
    {
Index: XIOS/trunk/src/node/variable.hpp
===================================================================
--- XIOS/trunk/src/node/variable.hpp	(revision 368)
+++ XIOS/trunk/src/node/variable.hpp	(revision 369)
@@ -55,6 +55,6 @@
             virtual StdString toString(void) const;
 
-            virtual void toBinary  (StdOStream & os) const;
-            virtual void fromBinary(StdIStream & is);
+//            virtual void toBinary  (StdOStream & os) const;
+//            virtual void fromBinary(StdIStream & is);
 
             /// Accesseur ///
@@ -67,5 +67,5 @@
             
             template <typename T, StdSize N>
-               inline void getData(ARRAY(T, N) _data_array) const;
+            inline void getData(CArray<T, N>& _data_array) const;
 
          public :
Index: XIOS/trunk/src/object.cpp
===================================================================
--- XIOS/trunk/src/object.cpp	(revision 368)
+++ XIOS/trunk/src/object.cpp	(revision 369)
@@ -40,5 +40,5 @@
       this->IdDefined = true ;
    }
-
+/*
    bool CObject::operator==(const CObject & other) const
    {
@@ -52,5 +52,5 @@
       return (!(*this == other));
    }
-
+*/
    StdOStream & operator << (StdOStream & os, const CObject & object)
    { 
Index: XIOS/trunk/src/object.hpp
===================================================================
--- XIOS/trunk/src/object.hpp	(revision 368)
+++ XIOS/trunk/src/object.hpp	(revision 369)
@@ -27,6 +27,6 @@
 
          /// OpÃ©rateurs ///
-         bool operator==(const CObject & other) const;
-         bool operator!=(const CObject & other) const;
+//         bool operator==(const CObject & other) const;
+//         bool operator!=(const CObject & other) const;
 
          /// Flux ///
Index: XIOS/trunk/src/object_template.hpp
===================================================================
--- XIOS/trunk/src/object_template.hpp	(revision 368)
+++ XIOS/trunk/src/object_template.hpp	(revision 369)
@@ -38,6 +38,6 @@
          virtual void fromString(const StdString & str);
 
-         virtual void toBinary  (StdOStream & os) const;
-         virtual void fromBinary(StdIStream & is);
+//         virtual void toBinary  (StdOStream & os) const;
+//         virtual void fromBinary(StdIStream & is);
          virtual string getName(void) const ;
          virtual void parse(xml::CXMLNode & node);
Index: XIOS/trunk/src/object_template_impl.hpp
===================================================================
--- XIOS/trunk/src/object_template_impl.hpp	(revision 368)
+++ XIOS/trunk/src/object_template_impl.hpp	(revision 369)
@@ -90,5 +90,6 @@
    
    //---------------------------------------------------------------
-   
+
+/*   
    template <class T>
       void CObjectTemplate<T>::toBinary(StdOStream & os) const
@@ -102,5 +103,6 @@
       SuperClassMap::fromBinary(is); 
    }
-   
+*/
+
    //---------------------------------------------------------------
 
@@ -321,4 +323,5 @@
      oss<<"#include \"icutil.hpp\""<<iendl ;
      oss<<"#include \"timer.hpp\""<<iendl ;
+     oss<<"#include \"node_type.hpp\""<<iendl ;
      oss<<iendl ;
      oss<<"extern \"C\""<<iendl ;
Index: XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- XIOS/trunk/src/output/nc4_data_output.cpp	(revision 368)
+++ XIOS/trunk/src/output/nc4_data_output.cpp	(revision 369)
@@ -79,10 +79,5 @@
                              ? StdString("lat").append(appendDomid).append("_local")
                              : latid;
-// supress mask         StdString maskid    = StdString("mask_").append(domid).append("_local");
-
-// supress mask         ARRAY(int, 2) mask = domain->getLocalMask();
-
-//         unsigned int ssize = domain->zoom_ni_loc.getValue() * domain->zoom_nj_loc.getValue();
-//         bool isCurvilinear = (domain->lonvalue.getValue()->size() == ssize);
+
          bool isCurvilinear = true ; //for moment
 
@@ -258,8 +253,7 @@
                SuperClassWriter::definition_end();
                
-               ARRAY(double,1) axis_value=axis->value.getValue() ;
-               ARRAY_CREATE(value,double,1,[zoom_size]) ;
-               for(StdSize i = 0 ; i < zoom_size ; i++) (*value)[i]=(*axis_value)[i+zoom_begin] ;
-               SuperClassWriter::writeData(value, axisid, isCollective, 0);
+               CArray<double,1> axis_value(zoom_size) ;
+               for(StdSize i = 0 ; i < zoom_size ; i++) axis_value(i)=axis->value(i+zoom_begin) ;
+               SuperClassWriter::writeData(axis_value, axisid, isCollective, 0);
                
                SuperClassWriter::definition_start();
@@ -488,9 +482,8 @@
              << "_" << field->getRelFile()->output_freq.getValue();
              
- //        ARRAY(double, 1) field_data = field->data_srv;
-         ARRAY_CREATE(time_data, double, 1, [1]);
-         if (field->operation.getValue()=="instant") (*time_data)[0] = Time(*field->last_Write_srv)
+         CArray<double,1> time_data(1) ;
+         if (field->operation.getValue()=="instant") time_data(0) = Time(*field->last_Write_srv)
                                                                       -Time(context->calendar->getTimeOrigin());
-         else (*time_data)[0] = (Time(*field->last_Write_srv)+Time(*field->lastlast_Write_srv))/2
+         else time_data(0) = (Time(*field->last_Write_srv)+Time(*field->lastlast_Write_srv))/2
                                -Time(context->calendar->getTimeOrigin());
            
@@ -498,5 +491,5 @@
          {
             CAxis* axis = grid->axis ;
-            ARRAY_CREATE(field_data3D,double,3,[domain->zoom_ni_srv][domain->zoom_nj_srv][axis->zoom_size.getValue()]) ;
+            CArray<double,3> field_data3D(domain->zoom_ni_srv,domain->zoom_nj_srv,axis->zoom_size) ;
             field->outputField(field_data3D);
             switch (SuperClass::type)
@@ -532,5 +525,5 @@
          else // 2D
          {
-            ARRAY_CREATE(field_data2D,double,2,[domain->zoom_ni_srv][domain->zoom_nj_srv]) ;
+            CArray<double,2> field_data2D(domain->zoom_ni_srv,domain->zoom_nj_srv) ;
             field->outputField(field_data2D);
             switch (SuperClass::type)
Index: XIOS/trunk/src/output/nc4_data_output.hpp
===================================================================
--- XIOS/trunk/src/output/nc4_data_output.hpp	(revision 368)
+++ XIOS/trunk/src/output/nc4_data_output.hpp	(revision 369)
@@ -81,12 +81,5 @@
                                      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 :
 
Index: XIOS/trunk/src/output/onetcdf4.cpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4.cpp	(revision 368)
+++ XIOS/trunk/src/output/onetcdf4.cpp	(revision 369)
@@ -358,5 +358,5 @@
          void CONetCDF4::writeData_(int grpid, int varid,
                                     const std::vector<StdSize> & sstart,
-                                    const std::vector<StdSize> & scount, double * data)
+                                    const std::vector<StdSize> & scount, const double * data)
       {
          cout<<"writeData_"<<endl ;
@@ -375,5 +375,5 @@
          void CONetCDF4::writeData_(int grpid, int varid,
                                     const std::vector<StdSize> & sstart,
-                                    const std::vector<StdSize> & scount, int * data)
+                                    const std::vector<StdSize> & scount, const int * data)
       {
           CheckError(nc_put_vara_int(grpid, varid, &(sstart[0]), &(scount[0]), data));
@@ -386,5 +386,5 @@
          void CONetCDF4::writeData_(int grpid, int varid,
                                     const std::vector<StdSize> & sstart,
-                                    const std::vector<StdSize> & scount, float * data)
+                                    const std::vector<StdSize> & scount, const float * data)
       {
           CheckError(nc_put_vara_float(grpid, varid, &(sstart[0]), &(scount[0]), data));
@@ -394,5 +394,5 @@
       //---------------------------------------------------------------
 
-      void CONetCDF4::writeData(const ARRAY(int, 2) data, const StdString & name)
+      void CONetCDF4::writeData(const CArray<int, 2>& data, const StdString & name)
       {
          int grpid = this->getCurrentGroup();
@@ -402,5 +402,5 @@
 
          this->getWriteDataInfos(name, 0, array_size,  sstart, scount, NULL, NULL);
-         this->writeData_(grpid, varid, sstart, scount, data->data());
+         this->writeData_(grpid, varid, sstart, scount, data.dataFirst());
       }
 
Index: XIOS/trunk/src/output/onetcdf4.hpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4.hpp	(revision 368)
+++ XIOS/trunk/src/output/onetcdf4.hpp	(revision 369)
@@ -5,6 +5,6 @@
 #include "xmlioserver_spl.hpp"
 #include "exception.hpp"
-#include "array.hpp"
 #include "data_output.hpp"
+#include "array_new.hpp"
 
 #include <mpi.h>
@@ -66,11 +66,11 @@
 
             /// Ecriture des donnÃ©es ///
-            template <class T, StdSize ndim>
-               void writeData(const ARRAY(T, ndim) data, const StdString & name,
+            template <class T, int ndim>
+               void writeData(const CArray<T,ndim>& data, const StdString & name,
                               bool collective, StdSize record,
                               const std::vector<StdSize> * start = NULL,
                               const std::vector<StdSize> * count = NULL);
 
-            void writeData(const ARRAY(int, 2) data, const StdString & name);
+            void writeData(const CArray<int, 2>& data, const StdString & name);
 
             /// Accesseur ///
Index: XIOS/trunk/src/output/onetcdf4_decl.cpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4_decl.cpp	(revision 368)
+++ XIOS/trunk/src/output/onetcdf4_decl.cpp	(revision 369)
@@ -4,5 +4,5 @@
 {
 # define  macro(type,size) \
-  template void CONetCDF4::writeData<type,size>(const ARRAY(type, size) data, const StdString & name, \
+  template void CONetCDF4::writeData<type,size>(const CArray<type, size>& data, const StdString & name, \
                                                bool collective, StdSize record, \
                                                const std::vector<StdSize> * start, \
Index: XIOS/trunk/src/output/onetcdf4_impl.hpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4_impl.hpp	(revision 368)
+++ XIOS/trunk/src/output/onetcdf4_impl.hpp	(revision 369)
@@ -6,6 +6,6 @@
 namespace xios
 {
-  template <class T, StdSize ndim>
-  void CONetCDF4::writeData(const ARRAY(T, ndim) data, const StdString & name,
+  template <class T, int ndim>
+  void CONetCDF4::writeData(const CArray<T, ndim>& data, const StdString & name,
                             bool collective, StdSize record,
                             const std::vector<StdSize> * start,
@@ -24,13 +24,13 @@
     this->getWriteDataInfos
     (name, record, array_size,  sstart, scount, start, count);
-    if (data->num_elements() != array_size)
+    if (data.numElements() != array_size)
     {
       ERROR("CONetCDF4::writeData(...)",
-      << "[ input array size = "  << data->num_elements()
+      << "[ input array size = "  << data.numElements()
       << ", intern array size = " << array_size
       << " ] Invalid input data !" );
     }
          
-    this->writeData_(grpid, varid, sstart, scount, data->data());
+    this->writeData_(grpid, varid, sstart, scount, data.dataFirst());
   }
       
@@ -57,12 +57,3 @@
 
 
-
-
-
-
-
-
-
-
-
 #endif
Index: XIOS/trunk/src/test/test.cpp
===================================================================
--- XIOS/trunk/src/test/test.cpp	(revision 368)
+++ XIOS/trunk/src/test/test.cpp	(revision 369)
@@ -8,4 +8,15 @@
 #include "date.hpp"
 #include "calendar_util.hpp"
+//#include "test_enum.hpp"
+#include "type.hpp"
+//#include "axis.hpp"
+//#include "field.hpp"
+#include "declare_attribute.hpp"
+#include "attribute_map.hpp"
+#include "array_new.hpp"
+#include "attribute_array.hpp"
+#include "attribute_array_impl.hpp"
+
+
 
 using namespace std ;
@@ -13,4 +24,23 @@
 using namespace boost::gregorian ;
 using namespace xios;
+using namespace blitz;
+
+  class CEnum_color
+  {
+    public:
+    enum t_enum { rouge=0, vert, bleu} ;
+    static const char** getStr(void) { static const char * enumStr[] = { "rouge", "vert", "bleu" } ; return enumStr ; }   
+    int getSize(void) { return 3 ; }   
+  } ;
+
+#include "enum.hpp"
+#include "enum_impl.hpp"
+#include "enum_ref_impl.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
+
+template class CEnum<CEnum_color> ;
+template class CAttributeEnum<CEnum_color> ;
+
 
 int main(void)
@@ -18,8 +48,108 @@
 //      ptime t(time_from_string("2012-02-30 15:24")) ;
 //      std::cout << to_simple_string(t) << std::endl;
-      CGregorianCalendar MyCalendar("2011-03-01 00:00") ;
-      cout<<MyCalendar.getInitDate()<<endl;
-      cout<<MyCalendar.getCurrentDate()<<endl ;
-      cout<<MyCalendar.getCurrentDate()-1*Day<<endl ;
+  CGregorianCalendar MyCalendar("2011-03-01 00:00") ;
+  cout<<MyCalendar.getInitDate()<<endl;
+  cout<<MyCalendar.getCurrentDate()<<endl ;
+  cout<<MyCalendar.getCurrentDate()-1*Day<<endl ;
+      
+  //CEnum<CEnum_color> MyEnum ;
+  //MyEnum.val=CEnum<CEnum_color>::rouge ;
+  
+  CEnum_color::t_enum y;
+  
+  CType<int> a(10) ;
+  CType<int> b ;
+  
+  a=5 ;
+  b=10.5 ;
+  a=a+b ;
+  cout<<a<<endl ;
+  if (a==5) cout<<"a que coucou"<<endl ;
+  else if (a!=5) cout<<"a que pas coucou"<<endl ;
+  
+  CType_ref<int> c(a);
+  cout<<c<<endl ;
+  a=3 ;
+  cout<<c<<endl ;
+//  c=b ;
+  cout<<c<<endl ;
+  b=4 ;
+  cout<<c<<endl ;
+  c.set_ref(b) ;
+  cout<<c<<endl ;
+  int x=c+c+a ;
+  cout<<x<<endl ;
+ 
+//  test::CAttributeTemplate<int> xx("toto") ;
+//  test::totoatt toto ;
+//  test::titiatt titi ;
+//  CAxis A ;
+//  CTest A ;
+//  CAxis B ;
+//    CField A ;
+//    cout<<xx.size()<<endl ;
+
+  CEnum<CEnum_color> color,color1 ;
+  color=CEnum<CEnum_color>::rouge ;
+  color1=color ;
+  
+  if (color1==CEnum<CEnum_color>::rouge) cout<<"Rouge !!"<<endl ;
+  if (color1==color) cout<<"Rouge !!"<<endl ;
+  color=CEnum<CEnum_color>::bleu ;
+ 
+  if (color1==color) cout<<"Rouge !!"<<endl ;
+  
+  cout<<color1.toString()<<endl ;
+  color1.fromString("vert ") ;
+  cout<<color1.toString()<<endl ;
+ 
+//  color1.fromString("jaune") ;
+  cout<<color1.toString()<<endl ;
+  cout<<sizeof(CEnum_color::t_enum)<<endl ; 
+  
+  CEnum_color::t_enum tt ;
+  tt=(CEnum_color::t_enum)1 ;
+  int ii=tt ;
+  cout<<ii<<endl ;
+  
+  CAttributeEnum<CEnum_color> toto("toto",CEnum_color::rouge) ;
+  CAttributeEnum<CEnum_color> titi("titi",CEnum_color::vert) ;
+  cout<<toto.toString()<<endl ;
+  toto.fromString(" vert  ") ;
+  cout<<toto.toString()<<endl ;
+
+  tt=toto ;
+  cout<<tt<<endl ;
+  cout<<titi.toString()<<endl ;
+  
+  if (titi==toto) cout<<"titi==toto"<<endl ;
+  else cout<<"titi!=toto"<<endl ;
+  titi=CEnum_color::rouge ;
+  if (titi==toto) cout<<"titi==toto"<<endl ;
+  else cout<<"titi!=toto"<<endl ;
+
+  CArray<int,2> A(2,2) ;
+  CArray<int,2> B(2,2) ;
+  A=1,2,3,4 ;
+  B = 1 ;
+  B+=A ;
+  cout<<B.toString()<<endl ;
+  cout<<A.toString()<<endl ;
+  string str="(0,1) x (0,1) [4 3 2 1]" ;
+  CArray<int,2> C ;
+  CBufferOut out(B.size()) ;
+  
+  B.toBuffer(out) ;
+  
+  CBufferIn in(out.begin,B.size()) ;
+  C.fromBuffer(in) ;
+  
+  cout<<C<<endl ; 
+  
+  CAttributeArray<int,2> attr("toto") ;
+  attr.resize(2,2) ;
+  attr=C ;
+  cout<<"attr "<<attr<<endl ;
+  cout<<attr.toString()<<endl ;
   return 1 ;  
 }
Index: XIOS/trunk/src/test/test_cs.f90
===================================================================
--- XIOS/trunk/src/test/test_cs.f90	(revision 368)
+++ XIOS/trunk/src/test/test_cs.f90	(revision 369)
@@ -10,6 +10,6 @@
   CALL MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr)
   
-  IF (rank<8) THEN
-   CALL client("client",rank,8)
+  IF (rank<7) THEN
+   CALL client("client",rank,7)
   ELSE 
     CALL server
@@ -90,5 +90,5 @@
   CALL xios_set_axis_attr("axis_A",size=llm ,value=lval) ;
   CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj)
-  !CALL xios_set_domain_attr("domain_A",zoom_ni=3,zoom_ibegin=3,zoom_nj=3,zoom_jbegin=6)
+!  CALL xios_set_domain_attr("domain_A",zoom_ni=10,zoom_ibegin=5,zoom_nj=20,zoom_jbegin=10)
   CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4)
   CALL xios_set_domain_attr("domain_A",lonvalue=RESHAPE(lon,(/ni*nj/)),latvalue=RESHAPE(lat,(/ni*nj/)))
Index: XIOS/trunk/src/test/test_xios.cpp
===================================================================
--- XIOS/trunk/src/test/test_xios.cpp	(revision 368)
+++ XIOS/trunk/src/test/test_xios.cpp	(revision 369)
@@ -11,4 +11,5 @@
 #include "context_server.hpp"
 #include "object_template.hpp"
+#include "array_new.hpp"
 #include <mpi.h>
 
@@ -27,26 +28,12 @@
    CBufferIn  bufferIn(&buff,sizeof(buff)) ;
    CMessage msg ;
-/*
-   msg<<(int)3<<(int)2<<(int)1<<str ;
-//   msg<<a<<b<<c ;
-   std::cout<<"message size : "<<msg.size()<<std::endl ;
-   str="turlututu" ;
-   bufferOut<<msg ;
-   msg.clear() ;
-   msg<<a<<b<<c<<str ;
-//   bufferIn>>c>>b>>a>>str ;
-   bufferIn>>msg ;
-   std::cout<<a<<"  "<<b<<"  "<<c<<"  "<<str<<endl ;
-*/
-//   CAttributeTemplate<ARRAY(double,1)> tabIn ;
- //  CAttributeTemplate<ARRAY(double,1)> tabOut ;
-   CAttributeTemplate<ARRAY(double,1)> tabIn("in") ;
-   CAttributeTemplate<ARRAY(double,1)> tabOut("out") ;
 
-   ARRAY_CREATE(tab,double,1,[5]) ; 
- //   tab->resize(extents[5]) ;
-    (*tab)[0]=0 ; (*tab)[1]=1 ;(*tab)[2]=2 ; (*tab)[3]=3 ;(*tab)[4]=4 ;
+   CAttributeArray<double,1> tabIn("in") ;
+   CAttributeArray<double,1> tabOut("out") ;
+
+   CArray<double,1> tab(5)
+    tab=0,1,2,3,4 ;
     tabIn=tab ;
-    (*tab)[0]=4 ; (*tab)[1]=3 ;(*tab)[2]=2 ; (*tab)[3]=1 ;(*tab)[4]=0 ;
+    tab= 4,3,2,1,0
     tabOut=tab ;
 //   tabOut=1 ;
Index: XIOS/trunk/src/test_enum.hpp
===================================================================
--- XIOS/trunk/src/test_enum.hpp	(revision 369)
+++ XIOS/trunk/src/test_enum.hpp	(revision 369)
@@ -0,0 +1,24 @@
+
+
+namespace xios
+{
+  
+    
+  class CEnum_color
+  {
+    public:
+    enum t_enum { rouge=0, vert, bleu} ;
+    t_enum val ;
+    
+    const char** getStr(void) { static const char * enumStr[] = { "rouge", "vert", "bleu" } ; return enumStr ; }   
+    int getSize(void) { return 3 ; }   
+  } ;
+  
+  template <typename CEnumType>
+  class CEnum : public CEnumType
+  {
+    public :
+//    typedef CEnum<CEnumType>::t_enum  myEnum; 
+  } ;
+}
+     
Index: XIOS/trunk/src/type/base_type.cpp
===================================================================
--- XIOS/trunk/src/type/base_type.cpp	(revision 368)
+++ 	(revision )
@@ -1,64 +1,0 @@
-#include "xmlioserver_spl.hpp"
-#include "exception.hpp"
-#include "base_type.hpp"
-#include "buffer_in.hpp"
-#include "buffer_out.hpp"
-
-namespace xios
-{
-   CBaseType::CBaseType(void) {}
-   
-   void CBaseType::fromString(const string& str)
-   { 
-   
-      ERROR("void CBaseType::fromString(const string& str)",
-            <<"Non implemented method in derived class");
-   }
-
-   string CBaseType::toString(void) const
-   {
-      ERROR("string CBaseType::toString(void) const",
-            <<"Non implemented method in derived class");
-      return string("") ;
-   }
-   
-   bool CBaseType::fromBuffer(CBufferIn& buffer)
-   { 
-   
-      ERROR("bool CBaseType::fromBuffer(CBufferIn& buffer) const",
-            <<"Non implemented method in derived class");
-      return false ;
-   }
-
-   bool CBaseType::toBuffer(CBufferOut& buffer) const
-   {
-      ERROR("bool CBaseType::fromBuffer(CBufferIn& buffer) const",
-            <<"Non implemented method in derived class");
-      return false ;
-   }
-   
-   CBaseType* CBaseType::duplicate(void)
-   {
-     return this ;
-   }
-
-   CBaseType* CBaseType::duplicate(void) const 
-   {
-      ERROR(" CBaseType* CBaseType::duplicate(void) const ",
-            <<"Non implemented method in derived class");
-     return 0 ;
-   }
-   
-   void CBaseType::destroy(void)
-   {
-     
-   }
-
-    size_t CBaseType::size(void) const
-   {
-      ERROR("size_t CBaseType::size(void) const) const",
-            <<"Non implemented method in derived class");
-      return 0 ;
-   }
-
-}   
Index: XIOS/trunk/src/type/base_type.hpp
===================================================================
--- XIOS/trunk/src/type/base_type.hpp	(revision 368)
+++ XIOS/trunk/src/type/base_type.hpp	(revision 369)
@@ -13,14 +13,15 @@
     public:
     
-    CBaseType(void) ;
-    virtual void fromString(const string& str) ;
-    virtual string toString(void) const;
+    CBaseType(void) {}
+    virtual ~CBaseType() {}
+    virtual void fromString(const string& str) =0 ;
+    virtual string toString(void) const =0;
     
-    virtual bool fromBuffer(CBufferIn& buffer) ;
-    virtual bool toBuffer(CBufferOut& buffer) const;
-    virtual CBaseType* duplicate(void) const;
-    virtual CBaseType* duplicate(void) ;
-    virtual void destroy(void) ;
-    virtual size_t size(void) const;
+    virtual bool fromBuffer(CBufferIn& buffer) =0;
+    virtual bool toBuffer(CBufferOut& buffer) const =0;
+    virtual CBaseType* clone(void) const =0;
+    virtual size_t size(void) const =0;
+    virtual bool isEmpty(void) const =0;
+    virtual void reset(void) =0;
   } ;
 
Index: XIOS/trunk/src/type/enum.hpp
===================================================================
--- XIOS/trunk/src/type/enum.hpp	(revision 369)
+++ XIOS/trunk/src/type/enum.hpp	(revision 369)
@@ -0,0 +1,154 @@
+#ifndef __XIOS_ENUM__
+#define __XIOS_ENUM__
+
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+#include "base_type.hpp"
+#include "message.hpp"
+
+#define __INLINE__ inline
+
+
+namespace xios
+{
+  class CEnumBase
+  {
+  } ;
+  
+  template <typename T> class CEnum_ref ;
+ 
+  template <typename T> 
+  class CEnum : public  virtual CBaseType, public T
+  {
+    public:
+    typedef typename T::t_enum T_enum ;
+    CEnum(void) ;
+    __INLINE__ CEnum(const T_enum& val) ;
+    __INLINE__ CEnum(const CEnum& type) ;
+    __INLINE__ CEnum(const CEnum_ref<T>& type) ;
+    virtual ~CEnum() { _reset() ; }
+
+    __INLINE__ T_enum& get(void) ;
+    __INLINE__ const T_enum& get(void) const;
+
+    __INLINE__ void set(const T_enum& val) ;
+    __INLINE__ void set(const CEnum& val) ;
+    __INLINE__ void set(const CEnum_ref<T>& val) ;
+    __INLINE__ CEnum& operator = (const T_enum& val) ;
+    __INLINE__ CEnum& operator = (const CEnum& val) ;
+    __INLINE__ CEnum& operator = (const CEnum_ref<T>& val) ;
+    __INLINE__ operator T_enum&() ;
+        
+    virtual CEnum* clone(void) const   { return _clone(); }
+    virtual void fromString(const string& str)   { _fromString(str); }
+    virtual string toString(void) const { return _toString(); }
+    virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer) ; }
+    virtual bool toBuffer(CBufferOut& buffer) const { return _toBuffer(buffer); }
+    virtual void reset(void) { _reset(); }
+    virtual bool isEmpty() const { return _isEmpty(); } 
+    virtual size_t size(void) const { return _size(); }
+    
+    __INLINE__ void allocate(void) ;
+    __INLINE__ void checkEmpty(void) const;
+       
+    T_enum* ptrValue ;
+    bool empty ;
+      
+    friend class CEnum_ref<T> ; 
+ 
+    private :
+ 
+    __INLINE__ CEnum* _clone(void) const;
+    __INLINE__ void _fromString(const string& str) ;
+    __INLINE__ string _toString(void) const;
+    __INLINE__ bool _fromBuffer(CBufferIn& buffer) ;
+    __INLINE__ bool _toBuffer(CBufferOut& buffer) const;
+    __INLINE__ void _reset(void) ;
+    __INLINE__ bool _isEmpty() const ;  
+    __INLINE__ size_t _size(void) const ;
+ 
+  } ;
+  
+  
+  
+  template <typename T> 
+  class CEnum_ref : public  virtual CBaseType, public T
+  {
+    public:
+    
+    typedef typename T::t_enum T_enum ;
+    __INLINE__ CEnum_ref(void) ;
+    __INLINE__ CEnum_ref(T_enum& val) ;
+    __INLINE__ CEnum_ref(CEnum<T>& type) ;
+    __INLINE__ CEnum_ref(const CEnum_ref& type) ;
+    virtual ~CEnum_ref() {};
+
+    __INLINE__ T_enum& get(void) const;
+
+    __INLINE__ void set(const T_enum& val) const ;
+    __INLINE__ void set(const CEnum<T>& val) const ;
+    __INLINE__ void set(const CEnum_ref& val) const ;
+
+    __INLINE__ void set_ref(T_enum& val) ;
+    __INLINE__ void set_ref(CEnum<T>& val) ;
+    __INLINE__ void set_ref(const CEnum_ref& val) ;
+    
+    __INLINE__ const CEnum_ref& operator = (T_enum& val) const ;
+    __INLINE__ const CEnum_ref& operator = (CEnum<T>& val) const ;
+    __INLINE__ const CEnum_ref& operator = (const CEnum_ref& val) const;
+    __INLINE__ operator T_enum&() const;
+    bool operator == (const CEnum_ref &other) {return this->get()==other.get() ;}
+
+    virtual CEnum_ref* clone(void) const   { return _clone(); }
+    virtual void fromString(const string& str)   { _fromString(str); }
+    virtual void fromString(const string& str) const  { _fromString(str); }
+    virtual string toString(void) const { return _toString(); }
+    virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer) ; }
+    virtual bool fromBuffer(CBufferIn& buffer) const { return _fromBuffer(buffer); }
+    virtual bool toBuffer(CBufferOut& buffer) const { return _toBuffer(buffer); }
+    virtual void reset(void) { _reset(); }
+    virtual bool isEmpty() const { return _isEmpty(); } 
+    virtual size_t size(void) const { return _size(); }
+
+    __INLINE__ void checkEmpty(void) const;
+    
+
+    T_enum mutable * ptrValue ;
+    bool empty ;
+    friend class CEnum<T> ;
+    
+    private :
+    
+    __INLINE__ CEnum_ref* _clone(void) const;
+    __INLINE__ void _fromString(const string& str) ;
+    __INLINE__ void _fromString(const string& str) const;
+    __INLINE__ string _toString(void) const;
+    __INLINE__ bool _fromBuffer(CBufferIn& buffer) ;
+    __INLINE__ bool _fromBuffer(CBufferIn& buffer) const ;
+    __INLINE__ bool _toBuffer(CBufferOut& buffer) const;
+    __INLINE__ void _reset(void) ;
+    __INLINE__ bool _isEmpty() const ;  
+    __INLINE__  size_t _size(void) const ;
+  } ;
+  
+  template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type) ;
+  template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum & type) ;  
+  template <typename T> __INLINE__ CBufferIn& operator>>(CBufferIn& buffer, CEnum<T>& type) ;
+  template <typename T> __INLINE__ CMessage& operator<<(CMessage& msg, const CEnum<T>& type) ;
+  template <typename T> __INLINE__ CMessage& operator<<(CMessage& msg, const typename T::t_enum & type) ;
+
+  template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type) ;
+  template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum & type);
+  template <typename T> __INLINE__ CBufferIn& operator>>(CBufferIn& buffer, CEnum<T>& type);
+  template <typename T> __INLINE__ CMessage& operator<<(CMessage& msg, const CEnum<T>& type);
+  template <typename T> __INLINE__ CMessage& operator<<(CMessage& msg, const typename T::t_enum & type);
+}
+
+#  ifdef __INLINE__
+#    include "enum_impl.hpp"
+#    include "enum_ref_impl.hpp"
+#  endif
+
+#endif
Index: XIOS/trunk/src/type/enum_impl.hpp
===================================================================
--- XIOS/trunk/src/type/enum_impl.hpp	(revision 369)
+++ XIOS/trunk/src/type/enum_impl.hpp	(revision 369)
@@ -0,0 +1,293 @@
+#ifndef __XIOS_ENUM_IMPL__
+#define __XIOS_ENUM_IMPL__
+
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+#include "message.hpp"
+#include <string>
+#include <boost/algorithm/string.hpp>
+
+namespace xios
+{
+ 
+  using namespace std;
+  
+  template <typename T>
+  CEnum<T>::CEnum(void)
+  {
+    empty=true ;
+  }
+    
+  template <typename T>
+  CEnum<T>::CEnum(const T_enum& val)
+  {
+    empty=true ;
+    set(val) ;
+  }
+  
+  template <typename T>
+  CEnum<T>::CEnum(const CEnum<T>& type)
+  {
+    empty=true ;
+    set(type) ;
+  }
+
+  template <typename T>
+  CEnum<T>::CEnum(const CEnum_ref<T>& type)
+  {
+    empty=true ;
+    set(type) ;
+  }  
+
+  template <typename T>
+  void CEnum<T>::set(const T_enum& val)
+  {
+    if (empty) 
+    { 
+      ptrValue = new T_enum(val) ;
+      empty=false ;
+    }
+    else *ptrValue = val ;
+  }
+
+  template <typename T>
+  void CEnum<T>::set(const CEnum<T>& type)
+  {
+    if (type.isEmpty()) reset() ;
+    else
+    {
+      if (empty)
+      { 
+        ptrValue = new T_enum(*type.ptrValue) ;
+        empty=false ;
+      }
+      else *ptrValue = *type.ptrValue ;
+    }
+  }
+
+  template <typename T>
+  void CEnum<T>::set(const CEnum_ref<T>& type)
+  {
+    if (type.isEmpty()) reset() ;
+    else
+    {
+      if (empty)
+      { 
+        ptrValue = new T_enum(*type.ptrValue) ;
+        empty=false ;
+      }
+      else *ptrValue = *type.ptrValue ;
+    }
+  }
+
+
+  template <typename T>
+  typename T::t_enum & CEnum<T>::get(void)
+  {
+    checkEmpty();
+    return *ptrValue ;
+  }
+
+  template <typename T>
+  const typename T::t_enum& CEnum<T>::get(void) const
+  {
+    checkEmpty();
+    return *ptrValue ;
+  }
+  
+  template <typename T>
+  CEnum<T>& CEnum<T>::operator = (const T_enum& val)
+  {
+    set(val) ;
+    return *this ;
+  }
+  
+  template <typename T>
+  CEnum<T>& CEnum<T>::operator = (const CEnum<T>& type)
+  {
+    set(type) ;
+    return *this ;
+  }
+
+  template <typename T>
+  CEnum<T>& CEnum<T>::operator = (const CEnum_ref<T>& type)
+  {
+    set(type) ;
+    return *this ;
+  }
+
+
+  template <typename T>
+  CEnum<T>::operator T_enum&()
+  {
+    cout<<"CEnum<T>::operator T_enum&()"<<endl ;
+    checkEmpty();
+    return *ptrValue ;
+   }
+
+   template <typename T>
+   CEnum<T>* CEnum<T>::_clone(void) const
+   {
+     checkEmpty();
+     return new CEnum(*this) ;
+   }
+
+  
+  template <class T>
+  void CEnum<T>::_fromString(const string& str)
+  {
+    string tmpStr=boost::to_lower_copy(boost::trim_copy(str)) ;
+    
+    bool found=false ;
+    for(int i=0;i<T::getSize();i++)
+    {
+      if (boost::to_lower_copy(string(T::getStr()[i]))==tmpStr)
+      {
+        allocate() ;
+        *ptrValue=(T_enum) i ;
+        return ;
+      }
+    }
+    
+    ostringstream strList ;
+    for(int i=0;i<T::getSize();i++) 
+    {
+      if (i>0) strList<<", " ;
+      strList<<boost::to_lower_copy(string(T::getStr()[i])) ;
+    }
+    
+    ERROR("template <typename T> void CEnum<T>::_fromString(const string& str)",
+    << tmpStr << " cannot be converted in a valid enumeration, possibilities are : "<<strList.str() ) ;
+
+  }
+
+  template <typename T>
+  size_t CEnum<T>::_size(void) const
+  {
+    return sizeof(T_enum) ;
+  }
+  
+  template <typename T>
+  bool CEnum<T>::_isEmpty(void) const
+  {
+    return empty ;
+  }
+  
+  template <typename T>
+  string CEnum<T>::_toString(void) const
+  {
+    if (!empty) return string((T::getStr())[(int)(*ptrValue)]) ;
+  }
+  
+  template <typename T>
+  bool CEnum<T>::_toBuffer(CBufferOut& buffer) const
+  {
+    checkEmpty();
+    if (sizeof(*ptrValue)==sizeof(short int)) return buffer.put((short int) *ptrValue) ;
+    else if (sizeof(*ptrValue)==sizeof(int)) return buffer.put((int) *ptrValue) ;
+    else if (sizeof(*ptrValue)==sizeof(long int)) return buffer.put((long int) *ptrValue) ;
+    else ERROR("template <typename T>  bool CEnum<T>::_toBuffer(CBufferOut& buffer) const",
+               <<"incompatibility between enumeration and standard integer type") ;
+  }
+  
+  template <typename T>
+  bool CEnum<T>::_fromBuffer(CBufferIn& buffer)
+  {
+    bool ret ;
+    allocate() ;
+    if (sizeof(*ptrValue)==sizeof(short int)) 
+    {
+      short int val ;
+      ret=buffer.get(val) ;
+      if (ret) *ptrValue = (T_enum) val ;
+    }
+    else if (sizeof(*ptrValue)==sizeof(int)) 
+    {
+      int val ;
+      ret=buffer.get(val) ;
+      if (ret) *ptrValue = (T_enum) val ;
+    }
+    else if (sizeof(*ptrValue)==sizeof(long int)) 
+    {
+      long int val ;
+      ret=buffer.get(val) ;
+      if (ret) *ptrValue = (T_enum) val ;
+    }
+    else ERROR("template <typename T>  bool CEnum<T>::_fromBuffer(CBufferIn& buffer)",
+               <<"incompatibility between enumeration and standard integer type") ;
+    return ret ;
+  }
+ 
+
+  template <typename T>
+  void CEnum<T>::allocate(void)
+  {
+    if (empty) 
+    {
+      ptrValue = new T_enum ;
+      empty=false ;
+    }
+  }
+  
+  template <typename T>
+  void CEnum<T>::_reset(void)
+  {
+    if (!empty) 
+    {
+      delete ptrValue ;
+      empty=true ;
+    }
+  }
+  
+  template <typename T>
+  void CEnum<T>::checkEmpty(void) const
+  {
+    if (empty) ERROR("template <typename T> void CEnum<T>::checkEmpty(void) const", <<"Type is not initialized") ;
+  }  
+
+  
+  template <typename T>
+  CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type)
+  {
+    if (!type.toBuffer(buffer)) ERROR("template <typename T> CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type)",
+                                           <<"Buffer remain size is to low for size type") ;
+    return buffer ;
+  }
+
+  template <typename T>
+  CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum & type)
+  {
+    if (!CEnum<T>(type).toBuffer(buffer)) ERROR("template <typename T> CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum & type)",
+                                           <<"Buffer remain size is to low for size type") ;      
+    return buffer ;
+  }
+  
+  template <typename T>
+  CBufferIn& operator>>(CBufferIn& buffer, CEnum<T>& type)
+  {
+    if (! type.fromBuffer(buffer)) ERROR("template <typename T> CBufferIn& operator>>(CBufferIn& buffer, CEnum<T>& type)",
+                                           <<"Buffer remain size is to low for size type") ;
+    return buffer ;
+  }
+  
+ 
+  template <typename T>
+  CMessage& operator<<(CMessage& msg, const CEnum<T>& type)
+  {
+    msg.push(*type.clone()) ;
+    return msg ;
+  }
+
+  template <typename T>
+  CMessage& operator<<(CMessage& msg, const typename T::t_enum & type)
+  {
+    msg.push(*CEnum<T>(type).clone()) ;
+    return msg ;
+  }
+  
+}
+
+#endif
+
Index: XIOS/trunk/src/type/enum_ref_impl.hpp
===================================================================
--- XIOS/trunk/src/type/enum_ref_impl.hpp	(revision 369)
+++ XIOS/trunk/src/type/enum_ref_impl.hpp	(revision 369)
@@ -0,0 +1,317 @@
+#ifndef __XIOS_ENUM_REF_IMPL__
+#define __XIOS_ENUM_REF_IMPL__
+
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+#include "message.hpp"
+#include <string>
+#include <boost/algorithm/string.hpp>
+
+namespace xios
+{
+ 
+    
+  using namespace std;
+  
+  template <typename T>
+  CEnum_ref<T>::CEnum_ref(void)
+  {
+    empty=true ;
+  }
+    
+  template <typename T>
+  CEnum_ref<T>::CEnum_ref(T_enum& val)
+  {
+    empty=true ;
+    set_ref(val) ;
+  }
+  
+  template <typename T>
+  CEnum_ref<T>::CEnum_ref(CEnum<T>& type)
+  {
+    empty=true ;
+    set_ref(type) ;
+  }
+
+  template <typename T>
+  CEnum_ref<T>::CEnum_ref(const CEnum_ref<T>& type)
+  {
+    empty=true ;
+    set_ref(type) ;
+  }  
+
+  
+  template <typename T>
+  void CEnum_ref<T>::set_ref(T_enum& val)
+  {
+    ptrValue=&val ;
+    empty=false ;
+  }
+
+  template <typename T>
+  void CEnum_ref<T>::set_ref(CEnum<T>& type)
+  {
+    ptrValue=&type.get() ;
+    empty=false ;
+  }
+
+  template <typename T>
+  void CEnum_ref<T>::set_ref(const CEnum_ref<T>& type)
+  {
+    ptrValue=type.ptrValue ;
+    empty=type.empty ;
+  }
+
+  template <typename T>
+  void CEnum_ref<T>::set(const T_enum& val) const
+  {
+    checkEmpty() ;
+    *ptrValue=val ;
+  }
+
+  template <typename T>
+  void CEnum_ref<T>::set(const CEnum<T>& type) const
+  {
+    checkEmpty() ;
+    *ptrValue=type.get() ;
+  }
+
+  template <typename T>
+  void CEnum_ref<T>::set(const CEnum_ref<T>& type) const
+  {
+    checkEmpty() ;
+    *ptrValue=type.get() ;
+  }
+  
+  template <typename T>
+  typename T::t_enum & CEnum_ref<T>::get(void) const
+  {
+    checkEmpty() ;
+    return *ptrValue ;
+  }
+  
+  template <typename T>
+  const CEnum_ref<T>& CEnum_ref<T>::operator = (T_enum& val) const
+  {
+    set(val) ;
+    return *this ;
+  }
+
+  template <typename T>
+  const CEnum_ref<T>& CEnum_ref<T>::operator = (CEnum<T>& type) const
+  {
+    set(type) ;
+    return *this ;
+  }
+   
+  template <typename T>
+  const CEnum_ref<T>& CEnum_ref<T>::operator = (const CEnum_ref<T>& type) const
+  {
+    set(type) ;
+    return *this ;
+  }
+  
+  template <typename T>
+  CEnum_ref<T>::operator T_enum&() const
+  {
+    checkEmpty() ;
+    return *ptrValue ;
+  }
+
+  template <typename T>
+  CEnum_ref<T>* CEnum_ref<T>::_clone(void) const
+  {
+    checkEmpty() ;
+    return new CEnum_ref<T>(*this) ;
+  }
+   
+  template <typename T>
+  void CEnum_ref<T>::_fromString(const string& str) const
+  {
+    istringstream iss(str);
+    checkEmpty() ;
+    iss>>*ptrValue ;
+  }
+ 
+  template <typename T>
+  void CEnum_ref<T>::_fromString(const string& str)
+  {
+    checkEmpty() ;
+    string tmpStr=boost::to_lower_copy(boost::trim_copy(str)) ;
+    
+    bool found=false ;
+    for(int i=0;i<T::getSize();i++)
+    {
+      if (boost::to_lower_copy(string(T::getStr()[i]))==tmpStr)
+      {
+        *ptrValue=(T_enum) i ;
+        return ;
+      }
+    }
+    
+    ostringstream strList ;
+    for(int i=0;i<T::getSize();i++) 
+    {
+      if (i>0) strList<<", " ;
+      strList<<boost::to_lower_copy(string(T::getStr()[i])) ;
+    }
+    
+    ERROR("template <typename T> void CEnum_ref<T>::_fromString(const string& str)",
+    << tmpStr << " cannot be converted in a valid enumeration, possibilities are : "<<strList.str() ) ;
+  }
+  
+  template <typename T>
+  string CEnum_ref<T>::_toString(void) const
+  {
+    if (!empty) return string((T::getStr())[(int)(*ptrValue)]) ;
+  }
+
+    
+  template <typename T>
+  bool CEnum_ref<T>::_toBuffer(CBufferOut& buffer) const
+  {
+    checkEmpty() ;
+    if (sizeof(*ptrValue)==sizeof(short int)) return buffer.put((short int) *ptrValue) ;
+    else if (sizeof(*ptrValue)==sizeof(int)) return buffer.put((int) *ptrValue) ;
+    else if (sizeof(*ptrValue)==sizeof(long int)) return buffer.put((long int) *ptrValue) ;
+    else ERROR("template <typename T>  bool CEnum_ref<T>::_toBuffer(CBufferOut& buffer) const",
+               <<"incompatibility between enumeration and standard integer type") ;
+  }
+  
+  template <typename T>
+  bool CEnum_ref<T>::_fromBuffer(CBufferIn& buffer)
+  {
+    checkEmpty() ;
+    bool ret ;
+    if (sizeof(*ptrValue)==sizeof(short int)) 
+    {
+      short int val ;
+      ret=buffer.get(val) ;
+      if (ret) *ptrValue = (T_enum) val ;
+    }
+    else if (sizeof(*ptrValue)==sizeof(int)) 
+    {
+      int val ;
+      ret=buffer.get(val) ;
+      if (ret) *ptrValue = (T_enum) val ;
+    }
+    else if (sizeof(*ptrValue)==sizeof(long int)) 
+    {
+      long int val ;
+      ret=buffer.get(val) ;
+      if (ret) *ptrValue = (T_enum) val ;
+    }
+    else ERROR("template <typename T>  bool CEnum_ref<T>::_fromBuffer(CBufferIn& buffer)",
+               <<"incompatibility between enumeration and standard integer type") ;
+    return ret ;
+  }
+ 
+  template <typename T>
+  bool CEnum_ref<T>::_fromBuffer(CBufferIn& buffer) const
+  {
+    checkEmpty() ;
+    bool ret ;
+    if (sizeof(*ptrValue)==sizeof(short int)) 
+    {
+      short int val ;
+      ret=buffer.get(val) ;
+      if (ret) *ptrValue = (T_enum) val ;
+    }
+    else if (sizeof(*ptrValue)==sizeof(int)) 
+    {
+      int val ;
+      ret=buffer.get(val) ;
+      if (ret) *ptrValue = (T_enum) val ;
+    }
+    else if (sizeof(*ptrValue)==sizeof(long int)) 
+    {
+      long int val ;
+      ret=buffer.get(val) ;
+      if (ret) *ptrValue = (T_enum) val ;
+    }
+    else ERROR("template <typename T>  bool CEnum_ref<T>::_fromBuffer(CBufferIn& buffer)",
+               <<"incompatibility between enumeration and standard integer type") ;
+  }
+ 
+  template <typename T>
+  size_t CEnum_ref<T>::_size(void) const
+  {
+    return sizeof(T_enum) ;
+  }
+  
+  template <typename T>
+  bool CEnum_ref<T>::_isEmpty(void) const
+  {
+    return empty ;
+  }
+   
+  template <typename T>
+  void CEnum_ref<T>::_reset(void)
+  {
+      empty=true ;
+  }
+  
+  template <typename T>
+  void CEnum_ref<T>::checkEmpty(void) const
+  {
+    if (empty) ERROR("template <typename T> void CEnum_ref<T>::checkEmpty(void)",
+                     <<"Type_ref reference is not assigned") ;
+  }
+                     
+
+  
+  template <typename T>
+  CBufferOut& operator<<(CBufferOut& buffer, const CEnum_ref<T>& type)
+  {
+    if (!type.toBuffer(buffer)) ERROR("template <typename T> CBufferOut& operator<<(CBufferOut& buffer, const CEnum_ref<T>& type)",
+                                           <<"Buffer remain size is to low for size type") ;
+    return buffer ;
+  }
+
+  template <typename T>
+  CBufferOut& operator<<(CBufferOut& buffer, typename T::t_enum& type)
+  {
+    if (!CEnum_ref<T>(type).toBuffer(buffer)) ERROR("template <typename T> CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum& type)",
+                                             <<"Buffer remain size is to low for size type") ;      
+    return buffer ;
+  }
+
+  template <typename T>
+  CBufferIn& operator>>(CBufferIn& buffer, typename T::t_enum& type)
+  {
+    if (! CEnum_ref<T>(type).fromBuffer(buffer)) ERROR("template <typename T>  CBufferIn& operator>>(CBufferIn& buffer, typename T::t_enum& type)",
+                                                       <<"Buffer remain size is to low for size type") ;
+    return buffer ;
+  }
+
+  template <typename T>
+  CBufferIn& operator>>(CBufferIn& buffer, const CEnum_ref<T>& type)
+  {
+    if (! type.fromBuffer(buffer) ) ERROR("  template <typename T> CBufferIn& operator>>(CBufferIn& buffer, const CEnum_ref<T>& type) ",
+                                           <<"Buffer remain size is to low for size type") ;
+    return buffer ;
+  }
+
+
+
+  template <typename T>
+  CMessage& operator<<(CMessage& msg, const CEnum_ref<T>& type)
+  {
+    msg.push(*type.clone()) ;
+    return msg ;
+  }
+
+
+  template <typename T>
+  CMessage& operator<<(CMessage& msg, typename T::t_enum & type)
+  {
+    msg.push(*CEnum_ref<T>(type).clone()) ;
+    return msg ;
+  }
+  
+}
+
+#endif
+
Index: XIOS/trunk/src/type/message.cpp
===================================================================
--- XIOS/trunk/src/type/message.cpp	(revision 368)
+++ XIOS/trunk/src/type/message.cpp	(revision 369)
@@ -12,13 +12,13 @@
    CMessage& CMessage::push(const CBaseType& type)
    {
-     typeList.push_back(type.duplicate());
+     typeList.push_back(type.clone());
      return *this ;
    }
    
-    CMessage& CMessage::push(CBaseType& type)
-   {
-     typeList.push_back(&type);
-     return *this ;
-   }
+//    CMessage& CMessage::push(CBaseType& type)
+//   {
+//     typeList.push_back(&type);
+//     return *this ;
+//   }
    
    size_t CMessage::size(void) const
@@ -66,5 +66,5 @@
     {
       list<CBaseType*>::iterator it; 
-      for(it=typeList.begin();it!=typeList.end();it++) (*it)->destroy() ;
+      for(it=typeList.begin();it!=typeList.end();it++) delete *it ;
       typeList.clear() ;
     }
@@ -97,9 +97,9 @@
   }
 
-  CMessage& operator<<(CMessage& msg, const CBaseType&  type)
-  {
-    msg.push(*type.duplicate()) ;
-    return msg ;
-  } 
+//  CMessage& operator<<(CMessage& msg, const CBaseType&  type)
+//  {
+//    msg.push(*type.clone()) ;
+//    return msg ;
+//  } 
   
 }
Index: XIOS/trunk/src/type/message.hpp
===================================================================
--- XIOS/trunk/src/type/message.hpp	(revision 368)
+++ XIOS/trunk/src/type/message.hpp	(revision 369)
@@ -12,5 +12,5 @@
 {
 
-  class CMessage : public CBaseType 
+  class CMessage
   {
     public:
@@ -23,5 +23,5 @@
   
     CMessage& push(const CBaseType& type) ; 
-    CMessage& push(CBaseType& type) ;
+//    CMessage& push(CBaseType& type) ;
     void clear(void) ;  
     ~CMessage() ;    
@@ -31,5 +31,5 @@
   CBufferIn& operator>>(CBufferIn& buffer, CMessage& msg) ;
 
-  CMessage& operator<<(CMessage& msg,CBaseType& type) ;
+//  CMessage& operator<<(CMessage& msg,CBaseType& type) ;
   CMessage& operator<<(CMessage& msg,const CBaseType& type) ;
  
Index: XIOS/trunk/src/type/type.hpp
===================================================================
--- XIOS/trunk/src/type/type.hpp	(revision 368)
+++ XIOS/trunk/src/type/type.hpp	(revision 369)
@@ -12,6 +12,8 @@
 {
 
+  template <typename T> class CType_ref ;
+    
   template <typename T> 
-  class CType : public CBaseType
+  class CType : public  virtual CBaseType
   {
     public:
@@ -19,34 +21,118 @@
     CType(void) ;
     CType(const T& val) ;
-    CType(T& val) ;
     CType(const CType& type) ;
+    CType(const CType_ref<T>& type) ;
+    virtual ~CType() { _reset() ; }
 
-    ~CType() {} ;
+    T& get(void) ;
+    const T& get(void) const;
 
-    void fromString(const string& str) ;
-    string toString(void) const;
+    void set(const T& val) ;
+    void set(const CType& val) ;
+    void set(const CType_ref<T>& val) ;
+    CType& operator = (const T& val) ;
+    CType& operator = (const CType& val) ;
+    CType& operator = (const CType_ref<T>& val) ;
+    operator T&() ;
     
-    bool fromBuffer(CBufferIn& buffer) ;
-    bool toBuffer(CBufferOut& buffer) const;
-    void destroy(void) ;
+    virtual CType* clone(void) const   { return _clone(); }
+    virtual void fromString(const string& str)   { _fromString(str); }
+    virtual string toString(void) const { return _toString(); }
+    virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer) ; }
+    virtual bool toBuffer(CBufferOut& buffer) const { return _toBuffer(buffer); }
+    virtual void reset(void) { _reset(); }
+    virtual bool isEmpty() const { return _isEmpty(); } 
+    virtual size_t size(void) const { return _size(); }
     
-    size_t size(void) const;
-    CBaseType* duplicate(void) const;  
-
-    void checkAccess(void) const;
+    void allocate(void) ;
+    void checkEmpty(void) const;
+       
     T* ptrValue ;
-    
-    bool clone ;
-    T value ; 
+    bool empty ;
+      
+    friend class CType_ref<T> ; 
+ 
+    private :
+ 
+    CType* _clone(void) const;
+    void _fromString(const string& str) ;
+    string _toString(void) const;
+    bool _fromBuffer(CBufferIn& buffer) ;
+    bool _toBuffer(CBufferOut& buffer) const;
+    void _reset(void) ;
+    bool _isEmpty() const ;  
+    size_t _size(void) const ;
+ 
   } ;
 
+
+  template<typename T> class CType ;
+    
+  template <typename T> 
+  class CType_ref : public virtual CBaseType
+  {
+    public:
+  
+    CType_ref(void) ;
+    CType_ref(T& val) ;
+    CType_ref(CType<T>& type) ;
+    CType_ref(const CType_ref& type) ;
+    virtual ~CType_ref() {};
+
+    T& get(void) const;
+
+    void set(const T& val) const ;
+    void set(const CType<T>& val) const ;
+    void set(const CType_ref& val) const ;
+
+    void set_ref(T& val) ;
+    void set_ref(CType<T>& val) ;
+    void set_ref(const CType_ref& val) ;
+    
+    const CType_ref& operator = (T& val) const ;
+    const CType_ref& operator = (CType<T>& val) const ;
+    const CType_ref& operator = (const CType_ref& val) const;
+    operator T&() const;
+
+    virtual CType_ref* clone(void) const   { return _clone(); }
+    virtual void fromString(const string& str)   { _fromString(str); }
+    virtual void fromString(const string& str) const  { _fromString(str); }
+    virtual string toString(void) const { return _toString(); }
+    virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer) ; }
+    virtual bool fromBuffer(CBufferIn& buffer) const { return _fromBuffer(buffer); }
+    virtual bool toBuffer(CBufferOut& buffer) const { return _toBuffer(buffer); }
+    virtual void reset(void) { _reset(); }
+    virtual bool isEmpty() const { return _isEmpty(); } 
+    virtual size_t size(void) const { return _size(); }
+
+    void checkEmpty(void) const;
+    
+
+    T mutable * ptrValue ;
+    bool empty ;
+    friend class CType<T> ;
+    
+    private :
+    
+    CType_ref* _clone(void) const;
+    void _fromString(const string& str) ;
+    void _fromString(const string& str) const;
+    string _toString(void) const;
+    bool _fromBuffer(CBufferIn& buffer) ;
+    bool _fromBuffer(CBufferIn& buffer) const ;
+    bool _toBuffer(CBufferOut& buffer) const;
+    void _reset(void) ;
+    bool _isEmpty() const ;  
+    size_t _size(void) const ;
+  } ;
+  
+  
   class CMessage ;
   
   template <typename T>
   CBufferOut& operator<<(CBufferOut& buffer, const CType<T>& type) ;
-  
 
   template <typename T>
-  CBufferOut& operator<<(CBufferOut& buffer, T& type) ;
+  CBufferOut& operator<<(CBufferOut& buffer, const CType_ref<T>& type) ;
   
   template <typename T>
@@ -54,28 +140,35 @@
   
   template <typename T>
-  CBufferIn& operator>>(CBufferIn& buffer, const CType<T>& type) ;
-  
-  template <typename T>
-  CBufferIn& operator>>(CBufferIn& buffer, T& type) ;
-  
+  CBufferOut& operator<<(CBufferOut& buffer, T& type) ;
 
 
   template <typename T>
+  CBufferIn& operator>>(CBufferIn& buffer, CType<T>& type) ;
+
+  template <typename T>
+  CBufferIn& operator>>(CBufferIn& buffer, const CType_ref<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, const CType_ref<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 "test_type_impl.hpp"
+//#include "test_type_specialisation.hpp"
 
 #endif
+
Index: XIOS/trunk/src/type/type_decl.cpp
===================================================================
--- XIOS/trunk/src/type/type_decl.cpp	(revision 368)
+++ XIOS/trunk/src/type/type_decl.cpp	(revision 369)
@@ -1,3 +1,5 @@
+#include "type.hpp"
 #include "type_impl.hpp"
+#include "type_ref_impl.hpp"
 #include "type_specialisation.hpp"
 #include <string> ;
@@ -8,11 +10,14 @@
 #define macro(decl_type)         \
   template class CType<decl_type> ; \
+  template class CType_ref<decl_type> ; \
   template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType<decl_type>& type) ; \
+  template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType_ref<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, CType<decl_type>& type) ; \
+  template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, const CType_ref<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 CType_ref<decl_type>& type) ; \
   template CMessage& operator<< <decl_type> (CMessage& msg, const decl_type& type) ; \
   template CMessage& operator<< <decl_type> (CMessage& msg, decl_type& type) ;
@@ -23,6 +28,4 @@
   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 368)
+++ XIOS/trunk/src/type/type_impl.hpp	(revision 369)
@@ -7,5 +7,5 @@
 #include "buffer_out.hpp"
 #include "message.hpp"
-#include "type.hpp"
+
 
 
@@ -13,58 +13,150 @@
 namespace xios
 {
+ 
   using namespace std;
   
   template <typename T>
+  CType<T>::CType(void)
+  {
+    empty=true ;
+  }
+    
+  template <typename T>
   CType<T>::CType(const T& val)
   {
-    value=val ;
-    ptrValue=&value ;
-    clone=false ;
-  }
-  
-  template <typename T>
-  CType<T>::CType(T& val)
-  {
-    ptrValue=&val ;
-    clone=false ;
-  }
-
+    empty=true ;
+    set(val) ;
+  }
+  
   template <typename T>
   CType<T>::CType(const CType<T>& type)
   {
-    if (type.ptrValue==&type.value)
-    {
-       value=type.value ;
-       ptrValue=&value ;
-    }
-    else 
-    {
-      ptrValue=type.ptrValue ;
-    }
-  }
-  
-
-  
-  template <typename T>
-  void CType<T>::fromString(const string& str)
+    empty=true ;
+    set(type) ;
+  }
+
+  template <typename T>
+  CType<T>::CType(const CType_ref<T>& type)
+  {
+    empty=true ;
+    set(type) ;
+  }  
+  
+  template <typename T>
+  void CType<T>::set(const T& val)
+  {
+    if (empty) 
+    { 
+      ptrValue = new T(val) ;
+      empty=false ;
+    }
+    else *ptrValue = val ;
+  }
+
+  template <typename T>
+  void CType<T>::set(const CType<T>& type)
+  {
+    if (type.isEmpty()) reset() ;
+    else
+    {
+      if (empty)
+      { 
+        ptrValue = new T(*type.ptrValue) ;
+        empty=false ;
+      }
+      else *ptrValue = *type.ptrValue ;
+    }
+  }
+
+  template <typename T>
+  void CType<T>::set(const CType_ref<T>& type)
+  {
+    if (type.isEmpty()) reset() ;
+    else
+    {
+      if (empty)
+      { 
+        ptrValue = new T(*type.ptrValue) ;
+        empty=false ;
+      }
+      else *ptrValue = *type.ptrValue ;
+    }
+  }
+
+  template <typename T>
+  T& CType<T>::get(void)
+  {
+    checkEmpty();
+   return *ptrValue ;
+  }
+
+  template <typename T>
+  const T& CType<T>::get(void) const
+  {
+    checkEmpty();
+    return *ptrValue ;
+  }
+  
+  template <typename T>
+  CType<T>& CType<T>::operator = (const T& val)
+  {
+    set(val) ;
+    return *this ;
+  }
+  
+  template <typename T>
+  CType<T>& CType<T>::operator = (const CType<T>& type)
+  {
+    set(type) ;
+    return *this ;
+  }
+  
+  template <typename T>
+  CType<T>& CType<T>::operator = (const CType_ref<T>& type)
+  {
+    set(type) ;
+    return *this ;
+  }
+  
+   template <typename T>
+   CType<T>::operator T&()
+   {
+    checkEmpty();
+    return *ptrValue ;
+   }
+
+   template <typename T>
+   CType<T>* CType<T>::_clone(void) const
+   {
+     checkEmpty();
+     return new CType(*this) ;
+   }
+
+  
+  template <typename T>
+  void CType<T>::_fromString(const string& str)
   {
     istringstream iss(str);
-    checkAccess() ;
+    allocate() ;
     iss>>*ptrValue ;
-    
-  }
-
-  template <typename T>
-  size_t CType<T>::size(void) const
+  }
+
+  template <typename T>
+  size_t CType<T>::_size(void) const
   {
     return sizeof(T) ;
   }
   
-
-  template <typename T>
-  string CType<T>::toString(void) const
+  template <typename T>
+  bool CType<T>::_isEmpty(void) const
+  {
+    return empty ;
+  }
+  
+  template <typename T>
+  string CType<T>::_toString(void) const
   {
     ostringstream oss;
-    checkAccess() ;
+    checkEmpty();
     oss<<*ptrValue ;
     return oss.str() ;
@@ -72,39 +164,43 @@
   
   template <typename T>
-  bool CType<T>::toBuffer(CBufferOut& buffer) const
-  {
-    checkAccess() ;
+  bool CType<T>::_toBuffer(CBufferOut& buffer) const
+  {
+    checkEmpty();
     return buffer.put(*ptrValue) ;
   }
   
   template <typename T>
-  bool CType<T>::fromBuffer(CBufferIn& buffer)
-  {
-    checkAccess() ;
+  bool CType<T>::_fromBuffer(CBufferIn& buffer)
+  {
+    allocate() ;
     return buffer.get(*ptrValue) ;
   }
  
-     
-  template <typename T>
-  void CType<T>::checkAccess(void) const
-  {
-//    if (!isAssign) ERROR("void CType<T>::checkAccess",<<"CType<type> has not been assign to any buffer") ;
-  }
-
-  template <typename T>
-  CBaseType* CType<T>::duplicate(void) const
-  {
-    
-    CType<T>* ret= new CType<T>(*this) ;
-    ret->clone=true ;
-    return ret ;
-  }
-  
-  template <typename T>
-  void CType<T>::destroy(void)
-  {
-    if (clone) delete this ;
-  }
-  
+
+  template <typename T>
+  void CType<T>::allocate(void)
+  {
+    if (empty) 
+    {
+      ptrValue = new T ;
+      empty=false ;
+    }
+  }
+  
+  template <typename T>
+  void CType<T>::_reset(void)
+  {
+    if (!empty) 
+    {
+      delete ptrValue ;
+      empty=true ;
+    }
+  }
+  
+  template <typename T>
+  void CType<T>::checkEmpty(void) const
+  {
+    if (empty) ERROR("template <typename T> void CTypef<T>::checkEmpty(void) const", <<"Type is not initialized") ;
+  }  
 
   
@@ -117,11 +213,4 @@
   }
 
-  template <typename T>
-  CBufferOut& operator<<(CBufferOut& buffer, T& type)
-  {
-    if (!CType<T>(type).toBuffer(buffer)) ERROR("operator<<(CBuffer& buffer, T& type)",
-                                           <<"Buffer remain size is to low for size type") ;      
-    return buffer ;
-  }
 
   template <typename T>
@@ -134,49 +223,26 @@
   
   template <typename T>
-  CBufferIn& operator>>(CBufferIn& buffer, const CType<T>& type)
-  {
-    if (! const_cast<CType<T> & >(type).fromBuffer(buffer)) ERROR("CBuffer& operator<<(CBuffer& buffer, CType<T>& type)",
+  CBufferIn& operator>>(CBufferIn& buffer, CType<T>& type)
+  {
+    if (! type.fromBuffer(buffer)) ERROR("CBuffer& operator<<(CBuffer& buffer, CType<T>& type)",
                                            <<"Buffer remain size is to low for size type") ;
     return buffer ;
   }
   
-  template <typename T>
-  CBufferIn& operator>>(CBufferIn& buffer, T& type)
-  {
-    if (!CType<T>(type).fromBuffer(buffer)) ERROR(" CBuffer& operator>>(CBuffer& buffer, T& type)",
-                                           <<"Buffer remain size is to low for size type") ;
-    return buffer ;
-  }
-
-
-
+  
   template <typename T>
   CMessage& operator<<(CMessage& msg, const CType<T>& type)
   {
-    msg.push(*type.duplicate()) ;
+    msg.push(*type.clone()) ;
     return msg ;
   }
 
   template <typename T>
-  CMessage& operator<<(CMessage& msg,CType<T>& type)
-  {
-    msg.push(type) ;
+  CMessage& operator<<(CMessage& msg, const T& type)
+  {
+    msg.push(*CType<T>(type).clone()) ;
     return msg ;
   }
 
-  template <typename T>
-  CMessage& operator<<(CMessage& msg, const T& type)
-  {
-    msg.push(*CType<T>(type).duplicate()) ;
-    return msg ;
-  }
-  
-  template <typename T>
-  CMessage& operator<<(CMessage& msg, T& type)
-  {
-    msg.push(*CType<T>(type).duplicate()) ;
-    return msg ;
-  }
-
 }
 
Index: XIOS/trunk/src/type/type_ref_impl.hpp
===================================================================
--- XIOS/trunk/src/type/type_ref_impl.hpp	(revision 369)
+++ XIOS/trunk/src/type/type_ref_impl.hpp	(revision 369)
@@ -0,0 +1,256 @@
+
+#ifndef __XIOS_TYPE_REF_IMPL__
+#define __XIOS_TYPE_REF_IMPL__
+
+#include "xmlioserver_spl.hpp"
+#include "exception.hpp"
+#include "buffer_in.hpp"
+#include "buffer_out.hpp"
+#include "message.hpp"
+#include "type.hpp"
+
+
+
+namespace xios
+{
+    
+  using namespace std;
+  
+  template <typename T>
+  CType_ref<T>::CType_ref(void)
+  {
+    empty=true ;
+  }
+    
+  template <typename T>
+  CType_ref<T>::CType_ref(T& val)
+  {
+    empty=true ;
+    set_ref(val) ;
+  }
+  
+  template <typename T>
+  CType_ref<T>::CType_ref(CType<T>& type)
+  {
+    empty=true ;
+    set_ref(type) ;
+  }
+
+  template <typename T>
+  CType_ref<T>::CType_ref(const CType_ref<T>& type)
+  {
+    empty=true ;
+    set_ref(type) ;
+  }  
+
+  
+  template <typename T>
+  void CType_ref<T>::set_ref(T& val)
+  {
+    ptrValue=&val ;
+    empty=false ;
+  }
+
+  template <typename T>
+  void CType_ref<T>::set_ref(CType<T>& type)
+  {
+    ptrValue=&type.get() ;
+    empty=false ;
+  }
+
+  template <typename T>
+  void CType_ref<T>::set_ref(const CType_ref<T>& type)
+  {
+    ptrValue=type.ptrValue ;
+    empty=type.empty ;
+  }
+
+  template <typename T>
+  void CType_ref<T>::set(const T& val) const
+  {
+    checkEmpty() ;
+    *ptrValue=val ;
+  }
+
+  template <typename T>
+  void CType_ref<T>::set(const CType<T>& type) const
+  {
+    checkEmpty() ;
+    *ptrValue=type.get() ;
+  }
+
+  template <typename T>
+  void CType_ref<T>::set(const CType_ref<T>& type) const
+  {
+    checkEmpty() ;
+    *ptrValue=type.get() ;
+  }
+  
+  template <typename T>
+  T& CType_ref<T>::get(void) const
+  {
+    checkEmpty() ;
+    return *ptrValue ;
+  }
+  
+  template <typename T>
+  const CType_ref<T>& CType_ref<T>::operator = (T& val) const
+  {
+    set(val) ;
+    return *this ;
+  }
+
+  template <typename T>
+  const CType_ref<T>& CType_ref<T>::operator = (CType<T>& type) const
+  {
+    set(type) ;
+    return *this ;
+  }
+   
+  template <typename T>
+  const CType_ref<T>& CType_ref<T>::operator = (const CType_ref<T>& type) const
+  {
+    set(type) ;
+    return *this ;
+  }
+  
+  template <typename T>
+  CType_ref<T>::operator T&() const
+  {
+    checkEmpty() ;
+    return *ptrValue ;
+  }
+
+  template <typename T>
+  CType_ref<T>* CType_ref<T>::_clone(void) const
+  {
+    checkEmpty() ;
+    return new CType_ref<T>(*this) ;
+  }
+   
+  template <typename T>
+  void CType_ref<T>::_fromString(const string& str) const
+  {
+    istringstream iss(str);
+    checkEmpty() ;
+    iss>>*ptrValue ;
+  }
+ 
+  template <typename T>
+  void CType_ref<T>::_fromString(const string& str)
+  {
+    istringstream iss(str);
+    checkEmpty() ;
+    iss>>*ptrValue ;
+  }
+  
+  template <typename T>
+  string CType_ref<T>::_toString(void) const
+  {
+    ostringstream oss;
+    checkEmpty() ;
+    oss<<*ptrValue ;
+    return oss.str() ;
+  }
+
+    
+  template <typename T>
+  bool CType_ref<T>::_toBuffer(CBufferOut& buffer) const
+  {
+    checkEmpty() ;
+    return buffer.put(*ptrValue) ;
+  }
+  
+  template <typename T>
+  bool CType_ref<T>::_fromBuffer(CBufferIn& buffer)
+  {
+    checkEmpty() ;
+    return buffer.get(*ptrValue) ;
+  }
+ 
+  template <typename T>
+  bool CType_ref<T>::_fromBuffer(CBufferIn& buffer) const
+  {
+    checkEmpty() ;
+    return buffer.get(*ptrValue) ;
+  }
+ 
+  template <typename T>
+  size_t CType_ref<T>::_size(void) const
+  {
+    return sizeof(T) ;
+  }
+  
+  template <typename T>
+  bool CType_ref<T>::_isEmpty(void) const
+  {
+    return empty ;
+  }
+   
+  template <typename T>
+  void CType_ref<T>::_reset(void)
+  {
+      empty=true ;
+  }
+  
+  template <typename T>
+  void CType_ref<T>::checkEmpty(void) const
+  {
+    if (empty) ERROR("template <typename T> void CType_ref<T>::checkEmpty(void)",
+                     <<"Type_ref reference is not assigned") ;
+  }
+                     
+
+  
+  template <typename T>
+  CBufferOut& operator<<(CBufferOut& buffer, const CType_ref<T>& type)
+  {
+    if (!type.toBuffer(buffer)) ERROR("CBuffer& operator<<(CBuffer& buffer, CType<T>& type)",
+                                           <<"Buffer remain size is to low for size type") ;
+    return buffer ;
+  }
+
+  template <typename T>
+  CBufferOut& operator<<(CBufferOut& buffer, T& type)
+  {
+    if (!CType_ref<T>(type).toBuffer(buffer)) ERROR("CBufferOut& operator<<(CBufferOut& buffer, T& type)",
+                                             <<"Buffer remain size is to low for size type") ;      
+    return buffer ;
+  }
+
+  template <typename T>
+  CBufferIn& operator>>(CBufferIn& buffer, T& type)
+  {
+    if (! CType_ref<T>(type).fromBuffer(buffer)) ERROR(" template <typename T> CBufferIn& operator>>(CBufferIn& buffer, T& type)",
+                                                <<"Buffer remain size is to low for size type") ;
+    return buffer ;
+  }
+
+  template <typename T>
+  CBufferIn& operator>>(CBufferIn& buffer, const CType_ref<T>& type)
+  {
+    if (! type.fromBuffer(buffer) ) ERROR("CBuffer& operator<<(CBuffer& buffer, CType<T>& type)",
+                                           <<"Buffer remain size is to low for size type") ;
+    return buffer ;
+  }
+
+
+
+  template <typename T>
+  CMessage& operator<<(CMessage& msg, const CType_ref<T>& type)
+  {
+    msg.push(*type.clone()) ;
+    return msg ;
+  }
+
+
+  template <typename T>
+  CMessage& operator<<(CMessage& msg, T& type)
+  {
+    msg.push(*CType_ref<T>(type).clone()) ;
+    return msg ;
+  }
+  
+}
+
+#endif
Index: XIOS/trunk/src/type/type_specialisation.hpp
===================================================================
--- XIOS/trunk/src/type/type_specialisation.hpp	(revision 368)
+++ XIOS/trunk/src/type/type_specialisation.hpp	(revision 369)
@@ -6,14 +6,53 @@
 #include "buffer_in.hpp"
 #include "buffer_out.hpp"
-#include "array.hpp"
-
+#include "type.hpp"
+#include <string>
+#include <boost/algorithm/string.hpp>
+ 
 namespace xios
 {
 
-
-// template specialisation for string
-
-  template <>
-  size_t CType<string>::size() const
+// template specialization for bool
+
+  template <> void CType<bool>::_fromString(const string& str)
+  {
+    string tmpStr=boost::to_lower_copy(boost::trim_copy(str)) ;
+    if (tmpStr=="true" || tmpStr==".true." || tmpStr=="yes" || tmpStr=="y") set(true) ;
+    else if (tmpStr=="false" || tmpStr==".false." || tmpStr=="no" || tmpStr=="n") set(false) ;
+    else ERROR("template <> CType<bool>::fromString(const string& str)",<< tmpStr << " cannot be converted in a boolean value") ;
+  }
+  
+  template <> string CType<bool>::_toString(void) const
+  {
+    if (get()) return string("true") ;
+    else return string("false") ;
+  }
+ 
+  template <> void CType_ref<bool>::_fromString(const string& str) const
+  {
+    string tmpStr=boost::to_lower_copy(boost::trim_copy(str)) ;
+    if (tmpStr=="true" || tmpStr==".true." || tmpStr=="yes" || tmpStr=="y") set(true) ;
+    else if (tmpStr=="false" || tmpStr==".false." || tmpStr=="no" || tmpStr=="n") set(false) ;
+    else ERROR("template <> CType<bool>::fromString(const string& str)",<< tmpStr << " cannot be converted in a boolean value") ;
+  }
+ 
+  template <> void CType_ref<bool>::_fromString(const string& str)
+  {
+    string tmpStr=boost::to_lower_copy(boost::trim_copy(str)) ;
+    if (tmpStr=="true" || tmpStr==".true." || tmpStr=="yes" || tmpStr=="y") set(true) ;
+    else if (tmpStr=="false" || tmpStr==".false." || tmpStr=="no" || tmpStr=="n") set(false) ;
+    else ERROR("template <> CType<bool>::fromString(const string& str)",<< tmpStr << " cannot be converted in a boolean value") ;
+  }
+  
+  template <> string CType_ref<bool>::_toString(void) const
+  {
+    if (get()) return string("true") ;
+    else return string("false") ;
+  }
+
+// template specialization for string
+
+  template <>
+  size_t CType<string>::_size() const
   {
     size_t typeSize=0 ;
@@ -22,7 +61,37 @@
     return typeSize ;
   }
-  
-  template <>
-  bool CType<string>::toBuffer(CBufferOut& buffer) const
+
+  template <>
+  size_t CType_ref<string>::_size() const
+  {
+    size_t typeSize=0 ;
+    typeSize+=sizeof(size_t) ;
+    typeSize+=ptrValue->size() ;
+    return typeSize ;
+  }
+  
+  template <>
+  void CType<string>::_fromString(const string& str)
+  {
+    allocate() ;
+    *ptrValue=str ;
+  }  
+
+  template <>
+  void CType_ref<string>::_fromString(const string& str)
+  {
+    checkEmpty() ;
+    *ptrValue=str ;
+  }  
+
+  template <>
+  void CType_ref<string>::_fromString(const string& str) const
+  {
+    checkEmpty() ;
+    *ptrValue=str ;
+  }  
+  
+  template <>
+  bool CType<string>::_toBuffer(CBufferOut& buffer) const
   {
     if (buffer.remain()<size()) return false ;
@@ -35,8 +104,24 @@
     }
   }
-
-  template <>
-  bool CType<string>::fromBuffer(CBufferIn& buffer)
-  {
+  
+  template <>
+  bool CType_ref<string>::_toBuffer(CBufferOut& buffer) const
+  {
+    if (buffer.remain()<size()) return false ;
+    else
+    {
+      bool ret=true ;
+      if (ret) ret&=buffer.put(ptrValue->size()) ;
+      if (ret) ret&=buffer.put(ptrValue->data(),ptrValue->size()) ;
+      return ret ;
+    }
+  }
+  
+  
+  
+  template <>
+  bool CType<string>::_fromBuffer(CBufferIn& buffer)
+  {
+    allocate() ;
     bool ret=true ;
     size_t typeSize ;
@@ -50,6 +135,34 @@
     return ret ;
   }  
-  
-  
+
+  template <>
+  bool CType_ref<string>::_fromBuffer(CBufferIn& buffer) const
+  {
+    bool ret=true ;
+    size_t typeSize ;
+    if (ret) ret&=buffer.get(typeSize) ;
+    
+    char* str;
+    str= (char*) buffer.ptr() ;
+    if (ret) buffer.advance(typeSize) ;
+    if (ret) *ptrValue=string(str,typeSize) ;
+    
+    return ret ;
+  }   
+
+  template <>
+  bool CType_ref<string>::_fromBuffer(CBufferIn& buffer)
+  {
+    bool ret=true ;
+    size_t typeSize ;
+    if (ret) ret&=buffer.get(typeSize) ;
+    
+    char* str;
+    str= (char*) buffer.ptr() ;
+    if (ret) buffer.advance(typeSize) ;
+    if (ret) *ptrValue=string(str,typeSize) ;
+    
+    return ret ;
+  }     
   // template specialisation for CArray
 /*
@@ -95,14 +208,28 @@
 boost::detail::multi_array::extent_gen<1> getExtentNull<1>(void) { return extents[0]; }
 */
-
+/*
 #define CTYPE_ARRAY(ValueType,NumsDims)                                \
+                                                                       \
+  template <>                                                          \
+  void CType<ARRAY(ValueType,NumsDims)>::allocate(void)  \
+  {                                                                    \
+    if (empty) ptrValue=new shared_ptr<CArray<ValueType, NumsDims> >(new  CArray<ValueType, NumsDims>()) ;\
+    empty=false ;                                                      \
+  }                                                                    \
+                                                                        \   
   template<>                                                           \
-  size_t CType< ARRAY(ValueType,NumsDims)>::size() const                           \
+  size_t CType< ARRAY(ValueType,NumsDims)>::_size() const               \
   {                                                                    \
      return (*(this->ptrValue))->getSize() ;                           \
   }                                                                    \
                                                                        \
-  template <>                                                          \
-  bool CType<ARRAY(ValueType,NumsDims)>::toBuffer(CBufferOut& buffer) const        \
+  template<>                                                           \
+  size_t CType_ref< ARRAY(ValueType,NumsDims)>::_size() const           \
+  {                                                                    \
+     return (*(this->ptrValue))->getSize() ;                           \
+  }                                                                    \
+                                                                       \
+  template <>                                                          \
+  bool CType<ARRAY(ValueType,NumsDims)>::_toBuffer(CBufferOut& buffer) const        \
   {                                                                    \
       return (*(this->ptrValue))->toBuffer(buffer) ;                   \
@@ -110,5 +237,25 @@
                                                                        \
   template <>                                                          \
-  bool CType<ARRAY(ValueType,NumsDims)>::fromBuffer(CBufferIn& buffer)       \
+  bool CType_ref<ARRAY(ValueType,NumsDims)>::_toBuffer(CBufferOut& buffer) const        \
+  {                                                                    \
+      return (*(this->ptrValue))->toBuffer(buffer) ;                   \
+  }                                                                    \
+                                                                       \
+  template <>                                                          \
+  bool CType<ARRAY(ValueType,NumsDims)>::_fromBuffer(CBufferIn& buffer)       \
+  {                                                                    \
+    allocate();                                                        \
+    return (*(ptrValue))->fromBuffer(buffer) ;                         \
+  }                                                                    \
+                                                                       \
+  template <>                                                          \
+  bool CType_ref<ARRAY(ValueType,NumsDims)>::_fromBuffer(CBufferIn& buffer) const  \
+  {                                                                    \
+    checkEmpty() ;                                                     \ 
+    return (*(this->ptrValue))->fromBuffer(buffer) ;                   \
+  }                                                                    \
+                                                                       \
+ template <>                                                          \
+  bool CType_ref<ARRAY(ValueType,NumsDims)>::_fromBuffer(CBufferIn& buffer)   \
   {                                                                    \
     shared_ptr<CArray<ValueType, NumsDims> > tmp(new CArray<ValueType, NumsDims>() ) ; \
@@ -117,17 +264,35 @@
   }                                                                    \
                                                                        \
-  template <>                                                          \
-  void CType<ARRAY(ValueType,NumsDims)>::fromString(const string& str)       \
-  {                                                                    \
- /* to implement */                                                    \
-  }                                                                    \
-                                                                       \
-  template <>                                                          \
-  string CType<ARRAY(ValueType,NumsDims)>::toString(void) const                    \
-  {                                                                    \
- /* to implement */                                                    \
+                                                                       \
+  template <>                                                          \
+  void CType<ARRAY(ValueType,NumsDims)>::_fromString(const string& str)       \
+  {                                                                    \
+                                      \
+  }                                                                    \
+                                                                       \
+  template <>                                                          \
+  void CType_ref<ARRAY(ValueType,NumsDims)>::_fromString(const string& str) const \
+  {                                                                    \
+                                        \
+  }                                                                    \
+  template <>                                                          \
+  void CType_ref<ARRAY(ValueType,NumsDims)>::_fromString(const string& str) \
+  {                                                                    \
+                                                \
+  }                                                                    \
+                                                                          \
+  template <>                                                          \
+  string CType<ARRAY(ValueType,NumsDims)>::_toString(void) const                    \
+  {                                                                    \
+                               \
    return string("") ;                                                 \
-  }
-
+  }                                                                    \
+                                                                          \
+  template <>                                                          \
+  string CType_ref<ARRAY(ValueType,NumsDims)>::_toString(void) const                    \
+  {                                                                    \
+                                      \
+   return string("") ;                                                 \
+  }
 //CTYPE_ARRAY(double,1) 
 
@@ -147,5 +312,5 @@
 CTYPE_ARRAY(float,2) 
 CTYPE_ARRAY(float,3) 
-
+*/
 }  
 
