The TELEMAC-MASCARET system  trunk
dismoy.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE dismoy
3 ! *****************
4 !
5  &(npoin,nelem,x,y,ikle,k,lishho)
6 !
7 !***********************************************************************
8 ! ARTEMIS V7P3 Aug 2017
9 !***********************************************************************
10 !
11 !brief CALCULATES THE NUMBER OF SMOOTHINGS ON THE WAVE
12 !+ HEIGHT (LISHHO), A PRIORI NECESSARY TO FILTER OUT
13 !+ THE PARASITIC OSCILLATIONS (REGULAR WAVES).
14 !+ ESTIMATED FROM THE AVERAGE DISTANCE BETWEEN
15 !+ NODES AND THE AVERAGE NUMBER OF NODES IN HALF A
16 !+ WAVELENGTH.
17 !
18 !history J-M HERVOUET (LNH)
19 !+
20 !+
21 !+ LINKED TO BIEF 5.0
22 !
23 !history D. AELBRECHT (LNH) ; P. THELLIER (LNH)
24 !+ 04/06/1999
25 !+ V5P1
26 !+ THANK YOU PAUL
27 !
28 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
29 !+ 13/07/2010
30 !+ V6P0
31 !+ Translation of French comments within the FORTRAN sources into
32 !+ English comments
33 !
34 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
35 !+ 21/08/2010
36 !+ V6P0
37 !+ Creation of DOXYGEN tags for automated documentation and
38 !+ cross-referencing of the FORTRAN sources
39 !
40 !history N.DURAND (HRW)
41 !+ August 2017
42 !+ V7P3
43 !+ PI now defined in DECLARATIONS_ARTEMIS
44 !
45 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46 !| IKLE |---| CONNECTIVITY TABLE
47 !| K |-->| WAVE NUMBER
48 !| LISHHO |<--| NUMBER OF SMOOTHING FOR HHO
49 !| NELEM |-->| NUMBER OF ELEMENTS
50 !| NPOIN |-->| NUMBER OF POINT
51 !| X,Y |-->| MESH COORDINATES
52 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
53 !
54  USE interface_artemis, ex_dismoy => dismoy
55 !
57  USE declarations_artemis, ONLY : pi
58  IMPLICIT NONE
59 !
60 !
61 ! VARIABLES FOR THE COMPUTATION OF AVERAGE DISTANCES
62 !
63  INTEGER NG, ISOM, IELEM
64  DOUBLE PRECISION SOM, D1, D2, DMOY, SOMD
65 !
66 !
67  INTEGER NPOIN,NELEM,LISHHO
68  INTEGER IKLE(nelem,*)
69 !
70  DOUBLE PRECISION X(npoin),Y(npoin),K(npoin)
71 !
72 !-----------------------------------------------------------------------
73 !
74 ! COMPUTES THE AVERAGE DISTANCE BETWEEN A NODE AND ITS NEIGHBOURS
75 ! -----------------------------------------------------------
76 !
77  somd = 0.d0
78  DO ng=1,npoin
79  isom = 0
80  som = 0.d0
81 !
82  DO ielem=1,nelem
83 !
84  IF (ikle(ielem,1).EQ.ng) THEN
85 ! -- ---
86 !
87 ! PT 1 IS COMMON, COMPUTES THE DISTANCE TO PTS 2 AND 3
88  d1 = sqrt( (x(ng)-x(ikle(ielem,2))) **2.d0 +
89  & (y(ng)-y(ikle(ielem,2))) **2.d0 )
90  d2 = sqrt( (x(ng)-x(ikle(ielem,3))) **2.d0 +
91  & (y(ng)-y(ikle(ielem,3))) **2.d0 )
92  som = som + d1 + d2
93  isom = isom + 2
94 !
95  ELSEIF (ikle(ielem,2).EQ.ng) THEN
96 ! ------ ----
97 !
98 ! PT 2 IS COMMON, COMPUTES THE DISTANCE TO PTS 1 AND 3
99  d1 = sqrt( (x(ng)-x(ikle(ielem,1))) **2.d0 +
100  & (y(ng)-y(ikle(ielem,1))) **2.d0 )
101  d2 = sqrt( (x(ng)-x(ikle(ielem,3))) **2.d0 +
102  & (y(ng)-y(ikle(ielem,3))) **2.d0 )
103  som = som + d1 + d2
104  isom = isom + 2
105 !
106  ELSEIF (ikle(ielem,3).EQ.ng) THEN
107 ! ------ ----
108 !
109 ! PT 3 IS COMMON, COMPUTES THE DISTANCE TO PTS 1 AND 2
110  d1 = sqrt( (x(ng)-x(ikle(ielem,1))) **2.d0 +
111  & (y(ng)-y(ikle(ielem,1))) **2.d0 )
112  d2 = sqrt( (x(ng)-x(ikle(ielem,2))) **2.d0 +
113  & (y(ng)-y(ikle(ielem,2))) **2.d0 )
114  som = som + d1 + d2
115  isom = isom + 2
116 !
117  ENDIF
118 ! -----
119 !
120  ENDDO ! IELEM
121 !
122  dmoy = som / float(isom)
123  somd = somd + (pi / (k(ng)*dmoy))
124 !
125  ENDDO ! NG
126 !
127 ! ESTIMATES THE NUMBER OF SMOOTHINGS FROM THE AVERAGE DISTANCE
128 ! -------------------------------------------------------------------
129 !
130  lishho = int((somd/float(npoin))) * 10
131 !
132  RETURN
133  END
subroutine dismoy(NPOIN, NELEM, X, Y, IKLE, K, LISHHO)
Definition: dismoy.f:7