Index: /XIOS/trunk/src/config/var_attribute.conf
===================================================================
--- /XIOS/trunk/src/config/var_attribute.conf	(revision 471)
+++ /XIOS/trunk/src/config/var_attribute.conf	(revision 472)
@@ -1,1 +1,2 @@
 DECLARE_ATTRIBUTE(StdString, type)
+DECLARE_ATTRIBUTE(StdString, name)
Index: /XIOS/trunk/src/data_output.cpp
===================================================================
--- /XIOS/trunk/src/data_output.cpp	(revision 471)
+++ /XIOS/trunk/src/data_output.cpp	(revision 472)
@@ -37,5 +37,10 @@
          this->writeFile_(file);
       }
- 
+
+      void CDataOutput::writeAttribute(CVariable*  var)
+      {
+         this->writeAttribute_(var) ;
+      }
+
       void CDataOutput::syncFile(void)
       {
Index: /XIOS/trunk/src/data_output.hpp
===================================================================
--- /XIOS/trunk/src/data_output.hpp	(revision 471)
+++ /XIOS/trunk/src/data_output.hpp	(revision 472)
@@ -21,4 +21,5 @@
             /// Ecriture ///
             void writeFile     (CFile*  file);
+            void writeAttribute(CVariable*  var);
             void syncFile     (void);
             void closeFile     (void);
@@ -42,4 +43,5 @@
 
             virtual void writeFile_       (CFile*     file)   = 0;
+            virtual void writeAttribute_(CVariable*  var) = 0 ;
             virtual void closeFile_       (void)                                            = 0;
             virtual void syncFile_       (void)                                            = 0;
Index: /XIOS/trunk/src/generate_fortran_interface.cpp
===================================================================
--- /XIOS/trunk/src/generate_fortran_interface.cpp	(revision 471)
+++ /XIOS/trunk/src/generate_fortran_interface.cpp	(revision 472)
@@ -18,4 +18,6 @@
   CField field;
   CFieldGroup fieldgroup ;
+  CVariable variable;
+  CVariableGroup variablegroup ;
   CDomain domain ;
   CDomainGroup domaingroup ;
@@ -129,4 +131,30 @@
 
 
+  file.open((path+"variable_interface_attr.f90").c_str()); 
+  variable.generateFortran2003Interface(file) ;
+  file.close();
+  
+  file.open((path+"icvariable_attr.cpp").c_str()); 
+  variable.generateCInterface(file) ;
+  file.close();
+  
+  file.open((path+"ivariable_attr.F90").c_str()); 
+  variable.generateFortranInterface(file) ;
+  file.close();
+  
+  file.open((path+"variablegroup_interface_attr.f90").c_str()); 
+  variablegroup.generateFortran2003Interface(file) ;
+  file.close();
+  
+  file.open((path+"icvariablegroup_attr.cpp").c_str()); 
+  variablegroup.generateCInterface(file) ;
+  file.close();
+  
+  file.open((path+"ivariablegroup_attr.F90").c_str()); 
+  variablegroup.generateFortranInterface(file) ;
+  file.close();
+
+
+
   file.open((path+"file_interface_attr.f90").c_str()); 
   afile.generateFortran2003Interface(file) ;
Index: /XIOS/trunk/src/group_parser.hpp
===================================================================
--- /XIOS/trunk/src/group_parser.hpp	(revision 471)
+++ /XIOS/trunk/src/group_parser.hpp	(revision 472)
@@ -80,5 +80,47 @@
       }
    }
+ 
+  /// ////////////////////// DÃ©finitions ////////////////////// ///
+   template <class U, class V, class W>
+      void CGroupTemplate<U, V, W>::parseChild(xml::CXMLNode & node)
+   {
 
+
+      // PARSING POUR GESTION DES ENFANTS
+           V* group_ptr = (this->hasId()) 
+         ? V::get(this->getId())
+         : boost::polymorphic_downcast<V*>(this);
+
+          StdString name = node.getElementName();
+          attributes.clear();
+          attributes = node.getAttributes();
+
+          if (name.compare(V::GetName()) == 0)
+          {
+             if (attributes.end() == attributes.find("id"))
+                CGroupFactory::CreateGroup(group_ptr->getShared())->parse(node);
+                return ;
+             else
+                CGroupFactory::CreateGroup(group_ptr->getShared(), attributes["id"])->parse(node);
+             continue;
+          }
+
+          if (name.compare(U::GetName()) == 0)
+          {
+             if (attributes.end() == attributes.find("id"))
+                CGroupFactory::CreateChild(group_ptr->getShared())->parse(node);
+                return ;
+             else
+                CGroupFactory::CreateChild(group_ptr->getShared(), attributes["id"])->parse(node);
+             continue;
+          }
+
+          DEBUG(<< "Dans le contexte \'" << CContext::getCurrent()->getId()
+                << "\', un objet de type \'" << V::GetName()
+                << "\' ne peut contenir qu'un objet de type \'" << V::GetName()
+                << "\' ou de type \'" << U::GetName()
+                << "\' (reÃ§u : " << name << ") !");
+
+   }
 } // namespace xios
 
Index: /XIOS/trunk/src/group_template.hpp
===================================================================
--- /XIOS/trunk/src/group_template.hpp	(revision 471)
+++ /XIOS/trunk/src/group_template.hpp	(revision 472)
@@ -50,5 +50,6 @@
          virtual void parse(xml::CXMLNode & node);
          virtual void parse(xml::CXMLNode & node, bool withAttr);
-         
+         virtual void parseChild(xml::CXMLNode & node);
+        
          /// Test ///
          virtual bool hasChild(void) const;
Index: /XIOS/trunk/src/group_template_impl.hpp
===================================================================
--- /XIOS/trunk/src/group_template_impl.hpp	(revision 471)
+++ /XIOS/trunk/src/group_template_impl.hpp	(revision 472)
@@ -551,4 +551,42 @@
       }
    }
+   
+   template <class U, class V, class W>
+   void CGroupTemplate<U, V, W>::parseChild(xml::CXMLNode & node)
+   {
+
+
+      // PARSING POUR GESTION DES ENFANTS
+           V* group_ptr = (this->hasId()) 
+         ? V::get(this->getId())
+         : boost::polymorphic_downcast<V*>(this);
+
+          StdString name = node.getElementName();
+          xml::THashAttributes attributes = node.getAttributes();
+
+          if (name.compare(V::GetName()) == 0)
+          {
+             if (attributes.end() == attributes.find("id"))
+                CGroupFactory::CreateGroup(group_ptr->getShared())->parse(node);
+             else
+                CGroupFactory::CreateGroup(group_ptr->getShared(), attributes["id"])->parse(node);
+             return ;
+          }
+          else if (name.compare(U::GetName()) == 0)
+          {
+             if (attributes.end() == attributes.find("id"))
+                CGroupFactory::CreateChild(group_ptr->getShared())->parse(node);
+             else
+                CGroupFactory::CreateChild(group_ptr->getShared(), attributes["id"])->parse(node);
+             return ;
+          }
+
+          DEBUG(<< "Dans le contexte \'" << CContext::getCurrent()->getId()
+                << "\', un objet de type \'" << V::GetName()
+                << "\' ne peut contenir qu'un objet de type \'" << V::GetName()
+                << "\' ou de type \'" << U::GetName()
+                << "\' (reÃ§u : " << name << ") !");
+
+   }
 } // namespace xios
 
Index: /XIOS/trunk/src/interface/c/icxml_tree.cpp
===================================================================
--- /XIOS/trunk/src/interface/c/icxml_tree.cpp	(revision 471)
+++ /XIOS/trunk/src/interface/c/icxml_tree.cpp	(revision 472)
@@ -20,4 +20,5 @@
 #include "axis.hpp"
 #include "domain.hpp"
+#include "variable.hpp"
 
 extern "C"
@@ -43,5 +44,8 @@
    typedef xios::CAxis      * XAxisPtr;
    typedef xios::CAxisGroup * XAxisGroupPtr;
-   
+ 
+   typedef xios::CVariable      *  XVariablePtr;
+   typedef xios::CVariableGroup *  XVariableGroupPtr;
+  
    // ----------------------- Ajout d'enfant Ã  un parent -----------------------
    
@@ -155,4 +159,41 @@
    }
 
+   void cxios_xml_tree_add_variabletofile
+      (XFilePtr parent_, XVariablePtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str;
+      CTimer::get("XIOS").resume() ;
+ 
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->addVariable(child_id_str);
+         parent_->sendAddVariable(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->addVariable();
+         parent_->sendAddVariable() ;
+      }
+      CTimer::get("XIOS").suspend() ;
+   }
+   
+    void cxios_xml_tree_add_variabletofield
+      (XFieldPtr parent_, XVariablePtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str;
+      CTimer::get("XIOS").resume() ;
+ 
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->addVariable(child_id_str);
+         parent_->sendAddVariable(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->addVariable();
+         parent_->sendAddVariable() ;
+      }
+      CTimer::get("XIOS").suspend() ;
+   }  
    // ----------------------- Ajout de groupe Ã  un parent ----------------------
 
@@ -264,4 +305,40 @@
       CTimer::get("XIOS").suspend() ;
    }
