Index: XIOS/dev/dev_ym/XIOS_COUPLING/src/interface/fortran_attr/iscalar_attr.F90
===================================================================
--- XIOS/dev/dev_ym/XIOS_COUPLING/src/interface/fortran_attr/iscalar_attr.F90	(revision 1941)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/interface/fortran_attr/iscalar_attr.F90	(revision 2338)
@@ -12,5 +12,5 @@
 
   SUBROUTINE xios(set_scalar_attr)  &
-    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
     , prec, scalar_ref, standard_name, unit, value )
 
@@ -26,4 +26,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: mask
       LOGICAL (KIND=C_BOOL) :: mask_tmp
+      INTEGER  , OPTIONAL, INTENT(IN) :: n
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive
@@ -37,5 +38,5 @@
       (scalar_id,scalar_hdl)
       CALL xios(set_scalar_attr_hdl_)   &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
       , prec, scalar_ref, standard_name, unit, value )
 
@@ -43,5 +44,5 @@
 
   SUBROUTINE xios(set_scalar_attr_hdl)  &
-    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
     , prec, scalar_ref, standard_name, unit, value )
 
@@ -56,4 +57,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: mask
       LOGICAL (KIND=C_BOOL) :: mask_tmp
+      INTEGER  , OPTIONAL, INTENT(IN) :: n
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive
@@ -65,5 +67,5 @@
 
       CALL xios(set_scalar_attr_hdl_)  &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
       , prec, scalar_ref, standard_name, unit, value )
 
@@ -71,5 +73,5 @@
 
   SUBROUTINE xios(set_scalar_attr_hdl_)   &
-    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, mask_, name_  &
+    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, mask_, n_, name_  &
     , positive_, prec_, scalar_ref_, standard_name_, unit_, value_ )
 
@@ -84,4 +86,5 @@
       LOGICAL  , OPTIONAL, INTENT(IN) :: mask_
       LOGICAL (KIND=C_BOOL) :: mask__tmp
+      INTEGER  , OPTIONAL, INTENT(IN) :: n_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive_
@@ -128,4 +131,9 @@
       ENDIF
 
+      IF (PRESENT(n_)) THEN
+        CALL cxios_set_scalar_n &
+      (scalar_hdl%daddr, n_)
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         CALL cxios_set_scalar_name &
@@ -166,5 +174,5 @@
 
   SUBROUTINE xios(get_scalar_attr)  &
-    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
     , prec, scalar_ref, standard_name, unit, value )
 
@@ -180,4 +188,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: mask
       LOGICAL (KIND=C_BOOL) :: mask_tmp
+      INTEGER  , OPTIONAL, INTENT(OUT) :: n
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive
@@ -191,5 +200,5 @@
       (scalar_id,scalar_hdl)
       CALL xios(get_scalar_attr_hdl_)   &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
       , prec, scalar_ref, standard_name, unit, value )
 
@@ -197,5 +206,5 @@
 
   SUBROUTINE xios(get_scalar_attr_hdl)  &
-    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
     , prec, scalar_ref, standard_name, unit, value )
 
@@ -210,4 +219,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: mask
       LOGICAL (KIND=C_BOOL) :: mask_tmp
+      INTEGER  , OPTIONAL, INTENT(OUT) :: n
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive
@@ -219,5 +229,5 @@
 
       CALL xios(get_scalar_attr_hdl_)  &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
       , prec, scalar_ref, standard_name, unit, value )
 
@@ -225,5 +235,5 @@
 
   SUBROUTINE xios(get_scalar_attr_hdl_)   &
-    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, mask_, name_  &
+    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, mask_, n_, name_  &
     , positive_, prec_, scalar_ref_, standard_name_, unit_, value_ )
 
@@ -238,4 +248,5 @@
       LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_
       LOGICAL (KIND=C_BOOL) :: mask__tmp
+      INTEGER  , OPTIONAL, INTENT(OUT) :: n_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive_
@@ -282,4 +293,9 @@
       ENDIF
 
+      IF (PRESENT(n_)) THEN
+        CALL cxios_get_scalar_n &
+      (scalar_hdl%daddr, n_)
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         CALL cxios_get_scalar_name &
@@ -320,5 +336,5 @@
 
   SUBROUTINE xios(is_defined_scalar_attr)  &
-    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
     , prec, scalar_ref, standard_name, unit, value )
 
@@ -340,4 +356,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: mask
       LOGICAL(KIND=C_BOOL) :: mask_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: n
+      LOGICAL(KIND=C_BOOL) :: n_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
@@ -358,5 +376,5 @@
       (scalar_id,scalar_hdl)
       CALL xios(is_defined_scalar_attr_hdl_)   &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
       , prec, scalar_ref, standard_name, unit, value )
 
@@ -364,5 +382,5 @@
 
   SUBROUTINE xios(is_defined_scalar_attr_hdl)  &
-    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
     , prec, scalar_ref, standard_name, unit, value )
 
@@ -383,4 +401,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: mask
       LOGICAL(KIND=C_BOOL) :: mask_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: n
+      LOGICAL(KIND=C_BOOL) :: n_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
@@ -399,5 +419,5 @@
 
       CALL xios(is_defined_scalar_attr_hdl_)  &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, n, name, positive  &
       , prec, scalar_ref, standard_name, unit, value )
 
@@ -405,5 +425,5 @@
 
   SUBROUTINE xios(is_defined_scalar_attr_hdl_)   &
-    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, mask_, name_  &
+    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, mask_, n_, name_  &
     , positive_, prec_, scalar_ref_, standard_name_, unit_, value_ )
 
@@ -424,4 +444,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: mask_
       LOGICAL(KIND=C_BOOL) :: mask__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: n_
+      LOGICAL(KIND=C_BOOL) :: n__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name_
       LOGICAL(KIND=C_BOOL) :: name__tmp
@@ -481,4 +503,10 @@
       ENDIF
 
+      IF (PRESENT(n_)) THEN
+        n__tmp = cxios_is_defined_scalar_n &
+      (scalar_hdl%daddr)
+        n_ = n__tmp
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         name__tmp = cxios_is_defined_scalar_name &
