<p><b>laura@ucar.edu</b> 2012-12-18 15:58:14 -0700 (Tue, 18 Dec 2012)</p><p>Added local arrays needed for the parameterization of gravity wave drag over orography. Added local arrays needed for the calculation of dry hydrostatic pressures.<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_interface_nhyd.F
===================================================================
--- branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_interface_nhyd.F        2012-12-18 22:55:22 UTC (rev 2363)
+++ branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_interface_nhyd.F        2012-12-18 22:58:14 UTC (rev 2364)
@@ -55,10 +55,13 @@
  if(.not.allocated(qg_p)   ) allocate(qg_p(ims:ime,kms:kme,jms:jme)   )
 
 !... arrays used for calculating the hydrostatic pressure and exner function:
- if(.not.allocated(psfc_hyd_p) ) allocate(psfc_hyd_p(ims:ime,jms:jme)         )
- if(.not.allocated(pres_hyd_p) ) allocate(pres_hyd_p(ims:ime,kms:kme,jms:jme) )
- if(.not.allocated(pres2_hyd_p)) allocate(pres2_hyd_p(ims:ime,kms:kme,jms:jme))
- if(.not.allocated(znu_hyd_p)  ) allocate(znu_hyd_p(ims:ime,kms:kme,jms:jme)  )
+ if(.not.allocated(psfc_hyd_p)  ) allocate(psfc_hyd_p(ims:ime,jms:jme)          )
+ if(.not.allocated(psfc_hydd_p) ) allocate(psfc_hydd_p(ims:ime,jms:jme)         )
+ if(.not.allocated(pres_hyd_p)  ) allocate(pres_hyd_p(ims:ime,kms:kme,jms:jme)  )
+ if(.not.allocated(pres_hydd_p) ) allocate(pres_hydd_p(ims:ime,kms:kme,jms:jme) )
+ if(.not.allocated(pres2_hyd_p) ) allocate(pres2_hyd_p(ims:ime,kms:kme,jms:jme) )
+ if(.not.allocated(pres2_hydd_p)) allocate(pres2_hydd_p(ims:ime,kms:kme,jms:jme))
+ if(.not.allocated(znu_hyd_p)   ) allocate(znu_hyd_p(ims:ime,kms:kme,jms:jme)   )
  
  end subroutine allocate_forall_physics
 
@@ -97,10 +100,13 @@
  if(allocated(qs_p)    ) deallocate(qs_p    )
  if(allocated(qg_p)    ) deallocate(qg_p    )
 
- if(allocated(psfc_hyd_p) ) deallocate(psfc_hyd_p  )
- if(allocated(pres_hyd_p) ) deallocate(pres_hyd_p  )
- if(allocated(pres2_hyd_p)) deallocate(pres2_hyd_p )
- if(allocated(znu_hyd_p)  ) deallocate(znu_hyd_p   )
+ if(allocated(psfc_hyd_p)  ) deallocate(psfc_hyd_p  )
+ if(allocated(psfc_hydd_p) ) deallocate(psfc_hydd_p )
+ if(allocated(pres_hyd_p)  ) deallocate(pres_hyd_p  )
+ if(allocated(pres_hydd_p) ) deallocate(pres_hydd_p )
+ if(allocated(pres2_hyd_p) ) deallocate(pres2_hyd_p )
+ if(allocated(pres2_hydd_p)) deallocate(pres2_hydd_p)
+ if(allocated(znu_hyd_p)   ) deallocate(znu_hyd_p   )
  
  end subroutine deallocate_forall_physics
 
@@ -125,7 +131,7 @@
  real(kind=RKIND),dimension(:,:),pointer:: rho_zz,theta_m,qv,pressure_p,u,v,w
  real(kind=RKIND),dimension(:,:),pointer:: qvs,rh
 
- real(kind=RKIND):: rho1,rho2,tem1,tem2
+ real(kind=RKIND):: rho_a,rho1,rho2,tem1,tem2
 
 !---------------------------------------------------------------------------------------------
 
@@ -294,16 +300,21 @@
  do i = its,ite
     !pressure at w-points:
     k = kte+1
-    pres2_hyd_p(i,k,j) = pres2_p(i,k,j)
+    pres2_hyd_p(i,k,j)  = pres2_p(i,k,j)
+    pres2_hydd_p(i,k,j) = pres2_p(i,k,j)
     do k = kte,1,-1
-       pres2_hyd_p(i,k,j) = pres2_hyd_p(i,k+1,j) + g*rho_p(i,k,j)*dz_p(i,k,j)
+       rho_a = rho_p(i,k,j) / (1.+qv_p(i,k,j))
+       pres2_hyd_p(i,k,j)  = pres2_hyd_p(i,k+1,j)  + g*rho_p(i,k,j)*dz_p(i,k,j)
+       pres2_hydd_p(i,k,j) = pres2_hydd_p(i,k+1,j) + g*rho_a*dz_p(i,k,j)
     enddo
     !pressure at theta-points:
     do k = kte,1,-1
