27 SUBROUTINE caltau(TAUX,TAUY)
31 use vrbls3d, only: zint, pmid, q, t, uh, vh, el_pbl, zmid
34 use params_mod, only: d00, d50, h1, d608, rd, d25
35 use ctlblk_mod
, only: jsta_2l, jend_2u, lm, jsta, jend, spval, jsta_m,&
37 use gridspec_mod
, only: gridtype
42 INTEGER,
dimension(4) :: kk(4)
43 INTEGER,
dimension(jm) :: ive, ivw
44 REAL,
dimension(im,jsta:jend),
intent(inout) :: taux, tauy
45 REAL,
ALLOCATABLE :: el(:,:,:)
46 REAL,
dimension(im,jsta:jend) :: egridu,egridv,egrid4,egrid5, el0
49 integer i,j,lmhk,ie,iw,ii,jj
50 real dz,rdz,rsfc,tv,rho,ulmh,vlmh,deludz,delvdz,elsqr,zint1, &
51 zint2,z0v,psfc,tvv,qvv,elv,elv1,elv2
56 ALLOCATE (el(im,jsta_2l:jend_2u,lm))
78 IF(gridtype ==
'A')
THEN
79 CALL clmax(el0,egridu,egridv,egrid4,egrid5)
86 IF(el(i,j,lmhk-1)<spval.and.z0(i,j)<spval.and. &
87 uz0(i,j)<spval.and.vz0(i,j)<spval)
THEN
91 dz = d50*(zint(i,j,lmhk)-zint(i,j,lmhk+1))
98 tv = (h1+d608*q(i,j,lmhk))*t(i,j,lmhk)
109 deludz = (ulmh-uz0(i,j))*rdz
110 delvdz = (vlmh-vz0(i,j))*rdz
114 elsqr = el(i,j,lmhk-1)*el(i,j,lmhk-1)
115 taux(i,j) = rho*elsqr*deludz*deludz
116 tauy(i,j) = rho*elsqr*delvdz*delvdz
125 ELSE IF(gridtype ==
'E')
THEN
126 call exch(zint(1,jsta_2l,lm))
127 call exch(zint(1,jsta_2l,lm+1))
128 call exch(z0(1,jsta_2l))
129 call exch(pmid(1,jsta_2l,lm))
130 call exch(t(1,jsta_2l,lm))
131 call exch(q(1,jsta_2l,lm))
132 call exch(el_pbl(1,jsta_2l,lm))
133 call exch(el_pbl(1,jsta_2l,lm-1))
143 lmhk = nint(lmh(i,j))
146 zint1=(zint(iw,j,lmhk)+zint(ie,j,lmhk) &
147 +zint(i,j+1,lmhk)+zint(i,j-1,lmhk))*d25
148 zint2=(zint(iw,j,lmhk+1)+zint(ie,j,lmhk+1) &
149 +zint(i,j+1,lmhk+1)+zint(i,j-1,lmhk+1))*d25
150 dz = d50*(zint1-zint2)
151 z0v=(z0(iw,j)+z0(ie,j)+z0(i,j+1)+z0(i,j-1))*d25
157 psfc = (pmid(iw,j,lmhk)+pmid(ie,j,lmhk) &
158 +pmid(i,j+1,lmhk)+pmid(i,j-1,lmhk))*d25
159 tvv = (t(iw,j,lmhk)+t(ie,j,lmhk) &
160 +t(i,j+1,lmhk)+t(i,j-1,lmhk))*d25
161 qvv = (q(iw,j,lmhk)+q(ie,j,lmhk) &
162 +q(i,j+1,lmhk)+q(i,j-1,lmhk))*d25
163 tv = (h1+d608*qvv)*tvv
168 deludz = (uh(i,j,lmhk)-uz0(i,j))*rdz
169 delvdz = (vh(i,j,lmhk)-vz0(i,j))*rdz
173 elv1=(el_pbl(iw,j,lmhk)+el_pbl(ie,j,lmhk) &
174 +el_pbl(i,j+1,lmhk)+el_pbl(i,j-1,lmhk))*d25
175 elv2=(el_pbl(iw,j,lmhk-1)+el_pbl(ie,j,lmhk-1) &
176 +el_pbl(i,j+1,lmhk-1)+el_pbl(i,j-1,lmhk-1))*d25
179 taux(i,j)=rho*elsqr*deludz*deludz
180 tauy(i,j)=rho*elsqr*delvdz*delvdz
187 ELSE IF(gridtype ==
'B')
THEN
189 call exch(vh(1,jsta_2l,lm))
193 lmhk = nint(lmh(i,j))
199 dz=zmid(i,j,lmhk)-(z0(i,j)+zint(i,j,lmhk+1))
205 psfc = pmid(i,j,lmhk)
206 tv = (h1+d608*q(i,j,lmhk))*t(i,j,lmhk)
211 ulmh = 0.5*(uh(i-1,j,lmhk)+uh(i,j,lmhk))
212 vlmh = 0.5*(vh(i,j-1,lmhk)+vh(i,j,lmhk))
216 deludz = (ulmh-uz0(i,j))*rdz
217 delvdz = (vlmh-vz0(i,j))*rdz
221 elv=0.5*(el_pbl(i,j,lmhk)+el_pbl(i,j,lmhk-1))
223 taux(i,j) = rho*elsqr*deludz*deludz
226 tauy(i,j) = rho*elsqr*delvdz*delvdz