~ubuntu-branches/ubuntu/utopic/nwchem/utopic

« back to all changes in this revision

Viewing changes to src/nwpw/pspw/cgsd/nominimize.F

  • Committer: Package Import Robot
  • Author(s): Michael Banck, Daniel Leidert, Andreas Tille, Michael Banck
  • Date: 2013-07-04 12:14:55 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130704121455-5tvsx2qabor3nrui
Tags: 6.3-1
* New upstream release.
* Fixes anisotropic properties (Closes: #696361).
* New features include:
  + Multi-reference coupled cluster (MRCC) approaches
  + Hybrid DFT calculations with short-range HF 
  + New density-functionals including Minnesota (M08, M11) and HSE hybrid
    functionals
  + X-ray absorption spectroscopy (XAS) with TDDFT
  + Analytical gradients for the COSMO solvation model
  + Transition densities from TDDFT 
  + DFT+U and Electron-Transfer (ET) methods for plane wave calculations
  + Exploitation of space group symmetry in plane wave geometry optimizations
  + Local density of states (LDOS) collective variable added to Metadynamics
  + Various new XC functionals added for plane wave calculations, including
    hybrid and range-corrected ones
  + Electric field gradients with relativistic corrections 
  + Nudged Elastic Band optimization method
  + Updated basis sets and ECPs 

[ Daniel Leidert ]
* debian/watch: Fixed.

[ Andreas Tille ]
* debian/upstream: References

[ Michael Banck ]
* debian/upstream (Name): New field.
* debian/patches/02_makefile_flags.patch: Refreshed.
* debian/patches/06_statfs_kfreebsd.patch: Likewise.
* debian/patches/07_ga_target_force_linux.patch: Likewise.
* debian/patches/05_avoid_inline_assembler.patch: Removed, no longer needed.
* debian/patches/09_backported_6.1.1_fixes.patch: Likewise.
* debian/control (Build-Depends): Added gfortran-4.7 and gcc-4.7.
* debian/patches/10_force_gcc-4.7.patch: New patch, explicitly sets
  gfortran-4.7 and gcc-4.7, fixes test suite hang with gcc-4.8 (Closes:
  #701328, #713262).
* debian/testsuite: Added tests for COSMO analytical gradients and MRCC.
* debian/rules (MRCC_METHODS): New variable, required to enable MRCC methods.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
c
2
 
c     $Id: nominimize.F 21832 2012-01-24 00:01:26Z bylaska $ 
 
2
c     $Id: nominimize.F 23844 2013-03-19 01:31:25Z bylaska $ 
3
3
c
4
4
*     ******************************************
5
5
*     *                                        *
27
27
      !real*8  e_qmmm_e,e_qmmm_q,e_qmmm_lj,e_mmmm_q,e_mmmm_lj
28
28
      real*8  e_lj,e_q,e_spring
29
29
      real*8  ehsic,phsic,exsic,pxsic,ehfx,phfx
 
30
      real*8  exc_atom,pxc_atom,ehartree_atom,ecmp_cmp,ecmp_pw
30
31
      
31
32
 
32
33
*     **** external functions ****
33
34
      integer  psi_neq,control_version
34
35
      real*8   dng_1ehartree
35
36
      real*8   psi_1ke
36
 
      real*8   psi_1vl,psi_1v_field
 
37
      real*8   psi_1vl,psi_1v_field,dng_1vlpaw_pw
37
38
      real*8   psi_1vnl
38
39
      real*8   rho_1exc
39
40
      real*8   rho_1pxc
43
44
      external psi_neq,control_version
44
45
      external dng_1ehartree
45
46
      external psi_1ke
46
 
      external psi_1vl,psi_1v_field
 
47
      external psi_1vl,psi_1v_field,dng_1vlpaw_pw
47
48
      external psi_1vnl
48
49
      external rho_1exc
49
50
      external rho_1pxc
64
65
      external pspw_charge_Energy_ion,pspw_charge_Energy_charge
65
66
 
66
67
*     ***** pspw_SIC and pspw_HFX external functions ****
67
 
      logical  pspw_SIC,pspw_HFX
68
 
      external pspw_SIC,pspw_HFX
 
68
      logical  pspw_SIC,pspw_HFX,psp_U_psputerm,meta_found
 
69
      external pspw_SIC,pspw_HFX,psp_U_psputerm,meta_found
69
70
 
70
71
*     ***** PAW functions ****
71
72
      logical  psp_pawexist
72
 
      real*8   psp_kinetic_core,psi_1ke_atom,psi_1vloc_atom,psi_1xc_atom
73
 
      real*8   psp_ion_core,psi_1valence_core_atom
 
73
      real*8   psp_kinetic_core,psi_1ke_atom,psi_1vloc_atom
 
74
      real*8   psp_ion_core,psi_1valence_core_atom,psi_1hartree_atom
 
75
      real*8   psi_1hartree_cmp_cmp,dng_1hartree_cmp_pw
74
76
      external psp_pawexist
75
 
      external psp_kinetic_core,psi_1ke_atom,psi_1vloc_atom,psi_1xc_atom
76
 
      external psp_ion_core,psi_1valence_core_atom
 
77
      external psp_kinetic_core,psi_1ke_atom,psi_1vloc_atom
 
78
      external psp_ion_core,psi_1valence_core_atom,psi_1hartree_atom
 
79
      external psi_1hartree_cmp_cmp,dng_1hartree_cmp_pw
 
80
 
 
81
      logical  nwpw_meta_gga_on
 
82
      external nwpw_meta_gga_on
 
83
      real*8   psi_1meta_gga_pxc
 
84
      external psi_1meta_gga_pxc
 
85
 
 
86
 
77
87
 
78
88
      call Pack_npack(1,npack1)
79
89
      neall = psi_neq(1)+psi_neq(2)
99
109
      exc      = rho_1exc()
100
110
      pxc      = rho_1pxc()
101
111
 
 
112
*     **** Metadynamics GGA Tau potential term ****
 
113
      if (nwpw_meta_gga_on()) then
 
114
         pxc = pxc + psi_1meta_gga_pxc()
 
115
      end if
 
116
 
 
117
 
102
118
      E(1)  = Enew + eion
103
119
      E(2)  = eorbit
104
120
      E(3)  = ehartree
109
125
      E(8)  = psi_1vnl()
110
126
      E(9)  = 2.0d0*ehartree
111
127
      E(10) = pxc
 
128
 
 
129
*     ***** qmmm energies *****
112
130
      if (pspw_qmmm_found()) then
113
 
         e_lj     = pspw_qmmm_LJ_E()
114
 
         e_q      = pspw_qmmm_Q_E()
115
 
         e_spring = pspw_qmmm_spring_E()
 
131
         e_lj     = pspw_qmmm_LJ_E()     !*** independent of psi ***
 
132
         e_q      = pspw_qmmm_Q_E()      !*** independent of psi ***
 
133
         e_spring = pspw_qmmm_spring_E() !*** independent of psi ***
116
134
         E(1)  = E(1) + e_lj + e_q + e_spring
117
135
 
118
136
         E(11) = e_lj
122
140
 
123
141
*     **** paw energies ****
124
142
      if (psp_pawexist()) then
125
 
         E(14) = psi_1ke_atom()            !*** kinetic atom ***
126
 
         E(15) = psp_kinetic_core()        !*** kinetic core ***
127
 
         E(16) = psi_1vloc_atom()          !*** vlocal atom  ***
128
 
         E(17) = 0.0d0                     !*** vcoulomb atom  ***
129
 
         E(18) = psi_1xc_atom()            !*** exc atom  ***
130
 
         E(30) = psp_ion_core()            !*** ion core energy ****
131
 
         E(31) = psi_1valence_core_atom()  !*** valence core energy
 
143
         E(35) = psi_1ke_atom()            !*** kinetic atom ***
 
144
         E(36) = psp_kinetic_core()        !*** kinetic core  - independent of psi ***
 
145
 
 
146
         E(37) = psi_1valence_core_atom()  !*** valence core energy ***
 
147
         E(38) = dng_1vlpaw_pw()           !*** Vlocal_paw (pw basis) ***
 
148
         E(39) = psi_1vloc_atom()          !*** Vlocal (local basis) -  nv*Vsrloc + nloc*Vloc - ncmp*Vloc ***
 
149
 
 
150
         ehartree_atom = psi_1hartree_atom()
 
151
         ecmp_cmp      = psi_1hartree_cmp_cmp()
 
152
         ecmp_pw       = dng_1hartree_cmp_pw()
 
153
         E(40) = ehartree_atom             !*** vcoulomb atom  ***
 
154
         E(41) = ecmp_cmp                  !*** ncmp-ncmp coulomb energy ***
 
155
         E(42) = ecmp_pw                   !*** ncmp-pw coulomb energy ***
 
156
 
 
157
         !call psi_1xc_atom(exc_atom,pxc_atom)
 
158
         exc_atom = 0.0d0
 
159
         pxc_atom = 0.0d0
 
160
         E(43) = exc_atom                  !*** exc atom  ***
 
161
         E(44) = pxc_atom                  !*** pxc atom  ***
 
162
 
 
163
         E(45) = psp_ion_core()            !*** ion core energy - independent of psi ***
 
164
 
 
165
         E(1) = E(1) + E(36) + E(45) 
 
166
     >        - E(40) - E(41)  + E(43) - E(44)
132
167
      end if
133
168
 
134
169
*     **** get pspw_charge  energies ****
135
170
      if (pspw_charge_found()) then
136
171
         E(19)  = psi_1v_field()
137
 
         E(20)  = pspw_charge_Energy_ion()
138
 
         E(21)  = pspw_charge_Energy_charge()
 
172
         E(20)  = pspw_charge_Energy_ion()    !*** independent of psi ***
 
173
         E(21)  = pspw_charge_Energy_charge() !*** independent of psi ***
139
174
         E(1)   = E(1) + E(20) + E(21)
140
175
      end if
141
176
 
156
191
         E(27) = phfx
157
192
      end if
158
193
 
 
194
*     **** HFX terms ****
 
195
      if (psp_U_psputerm()) then
 
196
         call electron_U_energies(ehfx,phfx)
 
197
         E(29) = ehfx
 
198
         E(30) = phfx
 
199
      end if
 
200
 
 
201
*     **** Metadynamics potential terms ****
 
202
      if (meta_found()) then
 
203
         call electron_meta_energies(ehfx,phfx)
 
204
         E(31) =  ehfx
 
205
         E(32) =  phfx
 
206
      end if
 
207
 
159
208
 
160
209
      value = MA_free_heap(G1(2))
161
210
      if (.not. value)