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 1780)
+++ XIOS/dev/dev_ym/XIOS_COUPLING/src/interface/fortran_attr/iscalar_attr.F90	(revision 1941)
@@ -12,6 +12,6 @@
 
   SUBROUTINE xios(set_scalar_attr)  &
-    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-    , scalar_ref, standard_name, unit, value )
+    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    , prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
@@ -24,4 +24,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
+      LOGICAL  , OPTIONAL, INTENT(IN) :: mask
+      LOGICAL (KIND=C_BOOL) :: mask_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive
@@ -35,12 +37,12 @@
       (scalar_id,scalar_hdl)
       CALL xios(set_scalar_attr_hdl_)   &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-      , scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      , prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(set_scalar_attr)
 
   SUBROUTINE xios(set_scalar_attr_hdl)  &
-    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-    , scalar_ref, standard_name, unit, value )
+    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    , prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
@@ -52,4 +54,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name
+      LOGICAL  , OPTIONAL, INTENT(IN) :: mask
+      LOGICAL (KIND=C_BOOL) :: mask_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive
@@ -61,12 +65,12 @@
 
       CALL xios(set_scalar_attr_hdl_)  &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-      , scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      , prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(set_scalar_attr_hdl)
 
   SUBROUTINE xios(set_scalar_attr_hdl_)   &
-    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, name_, positive_  &
-    , prec_, scalar_ref_, standard_name_, unit_, value_ )
+    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, mask_, name_  &
+    , positive_, prec_, scalar_ref_, standard_name_, unit_, value_ )
 
     IMPLICIT NONE
@@ -78,4 +82,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: label_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_
+      LOGICAL  , OPTIONAL, INTENT(IN) :: mask_
+      LOGICAL (KIND=C_BOOL) :: mask__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_
       CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive_
@@ -116,4 +122,10 @@
       ENDIF
 
+      IF (PRESENT(mask_)) THEN
+        mask__tmp = mask_
+        CALL cxios_set_scalar_mask &
+      (scalar_hdl%daddr, mask__tmp)
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         CALL cxios_set_scalar_name &
@@ -154,6 +166,6 @@
 
   SUBROUTINE xios(get_scalar_attr)  &
-    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-    , scalar_ref, standard_name, unit, value )
+    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    , prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
@@ -166,4 +178,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask
+      LOGICAL (KIND=C_BOOL) :: mask_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive
@@ -177,12 +191,12 @@
       (scalar_id,scalar_hdl)
       CALL xios(get_scalar_attr_hdl_)   &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-      , scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      , prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(get_scalar_attr)
 
   SUBROUTINE xios(get_scalar_attr_hdl)  &
-    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-    , scalar_ref, standard_name, unit, value )
+    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    , prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
@@ -194,4 +208,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: label
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask
+      LOGICAL (KIND=C_BOOL) :: mask_tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive
@@ -203,12 +219,12 @@
 
       CALL xios(get_scalar_attr_hdl_)  &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-      , scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      , prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(get_scalar_attr_hdl)
 
   SUBROUTINE xios(get_scalar_attr_hdl_)   &
-    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, name_, positive_  &
-    , prec_, scalar_ref_, standard_name_, unit_, value_ )
+    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, mask_, name_  &
+    , positive_, prec_, scalar_ref_, standard_name_, unit_, value_ )
 
     IMPLICIT NONE
@@ -220,4 +236,6 @@
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: label_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_
+      LOGICAL  , OPTIONAL, INTENT(OUT) :: mask_
+      LOGICAL (KIND=C_BOOL) :: mask__tmp
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_
       CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive_
@@ -258,4 +276,10 @@
       ENDIF
 
+      IF (PRESENT(mask_)) THEN
+        CALL cxios_get_scalar_mask &
+      (scalar_hdl%daddr, mask__tmp)
+        mask_ = mask__tmp
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         CALL cxios_get_scalar_name &
@@ -296,6 +320,6 @@
 
   SUBROUTINE xios(is_defined_scalar_attr)  &
-    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-    , scalar_ref, standard_name, unit, value )
+    ( scalar_id, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    , prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
@@ -314,4 +338,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mask
+      LOGICAL(KIND=C_BOOL) :: mask_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
@@ -332,12 +358,12 @@
       (scalar_id,scalar_hdl)
       CALL xios(is_defined_scalar_attr_hdl_)   &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-      , scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      , prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(is_defined_scalar_attr)
 
   SUBROUTINE xios(is_defined_scalar_attr_hdl)  &
-    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-    , scalar_ref, standard_name, unit, value )
+    ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+    , prec, scalar_ref, standard_name, unit, value )
 
     IMPLICIT NONE
@@ -355,4 +381,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name
       LOGICAL(KIND=C_BOOL) :: long_name_tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mask
+      LOGICAL(KIND=C_BOOL) :: mask_tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name
       LOGICAL(KIND=C_BOOL) :: name_tmp
@@ -371,12 +399,12 @@
 
       CALL xios(is_defined_scalar_attr_hdl_)  &
-      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, name, positive, prec  &
-      , scalar_ref, standard_name, unit, value )
+      ( scalar_hdl, axis_type, bounds, bounds_name, comment, label, long_name, mask, name, positive  &
+      , prec, scalar_ref, standard_name, unit, value )
 
   END SUBROUTINE xios(is_defined_scalar_attr_hdl)
 
   SUBROUTINE xios(is_defined_scalar_attr_hdl_)   &
-    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, name_, positive_  &
-    , prec_, scalar_ref_, standard_name_, unit_, value_ )
+    ( scalar_hdl, axis_type_, bounds_, bounds_name_, comment_, label_, long_name_, mask_, name_  &
+    , positive_, prec_, scalar_ref_, standard_name_, unit_, value_ )
 
     IMPLICIT NONE
@@ -394,4 +422,6 @@
       LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_
       LOGICAL(KIND=C_BOOL) :: long_name__tmp
+      LOGICAL, OPTIONAL, INTENT(OUT) :: mask_
+      LOGICAL(KIND=C_BOOL) :: mask__tmp
       LOGICAL, OPTIONAL, INTENT(OUT) :: name_
       LOGICAL(KIND=C_BOOL) :: name__tmp
@@ -445,4 +475,10 @@
       ENDIF
 
+      IF (PRESENT(mask_)) THEN
+        mask__tmp = cxios_is_defined_scalar_mask &
+      (scalar_hdl%daddr)
+        mask_ = mask__tmp
+      ENDIF
+
       IF (PRESENT(name_)) THEN
         name__tmp = cxios_is_defined_scalar_name &
