Index: /XIOS/trunk/inputs/COMPLETE/context_surface.xml
===================================================================
--- /XIOS/trunk/inputs/COMPLETE/context_surface.xml	(revision 526)
+++ /XIOS/trunk/inputs/COMPLETE/context_surface.xml	(revision 527)
@@ -15,5 +15,5 @@
       <field field_ref="field_A_srf" >
 	<variable id="my_attribute1" type="string" >surf_att</variable>
-	<variable id="my_attribute2" type="integer" > 10 </variable>
+	<variable id="my_attribute2" type="int" > 10 </variable>
 	<variable id="my_attribute3" type="float" >6.8</variable>
 	<variable id="my_attribute5" type="double" >100.201</variable>
@@ -30,5 +30,5 @@
       <field field_ref="field_A_srf" >
 	<variable id="my_attribute1" type="string" >surf_att</variable>
-	<variable id="my_attribute2" type="integer" >10</variable>
+	<variable id="my_attribute2" type="int" >10</variable>
 	<variable id="my_attribute3" type="float" >6.8</variable>
 	<variable id="my_attribute4" type="double" >100.201</variable>
Index: /XIOS/trunk/inputs/COMPLETE/iodef.xml
===================================================================
--- /XIOS/trunk/inputs/COMPLETE/iodef.xml	(revision 526)
+++ /XIOS/trunk/inputs/COMPLETE/iodef.xml	(revision 527)
@@ -15,5 +15,5 @@
         <variable_group id="parameters" >
           <variable id="info_level" type="int">100</variable>
-          <variable id="print_file" type="boolean">true</variable>
+          <variable id="print_file" type="bool">true</variable>
         </variable_group>
       </variable_definition>
Index: /XIOS/trunk/inputs/iodef.xml
===================================================================
--- /XIOS/trunk/inputs/iodef.xml	(revision 526)
+++ /XIOS/trunk/inputs/iodef.xml	(revision 527)
@@ -46,7 +46,7 @@
 
         <variable_group id="parameters" >
-          <variable id="using_server" type="boolean">false</variable>
+          <variable id="using_server" type="bool">false</variable>
           <variable id="info_level" type="int">50</variable>
-          <variable id="print_file" type="boolean">true</variable>
+          <variable id="print_file" type="bool">true</variable>
         </variable_group>
       </variable_definition>
Index: /XIOS/trunk/src/config/var_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/var_attribute.conf	(revision 526)
+++ /XIOS/trunk/src/config/var_attribute.conf	(revision 527)
@@ -1,2 +1,2 @@
-DECLARE_ATTRIBUTE(StdString, type)
+DECLARE_TYPE(type)
 DECLARE_ATTRIBUTE(StdString, name)
Index: /XIOS/trunk/src/declare_attribute.hpp
===================================================================
--- /XIOS/trunk/src/declare_attribute.hpp	(revision 526)
+++ /XIOS/trunk/src/declare_attribute.hpp	(revision 527)
@@ -115,4 +115,13 @@
    DECLARE_CLASS_ENUM(name) 
 
+  #define DECLARE_TYPE(name)                                      \
+   class Enum_##name                                              \
+   {                                                              \
+     public:                                                      \
+     enum t_enum { t_bool=0, t_int16, t_int, t_int32, t_int64, t_float, t_double, t_string }; \
+     const char** getStr(void) const { static const char * enumStr[] = { "bool", "int16", "int", "int32", "int64", "float", "double", "string" }; return enumStr; } \
+     int getSize(void) const { return 8; }                        \
+   };                                                             \
+   DECLARE_CLASS_ENUM(name)
 
 #define BEGIN_DECLARE_ATTRIBUTE_MAP(type)                  \
Index: /XIOS/trunk/src/interface/c_attr/icvariable_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icvariable_attr.cpp	(revision 526)
+++ /XIOS/trunk/src/interface/c_attr/icvariable_attr.cpp	(revision 527)
@@ -48,5 +48,5 @@
     if(!cstr2string(type, type_size, type_str)) return;
      CTimer::get("XIOS").resume();
-    variable_hdl->type.setValue(type_str);
+    variable_hdl->type.fromString(type_str);
      CTimer::get("XIOS").suspend();
   }
@@ -55,5 +55,5 @@
   {
      CTimer::get("XIOS").resume();
-    if(!string_copy(variable_hdl->type.getInheritedValue(),type , type_size))
+    if(!string_copy(variable_hdl->type.getInheritedStringValue(),type , type_size))
       ERROR("void cxios_get_variable_type(variable_Ptr variable_hdl, char * type, int type_size)", <<"Input string is to short");
      CTimer::get("XIOS").suspend();
Index: /XIOS/trunk/src/interface/c_attr/icvariablegroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icvariablegroup_attr.cpp	(revision 526)
+++ /XIOS/trunk/src/interface/c_attr/icvariablegroup_attr.cpp	(revision 527)
@@ -74,5 +74,5 @@
     if(!cstr2string(type, type_size, type_str)) return;
      CTimer::get("XIOS").resume();
-    variablegroup_hdl->type.setValue(type_str);
+    variablegroup_hdl->type.fromString(type_str);
      CTimer::get("XIOS").suspend();
   }
@@ -81,5 +81,5 @@
   {
      CTimer::get("XIOS").resume();
-    if(!string_copy(variablegroup_hdl->type.getInheritedValue(),type , type_size))
+    if(!string_copy(variablegroup_hdl->type.getInheritedStringValue(),type , type_size))
       ERROR("void cxios_get_variablegroup_type(variablegroup_Ptr variablegroup_hdl, char * type, int type_size)", <<"Input string is to short");
      CTimer::get("XIOS").suspend();
Index: /XIOS/trunk/src/node/variable.cpp
===================================================================
--- /XIOS/trunk/src/node/variable.cpp	(revision 526)
+++ /XIOS/trunk/src/node/variable.cpp	(revision 527)
@@ -70,25 +70,4 @@
    }
 
