Index: XIOS/xios_training/XIOS_TO_COMPILE/src/interface/fortran/idata.F90
===================================================================
--- XIOS/xios_training/XIOS_TO_COMPILE/src/interface/fortran/idata.F90	(revision 2093)
+++ XIOS/xios_training/XIOS_TO_COMPILE/src/interface/fortran/idata.F90	(revision 2094)
@@ -676,5 +676,5 @@
          CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
          INTEGER  (kind = C_INT)   , VALUE        :: varid_size
-         LOGICAL  (kind = 4)                      :: data_logic
+         LOGICAL  (kind = C_BOOL)                 :: data_logic
          LOGICAL  (kind = C_BOOL)                 :: is_var_existed
       END SUBROUTINE cxios_get_variable_data_logic
@@ -718,5 +718,5 @@
          CHARACTER(kind = C_CHAR)  , DIMENSION(*) :: vardid
          INTEGER  (kind = C_INT)   , VALUE        :: varid_size
-         LOGICAL  (kind = 4)       , VALUE        :: data_logic
+         LOGICAL  (kind = C_BOOL)       , VALUE   :: data_logic
          LOGICAL  (kind = C_BOOL)                 :: is_var_existed
       END SUBROUTINE cxios_set_variable_data_logic
@@ -1339,6 +1339,7 @@
    ! Get variable functions
    LOGICAL FUNCTION xios(getVar_k8)(varId, data_k8)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL  (kind = C_BOOL)                      :: val
       CHARACTER(len = *)               , INTENT(IN) :: varId
       REAL     (kind = 8)              , INTENT(OUT):: data_k8
@@ -1350,6 +1351,7 @@
 
    LOGICAL FUNCTION xios(getVar_k4)(varId, data_k4)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL  (kind = C_BOOL)                      :: val
       CHARACTER(len = *)               , INTENT(IN) :: varId
       REAL     (kind = 4)              , INTENT(OUT):: data_k4
@@ -1361,6 +1363,7 @@
 
    LOGICAL FUNCTION xios(getVar_int)(varId, data_int)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL  (kind = C_BOOL)                      :: val
       CHARACTER(len = *)               , INTENT(IN) :: varId
       INTEGER                          , INTENT(OUT):: data_int
@@ -1372,17 +1375,20 @@
 
    LOGICAL FUNCTION xios(getVar_logic)(varId, data_logic)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL  (kind = C_BOOL)                      :: val
       CHARACTER(len  = *)              , INTENT(IN) :: varId
-      LOGICAL  (kind = 4)              , INTENT(OUT):: data_logic
-
-      CALL cxios_get_variable_data_logic(varId, len(varId), data_logic, val)
-
+      LOGICAL  ,INTENT(OUT)                         :: data_logic
+      LOGICAL (C_BOOL)                              :: data_tmp
+
+      CALL cxios_get_variable_data_logic(varId, len(varId), data_tmp, val)
       xios(getVar_logic) = val
+      IF (val) data_logic = data_tmp
    END FUNCTION xios(getVar_logic)
 
    LOGICAL FUNCTION xios(getVar_char)(varId, data_char)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL  (kind = C_BOOL)                      :: val
       CHARACTER(len  = *)              , INTENT(IN) :: varId
       CHARACTER(len  = *)              , INTENT(OUT):: data_char
@@ -1395,6 +1401,7 @@
    ! Set variable functions
    LOGICAL FUNCTION xios(setVar_k8)(varId, data_k8)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL  (kind = C_BOOL)                      :: val
       CHARACTER(len = *)               , INTENT(IN) :: varId
       REAL     (kind = 8)              , INTENT(IN) :: data_k8
@@ -1406,6 +1413,7 @@
 
    LOGICAL FUNCTION xios(setVar_k4)(varId, data_k4)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL  (kind = C_BOOL)                      :: val
       CHARACTER(len = *)               , INTENT(IN) :: varId
       REAL     (kind = 4)              , INTENT(IN) :: data_k4
@@ -1417,6 +1425,7 @@
 
    LOGICAL FUNCTION xios(setVar_int)(varId, data_int)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL  (kind = C_BOOL)                           :: val
       CHARACTER(len = *)               , INTENT(IN) :: varId
       INTEGER                          , INTENT(IN) :: data_int
@@ -1428,10 +1437,13 @@
 
    LOGICAL FUNCTION xios(setVar_logic)(varId, data_logic)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL(kind = C_BOOL)                        :: val
       CHARACTER(len  = *)              , INTENT(IN) :: varId
-      LOGICAL  (kind = 4)              , INTENT(IN) :: data_logic
-
-      CALL cxios_set_variable_data_logic(varId, len(varId), data_logic, val)
+      LOGICAL                          , INTENT(IN) :: data_logic
+      LOGICAL  (kind = C_BOOL)                      :: data_tmp
+
+      data_tmp = data_logic
+      CALL cxios_set_variable_data_logic(varId, len(varId), data_tmp, val)
 
       xios(setVar_logic) = val
@@ -1439,6 +1451,7 @@
 
    LOGICAL FUNCTION xios(setVar_char)(varId, data_char)
-   IMPLICIT NONE
-      LOGICAL  (kind = 1)                           :: val
+   USE ISO_C_BINDING
+   IMPLICIT NONE
+      LOGICAL  (kind = C_BOOL)                      :: val
       CHARACTER(len  = *)              , INTENT(IN) :: varId
       CHARACTER(len  = *)              , INTENT(IN) :: data_char
