use, intrinsic :: iso_c_binding logical(kind=C_BOOL) :: L integer :: Q c_sizeof(L) == 1 c_sizeof(Q) == 4 ! typically
while C uses:
#include <stdbool.h> bool L; sizeof(L) == 1 # typically
So as usual, use iso_c_binding when using C or C++ with Fortran modules to produce cross-platform compatible projects.
See standard/logical_kind Fortran and C examples.