diff --git a/flib/Makefile b/flib/Makefile index b7e53fcfe..4d9d8de27 100644 --- a/flib/Makefile +++ b/flib/Makefile @@ -8,6 +8,7 @@ atomic_number.o \ capital.o \ dost.o \ erf.o \ +flush_unit.o \ functionals.o \ lsda_functionals.o \ more_functionals.o \ diff --git a/flib/flush_unit.f90 b/flib/flush_unit.f90 new file mode 100644 index 000000000..58dff8708 --- /dev/null +++ b/flib/flush_unit.f90 @@ -0,0 +1,26 @@ +! +! 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