      subroutine getcut
      include 'parmtr.inc'
      include 'screen.inc'
      real cut(maxcel),temp
      integer*2 ncut,numpts,iset,icut,irowt,icolt
      logical yesno
      external yesno
      call cls
c
c   get number of cut point sets to read in
c
      irow=5
      icol=10
 10   line='Number of cut point sets to be used is: '
      call scrlin
      call getbuf(line,nchar,10,iatt)
      ncut=0
      if (nchar.eq.0 .or. line.eq.' ') go to 11
      read(unit=line,fmt='(f10.0)',err=11) temp
      ncut=int(temp)
 11   if (ncut.lt.1 .or. ncut.gt.5) then
         call scroll(1,0,irow,49,irow,80,7,ierror)
         irow=irow+1
         line=
     1      'Number of cut point sets must be 1 < ncut < 5.  Re-enter.'
         call scrlin
         irow=irow-1
         go to 10
      endif
      write(iout,'(i2)') ncut
c   loop over the number of sets of cutpoints
      do 15 iset=1,ncut
c
c   get number of cut points to read in
c     call cls
      irow=10
      icol=10
 16   write(line,'(a,i2,a)')
     1   'Number of cut points to be used in set ',iset,' is: '
      call scrlin
      call getbuf(line,nchar,10,iatt)
      numpts=0
      if (nchar.eq.0 .or. line(1:10).eq.' ') go to 17
      read(unit=line,fmt='(f10.0)',err=17) temp
      numpts=int(temp)
 17   if (numpts.lt.1 .or. numpts.gt.maxcel) then
         call scroll(1,0,irow,49,irow,80,7,ierror)
         write(line,'(a,a)') 'Number of cut points must be',
     1   ' 1 < numpts < 20.  Re-enter.'
         irow=irow+1
         call scrlin
         irow=irow-1
         go to 16
      endif
c
c   put heading at top of table to read in lines
c
      call cls
      icol=10
      irow=1
      write(line,'(a,5x,a,5x,a)') 'Cut Point Set',
     1    'Cut Point Number','Cut Point Value'
      call scrlin
      irow=2
      write(line,'(13a1,5x,16a1,5x,15a1)') ('-',i=1,44)
      call scrlin
c   loop to read in a set of cutpoints
      do 20 i=1,numpts
         icut=i
         irow=irow+1
c   enter cut point set and cut point number in table
         call putcur(irow,5,ivpage,ierror)
         write(line,'(11x,i1,17x,i2)') iset,i
         call wchars(ivpage,line,32,icolor,ibckgd,0,ierror)
 23      write(line,'(a,a,i2,a)') 'Enter cut point value',
     1      ' for cut point number ',icut,': '
         icolt=index(line,':')+1
         call putcur(24,5,ivpage,ierror)
         call wchars(ivpage,line,icolt,icolor,ibckgd,0,ierror)
         call getbuf(line,nchar,10,iatt)
         temp=0.
         if (nchar.eq.0) go to 28
         read(line,'(f10.0)',err=28) temp
 28      if (temp.le.0) then
            call putcur(25,5,ivpage,ierror)
            call wchars(ivpage,'Incorrect input, re-enter.',26,
     1         icolor,ibckgd,0,ierror)
            go to 23
         else
            call scroll(1,0,24,1,25,80,7,ierror)
            cut(icut)=temp
            call putcur(irow,49,ivpage,ierror)
            write(line,'(f10.2)') temp
            call wchars(ivpage,line,10,icolor,ibckgd,0,ierror)
         endif
c
c   section to request changes in table when entries are in place
c
         if (i.eq.numpts) then
            call scroll(1,1,23,1,25,80,7,ierror)
            irow=23
            icol=5
            line=
     1      'Everything above OK, and ready to proceed to next page?'
            if (yesno(0)) then
               call scroll(1,0,3,1,25,80,7,ierror)
            else
 26            call scroll(1,0,23,45,23,80,7,ierror)
               call putcur(23,5,ivpage,ierror)
               line='Which cut point above should be changed: '
               call wchars(ivpage,line,40,icolor,ibckgd,0,ierror)
               call getbuf(line,nchar,3,iatt)
               icut=0
               read(line,'(i3)',err=27) icut
 27            if (icut.gt.0 .and. icut.le.numpts) then
                  irow=icut+2
                  go to 23
               else
                  call scroll(1,0,23,29,23,80,7,ierror)
                  call putcur(24,5,ivpage,ierror)
                  call wchars(ivpage,'Improper input. Re-enter.',30,
     1               icolor,ibckgd,0,ierror)
                  go to 26
               endif
            endif
         endif
 20      continue
      write(unit=iout,fmt='(7(f10.2,:1h,),:t80,1h$)')
     1   (cut(i),i=1,numpts)
 15   continue
      return
      end
