1 !WRF:model_layer:physics
6 module a_module_bl_gwdo
9 ! Generated by TAPENADE (INRIA, Tropics team)
10 ! Tapenade 3.10 (r5498) - 20 Jan 2015 09:48
12 ! Differentiation of gwdo in reverse (adjoint) mode:
13 ! gradient of useful results: rublten p3di u3d dusfcg z dvsfcg
14 ! dtauy3d rvblten t3d qv3d pi3d v3d dtaux3d
15 ! with respect to varying inputs: rublten p3di u3d dusfcg z dvsfcg
16 ! dtauy3d rvblten t3d qv3d pi3d v3d dtaux3d
17 ! RW status of diff variables: rublten:in-out p3di:incr u3d:incr
18 ! dusfcg:in-out z:incr dvsfcg:in-out dtauy3d:in-out
19 ! rvblten:in-out t3d:incr qv3d:incr pi3d:incr v3d:incr
21 !-------------------------------------------------------------------------------
22 SUBROUTINE GWDO_B(u3d, u3db, v3d, v3db, t3d, t3db, qv3d, qv3db, p3d, &
23 & p3di, p3dib, pi3d, pi3db, z, zb, rublten, rubltenb, rvblten, rvbltenb&
24 & , dtaux3d, dtaux3db, dtauy3d, dtauy3db, dusfcg, dusfcgb, dvsfcg, &
25 & dvsfcgb, var2d, oc12d, oa2d1, oa2d2, oa2d3, oa2d4, ol2d1, ol2d2, ol2d3&
26 & , ol2d4, znu, znw, p_top, cp, g, rd, rv, ep1, pi, dt, dx, &
27 & kpbl2d, itimestep, ids, ide, jds, jde, kds, kde, ims, ime, jms, jme, &
28 & kms, kme, its, ite, jts, jte, kts, kte)
31 !-------------------------------------------------------------------------------
33 !-- u3d 3d u-velocity interpolated to theta points (m/s)
34 !-- v3d 3d v-velocity interpolated to theta points (m/s)
35 !-- t3d temperature (k)
36 !-- qv3d 3d water vapor mixing ratio (kg/kg)
37 !-- p3d 3d pressure (pa)
38 !-- p3di 3d pressure (pa) at interface level
39 !-- pi3d 3d exner function (dimensionless)
40 !-- rublten u tendency due to pbl parameterization (m/s/s)
41 !-- rvblten v tendency due to pbl parameterization (m/s/s)
42 !-- znu eta values (sigma values)
43 !-- cp heat capacity at constant pressure for dry air (j/kg/k)
44 !-- g acceleration due to gravity (m/s^2)
45 !-- rd gas constant for dry air (j/kg/k)
46 !-- z height above sea level (m)
47 !-- rv gas constant for water vapor (j/kg/k)
49 !-- dx model grid interval (m)
50 !-- ep1 constant for virtual temperature (r_v/r_d - 1) (dimensionless)
51 !-- ids start index for i in domain
52 !-- ide end index for i in domain
53 !-- jds start index for j in domain
54 !-- jde end index for j in domain
55 !-- kds start index for k in domain
56 !-- kde end index for k in domain
57 !-- ims start index for i in memory
58 !-- ime end index for i in memory
59 !-- jms start index for j in memory
60 !-- jme end index for j in memory
61 !-- kms start index for k in memory
62 !-- kme end index for k in memory
63 !-- its start index for i in tile
64 !-- ite end index for i in tile
65 !-- jts start index for j in tile
66 !-- jte end index for j in tile
67 !-- kts start index for k in tile
68 !-- kte end index for k in tile
70 !-------------------------------------------------------------------------------
71 INTEGER, INTENT(IN) :: ids, ide, jds, jde, kds, kde, ims, ime, jms, &
72 & jme, kms, kme, its, ite, jts, jte, kts, kte
73 INTEGER, INTENT(IN) :: itimestep
75 REAL, INTENT(IN) :: dt, dx, cp, g, rd, rv, ep1, pi
77 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN) :: qv3d, p3d, &
79 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: qv3db, pi3db, t3db, zb
80 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN) :: p3di
81 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: p3dib
83 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rublten, &
85 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rubltenb
86 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: dtaux3d, &
88 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: dtaux3db
90 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(IN) :: u3d, v3d
91 REAL, DIMENSION(ims:ime, kms:kme, jms:jme) :: u3db, v3db
93 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT(IN) :: kpbl2d
94 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: dusfcg, dvsfcg
95 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: dusfcgb
97 REAL, DIMENSION(ims:ime, jms:jme), INTENT(IN) :: var2d, oc12d, oa2d1, &
98 & oa2d2, oa2d3, oa2d4, ol2d1, ol2d2, ol2d3, ol2d4
100 REAL, DIMENSION(kms:kme), OPTIONAL, INTENT(IN) :: znu, znw
102 REAL, OPTIONAL, INTENT(IN) :: p_top
106 REAL, DIMENSION(its:ite, kts:kte) :: delprsi, pdh
107 REAL, DIMENSION(its:ite, kts:kte) :: delprsib, pdhb
108 REAL, DIMENSION(its:ite, kts:kte + 1) :: pdhi
109 REAL, DIMENSION(its:ite, kts:kte+1) :: pdhib
110 REAL, DIMENSION(its:ite, 4) :: oa4, ol4
111 INTEGER :: i, j, k, kdt, kpblmax
113 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: rvbltenb
114 REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT) :: dvsfcgb
115 REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT) :: dtauy3db
118 IF (znu(k) .GT. 0.6) kpblmax = k + 1
125 CALL PUSHREAL8(pdh(i, k))
126 pdh(i, k) = p3d(i, k, j)
127 CALL PUSHCONTROL1B(0)
129 CALL PUSHCONTROL1B(1)
131 CALL PUSHREAL8(pdhi(i, k))
132 pdhi(i, k) = p3di(i, k, j)
138 CALL PUSHREAL8(delprsi(i, k))
139 delprsi(i, k) = pdhi(i, k) - pdhi(i, k+1)
143 CALL PUSHREAL8(oa4(i, 1))
144 oa4(i, 1) = oa2d1(i, j)
145 CALL PUSHREAL8(oa4(i, 2))
146 oa4(i, 2) = oa2d2(i, j)
147 CALL PUSHREAL8(oa4(i, 3))
148 oa4(i, 3) = oa2d3(i, j)
149 CALL PUSHREAL8(oa4(i, 4))
150 oa4(i, 4) = oa2d4(i, j)
151 CALL PUSHREAL8(ol4(i, 1))
152 ol4(i, 1) = ol2d1(i, j)
153 CALL PUSHREAL8(ol4(i, 2))
154 ol4(i, 2) = ol2d2(i, j)
155 CALL PUSHREAL8(ol4(i, 3))
156 ol4(i, 3) = ol2d3(i, j)
157 CALL PUSHREAL8(ol4(i, 4))
158 ol4(i, 4) = ol2d4(i, j)
165 CALL GWDO2D_B(rublten(ims, kms, j), rubltenb(ims, kms, j), rvblten(&
166 & ims, kms, j), rvbltenb(ims, kms, j), dtaux3d(ims, kms, j), &
167 & dtaux3db(ims, kms, j), dtauy3d(ims, kms, j), dtauy3db(ims, &
168 & kms, j), u3d(ims, kms, j), u3db(ims, kms, j), v3d(ims, kms, &
169 & j), v3db(ims, kms, j), t3d(ims, kms, j), t3db(ims, kms, j), &
170 & qv3d(ims, kms, j), qv3db(ims, kms, j), delprsi(its, kts), &
171 & delprsib(its, kts), pdhi(its, kts), pdhib(its, kts), pdh(its&
172 & , kts), pdhb(its, kts), pi3d(ims, kms, j), pi3db(ims, kms, j&
173 & ), z(ims, kms, j), zb(ims, kms, j), rcl=1.0, kpblmax=kpblmax&
174 & , var=var2d(ims, j), oc1=oc12d(ims, j), oa4=oa4, ol4=ol4, &
175 & dusfc=dusfcg(ims, j), dusfcb=dusfcgb(ims, j), dvsfc=dvsfcg(&
176 & ims, j), dvsfcb=dvsfcgb(ims, j), g=g, cp=cp, rd=rd, rv=rv, &
177 & fv=ep1, pi=pi, dxmeter=dx, deltim=dt, kpbl=kpbl2d(ims, j), &
178 & kdt=itimestep, lat=j, ids=ids, ide=ide, jds=jds, jde=jde, &
179 & kds=kds, kde=kde, ims=ims, ime=ime, jms=jms, jme=jme, kms=&
180 & kms, kme=kme, its=its, ite=ite, jts=jts, jte=jte, kts=kts, &
183 CALL POPREAL8(ol4(i, 4))
184 CALL POPREAL8(ol4(i, 3))
185 CALL POPREAL8(ol4(i, 2))
186 CALL POPREAL8(ol4(i, 1))
187 CALL POPREAL8(oa4(i, 4))
188 CALL POPREAL8(oa4(i, 3))
189 CALL POPREAL8(oa4(i, 2))
190 CALL POPREAL8(oa4(i, 1))
194 CALL POPREAL8(delprsi(i, k))
195 pdhib(i, k) = pdhib(i, k) + delprsib(i, k)
196 pdhib(i, k+1) = pdhib(i, k+1) - delprsib(i, k)
202 CALL POPREAL8(pdhi(i, k))
203 p3dib(i, k, j) = p3dib(i, k, j) + pdhib(i, k)
205 CALL POPCONTROL1B(branch)
206 IF (branch .EQ. 0) THEN
207 CALL POPREAL8(pdh(i, k))
213 END SUBROUTINE GWDO_B
215 ! Differentiation of gwdo2d in reverse (adjoint) mode:
216 ! gradient of useful results: v1 dvsfc dvdt dtauy2d prsi
217 ! prsl dusfc del t1 q1 dudt dtaux2d u1 zl prslk
218 ! with respect to varying inputs: v1 dvsfc dvdt dtauy2d prsi
219 ! prsl dusfc del t1 q1 dudt dtaux2d u1 zl prslk
220 !-------------------------------------------------------------------------------
222 !-------------------------------------------------------------------------------
223 SUBROUTINE GWDO2D_B(dudt, dudtb, dvdt, dvdtb, dtaux2d, dtaux2db, dtauy2d&
224 & , dtauy2db, u1, u1b, v1, v1b, t1, t1b, q1, q1b, del, delb, prsi, prsib&
225 & , prsl, prslb, prslk, prslkb, zl, zlb, rcl, kpblmax, var, oc1, oa4, &
226 & ol4, dusfc, dusfcb, dvsfc, dvsfcb, g, cp, rd, rv, fv, pi, dxmeter, &
227 & deltim, kpbl, kdt, lat, ids, ide, jds, jde, kds, kde, ims, ime, jms, &
228 & jme, kms, kme, its, ite, jts, jte, kts, kte)
230 !-------------------------------------------------------------------------------
231 INTEGER :: kdt, lat, latd, lond, kpblmax, ids, ide, jds, jde, kds, kde&
232 & , ims, ime, jms, jme, kms, kme, its, ite, jts, jte, kts, kte
234 REAL :: g, rd, rv, fv, cp, pi, dxmeter, deltim, rcl
235 REAL :: dudt(ims:ime, kms:kme), dvdt(ims:ime, kms:kme), dtaux2d(ims:&
236 & ime, kms:kme), dtauy2d(ims:ime, kms:kme), u1(ims:ime, kms:kme), v1(ims&
237 & :ime, kms:kme), t1(ims:ime, kms:kme), q1(ims:ime, kms:kme), zl(ims:ime&
238 & , kms:kme), prsl(its:ite, kts:kte), prslk(ims:ime, kms:kme)
239 REAL :: dudtb(ims:ime, kms:kme), dvdtb(ims:ime, kms:kme), dtaux2db(ims&
240 & :ime, kms:kme), dtauy2db(ims:ime, kms:kme), u1b(ims:ime, kms:kme), v1b&
241 & (ims:ime, kms:kme), t1b(ims:ime, kms:kme), q1b(ims:ime, kms:kme), zlb(&
242 & ims:ime, kms:kme), prslb(its:ite, kts:kte), prslkb(ims:ime, kms:kme)
243 REAL :: prsi(its:ite, kts:kte+1), del(its:ite, kts:kte)
244 REAL :: prsib(its:ite, kts:kte+1), delb(its:ite, kts:kte)
245 REAL :: oa4(its:ite, 4), ol4(its:ite, 4)
247 INTEGER :: kpbl(ims:ime)
248 REAL :: var(ims:ime), oc1(ims:ime), dusfc(ims:ime), dvsfc(ims:ime)
249 REAL :: dusfcb(ims:ime), dvsfcb(ims:ime)
251 ! critical richardson number for wave breaking : ! larger drag with larger value
253 REAL, PARAMETER :: ric=0.25
255 REAL, PARAMETER :: dw2min=1.
256 REAL, PARAMETER :: rimin=-100.
257 REAL, PARAMETER :: bnv2min=1.0e-5
258 REAL, PARAMETER :: efmin=0.0
259 REAL, PARAMETER :: efmax=10.0
260 REAL, PARAMETER :: xl=4.0e4
261 REAL, PARAMETER :: critac=1.0e-5
262 REAL, PARAMETER :: gmax=1.
263 REAL, PARAMETER :: veleps=1.0
264 REAL, PARAMETER :: factop=0.5
265 REAL, PARAMETER :: frc=1.0
266 REAL, PARAMETER :: ce=0.8
267 REAL, PARAMETER :: cg=0.5
268 INTEGER, PARAMETER :: kpblmin=2
272 INTEGER :: i, k, lcap, lcapp1, nwd, idir, klcap, kp1, ikount, kk
274 REAL :: rcs, rclcs, csg, fdir, cleff, cs, rcsks, wdir, ti, rdz, temp, &
275 & tem2, dw2, shr2, bvf2, rdelks, wtkbj, tem, gfobnv, hd, fro, rim, temc&
276 & , tem1, efact, temv, dtaux, dtauy
277 REAL :: rcsksb, tib, rdzb, tem2b, dw2b, shr2b, bvf2b, rdelksb, wtkbjb&
278 & , temb, gfobnvb, hdb, temcb, tem1b, efactb, dtauxb, dtauyb
280 LOGICAL :: ldrag(its:ite), icrilv(its:ite), flag(its:ite), kloop1(its:&
283 REAL :: taub(its:ite), taup(its:ite, kts:kte+1), xn(its:ite), yn(its:&
284 & ite), ubar(its:ite), vbar(its:ite), fr(its:ite), ulow(its:ite), rulow(&
285 & its:ite), bnv(its:ite), oa(its:ite), ol(its:ite), roll(its:ite), dtfac&
286 & (its:ite), brvf(its:ite), xlinv(its:ite), delks(its:ite), delks1(its:&
287 & ite), bnv2(its:ite, kts:kte), usqj(its:ite, kts:kte), taud(its:ite, &
288 & kts:kte), ro(its:ite, kts:kte), vtk(its:ite, kts:kte), vtj(its:ite, &
289 & kts:kte), zlowtop(its:ite), velco(its:ite, kts:kte-1), coefm(its:ite)
290 REAL :: taubb(its:ite), taupb(its:ite, kts:kte+1), xnb(its:ite), ynb(&
291 & its:ite), ubarb(its:ite), vbarb(its:ite), frb(its:ite), ulowb(its:ite)&
292 & , rulowb(its:ite), bnvb(its:ite), rollb(its:ite), dtfacb(its:ite), &
293 & brvfb(its:ite), delksb(its:ite), delks1b(its:ite), bnv2b(its:ite, kts:&
294 & kte), usqjb(its:ite, kts:kte), taudb(its:ite, kts:kte), rob(its:ite, &
295 & kts:kte), vtkb(its:ite, kts:kte), vtjb(its:ite, kts:kte), velcob(its:&
298 INTEGER :: kbl(its:ite), klowtop(its:ite)
301 INTEGER, PARAMETER :: mdir=8
302 INTEGER :: nwdir(mdir)
304 ! variables for flow-blocking drag
306 REAL, PARAMETER :: frmax=10.
307 REAL, PARAMETER :: olmin=1.0e-5
308 REAL, PARAMETER :: odmin=0.1
309 REAL, PARAMETER :: odmax=10.
310 REAL, PARAMETER :: erad=6371.315e+3
311 INTEGER :: komax(its:ite)
315 REAL :: zblkb, tautemb
317 REAL :: delx, dely, dxy4(4), dxy4p(4)
318 REAL :: dxy(its:ite), dxyp(its:ite)
319 REAL :: ol4p(4), olp(its:ite), od(its:ite)
320 REAL :: taufb(its:ite, kts:kte+1)
321 REAL :: taufbb(its:ite, kts:kte+1)
382 DATA nwdir /6, 7, 5, 8, 2, 3, 1, 4/
393 !--- calculate length of grid for flow-blocking drag
399 dxy4(3) = SQRT(delx*delx + dely*dely)
407 !-----initialize arrays
445 ! initialize array for flow-blocking drag
447 taufb(its:ite, kts:kte+1) = 0.0
451 vtj(i, k) = t1(i, k)*(1.+fv*q1(i, k))
452 vtk(i, k) = vtj(i, k)/prslk(i, k)
454 ro(i, k) = 1./rd*prsl(i, k)/vtj(i, k)
458 ! determine reference level: maximum of 2*var and pbl heights
461 zlowtop(i) = 2.*var(i)
470 IF (kloop1(i) .AND. zl(i, k) - zl(i, 1) .GE. zlowtop(i)) THEN
478 IF (kpbl(i) .LT. klowtop(i)) THEN
483 IF (kbl(i) .GT. kpblmax) THEN
488 IF (x1 .LT. kpblmin) THEN
495 ! determine the level of maximum orographic height
500 delks(i) = 1.0/(prsi(i, 1)-prsi(i, kbl(i)))
501 delks1(i) = 1.0/(prsl(i, 1)-prsl(i, kbl(i)))
504 ! compute low level averages within pbl
508 IF (k .LT. kbl(i)) THEN
509 rcsks = rcs*del(i, k)*delks(i)
510 rdelks = del(i, k)*delks(i)
512 ubar(i) = ubar(i) + rcsks*u1(i, k)
514 vbar(i) = vbar(i) + rcsks*v1(i, k)
516 roll(i) = roll(i) + rdelks*ro(i, k)
517 CALL PUSHCONTROL1B(1)
519 CALL PUSHCONTROL1B(0)
524 ! figure out low-level horizontal wind direction
526 ! nwd 1 2 3 4 5 6 7 8
527 ! wd w s sw nw e n ne se
530 wdir = ATAN2(ubar(i), vbar(i)) + pi
531 idir = MOD(NINT(fdir*wdir), mdir) + 1
533 oa(i) = (1-2*INT((nwd-1)/4))*oa4(i, MOD(nwd-1, 4)+1)
534 ol(i) = ol4(i, MOD(nwd-1, 4)+1)
536 !----- compute orographic width along (ol) and perpendicular (olp)
537 !----- the direction of wind
543 olp(i) = ol4p(MOD(nwd-1, 4)+1)
544 IF (ol(i) .LT. olmin) THEN
550 !----- compute orographic direction (horizontal orographic aspect ratio)
553 IF (od(i) .GT. odmax) THEN
558 IF (od(i) .LT. odmin) THEN
564 !----- compute length of grid in the along(dxy) and cross(dxyp) wind directions
566 dxy(i) = dxy4(MOD(nwd-1, 4)+1)
567 dxyp(i) = dxy4p(MOD(nwd-1, 4)+1)
570 !--- saving richardson number in usqj for migwdi
574 ti = 2.0/(t1(i, k)+t1(i, k+1))
575 rdz = 1./(zl(i, k+1)-zl(i, k))
577 tem1 = u1(i, k) - u1(i, k+1)
579 tem2 = v1(i, k) - v1(i, k+1)
580 dw2 = rcl*(tem1*tem1+tem2*tem2)
581 IF (dw2 .LT. dw2min) THEN
584 CALL PUSHCONTROL1B(0)
588 CALL PUSHCONTROL1B(1)
592 bvf2 = g*(g/cp+rdz*(vtj(i, k+1)-vtj(i, k)))*ti
593 IF (bvf2/shr2 .LT. rimin) THEN
595 CALL PUSHCONTROL1B(0)
597 usqj(i, k) = bvf2/shr2
598 CALL PUSHCONTROL1B(1)
600 bnv2(i, k) = 2.0*g*rdz*(vtk(i, k+1)-vtk(i, k))/(vtk(i, k+1)+vtk(i&
602 IF (bnv2(i, k) .LT. bnv2min) THEN
604 CALL PUSHCONTROL1B(0)
606 CALL PUSHCONTROL1B(1)
607 bnv2(i, k) = bnv2(i, k)
612 !----compute the "low level" or 1/3 wind magnitude (m/s)
615 x2 = SQRT(ubar(i)*ubar(i) + vbar(i)*vbar(i))
616 IF (x2 .LT. 1.0) THEN
618 CALL PUSHCONTROL1B(0)
621 CALL PUSHCONTROL1B(1)
623 rulow(i) = 1./ulow(i)
628 velco(i, k) = 0.5*rcs*((u1(i, k)+u1(i, k+1))*ubar(i)+(v1(i, k)+v1(&
630 CALL PUSHREAL8(velco(i, k))
631 velco(i, k) = velco(i, k)*rulow(i)
632 IF (velco(i, k) .LT. veleps .AND. velco(i, k) .GT. 0.) THEN
634 CALL PUSHCONTROL1B(1)
636 CALL PUSHCONTROL1B(0)
641 ! no drag when critical level in the base layer
644 ldrag(i) = velco(i, 1) .LE. 0.
647 ! no drag when velco.lt.0
651 IF (k .LT. kbl(i)) ldrag(i) = ldrag(i) .OR. velco(i, k) .LE. 0.
655 ! no drag when bnv2.lt.0
659 IF (k .LT. kbl(i)) ldrag(i) = ldrag(i) .OR. bnv2(i, k) .LT. 0.
663 !-----the low level weighted average ri is stored in usqj(1,1; im)
664 !-----the low level weighted average n**2 is stored in bnv2(1,1; im)
665 !---- this is called bnvl2 in phys_gwd_alpert_sub not bnv2
666 !---- rdelks (del(k)/delks) vert ave factor so we can * instead of /
669 wtkbj = (prsl(i, 1)-prsl(i, 2))*delks1(i)
670 CALL PUSHREAL8(bnv2(i, 1))
671 bnv2(i, 1) = wtkbj*bnv2(i, 1)
672 CALL PUSHREAL8(usqj(i, 1))
673 usqj(i, 1) = wtkbj*usqj(i, 1)
678 IF (k .LT. kbl(i)) THEN
679 rdelks = (prsl(i, k)-prsl(i, k+1))*delks1(i)
680 tmp = bnv2(i, 1) + bnv2(i, k)*rdelks
681 CALL PUSHREAL8(bnv2(i, 1))
683 tmp0 = usqj(i, 1) + usqj(i, k)*rdelks
684 CALL PUSHREAL8(usqj(i, 1))
686 CALL PUSHCONTROL1B(1)
688 CALL PUSHCONTROL1B(0)
694 ldrag(i) = ldrag(i) .OR. bnv2(i, 1) .LE. 0.0
695 ldrag(i) = ldrag(i) .OR. ulow(i) .EQ. 1.0
696 ldrag(i) = ldrag(i) .OR. var(i) .LE. 0.0
699 ! set all ri low level values to the low level value
703 IF (k .LT. kbl(i)) THEN
705 CALL PUSHREAL8(usqj(i, k))
707 CALL PUSHCONTROL1B(1)
709 CALL PUSHCONTROL1B(0)
715 IF (.NOT.ldrag(i)) THEN
716 bnv(i) = SQRT(bnv2(i, 1))
717 fr(i) = bnv(i)*rulow(i)*2.*var(i)*od(i)
718 IF (fr(i) .GT. frmax) THEN
720 CALL PUSHCONTROL1B(0)
722 CALL PUSHCONTROL1B(1)
725 xn(i) = ubar(i)*rulow(i)
726 yn(i) = vbar(i)*rulow(i)
727 CALL PUSHCONTROL1B(1)
729 CALL PUSHCONTROL1B(0)
733 ! compute the base level stress and store it in taub
734 ! calculate enhancement factor, number of mountains & aspect
735 ! ratio const. use simplified relationship between standard
736 ! deviation & critical hgt
739 IF (.NOT.ldrag(i)) THEN
740 CALL PUSHREAL8(efact)
741 efact = (oa(i)+2.)**(ce*fr(i)/frc)
742 IF (efact .LT. efmin) THEN
744 CALL PUSHCONTROL1B(0)
747 CALL PUSHCONTROL1B(1)
749 IF (x3 .GT. efmax) THEN
751 CALL PUSHCONTROL1B(0)
754 CALL PUSHCONTROL1B(1)
756 !!!!!!! cleff (effective grid length) is highly tunable parameter
757 !!!!!!! the bigger (smaller) value produce weaker (stronger) wave drag
758 cleff = SQRT(dxy(i)**2. + dxyp(i)**2.)
759 IF (dxmeter .LT. cleff) THEN
765 coefm(i) = (1.+ol(i))**(oa(i)+1.)
766 xlinv(i) = coefm(i)/cleff
767 tem = fr(i)*fr(i)*oc1(i)
768 gfobnv = gmax*tem/((tem+cg)*bnv(i))
769 taub(i) = xlinv(i)*roll(i)*ulow(i)*ulow(i)*ulow(i)*gfobnv*efact
770 CALL PUSHCONTROL1B(1)
775 CALL PUSHCONTROL1B(0)
779 ! now compute vertical structure of the stress.
783 IF (k .LE. kbl(i)) THEN
785 CALL PUSHCONTROL1B(1)
787 CALL PUSHCONTROL1B(0)
792 ! vertical level k loop!
794 CALL PUSHINTEGER4(kp1)
798 ! unstablelayer if ri < ric
799 ! unstable layer if upper air vel comp along surf vel <=0 (crit lay)
800 ! at (u-c)=0. crit layer exists and bit vector should be set (.le.)
802 IF (k .GE. kbl(i)) THEN
803 icrilv(i) = (icrilv(i) .OR. usqj(i, k) .LT. ric) .OR. velco(i, k&
805 IF (bnv2(i, k) .LT. bnv2min) THEN
806 CALL PUSHREAL8(brvf(i))
808 CALL PUSHCONTROL1B(0)
810 CALL PUSHREAL8(brvf(i))
812 CALL PUSHCONTROL1B(1)
814 ! brunt-vaisala frequency
815 CALL PUSHREAL8(brvf(i))
816 brvf(i) = SQRT(brvf(i))
817 CALL PUSHCONTROL1B(1)
819 CALL PUSHCONTROL1B(0)
824 IF (k .GE. kbl(i) .AND. (.NOT.ldrag(i))) THEN
825 IF (.NOT.icrilv(i) .AND. taup(i, k) .GT. 0.0) THEN
826 temv = 1.0/velco(i, k)
828 tem1 = coefm(i)/dxy(i)*(ro(i, kp1)+ro(i, k))*brvf(i)*velco(i, &
831 hd = SQRT(taup(i, k)/tem1)
832 fro = brvf(i)*hd*temv
834 ! rim is the minimum-richardson number by shutts (1985)
837 tem2 = SQRT(usqj(i, k))
839 rim = usqj(i, k)*(1.-fro)/(tem*tem)
841 ! check stability to employ the 'saturation hypothesis'
842 ! of lindzen (1981) except at tropospheric downstream regions
844 IF (rim .LE. ric) THEN
845 ! saturation hypothesis!
846 IF (oa(i) .LE. 0. .OR. kp1 .GE. kpblmin) THEN
847 temc = 2.0 + 1.0/tem2
848 hd = velco(i, k)*(2.*SQRT(temc)-temc)/brvf(i)
849 taup(i, kp1) = tem1*hd*hd
850 CALL PUSHCONTROL3B(4)
852 CALL PUSHCONTROL3B(3)
858 CALL PUSHCONTROL3B(2)
861 CALL PUSHCONTROL3B(1)
864 CALL PUSHCONTROL3B(0)
869 IF (lcap .LT. kte) THEN
872 tmp3 = prsi(i, klcap)/prsi(i, lcap)*taup(i, lcap)
873 CALL PUSHREAL8(taup(i, klcap))
874 taup(i, klcap) = tmp3
877 CALL PUSHCONTROL1B(1)
879 CALL PUSHCONTROL1B(0)
882 IF (.NOT.ldrag(i)) THEN
884 !------- determine the height of flow-blocking layer
886 CALL PUSHINTEGER4(kblk)
890 IF (kblk .EQ. 0 .AND. k .LE. komax(i)) THEN
891 pe = pe + bnv2(i, k)*(zl(i, komax(i))-zl(i, k))*del(i, k)/g/ro&
893 ke = 0.5*((rcs*u1(i, k))**2.+(rcs*v1(i, k))**2.)
895 !---------- apply flow-blocking drag when pe >= ke
898 CALL PUSHINTEGER4(kblk)
900 IF (kblk .GT. kbl(i)) THEN
906 zblk = zl(i, kblk) - zl(i, kts)
907 CALL PUSHCONTROL2B(2)
909 CALL PUSHCONTROL2B(1)
912 CALL PUSHCONTROL2B(0)
915 IF (kblk .NE. 0) THEN
917 !--------- compute flow-blocking stress
919 IF (2.0 - 1.0/od(i) .LT. 0.0) THEN
922 CALL PUSHCONTROL1B(0)
926 CALL PUSHCONTROL1B(1)
928 taufb(i, kts) = 0.5*roll(i)*coefm(i)/dxy(i)**2*cd*dxyp(i)*olp(i)&
930 tautem = taufb(i, kts)/FLOAT(kblk-kts)
932 taufb(i, k) = taufb(i, k-1) - tautem
934 CALL PUSHINTEGER4(k - 1)
936 !----------sum orographic GW stress and flow-blocking stress
938 CALL PUSHREAL8ARRAY(taup(i, :), kte - kts + 2)
939 taup(i, :) = taup(i, :) + taufb(i, :)
940 CALL PUSHCONTROL2B(2)
942 CALL PUSHCONTROL2B(1)
945 CALL PUSHCONTROL2B(0)
949 ! calculate - (g)*d(tau)/d(pressure) and deceleration terms dtaux, dtauy
953 taud(i, k) = 1.*(taup(i, k+1)-taup(i, k))*csg/del(i, k)
957 ! limit de-acceleration (momentum deposition ) at top to 1/2 value
958 ! the idea is some stuff must go out the 'top'
962 taud(i, klcap) = taud(i, klcap)*factop
966 ! if the gravity wave drag would force a critical line
967 ! in the lower ksmm1 layers during the next deltim timestep,
968 ! then only apply drag until that critical line is reached.
972 IF (k .LE. kbl(i)) THEN
973 IF (taud(i, k) .NE. 0.) THEN
974 x4 = velco(i, k)/(deltim*rcs*taud(i, k))
977 CALL PUSHCONTROL1B(0)
980 CALL PUSHCONTROL1B(1)
982 IF (dtfac(i) .GT. y1) THEN
984 CALL PUSHCONTROL2B(2)
987 CALL PUSHCONTROL2B(3)
990 CALL PUSHCONTROL2B(1)
993 CALL PUSHCONTROL2B(0)
1000 CALL PUSHREAL8(taud(i, k))
1001 taud(i, k) = taud(i, k)*dtfac(i)
1005 dvsfcb(i) = -(rcs*dvsfcb(i)/g)
1006 dusfcb(i) = -(rcs*dusfcb(i)/g)
1014 dtaux = taud(i, k)*xn(i)
1015 dtauy = taud(i, k)*yn(i)
1016 dtauyb = dvdtb(i, k) + dtauy2db(i, k) + del(i, k)*dvsfcb(i)
1017 delb(i, k) = delb(i, k) + dtaux*dusfcb(i) + dtauy*dvsfcb(i)
1018 dtauxb = dudtb(i, k) + dtaux2db(i, k) + del(i, k)*dusfcb(i)
1019 dtauy2db(i, k) = 0.0
1020 dtaux2db(i, k) = 0.0
1021 taudb(i, k) = taudb(i, k) + xn(i)*dtauxb + yn(i)*dtauyb
1022 ynb(i) = ynb(i) + taud(i, k)*dtauyb
1023 xnb(i) = xnb(i) + taud(i, k)*dtauxb
1024 CALL POPREAL8(taud(i, k))
1025 dtfacb(i) = dtfacb(i) + taud(i, k)*taudb(i, k)
1026 taudb(i, k) = dtfac(i)*taudb(i, k)
1034 DO k=kpblmax-1,kts,-1
1036 CALL POPCONTROL2B(branch)
1037 IF (branch .GE. 2) THEN
1038 IF (branch .EQ. 2) THEN
1044 CALL POPCONTROL1B(branch)
1045 IF (branch .EQ. 0) THEN
1050 temp12 = deltim*rcs*taud(i, k)
1051 velcob(i, k) = velcob(i, k) + x4b/temp12
1052 taudb(i, k) = taudb(i, k) - velco(i, k)*deltim*rcs*x4b/temp12**2
1056 DO klcap=kte,lcap,-1
1058 taudb(i, klcap) = factop*taudb(i, klcap)
1064 tempb20 = csg*taudb(i, k)/del(i, k)
1065 taupb(i, k+1) = taupb(i, k+1) + tempb20
1066 taupb(i, k) = taupb(i, k) - tempb20
1067 delb(i, k) = delb(i, k) - (taup(i, k+1)-taup(i, k))*tempb20/del(i&
1077 CALL POPCONTROL2B(branch)
1078 IF (branch .NE. 0) THEN
1079 IF (branch .NE. 1) THEN
1080 CALL POPREAL8ARRAY(taup(i, :), kte - kts + 2)
1081 taufbb(i, :) = taufbb(i, :) + taupb(i, :)
1083 CALL POPINTEGER4(ad_to)
1085 taufbb(i, k-1) = taufbb(i, k-1) + taufbb(i, k)
1086 tautemb = tautemb - taufbb(i, k)
1089 taufbb(i, kts) = taufbb(i, kts) + tautemb/FLOAT(kblk-kts)
1090 tempb18 = cd*0.5*olp(i)*coefm(i)*dxyp(i)*taufbb(i, kts)
1091 tempb19 = ulow(i)**2*tempb18/dxy(i)**2
1092 rollb(i) = rollb(i) + zblk*tempb19
1093 zblkb = zblkb + roll(i)*tempb19
1094 ulowb(i) = ulowb(i) + roll(i)*zblk*2*ulow(i)*tempb18/dxy(i)**2
1095 taufbb(i, kts) = 0.0
1096 CALL POPCONTROL1B(branch)
1097 IF (branch .EQ. 0) THEN
1104 CALL POPCONTROL2B(branch)
1105 IF (branch .NE. 0) THEN
1106 IF (branch .NE. 1) THEN
1108 zlb(i, kblk) = zlb(i, kblk) + zblkb
1109 zlb(i, kts) = zlb(i, kts) - zblkb
1110 CALL POPINTEGER4(kblk)
1115 CALL POPINTEGER4(kblk)
1118 CALL POPCONTROL1B(branch)
1119 IF (branch .NE. 0) THEN
1120 DO klcap=kte,lcapp1,-1
1122 CALL POPREAL8(taup(i, klcap))
1123 tmpb3 = taupb(i, klcap)
1124 taupb(i, klcap) = 0.0
1125 tempb17 = tmpb3/prsi(i, lcap)
1126 prsib(i, klcap) = prsib(i, klcap) + taup(i, lcap)*tempb17
1127 taupb(i, lcap) = taupb(i, lcap) + prsi(i, klcap)*tempb17
1128 prsib(i, lcap) = prsib(i, lcap) - prsi(i, klcap)*taup(i, lcap)*&
1129 & tempb17/prsi(i, lcap)
1137 DO k=kte-1,kpblmin,-1
1139 CALL POPCONTROL3B(branch)
1140 IF (branch .GE. 2) THEN
1141 IF (branch .EQ. 2) THEN
1142 tmpb2 = taupb(i, kp1)
1144 taupb(i, k) = taupb(i, k) + tmpb2
1147 ELSE IF (branch .EQ. 3) THEN
1151 tem1b = hd**2*taupb(i, kp1)
1152 hdb = tem1*2*hd*taupb(i, kp1)
1154 temc = 2.0 + 1.0/tem2
1156 tempb16 = (2.*temp11-temc)*hdb/brvf(i)
1157 temp10 = velco(i, k)/brvf(i)
1158 velcob(i, k) = velcob(i, k) + tempb16
1159 brvfb(i) = brvfb(i) - temp10*tempb16
1160 IF (temc .EQ. 0.0) THEN
1161 temcb = -(temp10*hdb)
1163 temcb = (2.*temp10/(2.0*temp11)-temp10)*hdb
1165 tem2b = -(temcb/tem2**2)
1168 IF (.NOT.usqj(i, k) .EQ. 0.0) usqjb(i, k) = usqjb(i, k) + tem2b/&
1169 & (2.0*SQRT(usqj(i, k)))
1172 temp9 = brvf(i)/dxy(i)
1173 tempb13 = coefm(i)*0.5*tem1b
1174 tempb14 = velco(i, k)*temp9*tempb13
1175 tempb15 = (ro(i, kp1)+ro(i, k))*tempb13
1176 rob(i, kp1) = rob(i, kp1) + tempb14
1177 rob(i, k) = rob(i, k) + tempb14
1178 velcob(i, k) = velcob(i, k) + temp9*tempb15
1179 brvfb(i) = brvfb(i) + velco(i, k)*tempb15/dxy(i)
1183 CALL POPCONTROL1B(branch)
1184 IF (branch .NE. 0) THEN
1185 CALL POPREAL8(brvf(i))
1186 IF (brvf(i) .EQ. 0.0) THEN
1189 brvfb(i) = brvfb(i)/(2.0*SQRT(brvf(i)))
1191 CALL POPCONTROL1B(branch)
1192 IF (branch .EQ. 0) THEN
1193 CALL POPREAL8(brvf(i))
1196 CALL POPREAL8(brvf(i))
1197 bnv2b(i, k) = bnv2b(i, k) + brvfb(i)
1202 CALL POPINTEGER4(kp1)
1207 CALL POPCONTROL1B(branch)
1208 IF (branch .NE. 0) THEN
1209 taubb(i) = taubb(i) + taupb(i, k)
1217 CALL POPCONTROL1B(branch)
1218 IF (branch .EQ. 0) THEN
1223 tem = fr(i)*fr(i)*oc1(i)
1224 gfobnv = gmax*tem/((tem+cg)*bnv(i))
1225 tempb10 = xlinv(i)*ulow(i)**3*taubb(i)
1226 ulowb(i) = ulowb(i) + roll(i)*gfobnv*efact*xlinv(i)*3*ulow(i)**2*&
1228 rollb(i) = rollb(i) + gfobnv*efact*tempb10
1229 gfobnvb = roll(i)*efact*tempb10
1230 efactb = roll(i)*gfobnv*tempb10
1232 temp8 = (cg+tem)*bnv(i)
1233 tempb11 = gmax*gfobnvb/temp8
1234 tempb12 = -(tem*tempb11/temp8)
1235 temb = bnv(i)*tempb12 + tempb11
1236 bnvb(i) = bnvb(i) + (cg+tem)*tempb12
1237 frb(i) = frb(i) + oc1(i)*2*fr(i)*temb
1238 CALL POPCONTROL1B(branch)
1239 IF (branch .EQ. 0) THEN
1244 CALL POPCONTROL1B(branch)
1245 IF (branch .EQ. 0) THEN
1250 CALL POPREAL8(efact)
1251 IF (.NOT.oa(i) + 2. .LE. 0.0) frb(i) = frb(i) + ce*(oa(i)+2.)**(ce&
1252 & *(fr(i)/frc))*LOG(oa(i)+2.)*efactb/frc
1259 CALL POPCONTROL1B(branch)
1260 IF (branch .NE. 0) THEN
1261 vbarb(i) = vbarb(i) + rulow(i)*ynb(i)
1262 rulowb(i) = rulowb(i) + ubar(i)*xnb(i) + vbar(i)*ynb(i)
1264 ubarb(i) = ubarb(i) + rulow(i)*xnb(i)
1266 CALL POPCONTROL1B(branch)
1267 IF (branch .EQ. 0) frb(i) = 0.0
1268 tempb9 = var(i)*2.*od(i)*frb(i)
1269 bnvb(i) = bnvb(i) + rulow(i)*tempb9
1270 rulowb(i) = rulowb(i) + bnv(i)*tempb9
1272 IF (.NOT.bnv2(i, 1) .EQ. 0.0) bnv2b(i, 1) = bnv2b(i, 1) + bnvb(i)/&
1273 & (2.0*SQRT(bnv2(i, 1)))
1277 DO k=kpblmax,kpblmin,-1
1279 CALL POPCONTROL1B(branch)
1280 IF (branch .NE. 0) THEN
1281 CALL POPREAL8(usqj(i, k))
1284 usqjb(i, 1) = usqjb(i, 1) + tmpb1
1289 DO k=kpblmax,kpblmin,-1
1291 CALL POPCONTROL1B(branch)
1292 IF (branch .NE. 0) THEN
1294 rdelks = (prsl(i, k)-prsl(i, k+1))*delks1(i)
1295 CALL POPREAL8(usqj(i, 1))
1298 usqjb(i, k) = usqjb(i, k) + rdelks*tmpb
1299 CALL POPREAL8(bnv2(i, 1))
1300 rdelksb = bnv2(i, k)*tmpb0 + usqj(i, k)*tmpb
1302 bnv2b(i, k) = bnv2b(i, k) + rdelks*tmpb0
1303 prslb(i, k) = prslb(i, k) + delks1(i)*rdelksb
1304 prslb(i, k+1) = prslb(i, k+1) - delks1(i)*rdelksb
1305 delks1b(i) = delks1b(i) + (prsl(i, k)-prsl(i, k+1))*rdelksb
1310 wtkbj = (prsl(i, 1)-prsl(i, 2))*delks1(i)
1311 CALL POPREAL8(usqj(i, 1))
1312 CALL POPREAL8(bnv2(i, 1))
1313 wtkbjb = bnv2(i, 1)*bnv2b(i, 1) + usqj(i, 1)*usqjb(i, 1)
1314 usqjb(i, 1) = wtkbj*usqjb(i, 1)
1315 bnv2b(i, 1) = wtkbj*bnv2b(i, 1)
1316 prslb(i, 1) = prslb(i, 1) + delks1(i)*wtkbjb
1317 prslb(i, 2) = prslb(i, 2) - delks1(i)*wtkbjb
1318 delks1b(i) = delks1b(i) + (prsl(i, 1)-prsl(i, 2))*wtkbjb
1322 CALL POPCONTROL1B(branch)
1323 IF (branch .NE. 0) velcob(i, k) = 0.0
1324 CALL POPREAL8(velco(i, k))
1325 rulowb(i) = rulowb(i) + velco(i, k)*velcob(i, k)
1326 velcob(i, k) = rulow(i)*velcob(i, k)
1327 tempb8 = rcs*0.5*velcob(i, k)
1328 u1b(i, k) = u1b(i, k) + ubar(i)*tempb8
1329 u1b(i, k+1) = u1b(i, k+1) + ubar(i)*tempb8
1330 ubarb(i) = ubarb(i) + (u1(i, k)+u1(i, k+1))*tempb8
1331 v1b(i, k) = v1b(i, k) + vbar(i)*tempb8
1332 v1b(i, k+1) = v1b(i, k+1) + vbar(i)*tempb8
1333 vbarb(i) = vbarb(i) + (v1(i, k)+v1(i, k+1))*tempb8
1338 ulowb(i) = ulowb(i) - rulowb(i)/ulow(i)**2
1340 CALL POPCONTROL1B(branch)
1341 IF (branch .EQ. 0) THEN
1348 IF (ubar(i)**2 + vbar(i)**2 .EQ. 0.0) THEN
1351 tempb7 = x2b/(2.0*SQRT(ubar(i)**2+vbar(i)**2))
1353 ubarb(i) = ubarb(i) + 2*ubar(i)*tempb7
1354 vbarb(i) = vbarb(i) + 2*vbar(i)*tempb7
1360 CALL POPCONTROL1B(branch)
1361 IF (branch .EQ. 0) bnv2b(i, k) = 0.0
1362 rdz = 1./(zl(i, k+1)-zl(i, k))
1363 temp6 = vtk(i, k+1) + vtk(i, k)
1364 temp7 = vtk(i, k+1) - vtk(i, k)
1365 tempb5 = g*2.0*bnv2b(i, k)/temp6
1366 tempb6 = -(rdz*temp7*tempb5/temp6)
1368 vtkb(i, k+1) = vtkb(i, k+1) + tempb6 + rdz*tempb5
1369 vtkb(i, k) = vtkb(i, k) + tempb6 - rdz*tempb5
1371 CALL POPCONTROL1B(branch)
1372 IF (branch .EQ. 0) THEN
1378 bvf2b = usqjb(i, k)/shr2
1379 shr2b = -(bvf2*usqjb(i, k)/shr2**2)
1382 ti = 2.0/(t1(i, k)+t1(i, k+1))
1384 temp5 = vtj(i, k+1) - vtj(i, k)
1386 rdzb = rdzb + max2*2*rdz*shr2b + temp5*tempb4
1387 vtjb(i, k+1) = vtjb(i, k+1) + rdz*tempb4
1388 vtjb(i, k) = vtjb(i, k) - rdz*tempb4
1389 tib = g*(g/cp+rdz*temp5)*bvf2b
1390 max2b = rdz**2*shr2b
1391 CALL POPCONTROL1B(branch)
1392 IF (branch .EQ. 0) THEN
1399 tem1b = rcl*2*tem1*dw2b
1400 tem2b = rcl*2*tem2*dw2b
1402 v1b(i, k) = v1b(i, k) + tem2b
1403 v1b(i, k+1) = v1b(i, k+1) - tem2b
1405 u1b(i, k) = u1b(i, k) + tem1b
1406 u1b(i, k+1) = u1b(i, k+1) - tem1b
1407 temp4 = zl(i, k+1) - zl(i, k)
1408 tempb2 = -(rdzb/temp4**2)
1409 zlb(i, k+1) = zlb(i, k+1) + tempb2
1410 zlb(i, k) = zlb(i, k) - tempb2
1411 temp3 = t1(i, k) + t1(i, k+1)
1412 tempb3 = -(2.0*tib/temp3**2)
1413 t1b(i, k) = t1b(i, k) + tempb3
1414 t1b(i, k+1) = t1b(i, k+1) + tempb3
1420 CALL POPCONTROL1B(branch)
1421 IF (branch .NE. 0) THEN
1422 rdelks = del(i, k)*delks(i)
1423 rdelksb = ro(i, k)*rollb(i)
1424 rob(i, k) = rob(i, k) + rdelks*rollb(i)
1425 rcsks = rcs*del(i, k)*delks(i)
1426 rcsksb = u1(i, k)*ubarb(i) + v1(i, k)*vbarb(i)
1427 v1b(i, k) = v1b(i, k) + rcsks*vbarb(i)
1428 u1b(i, k) = u1b(i, k) + rcsks*ubarb(i)
1429 delb(i, k) = delb(i, k) + rcs*delks(i)*rcsksb + delks(i)*rdelksb
1430 delksb(i) = delksb(i) + rcs*del(i, k)*rcsksb + del(i, k)*rdelksb
1435 temp2 = prsl(i, 1) - prsl(i, kbl(i))
1436 tempb0 = -(delks1b(i)/temp2**2)
1437 prslb(i, 1) = prslb(i, 1) + tempb0
1438 prslb(i, kbl(i)) = prslb(i, kbl(i)) - tempb0
1440 temp1 = prsi(i, 1) - prsi(i, kbl(i))
1441 tempb1 = -(delksb(i)/temp1**2)
1442 prsib(i, 1) = prsib(i, 1) + tempb1
1443 prsib(i, kbl(i)) = prsib(i, kbl(i)) - tempb1
1448 tempb = vtkb(i, k)/prslk(i, k)
1449 temp0 = rd*vtj(i, k)
1450 prslb(i, k) = prslb(i, k) + rob(i, k)/temp0
1451 vtjb(i, k) = vtjb(i, k) + tempb - prsl(i, k)*rd*rob(i, k)/temp0**2
1453 prslkb(i, k) = prslkb(i, k) - vtj(i, k)*tempb/prslk(i, k)
1455 t1b(i, k) = t1b(i, k) + (fv*q1(i, k)+1.)*vtjb(i, k)
1456 q1b(i, k) = q1b(i, k) + t1(i, k)*fv*vtjb(i, k)
1462 dtauy2db(i, k) = 0.0
1463 dtaux2db(i, k) = 0.0
1466 END SUBROUTINE GWDO2D_B
1468 end module a_module_bl_gwdo