      subroutine timset (value, lenval, limmo, timlim)

      character*(*) value, timlim(2)
      integer limmo(2)
      integer*2 lenval

      character*6 chival0
      character*80 mesage

      timlim(1) = chival0(limmo(1))//'01000000'
      timlim(2) = chival0(limmo(2))//'AAAAAAAA'
      if (lenval .ne. 0) then
        ix = index(value(:lenval), '-')
        if (ix .eq. 0) then
          call timsub (value(:lenval), timlim, 1)
          call timsub (value(:lenval), timlim, 2)
        else if (lenval .ne. 1) then
          if (ix .eq. 1) then
            call timsub (value(2:lenval), timlim, 2)
          else
            call timsub (value(:ix-1), timlim, 1)
            if (ix .ne. lenval) call timsub (value(ix+1:lenval),
     2                         timlim, 2)
          end if
        else
          lenmes = 0
          call append ('Time range unsuitable: ', mesage, lenmes)
          call append (value, mesage, lenmes)
          call abort (mesage(:lenmes))
        end if
      end if
      if (timlim(1) .gt. timlim(2)) then
        call append ('End earlier than start time: ', mesage, lenmes)
        call append (timlim(1), mesage, lenmes)
        call append ('-', mesage, lenmes)
        call append (timlim(2), mesage, lenmes)
        call abort (mesage(:lenmes))
      end if
      return
      end
