c---------------------------------------------------------------------  
      subroutine openfi
      character*20 prefix,ijkl,ijom,ona                        
      character*90 ijkl1,blan40,ijom1,ona1
      character*20 sci_densa,sci_densb,sci_densc,sci_densd
      character*20 sci_dense,sci_densf,sci_densg,sci_densh
      character*90 sci_densa1,sci_densb1,sci_densc1,sci_densd1
      character*90 sci_dense1,sci_densf1,sci_densg1,sci_densh1
      character*20 molcas_in,molcas_out
      character*90 molcas_in1,molcas_out1
      namelist/natfil/prefix,ijkl,ijkl1,ona,ona1,  
     *               sci_densa,sci_densb,sci_densc,sci_densd,
     *               sci_densa1,sci_densb1,sci_densc1,sci_densd1,
     *               sci_dense,sci_densf,sci_densg,sci_densh,
     *               sci_dense1,sci_densf1,sci_densg1,sci_densh1,
     *               molcas_in,molcas_out,
     *               molcas_in1,molcas_out1
      blan40=' '                                                        
      ijkl1=blan40                                                      
      ona1=blan40
      ijom1=blan40
      sci_densa1=blan40
      sci_densb1=blan40
      sci_densc1=blan40
      sci_densd1=blan40
      sci_dense1=blan40
      sci_densf1=blan40
      sci_densg1=blan40
      sci_densh1=blan40
      molcas_in1=blan40
      molcas_out1=blan40
      molcas_in='INPORB    '
      molcas_out='NATUORB  '
      molcas_in1='INPORB    '
      molcas_out1='NATUORB  '
      sci_densa='sci_densa    '
      sci_densb='sci_densb    '
      sci_densc='sci_densc    '
      sci_densd='sci_densd    '
      sci_dense='sci_dense    '
      sci_densf='sci_densf    '
      sci_densg='sci_densg    '
      sci_densh='sci_densh    '
      ijom=  'ijom      '
      ona=   'vecnat    '
      ijkl=  'ijkl      '                                              
      prefix= '          '                                              
      read(5,natfil)                                                  
cpc      call nomfil(40,ijkl,ijkl1,prefix,    'old       ',1)             
cpc      call nomfil(62,sci_densa,sci_densa1,prefix,'unknown   ',1)
cpc      call nomfil(63,sci_densb,sci_densb1,prefix,'unknown   ',1)
cpc      call nomfil(64,sci_densc,sci_densc1,prefix,'unknown   ',1)
cpc      call nomfil(65,sci_densd,sci_densd1,prefix,'unknown   ',1)
cpc      call nomfil(11,ijom,ijom1,prefix    ,'unknown   ',1)
cpc      call nomfil(9,molcas_in,molcas_in1,prefix,'unknown   ',0)
cpc      call nomfil(8,molcas_out,molcas_out1,prefix,'unknown   ',0)
cpc      call nomfil(14,ona,ona1,prefix    ,'unknown   ',1)
      return                                                            
      end                                                               
c---------------------------------------------------------------------  
       subroutine openf
        include 'dens.prm'
      IMPLICIT REAL*8(A-H,O-X,Z),logical*1(y)
      character*10 prefix,info,ijom,naom
      character*90 info1,ijom1,naom1,blan40,
     *densa,densb,densc,densd,
     *dense,densf,densg,densh,
     *densa1,densb1,densc1,densd1,
     *dense1,densf1,densg1,densh1
     *,molcas_in,molcas_in1
     *,molcas_out,molcas_out1
      common/info0/nsym
      common/info2/ywrn,ywrm,ywrll,ymolcas
      common/info3/const,coef(nmatz)
      common/info1/seuil,noc,norb,nao,nsyme,itsym(norbz)
      common/mxdat/nmat,metat(nmatz),
     *               nmdps(nmatz),ywr
      common/gell/ngel(nsymz),ndel(nsymz)
c     namelist /ij/nsym,norb,noc,ydp,itsym,its,enuc,ycl
     *,bdveca,bdvecb,bdvecc,bdvecd,bdvece
     *,detcla,detclb,detclc,detcld,detcle
      namelist/natfil/prefix,ona,ona1,  
     *               densa,densb,densc,densd,
     *               densa1,densb1,densc1,densd1,
     *               dense,densf,densg,densh,
     *               dense1,densf1,densg1,densh1,
     *               molcas_in,molcas_out,
     *               molcas_in1,molcas_out1
c     namelist/mixdat/coef,const,nmat,metat,nsym,nmdps,ywr,ywrm,
c    *               ywrn,ywrll,nao
      namelist/mixdat/nsym,metat,coef,ymolcas,ngel,ndel,ywrm,ywrn,seuil
      write(6,*)'======================'
      write(6,*)'openf   noms des files'
      write(6,*)'======================'
      blan40=' '
      info1=blan40
      naom1=blan40
      ijom1=blan40
      Info='Info      '
      naom='naom      '
      ijom='ijom      '
      densa1=blan40
      densb1=blan40
      densc1=blan40
      densd1=blan40
      dense1=blan40
      densf1=blan40
      densg1=blan40
      densh1=blan40
      densa='densa     '
      densb='densb     '
      densc='densc     '
      densd='densd     '
      dense='dense     '
      densf='densf     '
      densg='densg     '
      densh='densh     '
      molcas_in1=blan40
      molcas_out1=blan40
      molcas_in='INPORB    '
      molcas_out='NATUORB  '
      molcas_in1='INPORB    '
      molcas_out1='NATUORB  '
      nsym=1
      read(5,natfil)
      write(6,natfil)
        write(6,mixdat)
        read(5,mixdat)
        write(6,mixdat)
      write(6,*)' '
      write(6,*)'==========================='
      write(6,*)'openf   ouverture des files'
      write(6,*)'==========================='
      call nomfil(40,info,info1,prefix,'old       ','FORMATTED  ')
cpc      call nomfil(11,ijom,ijom1,prefix,'old       ','UNFORMATTED')
      call nomfil(14,naom,naom1,prefix,'unknown   ','UNFORMATTED')
      call nomfil(62,densa,densa1,prefix,'unknown   ','UNFORMATTED')
      call nomfil(63,densb,densb1,prefix,'unknown   ','UNFORMATTED')
      call nomfil(64,densc,densc1,prefix,'unknown   ','UNFORMATTED')
      call nomfil(65,densd,densd1,prefix,'unknown   ','UNFORMATTED')
      call nomfil(66,dense,dense1,prefix,'unknown   ','UNFORMATTED')
      call nomfil(67,densf,densf1,prefix,'unknown   ','UNFORMATTED')
      call nomfil(68,densg,densg1,prefix,'unknown   ','UNFORMATTED')
      call nomfil(69,densh,densh1,prefix,'unknown   ','UNFORMATTED')
      call nomfil(8,molcas_out,molcas_out1,prefix,
     *'unknown   ','FORMATTED  ')
      call nomfil(9,molcas_in,molcas_in1,prefix,
     *'unknown   ','FORMATTED  ')
      write(6,*)'==========================='
      return
      end

