subroutine nbo_lbl_split(str,lblstr,unstr)

  !  split string of form <units>; <label>

  implicit none

  character*(*), intent(in) :: str  ! combined string
  character*(*), intent(out) :: lblstr    ! output label string
  character*(*), intent(out) :: unstr     ! output units string

  integer :: isemi,istart,ic,ilen

  ilen = len(trim(str))
  isemi = index(str,';')

  if(isemi.le.0) then
     unstr = ' '
     lblstr = str(1:ilen)

  else if(isemi.eq.1) then
     unstr = ' '
     lblstr = str(2:ilen)

  else

     unstr = str(1:isemi-1)

     istart=0
     do ic=isemi+1,ilen
        if((str(ic:ic).ne.' ').and.(str(ic:ic).ne.char(9))) then
           istart=ic
           exit
        endif
     enddo

     if(istart.eq.0) then
        lblstr=' '
     else
        lblstr=str(istart:ilen)
     endif

  endif

end subroutine nbo_lbl_split
