c ZBAR
c
c To make a vertical color-bar scale for program ZOCZC.
c
c  Lin Cordell 21 December 1993
c
      character*50 ofile
      dimension id(14),pgm(2),g(2000)
1     format(' *',$)
800   format(a)
      print*,'Enter output grid file name:'
      print 1
      read(5,800)ofile
      print*,'Enter ncol,nrow:'
      print 1
      read*,ncol,nrow
      print*,'Enter min,max:'
      print 1
      read*,fmin,fmax
      range=fmax-fmin
      rnrow=nrow-1
      df=range/rnrow
      x0=0.
      y0=0.
      dx=1.
      dy=1.
      nz=1
      open(10,file=ofile,form='unformatted',status='new')
      print*,'Enter id:'
      print 1
      read(5,4)(id(i),i=1,14)
4     format(14a4)
      pgm(1)='zbar'
      pgm(2)='    '
      write(10)id,pgm,ncol,nrow,nz,x0,dx,y0,dy
      do 401 j=1,nrow
      y=j-1
      c=fmin+y*df
      do 400 i=1,ncol
      g(i)=c
400   continue
      call rowio(g,y,1,ncol,10,2)
401   continue
      stop
      end
      subroutine rowio(a,y,nz,ncol,ld,key)
      dimension a(nz,ncol)
      go to (1,2),key
1     read(ld) y,a
      go to 90
2     write(ld)y,a
90    return
      end
