C----------------------------------------------------------------------
	SUBROUTINE READNBS(dname,nfil,STATUS)
C----------------------------------------------------------------------
C Read in file in NBS format
C
C----------------------------------------------------------------------
	LOGICAL status
	INTEGER nfil
	character*(*) dname

	include 'shared$common'
	include '[-.shared]flabel.common'
C
	INTEGER ln

	Character*80 card1,card2
	LOGICAL exist

	STATUS = .false.

C   First, Does the file exist?
	INQUIRE(FILE=dname,EXIST=exist,NAME=cfilnam(nfil),
	1	defaultfile='.nbs')
	IF (.not. exist) RETURN

	OPEN(UNIT=IN,FILE=cfilnam(nfil),TYPE='OLD',ERR=111,
	1	defaultfile='.nbs',FORM='FORMATTED',readonly,shared)

C  Read first two cards
	read (in,'(a)',err=111) card1,card2
	IF (card2(4:4) .ne. '/' .or. card2(7:7) .ne. '/') goto 111
	rewind(unit=IN)

C----------------------------------------------------------------------
C----------------------------------------------------------------------
C NBS format
	read (IN,'(a)',err=111) ATITLE(nfil)
	read (IN,16,err=111) DATE(1,nfil),DATE(2,nfil),DATE(3,nfil),
	1	INST(nfil),SOURCE(nfil),IRAD(nfil),WAVE(nfil),npnt
	2	,START(nfil),DELTA(nfil),FINISH(nfil)
16	FORMAT(1x,I2,1x,I2,1x,I2,5x,A2,1x,A2,5x,A2,5x,F8.5,/,
	1	1x,I5,3F10.3)
	WKA1(nfil) = WAVE(nfil)
	WKA2(nfil) = WAVE(nfil)
	MONO(nfil)= .true.
	READ (IN,'(10F8.2)',err=111) (B(i,nfil),I=1,npnt)
	DO i=1,npnt
	  besd(i,nfil) = sqrt(B(i,nfil))
	  bx(i,nfil) = START(nfil) + (I-1.)*DELTA(nfil)
	ENDDO
	NPOINT(nfil)=npnt
	FXTYP(nfil) = 1
	FYTYP(nfil) = 1
	STATUS = .true.
	ln = lench(cfilnam(nfil))
	write (LO,'(A)') ' File '//cfilnam(nfil)(:ln)
	1		//' read in NBS format'
111	close(unit=IN)
	RETURN
	END
