Index: XIOS/dev/XIOS_DEV_CMIP6/src/interface/fortran_attr/ifield_attr.F90
===================================================================
--- XIOS/dev/XIOS_DEV_CMIP6/src/interface/fortran_attr/ifield_attr.F90	(revision 1211)
+++ XIOS/dev/XIOS_DEV_CMIP6/src/interface/fortran_attr/ifield_attr.F90	(revision 1492)
@@ -12,9 +12,9 @@
 
   SUBROUTINE xios(set_field_attr)  &
-    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -27,4 +27,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -62,18 +63,18 @@
       (field_id,field_hdl)
       CALL xios(set_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr)
 
   SUBROUTINE xios(set_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -85,4 +86,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value
@@ -118,18 +120,18 @@
 
       CALL xios(set_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(set_field_attr_hdl)
 
   SUBROUTINE xios(set_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, compression_level_  &
-    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
-    , freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_  &
-    , read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_  &
-    , valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, comment_  &
+    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  &
+    , freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_  &
+    , operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -141,4 +143,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: check_if_active_
       LOGICAL (KIND=C_BOOL) :: check_if_active__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: comment_
       INTEGER  , OPTIONAL, INTENT(IN) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_
@@ -199,4 +202,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_set_field_comment &
+      (field_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_set_field_compression_level &
@@ -337,9 +345,9 @@
 
   SUBROUTINE xios(get_field_attr)  &
-    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -352,4 +360,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -387,18 +396,18 @@
       (field_id,field_hdl)
       CALL xios(get_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr)
 
   SUBROUTINE xios(get_field_attr_hdl)  &
-    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -410,4 +419,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL (KIND=C_BOOL) :: check_if_active_tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value
@@ -443,18 +453,18 @@
 
       CALL xios(get_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+      , valid_max, valid_min )
 
   END SUBROUTINE xios(get_field_attr_hdl)
 
   SUBROUTINE xios(get_field_attr_hdl_)   &
-    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, compression_level_  &
-    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
-    , freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_  &
-    , read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_  &
-    , valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, comment_  &
+    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  &
+    , freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_  &
+    , operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -466,4 +476,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: check_if_active_
       LOGICAL (KIND=C_BOOL) :: check_if_active__tmp
+      CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: comment_
       INTEGER  , OPTIONAL, INTENT(OUT) :: compression_level_
       REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_
@@ -524,4 +535,9 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        CALL cxios_get_field_comment &
+      (field_hdl%daddr, comment_, len(comment_))
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         CALL cxios_get_field_compression_level &
@@ -662,9 +678,9 @@
 
   SUBROUTINE xios(is_defined_field_attr)  &
-    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_id, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -681,4 +697,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL(KIND=C_BOOL) :: check_if_active_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -737,18 +755,18 @@
       (field_id,field_hdl)
       CALL xios(is_defined_field_attr_hdl_)   &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, 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, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-    , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-    , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-    , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-     )
+    ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+    , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+    , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+    , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit  &
+    , valid_max, valid_min )
 
     IMPLICIT NONE
@@ -764,4 +782,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active
       LOGICAL(KIND=C_BOOL) :: check_if_active_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment
+      LOGICAL(KIND=C_BOOL) :: comment_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level
       LOGICAL(KIND=C_BOOL) :: compression_level_tmp
@@ -818,18 +838,18 @@
 
       CALL xios(is_defined_field_attr_hdl_)  &
-      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, compression_level  &
-      , default_value, detect_missing_value, domain_ref, enabled, expr, field_ref, freq_offset, freq_op  &
-      , grid_path, grid_ref, indexed_output, level, long_name, name, operation, prec, read_access  &
-      , scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, unit, valid_max, valid_min  &
-       )
+      ( field_hdl, add_offset, axis_ref, cell_methods, cell_methods_mode, check_if_active, comment  &
+      , compression_level, default_value, detect_missing_value, domain_ref, enabled, expr, field_ref  &
+      , freq_offset, freq_op, grid_path, grid_ref, indexed_output, level, long_name, name, operation  &
+      , prec, read_access, scalar_ref, scale_factor, standard_name, ts_enabled, ts_split_freq, 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_, cell_methods_, cell_methods_mode_, check_if_active_, compression_level_  &
-    , default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_, freq_offset_  &
-    , freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_, operation_, prec_  &
-    , read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_, unit_  &
-    , valid_max_, valid_min_ )
+    ( field_hdl, add_offset_, axis_ref_, cell_methods_, cell_methods_mode_, check_if_active_, comment_  &
+    , compression_level_, default_value_, detect_missing_value_, domain_ref_, enabled_, expr_, field_ref_  &
+    , freq_offset_, freq_op_, grid_path_, grid_ref_, indexed_output_, level_, long_name_, name_  &
+    , operation_, prec_, read_access_, scalar_ref_, scale_factor_, standard_name_, ts_enabled_, ts_split_freq_  &
+    , unit_, valid_max_, valid_min_ )
 
     IMPLICIT NONE
@@ -845,4 +865,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: check_if_active_
       LOGICAL(KIND=C_BOOL) :: check_if_active__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: comment_
+      LOGICAL(KIND=C_BOOL) :: comment__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: compression_level_
       LOGICAL(KIND=C_BOOL) :: compression_level__tmp
@@ -928,4 +950,10 @@
       ENDIF
 
+      IF (PRESENT(comment_)) THEN
+        comment__tmp = cxios_is_defined_field_comment &
+      (field_hdl%daddr)
+        comment_ = comment__tmp
+      ENDIF
+
       IF (PRESENT(compression_level_)) THEN
         compression_level__tmp = cxios_is_defined_field_compression_level &
