-
Notifications
You must be signed in to change notification settings - Fork 2
/
dipole.f
136 lines (136 loc) · 4.56 KB
/
dipole.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
FUNCTION DIPOLE (P,Q,COORD,DIPVEC, MODE)
IMPLICIT DOUBLE PRECISION (A-H,O-Z)
INCLUDE 'SIZES'
COMMON /MOLKST/ NUMAT,NAT(NUMATM),NFIRST(NUMATM), NMIDLE(NUMATM),
1 NLAST(NUMATM), NORBS, NELECS,NALPHA,NBETA,
2 NCLOSE,NOPEN,NDUMY,FRACT
COMMON /DIPSTO/ UX,UY,UZ,CH(NUMATM)
COMMON /KEYWRD/ KEYWRD
COMMON /MOLMEC/ HTYPE(4),NHCO(4,20),NNHCO,ITYPE
COMMON /ISTOPE/ AMS(107)
COMMON /MULTIP/ DD(107), QQ(107), AM(107), AD(107), AQ(107)
COMMON /NUMCAL/ NUMCAL
DIMENSION P(*),Q(*),COORD(3,*),DIPVEC(3), CENTER(3)
CHARACTER*241 KEYWRD
C***********************************************************************
C DIPOLE CALCULATES DIPOLE MOMENTS
C
C ON INPUT P = DENSITY MATRIX
C Q = TOTAL ATOMIC CHARGES, (NUCLEAR + ELECTRONIC)
C NUMAT = NUMBER OF ATOMS IN MOLECULE
C NAT = ATOMIC NUMBERS OF ATOMS
C NFIRST= START OF ATOM ORBITAL COUNTERS
C COORD = COORDINATES OF ATOMS
C
C OUTPUT DIPOLE = DIPOLE MOMENT
C***********************************************************************
C
C IN THE ZDO APPROXIMATION, ONLY TWO TERMS ARE RETAINED IN THE
C CALCULATION OF DIPOLE MOMENTS.
C 1. THE POINT CHARGE TERM (INDEPENDENT OF PARAMETERIZATION).
C 2. THE ONE-CENTER HYBRIDIZATION TERM, WHICH ARISES FROM MATRIX
C ELEMENTS OF THE FORM <NS/R/NP>. THIS TERM IS A FUNCTION OF
C THE SLATER EXPONENTS (ZS,ZP) AND IS THUS DEPENDENT ON PARAMETER-
C IZATION. THE HYBRIDIZATION FACTORS (HYF(I)) USED IN THIS SUB-
C ROUTINE ARE CALCULATED FROM THE FOLLOWING FORMULAE.
C FOR SECOND ROW ELEMENTS <2S/R/2P>
C HYF(I)= 469.56193322*(SQRT(((ZS(I)**5)*(ZP(I)**5)))/
C ((ZS(I) + ZP(I))**6))
C FOR THIRD ROW ELEMENTS <3S/R/3P>
C HYF(I)=2629.107682607*(SQRT(((ZS(I)**7)*(ZP(I)**7)))/
C ((ZS(I) + ZP(I))**8))
C FOR FOURTH ROW ELEMENTS AND UP :
C HYF(I)=2*(2.10716)*DD(I)
C WHERE DD(I) IS THE CHARGE SEPARATION IN ATOMIC UNITS
C
C
C REFERENCES:
C J.A.POPLE & D.L.BEVERIDGE: APPROXIMATE M.O. THEORY
C S.P.MCGLYNN, ET AL: APPLIED QUANTUM CHEMISTRY
C
DIMENSION DIP(4,3)
DIMENSION HYF(107,2)
SAVE FIRST, HYF, DIP, WTMOL, CHARGD, FORCE
LOGICAL FIRST, FORCE, CHARGD
DATA HYF(1,1) / 0.0D00 /
DATA HYF(1,2) /0.0D0 /
DATA HYF(5,2) /6.520587D0/
DATA HYF(6,2) /4.253676D0/
DATA HYF(7,2) /2.947501D0/
DATA HYF(8,2) /2.139793D0/
DATA HYF(9,2) /2.2210719D0/
DATA HYF(14,2)/6.663059D0/
DATA HYF(15,2)/5.657623D0/
DATA HYF(16,2)/6.345552D0/
DATA HYF(17,2)/2.522964D0/
DATA ICALCN/0/
FIRST=(ICALCN.NE.NUMCAL)
ICALCN=NUMCAL
IF (FIRST) THEN
DO 10 I=2,107
10 HYF(I,1)= 5.0832D0*DD(I)
WTMOL=0.D0
SUM=0.D0
DO 20 I=1,NUMAT
WTMOL=WTMOL+AMS(NAT(I))
20 SUM=SUM+Q(I)
CHARGD=(ABS(SUM).GT.0.5D0)
FORCE=(INDEX(KEYWRD,'FORCE') +INDEX(KEYWRD,'IRC').NE. 0)
KTYPE=1
IF(ITYPE.EQ.4)KTYPE=2
ENDIF
IF(.NOT.FORCE.AND.CHARGD)THEN
C
C NEED TO RESET ION'S POSITION SO THAT THE CENTER OF MASS IS AT THE
C ORIGIN.
C
DO 30 I=1,3
30 CENTER(I)=0.D0
DO 40 I=1,3
DO 40 J=1,NUMAT
40 CENTER(I)=CENTER(I)+AMS(NAT(J))*COORD(I,J)
DO 50 I=1,3
50 CENTER(I)=CENTER(I)/WTMOL
DO 60 I=1,3
DO 60 J=1,NUMAT
60 COORD(I,J)=COORD(I,J)-CENTER(I)
ENDIF
DO 70 I=1,4
DO 70 J=1,3
70 DIP(I,J)=0.0D00
DO 90 I=1,NUMAT
NI=NAT(I)
IA=NFIRST(I)
L=NLAST(I)-IA
DO 80 J=1,L
K=((IA+J)*(IA+J-1))/2+IA
80 DIP(J,2)=DIP(J,2)-HYF(NI,KTYPE)*P(K)
DO 90 J=1,3
90 DIP(J,1)=DIP(J,1)+4.803D00*Q(I)*COORD(J,I)
DO 100 J=1,3
100 DIP(J,3)=DIP(J,2)+DIP(J,1)
DO 110 J=1,3
110 DIP(4,J)=SQRT(DIP(1,J)**2+DIP(2,J)**2+DIP(3,J)**2)
IF( FORCE) THEN
DIPVEC(1)=DIP(1,3)
DIPVEC(2)=DIP(2,3)
DIPVEC(3)=DIP(3,3)
ENDIF
IF(MODE.EQ.1)WRITE (6,130) ((DIP(I,J),I=1,4),J=1,3)
C STORE DIPOLE MOMENT COMPONENTS IN UX,UY,UZ FOR USE IN
C ASSIGNING CHARGES DETERMINED FROM THE ESP. BHB
UX=DIP(1,3)
UY=DIP(2,3)
UZ=DIP(3,3)
C
C STORE CHARGES Q IN ARRAY CH FOR USE IN ASSIGNING SYMMETRY TO
C CHARGES. BHB
DO 120 I=1,NUMAT
120 CH(I)=Q(I)
DIPOLE = DIP(4,3)
RETURN
C
130 FORMAT (' DIPOLE',11X,'X Y Z TOTAL',/,
1' POINT-CHG.',4F10.3/,' HYBRID',4X,4F10.3/,' SUM',7X,4F10.3)
C
END