Check, if a unit is open, and close it
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer | :: | me |
the restart type to close |
subroutine tem_unit_close(me) ! -------------------------------------------------------------------- ! !> the restart type to close integer :: me ! -------------------------------------------------------------------- ! logical :: nUnitOpened ! -------------------------------------------------------------------- ! ! Check, if any open units have to be closed if ( me >= 0 ) then ! unit has be to be >= 0 inquire(unit=me, opened=nUnitOpened) if (nUnitOpened) then close( me ) end if end if end subroutine tem_unit_close