      subroutine displayflo
      use mod_dolo
      if(yes) print*,'entree displayflo'
      nwk=0
      do k=1,norb
         if(dot_product(flo(:,k),flo(:,k))>1.d-6) then
            nwk=nwk+1
            iwk(nwk)=k
         endif
      enddo
      call scripto6(flo(:,iwk(1:nwk)),norb,nwk,norb,nwk,orbi,6,
     *focvir(iwk(1:nwk)),flab(iwk(1:nwk)),focc(iwk(1:nwk))
     *,fsym(iwk(1:nwk)),fdat1(iwk(1:nwk)),iwk(1:nwk))
      call rfa1(nwk)
      if(yes) print*,'sortie displayflo'
      return
      end
       subroutine displaydata(rep)
      use mod_dolo
      character(*) rep
      if(yes) print*,'entree displadata'
      rep(1:2)=' '
      rep=adjustl(rep)
      l=len_trim(rep)
       print*,trim(rep)
      read(rep,*) idat
       print*,'idat',idat
      nwk=0
      do k=1,norb
         if(fdat1(k)==idat) then
            nwk=nwk+1
            iwk(nwk)=k
         endif
      enddo
      call scripto6(flo(:,iwk(1:nwk)),norb,nwk,norb,nwk,orbi,6,
     *focvir(iwk(1:nwk)),flab(iwk(1:nwk)),focc(iwk(1:nwk))
     *,fsym(iwk(1:nwk)),fdat1(iwk(1:nwk)),iwk(1:nwk))
      if(yes) print*,'sortie displaydata'
      return
      end
       subroutine displaydetails(rep)
!
!-----------------------------------------------------------
! Display details of the generation of an LO starting from
! a basic data
! Input value of rep is 'LD n', where n is an integer (rank
! of the corresponding basic data)
!-----------------------------------------------------------
!
      use mod_dolo
      character(*) rep
      character(300) aa
      logical yw
      yw=.false.
      if(yes) print*,'entree displadetails'
      print*,' '
      print*,'*******************'
      print*,'    Details        '
      print*,'*******************'
      rep(1:2)=' '
      rep=adjustl(rep)
      read(rep,*) irep
      l=len_trim(rep)
      if(datlist(irep)(1:4)=='SUBS'.or.
     *datlist(irep)(1:3)=='REN'.or.
     *datlist(irep)(1:2)=='CD'.or.
     *(datlist(irep)(1:1)=='C'.and.datlist(irep)(2:2)=='_'))
     *then
         print*,trim(datlist(irep))//': No details for this data'
         return
      endif
      if(datlist(irep)(1:1)==' ') then
         print*,'LD '//trim(rep)//': Data does not exist'
         return
      endif
      open(ifilpr,status='old',file='basicD_'//trim(rep),err=3)
      goto 2
 3    continue
      print*,' '
      print*,'File basicD_'//trim(rep),' does not exist'
      return
 2    continue
 
      do
         read(ifilpr,'(a300)',end=1) aa
         print*,trim(aa)
      enddo
 1    continue
      print*,
     *'*===========================================================*'
      close(ifilpr)
      return
      end
       subroutine canceldata(rep)
      use mod_dolo
      character(*) rep
      logical yw
      yw=.false.
      if(yes) print*,'entree canceldata'
      idatlist0=idatlist0+1
      datlist0(idatlist0)=trim(rep)
      idatlist=idatlist+1
      datlist(idatlist)=rep
      rep(1:2)=' '
       if(yw)print*,'rep',trim(rep)
      read(rep,*,end=1) n
      do k=1,norb
         if(fdat1(k)==n) print'(a,i4,2x,a)','cancel LO',k,flab(k)
      enddo
      if(iunit5==5) then
         print*,'OK? Y/N'
         read(5,'(a)') reponse
         call fnormaligo(reponse,1)
      else
         reponse='Y'
      endif
      if(reponse=='Y') then
         call flodeld(n)
         print*,'LO''s cancelled'
         if(yes) print*,'sortie canceldata'
         return
      else if(reponse=='N') then
         dataOK=.false.
         idatlist0=idatlist0-1
         if(yes) print*,'sortie canceldata'
         return
      else
         print*,'wrong data'
         dataOK=.false.
         idatlist0=idatlist0-1
         if(yes) print*,'sortie canceldata'
         return
      endif
 1    continue
      print*,'wrong data'
      dataOK=.false.
      idatlist0=idatlist0-1
      if(yes) print*,'sortie canceldata'
      return
      end
       subroutine cancello(rep)
      use mod_dolo
      character(*) rep
      logical yw
      idatlist0=idatlist0+1
      datlist0(idatlist0)=trim(rep)
      idatlist=idatlist+1
      datlist(idatlist)=rep
      rep(1:1)=' '
      l=len_trim(rep)
      if(l==0) goto 2
      call fnormaligo(rep,l)
      n=1
      do k=1,l
         if(rep(k:k)==' ') n=n+1
      enddo
      ! list of deleted LO's
      read(rep,*,err=2) iwk(1:n)
      if(iunit5==5) then
         ! sure ?
         do k=1,n
            print'(a,i4,2x,a)','cancel LO',iwk(k),
     *      trim(flab(iwk(k)))
         enddo
         print*,'OK? Y/N'
         read(5,'(a)') reponse
         call maj(reponse,1)
      else
         reponse='Y'
      endif
      if(reponse=='Y') then
      ! delete !
         call reor(n,iwk)
         do k=n,1,-1
            call flodel(iwk(k))
         enddo
         print*,'LO''s cancelled'
      else if(reponse=='N') then
         dataOK=.false.
         idatlist0=idatlist0-1
         return
      else
         print*,'wrong data'
         dataOK=.false.
         idatlist0=idatlist0-1
         return
      endif
      return
 2    continue
      print*,'wrong data'
      dataOK=.false.
      idatlist0=idatlist0-1
      return
      end
       subroutine displaywarnings(OK)
      use mod_dolo
      character(1000) aa
      character(80) aa1
      logical OK
      rewind 89
      nw=0
      OK=.true.
      do
         read(89,'(a1000)',end=1) aa
         nw=nw+1
         if(nw==1) print'(/,20x,a,/)','*******LIST OF WARNINGS********'
         print*,trim(aa)
      enddo
 1    continue
      if(nw/=0) then
         OK=.false.
         if(.not.interactive) OK=.true.
         if(iunit5==5.and.interactive) then
            do
               print*,' '
               print*,'"I" to ignore warnings'
               print*,'"LD n" to diplay details of dat n'
               print*,'"X" to go back to generation of LO''s'
               read(5,'(a80)') aa1
               l=len_trim(aa1)
               call fnormaligo(aa1,l)
               if(aa1(1:2)=='LD') then
                  call displaydetails(aa1)
                  cycle
               endif
               if(aa1=='I') OK=.true.
               exit
            enddo
         endif
      endif
      return
      end
 
 