-   CVariable::EVarType CVariable::getVarType(void) const
-   {
-     EVarType ret ;
-
-     if (type.isEmpty()) ret=t_undefined ;
-     else
-     {
-       string varType=boost::to_lower_copy(boost::trim_copy(type.getValue())) ;
-       if (varType=="int") ret=t_int ;
-       else if (varType=="short int" || varType=="short") ret=t_short_int ;
-       else if (varType=="long int" || varType=="long") ret=t_long_int ;
-       else if (varType=="float") ret=t_float ;
-       else if (varType=="double") ret=t_double ;
-       else if (varType=="long double") ret=t_long_double ;
-       else if (varType=="bool") ret=t_bool ;
-       else if (varType=="long double") ret=t_long_double ;
-       else if (varType=="string") ret=t_string ;
-     }
-     return ret ;
-   }
-
    /*
    *\brief Sending value of a variable with its id from client to server
@@ -126,5 +105,4 @@
       get(id)->recvValue(*buffer);
    }
-
 
    /*
Index: /XIOS/trunk/src/node/variable.hpp
===================================================================
--- /XIOS/trunk/src/node/variable.hpp	(revision 526)
+++ /XIOS/trunk/src/node/variable.hpp	(revision 527)
@@ -7,4 +7,6 @@
 #include "group_template.hpp"
 #include "array_new.hpp"
+#include "attribute_enum.hpp"
+#include "attribute_enum_impl.hpp"
 
 namespace xios
@@ -55,8 +57,4 @@
 
          public :
-            enum EVarType
-            {  t_int, t_short_int, t_long_int, t_float, t_double, t_long_double, t_bool, t_string, t_undefined } ;
-
-
             /// Autres ///
             virtual void parse(xml::CXMLNode & node);
@@ -74,6 +72,4 @@
             template <typename T, StdSize N>
             inline void getData(CArray<T, N>& _data_array) const;
-
-            EVarType getVarType(void) const ;
 
             static bool dispatchEvent(CEventServer& event) ;
@@ -139,7 +135,4 @@
       // Declare/Define CVarGroup and CVarDefinition
       DECLARE_GROUP_PARSE_REDEF(CVariable);
-
-
-
 } // namespace xios
 
Index: /XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 526)
+++ /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 527)
@@ -803,10 +803,17 @@
         try
         {
-          if (var->getVarType()==CVariable::t_int) addAttribute(name,var->getData<int>(),&fieldId) ;
-          else if (var->getVarType()==CVariable::t_short_int) addAttribute(name,var->getData<short int>(),&fieldId) ;
-          else if (var->getVarType()==CVariable::t_long_int) addAttribute(name,var->getData<long int>(),&fieldId) ;
-          else if (var->getVarType()==CVariable::t_float) addAttribute(name,var->getData<float>(),&fieldId) ;
-          else if (var->getVarType()==CVariable::t_double) addAttribute(name,var->getData<double>(),&fieldId) ;
-          else addAttribute(name,var->getData<string>(),&fieldId) ;
+          if (var->type.getValue() == CVariable::type_attr::t_int || var->type.getValue() == CVariable::type_attr::t_int32)
+            addAttribute(name, var->getData<int>(), &fieldId);
+          else if (var->type.getValue() == CVariable::type_attr::t_int16)
+            addAttribute(name, var->getData<short int>(), &fieldId);
+          else if (var->type.getValue() == CVariable::type_attr::t_float)
+            addAttribute(name, var->getData<float>(), &fieldId);
+          else if (var->type.getValue() == CVariable::type_attr::t_double)
+            addAttribute(name, var->getData<double>(), &fieldId);
+          else if (var->type.getValue() == CVariable::type_attr::t_string)
+            addAttribute(name, var->getData<string>(), &fieldId);
+          else
+            ERROR("CNc4DataOutput::writeAttribute_ (CVariable* var, const string& fieldId)",
+                  << "Unsupported variable of type " << var->type.getStringValue());
         }
        catch (CNetCdfException& e)
@@ -830,10 +837,17 @@
         try
         {
-          if (var->getVarType()==CVariable::t_int) addAttribute(name,var->getData<int>()) ;
-          else if (var->getVarType()==CVariable::t_short_int) addAttribute(name,var->getData<short int>()) ;
-          else if (var->getVarType()==CVariable::t_long_int) addAttribute(name,var->getData<long int>()) ;
-          else if (var->getVarType()==CVariable::t_float) addAttribute(name,var->getData<float>()) ;
-          else if (var->getVarType()==CVariable::t_double) addAttribute(name,var->getData<double>()) ;
-          else addAttribute(name,var->getData<string>()) ;
+          if (var->type.getValue() == CVariable::type_attr::t_int || var->type.getValue() == CVariable::type_attr::t_int32)
+            addAttribute(name, var->getData<int>());
+          else if (var->type.getValue() == CVariable::type_attr::t_int16)
+            addAttribute(name, var->getData<short int>());
+          else if (var->type.getValue() == CVariable::type_attr::t_float)
+            addAttribute(name, var->getData<float>());
+          else if (var->type.getValue() == CVariable::type_attr::t_double)
+            addAttribute(name, var->getData<double>());
+          else if (var->type.getValue() == CVariable::type_attr::t_string)
+            addAttribute(name, var->getData<string>());
+          else
+            ERROR("CNc4DataOutput::writeAttribute_ (CVariable* var)",
+                  << "Unsupported variable of type " << var->type.getStringValue());
         }
        catch (CNetCdfException& e)
