NLSL
zdotu.f90
Go to the documentation of this file.
1 c Version 1.4 10/10/94
2 c*********************************************************************
3 c
4 c This complex double precision function returns the dot
5 c product of the two input vectors without complex
6 c conjugation.
7 c
8 c Calling Parameters:
9 c ------------------
10 c
11 c vectors:
12 c x : input vector
13 c y : input vector
14 c
15 c scalars:
16 c ndim : dimension of the vectors x and y
17 c
18 c
19 c Local Variables:
20 c ---------------
21 c ir : row counter
22 c accr : real part of dot product
23 c acci : imaginary part of dot product
24 c
25 c Notes:
26 c -----
27 c It is assumed that the input vectors are stored in a
28 c double precision complex array or as a real double
29 c precision array dimensioned as 2 X mxdim in the
30 c calling routine.
31 c
32 c
33 c Includes:
34 c nlsdim.inc
35 c rndoff.inc
36 c
37 c Uses:
38 c
39 c written by DJS 26-AUG-87
40 c
41 c*********************************************************************
42 c
43  function zdotu(x,y,ndim)
44 c
45  use nlsdim
46  use rnddbl
47 c
48  implicit none
49 c
50  double complex zdotu
51 c
52  integer ndim
53  double precision x,y
54  dimension x(2,mxdim),y(2,mxdim)
55 c
56  integer ir
57  double precision accx,accy,accr,acci,scale
58 c
59  double precision ZERO
60  parameter(zero=0.0d0)
61 c
62 c######################################################################
63 c
64  accx=zero
65  accy=zero
66  accr=zero
67  acci=zero
68 c
69  do ir=1,ndim
70  accx=accx+x(1,ir)*x(1,ir)+x(2,ir)*x(2,ir)
71  accy=accy+y(1,ir)*y(1,ir)+y(2,ir)*y(2,ir)
72  accr=accr+x(1,ir)*y(1,ir)-x(2,ir)*y(2,ir)
73  acci=acci+x(1,ir)*y(2,ir)+x(2,ir)*y(1,ir)
74  end do
75 c
76  scale=sqrt(accx*accy)
77 c
78  if (dabs(accr)/scale.lt.rndoff) accr=zero
79  if (dabs(acci)/scale.lt.rndoff) acci=zero
80 c
81  zdotu=dcmplx(accr,acci)
82 c
83  return
84  end
integer, parameter mxdim
Definition: nlsdim.f90:39
double precision, parameter rndoff
Definition: rnddbl.f90:86
double complex function zdotu(x, y, ndim)
Definition: zdotu.f90:44