+   
+   void cxios_xml_tree_add_variablegrouptofile
+      (XFilePtr parent_, XVariableGroupPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str; 
+      CTimer::get("XIOS").resume() ;
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->addVariableGroup(child_id_str);
+         parent_->sendAddVariableGroup(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->addVariableGroup();
+         parent_->sendAddVariableGroup() ;
+      }
+      CTimer::get("XIOS").suspend() ;
+   }
+   
+   void cxios_xml_tree_add_variablegrouptofield
+      (XFieldPtr parent_, XVariableGroupPtr * child_, const char * child_id, int child_id_size)
+   {
+      std::string child_id_str; 
+      CTimer::get("XIOS").resume() ;
+      if (cstr2string(child_id, child_id_size, child_id_str))
+      {
+         *child_ = parent_->addVariableGroup(child_id_str);
+         parent_->sendAddVariableGroup(child_id_str) ;
+      }
+      else
+      {
+         *child_ = parent_->addVariableGroup();
+         parent_->sendAddVariableGroup() ;
+      }
+      CTimer::get("XIOS").suspend() ;
+   }   
    
    
Index: /XIOS/trunk/src/interface/c_attr/icfield_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 471)
+++ /XIOS/trunk/src/interface/c_attr/icfield_attr.cpp	(revision 472)
@@ -88,4 +88,26 @@
   
   
+  void cxios_set_field_detect_missing_value(field_Ptr field_hdl, bool detect_missing_value)
+  {
+     CTimer::get("XIOS").resume();
+    field_hdl->detect_missing_value.setValue(detect_missing_value);
+    field_hdl->sendAttributToServer(field_hdl->detect_missing_value);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_field_detect_missing_value(field_Ptr field_hdl, bool* detect_missing_value)
+  {
+    *detect_missing_value = field_hdl->detect_missing_value.getInheritedValue();
+  }
+  
+  bool cxios_is_defined_field_detect_missing_value(field_Ptr field_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return field_hdl->detect_missing_value.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_field_domain_ref(field_Ptr field_hdl, const char * domain_ref, int domain_ref_size)
   {
Index: /XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 471)
+++ /XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp	(revision 472)
@@ -88,4 +88,26 @@
   
   
+  void cxios_set_fieldgroup_detect_missing_value(fieldgroup_Ptr fieldgroup_hdl, bool detect_missing_value)
+  {
+     CTimer::get("XIOS").resume();
+    fieldgroup_hdl->detect_missing_value.setValue(detect_missing_value);
+    fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->detect_missing_value);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_fieldgroup_detect_missing_value(fieldgroup_Ptr fieldgroup_hdl, bool* detect_missing_value)
+  {
+    *detect_missing_value = fieldgroup_hdl->detect_missing_value.getInheritedValue();
+  }
+  
+  bool cxios_is_defined_fieldgroup_detect_missing_value(fieldgroup_Ptr fieldgroup_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return fieldgroup_hdl->detect_missing_value.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_fieldgroup_domain_ref(fieldgroup_Ptr fieldgroup_hdl, const char * domain_ref, int domain_ref_size)
   {
Index: /XIOS/trunk/src/interface/c_attr/icvariable_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icvariable_attr.cpp	(revision 472)
+++ /XIOS/trunk/src/interface/c_attr/icvariable_attr.cpp	(revision 472)
@@ -0,0 +1,74 @@
+/* ************************************************************************** *
+ *               Interface auto generated - do not modify                   *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include "xmlioserver.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "icutil.hpp"
+#include "timer.hpp"
+#include "node_type.hpp"
+
+extern "C"
+{
+  typedef xios::CVariable*  variable_Ptr;
+  
+  void cxios_set_variable_name(variable_Ptr variable_hdl, const char * name, int name_size)
+  {
+    std::string name_str;
+    if(!cstr2string(name, name_size, name_str)) return;
+     CTimer::get("XIOS").resume();
+    variable_hdl->name.setValue(name_str);
+    variable_hdl->sendAttributToServer(variable_hdl->name);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_variable_name(variable_Ptr variable_hdl, char * name, int name_size)
+  {
+     CTimer::get("XIOS").resume();
+    if(!string_copy(variable_hdl->name.getInheritedValue(),name , name_size))
+      ERROR("void cxios_get_variable_name(variable_Ptr variable_hdl, char * name, int name_size)", <<"Input string is to short");
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_variable_name(variable_Ptr variable_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return variable_hdl->name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
+  void cxios_set_variable_type(variable_Ptr variable_hdl, const char * type, int type_size)
+  {
+    std::string type_str;
+    if(!cstr2string(type, type_size, type_str)) return;
+     CTimer::get("XIOS").resume();
+    variable_hdl->type.setValue(type_str);
+    variable_hdl->sendAttributToServer(variable_hdl->type);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_variable_type(variable_Ptr variable_hdl, char * type, int type_size)
+  {
+     CTimer::get("XIOS").resume();
+    if(!string_copy(variable_hdl->type.getInheritedValue(),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();
+  }
+  
+  bool cxios_is_defined_variable_type(variable_Ptr variable_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return variable_hdl->type.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
+  
+}
Index: /XIOS/trunk/src/interface/c_attr/icvariablegroup_attr.cpp
===================================================================
--- /XIOS/trunk/src/interface/c_attr/icvariablegroup_attr.cpp	(revision 472)
+++ /XIOS/trunk/src/interface/c_attr/icvariablegroup_attr.cpp	(revision 472)
@@ -0,0 +1,101 @@
+/* ************************************************************************** *
+ *               Interface auto generated - do not modify                   *
+ * ************************************************************************** */
+
+#include <boost/multi_array.hpp>
+#include <boost/shared_ptr.hpp>
+#include "xmlioserver.hpp"
+#include "attribute_template.hpp"
+#include "object_template.hpp"
+#include "group_template.hpp"
+#include "icutil.hpp"
+#include "timer.hpp"
+#include "node_type.hpp"
+
+extern "C"
+{
+  typedef xios::CVariableGroup*  variablegroup_Ptr;
+  
+  void cxios_set_variablegroup_group_ref(variablegroup_Ptr variablegroup_hdl, const char * group_ref, int group_ref_size)
+  {
+    std::string group_ref_str;
+    if(!cstr2string(group_ref, group_ref_size, group_ref_str)) return;
+     CTimer::get("XIOS").resume();
+    variablegroup_hdl->group_ref.setValue(group_ref_str);
+    variablegroup_hdl->sendAttributToServer(variablegroup_hdl->group_ref);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_variablegroup_group_ref(variablegroup_Ptr variablegroup_hdl, char * group_ref, int group_ref_size)
+  {
+     CTimer::get("XIOS").resume();
+    if(!string_copy(variablegroup_hdl->group_ref.getInheritedValue(),group_ref , group_ref_size))
+      ERROR("void cxios_get_variablegroup_group_ref(variablegroup_Ptr variablegroup_hdl, char * group_ref, int group_ref_size)", <<"Input string is to short");
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_variablegroup_group_ref(variablegroup_Ptr variablegroup_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return variablegroup_hdl->group_ref.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
+  void cxios_set_variablegroup_name(variablegroup_Ptr variablegroup_hdl, const char * name, int name_size)
+  {
+    std::string name_str;
+    if(!cstr2string(name, name_size, name_str)) return;
+     CTimer::get("XIOS").resume();
+    variablegroup_hdl->name.setValue(name_str);
+    variablegroup_hdl->sendAttributToServer(variablegroup_hdl->name);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_variablegroup_name(variablegroup_Ptr variablegroup_hdl, char * name, int name_size)
+  {
+     CTimer::get("XIOS").resume();
+    if(!string_copy(variablegroup_hdl->name.getInheritedValue(),name , name_size))
+      ERROR("void cxios_get_variablegroup_name(variablegroup_Ptr variablegroup_hdl, char * name, int name_size)", <<"Input string is to short");
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_variablegroup_name(variablegroup_Ptr variablegroup_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return variablegroup_hdl->name.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
+  void cxios_set_variablegroup_type(variablegroup_Ptr variablegroup_hdl, const char * type, int type_size)
+  {
+    std::string type_str;
+    if(!cstr2string(type, type_size, type_str)) return;
+     CTimer::get("XIOS").resume();
+    variablegroup_hdl->type.setValue(type_str);
+    variablegroup_hdl->sendAttributToServer(variablegroup_hdl->type);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_variablegroup_type(variablegroup_Ptr variablegroup_hdl, char * type, int type_size)
+  {
+     CTimer::get("XIOS").resume();
+    if(!string_copy(variablegroup_hdl->type.getInheritedValue(),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();
+  }
+  
+  bool cxios_is_defined_variablegroup_type(variablegroup_Ptr variablegroup_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return variablegroup_hdl->type.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
+  
+}
Index: /XIOS/trunk/src/interface/fortran/ivariable.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/ivariable.F90	(revision 472)
+++ /XIOS/trunk/src/interface/fortran/ivariable.F90	(revision 472)
@@ -0,0 +1,56 @@
+#include "xios_fortran_prefix.hpp"
+
+MODULE IVARIABLE
+   USE, INTRINSIC :: ISO_C_BINDING
+   USE VARIABLE_INTERFACE
+   USE VARIABLEGROUP_INTERFACE
+   
+   TYPE txios(variable)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(variable)
+   
+   TYPE txios(variablegroup)
+      INTEGER(kind = C_INTPTR_T) :: daddr
+   END TYPE txios(variablegroup)
+   
+
+         
+   CONTAINS ! Fonctions disponibles pour les utilisateurs.
+
+   SUBROUTINE xios(get_variable_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *), INTENT(IN) :: idt      
+      TYPE(txios(variable)) , INTENT(OUT):: ret
+      CALL cxios_variable_handle_create(ret%daddr, idt, len(idt))            
+   END SUBROUTINE xios(get_variable_handle)
+   
+   SUBROUTINE xios(get_variablegroup_handle)(idt,ret)
+      IMPLICIT NONE
+      CHARACTER(len = *)    , INTENT(IN) :: idt      
+      TYPE(txios(variablegroup)), INTENT(OUT):: ret
+
+      CALL cxios_variablegroup_handle_create(ret%daddr, idt, len(idt))            
+
+   END SUBROUTINE xios(get_variablegroup_handle)
+
+   LOGICAL FUNCTION xios(is_valid_variable)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+      
+      CALL cxios_variable_valid_id(val, idt, len(idt))
+      xios(is_valid_variable) = val
+
+   END FUNCTION  xios(is_valid_variable)
+
+   LOGICAL FUNCTION xios(is_valid_variablegroup)(idt)
+      IMPLICIT NONE
+      CHARACTER(len  = *)    , INTENT(IN) :: idt
+      LOGICAL  (kind = 1)                 :: val
+
+      CALL cxios_variablegroup_valid_id(val, idt, len(idt))
+      xios(is_valid_variablegroup) = val
+
+   END FUNCTION  xios(is_valid_variablegroup)
+
+END MODULE IVARIABLE
Index: /XIOS/trunk/src/interface/fortran/ixios.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/ixios.F90	(revision 471)
+++ /XIOS/trunk/src/interface/fortran/ixios.F90	(revision 472)
@@ -43,4 +43,16 @@
                              xios(is_defined_fieldgroup_attr), xios(is_defined_fieldgroup_attr_hdl)
 
+USE ivariable, ONLY : txios(variable), txios(variablegroup), xios(get_variable_handle),  &
+                   xios(get_variablegroup_handle), xios(is_valid_variable),        &
+                   xios(is_valid_variablegroup)
+
+USE ivariable_attr, ONLY : xios(set_variable_attr),xios(set_variable_attr_hdl),    &
+                        xios(get_variable_attr),xios(get_variable_attr_hdl), &
+                        xios(is_defined_variable_attr),xios(is_defined_variable_attr_hdl)
+  
+USE ivariablegroup_attr, ONLY : xios(set_variablegroup_attr), xios(set_variablegroup_attr_hdl),  &
+                             xios(get_variablegroup_attr), xios(get_variablegroup_attr_hdl), &
+                             xios(is_defined_variablegroup_attr), xios(is_defined_variablegroup_attr_hdl)
+                             
 USE ifile, ONLY : txios(file), txios(filegroup), xios(get_file_handle),    & 
                   xios(get_filegroup_handle), xios(is_valid_file), xios(is_valid_filegroup)
@@ -77,7 +89,8 @@
 
 USE ixml_tree, ONLY : xios(add_axis), xios(add_file), xios(add_grid), xios(add_field), xios(add_domain),          &
-                     xios(add_fieldtofile), xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), &
-                     xios(add_fieldgroup), xios(add_domaingroup), xios(add_fieldgrouptofile)
-                  
+                     xios(add_fieldtofile), xios(add_variabletofile), xios(add_variabletofield),                  &
+                     xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), xios(add_fieldgroup),         & 
+                     xios(add_domaingroup), xios(add_fieldgrouptofile), xios(add_variablegrouptofile),            &
+                     xios(add_variablegrouptofield)
 
 PRIVATE
@@ -86,5 +99,6 @@
 INTERFACE xios(set_attr)
   MODULE PROCEDURE xios(set_domaingroup_attr_hdl), xios(set_domain_attr_hdl), xios(set_fieldgroup_attr_hdl), &
-                   xios(set_field_attr_hdl), xios(set_file_attr_hdl), xios(set_filegroup_attr_hdl),          &
+                   xios(set_field_attr_hdl),xios(set_variable_attr_hdl), xios(set_variablegroup_attr_hdl),   &
+                   xios(set_file_attr_hdl), xios(set_filegroup_attr_hdl),                                    &
                    xios(set_grid_attr_hdl), xios(set_gridgroup_attr_hdl), xios(set_axis_attr_hdl) ,          &
                    xios(set_axisgroup_attr_hdl), xios(set_context_attr_hdl)
@@ -93,5 +107,6 @@
 INTERFACE xios(get_attr)
   MODULE PROCEDURE xios(get_domaingroup_attr_hdl), xios(get_domain_attr_hdl), xios(get_fieldgroup_attr_hdl), &
-                   xios(get_field_attr_hdl), xios(get_file_attr_hdl), xios(get_filegroup_attr_hdl),          &
+                   xios(get_field_attr_hdl), xios(get_variable_attr_hdl), xios(get_variablegroup_attr_hdl),  &
+                   xios(get_file_attr_hdl), xios(get_filegroup_attr_hdl),                                    &
                    xios(get_grid_attr_hdl), xios(get_gridgroup_attr_hdl), xios(get_axis_attr_hdl) ,          &
                    xios(get_axisgroup_attr_hdl), xios(get_context_attr_hdl)
@@ -100,5 +115,6 @@
 INTERFACE xios(is_defined_attr)
   MODULE PROCEDURE xios(is_defined_domaingroup_attr_hdl), xios(is_defined_domain_attr_hdl), xios(is_defined_fieldgroup_attr_hdl), &
-                   xios(is_defined_field_attr_hdl), xios(is_defined_file_attr_hdl), xios(is_defined_filegroup_attr_hdl),          &
+                   xios(is_defined_field_attr_hdl), xios(is_defined_variable_attr_hdl), xios(is_defined_variablegroup_attr_hdl),  &
+                   xios(is_defined_file_attr_hdl), xios(is_defined_filegroup_attr_hdl),                                           &
                    xios(is_defined_grid_attr_hdl), xios(is_defined_gridgroup_attr_hdl), xios(is_defined_axis_attr_hdl) ,          &
                    xios(is_defined_axisgroup_attr_hdl), xios(is_defined_context_attr_hdl)
@@ -109,11 +125,13 @@
                     xios(get_file_handle), xios(get_filegroup_handle), xios(get_grid_handle),               &
                     xios(get_gridgroup_handle), xios(get_axis_handle), xios(get_axisgroup_handle),          &
-                    xios(get_field_handle), xios(get_fieldgroup_handle)
+                    xios(get_field_handle), xios(get_fieldgroup_handle),xios(get_variable_handle),          &
+                    xios(get_variablegroup_handle)
 END INTERFACE xios(get_handle) 
 
 INTERFACE xios(add_child)
-  MODULE PROCEDURE xios(add_axis), xios(add_file), xios(add_grid), xios(add_field), xios(add_domain),    &
-                   xios(add_fieldtofile), xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), &
-                   xios(add_fieldgroup), xios(add_domaingroup), xios(add_fieldgrouptofile)
+  MODULE PROCEDURE xios(add_axis), xios(add_file), xios(add_grid), xios(add_field), xios(add_domain),                &
+                   xios(add_fieldtofile), xios(add_variabletofile), xios(add_variabletofield), xios(add_axisgroup),  &
+                   xios(add_filegroup), xios(add_gridgroup), xios(add_fieldgroup), xios(add_domaingroup),            &
+                   xios(add_fieldgrouptofile), xios(add_variablegrouptofile),xios(add_variablegrouptofield) 
 END INTERFACE xios(add_child)
 
Index: /XIOS/trunk/src/interface/fortran/ixml_tree.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran/ixml_tree.F90	(revision 471)
+++ /XIOS/trunk/src/interface/fortran/ixml_tree.F90	(revision 472)
@@ -8,4 +8,5 @@
    USE IGRID
    USE IDOMAIN
+   USE IVARIABLE
      
    INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
@@ -59,4 +60,22 @@
       END SUBROUTINE cxios_xml_tree_add_fieldtofile
 
+      SUBROUTINE cxios_xml_tree_add_variabletofile(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_variabletofile
+
+
+      SUBROUTINE cxios_xml_tree_add_variabletofield(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_variabletofield
+
+
       SUBROUTINE cxios_xml_tree_add_fieldgroup(parent_, child_, child_id, child_id_size) BIND(C)
          USE ISO_C_BINDING
@@ -106,4 +125,20 @@
          INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
       END SUBROUTINE cxios_xml_tree_add_fieldgrouptofile    
+
+      SUBROUTINE cxios_xml_tree_add_variablegrouptofile(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_variablegrouptofile    
+
+      SUBROUTINE cxios_xml_tree_add_variablegrouptofield(parent_, child_, child_id, child_id_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T), VALUE        :: parent_
+         INTEGER  (kind = C_INTPTR_T)               :: child_
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: child_id
+         INTEGER  (kind = C_INT)     , VALUE        :: child_id_size
+      END SUBROUTINE cxios_xml_tree_add_variablegrouptofield    
 
       SUBROUTINE cxios_xml_tree_show(filename, filename_size) BIND(C)
@@ -210,4 +245,30 @@
    END SUBROUTINE xios(add_fieldtofile)
 
+   SUBROUTINE xios(add_variabletofile)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(file))            , INTENT(IN) :: parent_hdl
+      TYPE(txios(variable))           , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_variabletofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_variabletofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_variabletofile)
+
+   SUBROUTINE xios(add_variabletofield)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(field))            , INTENT(IN) :: parent_hdl
+      TYPE(txios(variable))           , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_variabletofield(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_variabletofield(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_variabletofield)
+
 
    SUBROUTINE xios(add_axisgroup)(parent_hdl, child_hdl, child_id)
@@ -288,4 +349,30 @@
 
    END SUBROUTINE xios(add_fieldgrouptofile)
-      
+
+   SUBROUTINE xios(add_variablegrouptofile)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(file))            , INTENT(IN) :: parent_hdl
+      TYPE(txios(variablegroup))     , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL  , INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_variablegrouptofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_variablegrouptofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_variablegrouptofile)
+
+   SUBROUTINE xios(add_variablegrouptofield)(parent_hdl, child_hdl, child_id)
+      TYPE(txios(field))            , INTENT(IN) :: parent_hdl
+      TYPE(txios(variablegroup))     , INTENT(OUT):: child_hdl
+      CHARACTER(len = *), OPTIONAL  , INTENT(IN) :: child_id
+
+      IF (PRESENT(child_id)) THEN
+         CALL cxios_xml_tree_add_variablegrouptofield(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id))
+      ELSE
+         CALL cxios_xml_tree_add_variablegrouptofield(parent_hdl%daddr, child_hdl%daddr, "NONE", -1)
+      END IF
+
+   END SUBROUTINE xios(add_variablegrouptofield)  
+         
 END MODULE IXML_TREE
Index: /XIOS/trunk/src/interface/fortran/variable_interface.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran/variable_interface.f90	(revision 472)
+++ /XIOS/trunk/src/interface/fortran/variable_interface.f90	(revision 472)
@@ -0,0 +1,22 @@
+MODULE VARIABLE_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+     
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+     
+      SUBROUTINE cxios_variable_handle_create(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_variable_handle_create
+
+      SUBROUTINE cxios_variable_valid_id(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         LOGICAL  (kind = C_BOOL)                   :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_variable_valid_id
+
+   END INTERFACE
+     
+END MODULE VARIABLE_INTERFACE
Index: /XIOS/trunk/src/interface/fortran/variablegroup_interface.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran/variablegroup_interface.f90	(revision 472)
+++ /XIOS/trunk/src/interface/fortran/variablegroup_interface.f90	(revision 472)
@@ -0,0 +1,23 @@
+MODULE VARIABLEGROUP_INTERFACE
+   USE, INTRINSIC :: ISO_C_BINDING
+     
+   INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99
+     
+  
+      SUBROUTINE cxios_variablegroup_handle_create(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         INTEGER  (kind = C_INTPTR_T)               :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_variablegroup_handle_create
+
+      SUBROUTINE cxios_variablegroup_valid_id(ret, idt, idt_size) BIND(C)
+         USE ISO_C_BINDING
+         LOGICAL  (kind = C_BOOL)                   :: ret
+         CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: idt
+         INTEGER  (kind = C_INT)     , VALUE        :: idt_size
+      END SUBROUTINE cxios_variablegroup_valid_id
+
+   END INTERFACE
+     
+END MODULE VARIABLEGROUP_INTERFACE
Index: /XIOS/trunk/src/interface/fortran_attr/field_interface_attr.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/field_interface_attr.f90	(revision 471)
+++ /XIOS/trunk/src/interface/fortran_attr/field_interface_attr.f90	(revision 472)
@@ -68,4 +68,23 @@
     
     
+    SUBROUTINE cxios_set_field_detect_missing_value(field_hdl, detect_missing_value) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: detect_missing_value
+    END SUBROUTINE cxios_set_field_detect_missing_value
+    
+    SUBROUTINE cxios_get_field_detect_missing_value(field_hdl, detect_missing_value) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+      LOGICAL (KIND=C_BOOL)             :: detect_missing_value
+    END SUBROUTINE cxios_get_field_detect_missing_value
+    
+    FUNCTION cxios_is_defined_field_detect_missing_value(field_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_detect_missing_value
+      INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl
+    END FUNCTION cxios_is_defined_field_detect_missing_value
+    
+    
     SUBROUTINE cxios_set_field_domain_ref(field_hdl, domain_ref, domain_ref_size) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.f90	(revision 471)
+++ /XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.f90	(revision 472)
@@ -68,4 +68,23 @@
     
     
+    SUBROUTINE cxios_set_fieldgroup_detect_missing_value(fieldgroup_hdl, detect_missing_value) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      LOGICAL (KIND=C_BOOL)      , VALUE :: detect_missing_value
+    END SUBROUTINE cxios_set_fieldgroup_detect_missing_value
+    
+    SUBROUTINE cxios_get_fieldgroup_detect_missing_value(fieldgroup_hdl, detect_missing_value) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+      LOGICAL (KIND=C_BOOL)             :: detect_missing_value
+    END SUBROUTINE cxios_get_fieldgroup_detect_missing_value
+    
+    FUNCTION cxios_is_defined_fieldgroup_detect_missing_value(fieldgroup_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_detect_missing_value
+      INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl
+    END FUNCTION cxios_is_defined_fieldgroup_detect_missing_value
+    
+    
     SUBROUTINE cxios_set_fieldgroup_domain_ref(fieldgroup_hdl, domain_ref, domain_ref_size) BIND(C)
       USE ISO_C_BINDING
Index: /XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90	(revision 471)
+++ /XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90	(revision 472)
@@ -12,7 +12,7 @@
   
   SUBROUTINE xios(set_field_attr)  &
-    ( field_id, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-    , valid_max, valid_min )
+    ( field_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled, field_ref  &
+    , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
+    , unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -22,4 +22,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
+      LOGICAL  , OPTIONAL, INTENT(IN) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
@@ -42,14 +44,14 @@
       CALL xios(get_field_handle)(field_id,field_hdl)
       CALL xios(set_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-      , valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor  &
+      , standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(set_field_attr)
   
   SUBROUTINE xios(set_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-    , valid_max, valid_min )
+    ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+    , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor  &
+    , standard_name, unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -58,4 +60,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
+      LOGICAL  , OPTIONAL, INTENT(IN) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
@@ -77,14 +81,14 @@
       
       CALL xios(set_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-      , valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor  &
+      , standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(set_field_attr_hdl)
   
   SUBROUTINE xios(set_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, default_value_, domain_ref_, enabled_, field_ref_, freq_offset_  &
-    , freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_, scale_factor_, standard_name_  &
-    , unit_, valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_, enabled_  &
+    , field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_  &
+    , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )
     
     IMPLICIT NONE
@@ -93,4 +97,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: detect_missing_value_
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref_
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_
@@ -123,4 +129,9 @@
       ENDIF
       
+      IF (PRESENT(detect_missing_value_)) THEN
+        detect_missing_value__tmp=detect_missing_value_
+        CALL cxios_set_field_detect_missing_value(field_hdl%daddr, detect_missing_value__tmp)
+      ENDIF
+      
       IF (PRESENT(domain_ref_)) THEN
         CALL cxios_set_field_domain_ref(field_hdl%daddr, domain_ref_, len(domain_ref_))
@@ -193,7 +204,7 @@
   
   SUBROUTINE xios(get_field_attr)  &
-    ( field_id, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-    , valid_max, valid_min )
+    ( field_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled, field_ref  &
+    , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
+    , unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -203,4 +214,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
@@ -223,14 +236,14 @@
       CALL xios(get_field_handle)(field_id,field_hdl)
       CALL xios(get_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-      , valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor  &
+      , standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(get_field_attr)
   
   SUBROUTINE xios(get_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-    , valid_max, valid_min )
+    ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+    , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor  &
+    , standard_name, unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -239,4 +252,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
@@ -258,14 +273,14 @@
       
       CALL xios(get_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-      , valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor  &
+      , standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(get_field_attr_hdl)
   
   SUBROUTINE xios(get_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, default_value_, domain_ref_, enabled_, field_ref_, freq_offset_  &
-    , freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_, scale_factor_, standard_name_  &
-    , unit_, valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_, enabled_  &
+    , field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_  &
+    , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )
     
     IMPLICIT NONE
@@ -274,4 +289,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: detect_missing_value_
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref_
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_
@@ -304,4 +321,9 @@
       ENDIF
       
+      IF (PRESENT(detect_missing_value_)) THEN
+        CALL cxios_get_field_detect_missing_value(field_hdl%daddr, detect_missing_value__tmp)
+        detect_missing_value_=detect_missing_value__tmp
+      ENDIF
+      
       IF (PRESENT(domain_ref_)) THEN
         CALL cxios_get_field_domain_ref(field_hdl%daddr, domain_ref_, len(domain_ref_))
@@ -374,7 +396,7 @@
   
   SUBROUTINE xios(is_defined_field_attr)  &
-    ( field_id, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-    , valid_max, valid_min )
+    ( field_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled, field_ref  &
+    , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
+    , unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -387,4 +409,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: default_value
       LOGICAL(KIND=C_BOOL) :: default_value_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL(KIND=C_BOOL) :: domain_ref_tmp
@@ -422,14 +446,14 @@
       CALL xios(get_field_handle)(field_id,field_hdl)
       CALL xios(is_defined_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-      , valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor  &
+      , standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(is_defined_field_attr)
   
   SUBROUTINE xios(is_defined_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-    , valid_max, valid_min )
+    ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+    , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor  &
+    , standard_name, unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -441,4 +465,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: default_value
       LOGICAL(KIND=C_BOOL) :: default_value_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL(KIND=C_BOOL) :: domain_ref_tmp
@@ -475,14 +501,14 @@
       
       CALL xios(is_defined_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit  &
-      , valid_max, valid_min )
+      ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor  &
+      , standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(is_defined_field_attr_hdl)
   
   SUBROUTINE xios(is_defined_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, default_value_, domain_ref_, enabled_, field_ref_, freq_offset_  &
-    , freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_, scale_factor_, standard_name_  &
-    , unit_, valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_, enabled_  &
+    , field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_  &
+    , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )
     
     IMPLICIT NONE
@@ -494,4 +520,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: default_value_
       LOGICAL(KIND=C_BOOL) :: default_value__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value_
+      LOGICAL(KIND=C_BOOL) :: detect_missing_value__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref_
       LOGICAL(KIND=C_BOOL) :: domain_ref__tmp
@@ -542,4 +570,9 @@
       ENDIF
       
+      IF (PRESENT(detect_missing_value_)) THEN
+        detect_missing_value__tmp=cxios_is_defined_field_detect_missing_value(field_hdl%daddr)
+        detect_missing_value_=detect_missing_value__tmp
+      ENDIF
+      
       IF (PRESENT(domain_ref_)) THEN
         domain_ref__tmp=cxios_is_defined_field_domain_ref(field_hdl%daddr)
Index: /XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 471)
+++ /XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90	(revision 472)
@@ -12,7 +12,7 @@
   
   SUBROUTINE xios(set_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-    , unit, valid_max, valid_min )
+    ( fieldgroup_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+    , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+    , scale_factor, standard_name, unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -22,4 +22,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
+      LOGICAL  , OPTIONAL, INTENT(IN) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
@@ -43,14 +45,14 @@
       CALL xios(get_fieldgroup_handle)(fieldgroup_id,fieldgroup_hdl)
       CALL xios(set_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-      , unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+      , scale_factor, standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(set_fieldgroup_attr)
   
   SUBROUTINE xios(set_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-    , unit, valid_max, valid_min )
+    ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+    , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+    , scale_factor, standard_name, unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -59,4 +61,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
+      LOGICAL  , OPTIONAL, INTENT(IN) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
@@ -79,14 +83,14 @@
       
       CALL xios(set_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-      , unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+      , scale_factor, standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(set_fieldgroup_attr_hdl)
   
   SUBROUTINE xios(set_fieldgroup_attr_hdl_)   &
-    ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, domain_ref_, enabled_, field_ref_  &
-    , freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_, operation_, prec_  &
-    , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )
+    ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_  &
+    , enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_  &
+    , operation_, prec_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )
     
     IMPLICIT NONE
@@ -95,4 +99,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: detect_missing_value_
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref_
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_
@@ -126,4 +132,9 @@
       ENDIF
       
+      IF (PRESENT(detect_missing_value_)) THEN
+        detect_missing_value__tmp=detect_missing_value_
+        CALL cxios_set_fieldgroup_detect_missing_value(fieldgroup_hdl%daddr, detect_missing_value__tmp)
+      ENDIF
+      
       IF (PRESENT(domain_ref_)) THEN
         CALL cxios_set_fieldgroup_domain_ref(fieldgroup_hdl%daddr, domain_ref_, len(domain_ref_))
@@ -200,7 +211,7 @@
   
   SUBROUTINE xios(get_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-    , unit, valid_max, valid_min )
+    ( fieldgroup_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+    , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+    , scale_factor, standard_name, unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -210,4 +221,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
@@ -231,14 +244,14 @@
       CALL xios(get_fieldgroup_handle)(fieldgroup_id,fieldgroup_hdl)
       CALL xios(get_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-      , unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+      , scale_factor, standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(get_fieldgroup_attr)
   
   SUBROUTINE xios(get_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-    , unit, valid_max, valid_min )
+    ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+    , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+    , scale_factor, standard_name, unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -247,4 +260,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
@@ -267,14 +282,14 @@
       
       CALL xios(get_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-      , unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+      , scale_factor, standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(get_fieldgroup_attr_hdl)
   
   SUBROUTINE xios(get_fieldgroup_attr_hdl_)   &
-    ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, domain_ref_, enabled_, field_ref_  &
-    , freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_, operation_, prec_  &
-    , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )
+    ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_  &
+    , enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_  &
+    , operation_, prec_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )
     
     IMPLICIT NONE
@@ -283,4 +298,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: detect_missing_value_
+      LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref_
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_
@@ -314,4 +331,9 @@
       ENDIF
       
+      IF (PRESENT(detect_missing_value_)) THEN
+        CALL cxios_get_fieldgroup_detect_missing_value(fieldgroup_hdl%daddr, detect_missing_value__tmp)
+        detect_missing_value_=detect_missing_value__tmp
+      ENDIF
+      
       IF (PRESENT(domain_ref_)) THEN
         CALL cxios_get_fieldgroup_domain_ref(fieldgroup_hdl%daddr, domain_ref_, len(domain_ref_))
@@ -388,7 +410,7 @@
   
   SUBROUTINE xios(is_defined_fieldgroup_attr)  &
-    ( fieldgroup_id, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-    , unit, valid_max, valid_min )
+    ( fieldgroup_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+    , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+    , scale_factor, standard_name, unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -401,4 +423,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: default_value
       LOGICAL(KIND=C_BOOL) :: default_value_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL(KIND=C_BOOL) :: domain_ref_tmp
@@ -438,14 +462,14 @@
       CALL xios(get_fieldgroup_handle)(fieldgroup_id,fieldgroup_hdl)
       CALL xios(is_defined_fieldgroup_attr_hdl_)   &
-      ( fieldgroup_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-      , unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+      , scale_factor, standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(is_defined_fieldgroup_attr)
   
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)  &
-    ( fieldgroup_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-    , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-    , unit, valid_max, valid_min )
+    ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+    , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+    , scale_factor, standard_name, unit, valid_max, valid_min )
     
     IMPLICIT NONE
@@ -457,4 +481,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: default_value
       LOGICAL(KIND=C_BOOL) :: default_value_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value
+      LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref
       LOGICAL(KIND=C_BOOL) :: domain_ref_tmp
@@ -493,14 +519,14 @@
       
       CALL xios(is_defined_fieldgroup_attr_hdl_)  &
-      ( fieldgroup_hdl, add_offset, axis_ref, default_value, domain_ref, enabled, field_ref, freq_offset  &
-      , freq_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name  &
-      , unit, valid_max, valid_min )
+      ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled  &
+      , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec  &
+      , scale_factor, standard_name, unit, valid_max, valid_min )
     
   END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl)
   
   SUBROUTINE xios(is_defined_fieldgroup_attr_hdl_)   &
-    ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, domain_ref_, enabled_, field_ref_  &
-    , freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_, operation_, prec_  &
-    , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )
+    ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_  &
+    , enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_  &
+    , operation_, prec_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )
     
     IMPLICIT NONE
@@ -512,4 +538,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: default_value_
       LOGICAL(KIND=C_BOOL) :: default_value__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value_
+      LOGICAL(KIND=C_BOOL) :: detect_missing_value__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref_
       LOGICAL(KIND=C_BOOL) :: domain_ref__tmp
@@ -562,4 +590,9 @@
       ENDIF
       
+      IF (PRESENT(detect_missing_value_)) THEN
+        detect_missing_value__tmp=cxios_is_defined_fieldgroup_detect_missing_value(fieldgroup_hdl%daddr)
+        detect_missing_value_=detect_missing_value__tmp
+      ENDIF
+      
       IF (PRESENT(domain_ref_)) THEN
         domain_ref__tmp=cxios_is_defined_fieldgroup_domain_ref(fieldgroup_hdl%daddr)
Index: /XIOS/trunk/src/interface/fortran_attr/ivariable_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ivariable_attr.F90	(revision 472)
+++ /XIOS/trunk/src/interface/fortran_attr/ivariable_attr.F90	(revision 472)
@@ -0,0 +1,165 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "xios_fortran_prefix.hpp"
+
+MODULE ivariable_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+  USE ivariable
+  USE variable_interface_attr
+  
+CONTAINS
+  
+  SUBROUTINE xios(set_variable_attr)  &
+    ( variable_id, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variable))  :: variable_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::variable_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type
+      
+      CALL xios(get_variable_handle)(variable_id,variable_hdl)
+      CALL xios(set_variable_attr_hdl_)   &
+      ( variable_hdl, name, type )
+    
+  END SUBROUTINE xios(set_variable_attr)
+  
+  SUBROUTINE xios(set_variable_attr_hdl)  &
+    ( variable_hdl, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type
+      
+      CALL xios(set_variable_attr_hdl_)  &
+      ( variable_hdl, name, type )
+    
+  END SUBROUTINE xios(set_variable_attr_hdl)
+  
+  SUBROUTINE xios(set_variable_attr_hdl_)   &
+    ( variable_hdl, name_, type_ )
+    
+    IMPLICIT NONE
+      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_
+      
+      IF (PRESENT(name_)) THEN
+        CALL cxios_set_variable_name(variable_hdl%daddr, name_, len(name_))
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        CALL cxios_set_variable_type(variable_hdl%daddr, type_, len(type_))
+      ENDIF
+      
+      
+    
+  END SUBROUTINE xios(set_variable_attr_hdl_)
+  
+  SUBROUTINE xios(get_variable_attr)  &
+    ( variable_id, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variable))  :: variable_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::variable_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type
+      
+      CALL xios(get_variable_handle)(variable_id,variable_hdl)
+      CALL xios(get_variable_attr_hdl_)   &
+      ( variable_hdl, name, type )
+    
+  END SUBROUTINE xios(get_variable_attr)
+  
+  SUBROUTINE xios(get_variable_attr_hdl)  &
+    ( variable_hdl, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type
+      
+      CALL xios(get_variable_attr_hdl_)  &
+      ( variable_hdl, name, type )
+    
+  END SUBROUTINE xios(get_variable_attr_hdl)
+  
+  SUBROUTINE xios(get_variable_attr_hdl_)   &
+    ( variable_hdl, name_, type_ )
+    
+    IMPLICIT NONE
+      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_
+      
+      IF (PRESENT(name_)) THEN
+        CALL cxios_get_variable_name(variable_hdl%daddr, name_, len(name_))
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        CALL cxios_get_variable_type(variable_hdl%daddr, type_, len(type_))
+      ENDIF
+      
+      
+    
+  END SUBROUTINE xios(get_variable_attr_hdl_)
+  
+  SUBROUTINE xios(is_defined_variable_attr)  &
+    ( variable_id, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variable))  :: variable_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::variable_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: name
+      LOGICAL(KIND=C_BOOL) :: name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type
+      LOGICAL(KIND=C_BOOL) :: type_tmp
+      
+      CALL xios(get_variable_handle)(variable_id,variable_hdl)
+      CALL xios(is_defined_variable_attr_hdl_)   &
+      ( variable_hdl, name, type )
+    
+  END SUBROUTINE xios(is_defined_variable_attr)
+  
+  SUBROUTINE xios(is_defined_variable_attr_hdl)  &
+    ( variable_hdl, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: name
+      LOGICAL(KIND=C_BOOL) :: name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type
+      LOGICAL(KIND=C_BOOL) :: type_tmp
+      
+      CALL xios(is_defined_variable_attr_hdl_)  &
+      ( variable_hdl, name, type )
+    
+  END SUBROUTINE xios(is_defined_variable_attr_hdl)
+  
+  SUBROUTINE xios(is_defined_variable_attr_hdl_)   &
+    ( variable_hdl, name_, type_ )
+    
+    IMPLICIT NONE
+      TYPE(txios(variable)) , INTENT(IN) :: variable_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: name_
+      LOGICAL(KIND=C_BOOL) :: name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type_
+      LOGICAL(KIND=C_BOOL) :: type__tmp
+      
+      IF (PRESENT(name_)) THEN
+        name__tmp=cxios_is_defined_variable_name(variable_hdl%daddr)
+        name_=name__tmp
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        type__tmp=cxios_is_defined_variable_type(variable_hdl%daddr)
+        type_=type__tmp
+      ENDIF
+      
+      
+    
+  END SUBROUTINE xios(is_defined_variable_attr_hdl_)
+  
+END MODULE ivariable_attr
Index: /XIOS/trunk/src/interface/fortran_attr/ivariablegroup_attr.F90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/ivariablegroup_attr.F90	(revision 472)
+++ /XIOS/trunk/src/interface/fortran_attr/ivariablegroup_attr.F90	(revision 472)
@@ -0,0 +1,190 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+#include "xios_fortran_prefix.hpp"
+
+MODULE ivariablegroup_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+  USE ivariable
+  USE variablegroup_interface_attr
+  
+CONTAINS
+  
+  SUBROUTINE xios(set_variablegroup_attr)  &
+    ( variablegroup_id, group_ref, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variablegroup))  :: variablegroup_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::variablegroup_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type
+      
+      CALL xios(get_variablegroup_handle)(variablegroup_id,variablegroup_hdl)
+      CALL xios(set_variablegroup_attr_hdl_)   &
+      ( variablegroup_hdl, group_ref, name, type )
+    
+  END SUBROUTINE xios(set_variablegroup_attr)
+  
+  SUBROUTINE xios(set_variablegroup_attr_hdl)  &
+    ( variablegroup_hdl, group_ref, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variablegroup)) , INTENT(IN) :: variablegroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type
+      
+      CALL xios(set_variablegroup_attr_hdl_)  &
+      ( variablegroup_hdl, group_ref, name, type )
+    
+  END SUBROUTINE xios(set_variablegroup_attr_hdl)
+  
+  SUBROUTINE xios(set_variablegroup_attr_hdl_)   &
+    ( variablegroup_hdl, group_ref_, name_, type_ )
+    
+    IMPLICIT NONE
+      TYPE(txios(variablegroup)) , INTENT(IN) :: variablegroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_
+      
+      IF (PRESENT(group_ref_)) THEN
+        CALL cxios_set_variablegroup_group_ref(variablegroup_hdl%daddr, group_ref_, len(group_ref_))
+      ENDIF
+      
+      IF (PRESENT(name_)) THEN
+        CALL cxios_set_variablegroup_name(variablegroup_hdl%daddr, name_, len(name_))
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        CALL cxios_set_variablegroup_type(variablegroup_hdl%daddr, type_, len(type_))
+      ENDIF
+      
+      
+    
+  END SUBROUTINE xios(set_variablegroup_attr_hdl_)
+  
+  SUBROUTINE xios(get_variablegroup_attr)  &
+    ( variablegroup_id, group_ref, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variablegroup))  :: variablegroup_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::variablegroup_id
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type
+      
+      CALL xios(get_variablegroup_handle)(variablegroup_id,variablegroup_hdl)
+      CALL xios(get_variablegroup_attr_hdl_)   &
+      ( variablegroup_hdl, group_ref, name, type )
+    
+  END SUBROUTINE xios(get_variablegroup_attr)
+  
+  SUBROUTINE xios(get_variablegroup_attr_hdl)  &
+    ( variablegroup_hdl, group_ref, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variablegroup)) , INTENT(IN) :: variablegroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type
+      
+      CALL xios(get_variablegroup_attr_hdl_)  &
+      ( variablegroup_hdl, group_ref, name, type )
+    
+  END SUBROUTINE xios(get_variablegroup_attr_hdl)
+  
+  SUBROUTINE xios(get_variablegroup_attr_hdl_)   &
+    ( variablegroup_hdl, group_ref_, name_, type_ )
+    
+    IMPLICIT NONE
+      TYPE(txios(variablegroup)) , INTENT(IN) :: variablegroup_hdl
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_
+      
+      IF (PRESENT(group_ref_)) THEN
+        CALL cxios_get_variablegroup_group_ref(variablegroup_hdl%daddr, group_ref_, len(group_ref_))
+      ENDIF
+      
+      IF (PRESENT(name_)) THEN
+        CALL cxios_get_variablegroup_name(variablegroup_hdl%daddr, name_, len(name_))
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        CALL cxios_get_variablegroup_type(variablegroup_hdl%daddr, type_, len(type_))
+      ENDIF
+      
+      
+    
+  END SUBROUTINE xios(get_variablegroup_attr_hdl_)
+  
+  SUBROUTINE xios(is_defined_variablegroup_attr)  &
+    ( variablegroup_id, group_ref, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variablegroup))  :: variablegroup_hdl
+      CHARACTER(LEN=*), INTENT(IN) ::variablegroup_id
+      LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
+      LOGICAL(KIND=C_BOOL) :: group_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: name
+      LOGICAL(KIND=C_BOOL) :: name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type
+      LOGICAL(KIND=C_BOOL) :: type_tmp
+      
+      CALL xios(get_variablegroup_handle)(variablegroup_id,variablegroup_hdl)
+      CALL xios(is_defined_variablegroup_attr_hdl_)   &
+      ( variablegroup_hdl, group_ref, name, type )
+    
+  END SUBROUTINE xios(is_defined_variablegroup_attr)
+  
+  SUBROUTINE xios(is_defined_variablegroup_attr_hdl)  &
+    ( variablegroup_hdl, group_ref, name, type )
+    
+    IMPLICIT NONE
+      TYPE(txios(variablegroup)) , INTENT(IN) :: variablegroup_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
+      LOGICAL(KIND=C_BOOL) :: group_ref_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: name
+      LOGICAL(KIND=C_BOOL) :: name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type
+      LOGICAL(KIND=C_BOOL) :: type_tmp
+      
+      CALL xios(is_defined_variablegroup_attr_hdl_)  &
+      ( variablegroup_hdl, group_ref, name, type )
+    
+  END SUBROUTINE xios(is_defined_variablegroup_attr_hdl)
+  
+  SUBROUTINE xios(is_defined_variablegroup_attr_hdl_)   &
+    ( variablegroup_hdl, group_ref_, name_, type_ )
+    
+    IMPLICIT NONE
+      TYPE(txios(variablegroup)) , INTENT(IN) :: variablegroup_hdl
+      LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref_
+      LOGICAL(KIND=C_BOOL) :: group_ref__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: name_
+      LOGICAL(KIND=C_BOOL) :: name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: type_
+      LOGICAL(KIND=C_BOOL) :: type__tmp
+      
+      IF (PRESENT(group_ref_)) THEN
+        group_ref__tmp=cxios_is_defined_variablegroup_group_ref(variablegroup_hdl%daddr)
+        group_ref_=group_ref__tmp
+      ENDIF
+      
+      IF (PRESENT(name_)) THEN
+        name__tmp=cxios_is_defined_variablegroup_name(variablegroup_hdl%daddr)
+        name_=name__tmp
+      ENDIF
+      
+      IF (PRESENT(type_)) THEN
+        type__tmp=cxios_is_defined_variablegroup_type(variablegroup_hdl%daddr)
+        type_=type__tmp
+      ENDIF
+      
+      
+    
+  END SUBROUTINE xios(is_defined_variablegroup_attr_hdl_)
+  
+END MODULE ivariablegroup_attr
Index: /XIOS/trunk/src/interface/fortran_attr/variable_interface_attr.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/variable_interface_attr.f90	(revision 472)
+++ /XIOS/trunk/src/interface/fortran_attr/variable_interface_attr.f90	(revision 472)
@@ -0,0 +1,55 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+
+MODULE variable_interface_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+  
+  INTERFACE ! Do not call directly / interface FORTRAN 2003 <-> C99
+    
+    
+    SUBROUTINE cxios_set_variable_name(variable_hdl, name, name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+      INTEGER  (kind = C_INT)     , VALUE        :: name_size
+    END SUBROUTINE cxios_set_variable_name
+    
+    SUBROUTINE cxios_get_variable_name(variable_hdl, name, name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+      INTEGER  (kind = C_INT)     , VALUE        :: name_size
+    END SUBROUTINE cxios_get_variable_name
+    
+    FUNCTION cxios_is_defined_variable_name(variable_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_variable_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl
+    END FUNCTION cxios_is_defined_variable_name
+    
+    
+    SUBROUTINE cxios_set_variable_type(variable_hdl, type, type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+      INTEGER  (kind = C_INT)     , VALUE        :: type_size
+    END SUBROUTINE cxios_set_variable_type
+    
+    SUBROUTINE cxios_get_variable_type(variable_hdl, type, type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+      INTEGER  (kind = C_INT)     , VALUE        :: type_size
+    END SUBROUTINE cxios_get_variable_type
+    
+    FUNCTION cxios_is_defined_variable_type(variable_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_variable_type
+      INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl
+    END FUNCTION cxios_is_defined_variable_type
+    
+    
+    END INTERFACE
+  
+END MODULE variable_interface_attr
Index: /XIOS/trunk/src/interface/fortran_attr/variablegroup_interface_attr.f90
===================================================================
--- /XIOS/trunk/src/interface/fortran_attr/variablegroup_interface_attr.f90	(revision 472)
+++ /XIOS/trunk/src/interface/fortran_attr/variablegroup_interface_attr.f90	(revision 472)
@@ -0,0 +1,76 @@
+! * ************************************************************************** *
+! *               Interface auto generated - do not modify                     *
+! * ************************************************************************** *
+
+MODULE variablegroup_interface_attr
+  USE, INTRINSIC :: ISO_C_BINDING
+  
+  INTERFACE ! Do not call directly / interface FORTRAN 2003 <-> C99
+    
+    
+    SUBROUTINE cxios_set_variablegroup_group_ref(variablegroup_hdl, group_ref, group_ref_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: group_ref
+      INTEGER  (kind = C_INT)     , VALUE        :: group_ref_size
+    END SUBROUTINE cxios_set_variablegroup_group_ref
+    
+    SUBROUTINE cxios_get_variablegroup_group_ref(variablegroup_hdl, group_ref, group_ref_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: group_ref
+      INTEGER  (kind = C_INT)     , VALUE        :: group_ref_size
+    END SUBROUTINE cxios_get_variablegroup_group_ref
+    
+    FUNCTION cxios_is_defined_variablegroup_group_ref(variablegroup_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_variablegroup_group_ref
+      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl
+    END FUNCTION cxios_is_defined_variablegroup_group_ref
+    
+    
+    SUBROUTINE cxios_set_variablegroup_name(variablegroup_hdl, name, name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+      INTEGER  (kind = C_INT)     , VALUE        :: name_size
+    END SUBROUTINE cxios_set_variablegroup_name
+    
+    SUBROUTINE cxios_get_variablegroup_name(variablegroup_hdl, name, name_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: name
+      INTEGER  (kind = C_INT)     , VALUE        :: name_size
+    END SUBROUTINE cxios_get_variablegroup_name
+    
+    FUNCTION cxios_is_defined_variablegroup_name(variablegroup_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_variablegroup_name
+      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl
+    END FUNCTION cxios_is_defined_variablegroup_name
+    
+    
+    SUBROUTINE cxios_set_variablegroup_type(variablegroup_hdl, type, type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+      INTEGER  (kind = C_INT)     , VALUE        :: type_size
+    END SUBROUTINE cxios_set_variablegroup_type
+    
+    SUBROUTINE cxios_get_variablegroup_type(variablegroup_hdl, type, type_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: type
+      INTEGER  (kind = C_INT)     , VALUE        :: type_size
+    END SUBROUTINE cxios_get_variablegroup_type
+    
+    FUNCTION cxios_is_defined_variablegroup_type(variablegroup_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_variablegroup_type
+      INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl
+    END FUNCTION cxios_is_defined_variablegroup_type
+    
+    
+    END INTERFACE
+  
+END MODULE variablegroup_interface_attr
Index: /XIOS/trunk/src/node/field.cpp
===================================================================
--- /XIOS/trunk/src/node/field.cpp	(revision 471)
+++ /XIOS/trunk/src/node/field.cpp	(revision 472)
@@ -27,5 +27,5 @@
       , active(false) , hasOutputFile(false),hasFieldOut(false), slotUpdateDate(NULL)
       , processed(false)
-      { /* Ne rien faire de plus */ }
+      { setVirtualVariableGroup() ; }
 
    CField::CField(const StdString & id)
@@ -39,5 +39,5 @@
       , active(false), hasOutputFile(false), hasFieldOut(false), slotUpdateDate(NULL)
       , processed(false)
-   { /* Ne rien faire de plus */ }
+   { setVirtualVariableGroup() ; }
 
    CField::~CField(void)
@@ -51,4 +51,34 @@
    }
 
+
+  //----------------------------------------------------------------
+
+   void CField::setVirtualVariableGroup(CVariableGroup* newVVariableGroup)
+   { 
+      this->vVariableGroup = newVVariableGroup; 
+   }
+ 
+   void CField::setVirtualVariableGroup(void)
+   {
+      this->setVirtualVariableGroup(CVariableGroup::create());
+   }
+  
+   CVariableGroup* CField::getVirtualVariableGroup(void) const
+   {
+      return (this->vVariableGroup);
+   }
+
+ 
+   std::vector<CVariable*> CField::getAllVariables(void) const
+   {
+      return (this->vVariableGroup->getAllChildren());
+   }
+   
+   void CField::solveDescInheritance(bool apply, const CAttributeMap * const parent)
+   {
+      SuperClassAttribute::setAttributes(parent,apply);
+      this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL);
+   }
+   //----------------------------------------------------------------
    //----------------------------------------------------------------
 
@@ -93,4 +123,14 @@
           return true ;
           break ;
+
+            case EVENT_ID_ADD_VARIABLE :
+             recvAddVariable(event) ;
+             return true ;
+             break ;
+         
+           case EVENT_ID_ADD_VARIABLE_GROUP :
+             recvAddVariableGroup(event) ;
+             return true ;
+             break ; 
  
         default :
@@ -658,4 +698,13 @@
       SuperClass::parse(node);
       node.getContent(this->content) ;
+      if (node.goToChildElement())
+      {
+        do
+        {
+          if (node.getElementName()=="variable" || node.getElementName()=="variable_group") this->getVirtualVariableGroup()->parseChild(node);
+        } while (node.goToNextElement()) ;
+        node.goToParentElement();
+      }
+
     }
     
@@ -782,4 +831,98 @@
     }
   }
+
+
+
+   CVariable* CField::addVariable(const string& id)
+   {
+     return vVariableGroup->createChild(id) ;
+   }
+
+   CVariableGroup* CField::addVariableGroup(const string& id)
+   {
+     return vVariableGroup->createChildGroup(id) ;
+   }
+
+
+   void CField::sendAddVariable(const string& id)
+   {
+    CContext* context=CContext::getCurrent() ;
+    
+    if (! context->hasServer )
+    {
+       CContextClient* client=context->client ;
+
+       CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE) ;   
+       if (client->isServerLeader())
+       {
+         CMessage msg ;
+         msg<<this->getId() ;
+         msg<<id ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+    }
+      
+   }
+ 
+   
+   void CField::sendAddVariableGroup(const string& id)
+   {
+    CContext* context=CContext::getCurrent() ;
+    if (! context->hasServer )
+    {
+       CContextClient* client=context->client ;
+
+       CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE_GROUP) ;   
+       if (client->isServerLeader())
+       {
+         CMessage msg ;
+         msg<<this->getId() ;
+         msg<<id ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+    }
+      
+   }
+   
+   void CField::recvAddVariable(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvAddVariable(*buffer) ;
+   }
+   
+   
+   void CField::recvAddVariable(CBufferIn& buffer)
+   {
+      string id ;
+      buffer>>id ;
+      addVariable(id) ;
+   }
+
+   void CField::recvAddVariableGroup(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvAddVariableGroup(*buffer) ;
+   }
+   
+   
+   void CField::recvAddVariableGroup(CBufferIn& buffer)
+   {
+      string id ;
+      buffer>>id ;
+      addVariableGroup(id) ;
+   }
+
+
+
   
 } // namespace xios
Index: /XIOS/trunk/src/node/field.hpp
===================================================================
--- /XIOS/trunk/src/node/field.hpp	(revision 471)
+++ /XIOS/trunk/src/node/field.hpp	(revision 472)
@@ -54,5 +54,5 @@
          enum EEventId
          {
-           EVENT_ID_UPDATE_DATA
+           EVENT_ID_UPDATE_DATA, EVENT_ID_ADD_VARIABLE, EVENT_ID_ADD_VARIABLE_GROUP
          } ;
          
@@ -138,8 +138,25 @@
         void parse(xml::CXMLNode & node) ;
         CArray<double,1>* getInstantData(void)  ;
+        
+        void setVirtualVariableGroup(CVariableGroup* newVVariableGroup);
+        void setVirtualVariableGroup(void);
+        CVariableGroup* getVirtualVariableGroup(void) const;
+        vector<CVariable*> getAllVariables(void) const;
+        virtual void solveDescInheritance(bool apply, const CAttributeMap * const parent = 0);
+ 
+        CVariable* addVariable(const string& id="") ;
+        CVariableGroup* addVariableGroup(const string& id="") ;
+        void sendAddVariable(const string& id="") ;
+        void sendAddVariableGroup(const string& id="") ;
+        static void recvAddVariable(CEventServer& event) ;
+        void recvAddVariable(CBufferIn& buffer) ;
+        static void recvAddVariableGroup(CEventServer& event) ;
+        void recvAddVariableGroup(CBufferIn& buffer) ;
+       
       public :
 
          /// PropriÃ©tÃ©s privÃ©es ///
-         
+         CVariableGroup* vVariableGroup ;
+                 
          std::vector<CField*> refObject;
          CField* baseRefObject;
Index: /XIOS/trunk/src/node/file.cpp
===================================================================
--- /XIOS/trunk/src/node/file.cpp	(revision 471)
+++ /XIOS/trunk/src/node/file.cpp	(revision 472)
@@ -24,10 +24,16 @@
       : CObjectTemplate<CFile>(), CFileAttributes()
       , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL)
-   { setVirtualFieldGroup() ;}
+   { 
+     setVirtualFieldGroup() ;
+     setVirtualVariableGroup() ;
+   }
 
    CFile::CFile(const StdString & id)
       : CObjectTemplate<CFile>(id), CFileAttributes()
       , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL)
-   { setVirtualFieldGroup() ;}
+    { 
+      setVirtualFieldGroup() ;
+      setVirtualVariableGroup() ;
+    }
 
    CFile::~CFile(void)
@@ -52,7 +58,17 @@
    }
 
+   CVariableGroup* CFile::getVirtualVariableGroup(void) const
+   {
+      return (this->vVariableGroup);
+   }
+
    std::vector<CField*> CFile::getAllFields(void) const
    {
       return (this->vFieldGroup->getAllChildren());
+   }
+ 
+   std::vector<CVariable*> CFile::getAllVariables(void) const
+   {
+      return (this->vVariableGroup->getAllChildren());
    }
 
@@ -120,4 +136,9 @@
    }
 
+   void CFile::setVirtualVariableGroup(CVariableGroup* newVVariableGroup)
+   { 
+      this->vVariableGroup = newVVariableGroup; 
+   }
+
    //----------------------------------------------------------------
 
@@ -125,4 +146,9 @@
    {
       this->setVirtualFieldGroup(CFieldGroup::create());
+   }
+
+   void CFile::setVirtualVariableGroup(void)
+   {
+      this->setVirtualVariableGroup(CVariableGroup::create());
    }
 
@@ -313,4 +339,7 @@
          }
          
+         vector<CVariable*> listVars = getAllVariables() ;
+         for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) this-> data_out-> writeAttribute(*it) ;
+         
          this->data_out->definition_end();
       }
@@ -333,10 +362,15 @@
    {
       SuperClass::parse(node);
-      if (node.goToChildElement() & this->hasId())
-      { // Si la dÃ©finition du fichier intÃ©gre des champs et si le fichier est identifiÃ©.
-         node.goToParentElement();
-//         this->setVirtualFieldGroup(this->getId());
-         this->getVirtualFieldGroup()->parse(node, false);
-      }
+      
+      if (node.goToChildElement())
+      {
+        do
+        {
+           if (node.getElementName()=="field" || node.getElementName()=="field_group") this->getVirtualFieldGroup()->parseChild(node);
+           else if (node.getElementName()=="variable" || node.getElementName()=="variable_group") this->getVirtualVariableGroup()->parseChild(node);
+        } while (node.goToNextElement()) ;
+        node.goToParentElement();
+      }
+
    }
    //----------------------------------------------------------------
@@ -361,5 +395,6 @@
    {
       SuperClassAttribute::setAttributes(parent,apply);
-      this->getVirtualFieldGroup()->solveDescInheritance(apply, NULL);
+      this->getVirtualFieldGroup()->solveDescInheritance(apply, NULL); 
+      this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL);
    }
 
@@ -422,4 +457,14 @@
    {
      return vFieldGroup->createChildGroup(id) ;
+   }
+ 
+   CVariable* CFile::addVariable(const string& id)
+   {
+     return vVariableGroup->createChild(id) ;
+   }
+
+   CVariableGroup* CFile::addVariableGroup(const string& id)
+   {
+     return vVariableGroup->createChildGroup(id) ;
    }
    
@@ -502,4 +547,94 @@
    }
    
+
+
+
+
+
+
+
+
+
+
+   void CFile::sendAddVariable(const string& id)
+   {
+    CContext* context=CContext::getCurrent() ;
+    
+    if (! context->hasServer )
+    {
+       CContextClient* client=context->client ;
+
+       CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE) ;   
+       if (client->isServerLeader())
+       {
+         CMessage msg ;
+         msg<<this->getId() ;
+         msg<<id ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+    }
+      
+   }
+   
+   void CFile::sendAddVariableGroup(const string& id)
+   {
+    CContext* context=CContext::getCurrent() ;
+    if (! context->hasServer )
+    {
+       CContextClient* client=context->client ;
+
+       CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE_GROUP) ;   
+       if (client->isServerLeader())
+       {
+         CMessage msg ;
+         msg<<this->getId() ;
+         msg<<id ;
+         event.push(client->getServerLeader(),1,msg) ;
+         client->sendEvent(event) ;
+       }
+       else client->sendEvent(event) ;
+    }
+      
+   }
+   
+   void CFile::recvAddVariable(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvAddVariable(*buffer) ;
+   }
+   
+   
+   void CFile::recvAddVariable(CBufferIn& buffer)
+   {
+      string id ;
+      buffer>>id ;
+      addVariable(id) ;
+   }
+
+   void CFile::recvAddVariableGroup(CEventServer& event)
+   {
+      
+      CBufferIn* buffer=event.subEvents.begin()->buffer;
+      string id;
+      *buffer>>id ;
+      get(id)->recvAddVariableGroup(*buffer) ;
+   }
+   
+   
+   void CFile::recvAddVariableGroup(CBufferIn& buffer)
+   {
+      string id ;
+      buffer>>id ;
+      addVariableGroup(id) ;
+   }
+
+
+
+
 
    bool CFile::dispatchEvent(CEventServer& event)
@@ -519,5 +654,14 @@
              return true ;
              break ;       
+ 
+            case EVENT_ID_ADD_VARIABLE :
+             recvAddVariable(event) ;
+             return true ;
+             break ;
          
+           case EVENT_ID_ADD_VARIABLE_GROUP :
+             recvAddVariableGroup(event) ;
+             return true ;
+             break ;               
            default :
               ERROR("bool CFile::dispatchEvent(CEventServer& event)", <<"Unknown Event") ;
Index: /XIOS/trunk/src/node/file.hpp
===================================================================
--- /XIOS/trunk/src/node/file.hpp	(revision 471)
+++ /XIOS/trunk/src/node/file.hpp	(revision 472)
@@ -42,5 +42,5 @@
          enum EEventId
          {
-           EVENT_ID_ADD_FIELD=0,EVENT_ID_ADD_FIELD_GROUP
+           EVENT_ID_ADD_FIELD=0,EVENT_ID_ADD_FIELD_GROUP, EVENT_ID_ADD_VARIABLE,EVENT_ID_ADD_VARIABLE_GROUP
          } ;
          
@@ -57,5 +57,7 @@
          boost::shared_ptr<CDataOutput> getDataOutput(void) const;
          CFieldGroup* getVirtualFieldGroup(void) const;
+         CVariableGroup* getVirtualVariableGroup(void) const;
          std::vector<CField*> getAllFields(void) const;
+         std::vector<CVariable*> getAllVariables(void) const;
 
          std::vector<CField* > getEnabledFields(int default_outputlevel = 5,
@@ -68,4 +70,6 @@
          void setVirtualFieldGroup(CFieldGroup* newVFieldGroup);
          void setVirtualFieldGroup(void);
+         void setVirtualVariableGroup(CVariableGroup* newVVariableGroup);
+         void setVirtualVariableGroup(void);
          void processEnabledFile(void) ;
          void processEnabledFields(void) ;
@@ -99,4 +103,6 @@
          CField* addField(const string& id="") ;
          CFieldGroup* addFieldGroup(const string& id="") ;
+         CVariable* addVariable(const string& id="") ;
+         CVariableGroup* addVariableGroup(const string& id="") ;
          void sendAddField(const string& id="") ;
          void sendAddFieldGroup(const string& id="") ;
@@ -105,5 +111,13 @@
          static void recvAddFieldGroup(CEventServer& event) ;
          void recvAddFieldGroup(CBufferIn& buffer) ;
+         
+         void sendAddVariable(const string& id="") ;
+         void sendAddVariableGroup(const string& id="") ;
+         static void recvAddVariable(CEventServer& event) ;
+         void recvAddVariable(CBufferIn& buffer) ;
+         static void recvAddVariableGroup(CEventServer& event) ;
+         void recvAddVariableGroup(CBufferIn& buffer) ;
          static bool dispatchEvent(CEventServer& event) ;
+         
          bool isSyncTime(void) ;
          bool checkSplit(void) ;
@@ -123,4 +137,5 @@
          /// PropriÃ©tÃ©s privÃ©es ///
          CFieldGroup* vFieldGroup;
+         CVariableGroup* vVariableGroup ;
          boost::shared_ptr<CDataOutput> data_out;
          std::vector<CField*> enabledFields;
Index: /XIOS/trunk/src/node/variable.cpp
===================================================================
--- /XIOS/trunk/src/node/variable.cpp	(revision 471)
+++ /XIOS/trunk/src/node/variable.cpp	(revision 472)
@@ -61,5 +61,27 @@
       oss << "</" << CVariable::GetName() << " >";
       return (oss.str());
+   } 
+   
+   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 ;
    }
+       
 /*
    void CVariable::toBinary(StdOStream & os) const
Index: /XIOS/trunk/src/node/variable.hpp
===================================================================
--- /XIOS/trunk/src/node/variable.hpp	(revision 471)
+++ /XIOS/trunk/src/node/variable.hpp	(revision 472)
@@ -50,23 +50,23 @@
 
          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);
             virtual StdString toString(void) const;
 
-//            virtual void toBinary  (StdOStream & os) const;
-//            virtual void fromBinary(StdIStream & is);
-
             /// Accesseur ///
             const StdString & getContent (void) const;
-
+            
             
             template <typename T> inline T getData(void) const;
-//            bool inline getData<bool>(void) const ;
-//            template <> getData<bool>(void) const ;
             
             template <typename T, StdSize N>
             inline void getData(CArray<T, N>& _data_array) const;
-
+            
+            EVarType getVarType(void) const ;
+            
          public :
          
Index: /XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 471)
+++ /XIOS/trunk/src/output/nc4_data_output.cpp	(revision 472)
@@ -645,4 +645,11 @@
          SuperClassWriter::addAttribute
                ("online_operation", field->operation.getValue(), &fieldid);
+
+        // write child variables as attributes
+        
+        
+         vector<CVariable*> listVars = field->getAllVariables() ;
+         for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) writeAttribute_(*it, fieldid) ;
+
                
          if (wtime)
@@ -710,4 +717,34 @@
          else singleDomain=false ;
       }
+ 
+      void CNc4DataOutput::writeAttribute_ (CVariable* var, const string& fieldId)
+      {
+        string name ;
+        if (!var->name.isEmpty()) name=var->name ;
+        else if (var->hasId()) name=var->getId() ;
+        else return ;
+        
+        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) ; 
+     }
+ 
+     void CNc4DataOutput::writeAttribute_ (CVariable* var)
+     {
+        string name ;
+        if (!var->name.isEmpty()) name=var->name ;
+        else if (var->hasId()) name=var->getId() ;
+        else return ;
+        
+        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>()) ; 
+     }     
  
       void CNc4DataOutput::syncFile_ (void)
Index: /XIOS/trunk/src/output/nc4_data_output.hpp
===================================================================
--- /XIOS/trunk/src/output/nc4_data_output.hpp	(revision 471)
+++ /XIOS/trunk/src/output/nc4_data_output.hpp	(revision 472)
@@ -44,4 +44,6 @@
             virtual void writeTimeDimension_(void);
             virtual void writeField_     (CField* field);
+            virtual void writeAttribute_ (CVariable* var);
+            virtual void writeAttribute_ (CVariable* var, const string& fieldId);
             virtual void writeFieldData_ (CField* field);
             virtual void writeFile_      (CFile* file);
Index: /XIOS/trunk/src/output/onetcdf4.cpp
===================================================================
--- /XIOS/trunk/src/output/onetcdf4.cpp	(revision 471)
+++ /XIOS/trunk/src/output/onetcdf4.cpp	(revision 472)
@@ -349,5 +349,48 @@
          CheckError(nc_put_att_int(grpid, varid, name.c_str(), NC_INT,value.numElements(), value.dataFirst()));
       }     
-      //---------------------------------------------------------------
+      
+      
+ 
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const short int & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_short(grpid, varid, name.c_str(), NC_SHORT,1, &value));
+      }
+
+       template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const CArray<short int,1>& value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_short(grpid, varid, name.c_str(), NC_SHORT,value.numElements(), value.dataFirst()));
+      }     
+      
+      
+      
+      template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const long int & value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_long(grpid, varid, name.c_str(), NC_LONG,1, &value));
+      }
+
+       template <>
+         void CONetCDF4::addAttribute
+            (const StdString & name, const CArray<long int,1>& value, const StdString * varname )
+      {
+         int grpid = this->getCurrentGroup();
+         int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname);
+         CheckError(nc_put_att_long(grpid, varid, name.c_str(), NC_LONG, value.numElements(), value.dataFirst()));
+      } 
+      
+      
+      
+                //---------------------------------------------------------------
 
       void CONetCDF4::getWriteDataInfos(const StdString & name, StdSize record, StdSize & array_size,
Index: /XIOS/trunk/src/output/onetcdf4.hpp
===================================================================
--- /XIOS/trunk/src/output/onetcdf4.hpp	(revision 471)
+++ /XIOS/trunk/src/output/onetcdf4.hpp	(revision 472)
@@ -53,7 +53,5 @@
                void setDefaultValue(const StdString & varname, const T * value = NULL);
          
-            template <class T>
-               void addAttribute
-                  (const StdString & name, const T & value, const StdString * varname = NULL);
+            template <class T>  void addAttribute (const StdString & name, const T & value, const StdString * varname = NULL);
 
             /// Ecriture des donnÃ©es ///
