      subroutine timsub (value, timlim, no)

      character*(*) value, timlim(2)

      logical cdigit
      character*80 mesage

      lenval = len(value)
      if (lenval .lt. 4 .or. lenval .gt. 14
     2           .or. mod(lenval,2) .ne. 0 .or.
     2         .not.cdigit(value)) then
        lenmes = 0
        call append ('Time value format problem in ', mesage, lenmes)
        call append (value, mesage, lenmes)
        call abort (mesage(:lenmes))
      end if
      if (lenval .gt. 4) then
        nyear = itchk(value(1:4))
        month = itchk(value(5:6))
        if (month .lt. 1 .or. month .gt. 12) then
          lenmes = 0
          call append ('Month number inappropriate in ', mesage, lenmes)
          call append (value, mesage, lenmes)
          call abort (mesage(:lenmes))
        end if
        if (lenval .gt. 6) then
          iday = itchk(value(7:8))
          if (iday .lt. 1 .or. iday .gt. moday(nyear,month)) then
            lenmes = 0
            call append ('Day number inappropriate in ', mesage, lenmes)
            call append (value, mesage, lenmes)
            call abort (mesage(:lenmes))
          end if
          if (lenval .gt. 8) then
            ihr = itchk(value(9:10))
            if (ihr .gt. 23) then
              lenmes = 0
              call append ('Hour inappropriate in ', mesage, lenmes)
              call append (value, mesage, lenmes)
              call abort (mesage(:lenmes))
            end if
            if (lenval .gt. 10) then
              imin = itchk(value(11:12))
              if (imin .gt. 59) then
                lenmes = 0
                call append ('Minutes inappropriate in ',
     2                              mesage, lenmes)
                call append (value, mesage, lenmes)
                call abort (mesage(:lenmes))
              end if
            end if
          end if
        end if
      end if
      if (no .eq. 1) then
        if (value .lt. timlim(no)(:lenval)) then
        
           lenmes = 0
           call append (value, mesage, lenmes)
           call append (' is earlier than ', mesage, lenmes)
           call append (timlim(no)(:lenval), mesage, lenmes)
           print '(1x,a)', mesage(:lenmes)
           print '(1x)'
          
c July 16th 2003 Peter - abort/core replaced by write/stop

c          call abort ('Time period requested precedes available data')

        print '(1x,a/)','Time period requested precedes available data'

        stop
           
        else
          timlim(no)(:lenval) = value
        end if
      else
        if (value .gt. timlim(no)(:lenval)) then
          lenmes = 0
          call append (value, mesage, lenmes)
          call append (' is later than ', mesage, lenmes)
          call append (timlim(no)(:lenval), mesage, lenmes)
          print '(1x,a)', mesage(:lenmes)
          print '(1x)'
          
c July 16th 2003 Peter - abort/core replaced by write/stop

c          call abort ('Time period requested exceeds available data')

        print '(1x,a/)' ,'Time period requested exceeds available data'
        stop
            
        else
        
          if ( lenval .eq. 4 ) then
          
            if ( timlim(2)(1:4) .gt. value ) then
          
                timlim(no)(5:6) = '12'
                
            end if
              
          end if

          timlim(no)(:lenval) = value
          
        end if
      end if
      return
      end