-       pres_hyd_p(i,k,j) = 0.5*(pres2_hyd_p(i,k+1,j)+pres2_hyd_p(i,k,j))
+       pres_hyd_p(i,k,j)  = 0.5*(pres2_hyd_p(i,k+1,j)+pres2_hyd_p(i,k,j))
+       pres_hydd_p(i,k,j) = 0.5*(pres2_hydd_p(i,k+1,j)+pres2_hydd_p(i,k,j))
     enddo
     !surface pressure:
     psfc_hyd_p(i,j) = pres2_hyd_p(i,1,j)
+    psfc_hydd_p(i,j) = pres2_hydd_p(i,1,j)
     !znu:
     do k = kte,1,-1
        znu_hyd_p(i,k,j) = pres_hyd_p(i,k,j) / psfc_hyd_p(i,j) 

Modified: branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_vars.F
===================================================================
--- branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_vars.F        2012-12-18 22:55:22 UTC (rev 2363)
+++ branches/atmos_physics/src/core_atmos_physics/mpas_atmphys_vars.F        2012-12-18 22:58:14 UTC (rev 2364)
@@ -14,6 +14,7 @@
  character(len=StrKIND),public:: microp_scheme
  character(len=StrKIND),public:: conv_deep_scheme
  character(len=StrKIND),public:: conv_shallow_scheme
+ character(len=StrKIND),public:: gwdo_scheme
  character(len=StrKIND),public:: lsm_scheme
  character(len=StrKIND),public:: pbl_scheme
  character(len=StrKIND),public:: radt_cld_scheme
@@ -100,10 +101,13 @@
 
 !... arrays used for calculating the hydrostatic pressure and exner function:
  real(kind=RKIND),dimension(:,:),allocatable:: &amp;
-    psfc_hyd_p         !surface pressure                                                 [hPa]
+    psfc_hyd_p,       &amp;!surface pressure                                                 [hPa]
+    psfc_hydd_p        !&quot;dry&quot; surface pressure                                           [hPa]
  real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
     pres_hyd_p,       &amp;!pressure located at theta levels                                 [hPa]
-    pres2_hyd_p,      &amp;!pressure located at w-velocity levels                            [hPa]     
+    pres_hydd_p,      &amp;!&quot;dry&quot; pressure located at theta levels                           [hPa]
+    pres2_hyd_p,      &amp;!pressure located at w-velocity levels                            [hPa]
+    pres2_hydd_p,     &amp;!&quot;dry&quot; pressure located at w-velocity levels                      [hPa]
     znu_hyd_p          !(pres_hyd_p / P0) needed in the Tiedtke convection scheme        [hPa]
 
 !=============================================================================================
@@ -225,6 +229,30 @@
     kzq_p              !
 
 !=============================================================================================
+!... variables and arrays related to parameterization of gravity wave drag over orography:
+!=============================================================================================
+
+ real(kind=RKIND),dimension(:,:),allocatable:: &amp;
+    var2d_p,          &amp;!orographic variance                                               (m2)
+    con_p,            &amp;!orographic convexity                                              (m2)
+    oa1_p,            &amp;!orographic direction asymmetry function                            (-)
+    oa2_p,            &amp;!orographic direction asymmetry function                            (-)
+    oa3_p,            &amp;!orographic direction asymmetry function                            (-)
+    oa4_p,            &amp;!orographic direction asymmetry function                            (-)
+    ol1_p,            &amp;!orographic direction asymmetry function                            (-)
+    ol2_p,            &amp;!orographic direction asymmetry function                            (-)
+    ol3_p,            &amp;!orographic direction asymmetry function                            (-)
+    ol4_p              !orographic direction asymmetry function                            (-)
+
+ real(kind=RKIND),dimension(:,:),allocatable:: &amp;
+    dusfcg_p,         &amp;!vertically-integrated gwdo u-stress                         (Pa m s-1)
+    dvsfcg_p           !vertically-integrated gwdo v -stress                        (Pa m s-1)
+
+ real(kind=RKIND),dimension(:,:,:),allocatable:: &amp;
+    dtaux3d_p,        &amp;!gravity wave drag over orography u-stress                      (m s-1)
+    dtauy3d_p          !gravity wave drag over orography u-stress                      (m s-1)
+
+!=============================================================================================
 !... variables and arrays related to parameterization of surface layer:
 !=============================================================================================
  real(kind=RKIND),dimension(:,:),allocatable:: &amp;

</font>
</pre>