Index: XIOS/trunk/src/config/file_attribute.conf
===================================================================
--- XIOS/trunk/src/config/file_attribute.conf	(revision 516)
+++ XIOS/trunk/src/config/file_attribute.conf	(revision 517)
@@ -12,4 +12,5 @@
 DECLARE_ATTRIBUTE(bool,      enabled)
 DECLARE_ENUM2(type,one_file,multiple_file)
+DECLARE_ENUM2(format, netcdf4, netcdf4_classic)
 DECLARE_ATTRIBUTE(StdString,      par_access)
 
Index: XIOS/trunk/src/interface/c_attr/icfile_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 516)
+++ XIOS/trunk/src/interface/c_attr/icfile_attr.cpp	(revision 517)
@@ -64,4 +64,30 @@
   
   
+  void cxios_set_file_format(file_Ptr file_hdl, const char * format, int format_size)
+  {
+    std::string format_str;
+    if(!cstr2string(format, format_size, format_str)) return;
+     CTimer::get("XIOS").resume();
+    file_hdl->format.fromString(format_str);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_file_format(file_Ptr file_hdl, char * format, int format_size)
+  {
+     CTimer::get("XIOS").resume();
+    if(!string_copy(file_hdl->format.getInheritedStringValue(),format , format_size))
+      ERROR("void cxios_get_file_format(file_Ptr file_hdl, char * format, int format_size)", <<"Input string is to short");
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_file_format(file_Ptr file_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return file_hdl->format.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_file_min_digits(file_Ptr file_hdl, int min_digits)
   {
Index: XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp
===================================================================
--- XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 516)
+++ XIOS/trunk/src/interface/c_attr/icfilegroup_attr.cpp	(revision 517)
@@ -64,4 +64,30 @@
   
   
+  void cxios_set_filegroup_format(filegroup_Ptr filegroup_hdl, const char * format, int format_size)
+  {
+    std::string format_str;
+    if(!cstr2string(format, format_size, format_str)) return;
+     CTimer::get("XIOS").resume();
+    filegroup_hdl->format.fromString(format_str);
+     CTimer::get("XIOS").suspend();
+  }
+  
+  void cxios_get_filegroup_format(filegroup_Ptr filegroup_hdl, char * format, int format_size)
+  {
+     CTimer::get("XIOS").resume();
+    if(!string_copy(filegroup_hdl->format.getInheritedStringValue(),format , format_size))
+      ERROR("void cxios_get_filegroup_format(filegroup_Ptr filegroup_hdl, char * format, int format_size)", <<"Input string is to short");
+     CTimer::get("XIOS").suspend();
+  }
+  
+  bool cxios_is_defined_filegroup_format(filegroup_Ptr filegroup_hdl )
+  {
+     CTimer::get("XIOS").resume();
+    return filegroup_hdl->format.hasInheritedValue();
+     CTimer::get("XIOS").suspend();
+  }
+  
+  
+  
   void cxios_set_filegroup_group_ref(filegroup_Ptr filegroup_hdl, const char * group_ref, int group_ref_size)
   {
Index: XIOS/trunk/src/interface/fortran_attr/file_interface_attr.f90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/file_interface_attr.f90	(revision 516)
+++ XIOS/trunk/src/interface/fortran_attr/file_interface_attr.f90	(revision 517)
@@ -49,4 +49,25 @@
     
     
+    SUBROUTINE cxios_set_file_format(file_hdl, format, format_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: format
+      INTEGER  (kind = C_INT)     , VALUE        :: format_size
+    END SUBROUTINE cxios_set_file_format
+    
+    SUBROUTINE cxios_get_file_format(file_hdl, format, format_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: format
+      INTEGER  (kind = C_INT)     , VALUE        :: format_size
+    END SUBROUTINE cxios_get_file_format
+    
+    FUNCTION cxios_is_defined_file_format(file_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_format
+      INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl
+    END FUNCTION cxios_is_defined_file_format
+    
+    
     SUBROUTINE cxios_set_file_min_digits(file_hdl, min_digits) BIND(C)
       USE ISO_C_BINDING
Index: XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.f90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.f90	(revision 516)
+++ XIOS/trunk/src/interface/fortran_attr/filegroup_interface_attr.f90	(revision 517)
@@ -49,4 +49,25 @@
     
     
+    SUBROUTINE cxios_set_filegroup_format(filegroup_hdl, format, format_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: format
+      INTEGER  (kind = C_INT)     , VALUE        :: format_size
+    END SUBROUTINE cxios_set_filegroup_format
+    
+    SUBROUTINE cxios_get_filegroup_format(filegroup_hdl, format, format_size) BIND(C)
+      USE ISO_C_BINDING
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+      CHARACTER(kind = C_CHAR)    , DIMENSION(*) :: format
+      INTEGER  (kind = C_INT)     , VALUE        :: format_size
+    END SUBROUTINE cxios_get_filegroup_format
+    
+    FUNCTION cxios_is_defined_filegroup_format(filegroup_hdl ) BIND(C)
+      USE ISO_C_BINDING
+      LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_format
+      INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl
+    END FUNCTION cxios_is_defined_filegroup_format
+    
+    
     SUBROUTINE cxios_set_filegroup_group_ref(filegroup_hdl, group_ref, group_ref_size) BIND(C)
       USE ISO_C_BINDING
Index: XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90	(revision 516)
+++ XIOS/trunk/src/interface/fortran_attr/ifile_attr.F90	(revision 517)
@@ -12,6 +12,6 @@
   
   SUBROUTINE xios(set_file_attr)  &
-    ( file_id, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-    , split_freq, split_freq_format, sync_freq, type )
+    ( file_id, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+    , par_access, split_freq, split_freq_format, sync_freq, type )
     
     IMPLICIT NONE
@@ -21,4 +21,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
@@ -34,12 +35,12 @@
       CALL xios(get_file_handle)(file_id,file_hdl)
       CALL xios(set_file_attr_hdl_)   &
-      ( file_hdl, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-      , split_freq, split_freq_format, sync_freq, type )
+      ( file_hdl, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+      , par_access, split_freq, split_freq_format, sync_freq, type )
     
   END SUBROUTINE xios(set_file_attr)
   
   SUBROUTINE xios(set_file_attr_hdl)  &
-    ( file_hdl, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-    , split_freq, split_freq_format, sync_freq, type )
+    ( file_hdl, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+    , par_access, split_freq, split_freq_format, sync_freq, type )
     
     IMPLICIT NONE
@@ -48,4 +49,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
@@ -60,12 +62,12 @@
       
       CALL xios(set_file_attr_hdl_)  &
-      ( file_hdl, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-      , split_freq, split_freq_format, sync_freq, type )
+      ( file_hdl, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+      , par_access, split_freq, split_freq_format, sync_freq, type )
     
   END SUBROUTINE xios(set_file_attr_hdl)
   
   SUBROUTINE xios(set_file_attr_hdl_)   &
-    ( file_hdl, description_, enabled_, min_digits_, name_, name_suffix_, output_freq_, output_level_  &
-    , par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
+    ( file_hdl, description_, enabled_, format_, min_digits_, name_, name_suffix_, output_freq_  &
+    , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
     
     IMPLICIT NONE
@@ -74,4 +76,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format_
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
@@ -94,4 +97,8 @@
       ENDIF
       
+      IF (PRESENT(format_)) THEN
+        CALL cxios_set_file_format(file_hdl%daddr, format_, len(format_))
+      ENDIF
+      
       IF (PRESENT(min_digits_)) THEN
         CALL cxios_set_file_min_digits(file_hdl%daddr, min_digits_)
@@ -139,6 +146,6 @@
   
   SUBROUTINE xios(get_file_attr)  &
-    ( file_id, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-    , split_freq, split_freq_format, sync_freq, type )
+    ( file_id, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+    , par_access, split_freq, split_freq_format, sync_freq, type )
     
     IMPLICIT NONE
@@ -148,4 +155,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
@@ -161,12 +169,12 @@
       CALL xios(get_file_handle)(file_id,file_hdl)
       CALL xios(get_file_attr_hdl_)   &
-      ( file_hdl, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-      , split_freq, split_freq_format, sync_freq, type )
+      ( file_hdl, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+      , par_access, split_freq, split_freq_format, sync_freq, type )
     
   END SUBROUTINE xios(get_file_attr)
   
   SUBROUTINE xios(get_file_attr_hdl)  &
-    ( file_hdl, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-    , split_freq, split_freq_format, sync_freq, type )
+    ( file_hdl, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+    , par_access, split_freq, split_freq_format, sync_freq, type )
     
     IMPLICIT NONE
@@ -175,4 +183,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
@@ -187,12 +196,12 @@
       
       CALL xios(get_file_attr_hdl_)  &
-      ( file_hdl, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-      , split_freq, split_freq_format, sync_freq, type )
+      ( file_hdl, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+      , par_access, split_freq, split_freq_format, sync_freq, type )
     
   END SUBROUTINE xios(get_file_attr_hdl)
   
   SUBROUTINE xios(get_file_attr_hdl_)   &
-    ( file_hdl, description_, enabled_, min_digits_, name_, name_suffix_, output_freq_, output_level_  &
-    , par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
+    ( file_hdl, description_, enabled_, format_, min_digits_, name_, name_suffix_, output_freq_  &
+    , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
     
     IMPLICIT NONE
@@ -201,4 +210,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format_
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
@@ -221,4 +231,8 @@
       ENDIF
       
+      IF (PRESENT(format_)) THEN
+        CALL cxios_get_file_format(file_hdl%daddr, format_, len(format_))
+      ENDIF
+      
       IF (PRESENT(min_digits_)) THEN
         CALL cxios_get_file_min_digits(file_hdl%daddr, min_digits_)
@@ -266,6 +280,6 @@
   
   SUBROUTINE xios(is_defined_file_attr)  &
-    ( file_id, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-    , split_freq, split_freq_format, sync_freq, type )
+    ( file_id, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+    , par_access, split_freq, split_freq_format, sync_freq, type )
     
     IMPLICIT NONE
@@ -276,4 +290,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: format
+      LOGICAL(KIND=C_BOOL) :: format_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits
       LOGICAL(KIND=C_BOOL) :: min_digits_tmp
@@ -299,12 +315,12 @@
       CALL xios(get_file_handle)(file_id,file_hdl)
       CALL xios(is_defined_file_attr_hdl_)   &
-      ( file_hdl, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-      , split_freq, split_freq_format, sync_freq, type )
+      ( file_hdl, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+      , par_access, split_freq, split_freq_format, sync_freq, type )
     
   END SUBROUTINE xios(is_defined_file_attr)
   
   SUBROUTINE xios(is_defined_file_attr_hdl)  &
-    ( file_hdl, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-    , split_freq, split_freq_format, sync_freq, type )
+    ( file_hdl, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+    , par_access, split_freq, split_freq_format, sync_freq, type )
     
     IMPLICIT NONE
@@ -314,4 +330,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: format
+      LOGICAL(KIND=C_BOOL) :: format_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits
       LOGICAL(KIND=C_BOOL) :: min_digits_tmp
@@ -336,12 +354,12 @@
       
       CALL xios(is_defined_file_attr_hdl_)  &
-      ( file_hdl, description, enabled, min_digits, name, name_suffix, output_freq, output_level, par_access  &
-      , split_freq, split_freq_format, sync_freq, type )
+      ( file_hdl, description, enabled, format, min_digits, name, name_suffix, output_freq, output_level  &
+      , par_access, split_freq, split_freq_format, sync_freq, type )
     
   END SUBROUTINE xios(is_defined_file_attr_hdl)
   
   SUBROUTINE xios(is_defined_file_attr_hdl_)   &
-    ( file_hdl, description_, enabled_, min_digits_, name_, name_suffix_, output_freq_, output_level_  &
-    , par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
+    ( file_hdl, description_, enabled_, format_, min_digits_, name_, name_suffix_, output_freq_  &
+    , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
     
     IMPLICIT NONE
@@ -351,4 +369,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL(KIND=C_BOOL) :: enabled__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: format_
+      LOGICAL(KIND=C_BOOL) :: format__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: min_digits_
       LOGICAL(KIND=C_BOOL) :: min_digits__tmp
@@ -382,4 +402,9 @@
       ENDIF
       
+      IF (PRESENT(format_)) THEN
+        format__tmp=cxios_is_defined_file_format(file_hdl%daddr)
+        format_=format__tmp
+      ENDIF
+      
       IF (PRESENT(min_digits_)) THEN
         min_digits__tmp=cxios_is_defined_file_min_digits(file_hdl%daddr)
Index: XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90
===================================================================
--- XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90	(revision 516)
+++ XIOS/trunk/src/interface/fortran_attr/ifilegroup_attr.F90	(revision 517)
@@ -12,5 +12,5 @@
   
   SUBROUTINE xios(set_filegroup_attr)  &
-    ( filegroup_id, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+    ( filegroup_id, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -21,4 +21,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits
@@ -35,5 +36,5 @@
       CALL xios(get_filegroup_handle)(filegroup_id,filegroup_hdl)
       CALL xios(set_filegroup_attr_hdl_)   &
-      ( filegroup_hdl, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+      ( filegroup_hdl, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -41,5 +42,5 @@
   
   SUBROUTINE xios(set_filegroup_attr_hdl)  &
-    ( filegroup_hdl, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+    ( filegroup_hdl, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -49,4 +50,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits
@@ -62,5 +64,5 @@
       
       CALL xios(set_filegroup_attr_hdl_)  &
-      ( filegroup_hdl, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+      ( filegroup_hdl, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -68,6 +70,7 @@
   
   SUBROUTINE xios(set_filegroup_attr_hdl_)   &
-    ( filegroup_hdl, description_, enabled_, group_ref_, min_digits_, name_, name_suffix_, output_freq_  &
-    , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
+    ( filegroup_hdl, description_, enabled_, format_, group_ref_, min_digits_, name_, name_suffix_  &
+    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  &
+     )
     
     IMPLICIT NONE
@@ -76,4 +79,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: format_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_
       INTEGER  , OPTIONAL, INTENT(IN) :: min_digits_
@@ -97,4 +101,8 @@
       ENDIF
       
+      IF (PRESENT(format_)) THEN
+        CALL cxios_set_filegroup_format(filegroup_hdl%daddr, format_, len(format_))
+      ENDIF
+      
       IF (PRESENT(group_ref_)) THEN
         CALL cxios_set_filegroup_group_ref(filegroup_hdl%daddr, group_ref_, len(group_ref_))
@@ -146,5 +154,5 @@
   
   SUBROUTINE xios(get_filegroup_attr)  &
-    ( filegroup_id, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+    ( filegroup_id, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -155,4 +163,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits
@@ -169,5 +178,5 @@
       CALL xios(get_filegroup_handle)(filegroup_id,filegroup_hdl)
       CALL xios(get_filegroup_attr_hdl_)   &
-      ( filegroup_hdl, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+      ( filegroup_hdl, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -175,5 +184,5 @@
   
   SUBROUTINE xios(get_filegroup_attr_hdl)  &
-    ( filegroup_hdl, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+    ( filegroup_hdl, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -183,4 +192,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL (KIND=C_BOOL) :: enabled_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits
@@ -196,5 +206,5 @@
       
       CALL xios(get_filegroup_attr_hdl_)  &
-      ( filegroup_hdl, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+      ( filegroup_hdl, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -202,6 +212,7 @@
   
   SUBROUTINE xios(get_filegroup_attr_hdl_)   &
-    ( filegroup_hdl, description_, enabled_, group_ref_, min_digits_, name_, name_suffix_, output_freq_  &
-    , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
+    ( filegroup_hdl, description_, enabled_, format_, group_ref_, min_digits_, name_, name_suffix_  &
+    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  &
+     )
     
     IMPLICIT NONE
@@ -210,4 +221,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL (KIND=C_BOOL) :: enabled__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: format_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_
       INTEGER  , OPTIONAL, INTENT(OUT) :: min_digits_
@@ -231,4 +243,8 @@
       ENDIF
       
+      IF (PRESENT(format_)) THEN
+        CALL cxios_get_filegroup_format(filegroup_hdl%daddr, format_, len(format_))
+      ENDIF
+      
       IF (PRESENT(group_ref_)) THEN
         CALL cxios_get_filegroup_group_ref(filegroup_hdl%daddr, group_ref_, len(group_ref_))
@@ -280,5 +296,5 @@
   
   SUBROUTINE xios(is_defined_filegroup_attr)  &
-    ( filegroup_id, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+    ( filegroup_id, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -290,4 +306,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: format
+      LOGICAL(KIND=C_BOOL) :: format_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
@@ -315,5 +333,5 @@
       CALL xios(get_filegroup_handle)(filegroup_id,filegroup_hdl)
       CALL xios(is_defined_filegroup_attr_hdl_)   &
-      ( filegroup_hdl, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+      ( filegroup_hdl, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -321,5 +339,5 @@
   
   SUBROUTINE xios(is_defined_filegroup_attr_hdl)  &
-    ( filegroup_hdl, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+    ( filegroup_hdl, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
     , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -330,4 +348,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled
       LOGICAL(KIND=C_BOOL) :: enabled_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: format
+      LOGICAL(KIND=C_BOOL) :: format_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref
       LOGICAL(KIND=C_BOOL) :: group_ref_tmp
@@ -354,5 +374,5 @@
       
       CALL xios(is_defined_filegroup_attr_hdl_)  &
-      ( filegroup_hdl, description, enabled, group_ref, min_digits, name, name_suffix, output_freq  &
+      ( filegroup_hdl, description, enabled, format, group_ref, min_digits, name, name_suffix, output_freq  &
       , output_level, par_access, split_freq, split_freq_format, sync_freq, type )
     
@@ -360,6 +380,7 @@
   
   SUBROUTINE xios(is_defined_filegroup_attr_hdl_)   &
-    ( filegroup_hdl, description_, enabled_, group_ref_, min_digits_, name_, name_suffix_, output_freq_  &
-    , output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_ )
+    ( filegroup_hdl, description_, enabled_, format_, group_ref_, min_digits_, name_, name_suffix_  &
+    , output_freq_, output_level_, par_access_, split_freq_, split_freq_format_, sync_freq_, type_  &
+     )
     
     IMPLICIT NONE
@@ -369,4 +390,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: enabled_
       LOGICAL(KIND=C_BOOL) :: enabled__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: format_
+      LOGICAL(KIND=C_BOOL) :: format__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: group_ref_
       LOGICAL(KIND=C_BOOL) :: group_ref__tmp
@@ -402,4 +425,9 @@
       ENDIF
       
+      IF (PRESENT(format_)) THEN
+        format__tmp=cxios_is_defined_filegroup_format(filegroup_hdl%daddr)
+        format_=format__tmp
+      ENDIF
+      
       IF (PRESENT(group_ref_)) THEN
         group_ref__tmp=cxios_is_defined_filegroup_group_ref(filegroup_hdl%daddr)
Index: XIOS/trunk/src/node/file.cpp
===================================================================
--- XIOS/trunk/src/node/file.cpp	(revision 516)
+++ XIOS/trunk/src/node/file.cpp	(revision 517)
@@ -322,4 +322,6 @@
          }
 
+         bool useClassicFormat = !format.isEmpty() && format == format_attr::netcdf4_classic;
+
          bool multifile=true ;
          if (!type.isEmpty())
@@ -369,5 +371,6 @@
            }
          }
-         data_out=shared_ptr<CDataOutput>(new CNc4DataOutput(oss.str(), false, fileComm, multifile, isCollective));
+         data_out=shared_ptr<CDataOutput>(new CNc4DataOutput(oss.str(), false, useClassicFormat,
+                                                             fileComm, multifile, isCollective));
          isOpen=true ;
 
Index: XIOS/trunk/src/output/nc4_data_output.cpp
===================================================================
--- XIOS/trunk/src/output/nc4_data_output.cpp	(revision 516)
+++ XIOS/trunk/src/output/nc4_data_output.cpp	(revision 517)
@@ -29,7 +29,8 @@
 
       CNc4DataOutput::CNc4DataOutput
-         (const StdString & filename, bool exist, MPI_Comm comm_file,bool multifile, bool isCollective)
+         (const StdString & filename, bool exist, bool useClassicFormat,
+          MPI_Comm comm_file,bool multifile, bool isCollective)
             : SuperClass()
-            , SuperClassWriter(filename, exist, &comm_file,multifile)
+            , SuperClassWriter(filename, exist, useClassicFormat, &comm_file, multifile)
             , comm_file(comm_file)
             , filename(filename)
@@ -732,8 +733,5 @@
            }
            else
-           {
-              double * default_value = NULL;
-              SuperClassWriter::setDefaultValue(fieldid, default_value);
-           }
+              SuperClassWriter::setDefaultValue(fieldid, (double*)NULL);
 
            {  // Ecriture des coordonnÃ©es
Index: XIOS/trunk/src/output/nc4_data_output.hpp
===================================================================
--- XIOS/trunk/src/output/nc4_data_output.hpp	(revision 516)
+++ XIOS/trunk/src/output/nc4_data_output.hpp	(revision 517)
@@ -25,5 +25,6 @@
                (const StdString & filename, bool exist);
             CNc4DataOutput
-               (const StdString & filename, bool exist, MPI_Comm comm_file, bool multifile, bool isCollective=true);
+               (const StdString & filename, bool exist, bool useClassicFormat,
+                MPI_Comm comm_file, bool multifile, bool isCollective=true);
 
             CNc4DataOutput(const CNc4DataOutput & dataoutput);       // Not implemented.
Index: XIOS/trunk/src/output/netCdfInterface.cpp
===================================================================
--- XIOS/trunk/src/output/netCdfInterface.cpp	(revision 516)
+++ XIOS/trunk/src/output/netCdfInterface.cpp	(revision 517)
@@ -524,4 +524,29 @@
    }
 
+  /*!
+  Set or unset the fill mode for a NetCDF file specified by its file id.
+  \param [in] ncid File id
+  \param [in] fill Define whether the fill mode should be enabled or not
+  \return Status code
+  */
+  int CNetCdfInterface::setFill(int ncid, bool fill)
+  {
+    int old_fill_mode;
+    int status = nc_set_fill(ncid, fill ? NC_FILL : NC_NOFILL, &old_fill_mode);
+    if (NC_NOERR != status)
+    {
+      StdString errormsg(nc_strerror(status));
+      StdStringStream sstr;
+
+      sstr << "Error when calling function nc_set_fill(ncid, fill ? NC_FILL : NC_NOFILL, &old_fill_mode)" << std::endl;
+      sstr << errormsg << std::endl;
+      sstr << "Unable to set the fill mode to : " << (fill ? "NC_FILL" : "NC_NOFILL") << std::endl;
+      StdString e = sstr.str();
+      throw CNetCdfException(e);
+    }
+
+    return status;
+  }
+
    /*!
    This function makes a request to netcdf with a ncid, to set the fill parameters for a variable,
Index: XIOS/trunk/src/output/netCdfInterface.hpp
===================================================================
--- XIOS/trunk/src/output/netCdfInterface.hpp	(revision 516)
+++ XIOS/trunk/src/output/netCdfInterface.hpp	(revision 517)
@@ -85,4 +85,7 @@
     static int defVarChunking(int ncid, int varId, int storage, StdSize chunkSize[]);
 
+    //! Set or unset the fill mode
+    static int setFill(int ncid, bool fill);
+
     //! Define variable fill parameters
     static int defVarFill(int ncid, int varId, int noFill, void* fillValue);
Index: XIOS/trunk/src/output/onetcdf4.cpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4.cpp	(revision 516)
+++ XIOS/trunk/src/output/onetcdf4.cpp	(revision 517)
@@ -11,9 +11,10 @@
 
       CONetCDF4::CONetCDF4
-         (const StdString & filename, bool exist, const MPI_Comm * comm, bool multifile)
+         (const StdString & filename, bool exist, bool useClassicFormat, const MPI_Comm * comm, bool multifile)
             : path()
+            , useClassicFormat(useClassicFormat)
       {
          this->wmpi = (comm != NULL) && !multifile;
-         this->initialize(filename, exist, comm,multifile);
+         this->initialize(filename, exist, useClassicFormat, comm,multifile);
       }
 
@@ -29,14 +30,20 @@
 
       void CONetCDF4::initialize
-         (const StdString & filename, bool exist, const MPI_Comm * comm, bool multifile)
-      {
+         (const StdString & filename, bool exist, bool useClassicFormat, const MPI_Comm * comm, bool multifile)
+      {
+         this->useClassicFormat = useClassicFormat;
+
+         int mode = useClassicFormat ? 0 : NC_NETCDF4;
+         if (!multifile)
+            mode |= useClassicFormat ? NC_PNETCDF : NC_MPIIO;
+
          if (!exist)
          {
             if (comm != NULL)
             {
-               if (!multifile) (CNetCdfInterface::createPar(filename, NC_NETCDF4|NC_MPIIO, *comm, MPI_INFO_NULL, (this->ncidp)));
-               else (CNetCdfInterface::create(filename, NC_NETCDF4, this->ncidp));
+               if (!multifile) CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp);
+               else CNetCdfInterface::create(filename, mode, this->ncidp);
             }
-            else (CNetCdfInterface::create(filename, NC_NETCDF4, this->ncidp));
+            else CNetCdfInterface::create(filename, mode, this->ncidp);
          }
          else
@@ -44,9 +51,14 @@
             if (comm != NULL)
             {
-               if (!multifile) (CNetCdfInterface::openPar(filename, NC_NETCDF4|NC_MPIIO, *comm, MPI_INFO_NULL, this->ncidp));
-               else (CNetCdfInterface::open(filename, NC_NETCDF4, this->ncidp));
+               if (!multifile) CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp);
+               else CNetCdfInterface::open(filename, mode, this->ncidp);
             }
-            else  (CNetCdfInterface::open(filename, NC_NETCDF4, this->ncidp));
-         }
+            else CNetCdfInterface::open(filename, mode, this->ncidp);
+         }
+
+         // If the classic NetCDF format is used, we enable the "no-fill mode" globally.
+         // This is done per variable for the NetCDF4 format.
+         if (useClassicFormat)
+            CNetCdfInterface::setFill(this->ncidp, false);    
       }
 
@@ -264,17 +276,22 @@
          }
 
-         (CNetCdfInterface::defVar(grpid, name, type, dimids.size(), &(dimids[0]), varid));
-
-// set chunksize : size of one record
-// but must not be > 2GB (netcdf or HDF5 problem)
-         totalSize=1 ;
-         for(vector<StdSize>::reverse_iterator it=dimsizes.rbegin(); it!=dimsizes.rend();++it)
-         {
-           totalSize*= *it ;
-           if (totalSize>=maxSize) *it=1 ;
-         }
-
-         (CNetCdfInterface::defVarChunking(grpid, varid, NC_CHUNKED, &(dimsizes[0])));
-         (CNetCdfInterface::defVarFill(grpid, varid, true, NULL));
+         CNetCdfInterface::defVar(grpid, name, type, dimids.size(), &(dimids[0]), varid);
+
+         // The classic NetCDF format does not support chunking nor fill parameters
+         if (!useClassicFormat)
+         {
+            // set chunksize : size of one record
+            // but must not be > 2GB (netcdf or HDF5 problem)
+            totalSize = 1;
+            for (vector<StdSize>::reverse_iterator it = dimsizes.rbegin(); it != dimsizes.rend(); ++it)
+            {
+              totalSize *= *it;
+              if (totalSize >= maxSize) *it = 1;
+            }
+
+            CNetCdfInterface::defVarChunking(grpid, varid, NC_CHUNKED, &dimsizes[0]);
+            CNetCdfInterface::defVarFill(grpid, varid, true, NULL);
+         }
+
          return (varid);
       }
Index: XIOS/trunk/src/output/onetcdf4.hpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4.hpp	(revision 516)
+++ XIOS/trunk/src/output/onetcdf4.hpp	(revision 517)
@@ -26,5 +26,6 @@
 
             /// Constructeurs ///
-            CONetCDF4(const StdString & filename, bool exist, const MPI_Comm * comm = NULL, bool multifile=true);
+            CONetCDF4(const StdString & filename, bool exist, bool useClassicFormat = false,
+                      const MPI_Comm * comm = NULL, bool multifile = true);
 
             CONetCDF4(const CONetCDF4 & onetcdf4);       // Not implemented.
@@ -33,5 +34,6 @@
 
             /// Initialisation ///
-            void initialize(const StdString & filename, bool exist, const MPI_Comm * comm, bool multifile);
+            void initialize(const StdString & filename, bool exist, bool useClassicFormat,
+                            const MPI_Comm * comm, bool multifile);
             void close(void) ;
             void sync(void) ;
@@ -92,4 +94,6 @@
             bool varExist(const StdString & varname);
 
+            bool useClassicFormat; //!< If true, NetCDF4 will use the classic NetCDF3 format
+
       //----------------------------------------------------------------
       
Index: XIOS/trunk/src/output/onetcdf4_impl.hpp
===================================================================
--- XIOS/trunk/src/output/onetcdf4_impl.hpp	(revision 516)
+++ XIOS/trunk/src/output/onetcdf4_impl.hpp	(revision 517)
@@ -46,8 +46,17 @@
     if (value != NULL)
     {
-      CNetCdfInterface::defVarFill(grpid, varid, 0, (void*)value);
+      // nc_def_var_fill will automatically set the _FillValue attribute when
+      // using the NetCDF 4 format but we need to do it manually otherwise
+      if (useClassicFormat)
+        this->addAttribute(StdString("_FillValue"), *value, &varname);
+      else
+        CNetCdfInterface::defVarFill(grpid, varid, 0, (void*)value);
       this->addAttribute(StdString("missing_value"), *value, &varname);
     }
-    else CNetCdfInterface::defVarFill(grpid, varid, 1, NULL);
+    else if (!useClassicFormat)
+    {
+      // The "no-fill mode" is set globally for the classic NetCDF format
+      CNetCdfInterface::defVarFill(grpid, varid, 1, NULL);
+    }
   }
 
