- Rearranged directory structure for forking out ANSTO
- Refactored site specific stuff into a site module - PSI specific stuff is now in the PSI directory. - The old version has been tagged with pre-ansto
This commit is contained in:
43
tecs/sys_lun.f
Executable file
43
tecs/sys_lun.f
Executable file
@@ -0,0 +1,43 @@
|
||||
!!-----------------------------------------------------------------------------
|
||||
!!
|
||||
subroutine SYS_GET_LUN(LUN) !!
|
||||
!!
|
||||
!! allocate logical unit number
|
||||
!!
|
||||
integer LUN !! out
|
||||
|
||||
logical*1 act(50:100)/51*.false./
|
||||
common /sys_lun/act
|
||||
|
||||
integer l
|
||||
|
||||
l=50
|
||||
do while (l .lt. 99 .and. act(l))
|
||||
l=l+1
|
||||
enddo
|
||||
if (l .eq. 100) stop 'SYS_GET_LUN: no more luns available'
|
||||
lun=l
|
||||
act(l)=.true.
|
||||
end
|
||||
|
||||
|
||||
!!-----------------------------------------------------------------------------
|
||||
!!
|
||||
subroutine SYS_FREE_LUN(LUN) !!
|
||||
!!
|
||||
!! deallocate logical unit number
|
||||
!!
|
||||
integer LUN !! in
|
||||
|
||||
logical*1 act(50:100)/51*.false./
|
||||
common /sys_lun/act
|
||||
|
||||
if (lun .lt. 50 .or. lun .gt. 99) then
|
||||
stop 'SYS_FREE_LUN: illegal lun'
|
||||
endif
|
||||
if (act(lun)) then
|
||||
act(lun)=.false.
|
||||
else
|
||||
stop 'SYS_FREE_LUN: lun already free'
|
||||
endif
|
||||
end
|
||||
Reference in New Issue
Block a user