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

      subroutine ckreal(label,xx,nn,valmin,valmax,kill) 12
c
c purpose:   issue an error message for an incorrectly specified
c            input parameter.
c input:
c   label    variable name
c   xx       real input parameter
c   nn       the absolute value of nn is the number of values in xx
c   valmin   lower limit of valid values
c   valmax   upper limit of valid values
c            
c            if nn is positive an error condition occurs if xx is
c            outside the range (valmin,valmax) (endpoints excluded).
c
c            if nn is negative an error condition occurs if xx is
c            inside the range [valmin,valmax] (endpoints included).
c output:
c   kill     set to one if error condition is detected.
c
      character*(*) label
      dimension xx(*)
      integer kill,nn,n
      n=abs(nn)
      do i=1,n
        if(nn.gt.0.eqv.(xx(i).lt.valmin.or.xx(i).gt.valmax)) then
          if(kill.eq.0) write(*,'(x,a)') 'Check INPUT: '
          write(*,'(     &                   'valmin',valmin,'valmax',valmax
          kill=1
        endif
      enddo
      return
      end