! -----------------------------------------------------------------------------
! RETURN TO THE CALLER A CURRENTLY UNUSED LOGICAL UNIT NUMBER TO BE USED AS THE
! LUN PARAMETER IN A FORTRAN "OPEN" STATEMENT. THE SEARCH FOR A LUN IS BEGUN
! WITH LOGICAL UNIT NUMBER 50.
!

	SUBROUTINE GETALUN

	1	( LUN )	!I*4	OUTPUT	CURRENTLY UNUSED LOGICAL UNIT NUMBER

!
! WRITTEN BY MIKE LATSHAW    ***   MARCH 4, 1982
! -----------------------------------------------------------------------------


	LOGICAL*1 IN_USE


	LUN = 49

	DO WHILE (.TRUE.)

	   LUN = LUN + 1

	   INQUIRE (UNIT=LUN, OPENED=IN_USE)

	   IF (.NOT. IN_USE) RETURN

	   END DO

	END
