The TELEMAC-MASCARET system  trunk
bief_sum.f
Go to the documentation of this file.
1 ! **********************************
2  DOUBLE PRECISION FUNCTION bief_sum
3 ! **********************************
4 !
5  &( x )
6 !
7 !***********************************************************************
8 ! BIEF V6P1 21/08/2010
9 !***********************************************************************
10 !
11 !brief SUMS UP THE COMPONENTS OF A VECTOR.
12 !+
13 !+ X CAN BE A VECTOR, OR
14 !+
15 !+ A BLOCK STRUCTURE OF VECTORS IN IDENTICAL NUMBER
16 !+ AND CHARACTERISTICS.
17 !
18 !warning IF THE VECTORS HAVE A SECOND DIMENSION,
19 !+ IT IS PRESENTLY IGNORED
20 !
21 !history J-M HERVOUET (LNHE)
22 !+ 11/05/2009
23 !+ V6P0
24 !+
25 !
26 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
27 !+ 13/07/2010
28 !+ V6P0
29 !+ Translation of French comments within the FORTRAN sources into
30 !+ English comments
31 !
32 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
33 !+ 21/08/2010
34 !+ V6P0
35 !+ Creation of DOXYGEN tags for automated documentation and
36 !+ cross-referencing of the FORTRAN sources
37 !
38 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 !| X |-->| BIEF_OBJ STRUCTURE OF WHICH X%R WILL BE SUMMED
40 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41 !
42  USE bief, ex_bief_sum => bief_sum
43 !
45  IMPLICIT NONE
46 !
47 !-----------------------------------------------------------------------
48 !
49 ! STRUCTURES: VECTORS OR BLOCKS
50 !
51  TYPE(bief_obj), INTENT(IN) :: X
52 !
53 !-----------------------------------------------------------------------
54 !
55 ! CASE OF A VECTOR
56 !
57  IF(x%TYPE.EQ.2) THEN
58 !
59  bief_sum = somme(x%R,x%DIM1*x%DIM2)
60 !
61 !-----------------------------------------------------------------------
62 !
63 ! CASE WHERE THE STRUCTURES ARE BLOCKS (TO BE CODED UP)
64 !
65 ! ELSEIF(X%TYPE.EQ.4) THEN
66 !
67 !-----------------------------------------------------------------------
68 !
69 ! ERROR
70 !
71  ELSE
72 !
73  WRITE(lu,60) x%NAME,x%TYPE
74  WRITE(lu,63)
75 60 FORMAT(1x,'BIEF_SUM (BIEF): NAME OF X : ',a6,' TYPE : ',1i6)
76 63 FORMAT(1x,' CASE NOT IMPLEMENTED')
77  CALL plante(1)
78  stop
79 !
80  ENDIF
81 !
82 !-----------------------------------------------------------------------
83 !
84  RETURN
85  END
double precision function somme(X, NPX)
Definition: somme.f:7
double precision function bief_sum(X)
Definition: bief_sum.f:7
Definition: bief.f:3