      subroutine acpdf(AA)
      use mod_dolo
      implicit real(8) (a-h,o-x,z),logical(1)(y)
      character(len_datlist) AA,orb1
      character(3) form
      yw=.false.
      if(yes)print*,'entree acpdf   '
      long=len_trim(AA)
c
c-----------------------------------------------------
c     traitement des accolades "{ }"
c-----------------------------------------------------
c
      yecr=.false.
      if(index(AA(1:long),'{').ne.0) then
         call acol(AA,long)
      endif
c
c-----------------------------------------------------
c     traitement des donnees multiples pour p,d,f...
c     dans les donnees oao
c-----------------------------------------------------
c
      ii=index(AA,'2P(')
      do while (ii/=0)
         jj=index(AA(ii+3:long),')')-1
         form='i'
         !print*,'jj',jj
         if(jj<10) then
            write(form(2:2),'(i1)') jj
         else if(jj<100) then
            write(form(2:3),'(i2)') jj
         else
            print*,'Cannot transform 2P in '
            print*,trim(aa)
            stop
         endif
         form=' '
         form=AA(ii+3:ii+3+jj-1)
         call repl(aa,'2P('//trim(form)//')',
     *   '2PX('//trim(form)//') 2PY('//
     *   trim(form)//') 2PZ('//trim(form)//')',yrepl)
         long=len_trim(AA)
         ii=index(AA,'2P(')
      enddo
      ii=index(AA,'3D(')
      do while (ii/=0)
         jj=index(AA(ii+3:long),')')-1
         form='i'
         !print*,'jj',jj
         if(jj<10) then
            write(form(2:2),'(i1)') jj
         else if(jj<100) then
            write(form(2:3),'(i2)') jj
         else
            print*,'Cannot transform 3D in '
            print*,trim(aa)
            stop
         endif
         form=' '
         form=AA(ii+3:ii+3+jj-1)
         call repl(aa,'3D('//trim(form)//')',
     *   '3D0('//trim(form)//
     *   ') 3D1+('//trim(form)//
     *   ') 3D1-('//trim(form)//
     *   ') 3D2+('//trim(form)//
     *   ') 3D2-('//trim(form)//')',yrepl)
         long=len_trim(AA)
         ii=index(AA,'3D(')
      enddo
      l=len_trim(AA)
      call fnormaligo(AA,l)
      if(yes)print*,'sortie acpdf   '
      return
      end
