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

« back to all changes in this revision

Viewing changes to src/nwdft/rt_tddft/closedshell/rt_tddft_cs_restart.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
C
 
2
C     rt_tddft_cs_restart.F
 
3
C
 
4
C     Routines for dumping and reading in restart point info.
 
5
C
 
6
      subroutine rt_tddft_cs_restart_save (params, it, tt, g_zdens_ao)
 
7
      implicit none
 
8
 
 
9
#include "errquit.fh"
 
10
#include "mafdecls.fh"
 
11
#include "stdio.fh"
 
12
#include "global.fh"
 
13
#include "rtdb.fh"
 
14
#include "util.fh"
 
15
#include "cdft.fh"
 
16
#include "matutils.fh"
 
17
#include "rt_tddft.fh"
 
18
 
 
19
C     == Inputs ==
 
20
      type(rt_params_t), intent(in) :: params
 
21
      integer, intent(in)           :: it
 
22
      double precision, intent(in)  :: tt
 
23
      integer, intent(in)           :: g_zdens_ao
 
24
 
 
25
      
 
26
C     == Parameters ==
 
27
      character(*), parameter :: pname = "rt_tddft_cs_restart_save: "
 
28
 
 
29
 
 
30
C     == Variables ==
 
31
      integer n
 
32
      integer g_densre_ao, g_densim_ao
 
33
      character(255) fname_re, fname_im
 
34
      logical ok
 
35
      double precision checksum
 
36
      double precision elapsed
 
37
 
 
38
 
 
39
      if (params%prof) call prof_start (elapsed)
 
40
 
 
41
      if (params%ipol .ne. 1)
 
