LMDZ
acama_gwd_rando_m.F90
Go to the documentation of this file.
2 
3  implicit none
4 
5 contains
6 
7  SUBROUTINE acama_gwd_rando(DTIME, pp, plat, tt, uu, vv, rot, &
8  zustr, zvstr, d_u, d_v,east_gwstress,west_gwstress)
9 
10  ! Parametrization of the momentum flux deposition due to a discrete
11  ! number of gravity waves.
12  ! Author: F. Lott, A. de la Camara
13  ! July, 24th, 2014
14  ! Gaussian distribution of the source, source is vorticity squared
15  ! Reference: de la Camara and Lott (GRL, 2015, vol 42, 2071-2078 )
16  ! Lott et al (JAS, 2010, vol 67, page 157-170)
17  ! Lott et al (JAS, 2012, vol 69, page 2134-2151)
18 
19 ! ONLINE:
20  use dimphy, only: klon, klev
21  use assert_m, only: assert
22  include "YOMCST.h"
23  include "clesphys.h"
24 ! OFFLINE:
25 ! include "dimensions.h"
26 ! include "dimphy.h"
27 !END DIFFERENCE
28  include "YOEGWD.h"
29 
30  ! 0. DECLARATIONS:
31 
32  ! 0.1 INPUTS
33  REAL, intent(in)::DTIME ! Time step of the Physics
34  REAL, intent(in):: PP(:, :) ! (KLON, KLEV) Pressure at full levels
35  REAL, intent(in):: ROT(:,:) ! Relative vorticity
36  REAL, intent(in):: TT(:, :) ! (KLON, KLEV) Temp at full levels
37  REAL, intent(in):: UU(:, :) ! (KLON, KLEV) Zonal wind at full levels
38  REAL, intent(in):: VV(:, :) ! (KLON, KLEV) Merid wind at full levels
39  REAL, intent(in):: PLAT(:) ! (KLON) LATITUDE
40 
41  ! 0.2 OUTPUTS
42  REAL, intent(out):: zustr(:), zvstr(:) ! (KLON) Surface Stresses
43 
44  REAL, intent(inout):: d_u(:, :), d_v(:, :)
45  REAL, intent(inout):: east_gwstress(:, :) ! Profile of eastward stress
46  REAL, intent(inout):: west_gwstress(:, :) ! Profile of westward stress
47  ! (KLON, KLEV) tendencies on winds
48 
49  ! O.3 INTERNAL ARRAYS
50  REAL BVLOW(klon) ! LOW LEVEL BV FREQUENCY
51  REAL ROTBA(klon),CORIO(klon) ! BAROTROPIC REL. VORTICITY AND PLANETARY
52  REAL UZ(klon, klev + 1)
53 
54  INTEGER II, JJ, LL
55 
56  ! 0.3.0 TIME SCALE OF THE LIFE CYCLE OF THE WAVES PARAMETERIZED
57 
58  REAL DELTAT
59 
60  ! 0.3.1 GRAVITY-WAVES SPECIFICATIONS
61 
62  INTEGER, PARAMETER:: NK = 2, np = 2, no = 2, nw = nk * np * no
63  INTEGER JK, JP, JO, JW
64  INTEGER, PARAMETER:: NA = 5 !number of realizations to get the phase speed
65  REAL KMIN, KMAX ! Min and Max horizontal wavenumbers
66  REAL CMIN, CMAX ! Min and Max absolute ph. vel.
67  REAL CPHA ! absolute PHASE VELOCITY frequency
68  REAL ZK(nw, klon) ! Horizontal wavenumber amplitude
69  REAL ZP(nw, klon) ! Horizontal wavenumber angle
70  REAL ZO(nw, klon) ! Absolute frequency !
71 
72  ! Waves Intr. freq. at the 1/2 lev surrounding the full level
73  REAL ZOM(nw, klon), ZOP(nw, klon)
74 
75  ! Wave EP-fluxes at the 2 semi levels surrounding the full level
76  REAL WWM(nw, klon), WWP(nw, klon)
77 
78  REAL RUW0(nw, klon) ! Fluxes at launching level
79 
80  REAL RUWP(nw, klon), RVWP(nw, klon)
81  ! Fluxes X and Y for each waves at 1/2 Levels
82 
83  INTEGER LAUNCH, LTROP ! Launching altitude and tropo altitude
84 
85  REAL XLAUNCH ! Controle the launching altitude
86  REAL XTROP ! SORT of Tropopause altitude
87  REAL RUW(klon, klev + 1) ! Flux x at semi levels
88  REAL RVW(klon, klev + 1) ! Flux y at semi levels
89 
90  REAL PRMAX ! Maximum value of PREC, and for which our linear formula
91  ! for GWs parameterisation apply
92 
93  ! 0.3.2 PARAMETERS OF WAVES DISSIPATIONS
94 
95  REAL RDISS, ZOISEC ! COEFF DE DISSIPATION, SECURITY FOR INTRINSIC FREQ
96  REAL CORSEC ! SECURITY FOR INTRINSIC CORIOLIS
97  REAL RUWFRT,SATFRT
98 
99  ! 0.3.3 BACKGROUND FLOW AT 1/2 LEVELS AND VERTICAL COORDINATE
100 
101  REAL H0 ! Characteristic Height of the atmosphere
102  REAL DZ ! Characteristic depth of the source!
103  REAL PR, TR ! Reference Pressure and Temperature
104 
105  REAL ZH(klon, klev + 1) ! Log-pressure altitude
106 
107  REAL UH(klon, klev + 1), VH(klon, klev + 1) ! Winds at 1/2 levels
108  REAL PH(klon, klev + 1) ! Pressure at 1/2 levels
109  REAL PSEC ! Security to avoid division by 0 pressure
110  REAL PHM1(klon, klev + 1) ! 1/Press at 1/2 levels
111  REAL BV(klon, klev + 1) ! Brunt Vaisala freq. (BVF) at 1/2 levels
112  REAL BVSEC ! Security to avoid negative BVF
113 
114  !-----------------------------------------------------------------
115 
116  ! 1. INITIALISATIONS
117 
118  ! 1.1 Basic parameter
119 
120  ! Are provided from elsewhere (latent heat of vaporization, dry
121  ! gaz constant for air, gravity constant, heat capacity of dry air
122  ! at constant pressure, earth rotation rate, pi).
123 
124  ! 1.2 Tuning parameters of V14
125 
126 ! Values for linear in rot (recommended):
127 ! RUWFRT=0.005 ! As RUWMAX but for frontal waves
128 ! SATFRT=1.00 ! As SAT but for frontal waves
129 ! Values when rot^2 is used
130 ! RUWFRT=0.02 ! As RUWMAX but for frontal waves
131 ! SATFRT=1.00 ! As SAT but for frontal waves
132 ! CMAX = 30. ! Characteristic phase speed
133 ! Values when rot^2*EXP(-pi*sqrt(J)) is used
134 ! RUWFRT=2.5 ! As RUWMAX but for frontal waves ~ N0*F0/4*DZ
135 ! SATFRT=0.60 ! As SAT but for frontal waves
136  ruwfrt=gwd_front_ruwmax
137  satfrt=gwd_front_sat
138  cmax = 40. ! Characteristic phase speed
139 ! Phase speed test
140 ! RUWFRT=0.01
141 ! CMAX = 50. ! Characteristic phase speed (TEST)
142 ! Values when rot^2 and exp(-m^2*dz^2) are used
143 ! RUWFRT=0.03 ! As RUWMAX but for frontal waves
144 ! SATFRT=1.00 ! As SAT but for frontal waves
145 ! CRUCIAL PARAMETERS FOR THE WIND FILTERING
146  xlaunch=0.95 ! Parameter that control launching altitude
147  rdiss = 1 ! Diffusion parameter
148 
149  ! maximum of rain for which our theory applies (in kg/m^2/s)
150 
151  dz = 1000. ! Characteristic depth of the source
152  xtrop=0.2 ! Parameter that control tropopause altitude
153  deltat=24.*3600. ! Time scale of the waves (first introduced in 9b)
154 ! DELTAT=DTIME ! No AR-1 Accumulation, OR OFFLINE
155 
156  kmin = 2.e-5
157  ! minimum horizontal wavenumber (inverse of the subgrid scale resolution)
158 
159  kmax = 1.e-3 ! Max horizontal wavenumber
160  cmin = 1. ! Min phase velocity
161 
162  tr = 240. ! Reference Temperature
163  pr = 101300. ! Reference pressure
164  h0 = rd * tr / rg ! Characteristic vertical scale height
165 
166  bvsec = 5.e-3 ! Security to avoid negative BVF
167  psec = 1.e-6 ! Security to avoid division by 0 pressure
168  zoisec = 1.e-6 ! Security FOR 0 INTRINSIC FREQ
169  corsec = romega*2.*sin(2.*rpi/180.)! Security for CORIO
170 
171 ! ONLINE
172  call assert(klon == (/size(pp, 1), size(tt, 1), size(uu, 1), &
173  size(vv, 1), size(rot,1), size(zustr), size(zvstr), size(d_u, 1), &
174  size(d_v, 1), &
175  size(east_gwstress,1), size(west_gwstress,1) /), &
176  "ACAMA_GWD_RANDO klon")
177  call assert(klev == (/size(pp, 2), size(tt, 2), size(uu, 2), &
178  size(vv, 2), size(d_u, 2), size(d_v, 2), &
179  size(east_gwstress,2), size(west_gwstress,2) /), &
180  "ACAMA_GWD_RANDO klev")
181 ! END ONLINE
182 
183  IF(deltat < dtime)THEN
184  print *, 'flott_gwd_rando: deltat < dtime!'
185  stop 1
186  ENDIF
187 
188  IF (klev < nw) THEN
189  print *, 'flott_gwd_rando: you will have problem with random numbers'
190  stop 1
191  ENDIF
192 
193  ! 2. EVALUATION OF THE BACKGROUND FLOW AT SEMI-LEVELS
194 
195  ! Pressure and Inv of pressure
196  DO ll = 2, klev
197  ph(:, ll) = exp((log(pp(:, ll)) + log(pp(:, ll - 1))) / 2.)
198  phm1(:, ll) = 1. / ph(:, ll)
199  end DO
200 
201  ph(:, klev + 1) = 0.
202  phm1(:, klev + 1) = 1. / psec
203  ph(:, 1) = 2. * pp(:, 1) - ph(:, 2)
204 
205  ! Launching altitude
206 
207  launch=0
208  ltrop =0
209  DO ll = 1, klev
210  IF (ph(klon / 2, ll) / ph(klon / 2, 1) > xlaunch) launch = ll
211  ENDDO
212  DO ll = 1, klev
213  IF (ph(klon / 2, ll) / ph(klon / 2, 1) > xtrop) ltrop = ll
214  ENDDO
215 
216 ! PRINT *,'LAUNCH IN ACAMARA:',LAUNCH
217 
218  ! Log pressure vert. coordinate
219  DO ll = 1, klev + 1
220  zh(:, ll) = h0 * log(pr / (ph(:, ll) + psec))
221  end DO
222 
223  ! BV frequency
224  DO ll = 2, klev
225  ! BVSEC: BV Frequency (UH USED IS AS A TEMPORARY ARRAY DOWN TO WINDS)
226  uh(:, ll) = 0.5 * (tt(:, ll) + tt(:, ll - 1)) &
227  * rd**2 / rcpd / h0**2 + (tt(:, ll) &
228  - tt(:, ll - 1)) / (zh(:, ll) - zh(:, ll - 1)) * rd / h0
229  end DO
230  bvlow = 0.5 * (tt(:, ltrop )+ tt(:, launch)) &
231  * rd**2 / rcpd / h0**2 + (tt(:, ltrop ) &
232  - tt(:, launch))/(zh(:, ltrop )- zh(:, launch)) * rd / h0
233 
234  uh(:, 1) = uh(:, 2)
235  uh(:, klev + 1) = uh(:, klev)
236  bv(:, 1) = uh(:, 2)
237  bv(:, klev + 1) = uh(:, klev)
238  ! SMOOTHING THE BV HELPS
239  DO ll = 2, klev
240  bv(:, ll)=(uh(:, ll+1)+2.*uh(:, ll)+uh(:, ll-1))/4.
241  end DO
242 
243  bv=max(sqrt(max(bv, 0.)), bvsec)
244  bvlow=max(sqrt(max(bvlow, 0.)), bvsec)
245 
246  ! WINDS
247  DO ll = 2, klev
248  uh(:, ll) = 0.5 * (uu(:, ll) + uu(:, ll - 1)) ! Zonal wind
249  vh(:, ll) = 0.5 * (vv(:, ll) + vv(:, ll - 1)) ! Meridional wind
250  uz(:, ll) = abs((sqrt(uu(:, ll)**2+vv(:, ll)**2) &
251  - sqrt(uu(:,ll-1)**2+vv(:, ll-1)**2)) &
252  /(zh(:, ll)-zh(:, ll-1)) )
253  end DO
254  uh(:, 1) = 0.
255  vh(:, 1) = 0.
256  uh(:, klev + 1) = uu(:, klev)
257  vh(:, klev + 1) = vv(:, klev)
258 
259  uz(:, 1) = uz(:, 2)
260  uz(:, klev + 1) = uz(:, klev)
261  uz(:, :) = max(uz(:,:), psec)
262 
263  ! BAROTROPIC VORTICITY AND INTEGRATED CORIOLIS PARAMETER
264 
265  corio(:) = max(romega*2.*abs(sin(plat(:)*rpi/180.)),corsec)
266  rotba(:)=0.
267  DO ll = 1,klev-1
268  !ROTBA(:) = ROTBA(:) + (ROT(:,LL)+ROT(:,LL+1))/2./RG*(PP(:,LL)-PP(:,LL+1))
269  ! Introducing the complete formula (exp of Richardson number):
270  rotba(:) = rotba(:) + &
271  !((ROT(:,LL)+ROT(:,LL+1))/2.)**2 &
272  (corio(:)*tanh(abs(rot(:,ll)+rot(:,ll+1))/2./corio(:)))**2 &
273  /rg*(pp(:,ll)-pp(:,ll+1)) &
274  * exp(-rpi*bv(:,ll+1)/uz(:,ll+1)) &
275 ! * DZ*BV(:,LL+1)/4./ABS(CORIO(:))
276  * dz*bv(:,ll+1)/4./1.e-4 ! Changes after 1991
277 !ARRET
278  ENDDO
279  ! PRINT *,'MAX ROTBA:',MAXVAL(ROTBA)
280  ! ROTBA(:)=(1.*ROTBA(:) & ! Testing zone
281  ! +0.15*CORIO(:)**2 &
282  ! /(COS(PLAT(:)*RPI/180.)+0.02) &
283  ! )*DZ*0.01/0.0001/4. ! & ! Testing zone
284  ! MODIF GWD4 AFTER 1985
285  ! *(1.25+SIN(PLAT(:)*RPI/180.))/(1.05+SIN(PLAT(:)*RPI/180.))/1.25
286  ! *1./(COS(PLAT(:)*RPI/180.)+0.02)
287  ! CORIO(:) = MAX(ROMEGA*2.*ABS(SIN(PLAT(:)*RPI/180.)),ZOISEC)/RG*PP(:,1)
288 
289  ! 3 WAVES CHARACTERISTICS CHOSEN RANDOMLY AT THE LAUNCH ALTITUDE
290 
291  ! The mod functions of weird arguments are used to produce the
292  ! waves characteristics in an almost stochastic way
293 
294  jw = 0
295  DO jp = 1, np
296  DO jk = 1, nk
297  DO jo = 1, no
298  jw = jw + 1
299  ! Angle
300  DO ii = 1, klon
301  ! Angle (0 or PI so far)
302  ! ZP(JW, II) = (SIGN(1., 0.5 - MOD(TT(II, JW) * 10., 1.)) + 1.) &
303  ! * RPI / 2.
304  ! Angle between 0 and pi
305  zp(jw, ii) = mod(tt(ii, jw) * 10., 1.) * rpi
306 ! TEST WITH POSITIVE WAVES ONLY (Part I/II)
307 ! ZP(JW, II) = 0.
308  ! Horizontal wavenumber amplitude
309  zk(jw, ii) = kmin + (kmax - kmin) * mod(tt(ii, jw) * 100., 1.)
310  ! Horizontal phase speed
311  cpha = 0.
312  DO jj = 1, na
313  cpha = cpha + &
314  cmax*2.*(mod(tt(ii, jw+4*(jj-1)+jj)**2, 1.)-0.5)*sqrt(3.)/sqrt(na*1.)
315  END DO
316  IF (cpha.LT.0.) THEN
317  cpha = -1.*cpha
318  zp(jw,ii) = zp(jw,ii) + rpi
319 ! TEST WITH POSITIVE WAVES ONLY (Part II/II)
320 ! ZP(JW, II) = 0.
321  ENDIF
322  cpha = cpha + cmin !we dont allow |c|<1m/s
323  ! Absolute frequency is imposed
324  zo(jw, ii) = cpha * zk(jw, ii)
325  ! Intrinsic frequency is imposed
326  zo(jw, ii) = zo(jw, ii) &
327  + zk(jw, ii) * cos(zp(jw, ii)) * uh(ii, launch) &
328  + zk(jw, ii) * sin(zp(jw, ii)) * vh(ii, launch)
329  ! Momentum flux at launch lev
330  ! LAUNCHED RANDOM WAVES WITH LOG-NORMAL AMPLITUDE
331  ! RIGHT IN THE SH (GWD4 after 1990)
332  ruw0(jw, ii) = 0.
333  DO jj = 1, na
334  ruw0(jw, ii) = ruw0(jw,ii) + &
335  2.*(mod(tt(ii, jw+4*(jj-1)+jj)**2, 1.)-0.5)*sqrt(3.)/sqrt(na*1.)
336  END DO
337  ruw0(jw, ii) = ruwfrt &
338  * exp(ruw0(jw,ii))/1250. & ! 2 mpa at south pole
339  *((1.05+sin(plat(ii)*rpi/180.))/(1.01+sin(plat(ii)*rpi/180.))-2.05/2.01)
340  ! RUW0(JW, II) = RUWFRT
341  ENDDO
342  end DO
343  end DO
344  end DO
345 
346  ! 4. COMPUTE THE FLUXES
347 
348  ! 4.0
349 
350  ! 4.1 Vertical velocity at launching altitude to ensure
351  ! the correct value to the imposed fluxes.
352 
353  DO jw = 1, nw
354 
355  ! Evaluate intrinsic frequency at launching altitude:
356  zop(jw, :) = zo(jw, :) &
357  - zk(jw, :) * cos(zp(jw, :)) * uh(:, launch) &
358  - zk(jw, :) * sin(zp(jw, :)) * vh(:, launch)
359 
360  ! VERSION WITH FRONTAL SOURCES
361 
362  ! Momentum flux at launch level imposed by vorticity sources
363 
364  ! tanh limitation for values above CORIO (inertial instability).
365  ! WWP(JW, :) = RUW0(JW, :) &
366  wwp(jw, :) = ruwfrt &
367  ! * (CORIO(:)*TANH(ROTBA(:)/CORIO(:)))**2 &
368  ! * ABS((CORIO(:)*TANH(ROTBA(:)/CORIO(:)))*CORIO(:)) &
369  ! CONSTANT FLUX
370  ! * (CORIO(:)*CORIO(:)) &
371  ! MODERATION BY THE DEPTH OF THE SOURCE (DZ HERE)
372  ! *EXP(-BVLOW(:)**2/MAX(ABS(ZOP(JW, :)),ZOISEC)**2 &
373  ! *ZK(JW, :)**2*DZ**2) &
374  ! COMPLETE FORMULA:
375  !* CORIO(:)**2*TANH(ROTBA(:)/CORIO(:)**2) &
376  * rotba(:) &
377  ! RESTORE DIMENSION OF A FLUX
378  ! *RD*TR/PR
379  *1. + ruw0(jw, :)
380 
381  ! Factor related to the characteristics of the waves: NONE
382 
383  ! Moderation by the depth of the source (dz here): NONE
384 
385  ! Put the stress in the right direction:
386 
387  ruwp(jw, :) = sign(1., zop(jw, :))*cos(zp(jw, :)) * wwp(jw, :)
388  rvwp(jw, :) = sign(1., zop(jw, :))*sin(zp(jw, :)) * wwp(jw, :)
389 
390  end DO
391 
392  ! 4.2 Uniform values below the launching altitude
393 
394  DO ll = 1, launch
395  ruw(:, ll) = 0
396  rvw(:, ll) = 0
397  DO jw = 1, nw
398  ruw(:, ll) = ruw(:, ll) + ruwp(jw, :)
399  rvw(:, ll) = rvw(:, ll) + rvwp(jw, :)
400  end DO
401  end DO
402 
403  ! 4.3 Loop over altitudes, with passage from one level to the next
404  ! done by i) conserving the EP flux, ii) dissipating a little,
405  ! iii) testing critical levels, and vi) testing the breaking.
406 
407  DO ll = launch, klev - 1
408  ! Warning: all the physics is here (passage from one level
409  ! to the next)
410  DO jw = 1, nw
411  zom(jw, :) = zop(jw, :)
412  wwm(jw, :) = wwp(jw, :)
413  ! Intrinsic Frequency
414  zop(jw, :) = zo(jw, :) - zk(jw, :) * cos(zp(jw, :)) * uh(:, ll + 1) &
415  - zk(jw, :) * sin(zp(jw, :)) * vh(:, ll + 1)
416 
417  ! No breaking (Eq.6)
418  ! Dissipation (Eq. 8)
419  wwp(jw, :) = wwm(jw, :) * exp(- 2. * rdiss * pr / (ph(:, ll + 1) &
420  + ph(:, ll)) * ((bv(:, ll + 1) + bv(:, ll)) / 2.)**3 &
421  / max(abs(zop(jw, :) + zom(jw, :)) / 2., zoisec)**4 &
422  * zk(jw, :)**3 * (zh(:, ll + 1) - zh(:, ll)))
423 
424  ! Critical levels (forced to zero if intrinsic frequency changes sign)
425  ! Saturation (Eq. 12)
426  wwp(jw, :) = min(wwp(jw, :), max(0., &
427  sign(1., zop(jw, :) * zom(jw, :))) * abs(zop(jw, :))**3 &
428  ! / BV(:, LL + 1) * EXP(- ZH(:, LL + 1) / H0) * SATFRT**2 * KMIN**2 &
429  / bv(:, ll + 1) * exp(- zh(:, ll + 1) / h0) * kmin**2 &
430 ! *(SATFRT*(2.5+1.5*TANH((ZH(:,LL+1)/H0-8.)/2.)))**2 &
431  *satfrt**2 &
432  / zk(jw, :)**4)
433  end DO
434 
435  ! Evaluate EP-flux from Eq. 7 and give the right orientation to
436  ! the stress
437 
438  DO jw = 1, nw
439  ruwp(jw, :) = sign(1., zop(jw, :))*cos(zp(jw, :)) * wwp(jw, :)
440  rvwp(jw, :) = sign(1., zop(jw, :))*sin(zp(jw, :)) * wwp(jw, :)
441  end DO
442 
443  ruw(:, ll + 1) = 0.
444  rvw(:, ll + 1) = 0.
445 
446  DO jw = 1, nw
447  ruw(:, ll + 1) = ruw(:, ll + 1) + ruwp(jw, :)
448  rvw(:, ll + 1) = rvw(:, ll + 1) + rvwp(jw, :)
449  east_gwstress(:, ll)=east_gwstress(:, ll)+max(0.,ruwp(jw,:))/float(nw)
450  west_gwstress(:, ll)=west_gwstress(:, ll)+min(0.,ruwp(jw,:))/float(nw)
451  end DO
452  end DO
453 
454  ! 5 CALCUL DES TENDANCES:
455 
456  ! 5.1 Rectification des flux au sommet et dans les basses couches
457 
458  ruw(:, klev + 1) = 0.
459  rvw(:, klev + 1) = 0.
460  ruw(:, 1) = ruw(:, launch)
461  rvw(:, 1) = rvw(:, launch)
462  DO ll = 1, launch
463  ruw(:, ll) = ruw(:, launch+1)
464  rvw(:, ll) = rvw(:, launch+1)
465  east_gwstress(:, ll)=east_gwstress(:, launch)
466  west_gwstress(:, ll)=west_gwstress(:, launch)
467  end DO
468 
469  ! AR-1 RECURSIVE FORMULA (13) IN VERSION 4
470  DO ll = 1, klev
471  d_u(:, ll) = (1.-dtime/deltat) * d_u(:, ll) + dtime/deltat/REAL(NW) * &
472  RG * (ruw(:, ll + 1) - ruw(:, ll)) &
473  / (ph(:, ll + 1) - ph(:, ll)) * DTIME
474 ! NO AR1 FOR MERIDIONAL TENDENCIES
475 ! D_V(:, LL) = (1.-DTIME/DELTAT) * D_V(:, LL) + DTIME/DELTAT/REAL(NW) * &
476  d_v(:, ll) = 1./REAL(NW) * &
477  RG * (rvw(:, ll + 1) - rvw(:, ll)) &
478  / (ph(:, ll + 1) - ph(:, ll)) * DTIME
479  ENDDO
480 
481  ! Cosmetic: evaluation of the cumulated stress
482  zustr = 0.
483  zvstr = 0.
484  DO ll = 1, klev
485  zustr = zustr + d_u(:, ll) / rg * (ph(:, ll + 1) - ph(:, ll))/dtime
486 ! ZVSTR = ZVSTR + D_V(:, LL) / RG * (PH(:, LL + 1) - PH(:, LL))/DTIME
487  ENDDO
488 ! COSMETICS TO VISUALIZE ROTBA
489  zvstr = rotba
490 
491  END SUBROUTINE acama_gwd_rando
492 
493 end module acama_gwd_rando_m
integer, save klon
Definition: dimphy.F90:3
integer, save klev
Definition: dimphy.F90:7
subroutine acama_gwd_rando(DTIME, pp, plat, tt, uu, vv, rot, zustr, zvstr, d_u, d_v, east_gwstress, west_gwstress)
Definition: dimphy.F90:1
real rg
Definition: comcstphy.h:1