        subroutine XBAR(X,HGT,WIDTH,MAXY,AREA,NOTE,NOTE1)
      include 'UNITS.INC'
        integer X,HGT,WIDTH,MAXY,X2,Y2,Y1,FLAG,NOTE
        integer MAXW,IW,I,J,IOFF,K
        character*1 NOTE1,TOP(15),NONE(15)
        character AREA(21)*61, TEMP3*3, TEMP1*1
        data MAXW/15/
        data NONE /'N','o','n','e',' ','N','o','n','e',' ',
     &  'N','o','n','e',' '/
      IW = WIDTH
      if (IW.gt.MAXW) then
         write (TTYOUT(MACHNO),5000) IW,MAXW
5000  format (//' Dimension of "TOP" in "XBAR" has been exceeded'/' Valu
     &e is: ',I5,', maximum is: ',I5)
         IW = MAXW
      endif
      X2 = X+IW-1
      if (NOTE1.ne.'A'.and.NOTE.eq.0) go to 170
      Y1 = MAXY
      if (HGT.eq.0) go to 120
      do 110 I = 1, HGT
         Y1 = MAXY-I+1
         AREA(Y1)(X:X) = NOTE1
         AREA(Y1)(X2:X2) = NOTE1
         do 100 J = X+1, X2-1
            AREA(Y1)(J:J) = '|'
100      continue
110   continue
120   continue
      do 130 I = 1, IW
         TOP(I) = NOTE1
130   continue
      FLAG = 0
      if (NOTE1.eq.'A'.and.NOTE.eq.0) FLAG = 1
      if (FLAG.eq.1) go to 150
      IOFF = (IW-3)/2
      write (TEMP3,5010) NOTE
5010  format (I3)
      do 140 I = 1, 3
         if (TEMP3(I:I).eq.' ') TEMP3(I:I) = '0'
         IOFF = IOFF+1
         TOP(IOFF) = TEMP3(I:I)
140   continue
150   continue
      Y2 = MAXY
      K = 0
      do 160 I = X, X2
         if (FLAG.eq.1) then
            TEMP1 = NOTE1
         else
            K = K+1
            TEMP1 = TOP(K)
         endif
         AREA(Y1)(I:I) = NOTE1
         AREA(Y2)(I:I) = TEMP1
160   continue
      return
170   continue
      J = 0
      do 180 I = X, X2
         J = J+1
         AREA(Y2)(I:I) = NONE(J)
180   continue
      return
      end
