      subroutine getrot (limmo, root, lenrot)

      integer limmo (2)
      character*(*) root
      integer* 2 lenrot

c get root directory for data

      character*80 mesage
      character*7 defalt/'/cdrom/'/
      character*1 seprate/'/'/

      include 'basics.inc'

      if (lenrot .le. 2) then
        if (lenrot .eq. 0) root = defalt
        lenrot = len_trim(root)
        call dirnam ('Root data directory', defalt//seprate,
     2                 root, lenrot)
      end if
      do while (limmo(1) .eq. 0)
        call limons (root(:lenrot), limmo)
        if (limmo(1) .eq. 0) then
          lenmes = 0
          call append ('No ', mesage, lenmes)
          call append (root(:lenrot), mesage, lenmes)
          call append ('year'//seprate//'yearmo.FFB files found',
     2                mesage, lenmes)
          print *, mesage(:lenmes)
          lenrot = 0
        end if
        call dirnam ('Root data directory', defalt,
     2     root, lenrot)
      end do
      return
      end
