      subroutine praxis(did,iclust,idim,istart,iend,v,d,ipower,icharg,  PRAX001
     &                   iat,charge,foc)                                PRAX002
c ----------------------------------------------------------------------PRAX003
c     This program module is part of the author's X-ray Library         PRAX004
c     and may not be sold or reproduced for commercial purposes.        PRAX005
c     Although it has been tested carefully, there is no warranty       PRAX006
c     regarding accuracy or freedom from side-effects.                  PRAX007
c                   (C) 1986-1994 Bernhard Rupp                         PRAX008
c ----------------------------------------------------------------------PRAX009
c     PRAXIS performa a principal axis transformation to determine the  PRAX010
c     symmetry of the centre site                                       PRAX011
c ----------------------------------------------------------------------PRAX012
                                                                        PRAX013
      real a(3,3),d(3),v(3,3),did(iclust,idim), charge(iat),foc(iat)    PRAX014
      integer n,ns                                                      PRAX015
      n=3                                                               PRAX016
      ns=3                                                              PRAX017
                                                                        PRAX018
c --- initialize a --                                                   PRAX019
      do 0001 i=1,3                                                     PRAX020
         do 0002 j=1,3                                                  PRAX021
            a(i,j)=0                                                    PRAX022
 0002    continue                                                       PRAX023
 0001 continue                                                          PRAX024
                                                                        PRAX025
c --- subtract centre coords, fill matrics mij for each atom, add in aijPRAX026
c                                                                       PRAX027
c          ishell                                                       PRAX028
c       aij=SUM(mij(n)/r(n)**2)                                         PRAX029
c           n=1                                                         PRAX030
c ----------------------------------------------------------------------PRAX031
                                                                        PRAX032
      do 0003 k=istart,iend                                             PRAX033
         id=int(did(k,5))                                               PRAX034
         if (icharg.eq.0) then                                          PRAX035
             chg=1.0*foc(id)                                            PRAX036
         elseif (icharg.eq.1) then                                      PRAX037
             chg=charge(id)*foc(id)                                     PRAX038
         else                                                           PRAX039
             chg=charge(id)*foc(id)                                     PRAX040
             chg=chg**icharg                                            PRAX041
         end if                                                         PRAX042
         rsqr=did(k,4)**ipower                                          PRAX043
         rsqr=rsqr/chg                                                  PRAX044
         do 0004 i=1,3                                                  PRAX045
            do 0005 j=1,3                                               PRAX046
            a(i,j)=a(i,j)+                                              PRAX047
     &       (did(k,5+j)-did(1,5+j))*(did(k,5+i)-did(1,5+i))/rsqr       PRAX048
 0005       continue                                                    PRAX049
 0004    continue                                                       PRAX050
 0003 continue                                                          PRAX051
                                                                        PRAX052
      n=3                                                               PRAX053
      ns=3                                                              PRAX054
      call jacobi(a,n,ns,d,v,nrot)                                      PRAX055
                                                                        PRAX056
 0081 continue                                                          PRAX057
      return                                                            PRAX058
      end                                                               PRAX059
