Get an unused unit number for I/O.
FIXME: remove and replace with newunit
in open
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(out) | :: | unit |
A new unit not associated with an open file |
subroutine get_unused_unit (unit)
implicit none
!> A new unit not associated with an open file
integer, intent (out) :: unit
logical :: od
unit = 50
do
inquire (unit=unit, opened=od)
if (.not.od) return
unit = unit + 1
end do
end subroutine get_unused_unit