2 SUBROUTINE calvis_gsd(CZEN,VIS)
103 use vrbls2d,
only: sno, si, ustar, z0
104 use vrbls3d,
only: qqw, qqi, qqs, qqr, qqg, t, pmid, q, u, v, aextc55
105 use params_mod,
only: h1, d608, rd, g
106 use ctlblk_mod,
only: jm, im, jsta_2l, jend_2u, lm, modelname, spval, method_blsn,&
111 integer :: j, i, k, ll
113 real :: tx, pol, esx, es, e
114 REAL VIS(ista_2l:iend_2u,jsta_2l:jend_2u)
115 REAL RHB(ista_2l:iend_2u,jsta_2l:jend_2u,LM)
116 REAL CZEN(ista_2l:iend_2u,jsta_2l:jend_2u)
118 real :: z, ustar_t, u_p, lamda, r_bar, alpha
120 real :: z_r, Q_s, C_r, c_z, c_alpha, vis_blsn, BETABLSN
122 real celkel,tice,coeflc,coeflp,coeffc,coeffp,coeffg
123 real exponlc,exponlp,exponfc,exponfp,exponfg,const1
124 real rhoice,rhowat,qrain,qsnow,qgraupel,qclw,qclice,tv,rhoair, &
125 vovermd,conclc,conclp,concfc,concfp,concfg,betav
127 real coeffp_dry, coeffp_wet, shear_fac, temp_fac
128 real coef_snow, shear
130 real coefrh,qrh,visrh
131 real rhmax,shear5_cnt, shear8_cnt
132 real shear5_cnt_lowvis, shear8_cnt_lowvis
133 real shear4_cnt, shear4_cnt_lowvis
134 integer night_cnt, lowsun_cnt
136 real visrh10_cnt, vis1km_cnt, visrh_lower
139 real vis_min, visrh_min
140 real vis_night, zen_fac
162 shear4_cnt_lowvis = 0
163 shear5_cnt_lowvis = 0
164 shear8_cnt_lowvis = 0
222 if(t(i,j,lm)<spval .and. u(i,j,lm)<spval .and. v(i,j,lm)<spval &
223 .and. pmid(i,j,lm)<spval)
then
233 if(qqw(i,j,ll)<spval)qclw = max(qclw, qqw(i,j,ll) )
234 if(qqi(i,j,ll)<spval)qclice = max(qclice, qqi(i,j,ll) )
235 if(qqs(i,j,ll)<spval)qsnow = max(qsnow, qqs(i,j,ll) )
236 if(qqr(i,j,ll)<spval)qrain = max(qrain, qqr(i,j,ll) )
237 if(qqg(i,j,ll)<spval)qgraupel = max(qgraupel, qqg(i,j,ll) )
241 pol = 0.99999683 + tx*(-0.90826951e-02 + &
242 tx*(0.78736169e-04 + tx*(-0.61117958e-06 + &
243 tx*(0.43884187e-08 + tx*(-0.29883885e-10 + &
244 tx*(0.21874425e-12 + tx*(-0.17892321e-14 + &
245 tx*(0.11112018e-16 + tx*(-0.30994571e-19)))))))))
246 if(abs(pol) > 0.)
THEN
250 e = pmid(i,j,ll)/100.*q(i,j,ll)/(0.62197+q(i,j,ll)*0.37803)
251 rhb(i,j,ll) = 100.*amin1(1.,e/es)
257 rhmax = max(rhb(i,j,lm),rhb(i,j,lm-1))
258 qrh = max(0.0,min(0.8,(rhmax/100.-0.15)))
262 visrh = 90. * exp(-2.5*qrh)
270 shear = sqrt( (u(i,j,lm-3)-u(i,j,lm))**2 &
271 +(v(i,j,lm-3)-v(i,j,lm))**2 )
273 shear_fac = min(1.,max(0.,(shear-4.)/2.) )
274 if (visrh<10.) visrh = visrh + (10.-visrh)* &
277 if (shear>4.) shear4_cnt = shear4_cnt +1
278 if (shear>5.) shear5_cnt = shear5_cnt +1
279 if (shear>6.) shear8_cnt = shear8_cnt +1
281 if (shear>4..and.visrh<10) &
282 shear4_cnt_lowvis = shear4_cnt_lowvis +1
283 if (shear>5..and.visrh<10) &
284 shear5_cnt_lowvis = shear5_cnt_lowvis +1
285 if (shear>6..and.visrh<10) &
286 shear8_cnt_lowvis = shear8_cnt_lowvis +1
288 if (visrh<10.) visrh10_cnt = visrh10_cnt+1
289 if (czen(i,j)<0.) night_cnt = night_cnt + 1
290 if (czen(i,j)<0.1) lowsun_cnt = lowsun_cnt + 1
292 tv=t(i,j,lm)*(h1+d608*q(i,j,lm))
294 rhoair=pmid(i,j,lm)/(rd*tv)
296 vovermd=(1.+q(i,j,lm))/rhoair+(qclw+qrain)/rhowat+ &
298 (qgraupel+qclice+qsnow)/rhoice
299 conclc=qclw/vovermd*1000.
300 conclp=qrain/vovermd*1000.
301 concfc=qclice/vovermd*1000.
302 concfp=qsnow/vovermd*1000.
303 concfg=qgraupel/vovermd*1000.
305 temp_fac = min(1.,max((t(i,j,lm)-271.15),0.) )
307 coef_snow = coeffp_dry*(1.-temp_fac) &
308 + coeffp_wet* temp_fac
310 if (t(i,j,lm)< 270. .and. temp_fac==1.) &
311 write (6,*)
'Problem w/ temp_fac - calvis'
326 if (si(i,j)<spval .and. si(i,j) .ge. 1.0 .and. ustar(i,j) > ustar_t .and. z0(i,j) .le. 0.7)
then
327 z_r = 1.6*(ustar(i,j)**2./(2.*g))
328 q_s = max((0.68/ustar(i,j))*(rhoair/g)*ustar_t*(ustar(i,j)**2.-ustar_t**2.),0.0)
329 c_r = (q_s/u_p)*(lamda*g/ustar(i,j)**2.)*exp(-lamda*z_r*g/ustar(i,j)**2.)
330 c_z = max(c_r * exp(-1.55*((0.05628*ustar(i,j))**-0.544 - z**-0.544)),1e-15)
331 c_alpha = alpha/(alpha+2)
332 rho_sno = sno(i,j)/(si(i,j)/1.0e3)
333 rho_sno = rho_sno*2. + 10.*max(0.,rho_sno-150.0)
334 vis_blsn = (5.217*rho_sno*r_bar**1.011)/(1.82*c_z*c_alpha)
335 betablsn = 3.912/(vis_blsn/1000.0)
354 betav=coeffc*concfc**exponfc &
355 + coef_snow*concfp**exponfp &
356 + coeflc*conclc**exponlc + coeflp*conclp**exponlp &
357 + coeffg*concfg**exponfg +1.e-10
360 if(method == 2 .or. method == 3)
then
361 betav = betav + aextc55(i,j,lm)*1000.
363 betav = betav + betablsn
368 vis(i,j)=min(90.,const1/betav)
370 if (vis(i,j)<vis_min) vis_min = vis(i,j)
371 if (visrh<visrh_min) visrh_min = visrh
373 if (visrh<vis(i,j)) visrh_lower = visrh_lower + 1
378 vis_night = 1.69 * ((vis(i,j)/1.609)**0.86) * 1.609
380 zen_fac = min(0.1,max(czen(i,j),0.))/ 0.1
381 vis(i,j) = zen_fac * vis(i,j) + (1.-zen_fac)*vis_night
383 if(method == 1 .or. method == 3)
then
384 vis(i,j) = min(vis(i,j),visrh)
387 if (vis(i,j)<1.) vis1km_cnt = vis1km_cnt + 1
388 if (vis(i,j)<3.) vis3km_cnt = vis3km_cnt + 1
389 if (vis(i,j)<5.) vis5km_cnt = vis5km_cnt + 1
391 vis(i,j) = vis(i,j) * 1000.