c======================================================================

      subroutine ckint(label,kk,nn,minval,maxval,kill) 13
c
c purpose:   issue an error message for an incorrectly specified
c            input parameter.
c input:
c   label    variable name
c   kk       integer input parameter
c   nn       the absolute value of nn is the number of values in kk
c   minval   lower limit of valid values
c   maxval   upper limit of valid values
c            
c            if nn is positive an error condition occurs if kk is
c            outside the range (minval,maxval).
c
c            if nn is negative an error condition occurs if kk is
c            inside the range [minval,maxval].
c output:
c   kill     set to one if error condition is detected.

      character*(*) label
      dimension kk(*)
      integer kill,nn,n
      n=abs(nn)
      do i=1,nn
        if(nn.gt.0.eqv.(kk(i).lt.minval.or.kk(i).gt.maxval)) then
          if(kill.eq.0) write(*,'(x,a)') 'Check INPUT: '
          write(*,'(     &                   'minval',minval,'maxval',maxval
          kill=1
        endif
      enddo
      return
      end