<p><b>duda</b> 2010-07-16 16:29:29 -0600 (Fri, 16 Jul 2010)</p><p>BRANCH COMMIT<br>
<br>
In CAM_TO_MPAS(), couple theta and scalar tendencies with the h field from the state<br>
that these tendencies were computed from, to be decoupled later in dynamics.<br>
<br>
M    src/driver_cam_interface/module_mpas_cam_interface.F<br>
</p><hr noshade><pre><font color="gray">Modified: branches/mpas_cam_coupling/src/driver_cam_interface/module_mpas_cam_interface.F
===================================================================
--- branches/mpas_cam_coupling/src/driver_cam_interface/module_mpas_cam_interface.F        2010-07-16 15:58:30 UTC (rev 379)
+++ branches/mpas_cam_coupling/src/driver_cam_interface/module_mpas_cam_interface.F        2010-07-16 22:29:29 UTC (rev 380)
@@ -672,6 +672,7 @@
       integer :: iCell, iEdge, iScalar, k, j
       integer, dimension(:), pointer :: nEdgesOnCell
       integer, dimension(:,:), pointer :: edgesOnCell
+      real (kind=RKIND), dimension(:,:), pointer :: h
       real (kind=RKIND), dimension(:,:), pointer :: east, north, edge_normal, pressure
       real (kind=RKIND), dimension(:,:), pointer :: Ux_tend_halo, Uy_tend_halo, theta_tend, u_tend
       real (kind=RKIND), dimension(:,:), pointer :: Ux_phys_tend, Uy_phys_tend
@@ -694,6 +695,7 @@
       u_tend =&gt; block % time_levs(1) % state % u_phys_tend % array
       Ux_phys_tend =&gt; block % time_levs(1) % state % Ux_phys_tend % array
       Uy_phys_tend =&gt; block % time_levs(1) % state % Uy_phys_tend % array
+      h =&gt; block % time_levs(1) % state % h % array
 
       !
       !  Perform basic sanity check on expected and available field dimensions
@@ -759,6 +761,9 @@
       do iCell=1,block % mesh % nCellsSolve
          do k=1,block % mesh % nVertLevels
             theta_tend(k,iCell) = T_tend(iCell,k) * (p0 / (0.5*(pressure(k,iCell)+pressure(k+1,iCell)))) ** (rgas/cp)
+            
+            ! Couple theta tendency with h valid at time when tendency was computed
+            theta_tend(k,iCell) = theta_tend(k,iCell) * h(k,iCell) 
 
             !
             ! NOTE: Once we begin to use more than just qv in MPAS, we need to make sure to
@@ -766,6 +771,9 @@
             !
             do iScalar=1,num_scalars
                scalars_tend(iScalar,k,iCell) = (Tracer(iCell,k,iScalar) - scalars(iScalar,k,iCell)) / dt_physics
+
+               ! Couple scalar tendencies with h valid at time when tendencies were computed
+               scalars_tend(iScalar,k,iCell) = scalars_tend(iScalar,k,iCell) * h(k,iCell) 
             end do
          end do
       end do

</font>
</pre>