      subroutine coord (value, limits, eval, ok)

      character*(*) value
      character*2 limits

      character*1 symbol
      logical ok

      lenval = len(value)
      kase = 2
      if (limits .eq. 'SN') kase = 1
      symbol = value(lenval:lenval)
      call shiftup (symbol)
      ix = index(limits, symbol)
      if (ix .ne. 0) lenval = lenval - 1
      ok = lenval .gt. 0
      if (ok) then
        eval = rech(value(:lenval), ier, ip)
        ok = ier .eq. lenval
        if (ok) then
          if (ix .eq. 1) eval = -eval
          ok = abs(eval) .le. kase * 90.
        end if
      end if
      return
      end
