<p><b>laura@ucar.edu</b> 2012-08-06 09:32:18 -0600 (Mon, 06 Aug 2012)</p><p>added the variables kzh,kzq,and kzm as additional diagnostic outputs for debuggging the PBL scheme. Increased the asymptotic length scale rlam from 30m to 150m to avoid the YSU PBL scheme to crash over elevated terrain due to irrealistically strong mixing in the free troposphere near cloud-tops. This  increased value of rlam was recommended by Pr. Hong until the parameterization of gravity wave drag over orography is implemented.<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-08-06 15:12:54 UTC (rev 2085)
+++ branches/atmos_physics/src/core_atmos_physics/physics_wrf/module_bl_ysu.F        2012-08-06 15:32:18 UTC (rev 2086)
@@ -26,6 +26,8 @@
                   ids,ide, jds,jde, kds,kde,                                   &amp;
                   ims,ime, jms,jme, kms,kme,                                   &amp;
                   its,ite, jts,jte, kts,kte,                                   &amp;
+                !MPAS specific optional argument:
+                  rho,kzhout,kzmout,kzqout,                                    &amp;
                 !optional
                   regime                                           )
 !-------------------------------------------------------------------
@@ -193,6 +195,22 @@
                                                                         dvsfc, &amp;
                                                                         dtsfc, &amp;
                                                                         dqsfc
+
+!MPAS specific for debugging (Laura D. Fowler):
+   real,intent(in) ,dimension(ims:ime,kms:kme,jms:jme),optional:: rho
+   real,intent(out),dimension(ims:ime,kms:kme,jms:jme),optional:: kzhout,kzmout,kzqout
+   real:: rho_d
+   do j = jts,jte
+   do k = kts,kte
+   do i = its,ite
+      kzhout(i,k,j) = 0.
+      kzmout(i,k,j) = 0.
+      kzqout(i,k,j) = 0.
+   enddo
+   enddo
+   enddo
+!MPAS specific end.
+
 !
    qv2d(:,:) = 0.0
    do j = jts,jte
@@ -204,6 +222,26 @@
              pdhi(i,k) = mut(i,j)*znw(k) + p_top
           enddo
         enddo
+      elseif(present(rho)) then
+  203 format(1x,i4,1x,i2,10(1x,e15.8))
+!For MPAS, we replace the hydrostatic pressures defined at theta and w points by
+!the dry hydrostatic pressures (Laura D. Fowler):
+        k = kte+1
+        do i = its,ite
+           pdhi(i,k) = p3di(i,k,j)
+        enddo
+        do k = kte,kts,-1
+        do i = its,ite
+           rho_d = rho(i,k,j) / (1. + qv3d(i,k,j))
+           if(k.le.kte) pdhi(i,k) = pdhi(i,k+1) + g*rho_d*dz8w(i,k,j)
+        enddo
+        enddo
+        do k = kts,kte
+        do i = its,ite
+           pdh(i,k) = 0.5*(pdhi(i,k) + pdhi(i,k+1))
+        enddo
+        enddo
+!MPAS specific end.
       else
         do k = kts,kte+1
           do i = its,ite
@@ -242,6 +280,9 @@
               ,exch_hx=exch_h(ims,kms,j)                                       &amp;
               ,u10=u10(ims,j),v10=v10(ims,j)                                   &amp;
               ,gz1oz0=gz1oz0(ims,j)                                            &amp;
+              ,kzh=kzhout(ims,kms,j)                                           &amp; 
+              ,kzm=kzmout(ims,kms,j)                                           &amp;
+              ,kzq=kzqout(ims,kms,j)                                           &amp;
               ,ids=ids,ide=ide, jds=jds,jde=jde, kds=kds,kde=kde               &amp;
               ,ims=ims,ime=ime, jms=jms,jme=jme, kms=kms,kme=kme               &amp;
               ,its=its,ite=ite, jts=jts,jte=jte, kts=kts,kte=kte   )
@@ -275,6 +316,7 @@
                   ims,ime, jms,jme, kms,kme,                                   &amp;
                   its,ite, jts,jte, kts,kte,                                   &amp;
                 !optional
+                  kzh,kzm,kzq,                                                 &amp;
                   regime                                           )
 !-------------------------------------------------------------------
    implicit none
@@ -324,7 +366,8 @@
 !-------------------------------------------------------------------
 !
    real,parameter    ::  xkzmin = 0.01,xkzmax = 1000.,rimin = -100.
-   real,parameter    ::  rlam = 30.,prmin = 0.25,prmax = 4.
+   real,parameter    ::  rlam = 150.,prmin = 0.25,prmax = 4.
+!  real,parameter    ::  rlam = 30.,prmin = 0.25,prmax = 4.
    real,parameter    ::  brcr_ub = 0.0,brcr_sb = 0.25,cori = 1.e-4
    real,parameter    ::  afac = 6.8,bfac = 6.8,pfac = 2.0,pfac_q = 2.0
    real,parameter    ::  phifac = 8.,sfcfrac = 0.1
@@ -473,6 +516,9 @@
    real    ::  prnumfac,bfx0,hfx0,qfx0,delb,dux,dvx,                           &amp;
                dsdzu,dsdzv,wm3,dthx,dqx,wspd10,ross,tem1,dsig,tvcon,conpr,prfac
 !
+!ldf:
+   real,intent(out),dimension(ims:ime,kms:kme),optional::kzh,kzm,kzq
+
 !----------------------------------------------------------------------
 !
    klpbl = kte
@@ -1198,6 +1244,18 @@
      kpbl1d(i) = kpbl(i)
    enddo
 !
+!MPAS specific (Laura D. Fowler)::
+   if(present(kzh) .and. present(kzm) .and. present(kzq)) then
+      do i = its,ite
+      do k = kts,kte
+         kzh(i,k) = xkzh(i,k)
+         kzm(i,k) = xkzm(i,k)
+         kzq(i,k) = xkzq(i,k)
+      enddo
+      enddo
+   endif
+!MPAS specific end.
+
    end subroutine ysu2d
 !
    subroutine tridi1n(cl,cm,cu,r1,r2,au,f1,f2,its,ite,kts,kte,nt)

</font>
</pre>