~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to src/base/prods3.f90

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
!-------------------------------------------------------------------------------
2
 
 
3
 
!     This file is part of the Code_Saturne Kernel, element of the
4
 
!     Code_Saturne CFD tool.
5
 
 
6
 
!     Copyright (C) 1998-2009 EDF S.A., France
7
 
 
8
 
!     contact: saturne-support@edf.fr
9
 
 
10
 
!     The Code_Saturne Kernel is free software; you can redistribute it
11
 
!     and/or modify it under the terms of the GNU General Public License
12
 
!     as published by the Free Software Foundation; either version 2 of
13
 
!     the License, or (at your option) any later version.
14
 
 
15
 
!     The Code_Saturne Kernel is distributed in the hope that it will be
16
 
!     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
 
!     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
!     GNU General Public License for more details.
19
 
 
20
 
!     You should have received a copy of the GNU General Public License
21
 
!     along with the Code_Saturne Kernel; if not, write to the
22
 
!     Free Software Foundation, Inc.,
23
 
!     51 Franklin St, Fifth Floor,
24
 
!     Boston, MA  02110-1301  USA
25
 
 
26
 
!-------------------------------------------------------------------------------
27
 
 
28
 
subroutine prods3 &
29
 
!================
30
 
 
31
 
 ( ncelet , ncel   , isqrt  ,                                     &
32
 
   va1    , vb1    , va2    , vb2    , va3    , vb3    ,          &
33
 
   vavb1  , vavb2  , vavb3  )
34
 
 
35
 
!===============================================================================
36
 
! FONCTION :
37
 
! ----------
38
 
 
39
 
! CALCUL SIMULTANE DE 3 PRODUITS SCALAIRES
40
 
!                   ______
41
 
! VAPVB = VA.VB OU \/ VA.VB  SI ISQRT=1
42
 
 
43
 
!-------------------------------------------------------------------------------
44
 
!ARGU                             ARGUMENTS
45
 
!__________________.____._____.________________________________________________.
46
 
! name             !type!mode ! role                                           !
47
 
!__________________!____!_____!________________________________________________!
48
 
! ncelet           ! i  ! <-- ! number of extended (real + ghost) cells        !
49
 
! ncel             ! i  ! <-- ! number of cells                                !
50
 
! isqrt            ! e  ! <-- ! indicateur = 1 pour prendre la racine          !
51
 
! va1(), vb1()     ! tr ! <-- ! premiers   vecteurs a multiplier               !
52
 
! va2(), vb2()     ! tr ! <-- ! seconds    vecteurs a multiplier               !
53
 
! va3(), vb3()     ! tr ! <-- ! troisiemes vecteurs a multiplier               !
54
 
! vavb1            ! r  ! --> ! premier   produit scalaire                     !
55
 
! vavb2            ! r  ! --> ! second    produit scalaire                     !
56
 
! vavb3            ! r  ! --> ! troisieme produit scalaire                     !
57
 
!__________________!____!_____!________________________________________________!
58
 
 
59
 
!     TYPE : E (ENTIER), R (REEL), A (ALPHANUMERIQUE), T (TABLEAU)
60
 
!            L (LOGIQUE)   .. ET TYPES COMPOSES (EX : TR TABLEAU REEL)
61
 
!     MODE : <-- donnee, --> resultat, <-> Donnee modifiee
62
 
!            --- tableau de travail
63
 
!===============================================================================
64
 
 
65
 
implicit none
66
 
 
67
 
!===============================================================================
68
 
! Common blocks
69
 
!===============================================================================
70
 
 
71
 
include "paramx.h"
72
 
include "parall.h"
73
 
 
74
 
!===============================================================================
75
 
 
76
 
! Arguments
77
 
 
78
 
integer          ncelet,ncel,isqrt
79
 
double precision vavb1, vavb2, vavb3
80
 
double precision va1(ncelet),vb1(ncelet)
81
 
double precision va2(ncelet),vb2(ncelet)
82
 
double precision va3(ncelet),vb3(ncelet)
83
 
 
84
 
! Local variables
85
 
 
86
 
integer nvavb
87
 
double precision vavb(3)
88
 
 
89
 
integer incx, incy
90
 
double precision ddot
91
 
external         ddot
92
 
 
93
 
!===============================================================================
94
 
 
95
 
incx = 1
96
 
incy = 1
97
 
vavb(1) = ddot(ncel, va1, incx, vb1, incy)
98
 
vavb(2) = ddot(ncel, va2, incx, vb2, incy)
99
 
vavb(3) = ddot(ncel, va3, incx, vb3, incy)
100
 
 
101
 
if (irangp.ge.0) then
102
 
  nvavb = 3
103
 
  call parrsm (nvavb, vavb)
104
 
  !==========
105
 
endif
106
 
 
107
 
vavb1 = vavb(1)
108
 
vavb2 = vavb(2)
109
 
vavb3 = vavb(3)
110
 
 
111
 
if (isqrt.eq.1) then
112
 
  vavb1 = sqrt(vavb1)
113
 
  vavb2 = sqrt(vavb2)
114
 
  vavb3 = sqrt(vavb3)
115
 
endif
116
 
 
117
 
!----
118
 
! FIN
119
 
!----
120
 
 
121
 
return
122
 
 
123
 
end subroutine
124