The TELEMAC-MASCARET system
trunk
sources
utils
bief
dot_comp.f
Go to the documentation of this file.
1
! **********************************
2
DOUBLE PRECISION
FUNCTION
dot_comp
3
! **********************************
4
!
5
&(npoin,x,y)
6
!
7
!***********************************************************************
8
! BIEF V7P3 24/02/2016
9
!***********************************************************************
10
!
11
!brief COMPENSATED SCALAR PRODUCT OF VECTORS X AND Y OF SIZE NPOIN.
12
!
13
!history R.NHEILI (Univerte de Perpignan, DALI)
14
!+ 24/02/2016
15
!+ V7P3
16
!+
17
!
18
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
19
!| NPOIN |-->| TAILLE DE X ET Y
20
!| X |-->| FIRST DOUBLE PRECISION VECTOR
21
!| Y |-->| SECOND DOUBLE PRECISION VECTOR
22
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23
!
24
USE
declarations_special
25
IMPLICIT NONE
26
!
27
!+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
28
!
29
INTEGER
,
INTENT(IN)
:: NPOIN
30
DOUBLE PRECISION
,
INTENT(IN)
:: X(npoin),Y(npoin)
31
!
32
!+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
33
!
34
INTEGER
I
35
DOUBLE PRECISION
:: P,S,H,R,Q
36
DOUBLE PRECISION
TMP
37
!
38
!-----------------------------------------------------------------------
39
!
40
IF
(npoin .EQ. 0)
THEN
41
dot_comp
=0.d0
42
RETURN
43
ENDIF
44
!
45
dot_comp
= 0.d0
46
p=0.d0
47
s=0.d0
48
h=0.d0
49
r=0.d0
50
q=0.d0
51
!
52
CALL
twoprod
(x(1),y(1),p,s)
53
!
54
DO
i = 2 , npoin
55
!
56
h=0.d0
57
r=0.d0
58
q=0.d0
59
CALL
twoprod
(x(i),y(i),h,r)
60
tmp = p
61
CALL
twosum
(tmp,h,p,q)
62
s=s+(q+r)
63
!
64
END DO
65
dot_comp
= p+s
66
!
67
!-----------------------------------------------------------------------
68
!
69
RETURN
70
END
declarations_special
Definition:
declarations_special.F:3
twoprod
subroutine twoprod(A, B, X, Y)
Definition:
twoprod.f:7
twosum
subroutine twosum(A, B, X, Y)
Definition:
twosum.f:7
dot_comp
double precision function dot_comp(NPOIN, X, Y)
Definition:
dot_comp.f:7