-
Notifications
You must be signed in to change notification settings - Fork 5
/
cost_tuning_EH.f
187 lines (159 loc) · 7.42 KB
/
cost_tuning_EH.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
module cost_EH
use type_m
use constants_m
use GA_QCModel_m , only : MO_erg, &
MO_erg_diff, &
Mulliken, &
Bond_Type, &
MO_character, &
Localize, &
Exclude, &
Adaptive_GA, &
me => i_
public :: evaluate_cost , REF_DP , REF_Alpha
! module variables ...
real*8 :: REF_DP(3) , REF_Alpha(3)
! module parameters ...
logical :: lock = .false.
private
contains
!
!===========================================================================
!
! THE TRUE PARAMETERS ARE OUT THERE
!
! TRUST NO OTHERS
!
! DENY EVERYTHING ELSE
!
!===========================================================================
!
!
!==========================================================================
function evaluate_cost( sys , OPT_UNI , basis , DP , Alpha_ii , ShowCost )
!==========================================================================
implicit none
type(structure) , intent(in) :: sys
type(R_eigen) , intent(in) :: OPT_UNI
type(STO_basis) , intent(in) :: basis(:)
real*8 , optional , intent(in) :: DP(3)
real*8 , optional , intent(in) :: Alpha_ii(3)
logical , optional , intent(in) :: ShowCost
real*8 :: evaluate_cost
! local variables ...
integer :: i , dumb
real*8 :: eval(200) = D_zero
logical :: input_mode
input_mode = Adaptive_GA% mode
!-------------------------------------------------------------------------
! Energies ...
! MO_erg_diff( OPT_UNI , MO , ref , {weight} )
! {...} terms are optional
!-------------------------------------------------------------------------
!-------------------------------------------------------------------------
! Energy gaps ...
! MO_erg_diff( OPT_UNI , MO_up , MO_down , dE_ref , {weight} )
! {...} terms are optional
!-------------------------------------------------------------------------
eval(me) = MO_erg_diff( OPT_UNI, 17, 16, 0.29d0 )
eval(me) = MO_erg_diff( OPT_UNI, 16, 15, 2.81d0 )
eval(me) = MO_erg_diff( OPT_UNI, 15, 14, 0.06d0 )
eval(me) = MO_erg_diff( OPT_UNI, 14, 13, 1.08d0 , 2.0)
eval(me) = MO_erg_diff( OPT_UNI, 13, 12, 8.76d0 )
eval(me) = MO_erg_diff( OPT_UNI, 12, 11, 0.21d0 , 5.0)
eval(me) = MO_erg_diff( OPT_UNI, 11, 10, 0.28d0 , 5.0)
eval(me) = MO_erg_diff( OPT_UNI, 10, 9 , 1.22d0 )
eval(me) = MO_erg_diff( OPT_UNI, 9 , 8 , 0.83d0 )
eval(me) = MO_erg_diff( OPT_UNI, 8 , 7 , 0.13d0 )
eval(me) = MO_erg_diff( OPT_UNI, 7 , 6 , 3.16d0 )
eval(me) = MO_erg_diff( OPT_UNI, 6 , 5 , 0.10d0 )
eval(me) = MO_erg_diff( OPT_UNI, 12, 9 , 1.709d0 )
eval(me) = MO_erg_diff( OPT_UNI, 12, 8 , 2.54d0 )
eval(me) = MO_erg_diff( OPT_UNI, 12, 7 , 2.67d0 )
eval(me) = MO_erg_diff( OPT_UNI, 12, 10, 0.485d0 )
eval(me) = MO_erg_diff( OPT_UNI, 11, 9 , 1.50d0 )
eval(me) = MO_erg_diff( OPT_UNI, 11, 8 , 2.33d0 )
eval(me) = MO_erg_diff( OPT_UNI, 9, 7 , 0.958d0 )
eval(me) = MO_erg_diff( OPT_UNI, 8, 6 , 3.291d0 )
eval(me) = MO_erg_diff( OPT_UNI, 40, 37, 17.d0 , 0.1)
!----------------------------------------------------------------------------------------------
! ==> MO_character( OPT_UNI , basis , MO , AO )
! AO = s , py , pz , px , dxy , dyz , dz2 , dxz , dx2y2
!
! ==> Bond_Type( sys , OPT_UNI , MO , atom1 , AO1 , atom2 , AO2 , "+" or "-" )
! Bond Topolgy analysis ...
! AO = s , py , pz , px , dxy , dyz , dz2 , dxz , dx2y2
! + = Bonding & - = Anti_Bonding
!
! ==> Mulliken( OPT_UNI , basis , MO , {atom}=[.,.,.] , {AO} , {EHSymbol} , {residue} , {weight} )
! Population analysis ...
! {...} terms are optional
! AO = s , py , pz , px , dxy , dyz , dz2 , dxz , dx2y2
! weight < 0 ==> does not update "me" when Mulliken in called
!
! ==> Exclude( OPT_UNI , basis , MO , {atom}=[:] , {AO} , {EHSymbol} , {residue} , {reference} , {from_to} , {adaptive} )
! NO charge on these atoms ...
! {...} terms are optional
! default reference < 0.001
! from_to = real_interval( begin , end ) : no need to use {reference} if {from_to} is used
! adaptive = {input_mode,lock} : logical flag to enable adpative GA method, lock sets reference = end
!
! ==> Localize( OPT_UNI , basis , MO , {atom}=[:] , {AO} , {EHSymbol} , {residue} , {reference} , {from_to} , {adaptive} )
! {...} terms are optional
! default criterium (reference=0.85): localized > 85% of total population
! from_to = real_interval( begin , end ) : no need to use {reference} if {from_to} is used
! adaptive = {input_mode,lock} : logical flag to enable adpative GA method , lock sets reference = end
!----------------------------------------------------------------------------------------------
!3 ===================
!eval(me) = exclude (OPT_UNI, basis, MO=39, AO="S", EHSymbol = "HW", from_to = real_interval( 0.91 , 0.30 ), adaptive = input_mode)
!5 LUMO ===================
!eval(me) = MO_character( OPT_UNI , basis , MO=41 , AO='S')
!eval(me) = exclude (OPT_UNI, basis, MO=41, AO="Py", EHSymbol = "$$", from_to = real_interval( 0.42 , 0.40 ), adaptive = lock)
!eval(me) = exclude(OPT_UNI, basis, MO=41, AO="S", EHSymbol = "$$", from_to = real_interval( 0.325 , 0.32 ), adaptive = lock)
!eval(me) = exclude (OPT_UNI, basis, MO=41, AO="S", EHSymbol = "OW", from_to = real_interval( 0.93 , 0.12 ), adaptive = input_mode)
!eval(me) = exclude (OPT_UNI, basis, MO=41, AO="Pz", EHSymbol = "OW", from_to = real_interval( 0.37 , 0.36 ), adaptive = input_mode)
!eval(me) = Bond_Type( sys , OPT_UNI , MO=41 , atom1=1 , AO1="S" , atom2=2 , AO2="S" , instance="-" )
!eval(me) = Bond_Type( sys , OPT_UNI , MO=41 , atom1=1 , AO1="S" , atom2=3 , AO2="S" , instance="-" )
!
!6 LUMO+1 ===================
!eval(me) = MO_character( OPT_UNI , basis , MO=42 , AO='Py')
!eval(me) = Localize (OPT_UNI, basis, MO=42, AO="S", EHSymbol = "HW", from_to = real_interval( 0.1, 0.5), adaptive = input_mode)
!eval(me) = Localize (OPT_UNI, basis, MO=42, AO="Py", EHSymbol = "OW", from_to = real_interval( 0.1, 0.4), adaptive = input_mode)
!-------------------------
! Total DIPOLE moment ...
!-------------------------
REF_DP = [ 0.0d0 , 0.0d0 , 1.85d0 ]
eval(me+1) = DP(1) - REF_DP(1)
eval(me+2) = DP(2) - REF_DP(2)
eval(me+3) = (DP(3) - REF_DP(3))*2.0
me = me + 3
!-----------------------------------------------------
! Polarizability: Alpha tensor diagonal elements ...
!-----------------------------------------------------
!REF_Alpha = [ 9.2d0 , 8.5d0 , 7.8d0 ]
!eval() = Alpha_ii(1) - REF_Alpha(1)
!eval() = Alpha_ii(2) - REF_Alpha(2)
!eval() = Alpha_ii(3) - REF_Alpha(3)
!......................................................................
! at last, show the cost ...
If( present(ShowCost) ) then
open( unit=33 , file='opt.trunk/view_cost.dat' , status='unknown' )
do i = 1 , me
write(33,*) i , dabs(eval(i))
end do
CALL system( dynemoldir//"env.sh save_cost_statement " )
Print 218
end If
!......................................................................
! evaluate total cost ...
evaluate_cost = sum( abs(eval) )
! just touching variables ...
dumb = basis(1)%atom
!reset index for next round ...
me = 0
include 'formats.h'
end function evaluate_cost
!
!
!
end module cost_EH