subroutine inspect(line,lc,l0,l,k0)
implicit none
character*(*) line,lc
integer l0,l,k0
character c
integer i,ic,l1,l2
c
c this subroutine locates the non-blank portion of line and
c returns it in line(1:l) (embedded blanks remain)
c line(l+1:) cleared
c
l1 = len(line)
l2 = len(lc)
if(l1 .gt. l2) l1 = l2
l0 = 0
k0 = 0
l = 1
do i = 1, l1
c = line(i:i)
if (c .ne. ' ') then
ic = ichar(c) + 32
if(c .ge. 'A' .and. c .le. 'Z') c = char(ic)
if(l0 .eq. 0) l0 = i
if(k0 .eq. 0) k0 = -1
l = i
else if(k0 .lt. 0) then
k0 = l
endif
lc(i:i) = c
enddo
if (l2.gt.l1) lc(l1+1:l2) = ' '
if(l0 .eq. 0) l0 = 1
if(k0 .lt. 1) k0 = l
return
end