	SUBROUTINE ADRPLT(BANG,DPI,DY,IPP,XAL,YAL,YOFS,YLAM)
C
C **	ROUTINE TO PLOT d-VALUES ON TOP OF THE PEAKS
C
	DIMENSION THE(150),RINT(150)
C
	BYTE NFILE(15),IOVER
C
	PI=4.*ATAN(1.)
	WRITE(7,1000)
1000	FORMAT(//,'$DO YOU WANT TO OVERLAY AN ADR PATTERN',
     +	' (Y OR N):')
	READ(5,1010) IOVER
1010	FORMAT(A1)
	IF(IOVER.NE.1HY) GO TO 999
	WRITE(7,1020)
1020	FORMAT(/,'$FULL NAME OF THE ADR OR SRC FILE:')
	READ(5,1030) NFILE
1030	FORMAT(15A1)
	CALL RDADR(NFILE,THE,RINT,NPTS)
	IF(NPTS.EQ.0) GO TO 999
	WRITE(7,1040)
1040	FORMAT(/,X,'	OPTION 1: JUST DRAW STICKS',/,X,
     +	'	OPTION 2: JUST WRITE d-VALUES',/,X,
     +	'	OPTION 3: DRAW STICKS AND WRITE d-VALUES',/,
     +	/,'$		OPTION > ')
	READ(5,1050) IDEC
1050	FORMAT(I1)
C
	EANG=BANG+DPI*XAL*IPP
C
C **	OPTION TO DRAW STICKS
C
	IF(IDEC.EQ.2) GO TO 30
	DO 20 I=1,NPTS
	IF(THE(I).LT.BANG.OR.THE(I).GT.EANG) GO TO 20
	YINI=0.0
	XP=(THE(I)-BANG)/DPI
	YP=RINT(I)/DY
	IF(IPP.EQ.1) GO TO 10
	IF(XP.LT.XAL) GO TO 10
	XP=XP-XAL
	YP=YP-YOFS
	YINI=-YOFS
10	CALL PLOT(XP,YINI,3)
	CALL PLOT(XP,YP,2)
20	CONTINUE
C
C **	STICKS ARE DRAWN
C
	IF(IDEC.EQ.1) GO TO 999
C
C **	WRITE d-VALUES ON TOP OF THE PEAKS
C
30	DO 50 I=1,NPTS
	IF(THE(I).LT.BANG.OR.THE(I).GT.EANG) GO TO 50
	XP=(THE(I)-BANG)/DPI
	YP=RINT(I)/DY
	YDEC=0.
	IF(IPP.EQ.1) GO TO 40
	IF(XP.LT.XAL) GO TO 40
	XP=XP-XAL
	YP=YP-YOFS
	YDEC=YOFS
C
C **	DECIDE WHETHER TO GO AHEAD ON TOP OF THE PEAK OR ON THE SIDE
C
40	DVAL=THE(I)*PI/180.
	DVAL=YLAM/(2.*SIN(DVAL))
	YPP=YP+.1
	IF((YP+1.).GT.YAL) YPP=YAL-1.-YDEC
	IF((YP+1.).GT.YAL) XP=XP+.2
	CALL NUMBER(XP,YPP,.8,DVAL,90.,4)
50	CONTINUE
999	RETURN
	END
