      subroutine openf
      IMPLICIT REAL*8(A-H,O-X,Z),logical*1(y)
      character*10000 namel
      common/pr/nprint
      character*80 prefix,info,info1,file,mono,mono1
      character*80 blan40
      namelist /smufil/ prefix,info,info1,mono,mono1
      open(75,file='BID75')
      nprint=0
      blan40='                                        '
     *//'                                        '
      prefix=blan40
      mono='Mono      '
      mono1=blan40
      info='Info      '
      info1=blan40
      call LECNAM('&SMUFIL ',namel,93,ierr,1)
      if(ierr.eq.1) then
         print*,'namelist SMUFIL non trouvee'
         stop
      endif
      call namela(namel,prefix,'PREFIX')
      call namela(namel,INFO,'INFO')
      call namela(namel,INFO1,'INFO1')
      call namela(namel,MONO,'MONO')
      call namela(namel,MONO1,'MONO1')
      write(75,smufil)
      call scrinam('NAMELIST SMUFIL ')
      write(6,*)' '
      write(6,*)'==========================='
      write(6,*)'openf   ouverture des files'
      write(6,*)'==========================='
c      write(75,smufil)
c
c--   ouverture des files
c
      file=info1
      if(file.eq.blan40) call colle(prefix,'Info',file,long)
      open(2,file=file,status='old',form='formatted')
      file=mono1
      if(file.eq.blan40) call colle(prefix,'Mono',file,long)
      open(3,file=file,status='old',form='unformatted')
      return
      end
       subroutine colle(a,b,c,ic)
      character*1 a*(*),b*(*),c*(*)
      la=len(a)
      lb=len(b)
      lc=len(c)
      do i=1,lc
         c(i:i)=' '
      enddo
      ic=0
      do ia=1,la
         if(a(ia:ia).ne.' ') then
            ic=ic+1
            if(ic.gt.lc) then
               print*,'impossible de coller a et b. c pas assez long'
               print*,a
               print*,b
               stop
            endif
            c(ic:ic)=a(ia:ia)
         endif
      enddo
      do ib=1,lb
         if(b(ib:ib).ne.' ') then
            ic=ic+1
            if(ic.gt.lc) then
               print*,'impossible de coller a et b. c pas assez long'
               print*,a
               print*,b
               stop
            endif
            c(ic:ic)=b(ib:ib)
         endif
      enddo
      return
      end
