<p><b>laura@ucar.edu</b> 2012-01-23 15:21:15 -0700 (Mon, 23 Jan 2012)</p><p>updated sourcecode to WRF version 3.3.1<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_atmos_physics/physics_wrf/module_bl_ysu.F
===================================================================
--- branches/atmos_physics/src/core_atmos_physics/physics_wrf/module_bl_ysu.F        2012-01-23 18:21:38 UTC (rev 1410)
+++ branches/atmos_physics/src/core_atmos_physics/physics_wrf/module_bl_ysu.F        2012-01-23 22:21:15 UTC (rev 1411)
@@ -307,7 +307,7 @@
 !              pressure-level diffusion, april 2009
 !               ==&gt; negligible differences
 !              implicit forcing for momentum with clean up, july 2009
-!               ==&gt; prevents model blownup when sfc layer is too low
+!               ==&gt; prevents model blowup when sfc layer is too low
 !              increase of lamda, 30 &lt; 0.1 x del z &lt; 300, feb 2010
 !               ==&gt; prevents model blowup when delz is extremely large
 !              revised prandtl number at surface, peggy lemone, feb 2010
@@ -471,7 +471,8 @@
                                                                 ufxpbl,vfxpbl, &amp;
                                                                   delta,dthvx
    real    ::  prnumfac,bfx0,hfx0,qfx0,delb,dux,dvx,                           &amp;
-               dsdzu,dsdzv,wm3,dthx,dqx,wspd10,ross,tem1,dsig,tvcon,conpr,prfac
+               dsdzu,dsdzv,wm3,dthx,dqx,wspd10,ross,tem1,dsig,tvcon,conpr,     &amp;
+               prfac,phim8z
 !
 !----------------------------------------------------------------------
 !
@@ -678,7 +679,8 @@
        hgamt(i) = min(gamfac*hfx(i)/cp,gamcrt)
        hgamq(i) = min(gamfac*qfx(i),gamcrq)
        vpert = (hgamt(i)+ep1*thx(i,1)*hgamq(i))/bfac*afac
-       thermal(i) = thermal(i)+max(vpert,0.)
+! thermal perturbation limited in surface layer (from H. Shin, May 2011)
+       thermal(i) = thermal(i)+max(vpert,0.)*min(za(i,1)/(sfcfrac*hpbl(i)),1.0)
        hgamt(i) = max(hgamt(i),0.0)
        hgamq(i) = max(hgamq(i),0.0)
        brint    = -15.9*ust(i)*ust(i)/wspd(i)*wstar3(i)/(wscale(i)**4.)
@@ -846,17 +848,20 @@
          zfac(i,k) = min(max((1.-(zq(i,k+1)-zl1(i))/(hpbl(i)-zl1(i))),zfmin),1.)
          xkzo = ckz*dza(i,k+1)
          zfacent(i,k) = (1.-zfac(i,k))**3.
+         wscalek(i,k) = (ust3(i)+phifac*karman*wstar3(i)*(1.-zfac(i,k)))**h1
          if(sfcflg(i)) then 
-           prfac = conpr/phim(i)/(1.+4.*karman*wstar3(i)/ust3(i))
+           prfac = conpr/phim(i)/((1.+4.*karman*wstar3(i)/ust3(i)))**h1
            prnumfac = -3.*(max(zq(i,k+1)-sfcfrac*hpbl(i),0.))**2./hpbl(i)**2.
          else
            prfac = 0.
            prnumfac = 0.
+           phim8z = 1.+(phim(i)-1.)*zq(i,k+1)/sfcfrac/hpbl(i)
+           wscalek(i,k) = ust(i)/phim8z
+           wscalek(i,k) = max(wscalek(i,k),ust(i)/aphi5)
          endif
          prnum0 = (phih(i)/phim(i)+prfac)
          prnum0 = min(prnum0,prmax)
          prnum0 = max(prnum0,prmin)
-         wscalek(i,k) = (ust3(i)+phifac*karman*wstar3(i)*(1.-zfac(i,k)))**h1
          xkzm(i,k) = xkzo+wscalek(i,k)*karman*zq(i,k+1)*zfac(i,k)**pfac
          prnum =  1. + (prnum0-1.)*exp(prnumfac)
          xkzq(i,k) = xkzm(i,k)/prnum*zfac(i,k)**(pfac_q-pfac)

</font>
</pre>