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

« back to all changes in this revision

Viewing changes to src/nwdft/rt_tddft/matutils/pack_buffer2ga.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     Pack real-valued input buffer into a GA.  Determines size of
 
3
C     buffer from the size of the GA (must be square matrix).
 
4
C
 
5
      subroutine pack_buffer2ga_dbl (buff, g_a)
 
6
      implicit none
 
7
 
 
8
#include "global.fh"
 
9
#include "errquit.fh"
 
10
#include "mafdecls.fh"
 
11
#include "stdio.fh"
 
12
 
 
13
C     == Inputs ==
 
14
      double precision, intent(in) :: buff(*)
 
15
 
 
16
C     == Outputs ==
 
17
      integer, intent(in) :: g_a
 
18
      
 
19
C     == Parameters ==
 
20
      character(*), parameter :: pname = "pack_buffer2ga_dbl: "
 
21
 
 
22
      
 
23
C     == Variables ==
 
24
      logical ok
 
25
      integer dtype, dim1, dim2
 
26
      integer n
 
27
      integer i, j
 
28
      integer itmp, ltmp
 
29
 
 
30
C
 
31
C     Check the output GA (input 2).
 
32
C
 
33
      call ga_check_handle (g_a,
 
34
     $     "second argument of "//pname//"not a valid GA")
 
35
      call ga_inquire (g_a, dtype, dim1, dim2)
 
36
 
 
37
      if (dim1 .ne. dim2)
 
38
     $     call errquit (pname//"dim1 must equal dim2", 0, 0)
 
39
      n = dim1
 
40
      
 
41
      if (dtype .ne. mt_dbl)
 
42
     $     call errquit (pname//"expecting real GA", 0, 0)
 
43
 
 
44
 
 
45
C
 
46
C     Allocation
 
47
C
 
48
      ok = .true.
 
49
      ok = ok.and.ma_push_get(mt_dbl, n, "tmp buffer", ltmp,itmp)
 
50
      if (.not.ok) call errquit (pname//"alloc failed", 0, MA_ERR)
 
51
 
 
52
 
 
53
C
 
54
C     Pack into GA. Note pointer vs fortran indexing.
 
55
C
 
56
      do i = 1, n
 
57
         do j = 1, n
 
58
            dbl_mb(itmp + j - 1) = buff(n*(i-1) + j)
 
59
         enddo
 
60
         call ga_put (g_a, 1, n, i, i, dbl_mb(itmp), n)
 
61
      enddo
 
62
 
 
63
 
 
64
C
 
65
C     Clean up
 
66
C
 
67
      if (.not.ma_pop_stack(ltmp))
 
68
     $     call errquit (pname//"failed to pop stack", 0, MA_ERR)
 
69
      
 
70
      end subroutine 
 
71
 
 
72
 
 
73
 
 
74
 
 
75
C====================================================================
 
76
C
 
77
C     Pack complex-valued input buffer into a GA.  Determines size of
 
78
C     buffer from the size of the GA (must be square matrix).
 
79
C
 
80
      subroutine pack_buffer2ga_dcpl (buff, g_a)
 
81
      implicit none
 
82
 
 
83
#include "global.fh"
 
84
#include "errquit.fh"
 
85
#include "mafdecls.fh"
 
86
#include "stdio.fh"
 
87
 
 
88
      
 
89
C     == Inputs ==
 
90
      double complex, intent(in) :: buff(*)
 
91
 
 
92
      
 
93
C     == Outputs ==
 
94
      integer, intent(in) :: g_a
 
95
 
 
96
      
 
97
C     == Parameters ==
 
98
      character(*), parameter :: pname = "pack_buffer2ga_dcpl: "
 
99
 
 
100
      
 
101
C     == Variables ==
 
102
      logical ok
 
103
      integer dtype, dim1, dim2
 
104
      integer n
 
105
      integer i, j
 
106
      integer itmp, ltmp
 
107
 
 
108
C
 
109
C     Check the output GA (input 2).
 
110
C
 
111
      call ga_check_handle (g_a,
 
112
     $     "second argument of "//pname//"not a valid GA")
 
113
      call ga_inquire (g_a, dtype, dim1, dim2)
 
114
 
 
115
      if (dim1 .ne. dim2)
 
116
     $     call errquit (pname//"dim1 must equal dim2", 0, 0)
 
117
      n = dim1
 
118
      
 
119
      if (dtype .ne. mt_dcpl)
 
120
     $     call errquit (pname//"expecting complex GA", 0, 0)
 
121
 
 
122
 
 
123
C
 
124
C     Allocation
 
125
C
 
126
      ok = .true.
 
127
      ok = ok.and.ma_push_get(mt_dcpl, n, "tmp buffer", ltmp,itmp)
 
128
      if (.not.ok) call errquit (pname//"alloc failed", 0, MA_ERR)
 
129
 
 
130
 
 
131
C
 
132
C     Pack into GA. Note pointer vs fortran indexing.
 
133
C
 
134
      do i = 1, n
 
135
         do j = 1, n
 
136
            dcpl_mb(itmp + j - 1) = buff(n*(i-1) + j)
 
137
         enddo
 
138
         call ga_put (g_a, 1, n, i, i, dcpl_mb(itmp), n)
 
139
      enddo
 
140
 
 
141
 
 
142
C
 
143
C     Clean up
 
144
C
 
145
      if (.not.ma_pop_stack(ltmp))
 
146
     $     call errquit (pname//"failed to pop stack", 0, MA_ERR)
 
147
      
 
148
      end subroutine 
 
149
 
 
150