c c pa60 - polyatom properties program for s,p,d and f-orbitals c c 250 basis functions allowed c c input modified according to the karlsruhe version of pitzer's c scf-program by c.m.ehrhardt c for this purpose the subroutines inpsym,getran,scfinp and comtrn c are taken from h.f. scfaefer's gradient-program c c the subroutines rhftce,propa and prod were made faster (4.3.1984) c c the program was modified to handle f-functions by p.maier and c c.m.ehrhardt ( 1.3.1984 ) c c mulliken and roby population analysis included ( 12.7.1984 ) c c modified to calculate the kinetic energy and its relativistic c correction by s. brode in april,1984 : a subroutine opap4 was c added and the main program and the subroutines dintfm, pint, c propa and prnt were slightly modified c c boys localization included by r.ahlrichs and h.schiffer c (1.3.1985) c c ft02,ft04,ft07,ft09 scratch files c ft22 localized mos for plopr c ft21 electrostatic potential c ft23 file for plot c c input description: c c input files: c ft24 integral information from the karlsruhe integral input c program c ft08 eigenvectors and occupation as written out by subroutine c outgrd of scf-program c ft05 input unit c ft28 optional file for atomic coordinates (compatible to ints) c c input on unit ft05: c c 1. title (format 12a6) c c 2. isl1 , isl2 , isl4 , nsupp (format 4i5) c isl1 = 1 full property calculation (default) c isl1 = 2 property only in ao-basis c isl2 = 1 no output of property matrix in ao-basis(default) c isl2 = 2 output of these integrals c isl2 = 3 output, and integrals are written on unit 3 c isl4 = 1 renormalisation of wavefunctions and output c isl4 = 2 no renormalisation c isl4 = all other values renormalisation but no output c (default) c nsupp= 1 output of diagonalelements of property matrix c in mo-basis c nsupp= 2 controll-output of integral and scf input data c nsupp= 3 output of mo vectors in ao basis c nsupp= 4 output of overlap population per mo c nsupp= 0 no output (default=0) c c 3. m, ilnmc, icntr, (c(k),k=1,3) (format i5,6x,a4,i5,3f10.5) c step 3 can be repeated several times c population analysis or localization must always be the c last option c m specifies the property : c potential(1), electric field(2), field gradient(3), c dipole moment(4), quadrupole moment(5), third moment(6), c planar density(7), linear density(8), charge density(9), c overlap(10), second moment(11), diamagnetic shielding(12), c relativistic correction(13), mulliken and roby population c analysis(14), boys localization(15), plot(16) c c ilnmc name of the point at which property shall be c calculated c icntr number of atom at which property shall be c calculated, if icntr.ne.0 you need not read in c coordinates c c(k) cartesian coordiantes of the point c c 4. special input for population analysis (m=14) c c nmao, (mor(im),im=1,nmao) (format i10, 20 i3) c nmao number of maos for atom 1,2...,n c mor numbers of selected maos c mor(1)= 0 automatic selection c nm, (iatnr(i),i=1,nm) (format 20i3) c nm.ne.0 special multicenter term of order nm c iatnr(i) atoms that form the multicenter term c (a blank line is required if nm=0) c c 5. special input for localization (m=15) c nmo (format 5x,i5) c nmo = -1 all occupied mo's shall be localized c nmo = 0 now the program wants to read a threshold c for the selection of mo's, wich shall be c localized c nmo = nmo number of mo's, wich shall be localized c now the program wants to read the corresponding c mo numbers in ascending order c either thr (5x,f10.4) for nmo = 0 c or mon(i),i=1,nmo (5x,(5i5)) for nmo > 0 c nop (5x,i5) c nop = 0 no further input needed for localization c nop = nop number of operators ( 1,2 or 3 ) c now the program wants to read the corresponding c operator numbers ( x=1, y=2, z=3 ) in canonical c order c opn(i),i=1,nop (5x,3i5) for nop > 0 c c c important dimensions c c number of atoms: nocmx = 50 c number of primitive basis functions : nbmx = 720 c number of contracted basis functions c and number of mos : nomx = 250 c dimension of buff : lbuff = nomx*(nomx+1)/2 c dimensions in common /big/ : maxuv = nomx**2 c max number of orbitals to be local. : mloc = 250 c (in common eig and scfinf) c dimension of rnabcd : n*(n-3)/2+m c with: n=nocmx*(nocmx-3)/2+nocmx-1 c m=(nocmx-2)*(nocmx-5)/2+nocmx-3 c max number of grids for 'x' direction: nmaxx = 50 c max number of grids for 'y' direction: nmaxy = 50 c max number of orbitals to be ploted : norbmx = 10 c implicit real*8(a-h,o-z) parameter(nocmx=50,nbmx=720,nomx=250,lbuff=31375,nrabcd=748379) parameter(nmaxx=50,nmaxy=50,norbmx=10,icomx=12) real*8 icod(12),ilab(12),ilbl(12) dimension eta(nbmx,25),fcntr(nbmx), 1 ftype(nbmx),frocc(nomx),c(3),dint(3,10), 2 type(20),val(10),tot(10),nstart(nomx),nstop(nomx), 3 ncontc(nomx),buff(lbuff),a(39),title(150), 4 cint(nomx,10),izahl(nbmx),itrnao(nbmx),idxxt(nbmx), 5 rnabcd(nrabcd),contrc(nomx,icomx) dimension nocc(norbmx),cc(nmaxx*nmaxy,3), 1 dd(nmaxx*nmaxy,3),dinx(nmaxx*nmaxy), 2 cin(nmaxx*nmaxy,norbmx+1), 3 v(nmaxx*nmaxy),ddsq(nmaxx*nmaxy) equivalence (buff(nocmx+1),rnabcd(1)) external opaa0,opaa1,opaa2,opab1,opab2,opab3,opac1,opac2, opac3, 1opad1,opab4,opaa3,opap4 external potnuc,fldnuc,grdnuc,dipnuc,qudnuc,octnuc,nonuc,magnuc, 1sldnuc integer centr,fcntr,ftype,type common/ioind/isl1, isl2 common/muli/vlist(nocmx,4),ianr(nomx),centr(nocmx),itnr(nomx) common/holl/blabel(19),alabel(19),fmt(4),jl,lomao,iopen,nsym common/supp/nsupp common/ncnt/ilnmcm common/prptyp/m common /contrc/ chomo,ncont common /big/ y(nomx*nomx),su(nomx*nomx),p(nomx,nomx) c data nromx/3/,nfcol/25/,ntcol/20/,iwarn/0/,ir/8/ data icod/6h1pa60 ,6h ,6h ,6hnyu pr,6hoperti,6hes pac, 1 6hkage ,6h ,6h ,6h ,6h12/66 ,6hspdf / data title/6h 1/r,6h ex,6h fxx,6h x,6h qxx,6h oxxx, 1 6h dx,6h dxy,6h den,6h ovl,6h xx,6h fx*x*,6h qx*x*, 2 6h x*x*,6h
, 6h ,6h ey,6h fyy, 3 6h y,6h qyy,6h oyyy,6h dy,6h dxz,6h ,6h , 4 6h yy,6h fy*y*,6h qy*y*,6h y*y*,6h
,
5 6h ,6h ez,6h fzz,6h z,6h qzz,6h ozzz,6h dz,
6 6h dyz,6h ,6h ,6h zz,6h fz*z*,6h qz*z*,6h z*z*,
7 6h sum , 6h ,6h ,6h fxy,6h ,
8 6h qxy,6h oxxy,6h ,6h ,6h ,6h ,6h xy,
9 6h fx*y*,6h qx*y*,6h x*y*,6h , 6h ,
1 6h ,6h fxz,6h ,6h qxz,6h oxxz,6h ,6h ,
2 6h ,6h ,6h xz,6h fx*z*,6h qx*z*,6h x*z*,6h ,
3 6h ,6h ,6h fyz,6h ,6h qyz,
4 6h oxyy,6h ,6h ,6h ,6h ,6h yz,6h fy*z*,
5 6h qy*z*,6h y*z*,6h ,
6 4*6h ,6h rsq,6h oyyz,9*6h ,
7 5*6h ,6h oxzz,9*6h ,
8 5*6h ,6h oyzz,9*6h ,
9 5*6h ,6h oxyz,9*6h /
data a/6hpotent,6helectr,6hfield ,6hdipole,6hquadru,6hthird ,
1 6hplanar,6hline d,6hcharge,6hoverla,6hsecond,6hdiamag,
& 6hrelati,
2 6hial ,6hic fie,6hgradie,6h momen,6hpole m,6hmoment,
3 6h densi,6hensity,6h densi,6hp ,6h momen,6hnetic ,
& 6hvistic,
4 6h ,6hld ,6hnt ,6ht ,6homent ,6h ,
5 6hty ,6h ,6hty ,6h ,6ht ,6hshldg ,
& 6h corr./
data type/4hs ,4hx ,4hy ,4hz ,4hxx ,4hyy ,4hzz ,
1 4hxy ,4hxz ,4hyz ,4hxxx ,4hyyy ,4hzzz ,4hxxy ,4hxxz ,
2 4hyyx ,4hyyz ,4hzzx ,4hzzy ,4hxyz /
c
c** call xuflow(0)
c file shout short output
open(unit=5,file='propin')
open(6,file='propls')
nshout=13
open(unit=nshout,file='shout',status='unknown'
&,access='sequential',form='formatted')
rewind nshout
c file vectgrd scf vectors
c ir=8
open(unit=ir,file='vectgrd',status='old',
1access='sequential',form='formatted')
c file plot: plot output
iplot=23
open(unit=iplot,file='plot',status='unknown',form='formatted')
rewind iplot
c
maxuv=nomx*nomx
lomao=22
76 do 20 i=1,12
20 ilab(i) = icod(i)
do 22 i=1,nomx
22 frocc(i) = 0.0d0
read(5,101,end=999) (ilbl(i), i=1,12)
write(6,101) (ilab(i), i=1,12)
write(6,103)
write(6,104) (ilbl(i), i=1,12)
read(5,100) isl1,isl2,isl4,nsupp
if(isl1.eq.0) isl1=1
if(isl2.eq.0) isl2=1
if(isl4.eq.0) isl4=3
if(isl2.eq.3) rewind 3
call input(eta,nfcol,fcntr,ftype,n,nbmx,vlist,centr,non,nocmx,
1 ntcol,type,ilab,ilbl,nomx,nstart,
2 nstop,contrc,ncontc,buff,izahl,nbfao,icomx,ianr,itnr)
call nrml(eta,nbmx,nfcol,nomx,contrc,nstart,nstop,fcntr,ftype,
1isl4,c,opad1)
c
c ivmax.ne.0 : transformation of mo-vectors in ao basis has already
c been done
rewind ir
read (ir,940)(alabel(i1),i1=1,19)
read(ir,940)(blabel(i1),i1=1,19)
read(ir,950)iopen,nsym,ivmax
read(ir,940)(fmt(i1),i1=1,4)
if(ivmax.eq.0) goto 170
if(ivmax.gt.maxuv) goto 1500
read(ir,fmt) (y(i),i=1,ivmax)
norb=iopen
do 180 nn=1,norb
frocc(nn)=2.0d0
180 chomo=chomo-2.0d0
write(6,970) chomo
goto 25
c
170 call getran(nbfao,frocc,norb,itrnao,idxxt)
25 read(5,102,end=999)m,ilnmcm,icntr,(c(k),k=1,3)
if(iwarn.eq.1) goto 998
if(m.eq.14.or.m.eq.15) iwarn=1
if(icntr.eq.0) go to 800
do 801 i=1,3
801 c(i)=vlist(icntr,i)
800 if(m.eq.0) go to 76
go to (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16),m
1 call dintfm(opaa0, potnuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
2 call dintfm(opaa1, fldnuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
3 call dintfm(opaa2, grdnuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
4 call dintfm(opab1, dipnuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
5 call dintfm(opab2, qudnuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
6 call dintfm(opab3, octnuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
7 call dintfm(opac1, nonuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
8 call dintfm(opac2, nonuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
9 call dintfm(opac3, nonuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
10 call dintfm(opad1, nonuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
11 call dintfm(opab4, magnuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
12 call dintfm(opaa3,sldnuc, dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
13 call dintfm(opap4, nonuc, dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
14 call dintfm(opad1, nonuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
15 call dintfm(opab1, nonuc,dint, vlist,c,n,eta,val,nt
1,norb,frocc,tot,non,nromx,ilbl,a,title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
go to 25
16 call plotin(nmaxx,nmaxy,kpmax,cc,norbpl,mdens,nocc,norbmx,iplot,
1 iat)
if(iat.gt.0) call molcor(iplot)
call orbval(eta,nbmx,norbmx,nomx,nstart,nstop,contrc,ftype,
1frocc,cc,dd,dinx,cin,v,ddsq,kpmax,norbpl,mdens,nocc,y,iplot)
go to 25
999 stop
1500 write(6,960) ivmax,maxuv
stop
100 format(6i5)
101 format(12a6)
102 format(i5,6x,a4,i5,3f10.0)
103 format(/)
104 format(1x,12a6)
105 format(2x,10a4)
940 format(19a4)
950 format(20i4)
960 format(//' dimension of y in main program too small ! ivmax= ',
&i6,' maxuv= ',i6//)
970 format(/' charge of the molecule ',f10.5/)
c
998 write(6,106)
106 format(1x,'option 14 (population analysis) or option 15 (localizat
1ion) must be the last one'/,' ***** calculation stopped *****')
stop
end
c
c
subroutine input( eta, nfcol, fcntr, ftype, n, nbmx, vlist, centr,
1 non,nocmx,ntcol,type,ilab,ilbl,nomx,
2 nstart,nstop,contrc,ncontc,buff,izahl,nbfao,icomx,ianr,
3 itnr)
implicit real*8(a-h,o-z)
c
c parameter statement as in integral program
parameter(laords=18,lconsu=60,lgcsu=18,lru=20,lcsu=24,
& lctu=30,lsfu=200,lgu=9,lsfru=250,lnsfu=6000,
& lpru=18000,lsu=50,lstu=8,lconu=12,
& lcu=8,lccu=182)
c
c this subroutine prepares the integral input from the karlsruhe
c input program for polyatom.
c one part is taken from routine convrt of schaefer's gradient
c program
c
real*8 ilab(12), ilbl(12)
integer fcntr, ftype, centr, type
dimension eta(nbmx,nfcol), vlist(nocmx,4),ianr(1),itnr(1)
dimension fcntr(1), ftype(1), centr(1), type(1),contrc(nomx,8)
dimension nstart(1),nstop(1),ncontc(1),buff(1),frocc(1),izahl(1)
common /contrc/ chomo,ncont
common /ioind/isl1,isl2
common/infoa/natoms,mul,nbf,nij,nelec,nalpha,nbeta
common /ntgr/ kaords, mconsu, mstu, msfu, mgu, msfru, mnsfu, mpru,
1mcxu,ngcs,mdum(45),mccu,mblu,ns,ng,nsf,nst,ncons
common/bl/nf(lsu),nc(lsu),ncon(lconsu),lmnp1(lconsu),
1 ntl(lsfu),ntu(lsfu),nnt(lsfu),mcons(lsfu),ica(lcu,lsu,lgu),
2 ccoef(lsu,lconsu),zet(lconu,lconsu),x(lcu,lsu),yy(lcu,lsu),
3 z(lcu,lsu),nir(laords),nso(lstu),nd(lstu),nblpr(lstu),
4 la(lru,laords),nct(lsfu),maords(lgcsu),mgcs(lsfu),
5 mtype(lsu),c(lctu,lcsu,lgcsu),chg(lsu),ityp(lstu)
c
msu=lsu
mconsu=lconsu
mconu=lconu
mcu=lcu
msfu=lsfu
mgu=lgu
mnsfu=lnsfu
mpru=lpru
mccu=lccu
kaords=laords
mgcsu=lgcsu
mstu=lstu
mru=lru
mcsu=lcsu
mctu=lctu
msfru=lsfru
call inpsym(mcu,msu,mru,mctu,mcsu,icomx,mgcsu)
n=0
nbf=0
ispf=0
natoms=0
nr=0
do 500 is=1,ns
icu=nc(is)
ifu=nf(is)
do 400 ic=1,icu
isf=ispf
natoms=natoms+1
if(natoms.le.nocmx) goto 504
write(6,1200)
1200 format(1x,'too many atoms in subroutine input')
stop
504 centr(natoms)=mtype(is)
vlist(natoms,1)=x(ic,is)
vlist(natoms,2)=yy(ic,is)
vlist(natoms,3)=z(ic,is)
vlist(natoms,4)=chg(is)
chomo=chomo+chg(is)
nr=nr+1
do 400 if=1,ifu
isf=isf+1
icons=mcons(isf)
ncns=ncon(icons)
jtyp=lmnp1(icons)
if(jtyp.le.4) goto 11
write(6,1000) jtyp
1000 format(1x,' jtyp = ',i3,4x,' only s,p,d and f orbitals are allowed
1 ',/,'****** calculation stopped ******')
stop
11 continue
jtypm=jtyp*(jtyp+1)/2
jtyp = (jtypm*(jtyp-1))/3 +1
do 400 i=1,jtypm
nbf=nbf+1
if(nbf.lt.nomx) goto 503
write(6,1100) nbf,nomx
1100 format(1x,' dimension too small in input, nbf =',i5,3x,
1' nomx =',i5)
stop
503 ncontc(nbf)=ncns
itnr(nbf)=jtyp-1+i
ianr(nbf)=nr
do 400 icon=1,ncns
n=n+1
if(n.le.nbmx) goto 505
write(6,1300)
1300 format(1x,'too many primitive functions in subroutine input')
stop
505 izahl(n)=nr
fcntr(n)=mtype(is)
ftype(n)=type(jtyp-1+i)
eta(n,4)=zet(icon,icons)
contrc(nbf,icon)=ccoef(icon,icons)
400 continue
ispf=ispf+ifu
500 continue
non=natoms
ncont=nbf
nbfao=nbf
call rdetac(eta,nfcol,fcntr,ftype,n,nbmx,vlist,centr,non,
1 nocmx,ntcol,type,nstart,nstop,contrc,ncontc,nomx,
2 izahl)
return
end
c
c
subroutine rdetac(eta,nfcol,cntr,typ,n,nfmx,vlist,centre,non,
1ncmx,ntcol,type,nstart,nstop,contrc,ncontc,nomx,izahl)
c
c polyatom inputroutine for basis functions
c
implicit real*8(a-h,o-z)
common /contrc/ chomo,ncont
dimension ncontc(1),nstart(1),nstop(1),contrc(nomx,8)
dimension eta(nfmx,nfcol),vlist(ncmx,4)
dimension cntr(1),typ(1),centre(1),type(1),izahl(1)
integer cntr,typ,centre,blank,type
write(6,105)
c.....center specifications
write(6,104)
write(6,106)
do 1 i=1,non
write(6,107) centre(i), (vlist(i,j), j=1,4)
1 continue
if(ncont.ne.n) go to 202
do 201 i=1,n
201 ncontc(i) = 1
202 nstart(1)=1
nstop(1)=ncontc(1)
do 31 i=2,ncont
nstart(i)=nstart(i-1)+ncontc(i-1)
31 nstop(i)=nstop(i-1)+ncontc(i)
c.....set up coordinates of function in eta
icon=1
jcon=0
do 3 i=1,n
if(i-nstop(icon)) 60,60,61
60 jcon=jcon+1
go to 62
61 icon=icon+1
jcon=1
62 j=izahl(i)
do 6 m=1,3
6 eta(i,m)=vlist(j,m)
c.....set up unnormalized hybridization coeffs of function in eta
do 7 j=1,ntcol
if(noteqv(type(j),typ(i))) 7, 8, 7
7 continue
write(6,2000) type(j),typ(i)
2000 format('0***** types not equal ',2a4)
stop
8 continue
do 9 m=1,ntcol
9 eta(i,m+5)=0.0d0
do 2 m=1,ntcol
if(typ(i).ne.type(m)) goto 2
eta(i,5)=m
eta(i,m+5)=1.0
goto 3
2 continue
3 continue
return
101 format(2i3)
1020 format(a4,6x,4f12.0)
1030 format(36i2)
103 format(a4,6x,a4,i3,3x,2f12.0)
104 format(/ ,1x,15hnuclear centres)
105 format(///,1x,32hgaussian function specifications)
106 format(/ ,1x,6hcentre,18x,12hco-ordinates,17x,6hcharge,//)
107 format(1x,a6,6x,3f12.8,6x,f4.1)
110 format(///,1x,8hfunction,3x,11hcontraction,3x,6hcentre,3x,4htype,
111x,8hexponent,3x,11hcoefficient)
111 format(1x,i5,8x,i5,8x,i3,a3,3x,a6,3x,2f13.7)
114 format(//,1x,18hadditional centres,//)
115 format(//,1x,6hcentre,18x,12hco-ordinates//)
end
c
c
subroutine nrml(eta,nfmx,nfcol,nomx,c,nstart,nstop,nc,nt,isl4,d,
1ovl)
implicit real*8 (a-h,o-z)
dimension a(20),eta(nfmx,nfcol),c(nomx,8),nstart(1),nstop(1),
1nc(1),nt(1),d(3)
data cons/15.7496099d0/,c1/1.0d0/,zero/0.d0/,c3/3.0d0/,c4/4.0d0/,
1 delt/1.0d-6/,c15/15.0d0/
common /contrc/chomo,ncont
c normalize primitive functions.
do 5 i=1,ncont
is=nstart(i)
if=nstop(i)
do 4 ii=is,if
z=eta(ii,4)*c4
do 1 m=1,20
1 a(m)=eta(ii,m+5)
s=cons*(a(1)+(a(2)+a(3)+a(4)+(a(8)+a(9)+a(10)+c3*(a(5)+a(6)+a(7))+
1 (a(20)+c3*(a(14)+a(15)+a(16)+a(17)+a(18)+a(19))+c15*(a(11)+a(12)
2 +a(13))) /z)/z)/z)/(z*sqrt(z))
s=c1/sqrt(s)
do 3 m=6,nfcol
3 eta(ii,m)=eta(ii,m)*s
4 continue
5 continue
if(isl4.eq.2) return
c renormalize contraction coefficients
d(1)=zero
d(2)=zero
d(3)=zero
if(isl4.ne.1) go to 2
write(6,101)
write(6,110)
2 do 9 i=1,ncont
is=nstart(i)
if=nstop(i)
ip=0
s=zero
do 7 ii=is,if
ip=ip+1
jp=0
do 7 jj=is,if
call propa(ovl,ii,jj,eta,a,d,1,nfmx)
jp=jp+1
s=s+c(i,ip)*c(i,jp)*a(1)
7 continue
s=c1/sqrt(s)
ip=0
do 8 ii=is,if
ip=ip+1
c(i,ip)=c(i,ip)*s
if(abs(c(i,ip)+c1).le.delt) c(i,ip)=c1
if(isl4.ne.1) go to 8
write(6,111)ii,i,nc(ii),nt(ii),eta(ii,4),c(i,ip)
8 continue
9 continue
110 format(//,1x,8hfunction,3x,11hcontraction,3x,6hcentre,3x,4htype,
111x,8hexponent,3x,11hcoefficient)
111 format(1x,i5,8x,i5,8x,a6,3x,a6,3x,2f13.7)
101 format(///,10x,15hrenormalization)
return
end
c
c
subroutine dintfm(opa, nuc, dint, vlist, c, n, eta,
1 val, nt, norb, frocc, tot, noc, nro, ilbl, a, title,
2 nstart,nstop,contrc,cint,buff,rnabcd)
implicit real*8(a-h,o-z)
parameter(nocmx=50,nbmx=720,nomx=250,lbuff=31375)
common /contrc/ chomo,ncont
common /prptyp/ m
common /big/ y(nomx*nomx),su(nomx*nomx),p(nomx,nomx)
dimension dint(nro,*), vlist(nocmx,4), c(3), eta(nbmx,16), val(1),
1 frocc(1), tot(1)
dimension nstart(1),nstop(1),contrc(nomx,8),cint(nomx,1),
1 buff(lbuff),rnabcd(1)
real*8 ilbl
common /ioind/isl1,isl2
dimension ilbl(1), a(1), title(1), dinx(310)
dimension lin(84),min(84),nin(84)
data pi/3.14159265359d0/, cl/137.03604d0/
data lin/0,1,0,0,2,0,0,1,1,0,3,0,0,2,2,1,0,1,0,1,4,0,0,3,3,1,0,1,0
1 ,2,2,0,2,1,1,5,0,0,3,3,2,2,0,0,4,4,1,0,0,1,1,3,1,2,2,1,6,0,0,3,
2 3,0,5,5,1,0,0,1,4,4,2,0,2,0,3,3,1,2,2,1,4,1,1,2/,min/0,0,1,0,0,
3 2,0,1,0,1,0,3,0,1,0,2,2,0,1,1,0,4,0,1,0,3,3,0,1,2,0,2,1,2,1,0,5,
4 0,2,0,3,0,3,2,1,0,4,4,1,0,1,1,3,2,1,2,0,6,0,3,0,3,1,0,0,1,5,5,2,0
5,0,2,4,4,2,1,3,1,3,2,1,4,1,2/,nin/0,0,0,1,0,0,2,0,1,1,0,0,3,0,1,0,
6 1,2,2,1,0,0,4,0,1,0,1,3,3,0,2,2,1,1,2,0,0,5,0,2,0,3,2,3,0,1,0,1,
7 4,4,3,1,1,1,2,2,0,0,6,0,3,3,0,1,5,5,1,0,0,2,4,4,0,2,1,2,2,3,1,3,
8 1,1,4,2/
c
c
call dumdum(nuc,noc,vlist,c,dint,nro,nocmx,nt)
if(m.eq.15) nt=3
if(m.eq.13) nt=3
call pint(opa, n, eta, c, val, nt, nro, nbmx, a, title,
1 ilbl,nstart,nstop,contrc,nomx,buff,lbuff)
if (m.ne.13) go to 7
c
c calculation of the darwin-term
c
valval=0.0d0
c + loop over the centers
do 80 ic=1,noc
c(1)=vlist(ic,1)
c(2)=vlist(ic,2)
c(3)=vlist(ic,3)
ipp=0
c + + loop over the c-gto's
do 40 iz=1,ncont
dinx(iz)=0.d0
istart=nstart(iz)
istop=nstop(iz)
iprim=0
c + + + loop over the gto's
do 40 ii=istart,istop
ipp=ipp+1
iprim=iprim+1
ieta=eta(ii,5)+0.00001
li=lin(ieta)
mi=min(ieta)
ni=nin(ieta)
xc=c(1)-eta(ii,1)
yc=c(2)-eta(ii,2)
zc=c(3)-eta(ii,3)
expo=-eta(ii,4)*(xc*xc+yc*yc+zc*zc)
din=1.d0
if(li.ne.0) din=xc**li
if(mi.ne.0) din=din*yc**mi
if(ni.ne.0) din=din*zc**ni
din=din*exp(expo)
ieta=ieta+5
dinx(iz)=dinx(iz)+din*contrc(iz,iprim)*eta(ipp,ieta)
40 continue
vval=0.d0
ii=0
c + + loop over the orbitals
do 70 mi=1,norb
dens=0.d0
c + + + loop over the c-gtos
do 75 mj=1,ncont
ii=ii+1
dens=dens+dinx(mj)*y(ii)
75 continue
vval=vval+frocc(mi)*dens*dens
70 continue
valval=valval+vlist(ic,4)*vval
80 continue
dint(1,3)=valval*0.5d0*pi/cl**2
c
c
7 if (m.ne.14) go to 6
c
c mulliken and roby population analysis
c
call cntrcm(cint,norb,noc,buff,frocc,rnabcd)
return
c
6 go to (4,5), isl1
4 call output(dint,norb,n,nt,nro,frocc,tot,c,ilbl,a,title,
1 cint,buff)
5 return
end
c
c
subroutine pint(opa,n,eta,c,val,nt,nro,nbmx,a,title,
1 ilbl,nstart,nstop,contrc,nomx,buff,lbuff)
c
c calculation of integrals in ao-basis. data are written on
c file ft002
c
implicit real*8(a-h,o-z)
common /contrc/ chomo,ncont
dimension nstart(1),nstop(1),contrc(nomx,8)
dimension a(13,3), title(14,10)
dimension c(1),eta(nbmx,16),val(1),dinx(10),buff(lbuff)
real*8 ilbl(1)
common/ioind/isl1,isl2
common/prptyp/mm
ipr=ncont*(ncont+1)/2
if(ipr.gt.lbuff.and.mm.eq.14) goto 99
nu = 3
rewind 2
ix=0
do 50 i=1,ncont
do 50 j=1,i
nu = nu + 1
istart = nstart(i)
istop = nstop(i)
jstart = nstart(j)
jstop = nstop(j)
iprim = 0
do 2 m=1,nt
2 dinx(m)=0.0d0
do 40 ii=istart,istop
iprim = iprim + 1
jprim = 0
do 40 jj=jstart,jstop
jprim = jprim + 1
call propa(opa,ii,jj,eta,val,c,nt,nbmx)
do 30 m=1,nt
30 dinx(m) = contrc(i,iprim)*contrc(j,jprim)*val(m) + dinx(m)
40 continue
if(mm.ne.14) goto 55
ix=ix+1
buff(ix)=dinx(1)
goto 50
55 do 60 m=1,nt
ix=ix+1
buff(ix)=dinx(m)
if(ix.lt.lbuff)go to 60
ix=0
write(2)buff
60 continue
50 continue
if(mm.eq.14) return
write(2)buff
if(isl2.eq.1)return
if(isl2.eq.3) go to 1
write(6,19) (ilbl(i), i=1,12)
write(6,20) (a(mm,i), i=1,3)
write(6,21)
rewind 2
ix=lbuff
do 6 i=1,ncont
do 7 j=1,i
write(6,21)
do 70 m=1,nt
ix=ix+1
if(ix.le.lbuff)go to 70
ix=1
read(2)buff
70 write(6,10)i,j,buff(ix)
7 continue
6 continue
return
1 rewind 2
ix=lbuff
do 66 i=1,ncont
do 77 j=1,i
do 770 m=1,nt
ix=ix+1
if(ix.le.lbuff) go to 770
ix=1
read(2) buff
write(3) buff
770 continue
77 continue
66 continue
return
c
99 write(6,7000) ipr,lbuff
7000 format(1x,'dimension too small in subroutine pint ipr =',i8,
1 ' lbuff = ',i8,/,' population analysis is not possible')
stop
c
19 format(1h0,/ ,1x,12a6)
20 format( //,1x,34hintegrals over basis functions for,5x,3a6//)
21 format(/)
10 format(1x,2i5,d20.5)
end
c
c
subroutine cntrac(cint,norb,n,nt,nro,buff)
c
c transformation of integrals in mo-basis. only diagonalelements
c are calculated
c
implicit real*8(a-h,o-z)
parameter(nocmx=50,nbmx=720,nomx=250,lbuff=31375)
common /contrc/ chomo,ncont
common/ioind/isl1, isl2
common /big/ y(nomx*nomx),su(nomx*nomx),p(nomx,nomx)
dimension cint(nomx,1),buff(lbuff)
rewind 2
do 10 m=1,nt
do 10 i=1,norb
10 cint(i,m)=0.0d0
nend=ncont*norb
ix=lbuff
do 50 k=1,ncont
do 50 l=1,k
do 40 m=1,nt
ix=ix+1
if(ix.le.lbuff)go to 20
ix=1
read(2)buff
20 do 30 i=1,norb
kk=ncont*(i-1)+k
ll=ncont*(i-1)+l
tmp=y(kk)*y(ll)
if(k.ne.l) tmp=tmp+tmp
30 cint(i,m)=buff(ix)*tmp+cint(i,m)
40 continue
50 continue
return
end
c
c
subroutine cntrcm(cint,norb,non,buff,frocc,rnabcd)
c
c mulliken and roby population analysis
c
implicit real*8(a-h,o-z)
parameter(nocmx=50,nbmx=720,nomx=250,lbuff=31375)
integer centr
common/scfinf/dmh(nomx),roc(nomx)
common /big/ y(nomx*nomx),su(nomx*nomx),uv(nomx*nomx)
common/holl/blabel(19),alabel(19),fmt(4),jl,lomao,iopen,nsym
common/muli/vlist(nocmx,4),ianr(nomx),centr(nocmx),itnr(nomx)
common /contrc/ chomo,ncont
common/ioind/isl1, isl2
common/supp/nsupp
data ifile/4/,jfile/7/,kfile/9/,tol/0.d0/
dimension cint(2),buff(lbuff),rnmy(20),frocc(2),mor(20)
c number of aos : 250
c number of atoms : 16
c dimension of ovpop : 16*(16+1)/2
c dimension of nat and jatnr : 16+1
dimension ovpop(136),mos(250),iatnr(16),nat(17),rmopo(250,250)
dimension rnab(15,16),jatnr(17),rnabc(14,15,16),rnamo(250,16)
dimension rnabcd(1),katnr(16)
c rnabcd(1) equivalenced to buff(16+1) in main program
equivalence (uv(1),rmopo(1,1)), (rnabc(1,1,1),rnamo(1,1))
tri=1.d0/3.d0
four=1.d0/4.d0
ipr=ncont*(ncont+1)/2
ncmax=ncont*ncont
maxuv=nomx*nomx
idmax=maxuv/2
nocm1=nocmx-1
nocm2=nocmx-2
nocp1=nocmx+1
c
c mulliken population analysis
c
c overlap * mos, written on kfile (for roby analysis)
call hm(buff,y,su,norb,ncont)
momax=norb*ncont
rewind kfile
write(kfile) (su(ir),ir=1,momax)
rewind kfile
c
c calculation of density , written on jfile
do 205 i=1,ipr
205 su(i)=0.d0
do 210 k=1,norb
ij=0
ist=(k-1)*ncont
do 220 i=1,ncont
iy=ist+i
do 220 j=1,i
ij=ij+1
jy=ist+j
220 su(ij)=su(ij)+y(iy)*y(jy)*frocc(k)
210 continue
rewind jfile
write(jfile) (su(ir),ir=1,ipr)
rewind jfile
c
c
do 10 i=1,ncont
10 cint(i)=0.0d0
ix=0
iend=non*(non+1)/2
ij=0
do 15 i=1,iend
ovpop(i)=0.d0
do 15 j=1,norb
15 rmopo(i,j)=0.d0
c calculation of overlap charges
do 50 k=1,ncont
do 50 l=1,k
ij=ij+1
ix=ix+1
tmp=0.d0
do 30 i=1,norb
kk=ncont*(i-1)+k
ll=ncont*(i-1)+l
ka=ianr(k)
la=ianr(l)
kla=(ka*(ka-1))/2+la
tmpb=y(kk)*y(ll)*frocc(i)*buff(ix)
if(ka.ne.la) tmpb=tmpb*2.0d0
rmopo(kla,i)=rmopo(kla,i)+tmpb
if(k.eq.l) goto 30
if(ka.eq.la) rmopo(kla,i)=rmopo(kla,i)+tmpb
30 continue
tmpb=su(ij)*buff(ix)
cint(k)=cint(k)+tmpb
if(k.ne.l) cint(l)=cint(l)+tmpb
50 continue
ren=0.d0
do 150 ii=1,ncont
150 ren=ren+cint(ii)
write(6,1000)
c calculation of occupation numbers
do 70 j=1,non
do 71 k=1,20
71 rnmy(k)=0.d0
rnmy2=0.d0
rnmy3=0.d0
rnmy4=0.d0
rnm=0.d0
do 60 i=1,ncont
if(ianr(i).ne.j) goto 60
itp=itnr(i)
rnmy(itp)=rnmy(itp)+cint(i)
60 continue
rnmy2=rnmy2+rnmy(2)+rnmy(3)+rnmy(4)
do 80 k=5,10
80 rnmy3=rnmy3+rnmy(k)
do 90 k=11,20
90 rnmy4=rnmy4+rnmy(k)
rnm=rnmy(1)+rnmy2+rnmy3+rnmy4
chg=vlist(j,4)-rnm
write(6,2000)
write(6,3000) j,centr(j),rnmy(1),rnmy2,rnmy3,rnmy4,rnm,chg
if(rnmy2.ne.0.d0) write(6,4000) (rnmy(ii),ii=2,4)
if(rnmy3.ne.0.d0) write(6,4001) (rnmy(ii),ii=5,10)
if(rnmy4.ne.0.d0) write(6,4002) (rnmy(ii),ii=11,20)
70 continue
write(6,5000) ren
write(6,6000)
fakt=1.0d0
do 115 i=1,iend
do 115 j=1,norb
115 ovpop(i)=ovpop(i)+rmopo(i,j)
call outpak(ovpop,non,1,1)
if(nsupp.ne.5) goto 218
ii=0
write(6,6400)
do 110 i=1,non
do 110 j=1,i
write(6,6500) i,centr(i),j,centr(j)
ii=ii+1
write(6,1001) (rmopo(ii,k),k=1,norb)
110 continue
c
c roby population analysis
c
218 continue
write(6,8000)
nnc=ncont
c
c calculate blocks of atoms
itmp=1
ij=0
do 400 i=2,ncont
if(ianr(i).ne.ianr(i-1)) goto 405
itmp=itmp+1
goto 400
405 ij=ij+1
iatnr(ij)=itmp
itmp=1
400 continue
iatnr(ij+1)=itmp
c
ndim=0
do 733 i=1,non
ia=iatnr(i)
733 ndim=ndim+(ia*ia+ia)/2
c
c atom blocked overlap matrix on su
call sort(buff,su,iatnr,non,0,ncmax)
c
c calculation of s**1/2 and s**-1/2 (diagonal)
ist=1
jst=1
ij=0
ll=0
do 530 i=1,non
ia=iatnr(i)
do 540 j=1,ia
do 540 k=1,ia
ij=ij+1
uv(ij)=0.d0
if(j.eq.k) uv(ij)=1.d0
540 continue
call erduw(su(jst),uv(ist),ia,1.d-12)
ii=jst-1
do 560 l=1,ia
ii=ii+l
ll=ll+1
cint(ll)=sqrt(su(ii))
560 dmh(ll)=1.d0/cint(ll)
ist=ist+ia*ia
jst=jst+(ia*ia+ia)/2
530 continue
itest=ist-1
if(itest.le.idmax) goto 94
write(6,7100) itest,idmax
7100 format(1x,'itest = ',i8,' greater than idmax = ',i8,
1 ' in subroutine cntrcm',/,' enlarge nomx in main program')
stop
94 continue
c
c calculation of s**1/2 (atom blocked)
call uduk(uv,cint,su,iatnr,non,ndim)
rewind jfile
read(jfile) (y(ii),ii=1,ipr)
rewind jfile
c
c atom blocked density matrix on uv
call sort(y,uv(idmax+1),iatnr,non,0,ncmax)
c s**1/2 * density * s**1/2
call h1h2h1(su,uv(idmax+1),cint,y,iatnr,non,ipr)
c
c calculation of s**-1/2 (atom blocked)
call uduk(uv,dmh,su,iatnr,non,ndim)
c
c calculation of maos (written on uv)
ij=0
ist=1
jst=1
do 570 i=1,non
ia=iatnr(i)
do 580 j=1,ia
iuv1=jst-1+(j-1)*ia
iuv2=jst-1+j
do 580 k=1,j
ij=ij+1
iuv=iuv1+k
uv(iuv)=su(ij)
iuv=iuv2+(k-1)*ia
580 uv(iuv)=su(ij)
call erduw(y(ist),uv(jst),ia,1.d-12)
ist=ist+(ia*ia+ia)/2
jst=jst+ia*ia
570 continue
c full mao matrix on y
call sort(uv,y,iatnr,non,1,ncmax)
c calculation of s * mao
call hm(buff,y,uv,ncont,ncont)
c read in density and calculate (mao*s)# * d * (mao*s)
rewind jfile
read(jfile) (buff(ii),ii=1,ipr)
rewind jfile
call ukhu(uv,buff,cint,su,ncont,ncont)
rewind ifile
write(ifile) (su(ir),ir=1,ncmax)
rewind ifile
c
ii=ncont+1
ij=1
do 585 i=1,ncont
roc(i)=su(ij)
585 ij=ij+ii
c mao * (s*mao), written on jfile
call mkm(y,uv,su,ncont,ncont,ncont)
rewind jfile
write(jfile) (su(ir),ir=1,ncmax)
rewind jfile
c
do 649 i=1,ncont
649 mos(i)=0
c
c roby occupation numbers
nnc=0
ii=0
ist=0
do 600 i=1,non
jatnr(i)=iatnr(i)
ia=iatnr(i)
rat=0.d0
do 610 j=1,ia
ii=ii+1
610 rat=rat+roc(ii)
write(6,6700) i,centr(i),rat
write(6,6800) (roc(ir),ir=ist+1,ii)
c
c selection of maos by user
rat=0.d0
read(5,1500) nmao,(mor(im),im=1,nmao)
if(mor(1).eq.0) goto 851
do 854 im=1,nmao
kk=mor(im)
mos(kk)=kk
cint(im)=roc(kk)
854 rat=rat+roc(kk)
iatnr(i)=nmao
nnc=nnc+nmao
goto 855
851 iatnr(i)=nmao
c automatic selection of maos according to occupation numbers
if(nmao.eq.0) write(6,6900) nmao,i
if(nmao.eq.0) goto 600
nnc=nnc+nmao
iij=0
do 850 k=1,nmao
rpr=0.d0
do 860 l=1,ia
if(roc(ist+l).le.rpr) goto 860
kk=ist+l
rpr=roc(kk)
860 continue
iij=iij+1
mos(kk)=kk
rat=rat+rpr
cint(iij)=rpr
roc(kk)=-rpr
850 continue
855 rnmy(i)=rat
write(6,6900) nmao,i,rat
write(6,7500) (cint(ir),ir=1,nmao)
600 ist=ist+ia
c
do 871 i=1,non
871 ianr(i)=jatnr(i)-iatnr(i)
min=1000
do 872 i=1,non
if(ianr(i).lt.min) min=ianr(i)
872 continue
c hypervalence contributions
call hypval(jatnr,mos,tol,ipr,ifile,non,ncmax,ren,
1 jfile,rtot)
c
c
nnc2=nnc*nnc
mm=0
do 870 m=1,ncont
if(mos(m).eq.0) goto 870
mm=mm+1
mos(mm)=mos(m)
roc(mm)=abs(roc(m))
870 continue
c
c calculate trace (mao*b*mao * s**-1)
c calculation of unassigned charge
rewind ifile
read(ifile) (uv(iw),iw=1,ncmax)
rewind ifile
rewind jfile
read(jfile) (su(iw),iw=1,ncmax)
rewind jfile
c order according to selected maos
call order(uv,su,mos,nnc,ncont)
c ordered overlap(mao basis) written on jfile
rewind jfile
write(jfile) (su(iw),iw=1,nnc2)
rewind jfile
c
if(nsupp.ne.4) goto 655
write(6,9100)
call prtblk(su,nnc,nnc,'mao ','mao ',mos)
write(6,9200)
655 call osinv1(su,nnc,d,tol,itnr,ianr)
c
rna=0.d0
do 910 i=1,nnc
a=0.d0
i1=i
i20=(i-1)*nnc
do 920 j=1,nnc
a=a+su(i1)*uv(i20+j)
920 i1=i1+nnc
rna=rna+a
910 continue
uach=ren-rna
write(6,7700) uach
rtot=(uach-rtot)/non
do 500 i=1,non
500 dmh(i)=dmh(i)+rtot
write(6,7800) rtot
c
c selection and reordering of mao vector y
imo=0
ie=0
ij=0
nnc=0
nst=1
nat(1)=1
do 650 l=1,non
nmao=iatnr(l)
nat(l+1)=nat(l)+nmao
if(nmao.eq.0) goto 650
do 660 i=1,nmao
imo=imo+1
imos=mos(imo)-1
ist=imos*ncont+1
ie=ist+ncont-1
do 680 k=ist,ie
ij=ij+1
680 y(ij)=y(k)
660 continue
write(6,7600) l,centr(l)
call prtblk(y(nst),ncont,nmao,' ao ','mao ',mos(nnc+1))
nst=nst+nmao*ncont
nnc=nnc+nmao
650 continue
c write out maos for plot
ndimw=nnc*ncont
write(lomao,8900) (alabel(i1),i1=1,19)
write(lomao,8900) (blabel(i1),i1=1,19)
write(lomao,9000) nnc,ncont,ndimw
write(lomao,8900) (fmt(i1),i1=1,4)
write(lomao,fmt) (y(i),i=1,ndimw)
c
c calculation of occupation numbers (mo-contributions)
rewind kfile
read(kfile) (uv(ir),ir=1,momax)
rewind kfile
c (maos)# * (sc) = su
call mkm(y,uv,su,nnc,ncont,norb)
if(nsupp.eq.5) write(6,8650)
do 960 m=1,non
rat=0.d0
mm=0
do 970 j=1,norb
ind=(j-1)*nnc
do 980 k=nat(m),nat(m+1)-1
mm=mm+1
980 uv(mm)=su(ind+k)
970 continue
ndim=iatnr(m)
i0=-ndim
do 950 i=1,norb
v=0.d0
i0=i0+ndim
do 955 j=1,ndim
955 v=v+uv(i0+j)*uv(i0+j)
rnamo(i,m)=v*frocc(i)
rat=rat+rnamo(i,m)
950 continue
if(nsupp.eq.5) write(6,8655) m,centr(m),(rnamo(ir,m),ir=1,norb)
960 continue
c
c two center shared electron numbers
write(6,8350)
ncen=1
ishare=2
rewind jfile
read(jfile) (uv(ir),ir=1,nnc2)
rewind jfile
do 715 i=1,non
715 buff(i)=0.d0
nat(non+1)=nnc+1
c
do 700 i=1,non-1
ij=0
if(iatnr(i).eq.0) goto 700
do 710 ii=nat(i),nat(i+1)-1
ij=ij+1
710 mos(ij)=ii
do 720 j=i+1,non
if(iatnr(j).eq.0) goto 720
ik=ij
do 730 jj=nat(j),nat(j+1)-1
ik=ik+1
730 mos(ik)=jj
itest=ik*ik
if(itest.gt.idmax) goto 95
c
call sen(su,uv,y(1),y(idmax),mos,cint,rna,ik,d,tol,itnr,ianr,
1 norb,nnc,roc,frocc)
rnab(i,j)=rna
write(6,7900) i,centr(i),j,centr(j)
rna=0.d0
do 810 im=1,norb
roc(im)=rnamo(im,i)+rnamo(im,j)-roc(im)
810 rna=rna+roc(im)
write(6,8100) (roc(ir),ir=1,norb)
buff(i)=buff(i)+rna*0.5d0
buff(j)=buff(j)+rna*0.5d0
write(6,8200) rna
720 continue
700 continue
c
c three center shared electron numbers
c
if(non.le.3) goto 515
ncen=-1
ishare=3
write(6,8400)
do 740 i=1,non-2
ij=0
if(iatnr(i).eq.0) goto 740
do 745 ii=nat(i),nat(i+1)-1
ij=ij+1
745 mos(ij)=ii
do 750 j=i+1,non-1
if(iatnr(j).eq.0) goto 750
ik=ij
do 755 jj=nat(j),nat(j+1)-1
ik=ik+1
755 mos(ik)=jj
do 760 k=j+1,non
if(iatnr(k).eq.0) goto 760
il=ik
do 765 kk=nat(k),nat(k+1)-1
il=il+1
765 mos(il)=kk
itest=il*il
if(itest.gt.idmax) goto 95
c
call sen(su,uv,y(1),y(idmax),mos,cint,rna,il,d,tol,itnr,ianr,
1 norb,nnc,roc,frocc)
rnabc(i,j,k)=rna
rna=rnmy(i)+rnmy(j)+rnmy(k)-rnab(i,j)-rnab(i,k)-rnab(j,k)+rna
buff(i)=buff(i)-tri*rna
buff(j)=buff(j)-tri*rna
buff(k)=buff(k)-tri*rna
if(abs(rna).ge.0.01d0) write(6,8500) i,j,k,rna
760 continue
750 continue
740 continue
c
c four center shared electron numbers
c
if(non.le.4) goto 515
ncen=1
ishare=4
write(6,8450)
do 770 i=1,non-3
ij=0
if(iatnr(i).eq.0) goto 770
do 775 ii=nat(i),nat(i+1)-1
ij=ij+1
775 mos(ij)=ii
do 780 j=i+1,non-2
if(iatnr(j).eq.0) goto 780
ik=ij
do 785 jj=nat(j),nat(j+1)-1
ik=ik+1
785 mos(ik)=jj
do 790 k=j+1,non-1
if(iatnr(k).eq.0) goto 790
il=ik
do 795 kk=nat(k),nat(k+1)-1
il=il+1
795 mos(il)=kk
do 800 l=k+1,non
if(iatnr(l).eq.0) goto 800
im=il
do 805 ll=nat(l),nat(l+1)-1
im=im+1
805 mos(im)=ll
itest=im*im
if(itest.gt.idmax) goto 95
c
call sen(su,uv,y(1),y(idmax),mos,cint,rna,im,d,tol,itnr,ianr,
1 norb,nnc,roc,frocc)
index1=j*(j-3)/2+i
index2=l*(l-3)/2+k
index=index2*(index2-3)/2+index1
rnabcd(index)=rna
rna=rnmy(i)+rnmy(j)+rnmy(k)+rnmy(l)-rnab(i,j)-rnab(i,k)-rnab(i,l)
1 -rnab(j,k)-rnab(j,l)-rnab(k,l)+rnabc(i,j,k)+rnabc(i,j,l)
2 +rnabc(i,k,l)+rnabc(j,k,l)-rna
buff(i)=buff(i)+four*rna
buff(j)=buff(j)+four*rna
buff(k)=buff(k)+four*rna
buff(l)=buff(l)+four*rna
if(abs(rna).ge.0.002d0) write(6,8550) i,j,k,l,rna
800 continue
790 continue
780 continue
770 continue
515 read(5,6100) nm,(iatnr(i),i=1,nm)
if(nm.eq.0) goto 933
call spemu(su,uv,y(1),y(idmax),mos,cint,rna,d,tol,itnr,ianr,
1 norb,nnc,roc,frocc,iatnr,rnmy,rnab,rnabc,rnabcd,nm,nat,idmax,
2 jatnr,katnr,nocm1,nocm2,nocp1)
c
933 continue
c
c calculation of atomic charges
c chomo: charge of molecule, cmult: multicenter contribution
sum=0.d0
do 786 i=1,non
rnmy(i)=vlist(i,4)-rnmy(i)+buff(i)-dmh(i)
sum=sum+rnmy(i)
786 continue
sum=sum-chomo
cmult=sum*ncen
if(non.eq.3) write(6,8840) cmult
if(non.eq.4) write(6,8850) cmult
if(non.ge.5) write(6,8800) cmult
write(6,8600)
sum=sum/non
do 787 i=1,non
q=rnmy(i)-sum
write(6,8700) i,centr(i),q
787 continue
c
c
1000 format(///,' mulliken population analysis',//)
1001 format(1x,12f10.6)
1500 format(i10,20i3)
2000 format(//,' atom nr. symbol s-occupation p-occupation ',
1 'd-occupation f-occupation total charge ')
3000 format(1x,i5,4x,a4,2x,6(f12.5,2x))
4000 format(/,1x,'n(px) =',f9.5,2x,'n(py) =',f9.5,2x,'n(pz) =',f9.5)
4001 format(1x,'n(dxx) =',f9.5,2x,'n(dyy) =',f9.5,2x,'n(dzz) =',f9.5,
1 2x,'n(dxy) =',f9.5,2x,'n(dxz) =',f9.5,2x,'n(dyz) =',f9.5)
4002 format(1x,'n(fxxx)=',f9.5,2x,'n(fyyy)=',f9.5,2x,'n(fzzz)=',f9.5,
1 2x,'n(fxxy)=',f9.5,2x,'n(fxxz)=',f9.5,2x,'n(fyyx)=',f9.5,/,
2 1x,'n(fyyz)=',f9.5,2x,'n(fzzx)=',f9.5,2x,'n(fzzy)=',f9.5,
3 2x,'n(fxyz)=',f9.5)
5000 format(//,' total number of electrons = ',f15.8)
6000 format(///,' mulliken overlap population ',/)
6100 format(20i3)
6400 format(//,' overlap population per mo',/)
6500 format(/,' atom ',i5,a4,' / ','atom ',i5,a4)
6700 format(//,' atom nr ',i5,2x,a4,' occupation',f10.6)
6800 format(1x,'occupation of maos',/,(10f10.6))
6900 format(1x,i5,' maos selected for atom ',i4,' occupation ',f10.6)
7500 format(1x,'occupation of maos ',/,(10f10.6))
7600 format(///,' selected maos for atom ',i3,a4)
7700 format(/,10x,'unassigned charge = ',f10.4,/)
7800 format(1x,'rest charge per atom = ',f10.6)
7900 format(//,' atom ',i3,a4,' / atom ',i3,a4)
8000 format(///,' roby population analysis with modified atomic',
1 ' orbitals ')
8100 format(1x,'contributions of mos to shared electron number',
1 /,(10f10.5))
8200 format(1x,' shared electron number = ',f10.4)
8300 format(1x,'n( 1 2 3 ) = ',f10.5)
8350 format(///,' two center shared electron numbers '/)
8400 format(///,' three center shared electron numbers ge 0.01'/)
8450 format(///,' four center shared electron numbers ge 0.002'/)
8500 format(1x,'n(',3i3,') = ',f10.4,f10.6)
8550 format(1x,'n(',4i3,') = ',f10.4)
8600 format(//,' atomic charges with multicenter corrections',
1 /,' atom charge')
8650 format(//,' contributions of mos to occupation numbers')
8655 format(/,' atom nr ',i5,2x,a4,/,(12f10.6))
8700 format(1x,i5,a4,f10.4)
8800 format(//,' multicenter rest contribution = ',f10.6,
1 ' (correct sign for five center terms)')
8840 format(//,' three center shared electron number = ',f10.6)
8850 format(//,' four center shared electron number = ',f10.6)
8900 format(19a4)
9000 format(20i4)
9100 format(///' s matrix in mao basis'/)
9200 format(//)
9500 format(a1,i4,14i5)
9550 format(1x,2i5)
return
c
95 write(6,7200) itest,idmax,ishare
7200 format(1x,'itest = ',i8,' greater than idmax = ',i8,
1 ' in subroutine cntrcm for',i3,'-center sens',/,
2 ' enlarge all arrays of dimension nomx')
stop
end
c
c
subroutine spemu(su,uv,ssu,suv,mos,cint,rna,d,tol,itnr,ianr,
1 norb,nnc,roc,frocc,iatnr,rnmy,rnab,rnabc,rnabcd,nm,nat,idmax,
2 jatnr,katnr,nocm1,nocm2,nocp1)
implicit real*8(a-h,o-z)
dimension su(1),uv(1),ssu(1),suv(1),mos(1),cint(1),itnr(1),ianr(1)
dimension roc(1),frocc(1),iatnr(1),rnmy(1),rnab(nocm1,1),nat(1)
dimension rnabc(nocm2,nocm1,1),rnabcd(1),jatnr(nocp1),katnr(1)
c
iend=nm
do 310 j=1,nm-1
max=iatnr(1)
ind=1
do 320 i=2,iend
if(iatnr(i).lt.max) goto 320
max=iatnr(i)
ind=i
320 continue
jj=nm-j+1
iend=jj-1
iatnr(ind)=iatnr(jj)
310 iatnr(jj)=max
write(6,2000) (iatnr(i),i=1,nm)
c
ij=0
do 50 i=1,nm
i1=iatnr(i)
do 60 ii=nat(i1),nat(i1+1)-1
ij=ij+1
60 mos(ij)=ii
50 continue
itest=ij*ij
if(itest.gt.idmax) goto 99
call sen(su,uv,ssu,suv,mos,cint,rna,ij,d,tol,itnr,ianr,
1 norb,nnc,roc,frocc)
tmult=0.d0
do 100 i=1,nm
i1=iatnr(i)
tmult=tmult+rnmy(i1)
100 continue
tmult=tmult-rna
write(6,3500) tmult
if(nm.le.4) return
ipha=(-1)**(nm-1)
sum=ipha*rna
c
lmax=int(4.e+09)
do 10 i=1,nm
i1=iatnr(i)
sum=sum+rnmy(i1)
if(i.eq.1) goto 10
do 20 j=1,i-1
j1=iatnr(j)
sum=sum-rnab(j1,i1)
if(j.eq.1) goto 20
do 30 k=1,j-1
k1=iatnr(k)
sum=sum+rnabc(k1,j1,i1)
if(k.eq.1) goto 30
do 40 l=1,k-1
l1=iatnr(l)
index1=k1*(k1-3)/2+l1
index2=i1*(i1-3)/2+j1
index=index2*(index2-3)/2+index1
40 sum=sum-rnabcd(index)
30 continue
20 continue
10 continue
if(nm.eq.5) goto 410
c
do 110 i=5,nm-1
do 115 ii=1,i
katnr(ii)=ii
115 jatnr(ii)=iatnr(ii)
ij=0
do 81 k=1,i
i1=jatnr(k)
do 91 ii=nat(i1),nat(i1+1)-1
ij=ij+1
91 mos(ij)=ii
81 continue
itest=ij*ij
if(itest.gt.idmax) goto 99
call sen(su,uv,ssu,suv,mos,cint,rna,ij,d,tol,itnr,ianr,
1 norb,nnc,roc,frocc)
ipha=(-1)**(i-1)
sum=sum+ipha*rna
c
jatnr(i+1)=1000
jst=i
do 140 l=1,lmax
do 120 j=jst,i
do 130 k=jst+1,nm
if(iatnr(k).le.jatnr(j)) goto 130
if(iatnr(k).ge.jatnr(j+1)) goto 130
jatnr(j)=iatnr(k)
katnr(j)=k
ij=0
do 80 ll=1,i
i1=jatnr(ll)
do 90 ii=nat(i1),nat(i1+1)-1
ij=ij+1
90 mos(ij)=ii
80 continue
itest=ij*ij
if(itest.gt.idmax) goto 99
call sen(su,uv,ssu,suv,mos,cint,rna,ij,d,tol,itnr,ianr,
1 norb,nnc,roc,frocc)
ipha=(-1)**(i-1)
sum=sum+ipha*rna
130 continue
120 continue
ki=0
do 145 kk=1,i
if(jatnr(kk).ne.iatnr(nm-i+kk)) goto 145
ki=ki+1
if(ki.eq.i) goto 110
if(ki.eq.1) jst=kk-1
kkk=katnr(kk-1)+1
if(ki.eq.1) kkk=katnr(kk-1)+2
jatnr(kk)=iatnr(kkk)
katnr(kk)=kkk
145 continue
140 continue
110 continue
c
410 write(6,3000) sum
return
c
1000 format(a1,i2,20i3)
2000 format(///,' special multi center contribution for the atoms',/,
1 (20i5))
3000 format(1x,'multi center shared electron number =',f15.6,/)
3500 format(1x,'total contribution =',f15.6)
c
99 write(6,4000) itest,idmax
4000 format(1x,'itest = ',i8,' greater than idmax = ',i8,
1 ' in subroutine spemu for special multi center contributions',/,
2 ' enlarge all arrays of dimension nomx')
return
end
c
c
subroutine sen(su,uv,ssu,suv,mos,cint,rna,idim,d,tol,itnr,
1 ianr,norb,nnc,roc,frocc)
c
c calculation of shared electron numbers
c
implicit real*8 (a-h,o-z)
dimension su(1),uv(1),ssu(1),suv(1),mos(1),cint(1),itnr(1)
dimension ianr(1),roc(1),frocc(1)
c
c sort (mao)#*s*c on ssu
ij=0
do 10 i=1,norb
ind0=(i-1)*nnc
do 20 j=1,idim
ij=ij+1
ind=ind0+mos(j)
20 ssu(ij)=su(ind)
10 continue
c
c sort s(mao basis) on suv
ij=0
do 30 j=1,idim
ind0=(mos(j)-1)*nnc
do 40 i=1,idim
ind=ind0+mos(i)
ij=ij+1
40 suv(ij)=uv(ind)
30 continue
c
call osinv1(suv,idim,d,tol,itnr,ianr)
ij=0
do 60 i=1,idim
ind=(i-1)*idim
do 60 j=1,i
ij=ij+1
suv(ij)=suv(ind+j)
60 continue
call ukhud(ssu,suv,cint,roc,idim,norb)
c
rna=0.d0
do 50 i=1,norb
roc(i)=roc(i)*frocc(i)
50 rna=rna+roc(i)
return
end
c
c
subroutine ukhud(a,b,c,d,idim1,idim2)
c
c u# * triangle matrix * u , diagonalelements only
implicit real*8(a-h,o-z)
dimension a(1),b(1),c(1),d(1)
kl=0
ij=0
i10=-idim1
do 40 j=1,idim2
i10=i10+idim1
ij=0
do 50 k=1,idim1
cc=0.d0
ij=ij+1
i20=(k*k-k)/2
do 60 l=1,k
60 cc=cc+a(i10+l)*b(i20+l)
if(k.eq.idim1) goto 55
i20=k*(k+3)/2
do 70 l=k+1,idim1
cc=cc+a(i10+l)*b(i20)
70 i20=i20+l
55 c(ij)=cc
50 continue
m1=0
m2=(j-1)*idim1
kl=kl+1
dd=0.0d0
do 90 n=1,idim1
90 dd=dd+c(m1+n)*a(m2+n)
d(kl)=dd
40 continue
return
end
c
subroutine hypval(jatnr,mos,tol,ipr,ifile,non,
1 ncmax,ren,jfile,rtot)
c
c calculation of hypervalence populations
c
implicit real*8 (a-h,o-z)
parameter(nocmx=50,nbmx=720,nomx=250,lbuff=31375)
integer centr
dimension jatnr(1),mos(1)
common/scfinf/dmh(nomx),roc(nomx)
common /big/ y(nomx*nomx),su(nomx*nomx),uv(nomx*nomx)
common/muli/vlist(nocmx,4),ianr(nomx),centr(nocmx),itnr(nomx)
common /contrc/ chomo,ncont
iend=0
rtot=0.d0
write(6,1000)
do 100 ia=1,non
ist=iend+1
iend=iend+jatnr(ia)
nnc=ist-1
if(nnc.eq.0) goto 111
do 50 i=1,nnc
50 itnr(i)=i
111 continue
do 110 ii=ist,iend
if(mos(ii).eq.0) goto 110
nnc=nnc+1
itnr(nnc)=ii
110 continue
if(ia.eq.non) goto 121
do 120 ii=iend+1,ncont
nnc=nnc+1
itnr(nnc)=ii
120 continue
c
121 rewind ifile
read(ifile) (uv(iw),iw=1,ncmax)
rewind ifile
rewind jfile
read(jfile) (su(iw),iw=1,ncmax)
rewind jfile
call order(uv,su,itnr,nnc,ncont)
call osinv1(su,nnc,d,tol,itnr,ianr)
c
c calculate trace(mao*s*d*s*mao * s**-1)
rna=0.d0
do 910 i=1,nnc
a=0.d0
i1=i
i20=(i-1)*nnc
do 920 j=1,nnc
a=a+su(i1)*uv(i20+j)
920 i1=i1+nnc
rna=rna+a
910 continue
rna=ren-rna
dmh(ia)=rna
rtot=rtot+rna
write(6,2000) ia,centr(ia),rna
100 continue
c
1000 format(/' hypervalence contributions'//' unshared atomic',
1 ' populations')
2000 format(1x,'atom nr.',i3,1x,a4,5x,f10.6)
return
end
c
subroutine order(a,b,iord,idims,idimb)
implicit real*8(a-h,o-z)
dimension a(1),b(1),iord(1)
c sort matrix a an b according to vector iord
ij=0
do 10 j=1,idims
ind2=(iord(j)-1)*idimb
do 20 i=1,idims
ind=ind2+iord(i)
ij=ij+1
a(ij)=a(ind)
20 b(ij)=b(ind)
10 continue
return
end
c
c
subroutine hm(a,b,c,norb,ncont)
c triangle matrix(a) * full matrix(b)
implicit real*8(a-h,o-z)
dimension a(1),b(1),c(1)
ij=0
do 20 i=1,norb
ibst=(i-1)*ncont
do 30 j=1,ncont
ct=0.d0
ij=ij+1
iast=j*(j-1)/2
do 40 k=1,j
40 ct=ct+a(iast+k)*b(ibst+k)
if(j.eq.ncont) goto 29
iast=j*(j+3)/2
do 50 k=j+1,ncont
ct=ct+a(iast)*b(ibst+k)
50 iast=iast+k
29 c(ij)=ct
30 continue
20 continue
return
end
c
subroutine mkm(a,b,c,idima,idimab,idimb)
implicit real*8(a-h,o-z)
dimension a(1),b(1),c(1)
c (full matrix)# * full matrix
ij=0
do 10 i=1,idimb
iast=0
ibst=(i-1)*idimab
do 20 j=1,idima
ij=ij+1
v=0.d0
do 30 k=1,idimab
30 v=v+a(iast+k)*b(ibst+k)
c(ij)=v
20 iast=iast+idimab
10 continue
return
end
c
c
c
c
subroutine sort(a,b,nr,non,iswi,ncmax)
c sorting of matrices in atom blocked matrices
implicit real*8(a-h,o-z)
dimension a(1),b(1),nr(1)
c iswi=0: full matrix in atom blocked matrix
ij=0
if(iswi.eq.1) goto 30
jend=0
do 10 i=1,non
jst=jend+1
jend=jend+nr(i)
do 10 j=jst,jend
kkst=(j*j-j)/2
do 10 k=jst,j
ij=ij+1
kl=kkst+k
b(ij)=a(kl)
10 continue
return
c iswi=1: atom blocked matrix in full matrix
30 iofs=0
ndim=0
do 35 i=1,non
35 ndim=ndim+nr(i)
do 38 i=1,ncmax
38 b(i)=0.d0
iaa=0
kl=0
do 40 i=1,non
ia=nr(i)
iaa=iaa+ia
do 50 j=1,ia
do 60 k=1,ia
ij=ij+1
kl=kl+1
60 b(kl)=a(ij)
kl=kl+ndim-iaa+iofs
50 continue
kl=kl+ia
iofs=iofs+ia
40 continue
return
end
c
c
c
c
c
c
subroutine uduk(a,b,c,nr,non,ndim)
c u# * vector * u
implicit real*8(a-h,o-z)
dimension a(1),b(1),c(1),nr(1)
do 10 i=1,ndim
10 c(i)=0.d0
ii=0
ijst=0
iist=0
do 20 l=1,non
ia=nr(l)
do 30 i=1,ia
ii=ii+1
ij=ijst
ist=iist+(i-1)*ia
do 40 j=1,ia
iu=ist+j
do 40 k=1,j
ij=ij+1
ju=ist+k
40 c(ij)=c(ij)+a(iu)*b(ii)*a(ju)
30 continue
ijst=ij
iist=iu
20 continue
return
end
c
c
subroutine ukhu(a,b,c,d,ncont,nc)
c u# * triangle matrix * u
implicit real*8(a-h,o-z)
dimension a(1),b(1),c(1),d(1)
i10=-ncont
do 40 j=1,nc
i10=i10+ncont
ij=0
i11=i10+1
do 50 k=1,ncont
ij=ij+1
i20=(k*k-k)/2
i21=i20+1
cij = 0.0d0
eij = 0.0d0
if (k. eq. 1) go to 110
do 60 l = 1, k-1, 2
cij = cij + a(i10+l) * b(i20+l)
60 eij = eij + a(i11+l) * b(i21+l)
if (mod(k,2) .eq. 0) go to 120
110 continue
cij = cij + a(i10+k) * b(i20+k)
120 continue
if(k.eq.ncont) goto 49
loff = (k+3) * k / 2
if (k+1 .eq .ncont) go to 130
do 70 l=k+1,ncont-1,2
cij=cij+a(i10+l) * b(loff)
eij=eij+a(i11+l) * b(loff+l)
70 loff = loff + l + l + 1
if (mod(ncont-k,2) .eq. 0) go to 49
130 cij=cij+a(i10+ncont) * b(loff)
49 c(ij) = cij+eij
50 continue
m2=0
do 80 m=1,nc
kl=(m-1)*nc+j
dkl=0.d0
fkl=0.0d0
m21 = m2 + 1
if (ncont .eq. 1) go to 140
do 90 n=1,ncont-1,2
dkl=dkl+c(n)*a(m2+n)
90 fkl=fkl+c(n+1)*a(m21+n)
if(mod(ncont,2) .eq. 0) go to 150
140 dkl = dkl + c(ncont) * a(m2+ncont)
150 continue
d(kl)=dkl+fkl
m2=m2+ncont
80 continue
40 continue
return
end
c
c
subroutine osinv1(a,n,d,tol,l,m)
c inversion of a full matrix
implicit real*8 (a-h,o-z)
dimension a(1),m(1),l(1)
if(n.ne.1) goto 5
a(1)=1.0/a(1)
return
5 d=1.d0
nk=-n
do 180 k=1,n
nk=nk+n
l(k)=k
m(k)=k
kk=nk+k
biga=a(kk)
do 20 j=k,n
iz=n*(j-1)
do 20 i=k,n
ij=iz+i
if(abs(biga)-abs(a(ij))) 10,20,20
10 biga=a(ij)
l(k)=i
m(k)=j
20 continue
j=l(k)
if(j-k) 50,50,30
30 ki=k-n
do 40 i=1,n
ki=ki+n
holo=-a(ki)
ji=ki-k+j
a(ki)=a(ji)
40 a(ji)=holo
50 i=m(k)
if(i-k) 80,80,60
60 jp=n*(i-1)
do 70 j=1,n
jk=nk+j
ji=jp+j
holo=-a(jk)
a(jk)=a(ji)
70 a(ji)=holo
80 if(abs(biga)-tol) 90,100,100
90 d=0.d0
return
100 continue
biginv = -1.0d0 / biga
do 120 i=1,n
a(nk+i)=a(nk+i)*biginv
120 continue
a(nk+k) = a(nk+k) * (-biga)
joff = 0
do 155 j=1,n
if(j. eq. k) go to 154
ajk = a(joff+k)
if (k .eq. 1) go to 152
do 151 i=1,k-1
151 a(joff+i) = a(joff+i) + a(nk+i) * ajk
152 continue
if (k .eq. n) go to 154
do 153 i=k+1,n
153 a(joff+i) = a(joff+i) + a(nk+i) * ajk
154 continue
joff = joff + n
155 continue
kj=k-n
biginv=-biginv
do 170 j=1,n
kj=kj+n
a(kj)=a(kj)*biginv
170 continue
kadd = (k-1)*n + k
a(kadd) = a(kadd) * biga
d=d*biga
a(kk)=biginv
180 continue
k=n
190 k=k-1
if(k) 260,260,200
200 i=l(k)
if(i-k) 230,230,210
210 jq=n*(k-1)
jr=n*(i-1)
do 220 j=1,n
jk=jq+j
holo=a(jk)
ji=jr+j
a(jk)=-a(ji)
220 a(ji)=holo
230 j=m(k)
if(j-k) 190,190,240
240 ki=k-n
do 250 i=1,n
ki=ki+n
holo=a(ki)
ji=ki+j-k
a(ki)=-a(ji)
250 a(ji)=holo
goto 190
260 return
end
c
c
subroutine h1h2h1(a,b,c,d,nr,non,max)
c matrix * matrix * matrix (three triangle matrices)
implicit real*8(a-h,o-z)
dimension a(1),b(1),c(1),d(1),nr(1)
do 10 i=1,max
10 d(i)=0.d0
iofs=0
kl=0
do 20 i=1,non
ia=nr(i)
do 30 j=1,ia
ij=0
i10=iofs+j*(j-1)/2
jj=iofs+j
do 40 k=1,ia
i2=iofs+k*(k-1)/2
ij=ij+1
c(ij)=0.d0
do 50 l=1,k
i1=i10+l
if(l.gt.j) i1=l*(l-1)/2+jj
i2=i2+1
50 c(ij)=c(ij)+a(i1)*b(i2)
if(k.eq.ia) goto 40
i20=iofs+k
do 55 l=k+1,ia
i1=i10+l
if(l.gt.j) i1=l*(l-1)/2+jj
i2=i20+l*(l-1)/2
55 c(ij)=c(ij)+a(i1)*b(i2)
40 continue
do 60 m=1,j
mm=iofs+m
kl=kl+1
m20=m*(m-1)/2+iofs
do 70 n=1,ia
m2=m20+n
if(n.gt.m) m2=n*(n-1)/2+mm
70 d(kl)=d(kl)+c(n)*a(m2)
60 continue
30 continue
iofs=iofs+ia*(ia+1)/2
20 continue
return
end
c
c
function noteqv(i,j)
implicit real*8(a-h,o-z)
noteqv = i-j
return
end
c
c
real*8 function ggntde(i,j,eta,nfmx,nfcol)
implicit real*8(a-h,o-z)
dimension eta(nfmx,nfcol)
dimension aa(3),bb(3),a(10),b(10),e(3)
data c2/2.0d0/,c3/3.0d0/,const/15.7496099d0/
do 1 m=1,3
aa(m) = eta(i,m)
1 bb(m) = eta(j,m)
iff1=eta(i,5)+0.0001
iff2=eta(j,5)+0.0001
do 2 m=1,10
a(m) = eta(i,m+5)
2 b(m) = eta(j,m+5)
call divpt(aa,eta(i,4),bb,eta(j,4),e,eexp,efact)
call rhftce(a,aa,e,iff1)
call rhftce(b,bb,e,iff2)
fexp=c2*eexp
ggntde = efact*const*(a(1)*b(1)+(a(2)*b(2
1)+a(3)*b(3)+a(4)*b(4)+a(1)*(b(5)+b(6)+b(7))+b(1)*(a(5)+a(6)+a(7))+
2 (c3*(a(5)*b(5)+a(6)*b(6)+a(7)*b(7))+a(8)*b(8)+a(9)*b(9)+a(10)*b(1
30)+a(5)*(b(6)+b(7))+a(6)*(b(5)+b(7))+a(7)*(b(5)+b(6)))/fexp)/fexp)
4/(fexp*sqrt(fexp))
return
end
c
c
subroutine rhftce(cfs,a,e,iff)
implicit real*8(a-h,o-z)
dimension cfs(20) ,a(3),e(3)
data c2/2.0d0/,c3/3.0d0/
aex = e(1)-a(1)
aey = e(2)-a(2)
aez = e(3)-a(3)
goto (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20),iff
1 return
2 cfs(1)=aex*cfs(2)
return
3 cfs(1)=aey*cfs(3)
return
4 cfs(1)=aez*cfs(4)
return
5 cfs(1)=aex*aex*cfs(5)
cfs(2)=c2*aex*cfs(5)
return
6 cfs(1)=aey*aey*cfs(6)
cfs(3)=c2*aey*cfs(6)
return
7 cfs(1)=aez*aez*cfs(7)
cfs(4)=c2*aez*cfs(7)
return
8 cfs(1)=aex*aey*cfs(8)
cfs(2)=aey*cfs(8)
cfs(3)=aex*cfs(8)
return
9 cfs(1)=aex*aez*cfs(9)
cfs(2)=aez*cfs(9)
cfs(4)=aex*cfs(9)
return
10 cfs(1)=aey*aez*cfs(10)
cfs(3)=aez*cfs(10)
cfs(4)=aey*cfs(10)
return
11 cfs(1)=aex*aex*aex*cfs(11)
cfs(2)=c3*aex*aex*cfs(11)
cfs(5)=c3*aex*cfs(11)
return
12 cfs(1)=aey*aey*aey*cfs(12)
cfs(3)=c3*aey*aey*cfs(12)
cfs(6)=c3*aey*cfs(12)
return
13 cfs(1)=aez*aez*aez*cfs(13)
cfs(4)=c3*aez*aez*cfs(13)
cfs(7)=c3*aez*cfs(13)
return
14 cfs(1)=aex*aex*aey*cfs(14)
cfs(2)=c2*aex*aey*cfs(14)
cfs(3)=aex*aex*cfs(14)
cfs(5)=aey*cfs(14)
cfs(8)=c2*aex*cfs(14)
return
15 cfs(1)=aex*aex*aez*cfs(15)
cfs(2)=c2*aex*aez*cfs(15)
cfs(4)=aex*aex*cfs(15)
cfs(5)=aez*cfs(15)
cfs(9)=c2*aex*cfs(15)
return
16 cfs(1)=aey*aey*aex*cfs(16)
cfs(2)=aey*aey*cfs(16)
cfs(3)=c2*aey*aex*cfs(16)
cfs(6)=aex*cfs(16)
cfs(8)=c2*aey*cfs(16)
return
17 cfs(1)=aey*aey*aez*cfs(17)
cfs(3)=c2*aey*aez*cfs(17)
cfs(4)=aey*aey*cfs(17)
cfs(6)=aez*cfs(17)
cfs(10)=c2*aey*cfs(17)
return
18 cfs(1)=aez*aez*aex*cfs(18)
cfs(2)=aez*aez*cfs(18)
cfs(4)=c2*aez*aex*cfs(18)
cfs(7)=aex*cfs(18)
cfs(9)=c2*aez*cfs(18)
return
19 cfs(1)=aez*aez*aey*cfs(19)
cfs(3)=aez*aez*cfs(19)
cfs(4)=c2*aez*aey*cfs(19)
cfs(7)=aey*cfs(19)
cfs(10)=c2*aez*cfs(19)
return
20 cfs(1)=aex*aey*aez*cfs(20)
cfs(2)=aez*aey*cfs(20)
cfs(3)=aex*aez*cfs(20)
cfs(4)=aex*aey*cfs(20)
cfs(8)=aez*cfs(20)
cfs(9)=aey*cfs(20)
cfs(10)=aex*cfs(20)
return
end
c
c
subroutine dumdum(nuc,noc,vlist,c,dint,nro,nocmx,nt)
implicit real*8(a-h,o-z)
dimension vlist(nocmx,4), c(1), dint(nro,1)
call nuc(noc,vlist,c,dint,nro,nocmx,nt)
return
end
c
c
subroutine nonuc(noc,vlist,c,dint,nro,nocmx,nt)
c for properties without nuclear part
implicit real*8(a-h,o-z)
dimension dint(nro,1)
dint(1,1)=0.0d0
nt = 1
return
end
c
c
subroutine fldnuc(noc,vlist,c,dint,nro,nocmx,nt)
c nuclear part of electric field
implicit real*8(a-h,o-z)
dimension dint(nro,1),vlist(nocmx ,4),c(3) ,fnuc(3)
do20 i=1,3
20 fnuc(i)=0.0d0
do21 i=1,noc
dst=(vlist(i,1)-c(1))**2+(vlist(i,2)-c(2))**2+(vlist(i,3)-c(3))**2
if(dst.eq.0.0d0) go to 21
do 23 j=1,3
fnuc(j)=fnuc(j)+vlist(i,4)*(vlist(i,j)-c(j))/(sqrt(dst))**3
23 continue
21 continue
do22 l=1,3
22 dint(1,l) = -fnuc(l)
nt = 3
return
end
c
c
subroutine potnuc(noc,vlist,c,dint,nro,nocmx,nt)
c nuclear part of potential
implicit real*8(a-h,o-z)
dimension dint(nro,1),vlist(nocmx ,4),c(3)
pnuc=0.0d0
do 12 i=1,noc
dst=(vlist(i,1)-c(1))**2+(vlist(i,2)-c(2))**2+(vlist(i,3)-c(3))**2
if(dst.eq.0.0d0)go to 12
pnuc=pnuc+vlist(i,4)/sqrt(dst)
12 continue
dint(1,1)=pnuc
nt = 1
return
end
c
c
subroutine grdnuc(noc,vlist,c,dint,nro,nocmx,nt)
c nuclear part of field gradient
implicit real*8(a-h,o-z)
dimension dint(nro,*),vlist(nocmx ,4),c(3) ,gnuc(6)
do 30 i=1,6
30 gnuc(i)=0.0d0
do 31 i=1,noc
dst=(vlist(i,1)-c(1))**2+(vlist(i,2)-c(2))**2+(vlist(i,3)-c(3))**2
if(dst.eq.0.0d0) go to 31
mu=0
do 32 j=1,3
do 33 k=1,j
mu=mu+1
gnuc(mu)=gnuc(mu)+vlist(i,4)*(vlist(i,j)-c(j))*(vlist(i,k)-c(k))
1/(sqrt(dst))**5
33 continue
32 continue
31 continue
dst=gnuc(1)+gnuc(3)+gnuc(6)
dint(1,1)=3.0d0*gnuc(1)-dst
dint(1,2)=3.0d0*gnuc(3)-dst
dint(1,3)=3.0d0*gnuc(6)-dst
dint(1,4)=gnuc(2)*3.0d0
dint(1,5)=gnuc(4)*3.0d0
dint(1,6)=gnuc(5)*3.0d0
do 40 i=1,6
40 dint(1,i) = - dint(1,i)
nt = 6
return
end
c
c
subroutine magnuc(noc,vlist,c,dint,nro,nocmx,nt)
c nuclear part of second moment
implicit real*8(a-h,o-z)
dimension dint(nro,*),vlist(nocmx ,4),c(3) ,qnuc(6)
do50 i=1,6
50 qnuc(i)=0.0d0
do 51 i=1,noc
mu=0
do52 j=1,3
do53 k=1,j
mu=mu+1
qnuc(mu)=qnuc(mu)+vlist(i,4)*(vlist(i,j)-c(j))*(vlist(i,k)-c(k))
53 continue
52 continue
51 continue
dint(1,1)=qnuc(1)
dint(1,2)=qnuc(3)
dint(1,3)=qnuc(6)
dint(1,4)=qnuc(2)
dint(1,5)=qnuc(4)
dint(1,6)=qnuc(5)
nt = 6
return
end
c
c
subroutine qudnuc(noc,vlist,c,dint,nro,nocmx,nt)
c nuclear part of quadropole moment
implicit real*8(a-h,o-z)
dimension dint(nro,*),vlist(nocmx ,*),c(3) ,qnuc(6)
data c3/3.0d0/
do50 i=1,6
50 qnuc(i)=0.0d0
do 51 i=1,noc
mu=0
do52 j=1,3
do53 k=1,j
mu=mu+1
qnuc(mu)=qnuc(mu)+vlist(i,4)*(vlist(i,j)-c(j))*(vlist(i,k)-c(k))
53 continue
52 continue
51 continue
dint(1,1)=qnuc(1)
dint(1,2)=qnuc(3)
dint(1,3)=qnuc(6)
dint(1,4)=qnuc(2)*1.5d0
dint(1,5)=qnuc(4)*1.5d0
dint(1,6)=qnuc(5)*1.5d0
dint(1,7)=dint(1,1)+dint(1,2)+dint(1,3)
dint(1,1)=(c3*dint(1,1)-dint(1,7))/2.d0
dint(1,2)=(c3*dint(1,2)-dint(1,7))/2.d0
dint(1,3) =(c3*dint(1,3)-dint(1,7))/2.d0
nt=7
return
end
c
c
subroutine dipnuc(noc,vlist,c,dint,nro,nocmx,nt)
c nuclear part of dipole moment
implicit real*8(a-h,o-z)
dimension dint(nro,*),vlist(nocmx ,4),c(3) ,dnuc(3)
do40 i=1,3
40 dnuc(i)=0.0d0
do41 i=1,noc
do41 j=1,3
41 dnuc(j)=dnuc(j)+vlist(i,4)*(vlist(i,j)-c(j))
do42 k=1,3
42 dint(1,k)=dnuc(k)
nt = 3
return
end
c
c
subroutine octnuc(noc,vlist,c,dint,nro,nocmx,nt)
c nuclear part of third moment
implicit real*8(a-h,o-z)
dimension dint(nro,*),vlist(nocmx,4),c(*),onuc(10)
do60 i=1,10
60 onuc(i)=0.0d0
do61 i=1,noc
mu=0
do62 j=1,3
do63 k=1,j
do64 m=1,k
mu=mu+1
onuc(mu)=onuc(mu)+vlist(i,4)*(vlist(i,j)-c(j))*(vlist(i,k)-c(k))*(
1vlist(i,m)-c(m))
64 continue
63 continue
62 continue
61 continue
dint(1,1)=onuc(1)
dint(1,2)=onuc(4)
dint(1,3)=onuc(10)
dint(1,4)=onuc(2)
dint(1,5)=onuc(5)
dint(1,6)=onuc(3)
dint(1,7)=onuc(7)
dint(1,8)=onuc(8)
dint(1,9)=onuc(9)
dint(1,10)=onuc(6)
nt = 10
return
end
c
c
subroutine sldnuc(noc,vlist,c,dint,nro,nocmx,nt)
c nuclear part of diamagnetic shielding
implicit real*8(a-h,o-z)
dimension dint(nro,*),vlist(nocmx,4),c(3),pnuc(6)
do 30 i=1,6
30 pnuc(i)=0.d0
do 31 i=1,noc
dst=(vlist(i,1)-c(1))**2+(vlist(i,2)-c(2))**2+(vlist(i,3)-c(3))**2
if(dst.lt.1.d-10) go to 31
mu=0
do 32 j=1,3
do 33 k=1,j
mu=mu+1
pnuc(mu)=pnuc(mu)+vlist(i,4)*(vlist(i,j)-c(j))*(vlist(i,k)-c(k))
1/(sqrt(dst))**3
33 continue
32 continue
31 continue
dint(1,1)=pnuc(1)
dint(1,2)=pnuc(3)
dint(1,3)=pnuc(6)
dint(1,4)=pnuc(2)
dint(1,5)=pnuc(4)
dint(1,6)=pnuc(5)
dint(1,7)=dint(1,1)+dint(1,2)+dint(1,3)
nt=7
return
end
c
c
subroutine propa(name,ij,kl,eta,va,c,nt,nbmx)
implicit real*8(a-h,o-z)
common /abfunc/ ra(3),rb(3),ga,gb,ia,ib
c this common-block is used in subroutine opap4 only
dimension eta(nbmx,15)
dimension va(1),c(1)
dimension a(3),b(3),e(3),d(3),aa(20),bb(20),dd(84),v(10),val(10)
dimension lin(84),min(84),nin(84)
data lin/0,1,0,0,2,0,0,1,1,0,3,0,0,2,2,1,0,1,0,1,4,0,0,3,3,1,0,1,0
1 ,2,2,0,2,1,1,5,0,0,3,3,2,2,0,0,4,4,1,0,0,1,1,3,1,2,2,1,6,0,0,3,
2 3,0,5,5,1,0,0,1,4,4,2,0,2,0,3,3,1,2,2,1,4,1,1,2/,min/0,0,1,0,0,
3 2,0,1,0,1,0,3,0,1,0,2,2,0,1,1,0,4,0,1,0,3,3,0,1,2,0,2,1,2,1,0,5,
4 0,2,0,3,0,3,2,1,0,4,4,1,0,1,1,3,2,1,2,0,6,0,3,0,3,1,0,0,1,5,5,2,0
5,0,2,4,4,2,1,3,1,3,2,1,4,1,2/,nin/0,0,0,1,0,0,2,0,1,1,0,0,3,0,1,0,
6 1,2,2,1,0,0,4,0,1,0,1,3,3,0,2,2,1,1,2,0,0,5,0,2,0,3,2,3,0,1,0,1,
7 4,4,3,1,1,1,2,2,0,0,6,0,3,3,0,1,5,5,1,0,0,2,4,4,0,2,1,2,2,3,1,3,
8 1,1,4,2/
do 10 i=1,3
a(i)=eta(ij,i)
b(i)=eta(kl,i)
ra(i)=a(i)
rb(i)=b(i)
10 continue
ga=eta(ij,4)
gb=eta(kl,4)
do 20 i=1,20
aa(i)=eta(ij,i+5)
bb(i)=eta(kl,i+5)
20 continue
iff1=eta(ij,5)+0.0001
iff2=eta(kl,5)+0.0001
ia=iff1
ib=iff2
call divpt(a,eta(ij,4),b,eta(kl,4),e,gama,efact)
call rhftce(aa,a,e,iff1)
call rhftce(bb,b,e,iff2)
call prod(aa,bb,dd,iff1,iff2)
do 30 i=1,nt
val(i)=0.d0
30 continue
do 25 i=1,3
d(i)=e(i)-c(i)
25 continue
c name represents an external function
if(iff1.gt.10.or.iff2.gt.10) goto 110
if(iff1.gt.4.or.iff2.gt.4) goto 120
if(iff1.gt.1.or.iff2.gt.1) goto 130
c s - s
call name(lin(1),min(1),nin(1),gama,v,d)
do 50 j=1,nt
val(j)=dd(1)*v(j)+val(j)
50 continue
do 70 i=1,nt
va(i)=efact*val(i)
70 continue
return
130 continue
if(iff1.ne.1.and.iff2.ne.1) goto 131
c s - p
do 61 i=1,4
if(abs(dd(i))-1.d-8) 61,61,41
41 call name(lin(i),min(i),nin(i),gama,v,d)
do 51 j=1,nt
val(j)=dd(i)*v(j)+val(j)
51 continue
61 continue
do 71 i=1,nt
va(i)=efact*val(i)
71 continue
return
131 continue
c p - p
do 62 i=1,10
if(abs(dd(i))-1.d-8) 62,62,42
42 call name(lin(i),min(i),nin(i),gama,v,d)
do 52 j=1,nt
val(j)=dd(i)*v(j)+val(j)
52 continue
62 continue
do 72 i=1,nt
va(i)=efact*val(i)
72 continue
return
120 continue
if(iff1.ne.1.and.iff2.ne.1) goto 121
c s - d
do 63 i=1,10
if(abs(dd(i))-1.d-8) 63,63,43
43 call name(lin(i),min(i),nin(i),gama,v,d)
do 53 j=1,nt
val(j)=dd(i)*v(j)+val(j)
53 continue
63 continue
do 73 i=1,nt
va(i)=efact*val(i)
73 continue
return
121 continue
if(iff1.gt.4.and.iff2.gt.4) goto 122
c p - d
do 64 i=1,20
if(abs(dd(i))-1.d-8) 64,64,44
44 call name(lin(i),min(i),nin(i),gama,v,d)
do 54 j=1,nt
val(j)=dd(i)*v(j)+val(j)
54 continue
64 continue
do 74 i=1,nt
va(i)=efact*val(i)
74 continue
return
122 continue
c d - d
do 65 i=1,35
if(abs(dd(i))-1.d-8) 65,65,45
45 call name(lin(i),min(i),nin(i),gama,v,d)
do 55 j=1,nt
val(j)=dd(i)*v(j)+val(j)
55 continue
65 continue
do 75 i=1,nt
va(i)=efact*val(i)
75 continue
return
110 continue
if(iff1.ne.1.and.iff2.ne.1) goto 111
c s - f
do 66 i=1,20
if(abs(dd(i))-1.d-8) 66,66,46
46 call name(lin(i),min(i),nin(i),gama,v,d)
do 56 j=1,nt
val(j)=dd(i)*v(j)+val(j)
56 continue
66 continue
do 76 i=1,nt
va(i)=efact*val(i)
76 continue
return
111 continue
if(iff1.gt.4.and.iff2.gt.4) goto 112
c p - f
do 67 i=1,35
if(abs(dd(i))-1.d-8) 67,67,47
47 call name(lin(i),min(i),nin(i),gama,v,d)
do 57 j=1,nt
val(j)=dd(i)*v(j)+val(j)
57 continue
67 continue
do 77 i=1,nt
va(i)=efact*val(i)
77 continue
return
112 continue
if(iff1.gt.10.and.iff2.gt.10) goto 113
c d - f
do 68 i=1,56
if(abs(dd(i))-1.d-8) 68,68,48
48 call name(lin(i),min(i),nin(i),gama,v,d)
do 58 j=1,nt
val(j)=dd(i)*v(j)+val(j)
58 continue
68 continue
do 78 i=1,nt
va(i)=efact*val(i)
78 continue
return
113 continue
c f - f
do 69 i=1,84
if(abs(dd(i))-1.d-8) 69,69,49
49 call name(lin(i),min(i),nin(i),gama,v,d)
do 59 j=1,nt
val(j)=dd(i)*v(j)+val(j)
59 continue
69 continue
do 79 i=1,nt
va(i)=efact*val(i)
79 continue
return
end
c
c
real*8 function olap(l,m,n,gama)
implicit real*8(a-h,o-z)
dimension dftr(7)
data pi /3.14159265359d0/
data dftr /1.d0,1.d0,3.d0,15.d0,105.d0,945.d0,10395.d0/
lh=l/2
mh=m/2
nh=n/2
if(2*lh-l) 50,1,50
1 if(2*mh-m) 50,2,50
2 if(2*nh-n) 50,3,50
3 hf=.5d0
olap=(sqrt(pi/gama))**3*(hf/gama)**(lh+mh+nh)*dftr(lh+1)*dftr(mh+
11)*dftr(nh+1)
return
50 olap=0.d0
return
end
c
c
subroutine prod(c,d,s,iff1,iff2)
implicit real*8(a-h,o-z)
dimension c(20),d(20),s(84)
do 10 i=1,84
10 s(i)=0.d0
if(iff1.gt.10.or.iff2.gt.10) goto 30
if(iff1.gt.4.or.iff2.gt.4) goto 20
s( 1)=c( 1)*d( 1)
c end of s - s
if(iff1.eq.1.and.iff2.eq.1) return
s( 2)=c( 1)*d( 2)+c( 2)*d( 1)
s( 3)=c( 1)*d( 3)+c( 3)*d( 1)
s( 4)=c( 1)*d( 4)+c( 4)*d( 1)
c end of s - p
if(iff1.eq.1.or.iff2.eq.1) return
s( 5)=c( 2)*d( 2)
s( 6)=c( 3)*d( 3)
s( 7)=c( 4)*d( 4)
s( 8)=c( 2)*d( 3)+c( 3)*d( 2)
s( 9)=c( 2)*d( 4)+c( 4)*d( 2)
s(10)=c( 3)*d( 4)+c( 4)*d( 3)
c end of p - p
return
20 continue
s( 1)=c( 1)*d( 1)
s( 2)=c( 1)*d( 2)+c( 2)*d( 1)
s( 3)=c( 1)*d( 3)+c( 3)*d( 1)
s( 4)=c( 1)*d( 4)+c( 4)*d( 1)
s( 5)=c( 1)*d( 5)+c( 5)*d( 1)+c( 2)*d( 2)
s( 6)=c( 1)*d( 6)+c( 6)*d( 1)+c( 3)*d( 3)
s( 7)=c( 1)*d( 7)+c( 7)*d( 1)+c( 4)*d( 4)
s( 8)=c( 1)*d( 8)+c( 8)*d( 1)+c( 2)*d( 3)+c( 3)*d( 2)
s( 9)=c( 1)*d( 9)+c( 9)*d( 1)+c( 2)*d( 4)+c( 4)*d( 2)
s(10)=c( 1)*d(10)+c(10)*d( 1)+c( 3)*d( 4)+c( 4)*d( 3)
c end of s - d
if(iff1.eq.1.or.iff2.eq.1) return
s(11)=c( 2)*d( 5)+c( 5)*d( 2)
s(12)=c( 3)*d( 6)+c( 6)*d( 3)
s(13)=c( 4)*d( 7)+c( 7)*d( 4)
s(14)=c( 2)*d( 8)+c( 8)*d( 2)+c( 3)*d( 5)+c( 5)*d( 3)
s(15)=c( 2)*d( 9)+c( 9)*d( 2)+c( 4)*d( 5)+c( 5)*d( 4)
s(16)=c( 2)*d( 6)+c( 6)*d( 2)+c( 3)*d( 8)+c( 8)*d( 3)
s(17)=c( 3)*d(10)+c(10)*d( 3)+c( 4)*d( 6)+c( 6)*d( 4)
s(18)=c( 2)*d( 7)+c( 7)*d( 2)+c( 4)*d( 9)+c( 9)*d( 4)
s(19)=c( 3)*d( 7)+c( 7)*d( 3)+c( 4)*d(10)+c(10)*d( 4)
s(20)=c( 2)*d(10)+c(10)*d( 2)+c( 3)*d( 9)
1 +c( 9)*d( 3)+c( 4)*d( 8)+c( 8)*d( 4)
c end of p - d
if(iff1.lt.5.or.iff2.lt.5) return
s(21)=c( 5)*d( 5)
s(22)=c( 6)*d( 6)
s(23)=c( 7)*d( 7)
s(24)=c( 5)*d( 8)+c( 8)*d( 5)
s(25)=c( 5)*d( 9)+c( 9)*d( 5)
s(26)=c( 6)*d( 8)+c( 8)*d( 6)
s(27)=c( 6)*d(10)+c(10)*d( 6)
s(28)=c( 7)*d( 9)+c( 9)*d( 7)
s(29)=c( 7)*d(10)+c(10)*d( 7)
s(30)=c( 5)*d( 6)+c( 6)*d( 5)+c( 8)*d( 8)
s(31)=c( 5)*d( 7)+c( 7)*d( 5)+c( 9)*d( 9)
s(32)=c( 6)*d( 7)+c( 7)*d( 6)+c(10)*d(10)
s(33)=c( 5)*d(10)+c(10)*d( 5)+c( 8)*d( 9)+c( 9)*d( 8)
s(34)=c( 6)*d( 9)+c( 9)*d( 6)+c( 8)*d(10)+c(10)*d( 8)
s(35)=c( 7)*d( 8)+c( 8)*d( 7)+c( 9)*d(10)+c(10)*d( 9)
c end of d - d
return
30 continue
s( 1)=c( 1)*d( 1)
s( 2)=c( 1)*d( 2)+c( 2)*d( 1)
s( 3)=c( 1)*d( 3)+c( 3)*d( 1)
s( 4)=c( 1)*d( 4)+c( 4)*d( 1)
s( 5)=c( 1)*d( 5)+c( 5)*d( 1)+c( 2)*d( 2)
s( 6)=c( 1)*d( 6)+c( 6)*d( 1)+c( 3)*d( 3)
s( 7)=c( 1)*d( 7)+c( 7)*d( 1)+c( 4)*d( 4)
s( 8)=c( 1)*d( 8)+c( 8)*d( 1)+c( 2)*d( 3)+c( 3)*d( 2)
s( 9)=c( 1)*d( 9)+c( 9)*d( 1)+c( 2)*d( 4)+c( 4)*d( 2)
s(10)=c( 1)*d(10)+c(10)*d( 1)+c( 3)*d( 4)+c( 4)*d( 3)
s(11)=c( 2)*d( 5)+c( 5)*d( 2)+c(1)*d(11)+c(11)*d(1)
s(12)=c( 3)*d( 6)+c( 6)*d( 3)+c(1)*d(12)+c(12)*d(1)
s(13)=c( 4)*d( 7)+c( 7)*d( 4)+c(1)*d(13)+c(13)*d(1)
s(14)=c( 2)*d( 8)+c( 8)*d( 2)+c( 3)*d( 5)+c( 5)*d( 3)+c(1)*d(14)+
1 c(14)*d(1)
s(15)=c( 2)*d( 9)+c( 9)*d( 2)+c( 4)*d( 5)+c( 5)*d( 4)+c(1)*d(15)+
1 c(15)*d(1)
s(16)=c( 2)*d( 6)+c( 6)*d( 2)+c( 3)*d( 8)+c( 8)*d( 3)+c(1)*d(16)+
1 c(16)*d(1)
s(17)=c( 3)*d(10)+c(10)*d( 3)+c( 4)*d( 6)+c( 6)*d( 4)+c(1)*d(17)+
1 c(17)*d(1)
s(18)=c( 2)*d( 7)+c( 7)*d( 2)+c( 4)*d( 9)+c( 9)*d( 4)+c(1)*d(18)+
1 c(18)*d(1)
s(19)=c( 3)*d( 7)+c( 7)*d( 3)+c( 4)*d(10)+c(10)*d( 4)+c(1)*d(19)+
1 c(19)*d(1)
s(20)=c( 2)*d(10)+c(10)*d( 2)+c( 3)*d( 9)+c(9)*d(3)+c(4)*d(8)+
1 c(8)*d(4)+c(1)*d(20)+c(20)*d(1)
c end of s - f
if(iff1.eq.1.or.iff2.eq.1) return
s(21)=c( 5)*d( 5)+c(2)*d(11)+c(11)*d(2)
s(22)=c( 6)*d( 6)+c(3)*d(12)+c(12)*d(3)
s(23)=c( 7)*d( 7)+c(4)*d(13)+c(13)*d(4)
s(24)=c( 5)*d( 8)+c( 8)*d( 5)+c(3)*d(11)+c(11)*d(3)+c(2)*d(14)+
1 c(14)*d(2)
s(25)=c( 5)*d( 9)+c( 9)*d( 5)+c(2)*d(15)+c(15)*d(2)+c(4)*d(11)+
1 c(11)*d(4)
s(26)=c( 6)*d( 8)+c( 8)*d( 6)+c(2)*d(12)+c(12)*d(2)+c(3)*d(16)+
1 c(16)*d(3)
s(27)=c( 6)*d(10)+c(10)*d( 6)+c(3)*d(17)+c(17)*d(3)+c(4)*d(12)+
1 c(12)*d(4)
s(28)=c( 7)*d( 9)+c( 9)*d( 7)+c(2)*d(13)+c(13)*d(2)+c(4)*d(18)+
1 c(18)*d(4)
s(29)=c( 7)*d(10)+c(10)*d( 7)+c(3)*d(13)+c(13)*d(3)+c(4)*d(19)+
1 c(19)*d(4)
s(30)=c( 5)*d( 6)+c( 6)*d( 5)+c( 8)*d( 8)+c(2)*d(16)+c(16)*d(2)+
1 c(3)*d(14)+c(14)*d(3)
s(31)=c( 5)*d( 7)+c( 7)*d( 5)+c( 9)*d( 9)+c(2)*d(18)+c(18)*d(2)+
1 c(4)*d(15)+c(15)*d(4)
s(32)=c( 6)*d( 7)+c( 7)*d( 6)+c(10)*d(10)+c(3)*d(19)+c(19)*d(3)+
1 c(4)*d(17)+c(17)*d(4)
s(33)=c( 5)*d(10)+c(10)*d( 5)+c( 8)*d( 9)+c( 9)*d( 8)+c(3)*d(15)+
1 c(15)*d(3)+c(4)*d(14)+c(14)*d(4)+c(2)*d(20)+c(20)*d(2)
s(34)=c( 6)*d( 9)+c( 9)*d( 6)+c( 8)*d(10)+c(10)*d( 8)+c(2)*d(17)+
1 d(2)*c(17)+c(3)*d(20)+c(20)*d(3)+c(4)*d(16)+c(16)*d(4)
s(35)=c( 7)*d( 8)+c( 8)*d( 7)+c( 9)*d(10)+c(10)*d( 9)+c(2)*d(19)+
1 c(19)*d(2)+c(3)*d(18)+c(18)*d(3)+c(4)*d(20)+c(20)*d(4)
c end of p - f
if(iff1.eq.2.or.iff2.eq.2) return
s(36)=c(5)*d(11)+c(11)*d(5)
s(37)=c(6)*d(12)+c(12)*d(6)
s(38)=c(7)*d(13)+c(13)*d(7)
s(39)=c(6)*d(11)+c(11)*d(6)+c(5)*d(16)+c(16)*d(5)+c(8)*d(14)+
1 c(14)*d(8)
s(40)=c(7)*d(11)+c(11)*d(7)+c(5)*d(18)+c(18)*d(5)+c(9)*d(15)+
1 c(15)*d(9)
s(41)=c(5)*d(12)+c(12)*d(5)+c(6)*d(14)+c(14)*d(6)+c(8)*d(16)+
1 c(16)*d(8)
s(42)=c(5)*d(13)+c(13)*d(5)+c(7)*d(15)+c(15)*d(7)+c(9)*d(18)+
1 c(18)*d(9)
s(43)=c(7)*d(12)+c(12)*d(7)+c(6)*d(19)+c(19)*d(6)+c(10)*d(17)+
1 c(17)*d(10)
s(44)=c(6)*d(13)+c(13)*d(6)+c(7)*d(17)+c(17)*d(7)+c(10)*d(19)+
1 c(19)*d(10)
s(45)=c(8)*d(11)+c(11)*d(8)+c(5)*d(14)+c(14)*d(5)
s(46)=c(9)*d(11)+c(11)*d(9)+c(5)*d(15)+c(15)*d(5)
s(47)=c(8)*d(12)+c(12)*d(8)+c(6)*d(16)+c(16)*d(6)
s(48)=c(10)*d(12)+c(12)*d(10)+c(6)*d(17)+c(17)*d(6)
s(49)=c(10)*d(13)+c(13)*d(10)+c(7)*d(19)+c(19)*d(7)
s(50)=c(9)*d(13)+c(13)*d(9)+c(7)*d(18)+c(18)*d(7)
s(51)=c(8)*d(13)+c(13)*d(8)+c(7)*d(20)+c(20)*d(7)+c(9)*d(19)+
1 c(19)*d(9)+c(10)*d(18)+c(18)*d(10)
s(52)=c(10)*d(11)+c(11)*d(10)+c(5)*d(20)+c(20)*d(5)+c(9)*d(14)+
1 c(14)*d(9)+c(8)*d(15)+c(15)*d(8)
s(53)=c(9)*d(12)+c(12)*d(9)+c(6)*d(20)+c(20)*d(6)+c(10)*d(16)+
1 c(16)*d(10)+c(8)*d(17)+c(17)*d(8)
s(54)=c(5)*d(17)+c(17)*d(5)+c(6)*d(15)+c(15)*d(6)+c(14)*d(10)+
1 d(14)*c(10)+c(9)*d(16)+c(16)*d(9)+c(8)*d(20)+c(20)*d(8)
s(55)=c(5)*d(19)+c(19)*d(5)+c(7)*d(14)+c(14)*d(7)+c(10)*d(15)+
1 c(15)*d(10)+c(9)*d(20)+c(20)*d(9)+c(8)*d(18)+c(18)*d(8)
s(56)=c(6)*d(18)+c(18)*d(6)+c(7)*d(16)+c(16)*d(7)+c(10)*d(20)+
1 c(20)*d(10)+c(9)*d(17)+c(17)*d(9)+c(8)*d(19)+c(19)*d(8)
c end of d - f
if(iff1.eq.3.or.iff2.eq.3) return
s(57)=c(11)*d(11)
s(58)=c(12)*d(12)
s(59)=c(13)*d(13)
s(60)=c(11)*d(12)+c(12)*d(11)+c(14)*d(16)+c(16)*d(14)
s(61)=c(11)*d(13)+c(13)*d(11)+c(15)*d(18)+c(18)*d(15)
s(62)=c(12)*d(13)+c(13)*d(12)+c(17)*d(19)+c(19)*d(17)
s(63)=c(11)*d(14)+c(14)*d(11)
s(64)=c(11)*d(15)+c(15)*d(11)
s(65)=c(13)*d(18)+c(18)*d(13)
s(66)=c(13)*d(19)+c(19)*d(13)
s(67)=c(12)*d(17)+d(12)*c(17)
s(68)=c(12)*d(16)+c(16)*d(12)
s(69)=c(11)*d(16)+c(16)*d(11)+c(14)*d(14)
s(70)=c(11)*d(18)+c(18)*d(11)+c(15)*d(15)
s(71)=c(13)*d(15)+c(15)*d(13)+c(18)*d(18)
s(72)=c(13)*d(17)+c(17)*d(13)+c(19)*d(19)
s(73)=c(12)*d(14)+c(14)*d(12)+c(16)*d(16)
s(74)=c(12)*d(19)+c(19)*d(12)+c(17)*d(17)
s(75)=c(11)*d(17)+c(17)*d(11)+c(14)*d(20)+c(20)*d(14)+
1 c(15)*d(16)+c(16)*d(15)
s(76)=c(11)*d(19)+c(19)*d(11)+c(20)*d(15)+c(15)*d(20)+
1 c(14)*d(18)+c(18)*d(14)
s(77)=c(12)*d(18)+c(18)*d(12)+c(16)*d(19)+c(19)*d(16)+
1 c(17)*d(20)+c(20)*d(17)
s(78)=c(13)*d(14)+c(14)*d(13)+c(15)*d(19)+c(19)*d(15)+
1 c(18)*d(20)+c(20)*d(18)
s(79)=c(12)*d(15)+c(15)*d(12)+c(14)*d(17)+c(17)*d(14)+
1 c(16)*d(20)+c(20)*d(16)
s(80)=c(13)*d(16)+c(16)*d(13)+c(17)*d(18)+c(18)*d(17)+
1 c(19)*d(20)+c(20)*d(19)
s(81)=c(11)*d(20)+c(20)*d(11)+c(14)*d(15)+c(15)*d(14)
s(82)=c(12)*d(20)+c(20)*d(12)+c(16)*d(17)+c(17)*d(16)
s(83)=c(13)*d(20)+c(20)*d(13)+c(18)*d(19)+c(19)*d(18)
s(84)=c(14)*d(19)+c(19)*d(14)+c(15)*d(17)+c(17)*d(15)+
1 c(16)*d(18)+c(18)*d(16)+c(20)*d(20)
c end of f - f
return
end
c
c
subroutine fmc(mvar,xvar,expmx,fmch)
implicit real*8(a-h,o-z)
m=mvar
x=xvar
expmx=exp(-x)
if(x -20.d0) 10,10,20
c x less than or equal to 20.0.
10 a=m
a=a+0.5d0
term=1.d0/a
ptlsum=term
do 11 i=2,60
a=a+1.d0
term=term*x/a
ptlsum=ptlsum+term
if (term/ptlsum- 1.d-8 ) 12, 11, 11
11 continue
print 999,m,x
12 fmch=.5d0*ptlsum*expmx
return
c x greater than 20.0.
20 a=m
xd=1.d0/x
b=a+0.5d0
a=a-0.5d0
approx=.886226925428d0*(sqrt(xd)*xd**m)
if (m) 21, 23, 21
21 do 22 i=1,m
b=b-1.d0
22 approx=approx*b
23 fimult=.5d0*expmx*xd
fiprop=fimult/approx
term=1.d0
ptlsum=term
notrms=x
notrms=notrms+m
do 24 i=2,notrms
term=term*a*xd
ptlsum=ptlsum+term
if (abs(term*fiprop/ptlsum) - 1.d-8 ) 25,25,24
24 a=a-1.d0
print 999,m,x
25 fmch=approx-fimult*ptlsum
return
999 format (24h no convergence for fmch, i6, d16.9)
end
c
c
subroutine opaa0(l,m,n,ga,v,d)
c electronic part of potential
implicit real*8(a-h,o-z)
dimension v(1),d(3),fnu(7),fn(7),fd(7),dp(4)
data pi /3.14159265359d0/, fn /1.d0,1.d0,2.d0,6.d0,24.d0,120.d0,
1 720.d0/
data fd/1.d0,1.d0,0.5d0,0.1666666666667d0,0.416666666667d-1,
1 .833333333333d-2,.1388888888889d-2/
itot=l+m+n
itoth=itot/2
pre=(2.d0*pi/ga)*fn(l+1)*fn(m+1)*fn(n+1)
if(2*itoth-itot) 1,2,1
1 pre=-pre
2 del=.25d0/ga
x=ga*(d(1)**2+d(2)**2+d(3)**2)
xx=2.d0*x
call fmc(6,x,expmx,fmch)
fnu(7)=fmch
fnu(6)=(expmx+xx*fnu(7))/11.d0
fnu(5)=(expmx+xx*fnu(6))/9.d0
fnu(4)=(expmx+xx*fnu(5))/7.d0
fnu(3)=(expmx+xx*fnu(4))/5.d0
fnu(2)=(expmx+xx*fnu(3))/3.d0
fnu(1)=expmx+xx*fnu(2)
dp(1)=1.d0
dp(2)=del
dp(3)=del**2
v(1)=pre*aainer(0,0,0,l,m,n,d,dp,fnu,fn,fd)*(-1.0d0)
return
end
c
c
subroutine opaa1(l,m,n,ga,v,d)
c electronic part of electric field
implicit real*8(a-h,o-z)
dimension v(3),d(3),fnu(9),fd(9),fn(9),dp(4)
data pi /3.14159265359d0/, fn /1.d0,1.d0,2.d0,6.d0,24.d0,120.d0,
1 720.d0,5040.d0,40320.d0/
data fd /1.d0,1.d0,.5d0,.1666666666667d0,.416666666667d-1,
1 .833333333333d-2,.1388888888889d-2,.1984126984d-3,0.248015873d-4/
itot=l+m+n
itoth=itot/2
pre=4.d0*pi*fn(l+1)*fn(m+1)*fn(n+1)
if(2*itoth-itot) 1,2,1
1 pre=-pre
2 del=.25d0/ga
x=ga*(d(1)**2+d(2)**2+d(3)**2)
xx=2.d0*x
call fmc(8,x,expmx,fmch)
fnu(9)=fmch
fnu(8)=(expmx+xx*fnu(9))/15.d0
fnu(7)=(expmx+xx*fnu(8))/13.d0
fnu(6)=(expmx+xx*fnu(7))/11.d0
fnu(5)=(expmx+xx*fnu(6))/9.d0
fnu(4)=(expmx+xx*fnu(5))/7.d0
fnu(3)=(expmx+xx*fnu(4))/5.d0
fnu(2)=(expmx+xx*fnu(3))/3.d0
fnu(1)=expmx+xx*fnu(2)
dp(1)=1.d0
dp(2)=del
dp(3)=del**2
dp(4)=del*dp(3)
v(1)=pre*aainer(1,0,0,l,m,n,d,dp,fnu,fn,fd)
v(2)=pre*aainer(0,1,0,l,m,n,d,dp,fnu,fn,fd)
v(3)=pre*aainer(0,0,1,l,m,n,d,dp,fnu,fn,fd)
return
end
c
c
subroutine opaa2(l,m,n,ga,v,d)
c electronic part of field gradient
implicit real*8(a-h,o-z)
dimension v(6),d(3),fnu(9),fd(9),fn(9),dp(5)
data pi /3.14159265359d0/, fn /1.d0,1.d0,2.d0,6.d0,24.d0,120.d0,
1 720.d0,5040.d0,40320.d0/
data fd /1.d0,1.d0,.5d0,.1666666666667d0,.416666666667d-1,
1 .833333333333d-2,.1388888888889d-2,.1984126984d-3,0.248015873d-4/
itot=l+m+n
itoth=itot/2
pre=(8.d0*pi*ga)*fn(l+1)*fn(m+1)*fn(n+1)
if(2*itoth-itot)1,2,1
1 pre=-pre
2 del=.25d0/ga
x=ga*(d(1)**2+d(2)**2+d(3)**2)
xx=2.d0*x
call fmc(8,x,expmx,fmch)
fnu(9)=fmch
fnu(8)=(expmx+xx*fnu(9))/15.d0
fnu(7)=(expmx+xx*fnu(8))/13.d0
fnu(6)=(expmx+xx*fnu(7))/11.d0
fnu(5)=(expmx+xx*fnu(6))/9.d0
fnu(4)=(expmx+xx*fnu(5))/7.d0
fnu(3)=(expmx+xx*fnu(4))/5.d0
fnu(2)=(expmx+xx*fnu(3))/3.d0
fnu(1)=expmx+xx*fnu(2)
dp(1)=1.d0
dp(2)=del
dp(3)=del**2
dp(4)=del*dp(3)
dp(5)=del*dp(4)
v(1)=pre*aainer(2,0,0,l,m,n,d,dp,fnu,fn,fd)
v(2)=pre*aainer(0,2,0,l,m,n,d,dp,fnu,fn,fd)
v(3)=pre*aainer(0,0,2,l,m,n,d,dp,fnu,fn,fd)
v(4)=pre*aainer(1,1,0,l,m,n,d,dp,fnu,fn,fd)
v(5)=pre*aainer(1,0,1,l,m,n,d,dp,fnu,fn,fd)
v(6)=pre*aainer(0,1,1,l,m,n,d,dp,fnu,fn,fd)
call opac3(l,m,n,ga,dp(1),d)
dp(1)=1.333333333333d0*pi*dp(1)
v(1)=v(1)+dp(1)
v(2)=v(2)+dp(1)
v(3)=v(3)+dp(1)
return
end
c
c
subroutine opaa3(l,m,n,ga,v,d)
c electronic part of diamagnetic shielding
implicit real*8(a-h,o-z)
dimension vx(3),d(3),v(7)
call opaa1(l,m,n,ga,vx,d)
v(1)=vx(1)*d(1)
v(2)=vx(2)*d(2)
v(3)=vx(3)*d(3)
v(4)=vx(2)*d(1)
v(5)=vx(3)*d(1)
v(6)=vx(3)*d(2)
call opaa1(l+1,m,n,ga,vx,d)
v(1)=v(1)+vx(1)
v(4)=v(4)+vx(2)
v(5)=v(5)+vx(3)
call opaa1(l,m+1,n,ga,vx,d)
v(2)=v(2)+vx(2)
v(6)=v(6)+vx(3)
call opaa1(l,m,n+1,ga,vx,d)
v(3)=v(3)+vx(3)
v(7)=v(1)+v(2)+v(3)
do 300 i=1,7
v(i)=-v(i)
300 continue
return
end
c
c
subroutine opab1(l,m,n,ga,v,d)
c electronic part of dipole moment
implicit real*8(a-h,o-z)
dimension v(3),d(3),g(4)
g(1)=olap(l,m,n,ga)
g(2)=olap(l+1,m,n,ga)
g(3)=olap(l,m+1,n,ga)
g(4)=olap(l,m,n+1,ga)
v(1)=g(2)+d(1)*g(1)
v(2)=g(3)+d(2)*g(1)
v(3)=g(4)+d(3)*g(1)
do 300 i=1,3
300 v(i)=-v(i)
return
end
c
c
subroutine opab2(l,m,n,ga,v,d)
c electronic part of quadrupole moment
implicit real*8(a-h,o-z)
dimension v(7),d(3),g(10)
g(1)=olap(l,m,n,ga)
g(2)=olap(l+1,m,n,ga)
g(3)=olap(l,m+1,n,ga)
g(4)=olap(l,m,n+1,ga)
g(5)=olap(l+2,m,n,ga)
g(6)=olap(l,m+2,n,ga)
g(7)=olap(l,m,n+2,ga)
g(8)=olap(l+1,m+1,n,ga)
g(9)=olap(l+1,m,n+1,ga)
g(10)=olap(l,m+1,n+1,ga)
v(1)=g(5)+2.d0*d(1)*g(2)+d(1)**2*g(1)
v(2)=g(6)+2.d0*d(2)*g(3)+d(2)**2*g(1)
v(3)=g(7)+2.d0*d(3)*g(4)+d(3)**2*g(1)
v(4)=(g(8)+d(1)*g(3)+d(2)*g(2)+d(1)*d(2)*g(1))/2.d0
v(5)=(g(9)+d(1)*g(4)+ d(3)*g(2)+d(1)*d(3)*g(1))/2.d0
v(6)=(g(10)+d(2)*g(4)+d(3)*g(3)+d(2)*d(3)*g(1))/2.d0
v(7)=v(1)+v(2)+v(3)
v(1)=(3.d0*v(1)-v(7))/2.d0
v(2)=(3.d0*v(2)-v(7))/2.d0
v(3)=(3.d0*v(3)-v(7))/2.d0
v(4)=3.d0*v(4)
v(5)=3.d0*v(5)
v(6)=3.d0*v(6)
do 300 i=1,7
300 v(i)=-v(i)
return
end
c
c
subroutine opab3(l,m,n,ga,v,dd)
c electronic part of third moment
implicit real*8(a-h,o-z)
dimension v(10),dd(3),g(20),d(20)
g(1)=olap( l,m,n,ga)
g(2)=olap(l+1,m,n,ga)
g(3)=olap(l,m+1,n,ga)
g(4)=olap(l,m,n+1,ga)
g(5)=olap(l+2,m,n,ga)
g(6)=olap(l,m+2,n,ga)
g(7)=olap(l,m,n+2,ga)
g(8)=olap(l+1,m+1,n,ga)
g(9)=olap(l+1,m,n+1,ga)
g(10)=olap(l,m+1,n+1,ga)
g(11)=olap(l+3,m,n,ga)
g(12)=olap(l,m+3,n,ga)
g(13)=olap(l,m,n+3,ga)
g(14)=olap(l+2,m+1,n,ga)
g(15)=olap(l+2,m,n+1,ga)
g(16)=olap(l+1,m+2,n,ga)
g(17)=olap(l,m+2,n+1,ga)
g(18)=olap(l+1,m,n+2,ga)
g(19)=olap(l,m+1,n+2,ga)
g(20)=olap(l+1,m+1,n+1,ga)
d(2)=dd(1)
d(3)=dd(2)
d(4)=dd(3)
d(5)=dd(1)**2
d(6)=dd(2)**2
d(7)=dd(3)**2
d(8)=d(2)*d(3)
d(9)=d(2)*d(4)
d(10)=d(3)*d(4)
d(11)=d(5)*d(2)
d(12)=d(6)*d(3)
d(13)=d(7)*d(4)
d(14)=d(5)*d(3)
d(15)=d(5)*d(4)
d(16)=d(6)*d(2)
d(17)=d(6)*d(4)
d(18)=d(7)*d(2)
d(19)=d(7)*d(3)
d(20)=d(8)*d(4)
v(1)=g(11)+3.d0*d(2)*g(5)+3.d0*d(5)*g(2)+d(11)*g(1)
v(2)=g(12)+3.d0*d(3)*g(6)+3.d0*d(6)*g(3)+d(12)*g(1)
v(3)=g(13)+3.d0*d(4)*g(7)+3.d0*d(7)*g(4)+d(13)*g(1)
v(4)=g(14)+2.d0*d(2)*g(8)+d(3)*g(5)+d(5)*g(3)+2.d0*d(8)*g(2)
1 +d(14)*g(1)
v(5)=g(15)+2.d0*d(2)*g(9)+d(4)*g(5)+d(5)*g(4)+2.d0*d(9)*g(2)
1 +d(15)*g(1)
v(6)=g(16)+2.d0*d(3)*g(8)+d(2)*g(6)+d(6)*g(2)+2.d0*d(8)*g(3)
1 +d(16)*g(1)
v(7)=g(17)+2.d0*d(3)*g(10)+d(4)*g(6)+d(6)*g(4)+2.d0*d(10)*g(3)
1 +d(17)*g(1)
v(8)=g(18)+2.d0*d(4)*g(9)+d(2)*g(7)+d(7)*g(2)+2.d0*d(9)*g(4)
1 +d(18)*g(1)
v(9)=g(19)+2.d0*d(4)*g(10)+d(3)*g(7)+d(7)*g(3)+2.d0*d(10)*g(4)
1 +d(19)*g(1)
v(10)=g(20)+d(2)*g(10)+d(3)*g(9)+d(4)*g(8)+d(10)*g(2)+d(9)*g(3)+
1d(8)*g(4)+d(20)*g(1)
do 300 i=1,10
300 v(i)=-v(i)
return
end
c
c
subroutine opab4(l,m,n,ga,v,d)
c electronic part of second moment
implicit real*8(a-h,o-z)
dimension v(6),d(3),g(10)
g(1)=olap(l,m,n,ga)
g(2)=olap(l+1,m,n,ga)
g(3)=olap(l,m+1,n,ga)
g(4)=olap(l,m,n+1,ga)
g(5)=olap(l+2,m,n,ga)
g(6)=olap(l,m+2,n,ga)
g(7)=olap(l,m,n+2,ga)
g(8)=olap(l+1,m+1,n,ga)
g(9)=olap(l+1,m,n+1,ga)
g(10)=olap(l,m+1,n+1,ga)
v(1)=g(5)+2.d0*d(1)*g(2)+d(1)**2*g(1)
v(2)=g(6)+2.d0*d(2)*g(3)+d(2)**2*g(1)
v(3)=g(7)+2.d0*d(3)*g(4)+d(3)**2*g(1)
v(4)=g(8)+d(1)*g(3)+d(2)*g(2)+d(1)*d(2)*g(1)
v(5)=g(9)+d(1)*g(4)+d(3)*g(2)+d(1)*d(3)*g(1)
v(6)=g(10)+d(2)*g(4)+d(3)*g(3)+d(2)*d(3)*g(1)
do 300 i=1,6
300 v(i)=-v(i)
return
end
c
c
subroutine opac1(l,m,n,ga,v,d)
c electronic part of planar density
implicit real*8(a-h,o-z)
dimension v(3),d(3),dd(3),dftr(6)
data pi /3.14159265359d0/, dftr /1.d0,1.d0,3.d0,5.d0,15.d0,105.d0/
do 1 i=1,3
dd(i)=-d(i)
v(i)=0.d0
1 continue
g=.5d0/ga
lh=l/2
mh=m/2
nh=n/2
pre=2.d0*g*pi
if(2*nh-n) 9,3,9
3 if(2*mh-m) 7,4,7
4 v(1)=1.d0
if(l) 39,41,39
39 v(1)=dd(1)**l
41 v(1)=pre*v(1)* exp (-ga*dd(1)**2)*g**(mh+nh)*dftr(mh+1)*dftr(nh
1+1)
if(2*lh-l) 50,5,50
5 v(2)=1.d0
if(m) 49,51,49
49 v(2)=dd(2)**m
51 v(2)=pre*v(2)* exp (-ga*dd(2)**2)*g**(lh+nh)*dftr(lh+1)*dftr(nh
1+1)
6 v(3)=1.d0
if(n) 59,61,59
59 v(3)=dd(3)**n
61 v(3)=pre*v(3)* exp (-ga*dd(3)**2)*g**(lh+mh)*dftr(lh+1)*dftr(mh
1+1)
return
7 if(2*lh-l) 50,8,50
8 v(2)=1.d0
if(m) 79,81,79
79 v(2)=dd(2)**m
81 v(2)=pre*v(2)* exp (-ga*dd(2)**2)*g**(lh+nh)*dftr(lh+1)*dftr(nh
1+1)
return
9 if(2*mh-m) 50,10,50
10 if(2*lh-l) 50,6,50
50 return
end
c
c
subroutine opac2(l,m,n,ga,v,d)
c electronic part of linear density
implicit real*8(a-h,o-z)
dimension v(3),d(3),dd(3),ds(3),dftr(5)
data sqrpi /1.772453850906d0/, dftr /1.d0,1.d0,3.d0,15.d0,105.d0/
do 1 i=1,3
dd(i)=-d(i)
ds(i)=d(i)**2
v(i)=0.d0
1 continue
g=.5d0/ga
pre=sqrpi*sqrt(2.d0*g)
lh=l/2
mh=m/2
nh=n/2
if(2*nh-n) 4,3,4
3 v(1)=1.d0
if(l.le.0.and.dd(1).eq.0.d0) go to 29
28 v(1)=dd(1)**l
29 if(m.le.0.and.dd(2).eq.0.d0) go to 31
30 v(1)=v(1)*dd(2)**m
31 v(1)=pre*g**nh*v(1)*exp(-ga*(ds(1)+ds(2)))*dftr(nh+1)
4 if(2*mh-m) 6,5,6
5 v(2)=1.d0
if(l.le.0.and.dd(1).eq.0.d0) go to 49
48 v(2)=dd(1)**l
49 if(n.le.0.and.dd(1).eq.0.d0) go to 51
50 v(2)=v(2)*dd(1)**n
51 v(2)=pre*g**mh*v(2)*exp(-ga*(ds(1)+ds(3)))*dftr(mh+1)
6 if(2*lh-l) 8,7,8
7 v(3)=1.d0
if(m.le.0.and.dd(2).eq.0.d0) go to 69
68 v(3)=dd(2)**m
69 if(n.le.0.and.dd(3).eq.0.d0) go to 71
70 v(3)=v(3)*dd(3)**n
71 v(3)=pre*g**lh*v(3)*exp(-ga*(ds(2)+ds(3)))*dftr(lh+1 )
8 return
end
c
c
subroutine opac3(l,m,n,ga,v,d)
c electronic part of charge density
implicit real*8(a-h,o-z)
dimension v(1),d(1),dd(3)
ddsq=0.d0
do 1 i=1,3
dd(i)=-d(i)
ddsq=ddsq+d(i)**2
1 continue
v(1) =1.d0
if(l) 2,3,2
2 v(1)=dd(1)**l
3 if(m) 4,5,4
4 v(1)=v(1)*dd(2)**m
5 if(n) 6,7,6
6 v(1)=v(1)*dd(3)**n
7 v(1)=v(1)*exp(-ga*ddsq)
return
end
c
c
subroutine opad1(l,m,n,ga,v,d)
c electronic part of overlap
implicit real*8(a-h,o-z)
dimension v(1),d(1)
v(1)=olap(l,m,n,ga)
return
end
c
c
subroutine opap4(l,m,n,gc,v,rc)
c
c this subroutine calculates the expectation-values of
c -p**2/2 (kinetic energy) and p**4/(8*cl**2) (relativistic
c correction of the kinetic energy)
c
c the program works correct only for s and p and the irreducible
c linear combinations of the primitive d,f,... functions
c
c written by s. brode in april,1984
c
c
implicit real*8 (a-h,o-z)
logical lodd,modd,nodd,leven,meven,neven
dimension v(3),rc(3),rca(3),rcb(3),srcab(3),
&lmni(35),o(25),dftr(7)
data a0/0.0d0/,a1/1.0d0/,a2/2.0d0/,a4/4.0d0/,a8/8.0d0/,
&lmni/0,3*1,6*2,10*3,15*4/,cl/137.03604d0/,pi/3.1415926559d0/,
&dftr/1.0d0,1.0d0,3.0d0,15.0d0,105.0d0,945.0d0,103935.0d0/
common /abfunc/ ra(3),rb(3),ga,gb,ia,ib
c
c define the overlap-integral
c
ola(ll,mm,nn)=gch**(ll/2+mm/2+nn/2)*dftr(ll/2+1)*dftr(mm/2+1)*
&dftr(nn/2+1)
c
c some previous calculations
c
do 10 i=1,25
10 o(i)=a0
gch=a1/(a2*gc)
ropigc=sqrt(pi/gc)*pi/gc
lodd=mod(l,2).eq.1
leven=.not.lodd
modd=mod(m,2).eq.1
meven=.not.modd
nodd=mod(n,2).eq.1
neven=.not.nodd
ga2=ga*a2
gb2=gb*a2
gab4=ga2*gb2
prcaa=a0
prcbb=a0
do 20 i=1,3
rca(i)=rc(i)-ra(i)
rcb(i)=rc(i)-rb(i)
srcab(i)=rca(i)+rcb(i)
prcaa=prcaa+rca(i)*rca(i)
prcbb=prcbb+rcb(i)*rcb(i)
20 continue
zwa=ga2*prcaa-dfloat(2*lmni(ia)+3)
zwb=gb2*prcbb-dfloat(2*lmni(ib)+3)
c
c calculation of the overlap-integrals
c
if(lodd.or.modd.or.nodd) go to 110
o( 1)=ola(l ,m ,n )
o( 5)=ola(l+2,m ,n )
o( 6)=ola(l ,m+2,n )
o( 7)=ola(l ,m ,n+2)
o(11)=ola(l+4,m ,n )
o(12)=ola(l ,m+4,n )
o(13)=ola(l ,m ,n+4)
o(20)=ola(l+2,m+2,n )
o(21)=ola(l+2,m ,n+2)
o(22)=ola(l ,m+2,n+2)
110 continue
c
if(leven.or.modd.or.nodd) go to 120
o( 2)=ola(l+1,m ,n )
o( 8)=ola(l+3,m ,n )
o(14)=ola(l+1,m+2,n )
o(15)=ola(l+1,m ,n+2)
120 continue
c
if(lodd.or.meven.or.nodd) go to 130
o( 3)=ola(l ,m+1,n )
o( 9)=ola(l ,m+3,n )
o(16)=ola(l+2,m+1,n )
o(17)=ola(l ,m+1,n+2)
130 continue
c
if(lodd.or.modd.or.neven) go to 140
o( 4)=ola(l ,m ,n+1)
o(10)=ola(l ,m ,n+3)
o(18)=ola(l+2,m ,n+1)
o(19)=ola(l ,m+2,n+1)
140 continue
c
if(leven.or.meven.or.nodd) go to 150
o(23)=ola(l+1,m+1,n )
150 continue
if(leven.or.modd.or.neven) go to 160
o(24)=ola(l+1,m ,n+1)
160 continue
if(lodd.or.meven.or.neven) go to 170
o(25)=ola(l ,m+1,n+1)
170 continue
c
c calculation of kinetic energy
c
p2=-ga*(zwa*o(1)
& +ga2*(a2*(rca(1)*o(2)+rca(2)*o(3)+rca(3)*o(4))
& +o(5)+o(6)+o(7)))
c
c calculation of relativistic correction
c
p4=(gab4*(o(11)+o(12)+o(13)+a2*(o(20)+o(21)+o(22))
& +a2*(srcab(1)*(o( 8)+o(16)+o(18))
& +srcab(2)*(o(14)+o( 9)+o(19))
& +srcab(3)*(o(15)+o(17)+o(10)))
& +a4*(rca(1)*rcb(1)*o(5)
& +rca(2)*rcb(2)*o(6)
& +rca(3)*rcb(3)*o(7)
& +a2*((rca(1)*rcb(2)+rca(2)+rcb(1))*o(23)
& +(rca(1)*rcb(3)+rca(3)+rcb(1))*o(24)
& +(rca(2)*rcb(3)+rca(3)+rcb(2))*o(25))))
& +(gb2*zwa+ga2*zwb)*(o(5)+o(6)+o(7))
& +a2*(gb2*zwa*(rcb(1)*o(2)+rcb(2)*o(3)+rcb(3)*o(4))
& +ga2*zwb*(rca(1)*o(2)+rca(2)*o(3)+rca(3)*o(4)))
& +zwa*zwb*o(1))
& *(-gab4)/(a8*cl**2)
c
c store p2 and p4 to the correct storage-locations
c
v(1)=p2*ropigc
v(2)=p4*ropigc
v(3)=v(1)+v(2)
return
end
c
c
real*8 function aainer(r,s,t,l,m,n,d,dp,fnu,fn,fd)
implicit real*8(a-h,o-z)
dimension d(3),dp(1),fnu(1),fn(1),fd(1)
integer r,s,t,u,v,w,uvwt,rstt,uvwth
rstt=r+s+t
lmnt=l+m+n
lmnrst=rstt+lmnt
lh=l/2
mh=m/2
nh=n/2
aainer=0.0d0
last1 = lh+1
do 6 ii=1,last1
i = ii-1
il=l-2*i+1
ilr=r+il
ilrh=(ilr-1)/2
fi=fn(ilr)*fd(il)*fd(i+1)
last2 = mh+1
do 5 jj=1,last2
j = jj-1
jm=m-2*j+1
jms=s+jm
jmsh=(jms-1)/2
fij=fn(jms)*fd(jm)*fd(j+1)*fi
last3 = nh+1
do 4 kk=1,last3
k = kk-1
kn=n-2*k+1
knt=t+kn
knth=(knt-1)/2
ijkt=i+j+k
fijk=fn(knt)*fd(kn)*fd(k+1)*dp(ijkt+1)*fij
lmrsij=lmnrst-2*ijkt
last4 = ilrh+1
do 3 iu=1,last4
u = iu-1
ilru=ilr-2*u
fu=fd(u+1)*fd(ilru)
if(abs(d(1))-0.0000001d0)10,10,11
10 if(ilru-1) 12,12, 3
11 fu=fu*d(1)**(ilru-1)
12 last5 = jmsh+1
do 2 iv=1,last5
v = iv-1
jmsv=jms-2*v
fuv=fu*fd(v+1)*fd(jmsv)
if(abs(d(2))-0.0000001d0)20,20,21
20 if(jmsv-1) 22,22,2
21 fuv=fuv*d(2)**(jmsv-1)
22 last6 = knth+1
do 1 iw=1,last6
w = iw-1
kntw=knt-2*w
fuvw=fuv*fd(w+1) *fd(kntw)
if(abs(d(3))-0.0000001d0)30,30,31
30 if(kntw-1) 32,32,1
31 fuvw=fuvw*d(3)**(kntw-1)
32 uvwt=u+v+w
uvwth=uvwt/2
if(2*uvwth-uvwt) 33,34,33
33 fuvw=-fuvw
34 nuindx=lmrsij-uvwt
fuvw=fuvw*fnu(nuindx +1)*dp(uvwt+1)
aainer=fijk*fuvw+aainer
1 continue
2 continue
3 continue
4 continue
5 continue
6 continue
return
end
c
c
subroutine divpt(a,alpha,b,beta,ecoord,eexp,efact)
implicit real*8(a-h,o-z)
c this computes the centre, exponent, and multiplying factor of
c a single gaussian which can replace the product of two gaussia
c centres a and b, and exponents alpha and beta.
dimension a(3), b(3), ecoord(3)
do 1 i=1,3
1 ecoord(i)=(alpha*a(i)+beta*b(i))/(alpha+beta)
eexp=alpha+beta
absqd=0.0d0
do 2 i=1,3
2 absqd=absqd+(b(i)-a(i))*(b(i)-a(i))
efact=exp(-alpha*beta*absqd/(alpha+beta))
return
end
c
c
subroutine elcmom(nt,frocc,dint,nro,norb,tot,cint,nomx)
c total property in mo basis * occupation numbers
implicit real*8(a-h,o-z)
dimension frocc(*),dint(nro,*),tot(*),cint(nomx,*)
do 11 nu=1,nt
tot(nu)=0.0d0
do 12 n=1,norb
tot(nu)=tot(nu) + frocc(n)*cint(n,nu)
dint(2,nu)=tot(nu)
12 continue
11 continue
return
end
c
c
subroutine total(nt,dint,nro)
c nuclear + electronic part of property
implicit real*8(a-h,o-z)
dimension dint(nro,*)
do 20 k=1,nt
20 dint(3,k)=dint(1,k)+dint(2,k)
return
end
c
c
subroutine output(dint,norb,n,nt,nro,frocc,tot,c,ilbl,a,
& title,cint,buff)
implicit real*8(a-h,o-z)
parameter(nocmx=50,nbmx=720,nomx=250,lbuff=31375)
real*8 c(1), ilbl(1), a(1), title(1)
parameter (mloc=250)
dimension dint(nro,*),frocc(*),tot(nt),cint(nomx,*),buff(lbuff)
c
c dimensions for localization have to be:
c help(ncont,norb,nt), xlv(ncont,norb), op(nnorb,nt), d(norb,norb)
c eig(norb), mon(norb)
c
dimension mon(mloc),xlv(2),repv(2)
logical ok
common /big/ y(nomx*nomx), help(nomx*mloc*3),
& d(mloc*(mloc+1)*3/2),op(mloc*mloc)
common /eig/ eig(mloc)
common /prptyp/ m
common /contrc/ chomo,ncont
equivalence (help(1),xlv(1),repv(1))
c
if(m.eq.15) go to 17
call cntrac(cint,norb,n,nt,nro,buff)
call elcmom(nt,frocc,dint,nro,norb,tot,cint,nomx)
call total(nt,dint,nro)
call prnt(dint,nro,nt,norb,c,ilbl,a,title,cint,nomx)
return
c
17 write(6,6000)
do 10 i=1,norb
10 mon(i)=i
c
read(5,1000) nmo
if(nmo) 300,200,100
100 read(5,1000) (mon(i),i=1,nmo)
c
ok=.true.
ialt=mon(1)
do 220 ip=2,nmo
if(mon(ip).gt.ialt) go to 210
ok=.false.
write(6,2222) ip,mon(ip),ialt
210 ialt=mon(ip)
220 continue
if (ok) go to 250
stop
c
200 read(5,2000) thr
write(6,6002) thr
ii=0
do 20 i=1,norb
if(eig(i).lt.thr) go to 20
ii=ii+1
mon(ii)=i
20 continue
nmo=ii
c
250 ij=0
do 30 i=1,nmo
eig(i)=eig(mon(i))
ist=(mon(i)-1)*ncont+1
ie=ist+ncont-1
do 40 k=ist,ie
ij=ij+1
40 y(ij)=y(k)
30 continue
norb=nmo
c
300 write(6,6001) norb,(mon(i),i=1,norb)
nnorb=norb*(norb+1)/2
call local(nt,norb,ncont,op,nnorb,buff,lbuff,y,help,d,xlv,repv)
return
c
1000 format(5x,5i5)
2000 format(5x,f10.4)
2222 format(' ====> danger : ordering of mos illegal ',i5,5x,2i5)
6000 format(//' boys localization '//)
6001 format(1x,i5,' occupied mo s selected :',5i5/(31x,5i5))
6002 format(6x,' threshold for selection of mo s :',f10.4/)
end
c
c
subroutine local(nt,norb,ncont,op,nnorb,buff,lbuff,y,help,d,xlv,
1 repv)
implicit real*8(a-h,o-z)
integer opn(3)
logical ok
parameter (mloc=250)
dimension y(ncont,norb),help(ncont,norb,nt),buff(lbuff),
& op(nnorb,nt),d(norb,norb),xlv(ncont,norb),repv(2)
common/holl/blabel(19),alabel(19),fmt(4),jl,lomao,iopen,nsym
common/supp/nsupp
common/eig/eig(mloc)
c
c help(i,j), xlv(i,j) and repv(i) are equivalenced in subroutine
c output
c
rewind 2
do 10 m=1,nt
do 10 i=1,norb
do 10 k=1,ncont
10 help(k,i,m)=0.0d0
do 20 j=1,nt
20 opn(j)=j
c
ix=lbuff
do 30 k=1,ncont
do 30 l=1,k
fac=1.0d0
if(k.eq.l) fac=0.5d0
do 50 m=1,nt
ix=ix+1
if(ix.le.lbuff)go to 40
ix=1
read(2) buff
40 continue
temp=-buff(ix)*fac
do 60 i=1,norb
help(k,i,m)=help(k,i,m)+temp*y(l,i)
60 help(l,i,m)=help(l,i,m)+temp*y(k,i)
50 continue
30 continue
c
do 70 m=1,nt
ij=0
do 80 i=1,norb
do 80 j=1,i
ij=ij+1
top=0.0d0
do 90 k=1,ncont
90 top=top+y(k,i)*help(k,j,m)
op(ij,m)=top
80 continue
70 continue
c
c
read(5,5000) nop
if(nop.eq.0) go to 100
read(5,5000) (opn(nn),nn=1,nop)
c
if(nop.eq.1) go to 130
ok=.true.
ialt=opn(1)
do 110 ip=2,nop
if(opn(ip).gt.ialt) go to 120
ok=.false.
write(6,6000) ip,opn(ip),ialt
120 ialt=opn(ip)
110 continue
if (ok) go to 130
stop
c
130 if(nsupp.lt.2) go to 140
write(6,6010)
do 150 i=1,nnorb
150 write(6,6020) (op(i,kk),kk=1,nt)
c
140 ii=0
do 160 n=1,nop
nopn=opn(n)
do 160 l=1,nnorb
160 op(l,n)=op(l,nopn)
nt=nop
c
100 write(6,6030) nt,(opn(nn),nn=1,nt)
thi=1.0d-13
call boys(norb,nt,nnorb,op,thi,d)
c
ij=0
do 300 i=1,norb
do 300 j=1,i
ij=ij+1
repv(ij)=0.d0
do 300 k=1,norb
300 repv(ij)=repv(ij)+d(k,i)*eig(k)*d(k,j)
write(6,6140)
call outpak(repv,norb,1,2)
c
do 170 i=1,norb
do 180 k=1,ncont
xlv(k,i)=y(k,1)*d(1,i)
if(norb.eq.1) go to 180
do 190 j=2,norb
190 xlv(k,i)=xlv(k,i)+y(k,j)*d(j,i)
180 continue
170 continue
nxlv=norb*ncont
c
if(nsupp.lt.2) go to 200
write(6,6040)
do 210 i=1,nnorb
210 write(6,6020) (op(i,kk),kk=1,nt)
c
200 write(6,6050)
write(6,6060) (opn(i),i=1,nt)
ii=0
do 220 i=1,norb
ii=ii+i
220 write(6,6070) i,(op(ii,kk),kk=1,nt)
c
write(6,6080)
do 230 i=1,norb
230 write(6,6090) i,(d(j,i),j=1,norb)
c
if(nsupp.lt.2) go to 240
write(6,6100)
do 250 i=1,norb
250 write(6,6110) i,(xlv(ll,i),ll=1,ncont)
c
240 write(lomao,6120) (alabel(i1),i1=1,19)
write(lomao,6120) (blabel(i1),i1=1,19)
write(lomao,6130) norb,ncont,nxlv
write(lomao,6120) (fmt(i1),i1=1,4)
write(lomao,fmt) ((xlv(ll,i),ll=1,ncont),i=1,norb)
c
return
5000 format(5x,5i5)
6000 format(' ====> danger : ordering of operators illegal ',i5,5x,2i5)
6010 format(/' operators in mo basis '/)
6020 format(4f20.14)
6030 format(/1x,i5,' operators selected :',10i5)
6040 format(/' operators in lmo basis '/)
6050 format(//' diagonalelements of the operators in lmo basis :'/)
6060 format(8x,'lmo',12x,3(i2,12x)/)
6070 format(5x,i5,5x,3f14.8)
6080 format(/' lmo s as linearcombination of mo s ')
6090 format(/' lmo nb.',i5/(1x,5f14.8))
6100 format(/' lmo vectors '/)
6110 format(' lmo nb.',i5/(1x,4f14.8))
6120 format(19a4)
6130 format(20i4)
6140 format(/' fockmatrix in lmo basis',/)
end
c
c
subroutine boys(n,no,nn1,op,thi,d)
c
c subroutine for boys localization r.ahlrichs 2/85
c to determine vectors |i>, i=1,n
c which maximize
c f = sum(i,j=1,n)sum(k=1,no) (-