      module mod_dolo
c     integer,parameter :: len_lolist=1000
      integer,parameter :: len_lolist=5000
c     integer,parameter :: dim_lolist=1000
      integer,parameter :: dim_lolist=5000
c     integer,parameter :: len_datlist=10000
      integer,parameter :: len_datlist=50000
c     integer,parameter :: dim_datlist=1000
      integer,parameter :: dim_datlist=5000
c     integer,parameter :: len_file_name=500
      integer,parameter :: len_file_name=1500
      integer,parameter :: maxsym=8
      character(80) prefix
      character(len_file_name) workdir,scforb,dat0(dim_datlist),currdir
     *,dat1(dim_datlist)
      character(len_lolist),allocatable :: glabel(:)
      character(10),allocatable :: orig(:),ftype(:)
      character(10) :: origtmp=' ',ftypetmp=' '
      character(len_datlist) datlist(dim_datlist)
      character(len_datlist) datlist0(dim_datlist)
      character(1) reponse
      character(80) :: form_dolo
      character(80) :: form_dolo1
      character(80) :: form_dolo0
      character(80) :: form_dolo10
      integer :: norb,ncor=0,idatlist=0,ideb_datlist=0,ifin_datlist=0
     *,nbdat0=0,jdatlist,idatlist0=0,nbbasref=0
      integer fermi0(maxsym),iunit5,ifilpr
      logical(1),allocatable :: yvirt(:)
      double precision,dimension(:,:),allocatable :: gamma
      logical :: yes,dataok,occupok,wdataok=.true.,nointerac=.false.
      logical :: loc_actives=.true.,ygcas
      integer :: gap=2 !: factor. The tables for the norb orbitals are
!                         allocated to norb*gap, because more than norb
!                         orbitals can be stored during the calculation
      character(20) in_progress
! idolo
      logical interactive
! orientation
      character(4) orient
! Work space
      logical,dimension(:),allocatable :: ywk,ywk2
      integer,dimension(:),allocatable :: iwk,iwk2
! Storage
      double precision,dimension(:,:),allocatable :: flo,work2
      double precision,dimension(:),allocatable :: focc
      integer,dimension(:),allocatable :: fmult_a,fmult_o
      integer,dimension(:),allocatable :: fsym,fdat0,fdat1
      logical,dimension(:),allocatable :: fly
      character(18),dimension(:),allocatable :: flab
      integer,dimension(maxsym) :: fnoc,fnac,fnal
      dimension ninacs(maxsym),noacts(maxsym),nvirts(maxsym)
      integer fnorb
      character(4),allocatable :: focvir(:)
      character(8),allocatable :: fsigpi(:)
! Atoms of a LO
c     integer,parameter :: max_atoms_in_LO=100
      integer,parameter :: max_atoms_in_LO=150
      integer fnat_tmp
      integer,allocatable :: fnat(:)
      character(4) :: atoms_in_LO_tmp(max_atoms_in_LO)
      character(4),allocatable :: atoms_in_LO(:,:)
! Inclusion smuc
         integer,save :: nl,ninac,noac
         integer,save,allocatable,dimension(:) :: numina,numac
         real(8),allocatable,dimension(:,:) :: coor
         character(8) orbi!,base
         dimension nbas(:),nbast(:),atom(:),orbi(:)!,base(:)
         character(4) atom
         allocatable nbas,nbast,atom,orbi!,base
         save orbi,nbas,nbast,atom,natom!,base
         integer nbast,nbas,natom,noacs(8)
         integer,save,allocatable,dimension(:) :: itype
         integer,save :: ntyp
         double precision,save,allocatable,dimension(:) :: occ
         character(3) sym1(7)
         allocatable mult1(:)
         integer,save :: msym,natom1
         logical,save :: ysym=.false.,ycallsymetrie=.false.,
     *   ydatoto=.false.
         
         logical ychol
         logical yopm
      end module
