C.begin.doc ************************** begin.doc
C
C
C .c ;Module name: 
C .c ;^&GETSRC\&
C .NF	
C .x GETSRC>Defined
C Source:GETSRC.FTN
C Designer           :H.BARTA
C Author             :H.BARTA, E. LAKIA
C Date of last update:22-APR-85
C Revision level     :1.0
C 	
C .C ;Formal Parameter List
C Receives:
C   DIRFIL         LOGICAL NAME  File name containing a directory
c				 of files to scan and extract
c                                filenames out of.  Must be defined
c                                via DCL.     
C Returns:
C   
C   SRCFIL           CHAR*80    File name (i.e. DR10:[277,310]SUCKER.FTN )
C                               that is next to be scanned.
C   
C   EOFF             LOGICAL*1  Validity of file name just returned. If no more
C                               file names exist, EOFF is returned as .TRUE.
 	
C Accesses common(s):
C 	
C Accesses file(s):
C 	
C 	
C Other modules referenced:
C 	
C .SK
C .fill
C .SK
C Description:
C .sk    
C 	This module will open the file name passed to it on it's first pass
C and return the filename. The input file is assumed to be .SRD output. The
C device and  UIC will be added to the file name and the version will be
C left off. Consecutive duplicate file names (different versions) will be skipped.
C When no more file names are in the input file, EOFF is returned as  .TRUE.
C.end.doc ****************************** end.doc
C
C
          SUBROUTINE GETSRC ( FNAME, EOFF )
C
	CHARACTER	FNAME*80	! file name to be returned
c
	LOGICAL*1	EOFF,		!end of file indicator
	1		FILOPN		!file already open indicator
c
c
	DATA FILOPN / .FALSE. /
C

C
C GET THE DIRECTORY FILE NAME
C
	IF(.NOT.FILOPN) THEN
C
C  open directory file
C  NOTE:  DIRFIL must be assigned via the DCL
c         command  such as:   
C		DEFINE DIRFIL MODULE.DRR
C
		OPEN(	UNIT=1,
	1		TYPE = 'OLD',
	2		NAME='DIRFIL',
	3		ACCESS='SEQUENTIAL'	 	)
C
		FILOPN = .TRUE.
	ENDIF
C
c
 1	READ ( 1, 100, END=99 )FNAME
 100	FORMAT( A80 )
	EOFF = .FALSE.
	RETURN
C
C  arrive here when directiory file is exhausted
C
 99	EOFF = .TRUE.
	RETURN
	END
