5
C> Implementation of the M06 exchange functional
12
C> \brief The M06 exchange functional
14
C> The M06 functional [1,2] is a meta-GGA of which this evaluates
15
C> the exchange component.
19
C> [1] Y Zhao, DG Truhlar,
20
C> "A new local density functional for main-group thermochemistry,
21
C> transition metal bonding, thermochemical kinetics, and noncovalent
23
C> J. Chem. Phys. <b>125</b>, 194101 (2006), DOI:
24
C> <a href="http://dx.doi.org/10.1063/1.2370993">
25
C> 10.1063/1.2370993</a>.
27
C> [2] Y Zhao, DG Truhlar,
28
C> "Density functional for spectroscopy: No long-range self-interaction
29
C> error, good performance for Rydberg and charge-transfer states,
30
C> and better performance on average than B3LYP for ground states",
31
C> J. Phys. Chem. A <b>110</b>, 13126-13130 (2006), DOI:
32
C> <a href="http://dx.doi.org/10.1021/jp066479k">
33
C> 10.1021/jp066479k</a>.
35
c M06 suite exchange functional
37
C utilizes ingredients:
39
c delrho - gradient of density
40
c tau - K.S kinetic energy density
41
c tauU - uniform-gas KE density
47
c [a] Zhao, Y. and Truhlar, D. G. J. Chem. Phys. 2006, 125, 194101;
48
c [b] Zhao, Y. and Truhlar, D. G. J. Phys. Chem. A (2006),110(49),13126-13130.
51
Subroutine nwxc_x_m06(param, tol_rho, ipol, nq, wght, rho, rgamma,
52
& tau, func, Amat, Cmat, Mmat)
54
c$Id: xc_xm06.F 21740 2012-01-11 00:25:15Z edo $
58
#include "nwxc_param.fh"
60
double precision param(*) !< [Input] Parameters of the functional
61
!< - param( 1): \f$ d_0 \f$
62
!< - param( 2): \f$ d_1 \f$
63
!< - param( 3): \f$ d_2 \f$
64
!< - param( 4): \f$ d_3 \f$
65
!< - param( 5): \f$ d_4 \f$
66
!< - param( 6): \f$ d_5 \f$
67
!< - param( 7): \f$ a_0 \f$
68
!< - param( 8): \f$ a_1 \f$
69
!< - param( 9): \f$ a_2 \f$
70
!< - param(10): \f$ a_3 \f$
71
!< - param(11): \f$ a_4 \f$
72
!< - param(12): \f$ a_5 \f$
73
!< - param(13): \f$ a_6 \f$
74
!< - param(14): \f$ a_7 \f$
75
!< - param(15): \f$ a_8 \f$
76
!< - param(16): \f$ a_9 \f$
77
!< - param(17): \f$ a_10 \f$
78
!< - param(18): \f$ a_11 \f$
79
double precision tol_rho !< [Input] The lower limit on the density
80
integer nq !< [Input] The number of points
81
integer ipol !< [Input] The number of spin channels
82
double precision wght !< [Input] The weight of the functional
86
double precision rho(nq,*) !< [Input] The density
88
c Charge Density Gradient Norm
90
double precision rgamma(nq,*) !< [Input] The density gradient norm
92
c Kinetic Energy Density
94
double precision tau(nq,*) !< [Input] The kinetic energy density
98
double precision func(*) !< [Output] The functional value
100
c Sampling Matrices for the XC Potential
102
double precision Amat(nq,*) !< [Output] Derivative wrt density
103
double precision Cmat(nq,*) !< [Output] Derivative wrt rgamma
104
double precision Mmat(nq,*) !< [Output] Derivative wrt tau
109
double precision at1, at2, at3, at4, at5, at6, at7, at8, at9
110
double precision at, at10, at11, at0, C1, C2, fL, fNL
111
double precision rrho, rho43, rho13, rhoo, rho53
112
double precision Gamma2, Gamma
113
double precision TauUEG, Tsig, Wsig, W1, W2, W3, W4, W5, W6
114
double precision W7, W8, W9, W10, W11, Fsig
116
double precision tauN,tauu,DTol
117
double precision F83, F23, F53, F43, F13, F1o3
118
double precision F1o4, F2o3, F3o2, F4o3, F4o9, F3o5
119
double precision One, Two, Three, Four, Five, Six, Seven, Eight
120
double precision Nine, F10, F11
121
double precision Cs, Ax, P32, s, s2, En, Ed, E, dE, dEn, dEd
123
c functional derivatives below FFFFFFFFFFFF
125
double precision dFdW, dWdT, dTdR, dTdTau, dGGAdR, dFdR
126
double precision dFdTau, dGGAdG,tauW
128
c functional derivatives above FFFFFFFFFFFF
131
cedo parameter( pi = 3.1415926535897932384626433832795d0 )
134
parameter (F1o3=1.d0/3.d0, F1o4=1.d0/4.d0, F2o3=2.d0/3.d0,
135
& F3o2=3.d0/2.d0,F13=1.d0/3.d0)
136
parameter (F4o3=4.d0/3.d0, F4o9=4.d0/9.d0, F3o5=3.d0/5.d0)
137
parameter (F83=8.d0/3.0d0, F23=2.0d0/3.d0, F53=5.d0/3.d0)
138
parameter (One=1.0d0, Two=2.0d0, Three=3.0d0, Four=4.0d0,
139
& Five=5.0d0,Six=6.0d0, Seven=7.0d0,
140
& Eight=8.0d0, Nine=9.0d0,F10=10.d0, F11=11.d0)
155
c if (ijzy.eq.1) then
167
c at11= -9.049762D+00
168
c elseif (ijzy.eq.2) then
169
c Parameters for M06-HF
180
c at10= -2.557716D+01
182
c elseif (ijzy.eq.3) then
196
c elseif (ijzy.eq.4) then
197
c Parameters for M06-2X
213
call nwxc_x_vs98(param,tol_rho, ipol, nq, wght, rho, rgamma, tau,
214
& func, Amat, Cmat, Mmat)
217
C1 = 0.2195149727645171d0
222
C Scale factors for local and non-local contributions.
226
Cs = 0.5d0/(3.0d0*pi*pi)**F13
227
P32 = (3.d0*pi**2)**F23
230
Ax = (-0.75d0)*(3.0d0/pi)**F13
236
c ======> SPIN-RESTRICTED <======
242
if (rho(n,R_T).lt.DTol) goto 10
246
rrho = 1d0/rhoo ! reciprocal of rho
253
if(taun.lt.dtol) goto 10
255
TauUEG=0.3d0*P32*rho53
257
Wsig =(Tsig-One)/(Tsig+One)
269
Fsig =at*(at0 + at1*W1+ at2*W2 + at3*W3
270
& + at4*W4 + at5*W5 + at6*W6 + at7*W7
271
& + at8*W8 + at9*W9 + at10*W10 + at11*W11)
273
c Gamma2 = delrho(n,1,1)*delrho(n,1,1) +
274
c & delrho(n,2,1)*delrho(n,2,1) +
275
c & delrho(n,3,1)*delrho(n,3,1)
276
Gamma2 = rgamma(n,G_TT)
277
Gamma = dsqrt(Gamma2)
278
if(gamma.lt.dtol) goto 10
284
c Ex = Ex + rho43*Ax*(fL+fNL*E)*Fsig*qwght(n)
285
func(n)=func(n)+rho43*Ax*(fL+fNL*E)*Fsig
287
c functional derivatives
291
dE = (dEn*Ed-En*dEd)/(Ed*Ed)
292
dFdW = at*(at1 + Two*at2*W1 + Three*at3*W2
293
& + Four*at4*W3 + Five*at5*W4
294
& + Six*at6*W5 + Seven*at7*W6
295
& + Eight*at8*W7 + Nine*at9*W8
296
& + F10*at10*W9 + F11*at11*W10)
297
dWdT = Two/((One + Tsig)**2)
298
dTdR = (0.5d0*P32*rho13*rho13)/tauu
299
dTdTau = -TauUEG/tauu**2
300
dGGAdR = F4o3*rho13*Ax*(fL+fNL*(E-s*dE))
301
dFdR = dFdW*dWdT*dTdR
302
dFdTau=dFdW*dWdT*dTdTau
303
dGGAdG =(fNL*dE*s/(Two*Gamma2))
304
Amat(n,D1_RA) = Amat(n,D1_RA) + dGGAdR*Fsig
305
& + (fL+fNL*E)*Ax*rho43*dFdR
306
Cmat(n,D1_GAA) = Cmat(n,D1_GAA)
307
& + Two*dGGAdG*Ax*rho43*Fsig
308
Mmat(n,D1_TA) = Mmat(n,D1_TA)
309
& + 0.5d0*rho43*Ax*(fL+fNL*E)*dFdTau
314
c UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUnrestricted
317
c ======> SPIN-UNRESTRICTED <======
320
c use spin density functional theory ie n-->2n
321
c Ex=(1/2)Ex[2*alpha] + (1/2)Ex[2*beta]
324
if (rho(n,R_A)+rho(n,R_B).lt.DTol) goto 20
328
if (rho(n,R_A).lt.0.5d0*DTol) goto 25
329
rhoo = Two*rho(n,R_A)
331
rrho = 1.0d0/rhoo ! reciprocal of rho
337
TauUEG=0.3d0*P32*rho53
339
Wsig =(Tsig-One)/(Tsig+One)
351
Fsig =at*(at0 + at1*W1+ at2*W2 + at3*W3
352
& + at4*W4 + at5*W5 + at6*W6 + at7*W7
353
& + at8*W8 + at9*W9 + at10*W10 + at11*W11)
356
c Gamma2 = delrho(n,1,1)*delrho(n,1,1) +
357
c & delrho(n,2,1)*delrho(n,2,1) +
358
c & delrho(n,3,1)*delrho(n,3,1)
359
Gamma2 = rgamma(n,G_AA)
361
Gamma = dsqrt(Gamma2)
368
c Ex = Ex + rho43*Ax*(fL+fNL*E)*(Fsig)*0.5d0*qwght(n)
369
func(n)=func(n)+rho43*Ax*(fL+fNL*E)*(Fsig)*.5d0
371
c functional derivatives
375
dE = (dEn*Ed-En*dEd)/(Ed*Ed)
376
dFdW = at*(at1 + Two*at2*W1 + Three*at3*W2
377
& + Four*at4*W3 + Five*at5*W4
378
& + Six*at6*W5 + Seven*at7*W6
379
& + Eight*at8*W7 + Nine*at9*W8
380
& + F10*at10*W9 + F11*at11*W10)
381
dWdT = Two/((One + Tsig)**2)
382
dTdR = Two*(0.5d0*P32*rho13*rho13)/tauu
383
dTdTau = -Two*TauUEG/tauu**2
384
dGGAdR = Two*F4o3*rho13*Ax*(fL+fNL*(E-s*dE))
385
dFdR = dFdW*dWdT*dTdR
386
dFdTau=dFdW*dWdT*dTdTau
387
dGGAdG =Four*(fNL*dE*s/(Two*Gamma2))
389
Amat(n,D1_RA) = Amat(n,D1_RA) + (dGGAdR*(Fsig)
390
& + (fL+fNL*E)*Ax*rho43*dFdR)*0.5d0
391
Cmat(n,D1_GAA) = Cmat(n,D1_GAA)
392
& + dGGAdG*Ax*rho43*(Fsig)*0.5d0
393
Mmat(n,D1_TA) = Mmat(n,D1_TA)
394
& + 0.5d0*0.5d0*rho43*Ax*(fL+fNL*E)*dFdTau
396
c write (*,*) "Ex,Amat(n,1),Cmat(n,1)",
397
c & Ex,Amat(n,1),Cmat(n,1)
408
if (rho(n,R_B).lt.0.5d0*DTol) goto 20
409
rhoo = Two*rho(n,R_B)
411
rrho = 1.0d0/rhoo ! reciprocal of rho
417
TauUEG=0.3d0*P32*rho53
419
Wsig =(Tsig-One)/(Tsig+One)
431
Fsig =at*(at0+at1*W1+ at2*W2 + at3*W3
432
& + at4*W4 + at5*W5 + at6*W6 + at7*W7
433
& + at8*W8 + at9*W9 + at10*W10 + at11*W11)
436
c Gamma2 = delrho(n,1,2)*delrho(n,1,2) +
437
c & delrho(n,2,2)*delrho(n,2,2) +
438
c & delrho(n,3,2)*delrho(n,3,2)
439
Gamma2 = rgamma(n,G_BB)
441
Gamma = dsqrt(Gamma2)
447
c Ex = Ex + rho43*Ax*(fL+fNL*E)*(Fsig)*0.5d0*qwght(n)
448
func(n)= func(n)+rho43*Ax*(fL+fNL*E)*(Fsig)*.5d0
450
c functional derivatives
454
dE = (dEn*Ed-En*dEd)/(Ed*Ed)
455
dFdW = at*(at1 + Two*at2*W1 + Three*at3*W2
456
& + Four*at4*W3 + Five*at5*W4
457
& + Six*at6*W5 + Seven*at7*W6
458
& + Eight*at8*W7 + Nine*at9*W8
459
& + F10*at10*W9 + F11*at11*W10)
460
dWdT = Two/((One + Tsig)**2)
461
dTdR = Two*(0.5d0*P32*rho13*rho13)/tauu
462
dTdTau = -Two*TauUEG/tauu**2
463
dGGAdR = Two*F4o3*rho13*Ax*(fL+fNL*(E-s*dE))
464
dFdR = dFdW*dWdT*dTdR
465
dFdTau=dFdW*dWdT*dTdTau
466
dGGAdG =Four*(fNL*dE*s/(Two*Gamma2))
468
Amat(n,D1_RB) = Amat(n,D1_RB) + (dGGAdR*(Fsig)
469
& + (fL+fNL*E)*Ax*rho43*dFdR)*0.5d0
470
Cmat(n,D1_GBB) = Cmat(n,D1_GBB)
471
& + dGGAdG*Ax*rho43*(Fsig)*0.5d0
472
Mmat(n,D1_TB) = Mmat(n,D1_TB)
473
& + 0.5d0*0.5d0*rho43*Ax*(fL+fNL*E)*dFdTau
481
C> \brief Evaluate the M06-2X exchange functional
483
C> This routine evaluates the M06-2X exchange functional [1,2]. This functional
484
C> is closely related to the M06, M06-HF and M06-L exchange functionals
485
C> except that it does not use the VS98 exchange functional, hence the
486
C> parameter list is defined differently.
488
C> ### References ###
490
C> [1] Y Zhao, DG Truhlar,
491
C> "A new local density functional for main-group thermochemistry,
492
C> transition metal bonding, thermochemical kinetics, and noncovalent
494
C> J. Chem. Phys. <b>125</b>, 194101 (2006), DOI:
495
C> <a href="http://dx.doi.org/10.1063/1.2370993">
496
C> 10.1063/1.2370993</a>.
498
C> [2] Y Zhao, DG Truhlar,
499
C> "Density functional for spectroscopy: No long-range self-interaction
500
C> error, good performance for Rydberg and charge-transfer states,
501
C> and better performance on average than B3LYP for ground states",
502
C> J. Phys. Chem. A <b>110</b>, 13126-13130 (2006), DOI:
503
C> <a href="http://dx.doi.org/10.1021/jp066479k">
504
C> 10.1021/jp066479k</a>.
507
Subroutine nwxc_x_m06_2x(param, tol_rho, ipol, nq, wght,
508
& rho, rgamma, tau, func, Amat, Cmat, Mmat)
510
c$Id: xc_xm06.F 21740 2012-01-11 00:25:15Z edo $
514
#include "nwxc_param.fh"
516
double precision param(*) !< [Input] Parameters of the functional
517
!< - param( 1): \f$ a_0 \f$
518
!< - param( 2): \f$ a_1 \f$
519
!< - param( 3): \f$ a_2 \f$
520
!< - param( 4): \f$ a_3 \f$
521
!< - param( 5): \f$ a_4 \f$
522
!< - param( 6): \f$ a_5 \f$
523
!< - param( 7): \f$ a_6 \f$
524
!< - param( 8): \f$ a_7 \f$
525
!< - param( 9): \f$ a_8 \f$
526
!< - param(10): \f$ a_9 \f$
527
!< - param(11): \f$ a_10 \f$
528
!< - param(12): \f$ a_11 \f$
529
double precision tol_rho !< [Input] The lower limit on the density
530
integer nq !< [Input] The number of points
531
integer ipol !< [Input] The number of spin channels
532
double precision wght !< [Input] The weight of the functional
536
double precision rho(nq,*) !< [Input] The density
538
c Charge Density Gradient Norm
540
double precision rgamma(nq,*) !< [Input] The density gradient norm
542
c Kinetic Energy Density
544
double precision tau(nq,*) !< [Input] The kinetic energy density
548
double precision func(*) !< [Output] The functional value
550
c Sampling Matrices for the XC Potential
552
double precision Amat(nq,*) !< [Output] Derivative wrt density
553
double precision Cmat(nq,*) !< [Output] Derivative wrt rgamma
554
double precision Mmat(nq,*) !< [Output] Derivative wrt tau
559
double precision at1, at2, at3, at4, at5, at6, at7, at8, at9
560
double precision at, at10, at11, at0, C1, C2, fL, fNL
561
double precision rrho, rho43, rho13, rhoo, rho53
562
double precision Gamma2, Gamma
563
double precision TauUEG, Tsig, Wsig, W1, W2, W3, W4, W5, W6
564
double precision W7, W8, W9, W10, W11, Fsig
566
double precision tauN,tauu,DTol
567
double precision F83, F23, F53, F43, F13, F1o3
568
double precision F1o4, F2o3, F3o2, F4o3, F4o9, F3o5
569
double precision One, Two, Three, Four, Five, Six, Seven, Eight
570
double precision Nine, F10, F11
571
double precision Cs, Ax, P32, s, s2, En, Ed, E, dE, dEn, dEd
573
c functional derivatives below FFFFFFFFFFFF
575
double precision dFdW, dWdT, dTdR, dTdTau, dGGAdR, dFdR
576
double precision dFdTau, dGGAdG,tauW
578
c functional derivatives above FFFFFFFFFFFF
581
cedo parameter( pi = 3.1415926535897932384626433832795d0 )
584
parameter (F1o3=1.d0/3.d0, F1o4=1.d0/4.d0, F2o3=2.d0/3.d0,
585
& F3o2=3.d0/2.d0,F13=1.d0/3.d0)
586
parameter (F4o3=4.d0/3.d0, F4o9=4.d0/9.d0, F3o5=3.d0/5.d0)
587
parameter (F83=8.d0/3.0d0, F23=2.0d0/3.d0, F53=5.d0/3.d0)
588
parameter (One=1.0d0, Two=2.0d0, Three=3.0d0, Four=4.0d0,
589
& Five=5.0d0,Six=6.0d0, Seven=7.0d0,
590
& Eight=8.0d0, Nine=9.0d0,F10=10.d0, F11=11.d0)
605
c if (ijzy.eq.1) then
617
c at11= -9.049762D+00
618
c elseif (ijzy.eq.2) then
619
c Parameters for M06-HF
630
c at10= -2.557716D+01
632
c elseif (ijzy.eq.3) then
646
c elseif (ijzy.eq.4) then
647
c Parameters for M06-2X
664
C1 = 0.2195149727645171d0
669
C Scale factors for local and non-local contributions.
673
Cs = 0.5d0/(3.0d0*pi*pi)**F13
674
P32 = (3.d0*pi**2)**F23
677
Ax = (-0.75d0)*(3.0d0/pi)**F13
683
c ======> SPIN-RESTRICTED <======
689
if (rho(n,R_T).lt.DTol) goto 10
693
rrho = 1d0/rhoo ! reciprocal of rho
700
if(taun.lt.dtol) goto 10
702
TauUEG=0.3d0*P32*rho53
704
Wsig =(Tsig-One)/(Tsig+One)
716
Fsig =at*(at0 + at1*W1+ at2*W2 + at3*W3
717
& + at4*W4 + at5*W5 + at6*W6 + at7*W7
718
& + at8*W8 + at9*W9 + at10*W10 + at11*W11)
720
c Gamma2 = delrho(n,1,1)*delrho(n,1,1) +
721
c & delrho(n,2,1)*delrho(n,2,1) +
722
c & delrho(n,3,1)*delrho(n,3,1)
723
Gamma2 = rgamma(n,G_TT)
724
Gamma = dsqrt(Gamma2)
725
if(gamma.lt.dtol) goto 10
731
c Ex = Ex + rho43*Ax*(fL+fNL*E)*Fsig*qwght(n)
732
func(n)=func(n)+rho43*Ax*(fL+fNL*E)*Fsig
734
c functional derivatives
738
dE = (dEn*Ed-En*dEd)/(Ed*Ed)
739
dFdW = at*(at1 + Two*at2*W1 + Three*at3*W2
740
& + Four*at4*W3 + Five*at5*W4
741
& + Six*at6*W5 + Seven*at7*W6
742
& + Eight*at8*W7 + Nine*at9*W8
743
& + F10*at10*W9 + F11*at11*W10)
744
dWdT = Two/((One + Tsig)**2)
745
dTdR = (0.5d0*P32*rho13*rho13)/tauu
746
dTdTau = -TauUEG/tauu**2
747
dGGAdR = F4o3*rho13*Ax*(fL+fNL*(E-s*dE))
748
dFdR = dFdW*dWdT*dTdR
749
dFdTau=dFdW*dWdT*dTdTau
750
dGGAdG =(fNL*dE*s/(Two*Gamma2))
751
Amat(n,D1_RA) = Amat(n,D1_RA) + dGGAdR*Fsig
752
& + (fL+fNL*E)*Ax*rho43*dFdR
753
Cmat(n,D1_GAA) = Cmat(n,D1_GAA)
754
& + Two*dGGAdG*Ax*rho43*Fsig
755
Mmat(n,D1_TA) = Mmat(n,D1_TA)
756
& + 0.5d0*rho43*Ax*(fL+fNL*E)*dFdTau
761
c UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUnrestricted
764
c ======> SPIN-UNRESTRICTED <======
767
c use spin density functional theory ie n-->2n
768
c Ex=(1/2)Ex[2*alpha] + (1/2)Ex[2*beta]
771
if (rho(n,R_A)+rho(n,R_B).lt.DTol) goto 20
775
if (rho(n,R_A).lt.0.5d0*DTol) goto 25
776
rhoo = Two*rho(n,R_A)
778
rrho = 1.0d0/rhoo ! reciprocal of rho
784
TauUEG=0.3d0*P32*rho53
786
Wsig =(Tsig-One)/(Tsig+One)
798
Fsig =at*(at0 + at1*W1+ at2*W2 + at3*W3
799
& + at4*W4 + at5*W5 + at6*W6 + at7*W7
800
& + at8*W8 + at9*W9 + at10*W10 + at11*W11)
803
c Gamma2 = delrho(n,1,1)*delrho(n,1,1) +
804
c & delrho(n,2,1)*delrho(n,2,1) +
805
c & delrho(n,3,1)*delrho(n,3,1)
806
Gamma2 = rgamma(n,G_AA)
808
Gamma = dsqrt(Gamma2)
815
c Ex = Ex + rho43*Ax*(fL+fNL*E)*(Fsig)*0.5d0*qwght(n)
816
func(n)=func(n)+rho43*Ax*(fL+fNL*E)*(Fsig)*.5d0
818
c functional derivatives
822
dE = (dEn*Ed-En*dEd)/(Ed*Ed)
823
dFdW = at*(at1 + Two*at2*W1 + Three*at3*W2
824
& + Four*at4*W3 + Five*at5*W4
825
& + Six*at6*W5 + Seven*at7*W6
826
& + Eight*at8*W7 + Nine*at9*W8
827
& + F10*at10*W9 + F11*at11*W10)
828
dWdT = Two/((One + Tsig)**2)
829
dTdR = Two*(0.5d0*P32*rho13*rho13)/tauu
830
dTdTau = -Two*TauUEG/tauu**2
831
dGGAdR = Two*F4o3*rho13*Ax*(fL+fNL*(E-s*dE))
832
dFdR = dFdW*dWdT*dTdR
833
dFdTau=dFdW*dWdT*dTdTau
834
dGGAdG =Four*(fNL*dE*s/(Two*Gamma2))
836
Amat(n,D1_RA) = Amat(n,D1_RA) + (dGGAdR*(Fsig)
837
& + (fL+fNL*E)*Ax*rho43*dFdR)*0.5d0
838
Cmat(n,D1_GAA) = Cmat(n,D1_GAA)
839
& + dGGAdG*Ax*rho43*(Fsig)*0.5d0
840
Mmat(n,D1_TA) = Mmat(n,D1_TA)
841
& + 0.5d0*0.5d0*rho43*Ax*(fL+fNL*E)*dFdTau
843
c write (*,*) "Ex,Amat(n,1),Cmat(n,1)",
844
c & Ex,Amat(n,1),Cmat(n,1)
855
if (rho(n,R_B).lt.0.5d0*DTol) goto 20
856
rhoo = Two*rho(n,R_B)
858
rrho = 1.0d0/rhoo ! reciprocal of rho
864
TauUEG=0.3d0*P32*rho53
866
Wsig =(Tsig-One)/(Tsig+One)
878
Fsig =at*(at0+at1*W1+ at2*W2 + at3*W3
879
& + at4*W4 + at5*W5 + at6*W6 + at7*W7
880
& + at8*W8 + at9*W9 + at10*W10 + at11*W11)
883
c Gamma2 = delrho(n,1,2)*delrho(n,1,2) +
884
c & delrho(n,2,2)*delrho(n,2,2) +
885
c & delrho(n,3,2)*delrho(n,3,2)
886
Gamma2 = rgamma(n,G_BB)
888
Gamma = dsqrt(Gamma2)
894
c Ex = Ex + rho43*Ax*(fL+fNL*E)*(Fsig)*0.5d0*qwght(n)
895
func(n)= func(n)+rho43*Ax*(fL+fNL*E)*(Fsig)*.5d0
897
c functional derivatives
901
dE = (dEn*Ed-En*dEd)/(Ed*Ed)
902
dFdW = at*(at1 + Two*at2*W1 + Three*at3*W2
903
& + Four*at4*W3 + Five*at5*W4
904
& + Six*at6*W5 + Seven*at7*W6
905
& + Eight*at8*W7 + Nine*at9*W8
906
& + F10*at10*W9 + F11*at11*W10)
907
dWdT = Two/((One + Tsig)**2)
908
dTdR = Two*(0.5d0*P32*rho13*rho13)/tauu
909
dTdTau = -Two*TauUEG/tauu**2
910
dGGAdR = Two*F4o3*rho13*Ax*(fL+fNL*(E-s*dE))
911
dFdR = dFdW*dWdT*dTdR
912
dFdTau=dFdW*dWdT*dTdTau
913
dGGAdG =Four*(fNL*dE*s/(Two*Gamma2))
915
Amat(n,D1_RB) = Amat(n,D1_RB) + (dGGAdR*(Fsig)
916
& + (fL+fNL*E)*Ax*rho43*dFdR)*0.5d0
917
Cmat(n,D1_GBB) = Cmat(n,D1_GBB)
918
& + dGGAdG*Ax*rho43*(Fsig)*0.5d0
919
Mmat(n,D1_TB) = Mmat(n,D1_TB)
920
& + 0.5d0*0.5d0*rho43*Ax*(fL+fNL*E)*dFdTau
931
Subroutine nwxc_x_m06_d2()
932
call errquit(' xm06: d2 not coded ',0,0)