da_get_unit.inc
References to this file elsewhere.
1 subroutine da_get_unit(unit)
2
3 !-----------------------------------------------------------------------
4 ! Purpose: TBD
5 !-----------------------------------------------------------------------
6
7 implicit none
8
9 integer, intent(out) :: unit
10
11 integer i
12
13 unit = -1
14
15 do i = unit_start, unit_end
16 if (.NOT. unit_used(i)) then
17 unit=i
18 unit_used(i) = .true.
19 exit
20 end if
21 end do
22
23 if (unit == -1) then
24 call da_error(__FILE__,__LINE__,(/"No free units"/))
25 end if
26
27 end subroutine da_get_unit
28
29