2 SUBROUTINE calvis_gsd(CZEN,VIS)
98 use vrbls3d, only: qqw, qqi, qqs, qqr, qqg, t, pmid, q, u, v, extcof55, aextc55
100 use ctlblk_mod
, only: jm, im, jsta_2l, jend_2u, lm, modelname, spval,&
105 integer :: j, i, k, ll
107 real :: tx, pol, esx, es, e
108 REAL vis(ista_2l:iend_2u,jsta_2l:jend_2u)
109 REAL rhb(ista_2l:iend_2u,jsta_2l:jend_2u,lm)
110 REAL czen(ista_2l:iend_2u,jsta_2l:jend_2u)
112 real celkel,tice,coeflc,coeflp,coeffc,coeffp,coeffg
113 real exponlc,exponlp,exponfc,exponfp,exponfg,const1
114 real rhoice,rhowat,qrain,qsnow,qgraupel,qclw,qclice,tv,rhoair, &
115 vovermd,conclc,conclp,concfc,concfp,concfg,betav
117 real coeffp_dry, coeffp_wet, shear_fac, temp_fac
118 real coef_snow, shear
120 real coefrh,qrh,visrh
121 real rhmax,shear5_cnt, shear8_cnt
122 real shear5_cnt_lowvis, shear8_cnt_lowvis
123 real shear4_cnt, shear4_cnt_lowvis
124 integer night_cnt, lowsun_cnt
126 real visrh10_cnt, vis1km_cnt, visrh_lower
129 real vis_min, visrh_min
130 real vis_night, zen_fac
152 shear4_cnt_lowvis = 0
153 shear5_cnt_lowvis = 0
154 shear8_cnt_lowvis = 0
212 if(t(i,j,lm)<spval .and. u(i,j,lm)<spval .and. v(i,j,lm)<spval &
213 .and. pmid(i,j,lm)<spval)
then
223 if(qqw(i,j,ll)<spval)qclw = max(qclw, qqw(i,j,ll) )
224 if(qqi(i,j,ll)<spval)qclice = max(qclice, qqi(i,j,ll) )
225 if(qqs(i,j,ll)<spval)qsnow = max(qsnow, qqs(i,j,ll) )
226 if(qqr(i,j,ll)<spval)qrain = max(qrain, qqr(i,j,ll) )
227 if(qqg(i,j,ll)<spval)qgraupel = max(qgraupel, qqg(i,j,ll) )
231 pol = 0.99999683 + tx*(-0.90826951e-02 + &
232 tx*(0.78736169e-04 + tx*(-0.61117958e-06 + &
233 tx*(0.43884187e-08 + tx*(-0.29883885e-10 + &
234 tx*(0.21874425e-12 + tx*(-0.17892321e-14 + &
235 tx*(0.11112018e-16 + tx*(-0.30994571e-19)))))))))
236 if(abs(pol) > 0.)
THEN
240 e = pmid(i,j,ll)/100.*q(i,j,ll)/(0.62197+q(i,j,ll)*0.37803)
241 rhb(i,j,ll) = 100.*amin1(1.,e/es)
247 rhmax = max(rhb(i,j,lm),rhb(i,j,lm-1))
248 qrh = max(0.0,min(0.8,(rhmax/100.-0.15)))
252 visrh = 90. * exp(-2.5*qrh)
260 shear = sqrt( (u(i,j,lm-3)-u(i,j,lm))**2 &
261 +(v(i,j,lm-3)-v(i,j,lm))**2 )
263 shear_fac = min(1.,max(0.,(shear-4.)/2.) )
264 if (visrh<10.) visrh = visrh + (10.-visrh)* &
267 if (shear>4.) shear4_cnt = shear4_cnt +1
268 if (shear>5.) shear5_cnt = shear5_cnt +1
269 if (shear>6.) shear8_cnt = shear8_cnt +1
271 if (shear>4..and.visrh<10) &
272 shear4_cnt_lowvis = shear4_cnt_lowvis +1
273 if (shear>5..and.visrh<10) &
274 shear5_cnt_lowvis = shear5_cnt_lowvis +1
275 if (shear>6..and.visrh<10) &
276 shear8_cnt_lowvis = shear8_cnt_lowvis +1
278 if (visrh<10.) visrh10_cnt = visrh10_cnt+1
279 if (czen(i,j)<0.) night_cnt = night_cnt + 1
280 if (czen(i,j)<0.1) lowsun_cnt = lowsun_cnt + 1
282 tv=t(i,j,lm)*(h1+d608*q(i,j,lm))
284 rhoair=pmid(i,j,lm)/(rd*tv)
286 vovermd=(1.+q(i,j,lm))/rhoair+(qclw+qrain)/rhowat+ &
288 (qgraupel+qclice+qsnow)/rhoice
289 conclc=qclw/vovermd*1000.
290 conclp=qrain/vovermd*1000.
291 concfc=qclice/vovermd*1000.
292 concfp=qsnow/vovermd*1000.
293 concfg=qgraupel/vovermd*1000.
295 temp_fac = min(1.,max((t(i,j,lm)-271.15),0.) )
297 coef_snow = coeffp_dry*(1.-temp_fac) &
298 + coeffp_wet* temp_fac
300 if (t(i,j,lm)< 270. .and. temp_fac==1.) &
301 write (6,*)
'Problem w/ temp_fac - calvis'
304 betav=coeffc*concfc**exponfc &
305 + coef_snow*concfp**exponfp &
306 + coeflc*conclc**exponlc + coeflp*conclp**exponlp &
307 + coeffg*concfg**exponfg +1.e-10
310 if(method == 2 .or. method == 3)
then
311 betav = betav + aextc55(i,j,lm)*1000.
314 if (i==290 .and. j==112)
then
315 write (6,*)
'BETAV, extcof55 =',betav,extcof55(i,j,lm)
319 vis(i,j)=min(90.,const1/(betav+extcof55(i,j,lm)))
321 if (vis(i,j)<vis_min) vis_min = vis(i,j)
322 if (visrh<visrh_min) visrh_min = visrh
324 if (visrh<vis(i,j)) visrh_lower = visrh_lower + 1
329 vis_night = 1.69 * ((vis(i,j)/1.609)**0.86) * 1.609
331 zen_fac = min(0.1,max(czen(i,j),0.))/ 0.1
332 if (i==290 .and. j==112)
then
333 write (6,*)
'zen_fac,vis_night, vis =',zen_fac,vis_night, vis(i,j)
336 vis(i,j) = zen_fac * vis(i,j) + (1.-zen_fac)*vis_night
338 if (i==290 .and. j==112)
then
339 write (6,*)
'visrh, vis =',visrh, vis(i,j)
342 if(method == 1 .or. method == 3)
then
343 vis(i,j) = min(vis(i,j),visrh)
346 if (vis(i,j)<1.) vis1km_cnt = vis1km_cnt + 1
347 if (vis(i,j)<3.) vis3km_cnt = vis3km_cnt + 1
348 if (vis(i,j)<5.) vis5km_cnt = vis5km_cnt + 1
350 vis(i,j) = vis(i,j) * 1000.