42
     $     call errquit (pname//"only valid for ipol = 1",0,0)
 
43
 
 
44
      
 
45
C
 
46
C     First, store current time in rtdb.  Note we put both it and tt
 
47
C     which is redundant, but we check that tt = tmin + (it-1)*dt when
 
48
C     we restart.
 
49
C
 
50
      if (.not.rtdb_put(params%rtdb,'rt_tddft:rest_it', mt_int, 1, it))
 
51
     $     call errquit(pname//'Write failed rest_it to rtdb',
 
52
     $     0,RTDB_ERR)
 
53
 
 
54
      if (.not.rtdb_put(params%rtdb,'rt_tddft:rest_tt', mt_dbl, 1, tt))
 
55
     $     call errquit(pname//'Write failed rest_tt to rtdb',
 
56
     $     0,RTDB_ERR)
 
57
 
 
58
 
 
59
C
 
60
C     Also store some other params (so we can check when we restart).
 
61
C
 
62
CXXX  [KAL]: ns_ao, ns_mo
 
63
      
 
64
 
 
65
C     
 
66
C     Compute and store checksum for complex dens mat.
 
67
C
 
68
      checksum = zmat_checksum (g_zdens_ao)
 
69
 
 
70
      if (.not.rtdb_put(params%rtdb,'rt_tddft:rest_checksum',
 
71
     $     mt_dbl, 1, checksum))
 
72
     $     call errquit(pname//'Write failed rest_checksum to rtdb',
 
73
     $     0,RTDB_ERR)
 
74
 
 
75
 
 
76
C
 
77
C     Dump dens mat in AO basis to file.  Note we do real and imag parts
 
78
C     separately.
 
79
C
 
80
      n = params%ns_ao   !alias for clarity
 
81
 
 
82
      ok = .true.
 
83
      ok = ok.and.ga_create(mt_dbl, n, n, "Re[P]", 0, 0, g_densre_ao)
 
84
      ok = ok.and.ga_create(mt_dbl, n, n, "Im[P]", 0, 0, g_densim_ao)
 
85
 
 
86
      if (.not.ok) call errquit(pname//"GA allocation failed", 0,GA_ERR)
 
87
 
 
88
      call convert_z2d (g_zdens_ao, g_densre_ao, g_densim_ao)
 
89
 
 
90
      call util_file_name ("densmat_ao_re", .false., .false., fname_re)
 
91
      call util_file_name ("densmat_ao_im", .false., .false., fname_im)
 
92
 
 
93
      if (.not. dmat_io_dump (g_densre_ao, fname_re))
 
94
     $     call errquit (pname//"failed to dump densao_re",0,0)
 
95
 
 
96
      if (.not. dmat_io_dump (g_densim_ao, fname_im))
 
97
     $     call errquit (pname//"failed to dump densao_im",0,0)
 
98
 
 
99
 
 
100
C
 
101
C     Clean up.
 
102
C
 
103
      ok = .true.
 
104
      ok = ok .and. ga_destroy(g_densre_ao)
 
105
      ok = ok .and. ga_destroy(g_densim_ao)
 
106
      if (.not.ok) call errquit(pname//"failed to destroy GAs", 0,0)
 
107
 
 
108
      if (params%prof) call prof_end (elapsed, "Saving restart point")
 
109
      end subroutine
 
110
 
 
111
 
 
112
C====================================================================
 
113
C
 
114
C     Load info from previous restart point.
 
115
C
 
116
      subroutine rt_tddft_cs_restart_load (params, it, tt, g_zdens_ao)
 
117
      implicit none
 
118
 
 
119
#include "errquit.fh"
 
120
#include "mafdecls.fh"
 
121
#include "stdio.fh"
 
122
#include "global.fh"
 
123
#include "rtdb.fh"
 
124
#include "util.fh"
 
125
#include "cdft.fh"
 
126
#include "matutils.fh"
 
127
#include "rt_tddft.fh"
 
128
 
 
129
C     == Inputs ==
 
130
      type(rt_params_t), intent(in) :: params
 
131
      integer, intent(in)           :: g_zdens_ao     !the GA value will be updated
 
132
 
 
133
      
 
134
C     == Parameters ==
 
135
      character(*), parameter  :: pname = "rt_tddft_cs_restart_load: "
 
136
 
 
137
      
 
138
C     == Outputs ==
 
139
      integer it
 
140
      double precision tt
 
141
 
 
142
      
 
143
C     == Variables ==
 
144
      double precision checksum, rest_checksum
 
145
      integer n
 
146
      integer g_densre_ao, g_densim_ao
 
147
      character(255) fname_re, fname_im
 
148
      logical ok
 
149
      double precision tdiff
 
150
      double precision elapsed
 
151
 
 
152
 
 
153
      call rt_tddft_cs_confirm (params)
 
154
 
 
155
      if (params%prof) call prof_start (elapsed)
 
156
 
 
157
 
 
158
C
 
159
C     Read in previous time values.
 
160
C
 
161
      if (.not.rtdb_get (params%rtdb,"rt_tddft:rest_it",mt_int, 1, it))
 
162
     $     call errquit (pname//"failed to read rest_it from rtdb",0,0)
 
163
 
 
164
      if (.not.rtdb_get (params%rtdb,"rt_tddft:rest_tt",mt_dbl, 1, tt))
 
165
     $     call errquit (pname//"failed to read rest_tt from rtdb",0,0)
 
166
 
 
167
      tdiff = tt - (params%tmin + (it-1)*params%dt)
 
168
      if ( abs(tdiff) > 1d-4 ) then
 
169
         call errquit (pname//"inconsistent rest_it, rest_tt",0,0)
 
170
      endif
 
171
      
 
172
 
 
173
      if (.not.rtdb_get (params%rtdb,"rt_tddft:rest_checksum",
 
174
     $     mt_dbl, 1, rest_checksum)) call errquit (pname//
 
175
     $     "failed to read rest_checksum from rtdb",0,0)
 
176
 
 
177
      
 
178
C
 
179
C     Read in complex dens mat in AO basis.
 
180
C
 
181
      call util_file_name ("densmat_ao_re", .false., .false., fname_re)
 
182
      call util_file_name ("densmat_ao_im", .false., .false., fname_im)
 
183
 
 
184
      n = params%ns_ao   !alias for clarity
 
185
 
 
186
      ok = .true.
 
187
      ok = ok.and.ga_create(mt_dbl, n, n, "Re[P]", 0, 0, g_densre_ao)
 
188
      ok = ok.and.ga_create(mt_dbl, n, n, "Im[P]", 0, 0, g_densim_ao)
 
189
      
 
190
      if (.not. dmat_io_read (g_densre_ao, fname_re))
 
191
     $     call errquit (pname//"failed to read densao_re",0,0)
 
192
 
 
193
      if (.not. dmat_io_read (g_densim_ao, fname_im))
 
194
     $     call errquit (pname//"failed to read densao_im",0,0)
 
195
 
 
196
 
 
197
C
 
198
C     Load real and im parts into complex GA and check that checksum is
 
199
C     consistent.
 
200
C
 
201
      call convert_d2z (1d0, g_densre_ao, 1d0, g_densim_ao, g_zdens_ao)
 
202
      
 
203
      checksum = zmat_checksum (g_zdens_ao)
 
204
 
 
205
      if ( abs(checksum - rest_checksum) > params%tol_zero) !warning: hardcoded tol_zero
 
206
     $     call errquit (pname//
 
207
     $     "bad checksum while importing dens mat",0,0)
 
208
 
 
209
      ok = .true.
 
210
      ok = ok .and. ga_destroy(g_densre_ao)
 
211
      ok = ok .and. ga_destroy(g_densim_ao)
 
212
      if (.not.ok) call errquit(pname//"failed to destroy GAs", 0,0)
 
213
 
 
214
 
 
215
      if (params%prof) call prof_end (elapsed, "Loading restart point")
 
216
      end subroutine