quantum-espresso/flib/flush_unit.f90

27 lines
747 B
Fortran

!
! Copyright (C) 2005 PWSCF-FPMD-CPV groups
! This file is distributed under the terms of the
! GNU General Public License. See the file `License'
! in the root directory of the present distribution,
! or http://www.gnu.org/copyleft/gpl.txt .
!
#include "f_defs.h"
!
!----------------------------------------------------------------------------
SUBROUTINE flush_unit( unit_tobeflushed )
!----------------------------------------------------------------------------
!
! ... this is a wrapper to the standard flush routine
!
INTEGER, INTENT(IN) :: unit_tobeflushed
LOGICAL :: opnd
!
!
INQUIRE( UNIT = unit_tobeflushed, OPENED = opnd )
!
IF ( opnd ) CALL flush( unit_tobeflushed )
!
RETURN
!
END SUBROUTINE