Directory: | ./ |
---|---|
File: | dyn/groupeun.f |
Date: | 2022-01-11 19:19:34 |
Exec | Total | Coverage | |
---|---|---|---|
Lines: | 58 | 58 | 100.0% |
Branches: | 76 | 98 | 77.6% |
Line | Branch | Exec | Source |
---|---|---|---|
1 | ! | ||
2 | ! $Header$ | ||
3 | ! | ||
4 | 960 | SUBROUTINE groupeun(jjmax,llmax,q) | |
5 | |||
6 | USE comconst_mod, ONLY: ngroup | ||
7 | |||
8 | IMPLICIT NONE | ||
9 | |||
10 | include "dimensions.h" | ||
11 | include "paramet.h" | ||
12 | include "comgeom2.h" | ||
13 | |||
14 | INTEGER jjmax,llmax | ||
15 | REAL q(iip1,jjmax,llmax) | ||
16 | |||
17 | ! INTEGER ngroup | ||
18 | ! PARAMETER (ngroup=3) | ||
19 | |||
20 | REAL airecn,qn | ||
21 | REAL airecs,qs | ||
22 | |||
23 | INTEGER i,j,l,ig,ig2,j1,j2,i0,jd | ||
24 | |||
25 | c--------------------------------------------------------------------c | ||
26 | c Strategie d'optimisation c | ||
27 | c stocker les valeurs systematiquement recalculees c | ||
28 | c et identiques d'un pas de temps sur l'autre. Il s'agit des c | ||
29 | c aires des cellules qui sont sommees. S'il n'y a pas de changement c | ||
30 | c de grille au cours de la simulation tout devrait bien se passer. c | ||
31 | c Autre optimisation : determination des bornes entre lesquelles "j" c | ||
32 | c varie, au lieu de faire un test à chaque fois... | ||
33 | c--------------------------------------------------------------------c | ||
34 | |||
35 | INTEGER j_start, j_finish | ||
36 | |||
37 | REAL, SAVE :: airen_tab(iip1,jjp1,0:1) | ||
38 | REAL, SAVE :: aires_tab(iip1,jjp1,0:1) | ||
39 | |||
40 | LOGICAL, SAVE :: first = .TRUE. | ||
41 | ! INTEGER,SAVE :: i_index(iim,ngroup) | ||
42 | INTEGER :: offset | ||
43 | ! REAL :: qsum(iim/ngroup) | ||
44 | |||
45 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 959 times.
|
960 | IF (first) THEN |
46 | 1 | CALL INIT_GROUPEUN(airen_tab, aires_tab) | |
47 | 1 | first = .FALSE. | |
48 | ENDIF | ||
49 | |||
50 | |||
51 | c Champs 3D | ||
52 | 960 | jd=jjp1-jjmax | |
53 | c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) | ||
54 |
2/2✓ Branch 0 taken 37440 times.
✓ Branch 1 taken 960 times.
|
38400 | DO l=1,llm |
55 | 37440 | j1=1+jd | |
56 | j2=2 | ||
57 |
2/2✓ Branch 0 taken 112320 times.
✓ Branch 1 taken 37440 times.
|
150720 | DO ig=1,ngroup |
58 | |||
59 | c Concerne le pole nord | ||
60 | 112320 | j_start = j1-jd | |
61 | 112320 | j_finish = j2-jd | |
62 |
2/2✓ Branch 0 taken 112320 times.
✓ Branch 1 taken 224640 times.
|
336960 | DO ig2=1,ngroup-ig+1 |
63 |
1/2✓ Branch 0 taken 224640 times.
✗ Branch 1 not taken.
|
224640 | offset=2**(ig2-1) |
64 |
2/2✓ Branch 0 taken 468000 times.
✓ Branch 1 taken 224640 times.
|
804960 | DO j=j_start, j_finish |
65 | !CDIR NODEP | ||
66 | !CDIR ON_ADB(q) | ||
67 |
2/4✓ Branch 0 taken 468000 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 468000 times.
✗ Branch 3 not taken.
|
692640 | DO i0=1,iim,2**ig2 |
68 |
2/2✓ Branch 0 taken 5297760 times.
✓ Branch 1 taken 468000 times.
|
5765760 | q(i0,j,l)=q(i0,j,l)+q(i0+offset,j,l) |
69 | ENDDO | ||
70 | ENDDO | ||
71 | ENDDO | ||
72 | |||
73 |
2/2✓ Branch 0 taken 280800 times.
✓ Branch 1 taken 112320 times.
|
393120 | DO j=j_start, j_finish |
74 | !CDIR NODEP | ||
75 | !CDIR ON_ADB(q) | ||
76 |
2/2✓ Branch 0 taken 8985600 times.
✓ Branch 1 taken 280800 times.
|
9378720 | DO i=1,iim |
77 |
2/4✓ Branch 0 taken 8985600 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 8985600 times.
✗ Branch 3 not taken.
|
9266400 | q(i,j,l)=q(i-MOD(i-1,2**(ngroup-ig+1)),j,l) |
78 | ENDDO | ||
79 | ENDDO | ||
80 | |||
81 |
2/2✓ Branch 0 taken 280800 times.
✓ Branch 1 taken 112320 times.
|
393120 | DO j=j_start, j_finish |
82 | !CDIR ON_ADB(airen_tab) | ||
83 | !CDIR ON_ADB(q) | ||
84 |
2/2✓ Branch 0 taken 8985600 times.
✓ Branch 1 taken 280800 times.
|
9266400 | DO i=1,iim |
85 | 9266400 | q(i,j,l)=q(i,j,l)*airen_tab(i,j,jd) | |
86 | ENDDO | ||
87 | 393120 | q(iip1,j,l)=q(1,j,l) | |
88 | ENDDO | ||
89 | |||
90 | !c Concerne le pole sud | ||
91 | j_start = j1-jd | ||
92 | j_finish = j2-jd | ||
93 |
2/2✓ Branch 0 taken 112320 times.
✓ Branch 1 taken 224640 times.
|
336960 | DO ig2=1,ngroup-ig+1 |
94 |
1/2✓ Branch 0 taken 224640 times.
✗ Branch 1 not taken.
|
224640 | offset=2**(ig2-1) |
95 |
2/2✓ Branch 0 taken 468000 times.
✓ Branch 1 taken 224640 times.
|
804960 | DO j=j_start, j_finish |
96 | !CDIR NODEP | ||
97 | !CDIR ON_ADB(q) | ||
98 |
2/4✓ Branch 0 taken 468000 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 468000 times.
✗ Branch 3 not taken.
|
692640 | DO i0=1,iim,2**ig2 |
99 | q(i0,jjp1-j+1-jd,l)= q(i0,jjp1-j+1-jd,l) | ||
100 |
2/2✓ Branch 0 taken 5297760 times.
✓ Branch 1 taken 468000 times.
|
5765760 | & +q(i0+offset,jjp1-j+1-jd,l) |
101 | ENDDO | ||
102 | ENDDO | ||
103 | ENDDO | ||
104 | |||
105 | |||
106 |
2/2✓ Branch 0 taken 280800 times.
✓ Branch 1 taken 112320 times.
|
393120 | DO j=j_start, j_finish |
107 | !CDIR NODEP | ||
108 | !CDIR ON_ADB(q) | ||
109 |
2/2✓ Branch 0 taken 8985600 times.
✓ Branch 1 taken 280800 times.
|
9378720 | DO i=1,iim |
110 | q(i,jjp1-j+1-jd,l)=q(i-MOD(i-1,2**(ngroup-ig+1)), | ||
111 |
2/4✓ Branch 0 taken 8985600 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 8985600 times.
✗ Branch 3 not taken.
|
9266400 | & jjp1-j+1-jd,l) |
112 | ENDDO | ||
113 | ENDDO | ||
114 | |||
115 |
2/2✓ Branch 0 taken 280800 times.
✓ Branch 1 taken 112320 times.
|
393120 | DO j=j_start, j_finish |
116 | !CDIR ON_ADB(aires_tab) | ||
117 | !CDIR ON_ADB(q) | ||
118 |
2/2✓ Branch 0 taken 8985600 times.
✓ Branch 1 taken 280800 times.
|
9266400 | DO i=1,iim |
119 | q(i,jjp1-j+1-jd,l)=q(i,jjp1-j+1-jd,l)* | ||
120 | 9266400 | & aires_tab(i,jjp1-j+1,jd) | |
121 | ENDDO | ||
122 | 393120 | q(iip1,jjp1-j+1-jd,l)=q(1,jjp1-j+1-jd,l) | |
123 | ENDDO | ||
124 | |||
125 | |||
126 | 112320 | j1=j2+1 | |
127 |
1/2✓ Branch 0 taken 112320 times.
✗ Branch 1 not taken.
|
149760 | j2=j2+2**ig |
128 | ENDDO | ||
129 | ENDDO | ||
130 | !$OMP END DO NOWAIT | ||
131 | |||
132 | 960 | RETURN | |
133 | END | ||
134 | |||
135 | |||
136 | |||
137 | |||
138 | 1 | SUBROUTINE INIT_GROUPEUN(airen_tab, aires_tab) | |
139 | |||
140 | USE comconst_mod, ONLY: ngroup | ||
141 | |||
142 | IMPLICIT NONE | ||
143 | |||
144 | include "dimensions.h" | ||
145 | include "paramet.h" | ||
146 | include "comgeom2.h" | ||
147 | |||
148 | ! INTEGER ngroup | ||
149 | ! PARAMETER (ngroup=3) | ||
150 | |||
151 | REAL airen,airecn | ||
152 | REAL aires,airecs | ||
153 | |||
154 | INTEGER i,j,l,ig,j1,j2,i0,jd | ||
155 | |||
156 | INTEGER j_start, j_finish | ||
157 | |||
158 | REAL :: airen_tab(iip1,jjp1,0:1) | ||
159 | REAL :: aires_tab(iip1,jjp1,0:1) | ||
160 | |||
161 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 1 times.
|
3 | DO jd=0, 1 |
162 | 2 | j1=1+jd | |
163 | j2=2 | ||
164 |
2/2✓ Branch 0 taken 2 times.
✓ Branch 1 taken 6 times.
|
9 | DO ig=1,ngroup |
165 | |||
166 | ! c Concerne le pole nord | ||
167 | 6 | j_start = j1-jd | |
168 | 6 | j_finish = j2-jd | |
169 |
2/2✓ Branch 0 taken 6 times.
✓ Branch 1 taken 15 times.
|
21 | DO j=j_start, j_finish |
170 |
5/8✓ Branch 0 taken 15 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 15 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 15 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 157 times.
✓ Branch 7 taken 15 times.
|
193 | DO i0=1,iim,2**(ngroup-ig+1) |
171 | airen=0. | ||
172 |
4/6✓ Branch 0 taken 172 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 172 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 480 times.
✓ Branch 5 taken 172 times.
|
652 | DO i=i0,i0+2**(ngroup-ig+1)-1 |
173 | 652 | airen = airen+aire(i,j) | |
174 | ENDDO | ||
175 |
2/2✓ Branch 0 taken 480 times.
✓ Branch 1 taken 172 times.
|
667 | DO i=i0,i0+2**(ngroup-ig+1)-1 |
176 | airen_tab(i,j,jd) = | ||
177 | 652 | & aire(i,j) / airen | |
178 | ENDDO | ||
179 | ENDDO | ||
180 | ENDDO | ||
181 | |||
182 | ! c Concerne le pole sud | ||
183 | j_start = j1-jd | ||
184 | j_finish = j2-jd | ||
185 |
2/2✓ Branch 0 taken 15 times.
✓ Branch 1 taken 6 times.
|
21 | DO j=j_start, j_finish |
186 |
5/8✓ Branch 0 taken 15 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 15 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 15 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 157 times.
✓ Branch 7 taken 15 times.
|
193 | DO i0=1,iim,2**(ngroup-ig+1) |
187 | aires=0. | ||
188 |
4/6✓ Branch 0 taken 172 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 172 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 480 times.
✓ Branch 5 taken 172 times.
|
652 | DO i=i0,i0+2**(ngroup-ig+1)-1 |
189 | 652 | aires=aires+aire(i,jjp1-j+1) | |
190 | ENDDO | ||
191 |
2/2✓ Branch 0 taken 480 times.
✓ Branch 1 taken 172 times.
|
667 | DO i=i0,i0+2**(ngroup-ig+1)-1 |
192 | aires_tab(i,jjp1-j+1,jd) = | ||
193 | 652 | & aire(i,jjp1-j+1) / aires | |
194 | ENDDO | ||
195 | ENDDO | ||
196 | ENDDO | ||
197 | |||
198 | 6 | j1=j2+1 | |
199 |
1/2✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
|
8 | j2=j2+2**ig |
200 | ENDDO | ||
201 | ENDDO | ||
202 | |||
203 | 1 | RETURN | |
204 | END | ||
205 |