1 | |
---|
2 | ! $Id: inigeom.f90 5159 2024-08-02 19:58:25Z abarral $ |
---|
3 | |
---|
4 | |
---|
5 | |
---|
6 | SUBROUTINE inigeom |
---|
7 | |
---|
8 | ! Auteur : P. Le Van |
---|
9 | |
---|
10 | ! ............ Version du 01/04/2001 ........................ |
---|
11 | |
---|
12 | ! Calcul des elongations cuij1,.cuij4 , cvij1,..cvij4 aux memes en- |
---|
13 | ! endroits que les aires aireij1,..aireij4 . |
---|
14 | |
---|
15 | ! Choix entre f(y) a derivee sinusoid. ou a derivee tangente hyperbol. |
---|
16 | |
---|
17 | |
---|
18 | USE fxhyp_m, ONLY: fxhyp |
---|
19 | USE fyhyp_m, ONLY: fyhyp |
---|
20 | USE comconst_mod, ONLY: pi, g, omeg, rad |
---|
21 | USE logic_mod, ONLY: fxyhypb, ysinus |
---|
22 | USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, & |
---|
23 | alphax,alphay,taux,tauy,transx,transy,pxo,pyo |
---|
24 | USE lmdz_ssum_scopy, ONLY: ssum |
---|
25 | USE lmdz_comdissnew, ONLY: lstardis, nitergdiv, nitergrot, niterh, tetagdiv, & |
---|
26 | tetagrot, tetatemp, coefdis, vert_prof_dissip |
---|
27 | USE lmdz_comgeom2 |
---|
28 | |
---|
29 | USE lmdz_dimensions, ONLY: iim, jjm, llm, ndm |
---|
30 | USE lmdz_paramet |
---|
31 | IMPLICIT NONE |
---|
32 | ! |
---|
33 | |
---|
34 | |
---|
35 | |
---|
36 | !----------------------------------------------------------------------- |
---|
37 | ! .... Variables locales .... |
---|
38 | |
---|
39 | INTEGER :: i,j,itmax,itmay,iter |
---|
40 | REAL :: cvu(iip1,jjp1),cuv(iip1,jjm) |
---|
41 | REAL :: ai14,ai23,airez,rlatp,rlatm,xprm,xprp,un4rad2,yprp,yprm |
---|
42 | REAL :: eps,x1,xo1,f,df,xdm,y1,yo1,ydm |
---|
43 | REAL :: coslatm,coslatp,radclatm,radclatp |
---|
44 | REAL :: cuij1(iip1,jjp1),cuij2(iip1,jjp1),cuij3(iip1,jjp1), & |
---|
45 | cuij4(iip1,jjp1) |
---|
46 | REAL :: cvij1(iip1,jjp1),cvij2(iip1,jjp1),cvij3(iip1,jjp1), & |
---|
47 | cvij4(iip1,jjp1) |
---|
48 | REAL :: rlonvv(iip1),rlatuu(jjp1) |
---|
49 | REAL :: rlatu1(jjm),yprimu1(jjm),rlatu2(jjm),yprimu2(jjm) , & |
---|
50 | yprimv(jjm),yprimu(jjp1) |
---|
51 | REAL :: gamdi_gdiv, gamdi_grot, gamdi_h |
---|
52 | |
---|
53 | REAL :: rlonm025(iip1),xprimm025(iip1), rlonp025(iip1), & |
---|
54 | xprimp025(iip1) |
---|
55 | SAVE rlatu1,yprimu1,rlatu2,yprimu2,yprimv,yprimu |
---|
56 | SAVE rlonm025,xprimm025,rlonp025,xprimp025 |
---|
57 | |
---|
58 | |
---|
59 | ! ------------------------------------------------------------------ |
---|
60 | ! - - |
---|
61 | ! - calcul des coeff. ( cu, cv , 1./cu**2, 1./cv**2 ) - |
---|
62 | ! - - |
---|
63 | ! ------------------------------------------------------------------ |
---|
64 | |
---|
65 | ! les coef. ( cu, cv ) permettent de passer des vitesses naturelles |
---|
66 | ! aux vitesses covariantes et contravariantes , ou vice-versa ... |
---|
67 | |
---|
68 | |
---|
69 | ! on a : u (covariant) = cu * u (naturel) , u(contrav)= u(nat)/cu |
---|
70 | ! v (covariant) = cv * v (naturel) , v(contrav)= v(nat)/cv |
---|
71 | |
---|
72 | ! on en tire : u(covariant) = cu * cu * u(contravariant) |
---|
73 | ! v(covariant) = cv * cv * v(contravariant) |
---|
74 | |
---|
75 | |
---|
76 | ! on a l'application ( x(X) , y(Y) ) avec - im/2 +1 < X < im/2 |
---|
77 | ! = = |
---|
78 | ! et - jm/2 < Y < jm/2 |
---|
79 | ! = = |
---|
80 | |
---|
81 | ! ................................................... |
---|
82 | ! ................................................... |
---|
83 | ! . x est la longitude du point en radians . |
---|
84 | ! . y est la latitude du point en radians . |
---|
85 | ! . . |
---|
86 | ! . on a : cu(i,j) = rad * COS(y) * dx/dX . |
---|
87 | ! . cv( j ) = rad * dy/dY . |
---|
88 | ! . aire(i,j) = cu(i,j) * cv(j) . |
---|
89 | ! . . |
---|
90 | ! . y, dx/dX, dy/dY calcules aux points concernes . |
---|
91 | ! . . |
---|
92 | ! ................................................... |
---|
93 | ! ................................................... |
---|
94 | |
---|
95 | |
---|
96 | |
---|
97 | ! , |
---|
98 | ! cv , bien que dependant de j uniquement,sera ici indice aussi en i |
---|
99 | ! pour un adressage plus facile en ij . |
---|
100 | |
---|
101 | |
---|
102 | |
---|
103 | ! ************** aux points u et v , ***************** |
---|
104 | ! xprimu et xprimv sont respectivement les valeurs de dx/dX |
---|
105 | ! yprimu et yprimv . . . . . . . . . . . dy/dY |
---|
106 | ! rlatu et rlatv . . . . . . . . . . .la latitude |
---|
107 | ! cvu et cv . . . . . . . . . . . cv |
---|
108 | |
---|
109 | ! ************** aux points u, v, scalaires, et z **************** |
---|
110 | ! cu, cuv, cuscal, cuz sont respectiv. les valeurs de cu |
---|
111 | |
---|
112 | |
---|
113 | |
---|
114 | ! Exemple de distribution de variables sur la grille dans le |
---|
115 | ! domaine de travail ( X,Y ) . |
---|
116 | ! ................................................................ |
---|
117 | ! DX=DY= 1 |
---|
118 | |
---|
119 | |
---|
120 | ! + represente un point scalaire ( p.exp la pression ) |
---|
121 | ! > represente la composante zonale du vent |
---|
122 | ! V represente la composante meridienne du vent |
---|
123 | ! o represente la vorticite |
---|
124 | |
---|
125 | ! ---- , car aux poles , les comp.zonales covariantes sont nulles |
---|
126 | |
---|
127 | |
---|
128 | |
---|
129 | ! i -> |
---|
130 | |
---|
131 | ! 1 2 3 4 5 6 7 8 |
---|
132 | ! j |
---|
133 | ! v 1 + ---- + ---- + ---- + ---- + ---- + ---- + ---- + -- |
---|
134 | |
---|
135 | ! V o V o V o V o V o V o V o V o |
---|
136 | |
---|
137 | ! 2 + > + > + > + > + > + > + > + > |
---|
138 | |
---|
139 | ! V o V o V o V o V o V o V o V o |
---|
140 | |
---|
141 | ! 3 + > + > + > + > + > + > + > + > |
---|
142 | |
---|
143 | ! V o V o V o V o V o V o V o V o |
---|
144 | |
---|
145 | ! 4 + > + > + > + > + > + > + > + > |
---|
146 | |
---|
147 | ! V o V o V o V o V o V o V o V o |
---|
148 | |
---|
149 | ! 5 + ---- + ---- + ---- + ---- + ---- + ---- + ---- + -- |
---|
150 | |
---|
151 | |
---|
152 | ! Ci-dessus, on voit que le nombre de pts.en longitude est egal |
---|
153 | ! a IM = 8 |
---|
154 | ! De meme , le nombre d'intervalles entre les 2 poles est egal |
---|
155 | ! a JM = 4 |
---|
156 | |
---|
157 | ! Les points scalaires ( + ) correspondent donc a des valeurs |
---|
158 | ! entieres de i ( 1 a IM ) et de j ( 1 a JM +1 ) . |
---|
159 | |
---|
160 | ! Les vents U ( > ) correspondent a des valeurs semi- |
---|
161 | ! entieres de i ( 1+ 0.5 a IM+ 0.5) et entieres de j ( 1 a JM+1) |
---|
162 | |
---|
163 | ! Les vents V ( V ) correspondent a des valeurs entieres |
---|
164 | ! de i ( 1 a IM ) et semi-entieres de j ( 1 +0.5 a JM +0.5) |
---|
165 | |
---|
166 | |
---|
167 | |
---|
168 | WRITE(6,3) |
---|
169 | 3 FORMAT( // 10x,' .... INIGEOM date du 01/06/98 ..... ', & |
---|
170 | //5x,' Calcul des elongations cu et cv comme sommes des 4 ' / & |
---|
171 | 5 x,' elong. cuij1, .. 4 , cvij1,.. 4 qui les entourent , aux& |
---|
172 | & '/ 5x,' memes endroits que les aires aireij1,...j4 . ' / ) |
---|
173 | |
---|
174 | |
---|
175 | IF( nitergdiv/=2 ) THEN |
---|
176 | gamdi_gdiv = coefdis/ ( REAL(nitergdiv) -2. ) |
---|
177 | ELSE |
---|
178 | gamdi_gdiv = 0. |
---|
179 | ENDIF |
---|
180 | IF( nitergrot/=2 ) THEN |
---|
181 | gamdi_grot = coefdis/ ( REAL(nitergrot) -2. ) |
---|
182 | ELSE |
---|
183 | gamdi_grot = 0. |
---|
184 | ENDIF |
---|
185 | IF( niterh/=2 ) THEN |
---|
186 | gamdi_h = coefdis/ ( REAL(niterh) -2. ) |
---|
187 | ELSE |
---|
188 | gamdi_h = 0. |
---|
189 | ENDIF |
---|
190 | |
---|
191 | WRITE(6,*) ' gamdi_gd ',gamdi_gdiv,gamdi_grot,gamdi_h,coefdis, & |
---|
192 | nitergdiv,nitergrot,niterh |
---|
193 | |
---|
194 | pi = 2.* ASIN(1.) |
---|
195 | |
---|
196 | WRITE(6,990) |
---|
197 | |
---|
198 | ! ---------------------------------------------------------------- |
---|
199 | |
---|
200 | IF( .NOT.fxyhypb ) THEN |
---|
201 | |
---|
202 | |
---|
203 | IF( ysinus ) THEN |
---|
204 | |
---|
205 | WRITE(6,*) ' *** Inigeom , Y = Sinus ( Latitude ) *** ' |
---|
206 | |
---|
207 | ! .... utilisation de f(x,y ) avec y = sinus de la latitude ..... |
---|
208 | |
---|
209 | CALL fxysinus (rlatu,yprimu,rlatv,yprimv,rlatu1,yprimu1, & |
---|
210 | rlatu2,yprimu2, & |
---|
211 | rlonu,xprimu,rlonv,xprimv,rlonm025,xprimm025,rlonp025,xprimp025) |
---|
212 | |
---|
213 | ELSE |
---|
214 | |
---|
215 | WRITE(6,*) '*** Inigeom , Y = Latitude , der. sinusoid . ***' |
---|
216 | |
---|
217 | ! .... utilisation de f(x,y) a tangente sinusoidale , y etant la latit. ... |
---|
218 | ! |
---|
219 | |
---|
220 | pxo = clon *pi /180. |
---|
221 | pyo = 2.* clat* pi /180. |
---|
222 | |
---|
223 | ! .... determination de transx ( pour le zoom ) par Newton-Raphson ... |
---|
224 | |
---|
225 | itmax = 10 |
---|
226 | eps = .1e-7 |
---|
227 | |
---|
228 | xo1 = 0. |
---|
229 | DO iter = 1, itmax |
---|
230 | x1 = xo1 |
---|
231 | f = x1+ alphax *SIN(x1-pxo) |
---|
232 | df = 1.+ alphax *COS(x1-pxo) |
---|
233 | x1 = x1 - f/df |
---|
234 | xdm = ABS( x1- xo1 ) |
---|
235 | IF( xdm<=eps )GO TO 11 |
---|
236 | xo1 = x1 |
---|
237 | END DO |
---|
238 | 11 CONTINUE |
---|
239 | |
---|
240 | transx = xo1 |
---|
241 | |
---|
242 | itmay = 10 |
---|
243 | eps = .1e-7 |
---|
244 | |
---|
245 | yo1 = 0. |
---|
246 | DO iter = 1,itmay |
---|
247 | y1 = yo1 |
---|
248 | f = y1 + alphay* SIN(y1-pyo) |
---|
249 | df = 1. + alphay* COS(y1-pyo) |
---|
250 | y1 = y1 -f/df |
---|
251 | ydm = ABS(y1-yo1) |
---|
252 | IF(ydm<=eps) GO TO 17 |
---|
253 | yo1 = y1 |
---|
254 | END DO |
---|
255 | |
---|
256 | 17 CONTINUE |
---|
257 | transy = yo1 |
---|
258 | |
---|
259 | CALL fxy ( rlatu,yprimu,rlatv,yprimv,rlatu1,yprimu1, & |
---|
260 | rlatu2,yprimu2, & |
---|
261 | rlonu,xprimu,rlonv,xprimv,rlonm025,xprimm025,rlonp025,xprimp025) |
---|
262 | |
---|
263 | ENDIF |
---|
264 | |
---|
265 | ELSE |
---|
266 | |
---|
267 | ! .... Utilisation de fxyhyper , f(x,y) a derivee tangente hyperbol. |
---|
268 | ! ..................................................................... |
---|
269 | |
---|
270 | WRITE(6,*)'*** Inigeom , Y = Latitude , der.tg. hyperbolique ***' |
---|
271 | |
---|
272 | CALL fyhyp(rlatu, yprimu, rlatv, rlatu2, yprimu2, rlatu1, yprimu1) |
---|
273 | CALL fxhyp(xprimm025, rlonv, xprimv, rlonu, xprimu, xprimp025) |
---|
274 | |
---|
275 | ENDIF |
---|
276 | |
---|
277 | ! ------------------------------------------------------------------- |
---|
278 | |
---|
279 | |
---|
280 | rlatu(1) = ASIN(1.) |
---|
281 | rlatu(jjp1) = - rlatu(1) |
---|
282 | |
---|
283 | |
---|
284 | ! .... calcul aux poles .... |
---|
285 | |
---|
286 | yprimu(1) = 0. |
---|
287 | yprimu(jjp1) = 0. |
---|
288 | |
---|
289 | |
---|
290 | un4rad2 = 0.25 * rad * rad |
---|
291 | |
---|
292 | ! -------------------------------------------------------------------- |
---|
293 | ! -------------------------------------------------------------------- |
---|
294 | ! - - |
---|
295 | ! - calcul des aires ( aire,aireu,airev, 1./aire, 1./airez ) - |
---|
296 | ! - et de fext , force de coriolis extensive . - |
---|
297 | ! - - |
---|
298 | ! -------------------------------------------------------------------- |
---|
299 | ! -------------------------------------------------------------------- |
---|
300 | |
---|
301 | |
---|
302 | |
---|
303 | ! A 1 point scalaire P (i,j) de la grille, reguliere en (X,Y) , sont |
---|
304 | ! affectees 4 aires entourant P , calculees respectivement aux points |
---|
305 | ! ( i + 1/4, j - 1/4 ) : aireij1 (i,j) |
---|
306 | ! ( i + 1/4, j + 1/4 ) : aireij2 (i,j) |
---|
307 | ! ( i - 1/4, j + 1/4 ) : aireij3 (i,j) |
---|
308 | ! ( i - 1/4, j - 1/4 ) : aireij4 (i,j) |
---|
309 | |
---|
310 | ! , |
---|
311 | ! Les cotes de chacun de ces 4 carres etant egaux a 1/2 suivant (X,Y). |
---|
312 | ! Chaque aire centree en 1 point scalaire P(i,j) est egale a la somme |
---|
313 | ! des 4 aires aireij1,aireij2,aireij3,aireij4 qui sont affectees au |
---|
314 | ! point (i,j) . |
---|
315 | ! On definit en outre les coefficients alpha comme etant egaux a |
---|
316 | ! (aireij / aire), c.a.d par exp. alpha1(i,j)=aireij1(i,j)/aire(i,j) |
---|
317 | |
---|
318 | ! De meme, toute aire centree en 1 point U est egale a la somme des |
---|
319 | ! 4 aires aireij1,aireij2,aireij3,aireij4 entourant le point U . |
---|
320 | ! Idem pour airev, airez . |
---|
321 | |
---|
322 | ! On a ,pour chaque maille : dX = dY = 1 |
---|
323 | |
---|
324 | |
---|
325 | ! . V |
---|
326 | |
---|
327 | ! aireij4 . . aireij1 |
---|
328 | |
---|
329 | ! U . . P . U |
---|
330 | |
---|
331 | ! aireij3 . . aireij2 |
---|
332 | |
---|
333 | ! . V |
---|
334 | |
---|
335 | |
---|
336 | |
---|
337 | |
---|
338 | |
---|
339 | ! .................................................................... |
---|
340 | |
---|
341 | ! Calcul des 4 aires elementaires aireij1,aireij2,aireij3,aireij4 |
---|
342 | ! qui entourent chaque aire(i,j) , ainsi que les 4 elongations elemen |
---|
343 | ! taires cuij et les 4 elongat. cvij qui sont calculees aux memes |
---|
344 | ! endroits que les aireij . |
---|
345 | |
---|
346 | ! .................................................................... |
---|
347 | |
---|
348 | ! ....... do 35 : boucle sur les jjm + 1 latitudes ..... |
---|
349 | |
---|
350 | |
---|
351 | DO j = 1, jjp1 |
---|
352 | |
---|
353 | IF ( j == 1 ) THEN |
---|
354 | |
---|
355 | yprm = yprimu1(j) |
---|
356 | rlatm = rlatu1(j) |
---|
357 | |
---|
358 | coslatm = COS( rlatm ) |
---|
359 | radclatm = 0.5* rad * coslatm |
---|
360 | |
---|
361 | DO i = 1, iim |
---|
362 | xprp = xprimp025( i ) |
---|
363 | xprm = xprimm025( i ) |
---|
364 | aireij2( i,1 ) = un4rad2 * coslatm * xprp * yprm |
---|
365 | aireij3( i,1 ) = un4rad2 * coslatm * xprm * yprm |
---|
366 | cuij2 ( i,1 ) = radclatm * xprp |
---|
367 | cuij3 ( i,1 ) = radclatm * xprm |
---|
368 | cvij2 ( i,1 ) = 0.5* rad * yprm |
---|
369 | cvij3 ( i,1 ) = cvij2(i,1) |
---|
370 | END DO |
---|
371 | |
---|
372 | DO i = 1, iim |
---|
373 | aireij1( i,1 ) = 0. |
---|
374 | aireij4( i,1 ) = 0. |
---|
375 | cuij1 ( i,1 ) = 0. |
---|
376 | cuij4 ( i,1 ) = 0. |
---|
377 | cvij1 ( i,1 ) = 0. |
---|
378 | cvij4 ( i,1 ) = 0. |
---|
379 | ENDDO |
---|
380 | |
---|
381 | END IF |
---|
382 | |
---|
383 | IF ( j == jjp1 ) THEN |
---|
384 | yprp = yprimu2(j-1) |
---|
385 | rlatp = rlatu2 (j-1) |
---|
386 | !cc yprp = fyprim( REAL(j) - 0.25 ) |
---|
387 | !cc rlatp = fy ( REAL(j) - 0.25 ) |
---|
388 | |
---|
389 | coslatp = COS( rlatp ) |
---|
390 | radclatp = 0.5* rad * coslatp |
---|
391 | |
---|
392 | DO i = 1,iim |
---|
393 | xprp = xprimp025( i ) |
---|
394 | xprm = xprimm025( i ) |
---|
395 | aireij1( i,jjp1 ) = un4rad2 * coslatp * xprp * yprp |
---|
396 | aireij4( i,jjp1 ) = un4rad2 * coslatp * xprm * yprp |
---|
397 | cuij1(i,jjp1) = radclatp * xprp |
---|
398 | cuij4(i,jjp1) = radclatp * xprm |
---|
399 | cvij1(i,jjp1) = 0.5 * rad* yprp |
---|
400 | cvij4(i,jjp1) = cvij1(i,jjp1) |
---|
401 | END DO |
---|
402 | |
---|
403 | DO i = 1, iim |
---|
404 | aireij2( i,jjp1 ) = 0. |
---|
405 | aireij3( i,jjp1 ) = 0. |
---|
406 | cvij2 ( i,jjp1 ) = 0. |
---|
407 | cvij3 ( i,jjp1 ) = 0. |
---|
408 | cuij2 ( i,jjp1 ) = 0. |
---|
409 | cuij3 ( i,jjp1 ) = 0. |
---|
410 | ENDDO |
---|
411 | |
---|
412 | END IF |
---|
413 | ! |
---|
414 | |
---|
415 | IF ( j > 1 .AND. j < jjp1 ) THEN |
---|
416 | |
---|
417 | rlatp = rlatu2 ( j-1 ) |
---|
418 | yprp = yprimu2( j-1 ) |
---|
419 | rlatm = rlatu1 ( j ) |
---|
420 | yprm = yprimu1( j ) |
---|
421 | !c rlatp = fy ( REAL(j) - 0.25 ) |
---|
422 | !c yprp = fyprim( REAL(j) - 0.25 ) |
---|
423 | !c rlatm = fy ( REAL(j) + 0.25 ) |
---|
424 | !c yprm = fyprim( REAL(j) + 0.25 ) |
---|
425 | |
---|
426 | coslatm = COS( rlatm ) |
---|
427 | coslatp = COS( rlatp ) |
---|
428 | radclatp = 0.5* rad * coslatp |
---|
429 | radclatm = 0.5* rad * coslatm |
---|
430 | |
---|
431 | ai14 = un4rad2 * coslatp * yprp |
---|
432 | ai23 = un4rad2 * coslatm * yprm |
---|
433 | DO i = 1,iim |
---|
434 | xprp = xprimp025( i ) |
---|
435 | xprm = xprimm025( i ) |
---|
436 | |
---|
437 | aireij1 ( i,j ) = ai14 * xprp |
---|
438 | aireij2 ( i,j ) = ai23 * xprp |
---|
439 | aireij3 ( i,j ) = ai23 * xprm |
---|
440 | aireij4 ( i,j ) = ai14 * xprm |
---|
441 | cuij1 ( i,j ) = radclatp * xprp |
---|
442 | cuij2 ( i,j ) = radclatm * xprp |
---|
443 | cuij3 ( i,j ) = radclatm * xprm |
---|
444 | cuij4 ( i,j ) = radclatp * xprm |
---|
445 | cvij1 ( i,j ) = 0.5* rad * yprp |
---|
446 | cvij2 ( i,j ) = 0.5* rad * yprm |
---|
447 | cvij3 ( i,j ) = cvij2(i,j) |
---|
448 | cvij4 ( i,j ) = cvij1(i,j) |
---|
449 | END DO |
---|
450 | |
---|
451 | END IF |
---|
452 | |
---|
453 | ! ........ periodicite ............ |
---|
454 | |
---|
455 | cvij1 (iip1,j) = cvij1 (1,j) |
---|
456 | cvij2 (iip1,j) = cvij2 (1,j) |
---|
457 | cvij3 (iip1,j) = cvij3 (1,j) |
---|
458 | cvij4 (iip1,j) = cvij4 (1,j) |
---|
459 | cuij1 (iip1,j) = cuij1 (1,j) |
---|
460 | cuij2 (iip1,j) = cuij2 (1,j) |
---|
461 | cuij3 (iip1,j) = cuij3 (1,j) |
---|
462 | cuij4 (iip1,j) = cuij4 (1,j) |
---|
463 | aireij1 (iip1,j) = aireij1 (1,j ) |
---|
464 | aireij2 (iip1,j) = aireij2 (1,j ) |
---|
465 | aireij3 (iip1,j) = aireij3 (1,j ) |
---|
466 | aireij4 (iip1,j) = aireij4 (1,j ) |
---|
467 | |
---|
468 | END DO |
---|
469 | |
---|
470 | ! .............................................................. |
---|
471 | |
---|
472 | DO j = 1, jjp1 |
---|
473 | DO i = 1, iim |
---|
474 | aire ( i,j ) = aireij1(i,j) + aireij2(i,j) + aireij3(i,j) + & |
---|
475 | aireij4(i,j) |
---|
476 | alpha1 ( i,j ) = aireij1(i,j) / aire(i,j) |
---|
477 | alpha2 ( i,j ) = aireij2(i,j) / aire(i,j) |
---|
478 | alpha3 ( i,j ) = aireij3(i,j) / aire(i,j) |
---|
479 | alpha4 ( i,j ) = aireij4(i,j) / aire(i,j) |
---|
480 | alpha1p2( i,j ) = alpha1 (i,j) + alpha2 (i,j) |
---|
481 | alpha1p4( i,j ) = alpha1 (i,j) + alpha4 (i,j) |
---|
482 | alpha2p3( i,j ) = alpha2 (i,j) + alpha3 (i,j) |
---|
483 | alpha3p4( i,j ) = alpha3 (i,j) + alpha4 (i,j) |
---|
484 | END DO |
---|
485 | |
---|
486 | |
---|
487 | aire (iip1,j) = aire (1,j) |
---|
488 | alpha1 (iip1,j) = alpha1 (1,j) |
---|
489 | alpha2 (iip1,j) = alpha2 (1,j) |
---|
490 | alpha3 (iip1,j) = alpha3 (1,j) |
---|
491 | alpha4 (iip1,j) = alpha4 (1,j) |
---|
492 | alpha1p2(iip1,j) = alpha1p2(1,j) |
---|
493 | alpha1p4(iip1,j) = alpha1p4(1,j) |
---|
494 | alpha2p3(iip1,j) = alpha2p3(1,j) |
---|
495 | alpha3p4(iip1,j) = alpha3p4(1,j) |
---|
496 | END DO |
---|
497 | ! |
---|
498 | |
---|
499 | DO j = 1,jjp1 |
---|
500 | DO i = 1,iim |
---|
501 | aireu (i,j)= aireij1(i,j) + aireij2(i,j) + aireij4(i+1,j) + & |
---|
502 | aireij3(i+1,j) |
---|
503 | unsaire ( i,j)= 1./ aire(i,j) |
---|
504 | unsair_gam1( i,j)= unsaire(i,j)** ( - gamdi_gdiv ) |
---|
505 | unsair_gam2( i,j)= unsaire(i,j)** ( - gamdi_h ) |
---|
506 | airesurg ( i,j)= aire(i,j)/ g |
---|
507 | END DO |
---|
508 | aireu (iip1,j) = aireu (1,j) |
---|
509 | unsaire (iip1,j) = unsaire(1,j) |
---|
510 | unsair_gam1(iip1,j) = unsair_gam1(1,j) |
---|
511 | unsair_gam2(iip1,j) = unsair_gam2(1,j) |
---|
512 | airesurg (iip1,j) = airesurg(1,j) |
---|
513 | END DO |
---|
514 | |
---|
515 | |
---|
516 | DO j = 1,jjm |
---|
517 | |
---|
518 | DO i=1,iim |
---|
519 | airev (i,j) = aireij2(i,j)+ aireij3(i,j)+ aireij1(i,j+1) + & |
---|
520 | aireij4(i,j+1) |
---|
521 | ENDDO |
---|
522 | DO i=1,iim |
---|
523 | airez = aireij2(i,j)+aireij1(i,j+1)+aireij3(i+1,j) + & |
---|
524 | aireij4(i+1,j+1) |
---|
525 | unsairez(i,j) = 1./ airez |
---|
526 | unsairz_gam(i,j)= unsairez(i,j)** ( - gamdi_grot ) |
---|
527 | fext (i,j) = airez * SIN(rlatv(j))* 2.* omeg |
---|
528 | ENDDO |
---|
529 | airev (iip1,j) = airev(1,j) |
---|
530 | unsairez (iip1,j) = unsairez(1,j) |
---|
531 | fext (iip1,j) = fext(1,j) |
---|
532 | unsairz_gam(iip1,j) = unsairz_gam(1,j) |
---|
533 | |
---|
534 | END DO |
---|
535 | |
---|
536 | |
---|
537 | ! ..... Calcul des elongations cu,cv, cvu ......... |
---|
538 | |
---|
539 | DO j = 1, jjm |
---|
540 | DO i = 1, iim |
---|
541 | cv(i,j) = 0.5 *( cvij2(i,j)+cvij3(i,j)+cvij1(i,j+1)+cvij4(i,j+1)) |
---|
542 | cvu(i,j)= 0.5 *( cvij1(i,j)+cvij4(i,j)+cvij2(i,j) +cvij3(i,j) ) |
---|
543 | cuv(i,j)= 0.5 *( cuij2(i,j)+cuij3(i,j)+cuij1(i,j+1)+cuij4(i,j+1)) |
---|
544 | unscv2(i,j) = 1./ ( cv(i,j)*cv(i,j) ) |
---|
545 | ENDDO |
---|
546 | DO i = 1, iim |
---|
547 | cuvsurcv (i,j) = airev(i,j) * unscv2(i,j) |
---|
548 | cvsurcuv (i,j) = 1./cuvsurcv(i,j) |
---|
549 | cuvscvgam1(i,j) = cuvsurcv (i,j) ** ( - gamdi_gdiv ) |
---|
550 | cuvscvgam2(i,j) = cuvsurcv (i,j) ** ( - gamdi_h ) |
---|
551 | cvscuvgam(i,j) = cvsurcuv (i,j) ** ( - gamdi_grot ) |
---|
552 | ENDDO |
---|
553 | cv (iip1,j) = cv (1,j) |
---|
554 | cvu (iip1,j) = cvu (1,j) |
---|
555 | unscv2 (iip1,j) = unscv2 (1,j) |
---|
556 | cuv (iip1,j) = cuv (1,j) |
---|
557 | cuvsurcv (iip1,j) = cuvsurcv (1,j) |
---|
558 | cvsurcuv (iip1,j) = cvsurcuv (1,j) |
---|
559 | cuvscvgam1(iip1,j) = cuvscvgam1(1,j) |
---|
560 | cuvscvgam2(iip1,j) = cuvscvgam2(1,j) |
---|
561 | cvscuvgam(iip1,j) = cvscuvgam(1,j) |
---|
562 | ENDDO |
---|
563 | |
---|
564 | DO j = 2, jjm |
---|
565 | DO i = 1, iim |
---|
566 | cu(i,j) = 0.5*(cuij1(i,j)+cuij4(i+1,j)+cuij2(i,j)+cuij3(i+1,j)) |
---|
567 | unscu2 (i,j) = 1./ ( cu(i,j) * cu(i,j) ) |
---|
568 | cvusurcu (i,j) = aireu(i,j) * unscu2(i,j) |
---|
569 | cusurcvu (i,j) = 1./ cvusurcu(i,j) |
---|
570 | cvuscugam1 (i,j) = cvusurcu(i,j) ** ( - gamdi_gdiv ) |
---|
571 | cvuscugam2 (i,j) = cvusurcu(i,j) ** ( - gamdi_h ) |
---|
572 | cuscvugam (i,j) = cusurcvu(i,j) ** ( - gamdi_grot ) |
---|
573 | ENDDO |
---|
574 | cu (iip1,j) = cu(1,j) |
---|
575 | unscu2 (iip1,j) = unscu2(1,j) |
---|
576 | cvusurcu (iip1,j) = cvusurcu(1,j) |
---|
577 | cusurcvu (iip1,j) = cusurcvu(1,j) |
---|
578 | cvuscugam1(iip1,j) = cvuscugam1(1,j) |
---|
579 | cvuscugam2(iip1,j) = cvuscugam2(1,j) |
---|
580 | cuscvugam (iip1,j) = cuscvugam(1,j) |
---|
581 | ENDDO |
---|
582 | |
---|
583 | |
---|
584 | ! .... calcul aux poles .... |
---|
585 | |
---|
586 | DO i = 1, iip1 |
---|
587 | cu ( i, 1 ) = 0. |
---|
588 | unscu2( i, 1 ) = 0. |
---|
589 | cvu ( i, 1 ) = 0. |
---|
590 | |
---|
591 | cu (i, jjp1) = 0. |
---|
592 | unscu2(i, jjp1) = 0. |
---|
593 | cvu (i, jjp1) = 0. |
---|
594 | ENDDO |
---|
595 | |
---|
596 | ! .............................................................. |
---|
597 | |
---|
598 | DO j = 1, jjm |
---|
599 | DO i= 1, iim |
---|
600 | airvscu2 (i,j) = airev(i,j)/ ( cuv(i,j) * cuv(i,j) ) |
---|
601 | aivscu2gam(i,j) = airvscu2(i,j)** ( - gamdi_grot ) |
---|
602 | ENDDO |
---|
603 | airvscu2 (iip1,j) = airvscu2(1,j) |
---|
604 | aivscu2gam(iip1,j) = aivscu2gam(1,j) |
---|
605 | ENDDO |
---|
606 | |
---|
607 | DO j=2,jjm |
---|
608 | DO i=1,iim |
---|
609 | airuscv2 (i,j) = aireu(i,j)/ ( cvu(i,j) * cvu(i,j) ) |
---|
610 | aiuscv2gam (i,j) = airuscv2(i,j)** ( - gamdi_grot ) |
---|
611 | ENDDO |
---|
612 | airuscv2 (iip1,j) = airuscv2 (1,j) |
---|
613 | aiuscv2gam(iip1,j) = aiuscv2gam(1,j) |
---|
614 | ENDDO |
---|
615 | |
---|
616 | |
---|
617 | ! calcul des aires aux poles : |
---|
618 | ! ----------------------------- |
---|
619 | |
---|
620 | apoln = SSUM(iim,aire(1,1),1) |
---|
621 | apols = SSUM(iim,aire(1,jjp1),1) |
---|
622 | unsapolnga1 = 1./ ( apoln ** ( - gamdi_gdiv ) ) |
---|
623 | unsapolsga1 = 1./ ( apols ** ( - gamdi_gdiv ) ) |
---|
624 | unsapolnga2 = 1./ ( apoln ** ( - gamdi_h ) ) |
---|
625 | unsapolsga2 = 1./ ( apols ** ( - gamdi_h ) ) |
---|
626 | |
---|
627 | !----------------------------------------------------------------------- |
---|
628 | ! gtitre='Coriolis version ancienne' |
---|
629 | ! gfichier='fext1' |
---|
630 | ! CALL writestd(fext,iip1*jjm) |
---|
631 | |
---|
632 | ! changement F. Hourdin calcul conservatif pour fext |
---|
633 | ! constang contient le produit a * cos ( latitude ) * omega |
---|
634 | |
---|
635 | DO i=1,iim |
---|
636 | constang(i,1) = 0. |
---|
637 | ENDDO |
---|
638 | DO j=1,jjm-1 |
---|
639 | DO i=1,iim |
---|
640 | constang(i,j+1) = rad*omeg*cu(i,j+1)*COS(rlatu(j+1)) |
---|
641 | ENDDO |
---|
642 | ENDDO |
---|
643 | DO i=1,iim |
---|
644 | constang(i,jjp1) = 0. |
---|
645 | ENDDO |
---|
646 | |
---|
647 | ! periodicite en longitude |
---|
648 | |
---|
649 | DO j=1,jjm |
---|
650 | fext(iip1,j) = fext(1,j) |
---|
651 | ENDDO |
---|
652 | DO j=1,jjp1 |
---|
653 | constang(iip1,j) = constang(1,j) |
---|
654 | ENDDO |
---|
655 | |
---|
656 | ! fin du changement |
---|
657 | |
---|
658 | |
---|
659 | !----------------------------------------------------------------------- |
---|
660 | |
---|
661 | WRITE(6,*) ' *** Coordonnees de la grille *** ' |
---|
662 | WRITE(6,995) |
---|
663 | |
---|
664 | WRITE(6,*) ' LONGITUDES aux pts. V ( degres ) ' |
---|
665 | WRITE(6,995) |
---|
666 | DO i=1,iip1 |
---|
667 | rlonvv(i) = rlonv(i)*180./pi |
---|
668 | ENDDO |
---|
669 | WRITE(6,400) rlonvv |
---|
670 | |
---|
671 | WRITE(6,995) |
---|
672 | WRITE(6,*) ' LATITUDES aux pts. V ( degres ) ' |
---|
673 | WRITE(6,995) |
---|
674 | DO i=1,jjm |
---|
675 | rlatuu(i)=rlatv(i)*180./pi |
---|
676 | ENDDO |
---|
677 | WRITE(6,400) (rlatuu(i),i=1,jjm) |
---|
678 | |
---|
679 | DO i=1,iip1 |
---|
680 | rlonvv(i)=rlonu(i)*180./pi |
---|
681 | ENDDO |
---|
682 | WRITE(6,995) |
---|
683 | WRITE(6,*) ' LONGITUDES aux pts. U ( degres ) ' |
---|
684 | WRITE(6,995) |
---|
685 | WRITE(6,400) rlonvv |
---|
686 | WRITE(6,995) |
---|
687 | |
---|
688 | WRITE(6,*) ' LATITUDES aux pts. U ( degres ) ' |
---|
689 | WRITE(6,995) |
---|
690 | DO i=1,jjp1 |
---|
691 | rlatuu(i)=rlatu(i)*180./pi |
---|
692 | ENDDO |
---|
693 | WRITE(6,400) (rlatuu(i),i=1,jjp1) |
---|
694 | WRITE(6,995) |
---|
695 | |
---|
696 | 444 format(f10.3,f6.0) |
---|
697 | 400 FORMAT(1x,8f8.2) |
---|
698 | 990 FORMAT(//) |
---|
699 | 995 FORMAT(/) |
---|
700 | |
---|
701 | RETURN |
---|
702 | END SUBROUTINE inigeom |
---|