<p><b>laura@ucar.edu</b> 2010-11-18 16:04:38 -0700 (Thu, 18 Nov 2010)</p><p>added calculation of surface pressure. added call to add the physics tendencies to the dynamics tendencies<br>
</p><hr noshade><pre><font color="gray">Modified: branches/atmos_physics/src/core_nhyd_atmos/module_time_integration.F
===================================================================
--- branches/atmos_physics/src/core_nhyd_atmos/module_time_integration.F        2010-11-18 22:59:27 UTC (rev 626)
+++ branches/atmos_physics/src/core_nhyd_atmos/module_time_integration.F        2010-11-18 23:04:38 UTC (rev 627)
@@ -146,6 +146,11 @@
                                           block % mesh % nVertLevels+1, block % mesh % nCells,  &amp;
                                           block % parinfo % CellsToSend, block % parinfo % CellsToRecv)
 
+!surface_pressure
+         call dmpar_exch_halo_field1dReal(domain % dminfo, block % diag % surface_pressure % array(:), &amp;
+                                          block % mesh % nEdges, block % parinfo % edgesToSend,    &amp; 
+                                          block % parinfo % edgesToRecv)
+
          block =&gt; block % next
       end do
 
@@ -197,16 +202,16 @@
         if (debug) write(0,*) ' finished compute_dyn_tend '
 
 
-!#ifdef DO_PHYSICS
-!       if (debug) write(0,*) ' add physics tendencies '
-!       block =&gt; domain % blocklist
-!       do while (associated(block))
-!          call physics_addtend( block % tend, block % state % time_levs(2) % state, &amp;
-!                                block % state % time_levs(2) % state % rho % array(:,:), block % mesh )
-!          block =&gt; block % next
-!       end do
-!       if (debug) write(0,*) ' finished add physics tendencies '
-!#endif
+#ifdef DO_PHYSICS
+        if (debug) write(0,*) ' add physics tendencies '
+        block =&gt; domain % blocklist
+        do while (associated(block))
+           call physics_addtend( block % mesh , block % tend, block % tend_physics , &amp;
+                                 block % state % time_levs(2) % state % rho % array(:,:) )
+           block =&gt; block % next
+        end do
+        if (debug) write(0,*) ' finished add physics tendencies '
+#endif
 
 !***********************************
 !  we will need to communicate the momentum tendencies here - we want tendencies for all edges of owned cells
@@ -413,7 +418,8 @@
 
          !call microphysics schemes:
          if(config_microp_scheme .ne. 'off') &amp;
-            call microphysics_driver ( block % state % time_levs(2) % state, block % diag, block % tend, block % mesh, itimestep )
+            call microphysics_driver ( block % state % time_levs(2) % state, block % diag, block % diag_physics, &amp;
+                                       block % tend, block % mesh, itimestep )
 
          block =&gt; block % next
       end do
@@ -976,8 +982,8 @@
                                                     rtheta_p_save, rt_diabatic_tend, rho_p, rho_p_save, &amp;
                                                     rho_pp, rho, rho_base, ruAvg, ru_save, ru_p, u, ru, &amp;
                                                     exner, exner_base, rtheta_base, pressure_p,         &amp;
-                                                    zz, theta
-      real (kind=RKIND), dimension(:), pointer :: fzm, fzp, dvEdge, AreaCell
+                                                    zz, theta, pressure_b, qvapor
+      real (kind=RKIND), dimension(:), pointer :: fzm, fzp, dvEdge, AreaCell, rdzw, surface_pressure
       real (kind=RKIND), dimension(:,:,:), pointer :: zb, zb3 
       integer, dimension(:,:), pointer :: cellsOnEdge
 
@@ -1002,6 +1008,7 @@
        rtheta_base =&gt; diag % rtheta_base % array
        rt_diabatic_tend =&gt; tend % rt_diabatic_tend % array
        theta =&gt; s % theta % array
+       qvapor =&gt; s % scalars % array(s%index_qv,:,:)
 
        rho =&gt; s % rho % array
        rho_p =&gt; diag % rho_p % array
@@ -1019,7 +1026,10 @@
        exner_base =&gt; diag % exner_base % array
 
        pressure_p =&gt; diag % pressure_p % array
+       pressure_b =&gt; diag % pressure_base % array
+       surface_pressure =&gt; diag % surface_pressure % array
 
+       rdzw =&gt; grid % rdzw % array
        zz =&gt; grid % zz % array
        zb =&gt; grid % zb % array
        zb3 =&gt; grid % zb3 % array
@@ -1117,6 +1127,13 @@
 
 !        end if
 
+         !calculation of the surface pressure:
+         surface_pressure(iCell) = 0.5*gravity/rdzw(1)                                              &amp;
+                       * (1.25*(rtheta_p(1,iCell) + rtheta_base(1,iCell)) * (1. + qvapor(1,iCell))  &amp;
+                       -  0.25*(rtheta_p(2,iCell) + rtheta_base(2,iCell)) * (1. + qvapor(2,iCell)))
+         surface_pressure(iCell) = surface_pressure(iCell) + pressure_p(1,iCell) + pressure_b(1,iCell)
+
+
       end do
 
       ! recover time-averaged ruAvg on all edges of owned cells (for upcoming scalar transport).  

</font>
</pre>