The TELEMAC-MASCARET system  trunk
lissage.f
Go to the documentation of this file.
1 ! ******************
2  SUBROUTINE lissage
3 ! ******************
4 !
5  &(dim,entree,sortie)
6 !
7 !***********************************************************************
8 ! ARTEMIS V7P0 July 2014
9 !***********************************************************************
10 !
11 !brief SMOOTHES A FUNCTION USING LEAST SQUARE METHOD
12 ! BASED ON A PARABOLA FIT TO 5 EQUALLY SPACED POINTS.
13 !
14 !history S.BOURBAN (HRW)
15 !+ 1997
16 !+
17 !+
18 !
19 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 !| DIM | | DIMENSION OF THE FUNCTION
21 !| ENTREE | | INPUT VALUES
22 !| SORTIE | | OUTPUT VALUES
23 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 !
26  IMPLICIT NONE
27 !
28 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
29 !
30  INTEGER DIM,I
31  DOUBLE PRECISION ENTREE(dim),SORTIE(dim)
32 !
33  INTRINSIC dabs
34 !
35 !-----------------------------------------------------------------------
36 ! INITIALISES ENTREE
37  DO i = 1, dim
38  entree(i) = dabs(entree(i))
39  ENDDO
40  WRITE(lu,*)
41 !
42 !-----------------------------------------------------------------------
43 !
44  DO i = 1, dim
45 !
46 !-----------------------------------------------------------------------
47  IF(i.EQ.1) THEN
48  sortie(i)=31.d0*entree(i)+9.d0*entree(i+1)
49  &-3.d0*entree(i+2)-5.d0*entree(i+3)+3.d0*entree(i+4)
50  sortie(i)=sortie(i)/35.d0
51 !
52 !-----------------------------------------------------------------------
53  ELSEIF(i.EQ.2) THEN
54  sortie(i)=9.d0*entree(i)+13.d0*entree(i+1)
55  &+12.d0*entree(i+2)+6.d0*entree(i+3)-5.d0*entree(i+4)
56  sortie(i)=sortie(i)/35.d0
57 !
58 !-----------------------------------------------------------------------
59  ELSEIF(i.EQ.dim-1) THEN
60  sortie(i)=-5.d0*entree(dim-4)+6.d0*entree(dim-3)
61  &+12.d0*entree(dim-2)+13.d0*entree(dim-1)+9.d0*entree(dim)
62  sortie(i)=sortie(i)/35.d0
63 !
64 !-----------------------------------------------------------------------
65  ELSEIF(i.EQ.dim) THEN
66  sortie(i)=3.d0*entree(dim-4)-5.d0*entree(dim-3)
67  &-3.d0*entree(dim-2)+9.d0*entree(dim-1)+31.d0*entree(dim)
68  sortie(i)=sortie(i)/35.d0
69 !
70 !-----------------------------------------------------------------------
71  ELSE
72  sortie(i)=-3.d0*entree(i-2)+12.d0*entree(i-1)
73  &+17.d0*entree(i)+12.d0*entree(i+1)-3.d0*entree(i+2)
74  sortie(i)=sortie(i)/35.d0
75  ENDIF
76  ENDDO
77 !
78 !-----------------------------------------------------------------------
79  RETURN
80  END
subroutine sortie(CHAINE, MNEMO, NBRE, SORLEO)
Definition: sortie.f:7
subroutine lissage(DIM, ENTREE, SORTIE)
Definition: lissage.f:7