program main implicit none integer :: un logical :: is_opened un = 11 inquire(un, opened=is_opened) print*, is_opened end program main