      subroutine openf
      use mod_dolo
      IMPLICIT REAL*8(A-H,O-X,Z),logical*1(y)
      character*1280 namel
      common/pr/nprint
      character*80 info,info1,file,mono,mono1
      character*80 blan40
      namelist /smufil/ prefix,info,info1,mono,mono1
!
!-------------------------------------------------------------------
! Open work files
!-------------------------------------------------------------------
!
      open(75,file=trim(workdir)//'BID75')
      open(76,file=trim(workdir)//'BID76')
      open(77,file=trim(workdir)//'BID77')
      open(89,file=trim(workdir)//'DOLO_WARNINGS')
      close(89,status='delete')
      open(89,file=trim(workdir)//'DOLO_WARNINGS')
!
!-------------------------------------------------------------------
! read DOLOIN namelists
!-------------------------------------------------------------------
!
      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.' ') file=trim(prefix)//'Info'
      file=trim(workdir)//trim(file)
      open(2,file=file,status='old',form='formatted')
      file=mono1
      if(file.eq.' ') file=trim(prefix)//'Mono'
      file=trim(workdir)//trim(file)
      open(3,file=file,status='old',form='unformatted')
      return
      end
