    	SUBROUTINE IFBARS( XOP, YOP, BARL, BARH, BARW, ANGLE )
C
C  PROGRAMMER: R.S. ZHOU		FEB-1986
C
C  	THIS ROUTINE DRAWS A BAR/BOX.
C
C	XOP ------- CENTER OF BAR IN INCHES (X).
C	YOP ------- CENTER OF BAR IN INCHES (Y).
C	BARL ------ BAR LENGTH IN INCHES IN X-AXIS.
C	BARH ------ BAR HEIGHT IN INCHES IN Y-AXIS.
C	BARW ------ BAR BORDER WIDTH IN INCHES.
C	ANGLE ----- ROTATION ANGLE OF BAR IN DEGREES.
C
     	INCLUDE 'TEKLIB.CBS'

     	IF( ABS(BARL).LT.0.02 .OR. ABS(BARH).LT.0.02 ) RETURN
     	IWD = IDW
     	IF( ITM.EQ.1 ) GOTO 888
C
C  INITIALIZE...
C
     	IDW = 0
     	XPS = XOP
     	YPS = YOP
     	RD1 = 0.5*ABS(BARL)
     	RD2 = 0.5*ABS(BARH)
     	WID = ABS(BARW)
     	IF( WID.GE.RD1 .OR. WID.GE.RD2 ) WID = 0.0
     	ANG = AMOD( ANGLE, 360.0 )
C
C  MOVE ORIGIN TO (XPS,YPS) ...
C
     	CALL IFPLOT( XPS, YPS, -9 )
C
C  SET ROTATION IF AT ALL...
C
     	IF( ANG.NE.0.0 ) THEN
     	    ANGX = XANG
     	    ANGY = YANG
     	    CALL IFROTA( ANG+XANG, ANG+YANG )
     	ENDIF
C
C  START THE DRAWING...
C
111	CALL IFPLOT( -RD1, -RD2, 3 )
     	CALL IFPLOT( -RD1,  RD2, 2 )
     	CALL IFPLOT(  RD1,  RD2, 2 )
     	CALL IFPLOT(  RD1, -RD2, 2 )
     	CALL IFPLOT( -RD1, -RD2, 2 )
     	IF( WID.EQ.0.0 ) GOTO 222
     	RD1 = RD1 - WID
     	RD2 = RD2 - WID
     	WID = 0.0
     	GOTO 111
C
C  RESTORE...
C
222	IF( ANG.NE.0.0 ) CALL IFROTA( ANGX, ANGY )
     	CALL IFPLOT( -XOP, -YOP, -9 )

888	IF( IWD.NE.0 ) THEN
     	    IF( NPPS.GT.0 ) CALL IFPLOT_DUMP
     	    WRITE(IDF,1000) BARL,BARH,BARW, XOP,YOP,ANGLE
     	ENDIF
1000	FORMAT('BARS:',6F8.3)

     	IDW = IWD

999	RETURN
    	END
