1 | SUBROUTINE OROSETUP |
---|
2 | * ( klon , klev , KTEST |
---|
3 | * , KKCRIT, KKCRITH, KCRIT, KSECT , KKHLIM |
---|
4 | * , kkenvh, kknu , kknu2 |
---|
5 | * , PAPHM1, PAPM1 , PUM1 , PVM1 , PTM1 , PGEOM1, pvaror |
---|
6 | * , PRHO , PRI , PSTAB , PTAU , PVPH ,ppsi, pzdep |
---|
7 | * , PULOW , PVLOW |
---|
8 | * , Ptheta, pgamma, pnu , pd1 , pd2 ,pdmod ) |
---|
9 | C |
---|
10 | C**** *GWSETUP* |
---|
11 | C |
---|
12 | C PURPOSE. |
---|
13 | C -------- |
---|
14 | C |
---|
15 | C** INTERFACE. |
---|
16 | C ---------- |
---|
17 | C FROM *ORODRAG* |
---|
18 | C |
---|
19 | C EXPLICIT ARGUMENTS : |
---|
20 | C -------------------- |
---|
21 | C ==== INPUTS === |
---|
22 | C ==== OUTPUTS === |
---|
23 | C |
---|
24 | C IMPLICIT ARGUMENTS : NONE |
---|
25 | C -------------------- |
---|
26 | C |
---|
27 | C METHOD. |
---|
28 | C ------- |
---|
29 | C |
---|
30 | C |
---|
31 | C EXTERNALS. |
---|
32 | C ---------- |
---|
33 | C |
---|
34 | C |
---|
35 | C REFERENCE. |
---|
36 | C ---------- |
---|
37 | C |
---|
38 | C SEE ECMWF RESEARCH DEPARTMENT DOCUMENTATION OF THE "I.F.S." |
---|
39 | C |
---|
40 | C AUTHOR. |
---|
41 | C ------- |
---|
42 | C |
---|
43 | C MODIFICATIONS. |
---|
44 | C -------------- |
---|
45 | C F.LOTT FOR THE NEW-GWDRAG SCHEME NOVEMBER 1993 |
---|
46 | C |
---|
47 | C----------------------------------------------------------------------- |
---|
48 | use dimradmars_mod, only: ndlo2 |
---|
49 | implicit none |
---|
50 | C |
---|
51 | |
---|
52 | #include "dimensions.h" |
---|
53 | #include "dimphys.h" |
---|
54 | !#include "dimradmars.h" |
---|
55 | integer klon,klev,kidia,kfdia |
---|
56 | |
---|
57 | #include "comcstfi.h" |
---|
58 | #include "yoegwd.h" |
---|
59 | |
---|
60 | C----------------------------------------------------------------------- |
---|
61 | C |
---|
62 | C* 0.1 ARGUMENTS |
---|
63 | C --------- |
---|
64 | C |
---|
65 | INTEGER KKCRIT(NDLO2),KKCRITH(NDLO2),KCRIT(NDLO2),KSECT(NDLO2), |
---|
66 | * KKHLIM(NDLO2),KTEST(NDLO2),kkenvh(NDLO2) |
---|
67 | |
---|
68 | C |
---|
69 | REAL PAPHM1(NDLO2,KLEV+1),PAPM1(NDLO2,KLEV),PUM1(NDLO2,KLEV), |
---|
70 | * PVM1(NDLO2,KLEV),PTM1(NDLO2,KLEV),PGEOM1(NDLO2,KLEV), |
---|
71 | * PRHO(NDLO2,KLEV+1),PRI(NDLO2,KLEV+1),PSTAB(NDLO2,KLEV+1), |
---|
72 | * PTAU(NDLO2,KLEV+1),PVPH(NDLO2,KLEV+1),ppsi(NDLO2,klev+1), |
---|
73 | * pzdep(NDLO2,klev) |
---|
74 | REAL PULOW(NDLO2),PVLOW(NDLO2),ptheta(NDLO2),pgamma(NDLO2), |
---|
75 | * pnu(NDLO2), |
---|
76 | * pd1(NDLO2),pd2(NDLO2),pdmod(NDLO2) |
---|
77 | real pvaror(NDLO2) |
---|
78 | C |
---|
79 | C----------------------------------------------------------------------- |
---|
80 | C |
---|
81 | C* 0.2 LOCAL ARRAYS |
---|
82 | C ------------ |
---|
83 | C |
---|
84 | C |
---|
85 | LOGICAL LL1(NDLO2,nlayermx+1) |
---|
86 | integer kknu(NDLO2),kknu2(NDLO2),kknub(NDLO2),kknul(NDLO2), |
---|
87 | * kentp(NDLO2),ncount(NDLO2) |
---|
88 | C |
---|
89 | REAL ZHCRIT(NDLO2,nlayermx),ZNCRIT(NDLO2,nlayermx), |
---|
90 | * ZVPF(NDLO2,nlayermx), ZDP(NDLO2,nlayermx) |
---|
91 | REAL ZNORM(NDLO2),zpsi(NDLO2),zb(NDLO2),zc(NDLO2), |
---|
92 | * zulow(NDLO2),zvlow(NDLO2),znup(NDLO2),znum(NDLO2) |
---|
93 | C |
---|
94 | c declarations pour "implicit none" |
---|
95 | integer jk,jl,ilevm1,ilevm2,ilevh |
---|
96 | real zu,zphi,zcons1,zcons2,zcons3,zwind,zdwind,zhgeo |
---|
97 | real zvt1,zvt2,zst,zvar,zdelp,zstabm,zstabp,zrhom,zrhop |
---|
98 | real alpha,zggeenv,zggeom1,zgvar |
---|
99 | logical lo |
---|
100 | |
---|
101 | C ------------------------------------------------------------------ |
---|
102 | C |
---|
103 | C* 1. INITIALIZATION |
---|
104 | C -------------- |
---|
105 | C |
---|
106 | c print *,' entree gwsetup' |
---|
107 | 100 CONTINUE |
---|
108 | C |
---|
109 | C ------------------------------------------------------------------ |
---|
110 | C |
---|
111 | C* 1.1 COMPUTATIONAL CONSTANTS |
---|
112 | C ----------------------- |
---|
113 | C |
---|
114 | |
---|
115 | kidia=1 |
---|
116 | kfdia=klon |
---|
117 | |
---|
118 | 110 CONTINUE |
---|
119 | C |
---|
120 | ILEVM1=KLEV-1 |
---|
121 | ILEVM2=KLEV-2 |
---|
122 | ILEVH =KLEV/3 |
---|
123 | C |
---|
124 | ZCONS1=1./r |
---|
125 | cold ZCONS2=G**2/CPD |
---|
126 | ZCONS2=g**2/cpp |
---|
127 | cold ZCONS3=1.5*API |
---|
128 | ZCONS3=1.5*PI |
---|
129 | C |
---|
130 | C |
---|
131 | C ------------------------------------------------------------------ |
---|
132 | C |
---|
133 | C* 2. |
---|
134 | C -------------- |
---|
135 | C |
---|
136 | 200 CONTINUE |
---|
137 | C |
---|
138 | C ------------------------------------------------------------------ |
---|
139 | C |
---|
140 | C* 2.1 DEFINE LOW LEVEL WIND, PROJECT WINDS IN PLANE OF |
---|
141 | C* LOW LEVEL WIND, DETERMINE SECTOR IN WHICH TO TAKE |
---|
142 | C* THE VARIANCE AND SET INDICATOR FOR CRITICAL LEVELS. |
---|
143 | C |
---|
144 | C |
---|
145 | C |
---|
146 | DO 2001 JL=kidia,kfdia |
---|
147 | kknu(JL) =klev |
---|
148 | kknu2(JL) =klev |
---|
149 | kknub(JL) =klev |
---|
150 | kknul(JL) =klev |
---|
151 | pgamma(JL) =max(pgamma(jl),gtsec) |
---|
152 | ll1(jl,klev+1)=.false. |
---|
153 | 2001 CONTINUE |
---|
154 | C |
---|
155 | C* DEFINE TOP OF LOW LEVEL FLOW |
---|
156 | C ---------------------------- |
---|
157 | DO 2002 JK=KLEV,ilevh,-1 |
---|
158 | DO 2003 JL=kidia,kfdia |
---|
159 | LO=(PAPHM1(JL,JK)/PAPHM1(JL,KLEV+1)).GE.GSIGCR |
---|
160 | IF(LO) THEN |
---|
161 | KKCRIT(JL)=JK |
---|
162 | ENDIF |
---|
163 | ZHCRIT(JL,JK)=4.*pvaror(JL) |
---|
164 | ZHGEO=PGEOM1(JL,JK)/g |
---|
165 | ll1(JL,JK)=(ZHGEO.GT.ZHCRIT(JL,JK)) |
---|
166 | IF(ll1(JL,JK).NEQV.ll1(JL,JK+1)) THEN |
---|
167 | kknu(JL)=JK |
---|
168 | ENDIF |
---|
169 | 2003 CONTINUE |
---|
170 | 2002 CONTINUE |
---|
171 | DO 2004 JK=KLEV,ilevh,-1 |
---|
172 | DO 2005 JL=kidia,kfdia |
---|
173 | ZHCRIT(JL,JK)=3.*pvaror(JL) |
---|
174 | ZHGEO=PGEOM1(JL,JK)/g |
---|
175 | ll1(JL,JK)=(ZHGEO.GT.ZHCRIT(JL,JK)) |
---|
176 | IF(ll1(JL,JK).NEQV.ll1(JL,JK+1)) THEN |
---|
177 | kknu2(JL)=JK |
---|
178 | ENDIF |
---|
179 | 2005 CONTINUE |
---|
180 | 2004 CONTINUE |
---|
181 | DO 2006 JK=KLEV,ilevh,-1 |
---|
182 | DO 2007 JL=kidia,kfdia |
---|
183 | ZHCRIT(JL,JK)=2.*pvaror(JL) |
---|
184 | ZHGEO=PGEOM1(JL,JK)/g |
---|
185 | ll1(JL,JK)=(ZHGEO.GT.ZHCRIT(JL,JK)) |
---|
186 | IF(ll1(JL,JK).NEQV.ll1(JL,JK+1)) THEN |
---|
187 | kknub(JL)=JK |
---|
188 | ENDIF |
---|
189 | 2007 CONTINUE |
---|
190 | 2006 CONTINUE |
---|
191 | DO 2008 JK=KLEV,ilevh,-1 |
---|
192 | DO 2009 JL=kidia,kfdia |
---|
193 | ZHCRIT(JL,JK)=pvaror(JL) |
---|
194 | ZHGEO=PGEOM1(JL,JK)/g |
---|
195 | ll1(JL,JK)=(ZHGEO.GT.ZHCRIT(JL,JK)) |
---|
196 | IF(ll1(JL,JK).NEQV.ll1(JL,JK+1)) THEN |
---|
197 | kknul(JL)=JK |
---|
198 | ENDIF |
---|
199 | 2009 CONTINUE |
---|
200 | 2008 CONTINUE |
---|
201 | C |
---|
202 | do 2010 jl=kidia,kfdia |
---|
203 | kknu(jl)=min(kknu(jl),nktopg) |
---|
204 | kknub(jl)=min(kknub(jl),nktopg) |
---|
205 | if(kknub(jl).eq.nktopg) kknul(jl)=klev |
---|
206 | C |
---|
207 | C CHANGE IN HERE TO STOP KKNUL=KKNUB |
---|
208 | C |
---|
209 | if(kknul(jl).le.kknub(jl)) kknul(jl)=nktopg |
---|
210 | 2010 continue |
---|
211 | C |
---|
212 | |
---|
213 | 210 CONTINUE |
---|
214 | C |
---|
215 | C |
---|
216 | CC* INITIALIZE VARIOUS ARRAYS |
---|
217 | C |
---|
218 | DO 2107 JL=kidia,kfdia |
---|
219 | PRHO(JL,KLEV+1) =0.0 |
---|
220 | PSTAB(JL,KLEV+1) =0.0 |
---|
221 | PSTAB(JL,1) =0.0 |
---|
222 | PRI(JL,KLEV+1) =9999.0 |
---|
223 | ppsi(JL,KLEV+1) =0.0 |
---|
224 | PRI(JL,1) =0.0 |
---|
225 | PVPH(JL,1) =0.0 |
---|
226 | PULOW(JL) =0.0 |
---|
227 | PVLOW(JL) =0.0 |
---|
228 | zulow(JL) =0.0 |
---|
229 | zvlow(JL) =0.0 |
---|
230 | KKCRITH(JL) =KLEV |
---|
231 | KKenvH(JL) =KLEV |
---|
232 | Kentp(JL) =KLEV |
---|
233 | KCRIT(JL) =1 |
---|
234 | ncount(JL) =0 |
---|
235 | ll1(JL,klev+1) =.false. |
---|
236 | 2107 CONTINUE |
---|
237 | C |
---|
238 | C* DEFINE LOW-LEVEL FLOW |
---|
239 | C --------------------- |
---|
240 | C |
---|
241 | DO 223 JK=KLEV,2,-1 |
---|
242 | DO 222 JL=kidia,kfdia |
---|
243 | IF(KTEST(JL).EQ.1) THEN |
---|
244 | ZDP(JL,JK)=PAPM1(JL,JK)-PAPM1(JL,JK-1) |
---|
245 | PRHO(JL,JK)=2.*PAPHM1(JL,JK)*ZCONS1/(PTM1(JL,JK)+PTM1(JL,JK-1)) |
---|
246 | PSTAB(JL,JK)=2.*ZCONS2/(PTM1(JL,JK)+PTM1(JL,JK-1))* |
---|
247 | * (1.-cpp*PRHO(JL,JK)*(PTM1(JL,JK)-PTM1(JL,JK-1))/ZDP(JL,JK)) |
---|
248 | PSTAB(JL,JK)=MAX(PSTAB(JL,JK),GSSEC) |
---|
249 | ENDIF |
---|
250 | 222 CONTINUE |
---|
251 | 223 CONTINUE |
---|
252 | C |
---|
253 | C******************************************************************** |
---|
254 | C |
---|
255 | C* DEFINE blocked FLOW |
---|
256 | C ------------------- |
---|
257 | DO 2115 JK=klev,ilevh,-1 |
---|
258 | DO 2116 JL=kidia,kfdia |
---|
259 | if(jk.ge.kknub(jl).and.jk.le.kknul(jl)) then |
---|
260 | pulow(JL)=pulow(JL)+PUM1(JL,JK)*(PAPHM1(JL,JK+1)-PAPHM1(JL,JK)) |
---|
261 | pvlow(JL)=pvlow(JL)+PVM1(JL,JK)*(PAPHM1(JL,JK+1)-PAPHM1(JL,JK)) |
---|
262 | end if |
---|
263 | 2116 CONTINUE |
---|
264 | 2115 CONTINUE |
---|
265 | DO 2110 JL=kidia,kfdia |
---|
266 | pulow(JL)=pulow(JL)/(PAPHM1(JL,Kknul(jl)+1)-PAPHM1(JL,kknub(jl))) |
---|
267 | pvlow(JL)=pvlow(JL)/(PAPHM1(JL,Kknul(jl)+1)-PAPHM1(JL,kknub(jl))) |
---|
268 | ZNORM(JL)=MAX(SQRT(PULOW(JL)**2+PVLOW(JL)**2),GVSEC) |
---|
269 | PVPH(JL,KLEV+1)=ZNORM(JL) |
---|
270 | 2110 CONTINUE |
---|
271 | C |
---|
272 | C******* SETUP OROGRAPHY AXES AND DEFINE PLANE OF PROFILES ******* |
---|
273 | C |
---|
274 | DO 2112 JL=kidia,kfdia |
---|
275 | LO=(PULOW(JL).LT.GVSEC).AND.(PULOW(JL).GE.-GVSEC) |
---|
276 | IF(LO) THEN |
---|
277 | ZU=PULOW(JL)+2.*GVSEC |
---|
278 | ELSE |
---|
279 | ZU=PULOW(JL) |
---|
280 | ENDIF |
---|
281 | Zphi=ATAN(PVLOW(JL)/ZU) |
---|
282 | ppsi(jl,klev+1)=ptheta(jl)*pi/180.-zphi |
---|
283 | zb(jl)=1.-0.18*pgamma(jl)-0.04*pgamma(jl)**2 |
---|
284 | zc(jl)=0.48*pgamma(jl)+0.3*pgamma(jl)**2 |
---|
285 | pd1(jl)=zb(jl)-(zb(jl)-zc(jl))*(sin(ppsi(jl,klev+1))**2) |
---|
286 | pd2(jl)=(zb(jl)-zc(jl))*sin(ppsi(jl,klev+1))*cos(ppsi(jl,klev+1)) |
---|
287 | pdmod(jl)=sqrt(pd1(jl)**2+pd2(jl)**2) |
---|
288 | 2112 CONTINUE |
---|
289 | C |
---|
290 | C ************ DEFINE FLOW IN PLANE OF LOWLEVEL STRESS ************* |
---|
291 | C |
---|
292 | DO 213 JK=1,KLEV |
---|
293 | DO 212 JL=kidia,kfdia |
---|
294 | IF(KTEST(JL).EQ.1) THEN |
---|
295 | ZVt1 =PULOW(JL)*PUM1(JL,JK)+PVLOW(JL)*PVM1(JL,JK) |
---|
296 | ZVt2 =-PvLOW(JL)*PUM1(JL,JK)+PuLOW(JL)*PVM1(JL,JK) |
---|
297 | ZVPF(JL,JK)=(zvt1*pd1(jl)+zvt2*pd2(JL))/(znorm(jl)*pdmod(jl)) |
---|
298 | ENDIF |
---|
299 | PTAU(JL,JK) =0.0 |
---|
300 | Pzdep(JL,JK) =0.0 |
---|
301 | Ppsi(JL,JK) =0.0 |
---|
302 | ll1(JL,JK) =.FALSE. |
---|
303 | 212 CONTINUE |
---|
304 | 213 CONTINUE |
---|
305 | DO 215 JK=2,KLEV |
---|
306 | DO 214 JL=kidia,kfdia |
---|
307 | IF(KTEST(JL).EQ.1) THEN |
---|
308 | ZDP(JL,JK)=PAPM1(JL,JK)-PAPM1(JL,JK-1) |
---|
309 | PVPH(JL,JK)=((PAPHM1(JL,JK)-PAPM1(JL,JK-1))*ZVPF(JL,JK)+ |
---|
310 | * (PAPM1(JL,JK)-PAPHM1(JL,JK))*ZVPF(JL,JK-1)) |
---|
311 | * /ZDP(JL,JK) |
---|
312 | IF(PVPH(JL,JK).LT.GVSEC) THEN |
---|
313 | PVPH(JL,JK)=GVSEC |
---|
314 | KCRIT(JL)=JK |
---|
315 | ENDIF |
---|
316 | ENDIF |
---|
317 | 214 CONTINUE |
---|
318 | 215 CONTINUE |
---|
319 | C |
---|
320 | C |
---|
321 | C* 2.2 BRUNT-VAISALA FREQUENCY AND DENSITY AT HALF LEVELS. |
---|
322 | C |
---|
323 | 220 CONTINUE |
---|
324 | C |
---|
325 | DO 2211 JK=ilevh,KLEV |
---|
326 | DO 221 JL=kidia,kfdia |
---|
327 | IF(KTEST(JL).EQ.1) THEN |
---|
328 | IF(jk.ge.(kknub(jl)+1).and.jk.le.kknul(jl)) THEN |
---|
329 | ZST=ZCONS2/PTM1(JL,JK)*(1.-cpp*PRHO(JL,JK)* |
---|
330 | * (PTM1(JL,JK)-PTM1(JL,JK-1))/ZDP(JL,JK)) |
---|
331 | PSTAB(JL,KLEV+1)=PSTAB(JL,KLEV+1)+ZST*ZDP(JL,JK) |
---|
332 | PSTAB(JL,KLEV+1)=MAX(PSTAB(JL,KLEV+1),GSSEC) |
---|
333 | PRHO(JL,KLEV+1)=PRHO(JL,KLEV+1)+PAPHM1(JL,JK)*2.*ZDP(JL,JK) |
---|
334 | * *ZCONS1/(PTM1(JL,JK)+PTM1(JL,JK-1)) |
---|
335 | ENDIF |
---|
336 | ENDIF |
---|
337 | 221 CONTINUE |
---|
338 | 2211 CONTINUE |
---|
339 | C |
---|
340 | DO 2212 JL=kidia,kfdia |
---|
341 | C***************************************************************************** |
---|
342 | C |
---|
343 | C O.K. THERE IS A POSSIBLE PROBLEM HERE. IF KKNUL=KKNUB THEN |
---|
344 | C DIVISION BY ZERO OCCURS. I HAVE PUT A FIX IN HERE BUT WILL ASK FRANCOIS |
---|
345 | C LOTT ABOUT IT IN PARIS. |
---|
346 | C |
---|
347 | C MAT COLLINS 30.1.96 |
---|
348 | C |
---|
349 | C ALSO IF THIS IS THE CASE PSTAB AND PRHO ARE NOT DEFINED AT KLEV+1 |
---|
350 | C SO I HAVE ADDED THE ELSE |
---|
351 | C |
---|
352 | C***************************************************************************** |
---|
353 | IF (KKNUL(JL).NE.KKNUB(JL)) THEN |
---|
354 | PSTAB(JL,KLEV+1)=PSTAB(JL,KLEV+1)/(PAPM1(JL,Kknul(jl)) |
---|
355 | * -PAPM1(JL,kknub(jl))) |
---|
356 | PRHO(JL,KLEV+1)=PRHO(JL,KLEV+1)/(PAPM1(JL,Kknul(jl)) |
---|
357 | * -PAPM1(JL,kknub(jl))) |
---|
358 | ELSE |
---|
359 | WRITE(*,*) 'OROSETUP: KKNUB=KKNUL= ',KKNUB(JL),' AT JL= ',JL |
---|
360 | PSTAB(JL,KLEV+1)=PSTAB(JL,KLEV) |
---|
361 | PRHO(JL,KLEV+1)=PRHO(JL,KLEV) |
---|
362 | ENDIF |
---|
363 | ZVAR=PVARor(JL) |
---|
364 | 2212 CONTINUE |
---|
365 | C |
---|
366 | C* 2.3 MEAN FLOW RICHARDSON NUMBER. |
---|
367 | C* AND CRITICAL HEIGHT FOR FROUDE LAYER |
---|
368 | C |
---|
369 | 230 CONTINUE |
---|
370 | C |
---|
371 | DO 232 JK=2,KLEV |
---|
372 | DO 231 JL=kidia,kfdia |
---|
373 | IF(KTEST(JL).EQ.1) THEN |
---|
374 | ZDWIND=MAX(ABS(ZVPF(JL,JK)-ZVPF(JL,JK-1)),GVSEC) |
---|
375 | PRI(JL,JK)=PSTAB(JL,JK)*(ZDP(JL,JK) |
---|
376 | * /(g*PRHO(JL,JK)*ZDWIND))**2 |
---|
377 | PRI(JL,JK)=MAX(PRI(JL,JK),GRCRIT) |
---|
378 | ENDIF |
---|
379 | 231 CONTINUE |
---|
380 | 232 CONTINUE |
---|
381 | C |
---|
382 | C |
---|
383 | C* DEFINE TOP OF 'envelope' layer |
---|
384 | C ---------------------------- |
---|
385 | |
---|
386 | DO 233 JL=kidia,kfdia |
---|
387 | pnu (jl)=0.0 |
---|
388 | znum(jl)=0.0 |
---|
389 | 233 CONTINUE |
---|
390 | |
---|
391 | DO 234 JK=2,KLEV-1 |
---|
392 | DO 234 JL=kidia,kfdia |
---|
393 | |
---|
394 | IF(KTEST(JL).EQ.1) THEN |
---|
395 | |
---|
396 | IF (JK.GE.KKNU2(JL)) THEN |
---|
397 | |
---|
398 | ZNUM(JL)=PNU(JL) |
---|
399 | ZWIND=(pulow(JL)*pum1(jl,jk)+pvlow(jl)*pvm1(jl,jk))/ |
---|
400 | * max(sqrt(pulow(jl)**2+pvlow(jl)**2),gvsec) |
---|
401 | ZWIND=max(sqrt(zwind**2),gvsec) |
---|
402 | ZDELP=PAPHM1(JL,JK+1)-PAPHM1(JL,JK) |
---|
403 | ZSTABM=SQRT(MAX(PSTAB(JL,JK ),GSSEC)) |
---|
404 | ZSTABP=SQRT(MAX(PSTAB(JL,JK+1),GSSEC)) |
---|
405 | ZRHOM=PRHO(JL,JK ) |
---|
406 | ZRHOP=PRHO(JL,JK+1) |
---|
407 | PNU(JL) = PNU(JL) + (ZDELP/g)* |
---|
408 | * ((zstabp/zrhop+zstabm/zrhom)/2.)/ZWIND |
---|
409 | IF((ZNUM(JL).LE.GFRCRIT).AND.(PNU(JL).GT.GFRCRIT) |
---|
410 | * .AND.(KKENVH(JL).EQ.KLEV)) |
---|
411 | * KKENVH(JL)=JK |
---|
412 | |
---|
413 | ENDIF |
---|
414 | |
---|
415 | ENDIF |
---|
416 | |
---|
417 | 234 CONTINUE |
---|
418 | |
---|
419 | C CALCULATION OF A DYNAMICAL MIXING HEIGHT FOR THE BREAKING |
---|
420 | C OF GRAVITY WAVES: |
---|
421 | |
---|
422 | |
---|
423 | DO 235 JL=kidia,kfdia |
---|
424 | znup(jl)=0.0 |
---|
425 | znum(jl)=0.0 |
---|
426 | 235 CONTINUE |
---|
427 | |
---|
428 | DO 236 JK=KLEV-1,2,-1 |
---|
429 | DO 236 JL=kidia,kfdia |
---|
430 | |
---|
431 | IF(KTEST(JL).EQ.1) THEN |
---|
432 | |
---|
433 | IF (JK.LT.KKENVH(JL)) THEN |
---|
434 | |
---|
435 | ZNUM(JL)=ZNUP(JL) |
---|
436 | ZWIND=(pulow(JL)*pum1(jl,jk)+pvlow(jl)*pvm1(jl,jk))/ |
---|
437 | * max(sqrt(pulow(jl)**2+pvlow(jl)**2),gvsec) |
---|
438 | ZWIND=max(sqrt(zwind**2),gvsec) |
---|
439 | ZDELP=PAPHM1(JL,JK+1)-PAPHM1(JL,JK) |
---|
440 | ZSTABM=SQRT(MAX(PSTAB(JL,JK ),GSSEC)) |
---|
441 | ZSTABP=SQRT(MAX(PSTAB(JL,JK+1),GSSEC)) |
---|
442 | ZRHOM=PRHO(JL,JK ) |
---|
443 | ZRHOP=PRHO(JL,JK+1) |
---|
444 | ZNUP(JL) = ZNUP(JL) + (ZDELP/g)* |
---|
445 | * ((zstabp/zrhop+zstabm/zrhom)/2.)/ZWIND |
---|
446 | IF((ZNUM(JL).LE.1.5).AND.(ZNUP(JL).GT.1.5) |
---|
447 | * .AND.(KKCRITH(JL).EQ.KLEV)) |
---|
448 | * KKCRITH(JL)=JK |
---|
449 | |
---|
450 | ENDIF |
---|
451 | |
---|
452 | ENDIF |
---|
453 | |
---|
454 | 236 CONTINUE |
---|
455 | |
---|
456 | DO 237 JL=KIDIA,KFDIA |
---|
457 | KKCRITH(JL)=MIN0(KKCRITH(JL),KKNU(JL)) |
---|
458 | 237 CONTINUE |
---|
459 | c |
---|
460 | c directional info for flow blocking ************************* |
---|
461 | c |
---|
462 | do 251 jk=ilevh,klev |
---|
463 | DO 252 JL=kidia,kfdia |
---|
464 | IF(jk.ge.kkenvh(jl)) THEN |
---|
465 | LO=(PUm1(JL,jk).LT.GVSEC).AND.(PUm1(JL,jk).GE.-GVSEC) |
---|
466 | IF(LO) THEN |
---|
467 | ZU=PUm1(JL,jk)+2.*GVSEC |
---|
468 | ELSE |
---|
469 | ZU=PUm1(JL,jk) |
---|
470 | ENDIF |
---|
471 | Zphi=ATAN(PVm1(JL,jk)/ZU) |
---|
472 | ppsi(jl,jk)=ptheta(jl)*pi/180.-zphi |
---|
473 | end if |
---|
474 | 252 continue |
---|
475 | 251 CONTINUE |
---|
476 | c forms the vertical 'leakiness' ************************** |
---|
477 | |
---|
478 | alpha=3. |
---|
479 | |
---|
480 | DO 254 JK=ilevh,klev |
---|
481 | DO 253 JL=kidia,kfdia |
---|
482 | IF(jk.ge.kkenvh(jl)) THEN |
---|
483 | zggeenv=AMAX1(1., |
---|
484 | * (pgeom1(jl,kkenvh(jl))+pgeom1(jl,kkenvh(jl)-1))/2.) |
---|
485 | zggeom1=AMAX1(pgeom1(jl,jk),1.) |
---|
486 | zgvar=amax1(pvaror(jl)*g,1.) |
---|
487 | pzdep(jl,jk)=SQRT((zggeenv-zggeom1)/(zggeom1+zgvar)) |
---|
488 | end if |
---|
489 | 253 CONTINUE |
---|
490 | 254 CONTINUE |
---|
491 | |
---|
492 | 260 CONTINUE |
---|
493 | |
---|
494 | RETURN |
---|
495 | END |
---|