subroutine lectures
!
!Lecture des donnees et allocations
!
Use lewis_module !module des variables
implicit real*8 (a-h,o-x,z),logical*1(y)
logical lex
yw=.false.
call titre('lewis  lewis  lewis  lewis  lewis  lewis#',60)
namel=' '
symm_sew=' '
icoeur=0
ivalence=0
mprint=0
ychol=.false.
worb=.true.
currdir=' '
call lecnam('&LEWIS ',namel,5,ierr,1) !5 correspond ici à xx
call liprefix(prefix)
call namela(namel,prefix,'PREFIX')
call namela(namel,symm_sew,'SYMM')
call namela(namel,CURRDIR,'CURRDIR')
if(currdir==' ') then
   call system('echo $CurrDir > RENAME_BID')
   call open_chose_number(ifil,'RENAME_BID','old', &
   'formatted')
   read(ifil,'(a)') currdir
   close(ifil,status='delete')
endif
call nameli(namel,NPRINT,'NPRINT',4)
call nameli(namel,MPRINT,'MPRINT',4)
call nameli(namel,FERMI0,'FERMI0',4)
call namell(namel,YCHOL,'YCHOL',4)
call namell(namel,WORB,'WORB',4)
yw=(yw.or.nprint==5).and..not.nprint==-5
call maj(symm_sew,24)
scforbin=' '
call namela(namel,scforbin,'SCFORBIN')
call nameli(namel,REF_INAC,'REF_INAC',4)
call nameli(namel,REF_ACT,'REF_ACT',4)
call nameli(namel,NELAC,'NELAC',4)

if(worb)call open_chose_number(ifil_orb,trim(currdir)//'/WORB',&
'unknown','formatted')
print*,'=================================================='
print*,'Project: ',trim(PREFIX)
inquire(file=trim(prefix)//'Info',EXIST=lex)
if(.not.lex) then
   print*,'Lewis a voulu ouvrir le fichier'
   print*,trim(trim(prefix)//'Info')
   print*,'mais ne l''a pas trouve'
   stop
endif
open(1,file=trim(prefix)//'Info',status='old',form='formatted') !
call lecnam('&COST_AO ',namel,1,ierr,0)
close(1)
if(symm_sew==' ') then
   call namela(namel,symm_sew,'SYMM')
   print*,'SYMM lu dans &COST_AO : ',trim(symm_sew)
else
   print*,'SYMM lu dans &LEWIS : ',trim(symm_sew)
endif
call nameli(namel,NORB,'NORB',4)
allocate(ytest(norb))
call nameli(namel,NSYM,'NSYM',4)
call nameli(namel,ISYM,'ISYM',4)
call nameld(namel,ENUC,'ENUC',8)
print'(a,8i4)',' Isym',isym(1:nsym)
isymt(1:nsym+1)=0
do k=2,nsym+1
   isymt(k)=isym(k-1)+isymt(k-1)
enddo
if(symm_sew==' '.and.nsym>1) stop'nsym>1 et SYMM=='' '''
call maj(symm_sew,80)
print'(2a)',' SYMM= ',trim(symm_sew)
print*,'=================================================='
print'(a)',' '
call nameli(namel,NATOM,'NATOM',4)
allocate(atom(NATOM))
allocate(atom0(NATOM))
atom=' '
call namela(namel,atom0,'ATOM')
do k=1,natom
   atom(k)(1:4)=atom0(k)
enddo
print'(a,i4,a,i4,a)', 'Nous disposons de ',NATOM,' atomes avec ',NORB,' orbitales'
!
allocate(COORD(3,NATOM))
call nameld(namel,COORD,'COOR',8)
!
!Lecture des labels
!
allocate(label(NORB))
allocate(label0(NORB))
label=' '
call namela(namel,label0,'LABEL') !namel comprend tout le fichier
      !call incrementer_couches(label0,norb)
Do i=1,norb
   label(i)(1:8)=label0(i)
   call maj(label(i),8) !maj ecrit tout en majuscule
end do
end
