1 | !> \file detect-assym.f90 |
---|
2 | !! Detection de symetrie par rapport a un axe donnee |
---|
3 | !< |
---|
4 | |
---|
5 | !> SUBROUTINE: detect_assym |
---|
6 | !! \author ... |
---|
7 | !! \date ... |
---|
8 | !! @note Routine pour la detection de symetrie |
---|
9 | !! @param n1 |
---|
10 | !! @param n2 |
---|
11 | !! @param iaxe |
---|
12 | !! @param jaxe |
---|
13 | !! @param isens |
---|
14 | !! @param istag |
---|
15 | !! @param jsens |
---|
16 | !! @param jstag |
---|
17 | !! @param Tabsym |
---|
18 | !! @param itestsym |
---|
19 | !< |
---|
20 | |
---|
21 | subroutine detect_assym(n1,n2,iaxe,jaxe,isens,istag,jsens,jstag,Tabsym,itestsym) |
---|
22 | |
---|
23 | ! si symetrie par rapport a axe j=jaxe |
---|
24 | !--------------------------------------- |
---|
25 | ! pour variables type S,H,B,ddx (nx,ny,iaxe,jaxe,1,0,1,0 ...) |
---|
26 | ! pour variables type sdx, ux (nx,ny,iaxe,jaxe,1,0,1,0 ...) |
---|
27 | ! pour variables type sdy,uy (nx,ny,iaxe,jaxe,1,0,-1,1...) |
---|
28 | ! pour variables type ddy (nx,ny,iaxe,jaxe,1,0,1,1...) |
---|
29 | |
---|
30 | implicit none |
---|
31 | integer :: iaxe |
---|
32 | integer :: jaxe |
---|
33 | integer :: jsym |
---|
34 | integer :: isym |
---|
35 | integer :: n1 |
---|
36 | integer :: n2 |
---|
37 | integer :: itestsym |
---|
38 | integer :: i,j |
---|
39 | integer :: isens ! -1 negatif quand la variable change de direction +1 sinon |
---|
40 | integer :: istag ! 0 quand noeud majeur, 1 quand noeuds mineurs |
---|
41 | integer :: jsens |
---|
42 | integer :: jstag |
---|
43 | |
---|
44 | real,dimension(n1,n2) :: Tabsym |
---|
45 | real :: testsym |
---|
46 | real :: maxsym |
---|
47 | |
---|
48 | itestsym=0 |
---|
49 | |
---|
50 | maxsym=maxval(abs(Tabsym)) |
---|
51 | if (maxsym.ne.0.) then |
---|
52 | !symetrique par rapport à jaxe la référence est le bas. Pour l'instant seulement lui |
---|
53 | jsym=0 |
---|
54 | itestsym=0 |
---|
55 | do j=jaxe+1,n2 |
---|
56 | jsym=jsym+1 |
---|
57 | |
---|
58 | do i=1,n1 |
---|
59 | testsym=abs(tabsym(i,j)-jsens*tabsym(i,jaxe-jsym+jstag)) |
---|
60 | testsym=testsym/maxsym |
---|
61 | if (testsym.gt.1.e-8) then |
---|
62 | write(6,333),i,j,jaxe-jsym+jstag,testsym,tabsym(i,j)-jsens*tabsym(i,jaxe-jsym+jstag),tabsym(i,j),tabsym(i,jaxe-jsym+jstag) |
---|
63 | itestsym=itestsym+1 |
---|
64 | end if |
---|
65 | |
---|
66 | end do |
---|
67 | end do |
---|
68 | end if |
---|
69 | 333 format("asymetrie i,j",3(i4),4(es16.8,1x)) |
---|
70 | end subroutine detect_assym |
---|
71 | |
---|
72 | ! exemples d'utilisation noeud majeur |
---|
73 | !----------------------------------------------------------------------- |
---|
74 | !!$call detect_assym(nx,ny,0,41,1,0,1,0,H,itest_step) |
---|
75 | !!$ |
---|
76 | !!$if (itest_step.gt.0) then |
---|
77 | !!$ write(6,*) 'apres flottab asymetrie sur H pour time=',time |
---|
78 | !!$ stop |
---|
79 | !!$else |
---|
80 | !!$ write(6,*) 'apres flottab pas d asymetrie sur H pour time=',time |
---|
81 | !!$ |
---|
82 | !!$end if |
---|
83 | !----------------------------------------------------------------------- |
---|
84 | |
---|