  subroutine getfilnm(nopr,iout,fil,indir,filnm)

! *************************
  integer :: i,jfound
  character(len=30) :: fil
  character(len=100) :: filnm
  character(len=60) :: indir
  character(len=1) :: chr
  character(len=1) :: blnk

! *************************
   blnk=' '
  do i=1,100
   filnm(i:i)=blnk
  end do

  do i=1,60
   filnm(i:i)=indir(i:i)
  end do

! *************************
  jfound=-99
  do i=60,1,-1
    chr=indir(i:i)
   if (chr .ne. blnk) then 
    jfound=i
    go to 1000
   end if
  end do
  1000 i=1

   j=jfound
  do i=1,30 
   chr=fil(i:i)
   j=j+1
   filnm(j:j)=chr
  end do

! *************************
  if (nopr .eq. 1) then 
   write(iout,fmt=100) indir
   100 format(/,2x,"getfilnm: indir ",/,2x,a60)
   write(iout,fmt=110) filnm
   110 format(2x,"getfilnm: filnm ",/,2x,a100)
  endif

! *************************
  return
  end
