~ubuntu-branches/ubuntu/trusty/nwchem/trusty-proposed

« back to all changes in this revision

Viewing changes to src/nwdft/rt_tddft/closedshell/rt_tddft_cs_tdfock.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> @file rt_tddft_cs_tdfock.F
 
2
C> @ingroup rt_tddft
 
3
 
 
4
C--------------------------------------------------------------------
 
5
C> Builds time-dependent closed-shell Fock matrix.
 
6
C>
 
7
C> Constructs the time-dependent Fock matrix including
 
8
C> building Fock matrix from density matrix in AO basis,
 
9
C> and calculating and adding dipole interation with external uniform E-field.
 
10
C--------------------------------------------------------------------
 
11
      logical function rt_tddft_cs_tdfock (params, tt, g_zdens_ao,
 
12
     $     energies, g_zfock_ao)
 
13
 
 
14
      implicit none
 
15
 
 
16
#include "errquit.fh"
 
17
#include "mafdecls.fh"
 
18
#include "stdio.fh"
 
19
#include "global.fh"
 
20
#include "msgids.fh"
 
21
#include "util.fh"
 
22
#include "matutils.fh"
 
23
#include "rt_tddft.fh"
 
24
 
 
25
 
 
26
C     == Inputs ==
 
27
      type(rt_params_t), intent(in) :: params         !< struct containing parameters
 
28
      double precision, intent(in)  :: tt             !< current time
 
29
      integer, intent(in)           :: g_zdens_ao     !< complex dens mat, ns_ao x ns_ao
 
30
 
 
31
      
 
32
C     == Outputs ==
 
33
      type(rt_energies_t), intent(out) :: energies    !< time-dependent energies 
 
34
      integer, intent(in)              :: g_zfock_ao  !< complex fock mat, ns_ao x ns_ao
 
35
 
 
36
 
 
37
C     == Parameters ==
 
38
      character(*), parameter :: pname = "rt_tddft_cs_tdfock: "
 
39
 
 
40
 
 
41
C     == Variables ==
 
42
      type(rt_vector_t) field
 
43
      type(rt_quad_t) field_grad
 
44
      integer g_zscr(2)    !scratch, ns_ao x ns_ao; alpha beta
 
45
      integer g_zscr_mo    ! ns_mo x ns_mo dcpl
 
46
      integer n
 
47
      integer me
 
48
      double complex zval1, zval2, zscale
 
49
 
 
50
      integer lvals, ivals, g_zevecs, i, g_ztmp_mo
 
51
      integer lvre, ivre, lvim, ivim
 
52
      double complex zval
 
53
 
 
54
      call rt_tddft_cs_confirm (params)
 
55
     
 
56
      me = ga_nodeid()
 
57
      
 
58
      n = params%ns_ao            ! alias
 
59
 
 
60
 
 
61
      if (.not.ga_create(mt_dcpl,n ,n ,"zscr1", 0, 0, g_zscr(1)))
 
62
     $     call errquit ("failed to create zscr1", 0, GA_ERR)
 
63
      if (.not.ga_create(mt_dcpl,n ,n ,"zscr2", 0, 0, g_zscr(2)))
 
64
     $     call errquit ("failed to create zscr2", 0, GA_ERR)
 
65
 
 
66
      
 
67
C        
 
68
C     Build new complex fock mat from complex dens mat; this also
 
69
C     calculates energies.  Note, the input g_zdens_ao is in AO basis,
 
70
C     and the output g_zfock_ao is also in AO basis.
 
71
C
 
72
      call zfock_cs_build (params, g_zdens_ao, energies, g_zfock_ao)
 
73
      call ga_sync ()           !XXX needed?
 
74
 
 
75
      
 
76
C
 
77
C     Compute dipole interaction (updates field values inside), and add
 
78
C     to Fock matrix.  Since this is closedshell, we have already
 
79
C     checked that all fields only act on the full spin.  Thus we just
 
80
C     add the alpha part to the fock matrix.
 
81
C
 
82
      call ga_zero (g_zscr(1))
 
83
      call ga_zero (g_zscr(2))
 
84
      call rt_tddft_calc_excite (params, tt, g_zscr)
 
85
      call ga_add (z1, g_zfock_ao, zn1, g_zscr(1), g_zfock_ao)
 
86
 
 
87
C
 
88
C     Clean up
 
89
C
 
90
      if (.not.ga_destroy(g_zscr(1)))
 
91
     $     call errquit ("failed to destroy zscr1", 0, GA_ERR)
 
92
      if (.not.ga_destroy(g_zscr(2)))
 
93
     $     call errquit ("failed to destroy zscr2", 0, GA_ERR)
 
94
 
 
95
      
 
96
CXXX  [KAL]: have an option to return false?
 
97
      rt_tddft_cs_tdfock= .true.
 
98
 
 
99
      end function