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

« back to all changes in this revision

Viewing changes to src/tools/ga-5-1/global/src/complex.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
 
#if HAVE_CONFIG_H
2
 
#   include "config.fh"
3
 
#endif
4
 
c All Fortran functions returning a complex or double complex type must
5
 
c be defined here with a corresponding C subroutine e.g. (Fortran) complex
6
 
c function ga_cdot --> (C) void gai_cdot(..., SingleComplex *ret).
7
 
8
 
c from http://www.math.utah.edu/software/c-with-fortran.html
9
 
10
 
c <BEGIN EXCERPT>
11
 
c Function return types
12
 
c ...
13
 
c Unfortunately, returning composite objects that occupy more than a
14
 
c single register, or an adjacent register pair, is fraught with peril.
15
 
c Older C and C++ compilers did not support this at all, and newer ones
16
 
c may do it differently than Fortran compilers do: thus, you should not
17
 
c expect to use Fortran functions that return types such as COMPLEX or
18
 
c COMPLEX*16. Write a SUBROUTINE interface to your Fortran function
19
 
c instead, and then invoke it as a void function from C or C++. 
20
 
c <END EXCERPT>
21
 
22
 
c We attempted to use various calling conventions, argument order,
23
 
c hidden first arguments as the return, etc to eliminate the need
24
 
c for any Fortran source such as this, but portability was an issue.
25
 
c Intel compilers did not behave similarly to GCC or Pathscale.  At a
26
 
c later date perhaps we will revisit this.
27
 
c
28
 
c For the time being, any function returning a complex type must be
29
 
c defined here following the established convention herein.
30
 
 
31
 
      complex function ga_cdot(g_a,g_b)
32
 
      implicit none
33
 
      integer g_a, g_b
34
 
      external gai_cdot
35
 
      ga_cdot = (0.,0.)
36
 
      call gai_cdot(g_a,g_b,ga_cdot)
37
 
      end
38
 
 
39
 
      complex function nga_cdot(g_a,g_b)
40
 
      implicit none
41
 
      integer g_a, g_b
42
 
      external gai_cdot
43
 
      nga_cdot = (0.,0.)
44
 
      call ngai_cdot(g_a,g_b,nga_cdot)
45
 
      end
46
 
 
47
 
      double complex function ga_zdot(g_a,g_b)
48
 
      implicit none
49
 
      integer g_a, g_b
50
 
      external gai_zdot
51
 
      ga_zdot = (0.,0.)
52
 
      call gai_zdot(g_a,g_b,ga_zdot)
53
 
      end
54
 
 
55
 
      double complex function nga_zdot(g_a,g_b)
56
 
      implicit none
57
 
      integer g_a, g_b
58
 
      external gai_zdot
59
 
      nga_zdot = (0.,0.)
60
 
      call ngai_zdot(g_a,g_b,nga_zdot)
61
 
      end
62
 
 
63
 
      complex function ga_cdot_patch(
64
 
     $            g_a, t_a, ailo, aihi, ajlo, ajhi,
65
 
     $            g_b, t_b, bilo, bihi, bjlo, bjhi)
66
 
      implicit none
67
 
      integer g_a, ailo, aihi, ajlo, ajhi
68
 
      integer g_b, bilo, bihi, bjlo, bjhi
69
 
      character*1 t_a, t_b
70
 
      external gai_cdot_patch
71
 
      ga_cdot_patch = (0.,0.)
72
 
      call gai_cdot_patch(
73
 
     $            g_a, t_a, ailo, aihi, ajlo, ajhi,
74
 
     $            g_b, t_b, bilo, bihi, bjlo, bjhi, ga_cdot_patch)
75
 
      end
76
 
 
77
 
      complex function nga_cdot_patch(
78
 
     $            g_a, t_a, alo, ahi,
79
 
     $            g_b, t_b, blo, bhi)
80
 
      implicit none
81
 
      integer g_a, alo, ahi 
82
 
      integer g_b, blo, bhi
83
 
      character*1 t_a, t_b
84
 
      external ngai_cdot_patch
85
 
      nga_cdot_patch = (0.,0.)
86
 
      call ngai_cdot_patch(
87
 
     $            g_a, t_a, alo, ahi, 
88
 
     $            g_b, t_b, blo, bhi, nga_cdot_patch)
89
 
      end
90
 
 
91
 
      double complex function ga_zdot_patch(
92
 
     $            g_a, t_a, ailo, aihi, ajlo, ajhi,
93
 
     $            g_b, t_b, bilo, bihi, bjlo, bjhi)
94
 
      implicit none
95
 
      integer g_a, ailo, aihi, ajlo, ajhi
96
 
      integer g_b, bilo, bihi, bjlo, bjhi
97
 
      character*1 t_a, t_b
98
 
      external gai_zdot_patch
99
 
      ga_zdot_patch = (0.,0.)
100
 
      call gai_zdot_patch(
101
 
     $            g_a, t_a, ailo, aihi, ajlo, ajhi,
102
 
     $            g_b, t_b, bilo, bihi, bjlo, bjhi, ga_zdot_patch)
103
 
      end
104
 
 
105
 
      double complex function nga_zdot_patch(
106
 
     $            g_a, t_a, alo, ahi,
107
 
     $            g_b, t_b, blo, bhi)
108
 
      implicit none
109
 
      integer g_a, alo, ahi
110
 
      integer g_b, blo, bhi
111
 
      character*1 t_a, t_b
112
 
      external ngai_zdot_patch
113
 
      nga_zdot_patch = (0.,0.)
114
 
      call ngai_zdot_patch(
115
 
     $            g_a, t_a, alo, ahi,
116
 
     $            g_b, t_b, blo, bhi, nga_zdot_patch)
117
 
      end